You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
4183 lines
1.8 MiB
4183 lines
1.8 MiB
!(function(){var dl=Math.pow;(self.webpackChunk=self.webpackChunk||[]).push([[2524],{65030:function(qt,$e,ae){"use strict";ae.d($e,{Z:function(){return Se}});var te=ae(27247),re=ae(11913),X=ae(43079),D=ae(43403),W=ae(92310),y=ae.n(W),L=ae(29301),A=ae(76846),s=ae(96452),x=ae(6089),c=ae(80402),u=ae(34280),f=ae(49658),i=ae(59301),o=ae(32855),d=ae(77900),m=ae(8654);function _(ge){var Re=ge.prefixCls,ve=ge.align,Le=ge.arrow,Fe=ge.arrowPos,me=Le||{},oe=me.className,ie=me.content,fe=Fe.x,ye=fe===void 0?0:fe,he=Fe.y,Te=he===void 0?0:he,Oe=i.useRef();if(!ve||!ve.points)return null;var Be={position:"absolute"};if(ve.autoArrow!==!1){var Ze=ve.points[0],tt=ve.points[1],dt=Ze[0],nt=Ze[1],At=tt[0],Nt=tt[1];dt===At||!["t","b"].includes(dt)?Be.top=Te:dt==="t"?Be.top=0:Be.bottom=0,nt===Nt||!["l","r"].includes(nt)?Be.left=ye:nt==="l"?Be.left=0:Be.right=0}return i.createElement("div",{ref:Oe,className:y()("".concat(Re,"-arrow"),oe),style:Be},ie)}function h(ge){var Re=ge.prefixCls,ve=ge.open,Le=ge.zIndex,Fe=ge.mask,me=ge.motion;return Fe?i.createElement(d.default,(0,o.Z)({},me,{motionAppear:!0,visible:ve,removeOnLeave:!0}),function(oe){var ie=oe.className;return i.createElement("div",{style:{zIndex:Le},className:y()("".concat(Re,"-mask"),ie)})}):null}var v=i.memo(function(ge){var Re=ge.children;return Re},function(ge,Re){return Re.cache}),r=v,a=i.forwardRef(function(ge,Re){var ve=ge.popup,Le=ge.className,Fe=ge.prefixCls,me=ge.style,oe=ge.target,ie=ge.onVisibleChanged,fe=ge.open,ye=ge.keepDom,he=ge.fresh,Te=ge.onClick,Oe=ge.mask,Be=ge.arrow,Ze=ge.arrowPos,tt=ge.align,dt=ge.motion,nt=ge.maskMotion,At=ge.forceRender,Nt=ge.getPopupContainer,Bt=ge.autoDestroy,st=ge.portal,Ot=ge.zIndex,ur=ge.onMouseEnter,br=ge.onMouseLeave,Qt=ge.onPointerEnter,Fr=ge.onPointerDownCapture,Lt=ge.ready,gt=ge.offsetX,yt=ge.offsetY,ir=ge.offsetR,Jt=ge.offsetB,St=ge.onAlign,it=ge.onPrepare,Rt=ge.stretch,Vt=ge.targetWidth,jt=ge.targetHeight,Yt=typeof ve=="function"?ve():ve,qe=fe||ye,mt=(Nt==null?void 0:Nt.length)>0,Dt=i.useState(!Nt||!mt),Ft=(0,re.Z)(Dt,2),Zt=Ft[0],_t=Ft[1];if((0,u.Z)(function(){!Zt&&mt&&oe&&_t(!0)},[Zt,mt,oe]),!Zt)return null;var G="auto",Y={left:"-1000vw",top:"-1000vh",right:G,bottom:G};if(Lt||!fe){var J,le=tt.points,_e=tt.dynamicInset||((J=tt._experimental)===null||J===void 0?void 0:J.dynamicInset),Ie=_e&&le[0][1]==="r",Ce=_e&&le[0][0]==="b";Ie?(Y.right=ir,Y.left=G):(Y.left=gt,Y.right=G),Ce?(Y.bottom=Jt,Y.top=G):(Y.top=yt,Y.bottom=G)}var Xe={};return Rt&&(Rt.includes("height")&&jt?Xe.height=jt:Rt.includes("minHeight")&&jt&&(Xe.minHeight=jt),Rt.includes("width")&&Vt?Xe.width=Vt:Rt.includes("minWidth")&&Vt&&(Xe.minWidth=Vt)),fe||(Xe.pointerEvents="none"),i.createElement(st,{open:At||qe,getContainer:Nt&&function(){return Nt(oe)},autoDestroy:Bt},i.createElement(h,{prefixCls:Fe,open:fe,zIndex:Ot,mask:Oe,motion:nt}),i.createElement(L.Z,{onResize:St,disabled:!fe},function(Je){return i.createElement(d.default,(0,o.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:At,leavedClassName:"".concat(Fe,"-hidden")},dt,{onAppearPrepare:it,onEnterPrepare:it,visible:fe,onVisibleChanged:function(Ht){var Pe;dt==null||(Pe=dt.onVisibleChanged)===null||Pe===void 0||Pe.call(dt,Ht),ie(Ht)}}),function(bt,Ht){var Pe=bt.className,be=bt.style,ut=y()(Fe,Pe,Le);return i.createElement("div",{ref:(0,m.sQ)(Je,Re,Ht),className:ut,style:(0,te.Z)((0,te.Z)((0,te.Z)((0,te.Z)({"--arrow-x":"".concat(Ze.x||0,"px"),"--arrow-y":"".concat(Ze.y||0,"px")},Y),Xe),be),{},{boxSizing:"border-box",zIndex:Ot},me),onMouseEnter:ur,onMouseLeave:br,onPointerEnter:Qt,onClick:Te,onPointerDownCapture:Fr},Be&&i.createElement(_,{prefixCls:Fe,arrow:Be,arrowPos:Ze,align:tt}),i.createElement(r,{cache:!fe&&!he},Yt))})}))}),p=a,E=i.forwardRef(function(ge,Re){var ve=ge.children,Le=ge.getTriggerDOMNode,Fe=(0,m.Yr)(ve),me=i.useCallback(function(ie){(0,m.mH)(Re,Le?Le(ie):ie)},[Le]),oe=(0,m.x1)(me,(0,m.C4)(ve));return Fe?i.cloneElement(ve,{ref:oe}):ve}),S=E,w=i.createContext(null),R=w;function O(ge){return ge?Array.isArray(ge)?ge:[ge]:[]}function z(ge,Re,ve,Le){return i.useMemo(function(){var Fe=O(ve!=null?ve:Re),me=O(Le!=null?Le:Re),oe=new Set(Fe),ie=new Set(me);return ge&&(oe.has("hover")&&(oe.delete("hover"),oe.add("click")),ie.has("hover")&&(ie.delete("hover"),ie.add("click"))),[oe,ie]},[ge,Re,ve,Le])}var N=ae(29194);function P(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],ve=arguments.length>2?arguments[2]:void 0;return ve?ge[0]===Re[0]:ge[0]===Re[0]&&ge[1]===Re[1]}function F(ge,Re,ve,Le){for(var Fe=ve.points,me=Object.keys(ge),oe=0;oe<me.length;oe+=1){var ie,fe=me[oe];if(P((ie=ge[fe])===null||ie===void 0?void 0:ie.points,Fe,Le))return"".concat(Re,"-placement-").concat(fe)}return""}function K(ge,Re,ve,Le){return Re||(ve?{motionName:"".concat(ge,"-").concat(ve)}:Le?{motionName:Le}:null)}function B(ge){return ge.ownerDocument.defaultView}function V(ge){for(var Re=[],ve=ge==null?void 0:ge.parentElement,Le=["hidden","scroll","clip","auto"];ve;){var Fe=B(ve).getComputedStyle(ve),me=Fe.overflowX,oe=Fe.overflowY,ie=Fe.overflow;[me,oe,ie].some(function(fe){return Le.includes(fe)})&&Re.push(ve),ve=ve.parentElement}return Re}function C(ge){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(ge)?Re:ge}function M(ge){return C(parseFloat(ge),0)}function H(ge,Re){var ve=(0,te.Z)({},ge);return(Re||[]).forEach(function(Le){if(!(Le instanceof HTMLBodyElement||Le instanceof HTMLHtmlElement)){var Fe=B(Le).getComputedStyle(Le),me=Fe.overflow,oe=Fe.overflowClipMargin,ie=Fe.borderTopWidth,fe=Fe.borderBottomWidth,ye=Fe.borderLeftWidth,he=Fe.borderRightWidth,Te=Le.getBoundingClientRect(),Oe=Le.offsetHeight,Be=Le.clientHeight,Ze=Le.offsetWidth,tt=Le.clientWidth,dt=M(ie),nt=M(fe),At=M(ye),Nt=M(he),Bt=C(Math.round(Te.width/Ze*1e3)/1e3),st=C(Math.round(Te.height/Oe*1e3)/1e3),Ot=(Ze-tt-At-Nt)*Bt,ur=(Oe-Be-dt-nt)*st,br=dt*st,Qt=nt*st,Fr=At*Bt,Lt=Nt*Bt,gt=0,yt=0;if(me==="clip"){var ir=M(oe);gt=ir*Bt,yt=ir*st}var Jt=Te.x+Fr-gt,St=Te.y+br-yt,it=Jt+Te.width+2*gt-Fr-Lt-Ot,Rt=St+Te.height+2*yt-br-Qt-ur;ve.left=Math.max(ve.left,Jt),ve.top=Math.max(ve.top,St),ve.right=Math.min(ve.right,it),ve.bottom=Math.min(ve.bottom,Rt)}}),ve}function $(ge){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,ve="".concat(Re),Le=ve.match(/^(.*)\%$/);return Le?ge*(parseFloat(Le[1])/100):parseFloat(ve)}function q(ge,Re){var ve=Re||[],Le=(0,re.Z)(ve,2),Fe=Le[0],me=Le[1];return[$(ge.width,Fe),$(ge.height,me)]}function se(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[ge[0],ge[1]]}function ue(ge,Re){var ve=Re[0],Le=Re[1],Fe,me;return ve==="t"?me=ge.y:ve==="b"?me=ge.y+ge.height:me=ge.y+ge.height/2,Le==="l"?Fe=ge.x:Le==="r"?Fe=ge.x+ge.width:Fe=ge.x+ge.width/2,{x:Fe,y:me}}function pe(ge,Re){var ve={t:"b",b:"t",l:"r",r:"l"};return ge.map(function(Le,Fe){return Fe===Re?ve[Le]||"c":Le}).join("")}function xe(ge,Re,ve,Le,Fe,me,oe){var ie=i.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Fe[Le]||{}}),fe=(0,re.Z)(ie,2),ye=fe[0],he=fe[1],Te=i.useRef(0),Oe=i.useMemo(function(){return Re?V(Re):[]},[Re]),Be=i.useRef({}),Ze=function(){Be.current={}};ge||Ze();var tt=(0,x.Z)(function(){if(Re&&ve&&ge){let tn=function(An,xr){var kr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ht,Or=qe.x+An,Nr=qe.y+xr,Br=Or+Ce,Yr=Nr+Ie,Wn=Math.max(Or,kr.left),or=Math.max(Nr,kr.top),Ar=Math.min(Br,kr.right),jr=Math.min(Yr,kr.bottom);return Math.max(0,(Ar-Wn)*(jr-or))},mn=function(){Gr=qe.y+cr,un=Gr+Ie,Jr=qe.x+nr,gr=Jr+Ce};var At,Nt,Bt,st,Ot=Re,ur=Ot.ownerDocument,br=B(Ot),Qt=br.getComputedStyle(Ot),Fr=Qt.position,Lt=Ot.style.left,gt=Ot.style.top,yt=Ot.style.right,ir=Ot.style.bottom,Jt=Ot.style.overflow,St=(0,te.Z)((0,te.Z)({},Fe[Le]),me),it=ur.createElement("div");(At=Ot.parentElement)===null||At===void 0||At.appendChild(it),it.style.left="".concat(Ot.offsetLeft,"px"),it.style.top="".concat(Ot.offsetTop,"px"),it.style.position=Fr,it.style.height="".concat(Ot.offsetHeight,"px"),it.style.width="".concat(Ot.offsetWidth,"px"),Ot.style.left="0",Ot.style.top="0",Ot.style.right="auto",Ot.style.bottom="auto",Ot.style.overflow="hidden";var Rt;if(Array.isArray(ve))Rt={x:ve[0],y:ve[1],width:0,height:0};else{var Vt,jt,Yt=ve.getBoundingClientRect();Yt.x=(Vt=Yt.x)!==null&&Vt!==void 0?Vt:Yt.left,Yt.y=(jt=Yt.y)!==null&&jt!==void 0?jt:Yt.top,Rt={x:Yt.x,y:Yt.y,width:Yt.width,height:Yt.height}}var qe=Ot.getBoundingClientRect(),mt=br.getComputedStyle(Ot),Dt=mt.height,Ft=mt.width;qe.x=(Nt=qe.x)!==null&&Nt!==void 0?Nt:qe.left,qe.y=(Bt=qe.y)!==null&&Bt!==void 0?Bt:qe.top;var Zt=ur.documentElement,_t=Zt.clientWidth,G=Zt.clientHeight,Y=Zt.scrollWidth,J=Zt.scrollHeight,le=Zt.scrollTop,_e=Zt.scrollLeft,Ie=qe.height,Ce=qe.width,Xe=Rt.height,Je=Rt.width,bt={left:0,top:0,right:_t,bottom:G},Ht={left:-_e,top:-le,right:Y-_e,bottom:J-le},Pe=St.htmlRegion,be="visible",ut="visibleFirst";Pe!=="scroll"&&Pe!==ut&&(Pe=be);var ze=Pe===ut,He=H(Ht,Oe),Qe=H(bt,Oe),ht=Pe===be?Qe:He,pt=ze?Qe:ht;Ot.style.left="auto",Ot.style.top="auto",Ot.style.right="0",Ot.style.bottom="0";var kt=Ot.getBoundingClientRect();Ot.style.left=Lt,Ot.style.top=gt,Ot.style.right=yt,Ot.style.bottom=ir,Ot.style.overflow=Jt,(st=Ot.parentElement)===null||st===void 0||st.removeChild(it);var Tt=C(Math.round(Ce/parseFloat(Ft)*1e3)/1e3),Ut=C(Math.round(Ie/parseFloat(Dt)*1e3)/1e3);if(Tt===0||Ut===0||(0,A.Sh)(ve)&&!(0,N.Z)(ve))return;var ot=St.offset,It=St.targetOffset,ft=q(qe,ot),Ne=(0,re.Z)(ft,2),je=Ne[0],et=Ne[1],Ke=q(Rt,It),Et=(0,re.Z)(Ke,2),wt=Et[0],Pt=Et[1];Rt.x-=wt,Rt.y-=Pt;var zt=St.points||[],er=(0,re.Z)(zt,2),$t=er[0],_r=er[1],Ve=se(_r),Xt=se($t),ar=ue(Rt,Ve),mr=ue(qe,Xt),sr=(0,te.Z)({},St),nr=ar.x-mr.x+je,cr=ar.y-mr.y+et,Mr=tn(nr,cr),Sr=tn(nr,cr,Qe),Er=ue(Rt,["t","l"]),Cr=ue(qe,["t","l"]),vr=ue(Rt,["b","r"]),pr=ue(qe,["b","r"]),Qr=St.overflow||{},zr=Qr.adjustX,Wr=Qr.adjustY,wr=Qr.shiftX,on=Qr.shiftY,Xr=function(xr){return typeof xr=="boolean"?xr:xr>=0},Gr,un,Jr,gr;mn();var Wt=Xr(Wr),Mt=Xt[0]===Ve[0];if(Wt&&Xt[0]==="t"&&(un>pt.bottom||Be.current.bt)){var rr=cr;Mt?rr-=Ie-Xe:rr=Er.y-pr.y-et;var tr=tn(nr,rr),Tr=tn(nr,rr,Qe);tr>Mr||tr===Mr&&(!ze||Tr>=Sr)?(Be.current.bt=!0,cr=rr,et=-et,sr.points=[pe(Xt,0),pe(Ve,0)]):Be.current.bt=!1}if(Wt&&Xt[0]==="b"&&(Gr<pt.top||Be.current.tb)){var Hr=cr;Mt?Hr+=Ie-Xe:Hr=vr.y-Cr.y-et;var qr=tn(nr,Hr),Kr=tn(nr,Hr,Qe);qr>Mr||qr===Mr&&(!ze||Kr>=Sr)?(Be.current.tb=!0,cr=Hr,et=-et,sr.points=[pe(Xt,0),pe(Ve,0)]):Be.current.tb=!1}var rn=Xr(zr),En=Xt[1]===Ve[1];if(rn&&Xt[1]==="l"&&(gr>pt.right||Be.current.rl)){var gn=nr;En?gn-=Ce-Je:gn=Er.x-pr.x-je;var bn=tn(gn,cr),$r=tn(gn,cr,Qe);bn>Mr||bn===Mr&&(!ze||$r>=Sr)?(Be.current.rl=!0,nr=gn,je=-je,sr.points=[pe(Xt,1),pe(Ve,1)]):Be.current.rl=!1}if(rn&&Xt[1]==="r"&&(Jr<pt.left||Be.current.lr)){var Sn=nr;En?Sn+=Ce-Je:Sn=vr.x-Cr.x-je;var _n=tn(Sn,cr),Ln=tn(Sn,cr,Qe);_n>Mr||_n===Mr&&(!ze||Ln>=Sr)?(Be.current.lr=!0,nr=Sn,je=-je,sr.points=[pe(Xt,1),pe(Ve,1)]):Be.current.lr=!1}mn();var ln=wr===!0?0:wr;typeof ln=="number"&&(Jr<Qe.left&&(nr-=Jr-Qe.left-je,Rt.x+Je<Qe.left+ln&&(nr+=Rt.x-Qe.left+Je-ln)),gr>Qe.right&&(nr-=gr-Qe.right-je,Rt.x>Qe.right-ln&&(nr+=Rt.x-Qe.right+ln)));var cn=on===!0?0:on;typeof cn=="number"&&(Gr<Qe.top&&(cr-=Gr-Qe.top-et,Rt.y+Xe<Qe.top+cn&&(cr+=Rt.y-Qe.top+Xe-cn)),un>Qe.bottom&&(cr-=un-Qe.bottom-et,Rt.y>Qe.bottom-cn&&(cr+=Rt.y-Qe.bottom+cn)));var fn=qe.x+nr,Dr=fn+Ce,kn=qe.y+cr,Bn=kn+Ie,wn=Rt.x,Rn=wn+Je,Yn=Rt.y,Un=Yn+Xe,zn=Math.max(fn,wn),Vr=Math.min(Dr,Rn),ci=(zn+Vr)/2,oi=ci-fn,$n=Math.max(kn,Yn),ri=Math.min(Bn,Un),Qn=($n+ri)/2,jn=Qn-kn;oe==null||oe(Re,sr);var Tn=kt.right-qe.x-(nr+qe.width),Mn=kt.bottom-qe.y-(cr+qe.height);Tt===1&&(nr=Math.round(nr),Tn=Math.round(Tn)),Ut===1&&(cr=Math.round(cr),Mn=Math.round(Mn));var On={ready:!0,offsetX:nr/Tt,offsetY:cr/Ut,offsetR:Tn/Tt,offsetB:Mn/Ut,arrowX:oi/Tt,arrowY:jn/Ut,scaleX:Tt,scaleY:Ut,align:sr};he(On)}}),dt=function(){Te.current+=1;var Nt=Te.current;Promise.resolve().then(function(){Te.current===Nt&&tt()})},nt=function(){he(function(Nt){return(0,te.Z)((0,te.Z)({},Nt),{},{ready:!1})})};return(0,u.Z)(nt,[Le]),(0,u.Z)(function(){ge||nt()},[ge]),[ye.ready,ye.offsetX,ye.offsetY,ye.offsetR,ye.offsetB,ye.arrowX,ye.arrowY,ye.scaleX,ye.scaleY,ye.align,dt]}var De=ae(3300);function Ue(ge,Re,ve,Le,Fe){(0,u.Z)(function(){if(ge&&Re&&ve){let Te=function(){Le(),Fe()};var me=Re,oe=ve,ie=V(me),fe=V(oe),ye=B(oe),he=new Set([ye].concat((0,De.Z)(ie),(0,De.Z)(fe)));return he.forEach(function(Oe){Oe.addEventListener("scroll",Te,{passive:!0})}),ye.addEventListener("resize",Te,{passive:!0}),Le(),function(){he.forEach(function(Oe){Oe.removeEventListener("scroll",Te),ye.removeEventListener("resize",Te)})}}},[ge,Re,ve])}var Ge=ae(48736);function Ae(ge,Re,ve,Le,Fe,me,oe,ie){var fe=i.useRef(ge);fe.current=ge;var ye=i.useRef(!1);i.useEffect(function(){if(Re&&Le&&(!Fe||me)){var Te=function(){ye.current=!1},Oe=function(Bt){var st;fe.current&&!oe(((st=Bt.composedPath)===null||st===void 0||(st=st.call(Bt))===null||st===void 0?void 0:st[0])||Bt.target)&&!ye.current&&ie(!1)},Be=B(Le);Be.addEventListener("pointerdown",Te,!0),Be.addEventListener("mousedown",Oe,!0),Be.addEventListener("contextmenu",Oe,!0);var Ze=(0,s.A)(ve);if(Ze&&(Ze.addEventListener("mousedown",Oe,!0),Ze.addEventListener("contextmenu",Oe,!0)),0)var tt,dt,nt,At;return function(){Be.removeEventListener("pointerdown",Te,!0),Be.removeEventListener("mousedown",Oe,!0),Be.removeEventListener("contextmenu",Oe,!0),Ze&&(Ze.removeEventListener("mousedown",Oe,!0),Ze.removeEventListener("contextmenu",Oe,!0))}}},[Re,ve,Le,Fe,me]);function he(){ye.current=!0}return he}var We=["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 we(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:D.Z,Re=i.forwardRef(function(ve,Le){var Fe=ve.prefixCls,me=Fe===void 0?"rc-trigger-popup":Fe,oe=ve.children,ie=ve.action,fe=ie===void 0?"hover":ie,ye=ve.showAction,he=ve.hideAction,Te=ve.popupVisible,Oe=ve.defaultPopupVisible,Be=ve.onPopupVisibleChange,Ze=ve.afterPopupVisibleChange,tt=ve.mouseEnterDelay,dt=ve.mouseLeaveDelay,nt=dt===void 0?.1:dt,At=ve.focusDelay,Nt=ve.blurDelay,Bt=ve.mask,st=ve.maskClosable,Ot=st===void 0?!0:st,ur=ve.getPopupContainer,br=ve.forceRender,Qt=ve.autoDestroy,Fr=ve.destroyPopupOnHide,Lt=ve.popup,gt=ve.popupClassName,yt=ve.popupStyle,ir=ve.popupPlacement,Jt=ve.builtinPlacements,St=Jt===void 0?{}:Jt,it=ve.popupAlign,Rt=ve.zIndex,Vt=ve.stretch,jt=ve.getPopupClassNameFromAlign,Yt=ve.fresh,qe=ve.alignPoint,mt=ve.onPopupClick,Dt=ve.onPopupAlign,Ft=ve.arrow,Zt=ve.popupMotion,_t=ve.maskMotion,G=ve.popupTransitionName,Y=ve.popupAnimation,J=ve.maskTransitionName,le=ve.maskAnimation,_e=ve.className,Ie=ve.getTriggerDOMNode,Ce=(0,X.Z)(ve,We),Xe=Qt||Fr||!1,Je=i.useState(!1),bt=(0,re.Z)(Je,2),Ht=bt[0],Pe=bt[1];(0,u.Z)(function(){Pe((0,f.Z)())},[]);var be=i.useRef({}),ut=i.useContext(R),ze=i.useMemo(function(){return{registerSubPopup:function(Ar,jr){be.current[Ar]=jr,ut==null||ut.registerSubPopup(Ar,jr)}}},[ut]),He=(0,c.Z)(),Qe=i.useState(null),ht=(0,re.Z)(Qe,2),pt=ht[0],kt=ht[1],Tt=i.useRef(null),Ut=(0,x.Z)(function(or){Tt.current=or,(0,A.Sh)(or)&&pt!==or&&kt(or),ut==null||ut.registerSubPopup(He,or)}),ot=i.useState(null),It=(0,re.Z)(ot,2),ft=It[0],Ne=It[1],je=i.useRef(null),et=(0,x.Z)(function(or){(0,A.Sh)(or)&&ft!==or&&(Ne(or),je.current=or)}),Ke=i.Children.only(oe),Et=(Ke==null?void 0:Ke.props)||{},wt={},Pt=(0,x.Z)(function(or){var Ar,jr,pn=ft;return(pn==null?void 0:pn.contains(or))||((Ar=(0,s.A)(pn))===null||Ar===void 0?void 0:Ar.host)===or||or===pn||(pt==null?void 0:pt.contains(or))||((jr=(0,s.A)(pt))===null||jr===void 0?void 0:jr.host)===or||or===pt||Object.values(be.current).some(function(dn){return(dn==null?void 0:dn.contains(or))||or===dn})}),zt=K(me,Zt,Y,G),er=K(me,_t,le,J),$t=i.useState(Oe||!1),_r=(0,re.Z)($t,2),Ve=_r[0],Xt=_r[1],ar=Te!=null?Te:Ve,mr=(0,x.Z)(function(or){Te===void 0&&Xt(or)});(0,u.Z)(function(){Xt(Te||!1)},[Te]);var sr=i.useRef(ar);sr.current=ar;var nr=i.useRef([]);nr.current=[];var cr=(0,x.Z)(function(or){var Ar;mr(or),((Ar=nr.current[nr.current.length-1])!==null&&Ar!==void 0?Ar:ar)!==or&&(nr.current.push(or),Be==null||Be(or))}),Mr=i.useRef(),Sr=function(){clearTimeout(Mr.current)},Er=function(Ar){var jr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Sr(),jr===0?cr(Ar):Mr.current=setTimeout(function(){cr(Ar)},jr*1e3)};i.useEffect(function(){return Sr},[]);var Cr=i.useState(!1),vr=(0,re.Z)(Cr,2),pr=vr[0],Qr=vr[1];(0,u.Z)(function(or){(!or||ar)&&Qr(!0)},[ar]);var zr=i.useState(null),Wr=(0,re.Z)(zr,2),wr=Wr[0],on=Wr[1],Xr=i.useState(null),Gr=(0,re.Z)(Xr,2),un=Gr[0],Jr=Gr[1],gr=function(Ar){Jr([Ar.clientX,Ar.clientY])},Wt=xe(ar,pt,qe&&un!==null?un:ft,ir,St,it,Dt),Mt=(0,re.Z)(Wt,11),rr=Mt[0],tr=Mt[1],Tr=Mt[2],Hr=Mt[3],qr=Mt[4],Kr=Mt[5],rn=Mt[6],En=Mt[7],gn=Mt[8],bn=Mt[9],$r=Mt[10],Sn=z(Ht,fe,ye,he),_n=(0,re.Z)(Sn,2),Ln=_n[0],ln=_n[1],cn=Ln.has("click"),fn=ln.has("click")||ln.has("contextMenu"),Dr=(0,x.Z)(function(){pr||$r()}),kn=function(){sr.current&&qe&&fn&&Er(!1)};Ue(ar,ft,pt,Dr,kn),(0,u.Z)(function(){Dr()},[un,ir]),(0,u.Z)(function(){ar&&!(St!=null&&St[ir])&&Dr()},[JSON.stringify(it)]);var Bn=i.useMemo(function(){var or=F(St,me,bn,qe);return y()(or,jt==null?void 0:jt(bn))},[bn,jt,St,me,qe]);i.useImperativeHandle(Le,function(){return{nativeElement:je.current,popupElement:Tt.current,forceAlign:Dr}});var wn=i.useState(0),Rn=(0,re.Z)(wn,2),Yn=Rn[0],Un=Rn[1],zn=i.useState(0),Vr=(0,re.Z)(zn,2),ci=Vr[0],oi=Vr[1],$n=function(){if(Vt&&ft){var Ar=ft.getBoundingClientRect();Un(Ar.width),oi(Ar.height)}},ri=function(){$n(),Dr()},Qn=function(Ar){Qr(!1),$r(),Ze==null||Ze(Ar)},jn=function(){return new Promise(function(Ar){$n(),on(function(){return Ar})})};(0,u.Z)(function(){wr&&($r(),wr(),on(null))},[wr]);function Tn(or,Ar,jr,pn){wt[or]=function(dn){var hi;pn==null||pn(dn),Er(Ar,jr);for(var Zn=arguments.length,ni=new Array(Zn>1?Zn-1:0),Fn=1;Fn<Zn;Fn++)ni[Fn-1]=arguments[Fn];(hi=Et[or])===null||hi===void 0||hi.call.apply(hi,[Et,dn].concat(ni))}}(cn||fn)&&(wt.onClick=function(or){var Ar;sr.current&&fn?Er(!1):!sr.current&&cn&&(gr(or),Er(!0));for(var jr=arguments.length,pn=new Array(jr>1?jr-1:0),dn=1;dn<jr;dn++)pn[dn-1]=arguments[dn];(Ar=Et.onClick)===null||Ar===void 0||Ar.call.apply(Ar,[Et,or].concat(pn))});var Mn=Ae(ar,fn,ft,pt,Bt,Ot,Pt,Er),On=Ln.has("hover"),tn=ln.has("hover"),mn,An;On&&(Tn("onMouseEnter",!0,tt,function(or){gr(or)}),Tn("onPointerEnter",!0,tt,function(or){gr(or)}),mn=function(Ar){(ar||pr)&&pt!==null&&pt!==void 0&&pt.contains(Ar.target)&&Er(!0,tt)},qe&&(wt.onMouseMove=function(or){var Ar;(Ar=Et.onMouseMove)===null||Ar===void 0||Ar.call(Et,or)})),tn&&(Tn("onMouseLeave",!1,nt),Tn("onPointerLeave",!1,nt),An=function(){Er(!1,nt)}),Ln.has("focus")&&Tn("onFocus",!0,At),ln.has("focus")&&Tn("onBlur",!1,Nt),Ln.has("contextMenu")&&(wt.onContextMenu=function(or){var Ar;sr.current&&ln.has("contextMenu")?Er(!1):(gr(or),Er(!0)),or.preventDefault();for(var jr=arguments.length,pn=new Array(jr>1?jr-1:0),dn=1;dn<jr;dn++)pn[dn-1]=arguments[dn];(Ar=Et.onContextMenu)===null||Ar===void 0||Ar.call.apply(Ar,[Et,or].concat(pn))}),_e&&(wt.className=y()(Et.className,_e));var xr=i.useRef(!1);xr.current||(xr.current=br||ar||pr);var kr=(0,te.Z)((0,te.Z)({},Et),wt),Or={},Nr=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Nr.forEach(function(or){Ce[or]&&(Or[or]=function(){for(var Ar,jr=arguments.length,pn=new Array(jr),dn=0;dn<jr;dn++)pn[dn]=arguments[dn];(Ar=kr[or])===null||Ar===void 0||Ar.call.apply(Ar,[kr].concat(pn)),Ce[or].apply(Ce,pn)})});var Br=i.cloneElement(Ke,(0,te.Z)((0,te.Z)({},kr),Or)),Yr={x:Kr,y:rn},Wn=Ft?(0,te.Z)({},Ft!==!0?Ft:{}):null;return i.createElement(i.Fragment,null,i.createElement(L.Z,{disabled:!ar,ref:et,onResize:ri},i.createElement(S,{getTriggerDOMNode:Ie},Br)),xr.current&&i.createElement(R.Provider,{value:ze},i.createElement(p,{portal:ge,ref:Ut,prefixCls:me,popup:Lt,className:y()(gt,Bn),style:yt,target:ft,onMouseEnter:mn,onMouseLeave:An,onPointerEnter:mn,zIndex:Rt,open:ar,keepDom:pr,fresh:Yt,onClick:mt,onPointerDownCapture:Mn,mask:Bt,motion:zt,maskMotion:er,onVisibleChanged:Qn,onPrepare:jn,forceRender:br,autoDestroy:Xe,getPopupContainer:ur,align:bn,arrow:Wn,arrowPos:Yr,ready:rr,offsetX:tr,offsetY:Tr,offsetR:Hr,offsetB:qr,onAlign:Dr,stretch:Vt,targetWidth:Yn/En,targetHeight:ci/gn})))});return Re}var Se=we(D.Z)},57884:function(qt,$e,ae){"use strict";var te=ae(59301),re=ae(93314),X=ae(99571),D=Object.defineProperty,W=Object.defineProperties,y=Object.getOwnPropertyDescriptors,L=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,x=(i,o,d)=>o in i?D(i,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):i[o]=d,c=(i,o)=>{for(var d in o||(o={}))A.call(o,d)&&x(i,d,o[d]);if(L)for(var d of L(o))s.call(o,d)&&x(i,d,o[d]);return i},u=(i,o)=>W(i,y(o));const f=({img:i,buttonProps:o={},styles:d={},customText:m,ButtonText:_,ButtonClick:h,Buttonclass:v,ButtonTwo:r,imgStyles:a,loading:p=!1,className:E=""})=>te.createElement("section",{className:`tc animated fadeIn ${E}`,style:c({color:"#999",margin:"100px auto",visibility:p?"hidden":"visible"},d)},te.createElement("img",{src:i||re,style:u(c({},a),{pointerEvents:"none",userSelect:"none"})}),te.createElement("p",{className:"mt20 font14"},m||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),_&&te.createElement(X.ZP,c({className:v,onClick:h},o),_),r&&r);$e.Z=f},41550:function(qt,$e,ae){"use strict";ae.d($e,{Z:function(){return v}});var te=ae(59301),re={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},X=ae(99571),D=ae(70557),W=ae(51124),y=ae(25399),L=ae(49661),A=ae(72664),s=ae(57884),x=ae(90524),c=ae(14794),u=ae(59301),f=Object.defineProperty,i=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,m=(r,a,p)=>a in r?f(r,a,{enumerable:!0,configurable:!0,writable:!0,value:p}):r[a]=p,_=(r,a)=>{for(var p in a||(a={}))o.call(a,p)&&m(r,p,a[p]);if(i)for(var p of i(a))d.call(a,p)&&m(r,p,a[p]);return r},h=(r,a,p)=>new Promise((E,S)=>{var w=z=>{try{O(p.next(z))}catch(N){S(N)}},R=z=>{try{O(p.throw(z))}catch(N){S(N)}},O=z=>z.done?E(z.value):Promise.resolve(z.value).then(w,R);O((p=p.apply(r,a)).next())}),v=({editOffice:r="view",data:a,issaver:p,onSaver:E,theme:S,type:w,filename:R,monacoEditor:O,className:z,style:N,close:P,onClose:F,hasMask:K,disabledDownload:B,onImgDimensions:V,showNodata:C,recordInfo:M})=>{const[H,$]=(0,te.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[q,se]=(0,te.useState)(""),[ue,pe]=(0,te.useState)(),xe=window.ENV==="build"?"/react/build":"",De=location.host.startsWith("localhost")?x.Z.PROXY_SERVER:x.Z.API_SERVER,Ge=10*(1024*1024),Ae=(0,te.useRef)();a!=null&&a.startsWith("/api")&&w!=="txt"&&(a=x.Z.API_SERVER+a);const We=ve=>ve.substring(ve.lastIndexOf("/")+1).split(".").pop();R&&O&&(O.filename=R),(0,te.useEffect)(()=>{var ve,Le;const Fe=(Le=(ve=document.cookie)==null?void 0:ve.replace(/\s/g,""))==null?void 0:Le.split(";");Fe==null||Fe.map(me=>{let oe=me.split("=");oe[0]==="_educoder_session"&&se(oe[1])})},[]),(0,te.useEffect)(()=>{w==="office"&&(a.indexOf("bigfilescdn.")>-1||a.indexOf("bigfiles1")>-1?pe({url:a,fileType:We(a),model:a.indexOf("model=edit")?"edit":"view"}):Se())},[w,a]);function we(ve){return h(this,null,function*(){ve.data.type==="pdfdata"&&(E(ve.data.data),window.removeEventListener("message",we,!1)),console.log("mess---:",ve.data)})}const Se=()=>h(void 0,null,function*(){console.log("data:",a);let ve=a;a.startsWith("http")||(ve=location.origin+ve);let Le=new URL(ve).pathname.split("/").pop();const Fe=yield(0,A.gJ)({attachment_id:Le});Fe.url=De+Fe.url,pe(Fe)}),ge=()=>{if(a.startsWith("http")||a.startsWith("blob:")){Re();return}(0,L.Sv)(R||"educoder",a,R)},Re=()=>{M&&(0,c.fc)({id:M==null?void 0:M.id,watch_type:1,course_id:M==null?void 0:M.course_id}),(0,L.Nd)(R||"educoder",decodeURIComponent(a))};return u.createElement("div",{style:_({},N||{}),className:`${K&&re.bgBlack} ${w?re.wrp:"hide"}`},P&&u.createElement("div",{className:re.close,ref:Ae},!!V&&u.createElement(y.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>Ae.current},u.createElement("span",{onClick:()=>{F(),V()}},u.createElement("i",{className:"icon-yulanpizhu"}))),!B&&u.createElement(y.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>Ae.current},u.createElement("span",{onClick:Re},u.createElement("i",{className:"icon-quxiaozhiding"}))),p&&u.createElement(y.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>Ae.current},u.createElement("span",{className:"",onClick:()=>{const ve=document.getElementById("pdfiframe");window.addEventListener("message",we,!1),setTimeout(()=>{ve.contentWindow.postMessage("getData","*")},300)}},u.createElement("i",{className:"icon-baocun"}))),u.createElement(y.Z,{title:"\u5173\u95ED",getPopupContainer:()=>Ae.current},u.createElement("span",{className:"",onClick:()=>{F()}},u.createElement("i",{className:"icon-guanbi1"})))),u.createElement("div",{className:`${re[z]} ${z} ${re.monaco} ${w==="txt"?"show":"hide"}`},w==="txt"&&u.createElement(u.Fragment,null,u.createElement(W.ZP,_({},O)))),w==="audio"&&u.createElement("audio",{src:`${(a==null?void 0:a.indexOf("http://"))>-1||(a==null?void 0:a.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${a}`,autoPlay:!0}),w==="video"&&u.createElement(u.Fragment,null,(a==null?void 0:a.indexOf("http"))>-1?u.createElement("video",{controls:!0,src:`${a}`,autoPlay:!0}):u.createElement("video",{controls:!0,src:`data:video/mp4;base64,${a}`,autoPlay:!0})),w==="office"&&ue&&u.createElement("iframe",{src:`${xe}/office.html?key=${ue.key}&url=${btoa(ue.url)}&callbackUrl=${De+(ue.callbackUrl||"")}&fileType=${ue.fileType}&title=${ue.title||""}&model=${r}&officeServer=${x.Z.ONLYOFFICE}&disabledDownload=${!!B}`}),w==="html"&&u.createElement("iframe",{src:a+"&disposition=inline"}),w==="pdf"&&u.createElement("iframe",{id:"pdfiframe",src:`${xe}/js/pdfview/index.html?filename=${R||"educoder.pdf"}&url=${encodeURIComponent(a)}&disabledDownload=${!!B}&model=${r}`}),w==="image"&&u.createElement("img",{src:`${(a==null?void 0:a.indexOf("http://"))>-1||(a==null?void 0:a.indexOf("https://"))>-1?"":"data:image/png;base64,"}${a}`}),(w==="other"||w==="download")&&u.createElement(u.Fragment,null,C?u.createElement(s.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:u.createElement(X.ZP,{icon:u.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:ge,disabled:B},"\u4E0B\u8F7D")}):u.createElement(X.ZP,{type:"primary",size:"middle",onClick:ge,disabled:B},u.createElement(D.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")),w==="flowChart"&&u.createElement("div",{className:"embed"},u.createElement("iframe",{src:`/drawio/src/main/webapp/viewer.html?id=${a||""}&gapi=0&od=0&db=0&gh=0&gl=0`,width:"100%",height:"100%",frameBorder:"0"})))}},93152:function(qt,$e,ae){"use strict";ae.d($e,{Z:function(){return o}});var te=ae(59301),re=ae(6767),X=ae(75727),D=ae(60513),W=ae(68535),y=ae(34055),L=ae(56102),A=ae(2610),s={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"},x=(d,m,_)=>new Promise((h,v)=>{var r=E=>{try{p(_.next(E))}catch(S){v(S)}},a=E=>{try{p(_.throw(E))}catch(S){v(S)}},p=E=>E.done?h(E.value):Promise.resolve(E.value).then(r,a);p((_=_.apply(d,m)).next())});function c(d){if(isNaN(d))return{minutes:"00",seconds:"00"};const m=new Date(d*1e3).toISOString().substr(11,8);return{hour:m.substr(0,2),minutes:m.substr(3,2),seconds:m.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function u(d,m){return d-m}function f(d){d.sort(u);let m=0;for(let _=0;_<d.length-1;_++){let h=Math.abs(d[_+1]-d[_]);h<21&&(m+=h)}return m}const i=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;var o=(0,te.forwardRef)(({allow_skip:d,src:m,toLog:_,videoId:h,logWatchHistory:v,courseId:r=null,startTime:a,handlePause:p=()=>{},handlePlay:E=()=>{},handlePlayEnded:S=()=>{},autoPlay:w=!1,onPlayEnded:R=()=>{},isShowWaterMark:O=!0},z)=>{var N;m=m==null?void 0:m.replace("http://","https://");const F=((N=m==null?void 0:m.split("."))==null?void 0:N.pop())==="flv",K=(0,te.useRef)(),B=(0,te.useRef)(),V=(0,te.useRef)(),C=(0,te.useRef)(),M=(0,te.useRef)(),H=(0,te.useRef)(),$=(0,te.useRef)(),q=(0,te.useRef)(),se=(0,te.useRef)(),ue=(0,te.useRef)(),pe=(0,te.useRef)(),xe=(0,te.useRef)(),De=(0,te.useRef)(),Ue=(0,te.useRef)(),Ge=navigator.userAgent.toLowerCase().match(i),Ae=Ge?Ge[0]:"pc",We=(0,te.useRef)(!1),we=(0,y.eY)();let Se=0,ge=0,Re=0,ve=null,Le=!1,Fe=20,me=1,oe=!1,ie=!1,fe=[];(0,te.useImperativeHandle)(z,()=>({getLastUpdatedTime:()=>K.current.currentTime,getDuration:()=>K.current.duration})),re.ZP.config({maxCount:1,getContainer:()=>V.current});const ye=(0,te.useCallback)((dt,nt=!1)=>{let At={point:K.current.currentTime};ve?(At.log_id=ve,At.watch_duration=f(fe),At.total_duration=ge):(r?(At.video_id=parseInt(h,10),At.course_id=r):At.video_id=h,At.duration=Se,At.device=Ae),nt&&(At.ed="1");function Nt(){return x(this,null,function*(){oe=!0,ve=yield v==null?void 0:v(At),oe=!1,dt&&dt()})}Nt()},[h,r]);(0,te.useEffect)(()=>{K.current&&(C.current.style.display="none",M.current.style.display="block"),re.ZP.destroy();let dt=null;return D.Z.isSupported&&F&&m&&(m==null?void 0:m.indexOf(".m3u8"))<0?(dt=D.Z.createPlayer({type:"flv",volume:.8,cors:!0,url:m,muted:!1}),K.current&&(dt.attachMediaElement(K.current),dt.load())):K.current.setAttribute("src",m),Te(),()=>{dt&&(dt.unload(),dt.pause(),dt.destroy(),dt=null)}},[K,F,m]);function he(){K.current.paused?(C.current.style.display="none",M.current.style.display="block"):(C.current.style.display="block",M.current.style.display="none")}function Te(){pe.current.style.display="none",De.current.style.display="none",xe.current.style.display="none",K.current.muted||K.current.volume===0?pe.current.style.display="block":K.current.volume>0&&K.current.volume<=.5?De.current.style.display="block":xe.current.style.display="block"}(0,te.useEffect)(()=>{const dt=document.getElementById("play"),nt=document.querySelectorAll(".playback-icons use");function At(){E(),a&&!We.current&&(K.current.currentTime=a),We.current=!0,fe.push(K.current.currentTime),Le||(Le=!0,_&&ye())}function Nt(){return x(this,null,function*(){he(),fe.push(K.current.currentTime),_&&ye(()=>{ve=null,Re=0,Le=!1,oe=!1,ie=!1,fe=[],ge=0,me=1},!0),R()})}function Bt(){H.current.value=Math.round(K.current.currentTime),$.current.value=Math.round(K.current.currentTime)}function st(){const St=c(Math.round(K.current.currentTime));se.current.innerText=`${St.hour>0?St.hour+":":""}${St.minutes}:${St.seconds}`,se.current.setAttribute("datetime",`${St.hour>0?" "+St.hour+" ":""}${St.minutes}m ${St.seconds}s`)}function Ot(){var St,it,Rt,Vt,jt,Yt,qe;const mt=Math.round((St=K.current)==null?void 0:St.duration);(Rt=(it=H.current)==null?void 0:it.setAttribute)==null||Rt.call(it,"max",mt),(jt=(Vt=$.current)==null?void 0:Vt.setAttribute)==null||jt.call(Vt,"max",mt);const Dt=c(mt);q.current&&(q.current.innerText=`${Dt.hour>0?Dt.hour+":":""}${Dt.minutes}:${Dt.seconds}`,(qe=(Yt=q.current).setAttribute)==null||qe.call(Yt,"datetime",`${Dt.hour>0?" "+Dt.hour+" ":""}${Dt.minutes}m ${Dt.seconds}s`))}function ur(){try{const St=Math.round(K.current.duration);H.current.setAttribute("max",St),$.current.setAttribute("max",St);const it=c(St);q.current.innerText=`${it.hour>0?it.hour+":":""}${it.minutes}:${it.seconds}`,q.current.setAttribute("datetime",`${it.hour>0?" "+it.hour+" ":""}${it.minutes}m ${it.seconds}s`),Bt(),st();const{width:Rt,height:Vt,x:jt,y:Yt}=B.current.getBoundingClientRect();if(jt<0||Yt<0,!ie){let qe=K.current.currentTime,mt=qe-Re;Math.abs(mt)<10?(ge+=Math.abs(mt),Re=qe,oe||ge-me*Fe>=0&&(me++,fe.push(Re),_&&ye())):(Re=qe,_&&ye())}}catch(St){console.log("videoplaying:",St)}}function br(){ie=!0}function Qt(){K.current.playing&&fe.push(K.current.currentTime,Re),Re=K.current.currentTime,ie=!1}function Fr(){Se=K.current.duration,Se<=20&&(Fe=Se/3),K.current.addEventListener("play",At)}function Lt(St){St.preventDefault(),(0,A.vp)()?(K.current.style.width="100%",K.current.style.height="100%"):K.current.style.cssText=""}function gt(){p()}function yt(St){if(!d){re.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");return}const it=St.target.dataset.seek?St.target.dataset.seek:St.target.value;K.current.currentTime=it,$.current.value=it,H.current.value=it}function ir(St){const it=Math.round(St.offsetX/St.target.clientWidth*parseInt(St.target.getAttribute("max"),10));H.current.setAttribute("data-seek",it);const Rt=c(it);ue.current.textContent=`${Rt.hour>0?Rt.hour+":":""}${Rt.minutes}:${Rt.seconds}`;const Vt=K.current.getBoundingClientRect();ue.current.style.left=`${St.pageX-Vt.left}px`}function Jt(St){switch(St.code){case"Space":St.preventDefault(),Ze();break;case"ArrowRight":if(St.preventDefault(),!d){re.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(K.current.currentTime>=K.current.duration)break;K.current.currentTime=parseInt(K.current.currentTime)+5,Bt();break;case"ArrowLeft":if(St.preventDefault(),!d){re.ZP.warning("\u8BE5\u89C6\u9891\u7981\u6B62\u5FEB\u8FDB/\u540E\u9000\u64AD\u653E");break}if(K.current.currentTime===0)break;K.current.currentTime=parseInt(K.current.currentTime)-5,Bt();break;case"ArrowUp":St.preventDefault(),K.current.volume<1&&(K.current.volume=(parseInt(K.current.volume*10)+1)/10);break;case"ArrowDown":St.preventDefault(),K.current.volume>0&&(K.current.volume=(parseInt(K.current.volume*10)-1)/10);break}}return V.current.addEventListener((0,A.gH)(),Lt),K.current.addEventListener("canplay",Fr),K.current.addEventListener("ended",Nt),K.current.addEventListener("seeking",br),K.current.addEventListener("seeked",Qt),K.current.addEventListener("loadedmetadata",Ot),H.current.addEventListener("mousemove",ir),H.current.addEventListener("input",yt),K.current.addEventListener("timeupdate",ur),K.current.addEventListener("pause",gt),K.current.addEventListener("volumechange",Te),document.addEventListener("keydown",Jt),()=>{var St,it,Rt,Vt,jt,Yt,qe,mt,Dt,Ft,Zt,_t;(St=K.current)==null||St.removeEventListener("canplay",Fr),(it=K.current)==null||it.removeEventListener("play",At),(Rt=K.current)==null||Rt.removeEventListener("ended",Nt),(Vt=K.current)==null||Vt.removeEventListener("seeking",br),(jt=K.current)==null||jt.removeEventListener("seeked",Qt),(Yt=H.current)==null||Yt.removeEventListener("mousemove",ir),(qe=H.current)==null||qe.removeEventListener("input",yt),(mt=K.current)==null||mt.removeEventListener("timeupdate",ur),(Dt=K.current)==null||Dt.removeEventListener("pause",gt),(Ft=K.current)==null||Ft.removeEventListener("loadedmetadata",Ot),(Zt=K.current)==null||Zt.removeEventListener("volumechange",Te),document.removeEventListener("keydown",Jt),(_t=K.current)!=null&&_t.playing&&(fe.push(Re,K.current.currentTime),_&&ye())}},[K,m]),(0,te.useEffect)(()=>{if(K.current.onended=()=>{S(K)},K.current.oncontextmenu=()=>!1,(m==null?void 0:m.indexOf(".m3u8"))>-1){if(K.current.canPlayType("application/vnd.apple.mpegurl"))K.current.src=m;else if(W.ZP.isSupported()){var dt=new W.ZP;dt.loadSource(m),dt.attachMedia(K.current)}}},[m]);const[Oe,Be]=(0,te.useState)(1),Ze=()=>{K.current.paused||K.current.ended?K.current.play():K.current.pause(),he()};function tt(){K.current.muted=!K.current.muted,K.current.muted?(Ue.current.setAttribute("data-volume",volume.value),Ue.current.value=0):Ue.current.value=Ue.current.dataset.volume}return te.createElement("div",{style:{position:"relative"},ref:V},te.createElement("div",{ref:B,className:`${s.watermark} animated_alternate animate__animated_10s animate__infinite animate__stepstart ${s.animate__loop}`},O&&we?we.login:" "),te.createElement("div",{className:s.container},te.createElement("div",{className:s["video-container"],id:"video-container"},te.createElement("div",{className:s["playback-animation"],id:"playback-animation"},te.createElement("svg",{className:s["playback-icons"]},te.createElement("use",{className:"hidden",href:"#play-icon"}),te.createElement("use",{href:"#pause"}))),te.createElement("video",{className:s.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:K,autoPlay:w}),te.createElement("div",{className:`${s["video-controls"]} `,id:"video-controls"},te.createElement("div",{className:s["bottom-controls"]},te.createElement("div",{className:s["left-controls"]},te.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:Ze},te.createElement("svg",{className:s["playback-icons"]},te.createElement("use",{ref:M,href:"#play-icon"}),te.createElement("use",{ref:C,style:{display:"none"},href:"#pause"}))),te.createElement("div",{className:s.time},te.createElement("time",{id:"time-elapsed",ref:se},"00:00"),te.createElement("span",null," / "),te.createElement("time",{id:"duration",ref:q},"00:00"))),te.createElement("div",{className:s["right-controls"]},d&&te.createElement(X.Z,{placement:"top",overlayClassName:s.rateOverlay,getPopupContainer:dt=>dt.parentNode,menu:{items:[{key:"1",label:te.createElement("span",{onClick:()=>{Be(1),K.current.playbackRate=1}},"1.0x")},{key:"2",label:te.createElement("span",{onClick:()=>{Be(1.5),K.current.playbackRate=1.5}},"1.5x")},{key:"3",label:te.createElement("span",{onClick:()=>{Be(2),K.current.playbackRate=2}},"2.0x")}]}},te.createElement("div",{className:`${s.controlText} mr5`},"\u500D\u901F")),te.createElement(L.CopyToClipboard,{text:m,onCopy:()=>re.ZP.success("\u590D\u5236\u6210\u529F")},te.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},te.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),te.createElement("div",{className:s["volume-controls"]},te.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:s["volume-button"],id:"volume-button",onClick:tt},te.createElement("i",{ref:pe,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),te.createElement("i",{ref:De,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),te.createElement("i",{ref:xe,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),te.createElement("input",{className:s.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:Ue,style:{display:"none"},onClick:Te})),te.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:s["fullscreen-button"],onClick:()=>{(0,A.vp)()?(0,A.BU)():(0,A.Dj)(V.current)}},te.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),te.createElement("div",{className:s["video-progress"]},te.createElement("progress",{ref:$,value:"0",min:"0"}),te.createElement("input",{className:s.seek,ref:H,value:"0",min:"0",type:"range",step:"1"}),te.createElement("div",{className:s["seek-tooltip"],ref:ue,id:"seek-tooltip"},"00:00"))))),te.createElement("svg",{style:{display:"none"}},te.createElement("defs",null,te.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},te.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),te.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},te.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),te.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},te.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"})),te.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},te.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"})),te.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},te.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"})),te.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},te.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"})),te.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},te.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"})),te.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},te.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"})))))})},51124:function(qt,$e,ae){"use strict";ae.d($e,{SV:function(){return Ge},ZP:function(){return Ue}});var te=ae(59301),re=ae(76374);const X={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},D={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},W={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},y={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},L={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join(`
|
|
`)}]};var A=ae(53184),s=ae.n(A),x=(Ae,We,we)=>new Promise((Se,ge)=>{var Re=Fe=>{try{Le(we.next(Fe))}catch(me){ge(me)}},ve=Fe=>{try{Le(we.throw(Fe))}catch(me){ge(me)}},Le=Fe=>Fe.done?Se(Fe.value):Promise.resolve(Fe.value).then(Re,ve);Le((we=we.apply(Ae,We)).next())});const c={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},u=(Ae,We,we,Se)=>{const ge=We.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:we.lineNumber,endColumn:we.column});return Array.from(new Set(ge.match(/\b\w{2,}\b/g)||[])).map(ve=>({label:ve,kind:Ae.languages.CompletionItemKind.Text,insertText:ve,range:Se}))},f=(Ae,We,we,Se)=>{Ae.languages.registerCompletionItemProvider(We,{provideCompletionItems(ge,Re){const ve=ge.getWordUntilPosition(Re),Le={startLineNumber:Re.lineNumber,endLineNumber:Re.lineNumber,startColumn:ve.startColumn,endColumn:ve.endColumn},Fe=ge.getLineContent(Re.lineNumber).substring(ve.startColumn-2,ve.endColumn);return{suggestions:[...u(Ae,ge,Re,Le),...we.map(oe=>({label:oe,kind:Ae.languages.CompletionItemKind.Keyword,documentation:oe,insertText:oe,insertTextRules:Ae.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le})),...Se.map(oe=>({label:oe.label,kind:Ae.languages.CompletionItemKind.Snippet,documentation:oe.content,insertText:Fe.startsWith("#")?oe.content.replace(/#/,""):oe.content,insertTextRules:Ae.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}))]}}})};var i=Ae=>{c.languages.forEach(We=>{Ae.languages.registerDocumentFormattingEditProvider(We,{provideDocumentFormattingEdits(we){return x(this,null,function*(){const Se=s()(we.getValue(),{indent_size:2,indent_char:" ",max_preserve_newlines:2,preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:0,indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1});return[{range:we.getFullModelRange(),text:Se}]})}})}),f(Ae,"java",D.keywords,D.quickKey),f(Ae,"cpp",W.keywords,W.quickKey),f(Ae,"c",X.keywords,[]),f(Ae,"python",y.keywords,y.quickKey),f(Ae,"scala",L.keywords,L.quickKey)};const o="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var d=Object.defineProperty,m=(Ae,We,we)=>We in Ae?d(Ae,We,{enumerable:!0,configurable:!0,writable:!0,value:we}):Ae[We]=we,_=(Ae,We,we)=>m(Ae,typeof We!="symbol"?We+"":We,we);const h=class _l{constructor(We,we,Se){this.placeholder=We,this.editor=we,this.monaco=Se,we.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return _l.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};_(h,"ID","editor.widget.placeholderHint");var r=h,a=ae(96236),p=ae(6767),E=ae(25399),S=ae(89392),w=ae(33796),R=ae(56102),O=Object.defineProperty,z=Object.defineProperties,N=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,B=(Ae,We,we)=>We in Ae?O(Ae,We,{enumerable:!0,configurable:!0,writable:!0,value:we}):Ae[We]=we,V=(Ae,We)=>{for(var we in We||(We={}))F.call(We,we)&&B(Ae,we,We[we]);if(P)for(var we of P(We))K.call(We,we)&&B(Ae,we,We[we]);return Ae},C=(Ae,We)=>z(Ae,N(We)),M=(Ae,We)=>{var we={};for(var Se in Ae)F.call(Ae,Se)&&We.indexOf(Se)<0&&(we[Se]=Ae[Se]);if(Ae!=null&&P)for(var Se of P(Ae))We.indexOf(Se)<0&&K.call(Ae,Se)&&(we[Se]=Ae[Se]);return we},H=(Ae,We,we)=>new Promise((Se,ge)=>{var Re=Fe=>{try{Le(we.next(Fe))}catch(me){ge(me)}},ve=Fe=>{try{Le(we.throw(Fe))}catch(me){ge(me)}},Le=Fe=>Fe.done?Se(Fe.value):Promise.resolve(Fe.value).then(Re,ve);Le((we=we.apply(Ae,We)).next())});function $(Ae){return/^\d+$/.test(Ae)?`${Ae}px`:Ae}function q(){}let se=!1;const ue={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale",solidity:"sol"};function pe(Ae=[]){let We=Ae;if(Array.isArray(Ae)){for(let we=0;we<Ae.length;we++){let Se=ue[Ae[we]];if(Se)return Se}return We[0]}return ue[We]||We}let xe=null;const De=()=>H(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(Ae){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",Ae)}});var Ue=Ae=>{var We=Ae,{width:we="100%",height:Se="100%",value:ge,language:Re="javascript",style:ve={},options:Le={},overrideServices:Fe={},theme:me="vs-dark",onEditBlur:oe,isCopy:ie=!1,onSave:fe,autoHeight:ye=!1,forbidCopy:he=!1,onChange:Te=q,editorDidMount:Oe=q,onFocus:Be=q,onBreakPoint:Ze=q,breakPointValue:tt=[],filename:dt="educoder.txt",errorLine:nt,errorContent:At="",highlightLine:Nt,openBreakPoint:Bt=!1,placeholder:st="",showMiniMap:Ot=!0}=We,ur=M(We,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const br=(0,te.useRef)(),Qt=(0,te.useRef)({}),Fr=(0,te.useRef)(),Lt=(0,te.useRef)(),gt=(0,te.useRef)([]),yt=(0,te.useRef)(!1),ir=(0,te.useRef)(),Jt=(0,te.useRef)(),St=(0,te.useRef)(!1),[it,Rt]=(0,te.useState)(!1);function Vt(){let Ce;return br.current&&(Ce=new re.Z(Xe=>{for(let Je of Xe)(Je.target.offsetHeight>0||Je.target.offsetWidth>0)&&Qt.current.instance.layout()}),Ce.observe(br.current)),Ce}function jt(){p.ZP.warning({content:decodeURIComponent(o),key:"monaco-editor-tip"})}const Yt=()=>{let Ce=Qt.current.instance;if(ge!=null&&Ce&&it){const Xe=Ce.getModel();Xe&&ge!==Xe.getValue()&&(se=!0,Xe.setValue(ge),Ce.layout(),se=!1)}};(0,te.useEffect)(()=>{const Ce=w.Z.subscribe("formatDocument",Xe=>{var Je;let bt=Qt.current.instance;(Je=bt==null?void 0:bt.getAction)==null||Je.call(bt,"editor.action.formatDocument").run()});return window.updateMonacoValue=Xe=>{Te(Xe)},Ce},[]),(0,te.useEffect)(()=>{var Ce;let Xe=Qt.current.instance;Lt.current&&clearTimeout(Lt.current),Lt.current=setTimeout(()=>{Yt()},500),ge&&(ge!=null&&ge.length)&&((Ce=Xe==null?void 0:Xe.updateOptions)==null||Ce.call(Xe,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(ge.split(/\r\n|\r|\n/g).length))+3,5)}))},[ge,it,Qt.current]),(0,te.useEffect)(()=>{if(nt&&Qt.current&&Qt.current.instance){let Xe=Qt.current.instance;Xe.changeViewZones(function(Je){var bt=document.createElement("div");bt.style.padding="10px 20px",bt.style.width="calc(100% - 20px)",bt.className="my-error-line-wrp",bt.innerHTML=At,Je.addZone({afterLineNumber:nt||11,heightInLines:3,domNode:bt})});var Ce={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Xe.addOverlayWidget(Ce),Xe.revealPositionInCenter({lineNumber:20,column:1})}},[nt,Qt.current,it]);const qe=(Ce="",Xe)=>{if(!Ce||Ce.trim()==="")return!0;const bt=Qt.current.instance.getModel().getLineTokens(Xe);let Ht=!1;for(let Pe=0;Pe<2;Pe++)bt.getStandardTokenType(Pe)===1&&(Ht=!0);return Ht};(0,te.useEffect)(()=>{var Ce;const Xe=(Ce=Qt.current)==null?void 0:Ce.instance;if(Xe&&it&&he){const Je=Xe.onDidBlurEditorWidget(()=>{St.current=!1}),bt=Xe.onDidFocusEditorText(()=>{St.current=!0});return()=>{Je.dispose(),bt.dispose()}}},[Qt.current,it,he]),(0,te.useEffect)(()=>{var Ce;if((Ce=Qt.current)!=null&&Ce.instance&&it&&Bt){let Xe=Qt.current.instance,Je=Xe.getModel();if(!Je)return;(()=>{var Tt;let Ut=[],ot=[];const It=Je.getAllDecorations();for(let Ne of It)Ne.options.className==="highlighted-line"&&(Ut.push((Tt=Ne==null?void 0:Ne.range)==null?void 0:Tt.startLineNumber),ot.push(Ne==null?void 0:Ne.id));if(Nt===Ut[0])return;Je.deltaDecorations(ot,[]);const ft=Je.getLineCount();Nt&&Nt<=ft&&(Xe.deltaDecorations([],[{range:new xe.Range(Nt,1,Nt,Je.getLineMaxColumn(Nt)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Xe.revealLineInCenter(Nt))})();const Ht=(Tt=!1)=>{var Ut;let ot=[],It=[];const ft=Je.getAllDecorations();for(let Ne of ft)Ne.options.linesDecorationsClassName==="breakpoints-select"&&(ot.push((Ut=Ne==null?void 0:Ne.range)==null?void 0:Ut.startLineNumber),It.push(Ne==null?void 0:Ne.id));if(Tt)return{lines:ot,ids:It};Ze(ot)},Pe=Tt=>H(void 0,null,function*(){let Ut={range:new xe.Range(Tt,1,Tt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield Je.deltaDecorations([],[Ut]),Ht()}),be=Tt=>H(void 0,null,function*(){let Ut=[];const ot=Xe.getLineDecorations(Tt);for(let It of ot)It.options.linesDecorationsClassName==="breakpoints-select"&&Ut.push(It.id);yield Je.deltaDecorations(Ut,[]),Ht()}),ut=Tt=>{let Ut=Xe.getLineDecorations(Tt);for(let ot of Ut)if(ot.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,S.isEqual)(tt,Ht(!0).lines)){Je.deltaDecorations(Ht(!0).ids,[]);const Tt=tt.map(Ut=>({range:new xe.Range(Ut,1,Ut,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));Je.deltaDecorations([],Tt)}const ze=Xe.onDidChangeModelContent(Tt=>{let Ut=Xe.getPosition();if(Ut){let ot=Ut.lineNumber;clearTimeout(Jt.current),Jt.current=setTimeout(()=>{qe(Je.getLineContent(ot),ot)?be(ot):ut(ot)?(be(ot),Pe(ot)):Ht()},100)}}),He=Xe.onMouseDown(Tt=>{var Ut,ot,It;if(Tt.target.detail&&((It=(ot=(Ut=Tt.target)==null?void 0:Ut.element)==null?void 0:ot.className)!=null&&It.includes("line-numbers"))){let ft=Tt.target.position.lineNumber;if(qe(Je.getLineContent(ft),ft))return;ut(ft)?be(ft):Pe(ft)}}),Qe=Tt=>{let Ut={range:new xe.Range(Tt,1,Tt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};gt.current=Xe.deltaDecorations(gt.current,[Ut])},ht=()=>{gt.current=Xe.deltaDecorations(gt.current,[])},pt=Xe.onMouseMove(Tt=>{var Ut,ot,It;if(ht(),Tt.target.detail&&((It=(ot=(Ut=Tt.target)==null?void 0:Ut.element)==null?void 0:ot.className)!=null&&It.includes("line-numbers"))){let ft=Tt.target.position.lineNumber;if(qe(Je.getLineContent(ft),ft))return;Qe(ft)}}),kt=Xe.onMouseLeave(()=>{ht()});return()=>{ze.dispose(),He.dispose(),pt.dispose(),kt.dispose()}}},[Qt.current,it,tt,Nt,Bt,Re]),(0,te.useEffect)(()=>{var Ce;(Ce=Qt.current)!=null&&Ce.instance&&Bt&&Qt.current.instance.setPosition({lineNumber:0,column:0})},[Nt]);function mt(){let Ce=Qt.current.instance;if(Ce){const Xe=Ce.getSelection(),Je=Qt.current.pastePos||{},bt=new xe.Range(Je.startLineNumber||Xe.endLineNumber,Je.startColumn||Xe.endColumn,Je.endLineNumber||Xe.endLineNumber,Je.endColumn||Xe.endColumn);setTimeout(()=>{Ce.executeEdits("",[{range:bt,text:""}])},300)}}function Dt(Ce){(window.navigator.platform.match("Mac")?Ce.metaKey:Ce.ctrlKey)&&Ce.keyCode==83&&(Ce.preventDefault(),fe())}const Ft=()=>{if(ye&&Qt.current.instance){const Ce=Qt.current.instance.getContentHeight();_e(Ce<Se?Se:Ce)}else _e(Se)};function Zt(Ce){var Xe=document.createEvent("MouseEvents");Xe.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ce.dispatchEvent(Xe)}const _t=Ce=>{if(!St.current)return;const{keyCode:Xe,ctrlKey:Je,metaKey:bt,target:Ht,type:Pe}=Ce;return(Pe==="paste"||(Xe===67||Xe===86)&&(bt||Je))&&Ht.nodeName==="TEXTAREA"&&(jt(),Ce.preventDefault()),!1};function G(Ce,Xe){var Je=window.URL||window.webkitURL||window,bt=new Blob([Xe]),Ht=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ht.href=Je.createObjectURL(bt),Ht.download=Ce,Zt(Ht)}(0,te.useEffect)(()=>{Ft()},[Ft]),(0,te.useEffect)(()=>{br.current&&!it&&Promise.all([ae.e(8909),ae.e(5028)]).then(ae.bind(ae,71448)).then(Ce=>{try{xe=Ce,Qt.current.instance=xe.editor.create(br.current,{value:ge,language:pe(Re),theme:me,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:Ot||!1}},Fe);const Xe=Qt.current.instance;let Ht=[...a.BH._menuItems].find(ze=>ze[0]._debugName=="EditorContext")[1],Pe=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],be=(ze,He)=>{var Qe,ht;let pt=ze._first;do He.includes((ht=(Qe=pt.element)==null?void 0:Qe.command)==null?void 0:ht.id)&&ze._remove(pt);while(pt=pt.next)};if(Oe(Xe,xe),setTimeout(()=>{Ft(),Qt.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{G(dt||"educoder.txt",Xe.getValue())}})},500),Qt.current.subscription=Xe.onDidChangeModelContent(ze=>{yt.current?clearTimeout(ir.current):(Ft(),Te(Xe.getValue(),ze)),ir.current=setTimeout(()=>{yt.current=!1},500)}),window.Monaco||i(xe,pe(Re)),he&&(be(Ht,Pe),br.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",_t),window.removeEventListener("paste",_t),window.addEventListener("keydown",_t),window.addEventListener("paste",_t)),window.Monaco=xe,oe&&Xe.onDidBlurEditorWidget(()=>{oe(Xe.getValue())}),Be&&Xe.onDidFocusEditorText(()=>{he&&De(),Be(Xe.getValue())}),he){De();try{Xe.onDidPaste(ze=>{const He=Xe.getSelection(),Qe=Qt.current.pastePos||{},ht=new xe.Range(Qe.startLineNumber||He.endLineNumber,Qe.startColumn||He.endColumn,Qe.endLineNumber||He.endLineNumber,Qe.endColumn||He.endColumn);Xe.executeEdits("",[{range:ze.range,text:""}])})}catch(ze){}}let ut=Vt();return st&&typeof st=="string"&&new r(st,Xe,xe),Rt(!0),()=>{const ze=Qt.current.instance;ze.dispose();const He=ze.getModel();He&&He.dispose(),Qt.current.subscription&&Qt.current.subscription.dispose(),ut.unobserve(br.current)}}catch(Xe){}})},[]),(0,te.useEffect)(()=>{if(Qt.current.instance&&it)return document.addEventListener("keydown",Dt,!1),()=>{document.removeEventListener("keydown",Dt)}},[fe,it]),(0,te.useEffect)(()=>{let Ce=Qt.current.instance;if(Ce&&it){let Xe=pe(Re);xe.editor.setModelLanguage(Ce.getModel(),Xe)}},[Re,it]),(0,te.useEffect)(()=>{Qt.current.instance&&it&&xe.editor.setTheme(me)},[me,it]),(0,te.useEffect)(()=>{let Ce=Qt.current.instance;Fr.current=Le,Ce&&it&&(Ce.updateOptions(V({},Le)),setTimeout(()=>{Ce.getModel().updateOptions(V({},Le))},200))},[JSON.stringify(Le),it]),(0,te.useEffect)(()=>{let Ce=Qt.current.instance;Ce&&it&&Ce.layout()},[we,Se,it]);const[Y,J]=(0,te.useState)($(we)),[le,_e]=(0,te.useState)($(Se)),Ie=C(V({},ve),{width:Y,height:le,position:"relative"});return te.createElement("div",{className:"my-monaco-editor",ref:br,style:Ie},ie&&te.createElement(R.CopyToClipboard,{text:ge,onCopy:()=>p.ZP.success("\u590D\u5236\u6210\u529F")},te.createElement(E.Z,{title:"\u590D\u5236\u4EE3\u7801"},te.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},te.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function Ge({width:Ae="100%",height:We="100%",original:we,modified:Se,language:ge,options:Re={}}){const ve=(0,te.useRef)(),[Le,Fe]=(0,te.useState)(null);function me(ye){let he;return ve.current&&(he=new re.Z(Te=>{for(let Oe of Te)(Oe.target.offsetHeight>0||Oe.target.offsetWidth>0)&&ye.layout()}),he.observe(ve.current)),he}(0,te.useEffect)(()=>(ve.current&&Promise.all([ae.e(8909),ae.e(9404)]).then(ae.bind(ae,2550)).then(ye=>{xe=ye;const he=xe.editor.createDiffEditor(ve.current,C(V({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Re),{wordWrap:!0}));Fe(he);let Te=me(he);return()=>{he.dispose();const Oe=he.getModel();Oe&&Oe.dispose(),Te.unobserve(ve.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,te.useEffect)(()=>{Le&&Le.setModel({original:xe.editor.createModel(we,ge),modified:xe.editor.createModel(Se,ge)})},[we,Se,ge,Le]);const oe=$(Ae),ie=$(We),fe={width:oe,height:ie};return te.createElement("div",{className:"my-diff-editor",ref:ve,style:fe})}},929:function(qt,$e,ae){"use strict";ae.d($e,{Z:function(){return u}});var te={flex_box_center:"flex_box_center___AQ53o",flex_space_between:"flex_space_between___i2aIa",flex_box_vertical_center:"flex_box_vertical_center___sPEKB",flex_box_center_end:"flex_box_center_end___GhSSH",flex_box_column:"flex_box_column___R9_Hb",list:"list___jb2Ay",wrap:"wrap___VsQDr",lockWrap:"lockWrap___g1k1T",li:"li___IxCLC",cover:"cover___Mu8wr",img:"img___IpFLA",movebq:"movebq___mF7wt",bq:"bq___Bil0T",sign:"sign___DXJ4d",name:"name___l7FoJ",e:"e___pXQUG",unit:"unit___wCIFR",tags:"tags___w_Mil",tag1:"tag1___dxm7r",tag2:"tag2___llZkf",wrapisCurrent:"wrapisCurrent___qIfQT"},re=ae(29787),X=ae(25399),D=ae(60242),W=ae(92310),y=ae.n(W),L=ae(49661),A=ae(57884),s=ae(34055),x=ae(59301),u=({className:f,dataSource:i=[],col:o=4,right:d,bottom:m=23,precision:_=0,wrapWidth:h=1200,trackEventItems:v,loading:r,onRemove:a=()=>{},isCurrent:p=!0,showProgress:E=!1,showAlias:S=!1})=>{const w=Math.floor((h-(o-1)*d)/o),R=[{name:"\u63A8\u8350\u81EA\u5B66",ptimg:"/images/tjzx.png",swimg:"/images/sw_tjzx.png"},{name:"101\u8BA1\u5212",ptimg:"/images/jh.png",swimg:"/images/sw_jh.png"},{name:"\u56FD\u5BB6\u4E00\u6D41",ptimg:"/images/gjyl.png",swimg:"/images/sw_gjyl.png"},{name:"\u7701\u7EA7\u4E00\u6D41",ptimg:"/images/sjyl.png",swimg:"/images/sw_sjyl.png"},{name:"\u7CBE\u54C1\u8BFE\u7A0B",ptimg:"/images/jpkc.png",swimg:"/images/sw_jpkc.png"},{name:"\u519B\u961F\u4E00\u6D41",ptimg:"/images/jdyl.png",swimg:"/images/sw_jdyl.png"},{name:"\u65B0\u578B\u6559\u6750",ptimg:"/images/xxjc.png",swimg:"/images/sw_xxjc.png"}];return x.createElement(re.Z,{spinning:r},x.createElement("div",{className:y()(te.list,f)},!!(i!=null&&i.length)&&(i==null?void 0:i.map((O,z)=>{var N,P,F,K,B,V;const{name:C,id:M,identifier:H,featured:$,school_name:q,image_url:se,excellent:ue,is_plan:pe}=O;return x.createElement("div",{key:M,className:p&&E?te.wrapisCurrent:te.wrap,style:{width:w,marginRight:(1+z)%o===0?0:d+_,marginBottom:m}},x.createElement("a",{className:te.li,onClick:xe=>{xe.preventDefault(),xe.stopPropagation(),v&&(0,L.L9)([v]),(0,L.xg)(`/paths/${H}`)}},x.createElement("div",{className:te.img},x.createElement("img",{className:te.cover,src:`${se}`}),p&&(0,s.bg)()&&(O==null?void 0:O.studying)&&x.createElement("div",{className:`${te.movebq} user-path-items`,onClick:xe=>{xe.stopPropagation(),a(O)}},x.createElement("i",{className:"iconfont icon-yichu1 mr5 c-red"}),x.createElement("span",{className:"c-red"},"\u79FB\u9664")),(N=O==null?void 0:O.subject_tags)==null?void 0:N.map((xe,De)=>{var Ue,Ge;if(De===0){const We=(Ue=R.find(we=>we.name==xe))==null?void 0:Ue.swimg;return x.createElement("img",{className:te.sign,src:We,style:{left:"-4px"}})}const Ae=(Ge=R.find(We=>We.name==xe))==null?void 0:Ge.ptimg;return x.createElement("img",{className:te.sign,src:Ae,style:{left:`${48+52*(De-1)+2*De}px`}})}),x.createElement("div",{style:{position:"absolute",top:"150px",left:"4px"}},(O==null?void 0:O.excellent)&&x.createElement("div",{className:te.bq},"\u5F00\u653E\u8BFE\u7A0B"))),x.createElement("div",{className:te.name},x.createElement(X.Z,{title:S&&(O!=null&&O.excellent_alias_name)?x.createElement("span",null,`\u8BFE\u7A0B\u539F\u540D\uFF1A${C}`,x.createElement("br",null),x.createElement("span",null,`\u8BFE\u7A0B\u522B\u540D\uFF1A${O==null?void 0:O.excellent_alias_name}`)):C},x.createElement("span",{className:te.e},S&&(O==null?void 0:O.excellent_alias_name)||C))),p&&E&&((P=O==null?void 0:O.progress)==null?void 0:P.all_score)!=0&&x.createElement("div",{style:{padding:"0px 10px",color:"#333",marginTop:10}},x.createElement(D.Z,{strokeColor:"#44d7b6",gap:"small",percent:(((F=O==null?void 0:O.progress)==null?void 0:F.my_score)/((K=O==null?void 0:O.progress)==null?void 0:K.all_score)*100).toFixed(),showInfo:!1}),"\u5DF2\u5B8C\u6210 ",(B=O==null?void 0:O.progress)==null?void 0:B.my_score,"/",(V=O==null?void 0:O.progress)==null?void 0:V.all_score),(!p||!E)&&x.createElement(X.Z,{title:`\u53D1\u5E03\u5355\u4F4D\uFF1A${q}`},x.createElement("div",{className:te.unit},x.createElement("i",{className:"iconfont icon-danwei1 font14 mr3"}),q)),(!p||!E)&&x.createElement("div",{className:te.tags},x.createElement("div",null,x.createElement(X.Z,{placement:"bottom",title:"\u7AE0\u8282\u6570"},x.createElement("span",null,x.createElement("i",{className:"iconfont icon-zhangjie1 font14 mr3"}),x.createElement("span",null,O.stages_count))),x.createElement(X.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},x.createElement("span",null,x.createElement("i",{className:"iconfont icon-chengyuan font14 mr3"}),x.createElement("span",null,O.members_count)))))))})),!i.length&&x.createElement(A.Z,null)))}},71360:function(qt,$e,ae){"use strict";ae.d($e,{jL:function(){return W},w9:function(){return $},QD:function(){return nt},cQ:function(){return B.Z},op:function(){return Te},O5:function(){return Yt},_b:function(){return ur},t7:function(){return _},Gi:function(){return De},YG:function(){return pe},qp:function(){return c},vr:function(){return Bt},qE:function(){return Ze},Je:function(){return r},wb:function(){return K},cq:function(){return Se},tp:function(){return i}});var te=ae(59301),re={flex_box_center:"flex_box_center___NeSU8",flex_space_between:"flex_space_between___ImTGl",flex_box_vertical_center:"flex_box_vertical_center___BtRd9",flex_box_center_end:"flex_box_center_end___qcLe3",flex_box_column:"flex_box_column___Ze_3q",banner:"banner___PoUBO",content:"content___XoDjy",btns:"btns___Pb35j"},X="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE4AAAA0CAYAAAAkEw66AAAAAXNSR0IArs4c6QAAGNVJREFUeF7VmwmwHVWdxr9zuvvu9+3ZXsxCiNkIQZOwEzMgyADjggsWgzPqOAJaMiCjYiGKqDBQAo4iWGAxA+ooMm7gBhSyhBBRIIBSAQlrHuTt7913t97PmfpOd4cXlLAFGO6rW9237719+/z6+6/nPIHX+XHttddaex38nlW2lLO1svq1wJ4aeFMM9CqFnNKoaYVapDAOicfjGEMKqKk2nrx59Lbt5xx6aPR6DEG8Hj/K3xwY0YtjSx2vYnlspLEsX0BRKUBrINtyX+PZp0r3fR+IIgzFSo9EsahFUfSHWIj7Pa919zvf2vlo+rFXdWivObjHJvR8S6vTJORHckV0+4GBAF4InwQlBCAIkEMXgCLA9Mn9WCef4ft8HWkgVIDn6ckwUA/HQfCzoFX71TsP6n/41aL3moHTWotnJnGysPEFx8ZcAtMqGTjh2NmVTL+iDB6BZurjsRSe2SogjhNwMZIngbZbqgXom8N26/KjV3femB7ebRxfE3DbRnW/k8c3LQvv5yCjOFVVqhgCyNnJmAhoxyOFasz1OeCM2lLTJryI4BQQUn1RAhI24Lc1dBjc2K6Nnv2edfP+sLvIvergxqb0vpHA1fk8lre9xBZpZsYKU9sMYiDvAHKaqU4HuANcZrIpcILiezRdo7z0aUw3BoJYI4gELAeI/bjZmBq9+PGNd5x/+unHua8U4KsKbriujxUSV9gW+rwg9WPTfpHgpEgUQgAFJwU6LSDwjSxA8F2jslSBBJaZKwVGJRv1pSAJLyQ8qlwLOA4Q1us31Z58+OTj3rX/E68E3qsGbmhK/6Nt40oIFMJwZ5URFh/cZoGgHQKODeSsaUEiA5iSy6IqYRnfmPq66YojPILbYbqpGXuhRhRrFPMSUaP+6OTAtuPff8ze97xceK8KuJGG/oBl4XsaKMTTsiwDKVXZjm1qsgRBU84TXi5VXqo24/syP5ce2xEg0gBDeAZWFijo79JnpLQxXSo7iICiIyD8qUfdxuQRRx24x5MvB95uBzfW1G+XFn4GoMMojQNOYWUK45b+jG9mW+PvFNAKEkqVYgI583VZcOB7WRrCqGwiaQovU1lAlaXKM/BMQNIGbN0FLGh0lySCVv0OP3aPOnKf2a2XCm+3ghuc1AvzOdwmLSwIwkQlBoxMtgZYCkvwQLafBYo0l2v6gBcCxRxQyifwM9PckRCniXIGbjo8wiI4bgnRRFul0XAZMABbaggVoytvo12vff7Qt/Rc8LqBm5jQndrBr3MFHOwyemaJbGaaAKzMp00zV2O+6VVnSTCPcYCNdrItEGAOcKxpVUQKLjPZ6VHVgEuf3Kf/rLk0Y4ViTpiAEUYKJaEgVDg2OTq1+j3r5w68FHi7TXFDU/El1Yr8VLudDM4IjUpLVWW2Mg0GgubybATNfN/0C5+eqjQ9oO0ngAmR0ZF5X2bKjLRZBUFgNE03AKhcPqk62wJsm+qjvyM4Aa0idFN1zcmvHraq90uvObihqej4YsH6nzCEyHwRB0WFZeZJ05xupsZSp6sty+2mXX2a/5rP0fT8MAHRZpmWph48J38zi6xUF1Vqft9KAg2BES6PmyChGGFTBVJ1kb/dq7XeeuTBs0deLLxXrLhHn2nP6+4s3Gk7Yl6Q5mpZMMjAGWjT0o+dgkR6BVnUzJSW2PpzhpHVqIygdPiEET3rzwiHP2QCSlrjUm1epE0el+R1/E6SmjDa2nGEat5Bu9089bC9O7/1moDT0GJkMv5eR6f1oVY7MRfjp2SiNgOO5pkFBpnkadmD/qflRrAtiUrBhJFdPnauJhI6SU6noXSyb2BmUZUqzYKEqSSSZ6SUSU34WagYVUsg9N27R7DtkONWrmRcf8HHK1Lc4EjrqHJn6ZdxBIsXkXU2MqVZqU/ja5ZU/MyWR5/Bps1/wfD2p+G7TUy1QziWRHfZgVXsREd3H1YtnoW+vl709nSjv7f0V4MwPnRaRUGlxSm8rG7N0pAMlim/CE4Jk+tRbTxmAoYK4Qit/Mhb9/a9eze9ILW/YQwv5jvmM/fcs720YMnMDeWStabtJrmVUVaqtsy3sRqgAm+96yH85qbb4DZqWNjfi57uHlRKJViWjSCM0Wr5aDRaqDebqDeaqLkRLFugp7OIQudMrFn+JvT3z8Ee8+dgVldxp+tkpUB42ZZgqLrEnyUq89MkODkunjVVoREFMao5G367een6lZ2fejEQXrbiBgbbn+qZUbyETcWs2KZ/Ynsoi6aMgEPjLVz6Xz/B1OjT2P8tyzB7Zm/i6IMQYRghDGk2ielkLaKIPiiM4PshGk0XzWYDU40a6m6Ickmi3N2Lt+y1B5a+eQ+sXLIQM7rLxi1QiR47I2l3xPizFFyitsQnmqhq8juNks1go2BrDRG4WwMv3veItT1TLwTvZYH7w0NP9y7sn3NPqSgXMiCYRuNz1MbE9eEnRnDhpVdh1fxu7L1iCYIwghcECKMYUfaMY4Rh8jogxJgQNQjP+CECpUK4H8bwPR8tgmzW0Ao8lEsW+vrn4sA1S7Fs2VKsXDIP1UrO3BymMD7PEwvj6wJjnjTTJFAEsUJOJj4y8iMUWIfE8bp1Kzs2virgtg23PtHTV7os9JI0wASFNPWg4vI54LGBMZz/je/i71YvQv/sWXA9D2EYIooiAzCOYoRxDM/z4Xo+PC+Az2MR31NpkU4fpKGUQKRkoiSCjCSiSCAKVPLddgON9hQsK0TXjA7su3YVDjt0Hdbu82ZzbQYgVZb6OJOW0GQjZW54XtACInTkHXjt5kXr9+r4zG4Hd/bZZ8uTTz1rY7liHxiHiR9h+sFAQHNxJMulCGed/x2jtHlv6ofruogILaZpEl6MIAiML2u1XQRhaIDxeKZGqoEAObgoTkBGkUp7bvRRfC0QRpZRkYqk6SjHcYDQryNXVNj/oLX4yIc/iMULZyVVSFr0GxVmlQWDg0xSFG5j372rV1fXr1wpdhldX7Kpbn2mtbqrs7jRkqLIC6VDzgIBwZUKwGXfuwFjA49g331WoO26CSwDh/BieK6HyakaPM9LTZbv0WQJL0r2o9ioMkhN2gDka0JkDhYpExW1FtCQEMKGlg6gbWhTxjPFaKBvZgUfP/njOHz9WrRS5QXG9AkvzeXoHxXrVw0n9puxEm8+dGVlaFeqe8ngBifiT1Y65aUha7+0+M7Sj0IeeOixYXznO1fiHQfvY1REs4wiBoIAcRQZkBOTk/B9P1GSCRBBoraQn/dTmDxOiATGLV+nioxjA49wINjAY4YtIaQFwX1hQYtkn/AtW+Okfzsdf/+OA9H2Uj+XdoiZltBebaGh2a9DrONYvfdtK8q/2L3gaurXxaI4WqUJJH2ETTPltVsaX73wvzG7IjGrrwce4RhoieKCMMDY+LiBZ2AwGJjAQKg0Sx6jCrWBmQAlTJo3vx+ZvIvOXLBEEAJCMPFNQrkBBwnNfcuGMFAFlIqRyxdw+he/gv1WL0PDTftzSicd41jBYaURa/SUHLTrjc+vX9mxy47JS1LcpoGB4qKOuZvzebFMpyUPT0BoTD023P0wfvWL67DfPsvhut4O80z8Woip+hQma41UWVQRDMwEXIQ43Se4OApSYEAYeAijwADSmp1RghPGt3Kb5MMJxEx9VJ2QNu8mYNlQUYj+hUtx9nnnolIpw83KrrSSMOCURmfOQejWr37bis6P7DbFba/ptZal77SlyPFy6WC5ZedBKYWLLrkKs6oOCvl8AoR+zWwjeL6L4dFRuJ5CEGpTsEeBQBD4iFWMWEWIwjpU6Ca+kNswNll+zCgECSkcKM02CQtS/nK0oxPDFDzRIYFSfYRIcFRfzgDktRz7z5/E8Scci7ar0g4xc0aePen0VaSAiLxHutVTe6/cRfn1khQ3OBEdU6xYv4oZbzjJopJISrX96aFtuOaH12D5ogXw/QABVZQFhCDC5NQ4xienEIQCbijh+RKTvXPhVYrIPTGAXLOOOJ4AwhAxzTKomTTEdHy1l/guc5voWTmXSPWFSVAwf7FRH83YuD5jxgQooS3HqE9Bomf2fJx9wcXo7KjAp3swLSZApjPeJUvDioLBkttYvHZtf/v5VPeSwD09Fp9Z7pDnEhzvD1MEqo2d2ut+swEPbr4fM3p7jIqYbhjlBKHxdcMjQ0ZtXmjDbSsMLFqJx048AWDWv/kvWPjNy2DXB5hXAHEIpZqwZNVct1INSFkyoJRyE1g6hjaFnp2IDyrxezqFaMClHQdjsjljsrzuk8/4Cg46ZF9zPQYc05k0qpYswFH+uCW9VYcsm7F994CbiL5fKlkf4lyC1nSswnRlWcBfftVP0RgZRqGQR2jKKd/4JZrpxOQExicmEIQWvDCHhu9gyz99FN76VQCt0AZmnnUxSg/cAUuGEKoJaBdSZjVpBCk7EnDahxRlKHCfjbccNPMis29mWSGMH6TqNKQxWStJVayccQvrjv4ATj7lRLTcpL1k2kym0GUJJlASvuvo6JADV3RtfsngbtXa3gsoBA3k3Rakb8GtiuiaUtk+xveUqRjoU9gmKuYFLr/yGkwMjSBH5xrQ4dNPBaYiGBwehOu24QUCXuhgSnTjsTPOQDxvRjqjrNB31tdRfvwB5O0cEI9BaA9SVhCpGqA56+NAa/oIC5AER2XlmfdDhT60FLBoxlYAof0UnjLukAo1arPyxhev2vcAnHbWOSaJNmWe6elRCAm4TukrS0XvOGivrt+9aHDba8GaQt56r4A8XADztYIVKgimXH6M7iDUebackzJLIm8LlIsSP/jRz/HU1ieQcywDLnHwAWq1BsbGR5M6lYrzJEZmLsHw5z8LlOm0AWwfQ885X0Ol/oypHRFPwpZF2FYXwngEgoBEHpEaNwpTyJsqROsCgupMtFeshLt8Oap/ug8d998CKQgvgICfRFppm/QEBAdg1oIlOOMrF6BcLsAPlCnHIjPvClQcgW4nhFThPxy8ovPXLwjugaGh8uxyzwXlvPOxsoPC9PUaZpYoLZobHtAMtAEhoVDKSXSUHdy+YSN+d9MGFKm4NK0gwKHhUTSaNZPL+ZEFzwXGVrwNk6edlkDjHMLmrei78DzkLR8W18qoEUiRgxR5xKoJ2+ox4EJVh5B9UDqPel8vWgccAW/Naug5Myk84OkJzDn3FOTbIwacFASXJMSC/XOZhxISHTP6ceZ5F6GzuxNekEb5IKlIOvISvU7AhPiog5ZVbtgluE0DurigHPx4RnfunXQXbNJm8wEZQAYCphDs99c9YMqDKbALtjJNyNGRQVx++dWwtDA5GHMyz/ewfXAYntdE4AfwjFkINHsXY+JzXwPmdptGXunKH6D79uuRzxVhqwBKDSFnzTTRNIrHIQXz+RAxTVF1obFqPcY/ehLQVU2CLG+AApwNGzHjR99GTk0Bqg0pvCQ9sRxIY6o5aGmjWOnCmed/A70zZ8INmCpxbGwoAF0Fgd5cEBVkfNj+Szvu2CW4rUPumTN6C+faCijwxqTTeNmXssV+bM1w9oiqm2wToELgt1AtSHQULVxzzU/w5/u2mKUMcRCg3W7hmeFhBF4rKaPY6WDGJDrQnrcUrdX7wRkcQuXe22HHU7CFgDT+zE/AKR9au7CsPkSqAWWiaieG3nkCvPe9G+DSGQrqwUdRuHUjylvvQS4ahaObELoBAVqFSCsJzto4Jkg4OQdn/sd/ord/Plw/MtAIj5Y1oywxq+DXrThae8CKzq3PC+6ux4dndRZ67uut2nM68sn6jWxtx/QvZebKiWKCq7WAmtm2IZSPGR0FjI9uxxVXfB+tqTokYgNu++AQVOSZ1EErunSWRBXTyYASkLIAbdGnMBhI6Lhu5COlA61Ck39JUTHRVAtO73ej0TMbEyeeBj1vjlGauP8RVL7/A+SDQdiowVF1SN02UVaa2fAkl2NU5TNnC5z+5QswY/5iuG4EN1KmhtWxwNwuBws7w+G85S1ftaBr8nnB3f1Y8/hqtfzDzhzQU0qm0v4WOLam6ecIjl2GWhuYaFF5IcamJtFZtNDX4WDzvZvxv9dej9BzoaIIo+Oj0FEAzSxfhyYSa50W5iAU20RNafIuwmol/k0yGPAGJJ0OZSJqHkqWEcU22vPegua/nAR0dxvVWZv+iI6fXomcrsNRDWhNU9UmAWZoVVYOgsFBOCjlLXzqjC+ia+6eaHsRmp5GMScxu8NCf4eF7qKIRBQ8mnfkz4PQ/83SuX/d2BSbHmne3Fktv72vDHQUEsWxGnjuIwPH3hf93FQbGKnTXDUeGhiCFDFmVHPoKlu49dYN+O1vb4alYozXpqBjggvNBHDyYIHDhJVQ+IiSYolFuXHqBQhGT+VCWiUTGaOYQIuIhYWQ34tLcBeugH/ch4DuXmBkEJXvXoB8ewwWXGiT77GWSBoA9G9cKBcLB92dFZx02umI8r0m9Vszv4QVsx10FYUZu7GuNHeuN1XkB9FN7Xbwmb0XVh/KuIhNWwOvs2Tn+6rCZAecITezU9PWc5i0Ml0JZKbfwsTHDU0Bky6wYcs20w7qrThGeaW8xJ0bN+HW2+5Eo9k0lQT9jWkEMVHl2dnhoNp4VLBc4uI4JrKRAcgEO7HDXFLQE64oGNz0k0pUkvUhCxZDrz4A4tEHkXvwLtgihNSJa0gEQNfAXp0NZTnGVSxeuADHHHcCpJXD+9f0YcUc2zRgn6sXnr9O3yeBlqeGJyfDE1cvKlxvkuvfP6512QF6y8kCFwYHllHZsgSezAwh7ZhyPIRHH/fMJDDWAn72x8dQb7XRVbZNoKgWLBRyAvfe/wBuuf0u1CYnIWVaQ9K5pRMrdNw8v5khM2rjZ2iYVGJWfxJunJbwBGjm0kx6ohj/zQpryyS82lKQpopgI0AnLodmaop9C4rVAwTWH3wgluy9Fh/cbxbWLSqa6idbJfpcS3PNupNkQnuioVrDk976I1eV7xW3b2lvL5eKczoLQKWQrIqk6rIeWwYuWw1kymwFTLaAgQlgsK5xxa1bUGu66ChYqOSpXMss4Ms5EtsGnsatGzahMTaWhutsLWsaug2s7F5nix7S/CKZ/08L+7RlZMqpDJ4hk62JShWbLj805Ve2II9zlCbJQqW7C/sftA4HrZiPUw/vRweD7S7A0a/XXW1SsLYSeGpIbxiZeOpIccufG8dVOys/5r2o5JNVQaw9WUrxhDRbk46k62/5moobbySKu397gK/9ZgsKFlDNSZQJzhHI2xKOJVDISTRbbfzpwS0YePxxxL73rJzNwNJZ62yG2dzydNlOUqVnK4PTdpKRWLqfLe/JPpO9nuZnTFRNyFj5Apbtswr5rpn4wpELcPiyqhHKrhTHsTJ4TLnCWNdgA3Dr/lHiuo2j1XJf7x2VvNiHTbZyBs9OA8U02zcTMjKJrsNTwEgT+NE9ow9864Ytt/dVZVDNW6LsSBT5XUsgZ7P7L5BzbDPX+qeHH8HAlr+YZQeJjSWpwk4P2pdhk05mcHfHa3YyzXKa9GD6mez9hOiOhHjHwjzzOzZ65s3B/D2XolSt7nnh+5a9a0mfZcZLkTz3MrJronVxoQ+ziPEWsL3GXDZ60NjIr/6sjynk8EsHEPRxDBK8E1ztw+k+njhHFTqJCTMl4Qm21eDd/KR7+NePLt35fPnO/8fj592ljz5sPn49rwBUC4mF0bqmp2HZMguKhOC4kpPpF8fNgLEjkPzyz/qzjo3zcwKSyqOfy2avePKuNHgwUjEB3j4FbB1R973/3zfsh9ten/+nerk35RM36MPfswdu2qMDoqOY9BO59jhb6zJdbVneyhSMixPpnphR7BSBr3tAf9i2cH45j9k0Dy58Zreitwr0dSRK5J0YbwJDLfo39eWTDrTOebkDeL2+13e5nnPZfrh/UTdmVvOJb6fq6OsIzziK9H8lCI6RldtMcX46ZbDT9V//oJ6fAz4iBI7VMfYp5SBmEFw1uTNcezFcB56YQPv329qHfPXo8n2vF4BX8rsXbdS/WD0L72ZThfA4NrqiLIdlMGSfjtBYn1Nx9HH1wDQ7Nj9v6/zGB3S5HWCvUlFfvWiGWMYFQpQzzXSoAfxlWD1w0X1y33tPEkyy33CPk6/TBx8yF7f05pDjuIrOzuaaVUoExxKT43a5akFCtVys3+Wcwweu1dbHV+LxN3VhPsEx8jANGfOAh4eiL5x0iHPeG47YtAv+9I3xp9f0yIvLDAw6ySIY/ExSnpkqVcels/x/syLgtXHpx9bhlF2CO/tanVuzHHfPqmJVOf0nNdr5SFP7D02Eb/3iEfkdtdsbFeCXbtYfXlDGueU85iKZsjXZklnpyZdpGmgWFcS4pGsQnzvuOBG/4CzXFX/Qp+zZi28pPzkZHeNIS337X2+Qp+IckWajb1RsyXWffqOeN8tRH+rKyWOhsSBnYyYziiCAa0k8EQKb2kF01acPc3akXS8IbsW1Onf6AnVib16ewqWz21vq9qu2yNPeqL7thW7xZ65391jcV1jE/1qKFcaeCfDwOYeK9D83nv32/wHzrWgvjJ8Q7AAAAABJRU5ErkJggg==",W=({dataSource:qe=[],img:mt,imgWidth:Dt=346,title:Ft,sunTitle:Zt,bannerExtraContent:_t})=>te.createElement("div",{className:re.banner},te.createElement("div",{className:re.content},te.createElement("aside",null,te.createElement("p",null,te.createElement("b",null,Ft),te.createElement("span",null,Zt)),qe.length>0&&te.createElement("div",{className:re.btns},qe.map((G,Y)=>te.createElement("div",{key:Y,onClick:G.click},G.name,G.sign?te.createElement("img",{src:X,width:39}):null))),_t),mt&&te.createElement("img",{style:{marginTop:33,marginRight:38},src:mt,width:Dt}))),y={flex_box_center:"flex_box_center___hG6RI",flex_space_between:"flex_space_between___ss3Fh",flex_box_vertical_center:"flex_box_vertical_center___K80p9",flex_box_center_end:"flex_box_center_end___qmXX3",flex_box_column:"flex_box_column___GFV8F",row:"row___aXJjm",title:"title___HUKL0",tagsWrap:"tagsWrap___XB2W3",action:"action___VdHb1",bar:"bar___t1kKC",tag:"tag___V7Eft",name:"name___Hk1Ip",num:"num___xQpcH",active:"active___XryTX",tagsBorderWrap:"tagsBorderWrap___OMxjs"},L=ae(92310),A=ae.n(L),s=ae(89392),c=({dataSource:qe=[],value:mt,onChange:Dt,onTitleChange:Ft,className:Zt,title:_t,titleWidth:G=41,style:Y={},fontColor:J="#6A7283",showCount:le})=>{const[_e,Ie]=(0,te.useState)(0),[Ce,Xe]=(0,te.useState)(!1),Je=(0,te.useRef)(null),bt=(0,te.useRef)(null);return(0,te.useEffect)(()=>{var Ht;qe.length!==0&&(((Ht=Je==null?void 0:Je.current)==null?void 0:Ht.clientHeight)>97?Ie(1):Ie(0)),qe.length===0&&Ie(0),Xe(!1)},[qe]),te.createElement("div",{className:A()(y.row,Zt),style:Y},te.createElement("div",{onClick:(0,s.throttle)(()=>Ft==null?void 0:Ft(),2e3),style:{width:G,marginTop:Ce?12:4},className:`${y.title} ${Ft?"current":""}`},_t),te.createElement("div",{className:Ce?`${y.tagsWrap} ${y.tagsBorderWrap}`:y.tagsWrap},te.createElement("div",{className:y.bar,ref:bt,style:_e>0?{height:_e===1?97:"auto",overflow:_e===1?"hidden":"auto",paddingRight:55}:{paddingRight:0}},te.createElement("div",{className:y.tag,ref:Je},qe==null?void 0:qe.map(Ht=>te.createElement("span",{onClick:()=>Dt(Ht.id),key:Ht.id,style:{color:J},className:mt===Ht.id?y.active:""},te.createElement("span",{title:Ht.name,className:y.name},Ht.name),!!le&&te.createElement("span",{className:y.num},Ht.count))))),!!_e&&te.createElement(te.Fragment,null,_e===1?te.createElement("div",{onClick:()=>{var Ht;Ie(2),((Ht=Je==null?void 0:Je.current)==null?void 0:Ht.clientHeight)>245?Xe(!0):Xe(!1)},className:y.action},"\u5C55\u5F00",te.createElement("i",{style:{transform:"translateY(1px) scale(0.6)"},className:"iconfont icon-zhankai4"})):te.createElement("div",{onClick:()=>{bt.current.scrollTop=0,Ie(1),Xe(!1)},className:y.action},"\u6536\u8D77",te.createElement("i",{style:{transform:"translateY(0px) scale(0.6)"},className:"iconfont icon-shouqi3"})))))},u={flex_box_center:"flex_box_center___aK2n3",flex_space_between:"flex_space_between___HX0Oh",flex_box_vertical_center:"flex_box_vertical_center___LJOJr",flex_box_center_end:"flex_box_center_end___SCakF",flex_box_column:"flex_box_column___AYv4m",tabs:"tabs___GTqPV",active:"active___F26E8"},i=({dataSource:qe=[],value:mt,onChange:Dt,className:Ft,style:Zt={}})=>te.createElement("div",{style:Zt,className:A()(u.tabs,Ft)},qe.map(_t=>te.createElement("span",{onClick:()=>Dt(_t.id),className:mt===_t.id?u.active:"",key:_t.id},_t.name))),o={flex_box_center:"flex_box_center___yX6Oa",flex_space_between:"flex_space_between___t7oqF",flex_box_vertical_center:"flex_box_vertical_center___dEIHy",flex_box_center_end:"flex_box_center_end___taQDF",flex_box_column:"flex_box_column___xY_Lr",input:"input___PW2zI",dropdown:"dropdown___vSy8B",menu:"menu___NiyBu",text:"text___Grueu",b1:"b1___ZKryM",b2:"b2___aKyGa"},d=ae(37568),_=({dataSource:qe=[],value:mt="",onChange:Dt,onInputChange:Ft=()=>{},className:Zt,style:_t={},placeholder:G,allowClear:Y=!1})=>{var J;const[le,_e]=(0,te.useState)(""),[Ie,Ce]=(0,te.useState)("");(0,te.useEffect)(()=>{var bt;let Ht=mt;(bt=JSON.stringify(mt))!=null&&bt.includes("{")&&(_e(mt.id),Ht=mt.value||"");try{Ce(decodeURIComponent(Ht||""))}catch(Pe){Ce(decodeURIComponent(Ht||""))}},[mt]);const Xe=()=>{Dt(encodeURIComponent(Ie),le||null)},Je=bt=>{bt!==le&&(_e(bt),Dt(encodeURIComponent(Ie),bt))};return te.createElement("div",{className:A()(o.input,Zt),style:_t},!!qe.length&&te.createElement("div",{className:o.dropdown},te.createElement("div",{className:o.text},(J=qe.find(bt=>bt.id===le))==null?void 0:J.name,te.createElement("i",{className:"iconfont icon-zhankai4"}),te.createElement("b",{className:o.b1}),te.createElement("b",{className:o.b2})),te.createElement("div",{className:o.menu},qe.map((bt,Ht)=>te.createElement("div",{key:Ht,onClick:()=>Je(bt.id)},bt.name)))),te.createElement(d.default,{onPressEnter:Xe,value:Ie,onChange:bt=>{Ce(bt.target.value),Ft(encodeURIComponent(bt.target.value),le||null)},placeholder:G,variant:"borderless",allowClear:Y,onClear:()=>Dt("",le||null)}),te.createElement("i",{onClick:Xe,className:"iconfont icon-sousuo9 font14 current"}))},h={flex_box_center:"flex_box_center___tol8o",flex_space_between:"flex_space_between___Z235C",flex_box_vertical_center:"flex_box_vertical_center___Wq1sZ",flex_box_center_end:"flex_box_center_end___LLxom",flex_box_column:"flex_box_column___DbMSN",quickPager:"quickPager___GM30J",disabled:"disabled___Ozc8I"},r=({value:qe,onChange:mt,className:Dt,total:Ft,pageSize:Zt,style:_t={}})=>{const G=qe<2,Y=qe>=Math.ceil(Ft/Zt);return Ft<=Zt?te.createElement(te.Fragment,null):te.createElement("div",{className:A()(h.quickPager,Dt),style:_t},te.createElement("div",{onClick:()=>{G||mt(qe-1,"prev")},className:G?h.disabled:""},"\u4E0A\u4E00\u9875"),te.createElement("div",{onClick:()=>{Y||mt(qe+1,"next")},className:Y?h.disabled:""},"\u4E0B\u4E00\u9875"))},a={flex_box_center:"flex_box_center___FO7TP",flex_space_between:"flex_space_between___LotYx",flex_box_vertical_center:"flex_box_vertical_center___bWdaw",flex_box_center_end:"flex_box_center_end___mVJ1o",flex_box_column:"flex_box_column___M83Mm",list:"list___oOsiS",wrap:"wrap___G6T7F",lockWrap:"lockWrap___Rl79E",li:"li___oZZ7l",cover:"cover___b2bYW",img:"img___IQX7w",sign:"sign___HkT6C",name:"name___SsJx8",e:"e___TMqq0",tags:"tags___bcjyo",rate:"rate___YACg7"},p=ae(29787),E=ae(25399),S=ae(58018),w=ae(90524),R=ae(49661),O=ae(96908),z=ae(57177),N=ae(81378),P=ae(57884),K=({className:qe,dataSource:mt=[],col:Dt=4,right:Ft,bottom:Zt=23,precision:_t=0,wrapWidth:G=1200,trackEventItems:Y,loading:J})=>{const le=Math.floor((G-(Dt-1)*Ft)/Dt);return te.createElement(p.Z,{spinning:J},te.createElement("div",{className:A()(a.list,qe)},!!mt.length&&mt.map((_e,Ie)=>{const{name:Ce,id:Xe,identifier:Je,power:bt,cover_image_id:Ht,pic:Pe}=_e;return te.createElement("div",{className:a.wrap,key:Xe,style:{width:le,marginRight:(1+Ie)%Dt===0?0:Ft+_t,marginBottom:Zt}},te.createElement("a",{target:"_blank",href:`/shixuns/${Je}/challenges`,className:a.li,onClick:be=>{be.preventDefault(),Y&&(0,R.L9)([Y]),bt&&(0,R.xg)(`/shixuns/${Je}/challenges`)}},te.createElement("div",{className:a.img},te.createElement("img",{className:a.cover,src:`${Pe}`}),_e.is_jupyter&&te.createElement("img",{className:a.sign,src:O}),_e.is_jupyter_lab&&te.createElement("img",{className:a.sign,src:z}),_e.is_unity_3d&&te.createElement("img",{className:a.sign,src:N})),te.createElement("div",{className:a.name},te.createElement(E.Z,{title:Ce||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"},te.createElement("span",{className:a.e},Ce||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"))),te.createElement("div",{className:a.tags},te.createElement(E.Z,{placement:"bottom",title:"\u5173\u5361\u6570"},te.createElement("span",null,te.createElement("i",{className:"iconfont icon-shixunguanqia font14 mr2"}),te.createElement("span",null,_e.challenges_count))),!!_e.myshixuns_count&&te.createElement(E.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},te.createElement("span",null,te.createElement("i",{className:"iconfont icon-chengyuan font14 mr2"}),te.createElement("span",null,_e.myshixuns_count))),te.createElement(E.Z,{placement:"bottom",title:"\u96BE\u5EA6\u7B49\u7EA7"},te.createElement("span",null,te.createElement("span",null,_e.level))),te.createElement("div",{className:a.rate},te.createElement(S.Z,{allowHalf:!0,disabled:!0,defaultValue:_e.score_info}),te.createElement("span",null,"\xA0",_e.score_info?`${_e.score_info}\u5206`:"5\u5206")))),!bt&&te.createElement("div",{className:a.lockWrap},te.createElement("img",{src:`${w.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),te.createElement("span",{className:"mt15 font16 c-white"},"\u5B9A\u5411\u5F00\u653E\u5185\u5BB9\uFF0C\u9700\u8981\u6388\u6743")))}),!mt.length&&te.createElement(P.Z,null)))},B=ae(929),V={flex_box_center:"flex_box_center___eMcr7",flex_space_between:"flex_space_between___HcNca",flex_box_vertical_center:"flex_box_vertical_center___ZnvVN",flex_box_center_end:"flex_box_center_end___fdgDf",flex_box_column:"flex_box_column___SEKvd",list:"list___L1hmU",wrap:"wrap___pKgcW",lockWrap:"lockWrap___SMhkK",top:"top___udHSB",sign:"sign___uwRpq",name:"name___Fpf90",img:"img___AMLhL",text:"text___KiTb7",btns:"btns___i6IuZ",bottom:"bottom____k2sh"},C="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXWmQXFd1/s59r3t6nX00o93GluV9AQNxiAkIB0OMISFsFQqSAhOohFR+JKmEQPILClJZfpEfIUAChFQSHIJxnGDiDYwsb8KRLUuWZcmSxqN9pJF6nV7eSZ373u1509Mzvd2eGVt6VV2z9Ht3+9459+yX8Bq4mDmWK2GLqla3MvFWZt4KpjVMSBNzGoQ0M6WJkJbpMiNDxBkwMkyUIUYGxCeJaB8x7fMcZ18yiv1EVHy1Lw+9GicwO8tXlSrlbSB6O4HfANAmZlY250JEHsBHGLQTzA9H3chDfX2012Yfy9HWqwJgZh7NF6vvY/a2gWkbgyeWY3Hq+yDQcRA/RKQeSsSce4jo9EqMo50+Vy3AzNxXKFTv9MAfB/AuZo60M7Fe30tEZQA/UqBvx+POvUQ02+s+O2l/1QGcy5Xe6Cn1SXj8YYAHO5nU8j9DM1D0b8rzvpFMRp9a/v4X73HVAJwplN9GHj7P4NtW0wK1OxYCPcAKX0rHI4+0+2wv7l9xgHPFyrs9j78A5l/sxQRXrE2ix5SiLyZj7v+s2BgArBjA+XzpzR7oq8x880ouQK/7JqKnFfiziUT0iV731aj9ZQeYmYez+fJXiOguZl72/ldkkYmYmb+eSkT+lIjOLOcYlm2BBcx8sfoJz+O/BHhkOSe5evqiaaXoTxIx55tExMsxrmUBOJ/njVVUvgvmW5djUqu+D6JHHbgfTSRostdj7TnAuWLlDq/K37pwqXYxCGlaOfRbyZh7Xy9B7hnAzOzmCpUvA/jDC2WvbReogE3/TTLufo6IKu0+38r9PQE4n+f1VVS+B+ZbWhnEBX8P0Q4H7gcTCZqyvRbWARZHQLlavp8ZG20P9rXcHhEmI07kdtsODasA5/OlX6gy/dfF/bbTV5GmHeL3JBLRxzttof45awCLRYo9vpuZE7YGdyG2Q0R5UvQBWxYwKwBn8pWPEPg7IlhdiKDYnrMIXAz6WDrh/mu3bXcNcEC5P7wIbrdQzH9eQCZF7+2WkrsCWPZcD/TgRbZsF1zTmrBrBX5HN3tyxwD7YTOVRy8KVL0Bd65Vmo667q2dStcdASx6rofyjouqUK/B9dsXFUohcksnenLbAMtemy1UfnrRiLE84NZ6IdqRirtvbdfi1TbA2Xz5r5j5j5Z5ehe705RMf51KRP64ncVoC2BxHLDH9/batlz2gJPnFc7PArNVgvjViABH6Zhm/ZErQoxkH7AmxYhHlsX71s7aWr9XbNek6M52HBQtA6xdflx5pldCVaEMHDuvcK5A8AjI5oB8EShXgEoZKFeBSgVQCohEgKjr/4z3AUP9gCIg7jLWpBn9fa9lsMXa5d7UqquxJYCFYrOFyk964c8V4F44oVCsEs5lgfNZIJcHPMFIk27wU0sbof/V0UcyBgz2AyMDQDQCbBzwXrtAEz2airu/3ErQQEsA5wqVT3qe93WbPKfqAS+eUsiWCWdmgJPTQLVaB2gjw6oB3U9B0azbsGz5XV6KsWFg01pAzGqXjniIua89ilZK3ZWMu99ohklTgP0YqsqLNlnz+SJh7ymF8xkf2JKEkFu+BOx1Y8CGNcBAH2P9gGe5h5VujqZTCfeKZjFeTQHO5EpfA/ApW9N5ZYYweU5h6jhwPlfHcpux5Ha/BxCLAldfBqSijMtHX2sg4x/SyejvLIXNkgAHoa07bEnNe48rnCkQDr8CFBokehh2q1ntIizYsOVG3y/g6AH7dl3gykuAvj4gAkahSihUCCVP9nryJfNgj1dguIrQ5wKJCCMZZaSjjOGEh6jV9LbuSUb2YAW+ZamQ3CUBzubLT9mKW95zTOFkhnDoqC8NL8clL0oqSYgnCSoCVIM92580axAjji+BuyqQ4RgQOq8wUKrK/0jv83Ilo8BQzMO6VBUDseWYQfM+JO46lYi8cbE7FwVYZxxUvf9u3kXzOyZnCIfPKuw/FAhSgcxTz3GbyFQLpOh6Ics877qE9AAQiZEGSyJUI6JGOT5VxlxocEWvdgTcAGQBUtQwWRTDTQTkYhXIlQnZElD2fMBjDmMizdjYX0VkhSlbOepXF/M6LQpwJl/ebiOd5FyR8PxxhQNHgGKP8+9EL04PKU2tAr5LjIQLJB0DJmswDbACpuP41KuBFYDlEwBsKFdz72ClZqvA2SJpI4yALc+PJ6rYPCDSevOXvSd3EG1PJyK/1KjthgBLIhg8frjbwYgq9MRhB5PHgXOZha01k5nq9d4FalEgowk4/UMKTp/fR59iJBX0nqkBo8ASpsGVPdYHVD7yuwY8uLcGcrAyNZCljbopZErAqQKhWPGB3pD2cEl/RUyK3S5d+88renujhLeGI8nmyv9rI8vv+aMKh6cJk8eC8Tbjye1Oi4BEkpDo91lxVDFSjghS/lVjuQZgMXc6DDdgxRrYEAWbl0GDHwC6FMBmuLkycKJAKFUJMQe4YriCwdjy6t6S1ZhKRn6l0TY37386Pxd4st21rr9fWNnTkw72HeyNnit7Z/+YAsn+CUbaBWJ68wzADbFZQ8GaJSuex6INy9ZCVmDvNkBLW2Y/DrPpxdbmTBGYLhCYCBvSVWzury4rNSvgTfX5yQsoOJMr/T2AJXWrVsDfeUThldOEoydbubu9e9wIYWBUFtJnxwPOHPuct28KyHWs1yHWVCsgCgULwAZkDXBA3ealaAdgmYWoXlNZ0vtzfx9wzUhZ97NM19fSyeinw33NA1jKJmTzlePdZtaL40Cod8+BQGq2OLtIFBgcVVrlSTiMtDPXeHgy+ndDgYFkrPfZEBUb9cgA7H8X7M/B3m0o17QXNLvkjGRsx/OkJW+R2q8erWjW3fuLZlIJdyJcTmIewPl85QNV9r7X7UD2nVTYd4wweXTplpoZNuqf7osB6WEFD4xBw5IbdFG/b8rfMlENoKZQn01rISvYg42qNPcSzLFneRH0FWL/razR6QLh7KxvNLl2tLwsUrZD6oOJhHu3Gd88gLP5skRH3tnK4Je6Z/tBBwenGkvOnbYtHqL+Nb5DeFgMFK2wPSNBB9gYdu2zaNZg14QsvZfPl6r1ixH+NFCfms3nfBk4lSdEXcK1Y2X0tTLuZo0u8T0R3ZtKRN67AGApVZQrVI52W81GDANPHnGw64XA5RcaTODsWbSswGJCthguhsYJHjNGWwXXEJ0BSChYfjdsGKzB05Qb/M/swWGVSb8MwbMycNNGeG9uhse5EnC6qLShRUAWga5Xl1T/ScbddabEU42CbbkEX55W2DtFONAg87WZltToBZAFHV4rbBkYiDASLSzOPLYUAtgA6APFvkFD2HQAvBikjSQt1C036BdAKDt4EbSEbQwjIQNIM8BEXz5fJu3Zunqkt7basCuxthbZfOm7zPjNZgNt9v3OSYWXpgjHpxf655sB3Kjt0XEhLyDpMvrrBZVGqmadXlDbPo3QFLJUacOJYuhce+NXDu4z0nRY0hbDiTgu6oWxZmsi30sXIniJk0NUKDGK9Ooiwr+kEtGPhsQGCZEpH7NRQc7sv9PnlgzA0HNrZslKpgnxftKq0FCHZkAjYEl/AkxNWBKngo4aYWxdR7h8Qr5f3AJVKDF2H/FNnZHASSHgmz26FbCkv6kcoQrCVaMVpHsUiCAV+VLJyNoawEHtxz2tDLLZPT894OClI37oTTeXcoHRCaUdBbLvLrH2S3YzT481+CrA84CKJ2oc49feRHA1T176+vlBT8eGxSJ+PJgxc7ZjmRQ9+WiOEHMJ142WemYIibqRqyVYXs8qkyv9HoCvNptgK98/+rKD3S8CxVIrdy9+z8ioguoDBiOMePO1X9hQ6JkwFcuNQkns+UaJSpnx4V8iOC28QY+/6KFSBeIxaJVHuxoDo0k7sz1bIpwrETalq5hI9oxVfzadjP6dD3C+/B9gfn87g1zs3u2HHDz9/CIGjmY8OWhUjBlD4wpR8lWijq6wcyD4XW/ZQTBfqeJHbM5WGB9/W2sA/2yvp6k+0Qckoj6rNlaxdsYoe/8reV/6u3GsBKcdFtBqR0T/kU5EPqABzuZLLzPjklafXeq+n73s4JkXgFIXFDw2IdIMMBbh1vTdRgOqM0roNQwiN8TLpcEtC6dhfPK25gCLivbALtZUm4wDcQFYjCQdbh/ioDg1q3TwwIaUfSomwqFUInqpVOiK5QqVnK16yz854OCFg/LSLBSi6nFopBaJnXlkgtBHjCEb9WVDDgPDmiVao6zBBUR4+sztPsAvHmU89KwvOMn+KuDJfhuLsLZ7y/8kPFc+ArDEZndCwWYdROAShnLjmjKUZSqWetfJuJuk7Cxfx5XyszaoV9rQQtYkMD3TWYsjYwQ3ThgV6u1k7w11G1aRTJy1sEfJnBAOU5DPLOOzd/gA//wA49+3+/ZoAU8C9hIxRqoPSCeAlAG3zwc+2uEebIaYKQPTswqbByoYj9t3L5IbuZ5s2Z/NoB9/WWH/FOHY6QZ6cIM45nAQnbQxsVHpSIzRaGcvSPgpAViANTZvEazEEWDYswB8+QTjnTdKGA7hbJbx7YeBM1mgT8CNCqjsAxuHTpOR/Ve+kxfA2LE7JT6zF8vLcs2wfeOH2KUpVyh/3vP4i90vp9/CnuMKe15pbMlqxqJF700PkdYPJSKjkyvs9dEB8SEjhuy9IgUbAeuWrcC1m+aziVKF8cOngJdPCKA8n3KjQFxYdjRwMYZiuToZqzxzukjIVwnXj5T1S2PzUoq+QNl86dvM+JithjNFwtOTCk8+17zFeqF6fK2CijLWRHyvTzeX5gwBBUs7QrkSzSl6rLDW224A1gws3snOA4xnXvapt541a0NHKOynm3FKQN+JosLGlIeJpKR22LuI8B3K5sr3M/id9pr19+Fn9/sJZK3mFkn/Gy5ROjpj1IJwpfdcAVhin4U1e6ISARMDwLbrhAqbv0FHzzCeeInR5wCpuL/v9sneKy9gyG/czdrJMEVlSrmErcN2UzwI9GPK5MuP2U7mfmZS4YVX/Bjo8LWUGizS85p1hGSdE7+txTP6bqAOCRVrlajqS83XbwbecJnOs2252fwsQ6hZ2pFMRtl/ayG3gamy5cYWufFkUYLwCTeNWbZsEe2gbK70LAPXdTvI8PPTeYKA/OTu4L9GQFzCXzgwAKSGFIYc7spnKtgZdUgAFvelsOZrNwE3X946sOH5VD3Gjn2sbdkxAdmCgBVuX9yJ58oKVw1XkLSY50zAc7IHWzNyhAf96AEH+yehpelWrjVjhGiSMBZlcR51fIUBFoFKqFcMGrddD1w63hnAMpgn93uQUCRRmbQU3aWKFJ5gvgKcLilc2l/FSMye0UOMHZTJlU/bzBw0Az+dIzx3TGHHLn8PbHZt2KSgHMZ4N+qRsVYFrFnSUWXfFYPGO28ELptYCHClyrjnCeCJF32Hxi1XAnfcLFLy/Hu37w0ADqxYhoprHqpmE1zie9HLjxUUxpNVLWzZu2iasvnyLDN3s6yLjuexgw4OHAUOmbjoJUa++RKlY5bFc9TxFQZY2HPZ/+RngXe/Hrh87UKAv79DTJDzA99Fwn7PG+ff+8huD/kS0C/6cNwXtsRUaSNiUnawyRxhKAZcNmBPHyaiUk8Bzs4SnplSePw5P5uwfgsOC12XvE7BdRgjXfDnmr3ZWKvEHBkAfMfrgS3rFgL8Z//M+gUQsIxrUSTmP//Q/Hsf2OXp+/qTvtokurCoSyaeuuOXMnjwlRwhFSVcMWRPktYA94pFmwnvO6EgyWdPPOdLtDUvf92KXHKZ7z3qxLEvL4oSyVli8uTEQckOrPgClrxYuSLjzpsJV6xfCPBf/AvrPVrAMi+gWKw+5/thatf9z3g4XwAGk0DaOBsCn7D2NNZnQrSJ+NG8H30pgpa9S7Po3ghZ4UE+dUjh+DnCzr3zSy6E77lsi9KpJ+0ArM2QoRIe2lsURGr4rkDfW5QtAu97E+HKBgDf97RIyHMAS5ti4br9pvkA3/e0h5k8MBAALGZM0Yd1THUQ01XLoOhAljteJN3ONRbjtbSQ1Qs1qf4NFIqS/fjISWDfoSDZuq6myqVbFGLi/zXSQJ3tPaxpSfvakCFxVAFXEEuV1nsFYDFJGndghZErAO+/hXDVhsZC1oPPAruP+C/LdZuBt1+3UMj6wROM0xnGQMKn4Hk26SDHycRxmQS2dijxaIEQUaQzIWxdWk2ylSbabFCirkim4akZ4NmXfBDCe/DlW5SOvdJOBpNxv0ijJiPfUKuxVA0lgY0jvgAkL4BsCcb+fOm4sNcOSCsYw6GTrL1P2gccfKTfmTxr27b8XwcAhCxcbdhTMCUsOgJcPWSRRRM9JqbKHzH49mYA2fheFuSpIw7OFYCn9wRhPQHKW7YqXdhsIsicr0VfBB2HKdgYMgyI8vKsHwLeek17Viobc2Jm7J1iZIq+AaRmp24zlMcXsoArLAJMoPutOxtaWbTnjymcLRB27YcOr5Vr6xWkY5Q3JedaMKCaMknyjfEQyXeyzwqFFivAnW/ojkJbGfdi92SLjJ0HWbsXta06FAjQChXLnCbzhOE+xusG7TkctLPBtruw1YU6lSHsP62QLQC7DwJrxhWqirFloI5FByjXtuTQPlsTpMrAb79t+anXzFWo+Me7WEd6yN4sTgmTEtMKwBL8d7ygsDZZxXqLhg7tLrTt8G8VYHPfoWmF4znC0TMKmSrwun5PmwH9sjfBj9CebGpVihnSWKlyReBTv9KhA7ndAS9y/z1PeugPoj5MOE+rEZe5ih/ZIUaOIYuJ49rhbztkp5P1kr10+wEXB2cIG/s9DPbNVa+rUYnZi4N4ZpGShTVLPctMAfjM7Z0BfOgE4+cHgfN5YP0ocOtVrbkS6+f5b9s9DKUCCTtg1SbdpdmazJT8tJZrR+xmIOqQHdtBd80ms9j3UtTkP3dHMBpnbOpnQ8C1MoXmOSMxi+QqUq2w+Ewe+My72gf4wV2Me570JV/tpPB8gH7/DmDNYHsS93d/4gNcs3QFOnIrtmrRgUWWuGmNPQm6FnQnC7ccxo5WgL/72QgqHuPGCV4ArBG05Kdmz2UgN+sDfDYL/O672wN4aprxt/fMpaEIECacdt0w8Ad3tgfwPz3kYbQfWk/WwQFBWG0zgEWNFwl6oA/YMmgT4CBsVhY+ky/fDebfaAWEXt7zyAEHR2YUbpjwEHfnDCI1cg4iNLQLMGDPYj48m2kfYKHeR3b7QpGoNgZg8TzJnv4XH5bvWgf5Hx/0MNLvmzLDADdzRuSrUqlH6XoeaxIWPUnhwHebqSvdvABTM8CDByLYMMDYPNA4jNQYLjQQs5J240dBtsuif/A4Y9+UgMFatRGAhTMUSqT39N/eBmwYaR3gbz7oYTQNDKR8Z4REf7TibZJojlmPcMOo9bzhudQVm8ln3QAsz37vWVez5zdvDAEc+tUALM53EbBmAoA//c72WPR9TzFePsma2kR/FR1cABbqPZ8nfPhWYP1wewCPpIHBNgAWs6qwZynWstWigUPWcV7ymd6HLaWPdgvwzikHe04oXD/uYbjBIXnzKLgInAsAvqtNNen+ZxiTp1mrNkJtYkcWwU24grT5628mrG0DYM2iDcChPXgpFi2hOjNlhcstq0cL0kcDQctKAni3AIv/9vu7I7rK683rF7LpBQAXgDMZ4BPvaI+CJc/o2FnW3iHRW8UTJHu7ULAIbe+5mTAx1DoFf+thD8MCcEjIMtV7Gq2JCXqX6gLXj5XbCgRstsYNE8BtlXBo1nkr3+84pPDSGQc3rfMwUkfFJq9XVCRh0YaCP/QWQryFUFjTv0RonJzxU1I0BSs/+kMoeCbruwvHW1SVJL/p7sdYAyxStE5Oa6ImCfWeLYlwVcF4wm7aSsMSDraKsLQCYLN7ciXgnr0RXQfrzZt4XtEWDXCdFC37sGQoXLe5dYr72R4PJ87DZ9GBkGUo+FweeMd1tGRgfHgOzx1mPH+E9f4rAGtX4hIAy94r3iOXCNePlawmni1ahMVn03bKKDUDsJXv/++4g+eOKlw55mHT4NwT2oMU6MEiaIkeLFQsku8Nl0jUhqScNAf68X0eTmXmwm8MixbOIJXof/kawmj/0u3kZhn7p4Bdh31hTbPn4IURgBfLPJR0lUyZsGWwiuG4RdXIP1upcRklWcKVtkuHgfc8xg/3RFGsspaoE0G2gzZ0BA59baoUVSnvmxoF5GyBtIVL9nJxRsglViqxb+uEMskUjPvClXwkPEe8P1pNEs9UYB0TKpb2MtKelA4O0l5M6SVxKMjeLWqWBOJJW8LujbNBUk8bxWsVKuJYIKTlqAGL0Rtm7ZYshGarlGErFNrKPScyhAdecrXA9cYNfhlgk60gYMii66C6or93SuSGRD4KSKUKaVYuFK9LFjoCJOv9Viq362zBIM9Xx2OJqTJg/aYt+SltSx+Vqm9OlMu0pdNLg7YkXlpKOwi7X6x+R1lYc9Yv43PDSFn7j+1eTUoZSme2ipHaGviuowq7TzgYTTJuWucLI8Yebfbi2QBUne8rlBscpCXgGoAFZDE8SByVpj5x64XSQOV7aVf2YT8x3P+ISVTUJ+nLpLqatvTBXAElS1smrSVc+9Ksg6mwU2afNY9YZs26H6X+Ph13PxNe+wWbjK1ywrYAFl/rAy9FcSoHbB5kbBllDZpJKtPpoKGUUJGEBSShNh35EQiopui3T30+0Pr0tKDAmc4hDgQ4kw1hgJW/dX9BrrGpVGteGOEAus0glMcUSgvXddHFSSukzZGXWXTqh9e5pXLCWtiyVBDcFsiywD960UVmlnDNuIe16YCKg2o5RjfWe7MAEQBsYrfmFSM1Vd5DZYRN8W8twAVCnGlT/5T4MX34g++gNtXwxN+rSz0EFfG0V6pW8HRu9lKUVFyCUuXuqhH75Rq0nNFqQXDNpi2V9LcFsLQjqtOPX3Qhhca3jjHWpX1nhA7eC1ixYd36b3koFCigIx39lai5B8Phrvr2IGHcsHbNBYLgwHDYkC6FGDows1Yhvu5QD2nTgCv7vtTFsl2Lo7bG7ZT01yBbOpTDJsiZWeDhgxEtSIlDQth1GBQTqFeLugx1HsSm+1uVsOPQWQ4B7r7TKngpwjU9arFhcxWF5yrBm1LFQQeGLcvzx/KEfIV0wtq1wz0sDE70WDoReUujtV5U0bN5rI5NkCUT75EDEQjYw3HGNeNz0nWAT8jP2KDnYMZm4o1ipswLop9eysgUqsUVbsdUs9NV36OMa0Z7w5bN7Do6VkfvxRYPxrIJsuzJ2w9HcCLrn4N07bicUGazh87bkvpXx3JySAhhPCkCVaV3bNk3bHR2MJZM0fbRdp0vW+Mnxeu055QDqTa1cRDYNMAd17TsdmyyX5+UksEl2eMJW4aqGLPpwG/EjLo92k7vxZYPp+x2Ieufl1NOdr7i4lxRLEuMSwcYo6mFZxzZ7te0J3vtzKwvTMk5iAMxxpXDlR4YMRrOoLvDKX3J0v7xsrYXW3Rl8T7tOen4xUIjrIWwsYSd/N1G4xXVSYA9UyRUPKkeC1w+WMVo74qL1g3D0vGy0upqciUu9XJIwN6+0w4OTit9rI2rWLsb1yQZ6b7OSxKbPkVHlvMLZ2ZJq23i55LDpzcNVrE26fV0r62ft7UDogMq7tkR77apWdqrMuPwjMLhGQdydqI2TijW8dZyVKzYjyWoT2zBi1URFtYrOrcOrq+I98ePwxbmLwYNOdlsfdrDaHx5D7/S62X7iHdf4OKNVa4804t6Hr0A2bQpOvPRjIOTOYWzRd/VOFel3a9ma8yYNcNJrQSir0zJ/RHJXY5D25BFOhYz5cpcNO2Qe1MiQQ1OxVg4ouaO09AzuWLlDvb4XlsHRi/3AklJ4POzCjkpyD0rjgmlvUQV5uBsYXHC+6BHHKF01npsqo+RtFCcrdv5yoHQpOjOZMy9r9W22gJYGs3my3/FzH/UagcX77O3AkT016lE5I/babFtgJnZzRYqP7VdHa+dQV+Q9xLtSMXdtxJRW+kPbQMc7MfrPZR3MGPjBbnYyzxpIkwqRG5JJGiq3a47Alg68YPlK4++2oSudhdo5e+n6ajr3ionqHQylo4B9im59Ase6EFmbhCi3slwLj4TXgEiyivwOxKJ6OOdrkxXAEun4nVij+VQS+sRRp1O6rXwnOy1pOi9yZj7P93Mp2uApfNMvvIRAn/nIsjdQDH3rIDLoI+lE+6/dtuiFYBDlHz3RXbdHSTClknRB7qlXDMKawCbPbnK9F8XBa9OQRYrFb+nmz23vmerABvpulwt339RhWoPZFGFIk7k9k6l5cV6sw6w0ZOrqHzvojGkRZCJdjhwP9iJntush54ALJ2KwJUrVL4M4A9frbbrZovX7fdiWwbwN8m4+7l2LVSt9t0zgM0AxEHhVflbF/flBbvjtHLot9pxHLQK6jxdupOH2n1GuxpR+S6Yb2332dfk/USPOnA/2qrLr5s16DkFm8EJm84Xq5/wPP7LC5eaaVop+pNEzPlmwJ67wa6lZ5cN4BDQw9l8+StEdNeFsjcLmMz89VQi8qdEdKYlZCzdtOwAm3EHIblfZeabLc1lVTYjccsK/NlEIvrESgxwxQAOCWHv9jz+Aph/cSUWoGd9Ej2mFH3RlkWq03GuOMBm4JLwRh4+z+DbOp3ManhOsvxY4UvpeOSR1TGe1TCK0BiC/OS7APoQwKHqHKtsoPOGQzMA/7sCvp5MRp9aTSNdNRRcvyhSTqJQqN7pgT8O4F3MvArC3uZGKdVsAPxIgb4djzv3EtHsagLWjGXVAhxeLCnxlC9W38fsbQPTNgZPrMRiSgU5ED9EpB5KxJx7iKjFkxlXYrR+n68KgOuXJ6ituQ1E2wj8eoA2McuxWPYuqbcM8BEG7QTzw1E38pBtR4C90S7e0qsS4AbsPJYrYYuqVrcy8VZm3gqmcSakiTkFQpqZ0kRIy7PMyBBxBowME2WJkQHxCSLaR0z7PMfZl4xiPxFdXaKvAAAADElEQVQVlwOEXvbx/3Bccpan8cseAAAAAElFTkSuQmCC",M=ae(59301),$=({className:qe,dataSource:mt=[],col:Dt=4,right:Ft,bottom:Zt=23,precision:_t=0,wrapWidth:G=1200,trackEventItems:Y,loading:J,handleVery:le=()=>!0})=>{const _e=Math.floor((G-(Dt-1)*Ft)/Dt);return M.createElement(p.Z,{spinning:J},M.createElement("div",{className:A()(V.list,qe)},!!mt.length&&mt.map((Ie,Ce)=>{const{subject_identifier:Xe,id:Je,identifier:bt,power:Ht}=Ie,Pe=Ie.is_public!=0&&Ie.is_public;return M.createElement("div",{className:V.wrap,key:Je,style:{width:_e,marginRight:(1+Ce)%Dt===0?0:Ft+_t,marginBottom:Zt}},M.createElement("a",{className:V.li,onClick:be=>{be.preventDefault(),le(Ie==null?void 0:Ie.first_category_url)&&(Y&&(0,R.L9)([Y]),(0,R.xg)(Ie.first_category_url))}},M.createElement("div",{className:V.top},M.createElement(E.Z,{title:Ie.name},M.createElement("div",{className:V.name},Ie.name)),M.createElement("img",{className:V.img,src:w.Z.IMG_SERVER+"/images/"+Ie.avatar_url}),M.createElement("div",{className:V.text,title:Ie.creator},Ie.creator),Xe&&M.createElement("div",{className:V.btns},M.createElement("div",null,"\u5F00\u653E\u8BFE\u7A0B"),M.createElement("aside",null,"\u5F00\u653E\u8BFE\u5802")),Pe&&M.createElement("div",{className:V.sign},"\u516C\u5F00")),M.createElement("div",{className:V.bottom},Ie.visits>0&&M.createElement(E.Z,{title:"\u8BBF\u95EE\u91CF",placement:"bottom"},M.createElement("span",null,M.createElement("i",{className:"iconfont icon-liulanyan"}),M.createElement("span",null,Ie.visits))),Ie.course_members_count>0&&M.createElement(E.Z,{title:"\u6210\u5458",placement:"bottom"},M.createElement("span",null,M.createElement("i",{className:"iconfont icon-chengyuan"}),Ie.course_members_count)),Ie.tasks_count>0&&M.createElement(E.Z,{title:"\u4F5C\u4E1A",placement:"bottom"},M.createElement("span",null,M.createElement("i",{className:"iconfont icon-zuoye"}),Ie.tasks_count)),Ie.is_end?M.createElement("div",{style:{color:"#6B758B"}},"\u5DF2\u7ED3\u675F"):M.createElement("div",{style:{color:"#00B187"}},"\u8FDB\u884C\u4E2D"))),!Ie.is_accessible&&M.createElement("div",{className:V.lockWrap},M.createElement("img",{src:`${w.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),M.createElement("span",{className:"mt15 font16 c-white"},"\u975E\u8BFE\u5802\u6210\u5458\u4E0D\u53EF\u8FDB\u5165")))}),!mt.length&&M.createElement(P.Z,null)))},q={flex_box_center:"flex_box_center___d27mZ",flex_space_between:"flex_space_between___qfRU9",flex_box_vertical_center:"flex_box_vertical_center___fCRld",flex_box_center_end:"flex_box_center_end___ORMV8",flex_box_column:"flex_box_column___PNKtZ",tabs:"tabs___alpa7",tabsWrap:"tabsWrap___aCQjw",tab:"tab___MKLr4",active:"active___nl_4v"},se=ae(76560),pe=({dataSource:qe=[],value:mt,onChange:Dt,className:Ft,style:Zt={},tabBarExtraContent:_t})=>te.createElement("div",{className:A()(q.tabs,Ft),style:Zt},te.createElement("div",{className:q.tabsWrap},qe.map((G,Y)=>!(G!=null&&G.hide)&&te.createElement("aside",{className:q.tab,onClick:()=>{Dt(G.id),G.link&&se.history.push(G.link)},key:Y},te.createElement("div",{className:mt===G.id?q.active:""},G.name),(G==null?void 0:G.resetCount)==null&&(G==null?void 0:G.total)!==void 0&&te.createElement("span",null,"\uFF08",G==null?void 0:G.total,"\uFF09"),(G==null?void 0:G.resetCount)!==void 0&&(G==null?void 0:G.total)!==void 0&&te.createElement(E.Z,{title:(G==null?void 0:G.tip)!=null?G==null?void 0:G.tip:""},te.createElement("span",{style:{color:"#9096A3"}},"\uFF08",te.createElement("span",{style:{color:"#000"}},G==null?void 0:G.resetCount),"/",te.createElement("span",null,G==null?void 0:G.total),"\uFF09"))))),te.createElement("div",{className:q.tabBar},_t)),De=({className:qe,style:mt={},children:Dt})=>te.createElement("div",{className:A()(qe),style:mt},Dt),Ue={flex_box_center:"flex_box_center___e6HxQ",flex_space_between:"flex_space_between___RnXYe",flex_box_vertical_center:"flex_box_vertical_center___lVxPk",flex_box_center_end:"flex_box_center_end___bu8yv",flex_box_column:"flex_box_column___JczGj",orderWrap:"orderWrap___ZfyGX",orderIconWrap:"orderIconWrap___XTB_O",orderAsc:"orderAsc___KWHmA",orderDesc:"orderDesc___rHdbB",active:"active___a7eSP",cursorPointer:"cursorPointer___gs9kL",orderTextWrap:"orderTextWrap___teAKn"},Ge=ae(75727),Ae=ae(93041);const We=[{id:"updated_at",name:"\u6700\u65B0\u52A8\u6001"},{id:"created_at",name:"\u6700\u65B0\u521B\u5EFA"},{id:"name",name:"\u540D\u79F0\u6392\u5E8F"}];var Se=({sortValue:qe,dropValue:mt,className:Dt,onSort:Ft,onDrop:Zt,dataSource:_t=We})=>{var G;return te.createElement("div",{className:A()(Ue.orderWrap,Dt)},te.createElement(Ge.Z,{dropdownRender:()=>te.createElement(Ae.default,null,_t.map((Y,J)=>te.createElement(Ae.default.Item,{key:J,onClick:()=>Zt(Y.id)},Y.name)))},te.createElement("span",{className:Ue.orderTextWrap},(G=_t.find(Y=>mt===Y.id))==null?void 0:G.name)),te.createElement("span",{className:Ue.orderIconWrap},te.createElement("span",{className:Ue.orderAsc},te.createElement("i",{className:qe==="asc"?`iconfont icon-sanjiaoxing-up font12 ${Ue.cursorPointer} ${Ue.active}`:`iconfont icon-sanjiaoxing-up font12 ${Ue.cursorPointer}`,onClick:()=>Ft(qe==="asc"?"desc":"asc")})),te.createElement("span",{className:Ue.orderDesc},te.createElement("i",{className:qe==="desc"?`iconfont icon-sanjiaoxing-down font12 ${Ue.cursorPointer} ${Ue.active}`:`iconfont icon-sanjiaoxing-down font12 ${Ue.cursorPointer}`,onClick:()=>Ft(qe==="asc"?"desc":"asc")}))))},ge={flex_box_center:"flex_box_center___LCi0B",flex_space_between:"flex_space_between___hzONe",flex_box_vertical_center:"flex_box_vertical_center___ZyQRE",flex_box_center_end:"flex_box_center_end___XKM74",flex_box_column:"flex_box_column___p8LCU",btn:"btn___In02G","mediacy-round":"mediacy-round___uveEv","mediacy-default":"mediacy-default___dDxsd",default:"default___K791v"},Re=ae(99571),ve=Object.defineProperty,Le=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable,oe=(qe,mt,Dt)=>mt in qe?ve(qe,mt,{enumerable:!0,configurable:!0,writable:!0,value:Dt}):qe[mt]=Dt,ie=(qe,mt)=>{for(var Dt in mt||(mt={}))Fe.call(mt,Dt)&&oe(qe,Dt,mt[Dt]);if(Le)for(var Dt of Le(mt))me.call(mt,Dt)&&oe(qe,Dt,mt[Dt]);return qe},fe=(qe,mt)=>{var Dt={};for(var Ft in qe)Fe.call(qe,Ft)&&mt.indexOf(Ft)<0&&(Dt[Ft]=qe[Ft]);if(qe!=null&&Le)for(var Ft of Le(qe))mt.indexOf(Ft)<0&&me.call(qe,Ft)&&(Dt[Ft]=qe[Ft]);return Dt},ye=(qe,mt,Dt)=>new Promise((Ft,Zt)=>{var _t=J=>{try{Y(Dt.next(J))}catch(le){Zt(le)}},G=J=>{try{Y(Dt.throw(J))}catch(le){Zt(le)}},Y=J=>J.done?Ft(J.value):Promise.resolve(J.value).then(_t,G);Y((Dt=Dt.apply(qe,mt)).next())}),Te=qe=>{var mt=qe,{className:Dt,style:Ft,children:Zt,loading:_t=!1,openLoading:G,onClick:Y=()=>{},size:J="middle",shape:le="round"}=mt,_e=fe(mt,["className","style","children","loading","openLoading","onClick","size","shape"]);const[Ie,Ce]=(0,te.useState)(!1);return te.createElement(Re.ZP,ie({onClick:(0,s.throttle)(Xe=>ye(void 0,null,function*(){G&&Ce(!0);try{yield Y(Xe)}catch(Je){console.log("error",Je)}G&&Ce(!1)}),2e3,{leading:!0,trailing:!1}),className:A()(ge.btn,ge[`${J}-${le}`],Dt),style:Ft,size:J,shape:le,loading:Ie||_t},_e),Zt)},Oe={flex_box_center:"flex_box_center___TB7bQ",flex_space_between:"flex_space_between___oBlTb",flex_box_vertical_center:"flex_box_vertical_center___b5XbB",flex_box_center_end:"flex_box_center_end___CNhe7",flex_box_column:"flex_box_column___yHXKW",head:"head___ghH72",node:"node___mjPEy"},Ze=({className:qe,style:mt,children:Dt=null,onClick:Ft,title:Zt})=>te.createElement("div",{className:A()(Oe.head,qe),style:mt},te.createElement("span",{className:"primary-hover",onClick:Ft},te.createElement("i",{className:"iconfont icon-fanhui2 font12"}),"\u8FD4\u56DE"),te.createElement("b",{title:Zt},Zt),te.createElement("div",{className:Oe.node},Dt)),tt={flex_box_center:"flex_box_center___AlHuF",flex_space_between:"flex_space_between___vN2LW",flex_box_vertical_center:"flex_box_vertical_center___Ac7D2",flex_box_center_end:"flex_box_center_end___y38I7",flex_box_column:"flex_box_column___iQE6P",btns:"btns___sNgTb",confirm:"confirm___Ozirl",cancel:"cancel___aiq1I"},nt=({confirmShow:qe=!0,confirmTitle:mt,confirmClick:Dt,cancelShow:Ft=!0,cancelTitle:Zt,cancelClick:_t,className:G,style:Y,confirmLoading:J=!1})=>te.createElement("div",{className:A()(tt.btns,G),style:Y},qe&&te.createElement(Re.ZP,{loading:J,onClick:Dt,type:"primary",className:tt.confirm},mt),Ft&&te.createElement(Re.ZP,{onClick:_t,className:tt.cancel},Zt)),At={flex_box_center:"flex_box_center___jkpdr",flex_space_between:"flex_space_between___OtsL8",flex_box_vertical_center:"flex_box_vertical_center___rbcb_",flex_box_center_end:"flex_box_center_end___zBR21",flex_box_column:"flex_box_column___nS_eP",fixedBottom:"fixedBottom___oJl7m",wrap:"wrap___A3Oq1",center:"center____VL1y"},Bt=({className:qe,style:mt={},LeftContent:Dt,children:Ft,RightContent:Zt})=>te.createElement("div",{className:A()(At.fixedBottom,qe),style:mt},te.createElement("div",{className:At.wrap},te.createElement("div",{className:At.left},Dt),te.createElement("div",{className:At.center},Ft),te.createElement("div",{className:At.right},Zt))),st={flex_box_center:"flex_box_center___tY8Yn",flex_space_between:"flex_space_between___vHdYA",flex_box_vertical_center:"flex_box_vertical_center___pa61F",flex_box_center_end:"flex_box_center_end___HyDXt",flex_box_column:"flex_box_column___UjZek",crumbs:"crumbs___V41Oe",hover:"hover___bEIVd"},ur=({className:qe,style:mt={},dataSource:Dt=[]})=>te.createElement("div",{className:A()(st.crumbs,qe),style:mt},Dt.map((Ft,Zt)=>Zt<Dt.length-1?te.createElement(te.Fragment,{key:Zt},Ft.path||Ft.onClick?te.createElement("span",{className:st.hover,onClick:Ft!=null&&Ft.onClick?Ft.onClick:()=>se.history.push(Ft.path)},Ft.name):te.createElement("span",null,Ft.name),te.createElement("span",null,"\xA0",">","\xA0")):te.createElement("span",{key:Zt,style:{color:"#5F6368"}},Ft.name))),br=ae(11938),Qt=Object.defineProperty,Fr=Object.defineProperties,Lt=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertySymbols,yt=Object.prototype.hasOwnProperty,ir=Object.prototype.propertyIsEnumerable,Jt=(qe,mt,Dt)=>mt in qe?Qt(qe,mt,{enumerable:!0,configurable:!0,writable:!0,value:Dt}):qe[mt]=Dt,St=(qe,mt)=>{for(var Dt in mt||(mt={}))yt.call(mt,Dt)&&Jt(qe,Dt,mt[Dt]);if(gt)for(var Dt of gt(mt))ir.call(mt,Dt)&&Jt(qe,Dt,mt[Dt]);return qe},it=(qe,mt)=>Fr(qe,Lt(mt)),Rt=(qe,mt)=>{var Dt={};for(var Ft in qe)yt.call(qe,Ft)&&mt.indexOf(Ft)<0&&(Dt[Ft]=qe[Ft]);if(qe!=null&>)for(var Ft of gt(qe))mt.indexOf(Ft)<0&&ir.call(qe,Ft)&&(Dt[Ft]=qe[Ft]);return Dt};const{Countdown:Vt}=br.default;var Yt=qe=>{var mt=qe,{onChange:Dt}=mt,Ft=Rt(mt,["onChange"]);const[Zt,_t]=(0,te.useState)(null);(0,te.useEffect)(()=>{typeof Zt=="number"&&Zt>=0&&Dt(Zt)},[Zt]);const G=Y=>{const J=Math.floor(Y/1e3);_t(J)};return te.createElement(Vt,it(St({},Ft),{onChange:G}))}},54070:function(qt,$e,ae){"use strict";ae.r($e),ae.d($e,{default:function(){return Fr}});var te=ae(49661),re=ae(25399),X=ae(96599),D=ae(60242),W=ae(37285),y=ae(29787),L=ae(91882),A=ae(82326),s=ae(45685),x=ae(62957),c=ae(59301),u=ae(76560),f=ae(16288),i=ae(98072),o=ae(37034),d=ae(46798),m=Object.defineProperty,_=Object.defineProperties,h=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,p=(Lt,gt,yt)=>gt in Lt?m(Lt,gt,{enumerable:!0,configurable:!0,writable:!0,value:yt}):Lt[gt]=yt,E=(Lt,gt)=>{for(var yt in gt||(gt={}))r.call(gt,yt)&&p(Lt,yt,gt[yt]);if(v)for(var yt of v(gt))a.call(gt,yt)&&p(Lt,yt,gt[yt]);return Lt},S=(Lt,gt)=>_(Lt,h(gt)),w=(Lt,gt,yt)=>new Promise((ir,Jt)=>{var St=Vt=>{try{Rt(yt.next(Vt))}catch(jt){Jt(jt)}},it=Vt=>{try{Rt(yt.throw(Vt))}catch(jt){Jt(jt)}},Rt=Vt=>Vt.done?ir(Vt.value):Promise.resolve(Vt.value).then(St,it);Rt((yt=yt.apply(Lt,gt)).next())});const R=[{name:"\u6839\u8282\u70B9",src:"/images/one.svg",color:"#CC7CF5"},{name:"\u8BFE\u7A0B",src:"/images/kc.svg",color:"#3241F7"},{name:"\u7AE0\u8282",src:"/images/zj.svg",color:"#5e54e7"},{name:"\u77E5\u8BC6\u70B9",src:"/images/zsd.svg",color:"#FFDF55"},{name:"\u5B9E\u8BAD",src:"/images/sx.svg",color:"#4E9DFF"},{name:"\u4F5C\u4E1A",src:"/images/zy.svg",color:"#445DF3"},{name:"\u89C6\u9891",src:"/images/sp.svg",color:"#6BC4DE"},{name:"\u8BFE\u4EF6",src:"/images/fj.svg",color:"#6BDE73"},{name:"\u8BD5\u5377",src:"/images/sj.svg",color:"#2D9534"},{name:"\u5176\u4ED6",src:"/images/qt.svg",color:"#2D947C"}],O=(Lt,gt)=>{const yt={};let ir=null;return Lt.forEach(Jt=>{yt[Jt.properties.uuid]=S(E({},Jt),{id:Jt.properties.uuid,children:[]})}),gt.forEach(Jt=>{const St=yt[Jt.startNodeUuid],it=yt[Jt.endNodeUuid];St&&(St.id=St.properties.uuid),St&&it&&St.children.push(it)}),Lt.forEach(Jt=>{!gt.some(it=>it.endNodeUuid===Jt.properties.uuid)&&(ir=yt[Jt.properties.uuid])}),ir},z=(Lt,gt)=>{const yt=Lt.getParentData(gt.id,"tree");return yt?gt.style.x>yt.style.x?"right":"left":"center"};var P=({loading:Lt,nodes:gt=[],relationships:yt=[]})=>{const ir=(0,c.useRef)(null),Jt=(0,c.useRef)(),St=(0,c.useRef)(0);(0,c.useEffect)(()=>{(gt==null?void 0:gt.length)>0&&it()},[]);const it=()=>w(void 0,null,function*(){var Vt,jt,Yt;const qe=O(gt==null?void 0:gt.map((Zt,_t)=>{var G,Y,J,le,_e;return S(E({},Zt),{key:_t,title:(G=Zt==null?void 0:Zt.properties)==null?void 0:G.name,newcolor:parseInt((Y=Zt==null?void 0:Zt.properties)==null?void 0:Y.color)===1?"#CC7CF5":((J=R==null?void 0:R.find(Ie=>{var Ce;return(Ie==null?void 0:Ie.name)===((Ce=Zt==null?void 0:Zt.properties)==null?void 0:Ce.nodeType)}))==null?void 0:J.color)||"#2D947C",colornodeType:parseInt((le=Zt==null?void 0:Zt.properties)==null?void 0:le.color)===1?"\u6839\u8282\u70B9":((_e=R==null?void 0:R.find(Ie=>{var Ce;return(Ie==null?void 0:Ie.name)===((Ce=Zt==null?void 0:Zt.properties)==null?void 0:Ce.nodeType)}))==null?void 0:_e.name)||"\u5176\u4ED6"})}),yt==null?void 0:yt.filter(Zt=>Zt.type==="\u5305\u542B"));Jt!=null&&Jt.current&&((Vt=Jt==null?void 0:Jt.current)==null||Vt.destroy());const mt=(0,d.RN)(qe),Dt=(jt=mt.nodes)==null?void 0:jt.filter((Zt,_t,G)=>_t===G.findIndex(Y=>Y.id===Zt.id)),Ft=(Yt=mt.edges)==null?void 0:Yt.filter((Zt,_t,G)=>_t===G.findIndex(Y=>Y.source===Zt.source&&Y.target===Zt.target));Rt({nodes:Dt,edges:Ft})}),Rt=Vt=>{var jt,Yt;Jt.current=null,Jt.current=new d.kJ({container:ir.current,autoResize:!0,autoFit:{type:((jt=Vt==null?void 0:Vt.nodes)==null?void 0:jt.length)>20?"view":"center",options:{direction:"both",when:"always"}},animation:!(((Yt=Vt==null?void 0:Vt.nodes)==null?void 0:Yt.length)>300),data:Vt,node:{style:{labelText:qe=>qe.title,labelFill:"#333333",fill:qe=>qe.newcolor,labelBackground:!1,labelPlacement:function(qe){const mt=z(this,qe);return mt==="center"?"right":mt},ports:[{placement:"right"},{placement:"left"}]},animation:{enter:!1}},edge:{type:"cubic-horizontal",animation:{enter:!1}},layout:{type:"mindmap",direction:"H",getHeight:()=>32,getWidth:()=>32,getVGap:()=>4,getHGap:()=>80,getSide:qe=>(St.current++,St.current%2==0?"left":"right")},behaviors:["zoom-canvas","collapse-expand","drag-canvas"]}),Jt.current.render()};return c.createElement("div",{style:{height:"100%"}},c.createElement(y.Z,{spinning:Lt,className:"mt60 w100",tip:"\u52A0\u8F7D\u4E2D..."}),c.createElement("div",{style:{height:"100%"},ref:ir}))},F=ae(42441),K=ae(34055),V=({abilityGoalItem:Lt=[]})=>{var gt,yt;const ir=(gt=(0,K.eY)())==null?void 0:gt.username,Jt=typeof((yt=Lt==null?void 0:Lt[0])==null?void 0:yt.user_grasp_rate)=="number",St=Lt.map(jt=>jt.grasp_rate),it=Lt.map(jt=>jt.user_grasp_rate),Rt=()=>{const jt=Lt.map(mt=>mt.name),Yt=[{type:"bar",name:"\u7CFB\u7EDF\u5E73\u5747",data:St,barMaxWidth:"20%",barGap:"50%",itemStyle:{color:"#028DFD"},label:{show:!0,position:"top",formatter:"{c}%",color:"#666"}}];Jt&&Yt.unshift({type:"bar",name:ir,data:it,barMaxWidth:"20%",itemStyle:{color:"#CDCB56"},label:{show:!0,position:"top",formatter:"{c}%",color:"#666"}});const qe={tooltip:{appendToBody:!0,trigger:"item",formatter:mt=>{const{value:Dt,name:Ft,seriesName:Zt}=mt;return`<div>
|
|
${Ft}<br/>
|
|
${Zt}\uFF1A${Dt}%
|
|
</div>`}},grid:{left:"0%",right:"10%",bottom:"3%",containLabel:!0},xAxis:{data:jt,axisLabel:{color:"#666",formatter:function(mt){return mt.length>4?mt.substring(0,4)+"...":mt}},axisTick:{show:!1},axisLine:{show:!1}},yAxis:{show:!1,type:"value",axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:"#666",formatter:"{value}%"},splitLine:{lineStyle:{color:"rgba(164,200,252,0.1)"}}},series:Yt};return c.createElement(F.Z,{option:qe,className:"w-full"})},Vt=()=>{const jt=Math.max(...St,...Jt?it:[])*1.2||10,Yt=[{value:St,name:"\u7CFB\u7EDF\u5E73\u5747",lineStyle:{color:"rgba(2, 141, 253, 1)",window:3},areaStyle:{color:"rgba(2, 141, 253, 0.35)"},itemStyle:{color:"rgba(2, 141, 253, 1)",borderWidth:2}}];Jt&&Yt.unshift({value:it,name:ir,lineStyle:{color:"rgba(205, 203, 86, 1)",window:3},areaStyle:{color:"rgba(205, 203, 86, 0.35)"},itemStyle:{color:"rgba(205, 203, 86, 1)",borderWidth:2}});const qe={tooltip:{appendToBody:!0,trigger:"item",position:"right"},radar:{indicator:Lt.map(mt=>({name:mt.name,max:jt,min:0})),splitArea:{areaStyle:{color:["#fff","#f3f4f9"]}},name:{color:"#333",fontSize:12,formatter:function(mt){return mt.length>3?mt.slice(0,3)+"...":mt}},nameGap:5,axisLine:{lineStyle:{color:"#D9D9D9"}},splitLine:{lineStyle:{color:"#D9D9D9"}},center:["50%","50%"],radius:"50%"},series:[{type:"radar",symbolSize:2,tooltip:{trigger:"item",formatter:function(mt){console.log(mt);let Dt=mt.name+"<br/>";return mt.value.forEach((Ft,Zt)=>{Dt+=Lt[Zt].name+"\uFF1A"+Ft+"%<br/>"}),Dt}},data:Yt}]};return c.createElement(F.Z,{option:qe,className:"w-full"})};return c.createElement("div",{className:"flex flex-col item-center mt-20px-rem"},c.createElement("b",{className:"text-16px-rem"}," ",Jt?"\u80FD\u529B\u56FE\u8C31\u4E2A\u4EBA\u638C\u63E1\u60C5\u51B5":"\u80FD\u529B\u56FE\u8C31\u638C\u63E1\u7387\u60C5\u51B5"),Jt&&c.createElement("div",{className:"flex item-center gap-20px-rem text-14px-rem mt-10px-rem"},c.createElement("div",{className:"flex item-center"},c.createElement("b",{className:"mr-10px-rem flex",style:{width:"16rem",height:"8rem",background:"#CDCB56"}}),c.createElement(re.Z,{title:ir},c.createElement("span",null,(0,te.Pq)(ir,4)))),c.createElement("div",{className:"flex item-center"},c.createElement("b",{className:"mr-10px-rem flex",style:{width:"16rem",height:"8rem",background:"#028DFD"}}),"\u7CFB\u7EDF\u5E73\u5747")),Lt.length<3&&Rt(),Lt.length>=3&&Vt())},C=ae(71360),M=ae(82093),H=ae(90524),$=ae(41550),q={NextAbility:"NextAbility___wLOPq",AnchorDomStyle:"AnchorDomStyle___CG1xj",AnchorDom:"AnchorDom___jjRxi"},se="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA1lJREFUWEfFl09oXFUUxn/nvTEpbXXRos4bgwgGRYtZCIILhQSFtgEjgnShCNJV05pMqQstpV1UjW6seY1pFERB6EYEJVJbRMmALgqCixTFlgoupjOjUhdNo0068z65w0ycmcxMJmbk3e39zne+d/69c40Oz45P1PPnbwxZxEgkHjQjJUg5c4OcRM4zfpLH7LY7mftxjy13Qm1rge6ZVnK5yLEInkfctha+fG9c8+B0T4Ljvx6wQjublgL6T6r3L3EkEoeALR05Xg1a9IwTm403Lo/bUjOOpgLcV98o8hni0f/ouN7MOL8pwTPNorFKQN+kBkrGGYm+rjivkJiR9T2Gs2N2oZa3ToD78qUi33fbedWhE9Gb4JHaSKwIcDm/LjJdC3ur8BnntxqD1ZpYEZAKdTwSR7sZ9lZcnvFaLm3HKi0M5aK7yeUNVPt6dS9uuoV+l4pyBFKhTkVidL0sG8F7xkwubfvNTbiref7oeMhsxGt9+V/bHnC7BVPaqRLnusW7Hh7z2WWpUNOR2N/W0Jj3jBcRd0fi8zqsMW/iKYzDEvs8n6cxslGJjxAD7Xg945QlJzUHDLbuGj72U+zL7rG/g0k9Jvi2FpvwGcqOWSYI9abEqwaP5w/ad6n3tVk3eE/ihTYiMhaEuihx3yqQIYwDhXGbcXfJk3qWiA+BW1ewxheFtI3cO6M7FpfKXeTuFvDYWxi3Tyt2o4jpMlvDMeOSJUMtILY2EfBNIW1PDs4pcfECbyni5QZM0fN5KDdmPwehZlz462rMOHH/AK9khqyYDPU14okmPq63FGDGuXzadt/1rrZHRU4LdtYSVNsomNYDusk8kGgQ8JXn89yVl+xqEOqsxK4mqVhonQIo4jNSGLOzkiwIOWQwIehxYd7SS/8vo/Z7MtQsrggrx2BZxpH8OG+bmZJT2k2J2UaB5SlYTkG7IjRk8M62gMNuw0mGGkacMXg9f9CO9k1psFjCFfG/x2fYiS5vUAUm5PaJJvmvGGRcG645BQ1+8Dz2lowUJb40mJTHBMLltr7VfIY9UVDEB4KH12zD2AdR7KPYhaiTNKxnxHaCXfkZOXDsv+NKFOJbSJyA2FeyaipiW0qrhRPrWl4VEevDpCoi1qdZbR/H9jhtHCb/1/P8H/hZr0qiHgOCAAAAAElFTkSuQmCC",ue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA/1JREFUWEe1l19oW2UYxp/nNMmWdO1cZmcSW3TYKWwKoh3MmdBVUOmEDSeINvNGGEwRLwRR0Y12FHF44c2qTvEuCaNCRS+KiJiQP512eOFFB3XzX7FNXVnLlrRL8+e8ck6XmS45OUc9O5fnfO/7/L7n/b7vvB9h8dk1OuVaLF3po1QOqMBOEgGBBLRwgnMimFOA88KWr7zOzfGpZ3cVraSm2aC7Ryd9xVLxuCoSBqTdbPzad14lJeba6DnxxzM92WYxhgDd4xc2rCxl31YFrwFotSZcN2qZ5AetW3zDF/fvWG2UoyGANutCcfULQPb8R+GbwvjDBrf76UZu1AF0RiYeqKA8LkCnPeLXiwLOKg48Nftc6KfavOsAtJmvFgvn7BavChKcdbndu2uduAGg1Ty/OJ+wz3YD/4jJjYGu3t/7thfWdtD1JxBNnlAFx+y03SgXyeFsOKRr6QBri65w0Wi1EyiAvGaUUASbAVGswhNccbnd3VopdIBANP2hKupLBtuk0N6mbJs+GMwZCfijqXEAPSLS8S8gTmcPh45SO+EuFxcXjA4ZkkvZcMjbLLE/kvrY4VBOlSvqd9YhmNvq8t5Of3TiSZHy103qZQ4QTUYgzAO4SyiPQ9BixQkq7GcgkhpRIS//H4DaWF8kqR29PisACpWP6Iuk4oDsu0UAywQ+BRkUkZ56DSboj6amReReKwAyiV4Qz9eNJcbYg2+09zccIPIk+7MDoXTgzNmH1HLpx5vjSP5MXzSZg2CTFQArtuoAxKaquA4VTb0HkTcagOe1ElwFpM0OgEER5XQ0dQkKD2cHQvrC9kfSbwnUdxvnZ862Egw9LN9+EsucEshZCPo7OtqPLCzkXjUW1xuZaVsWoTZzXZwS02reOTrRXSlVPheRB5uWjYzbsg190fSxFiA9Gw7GzW2vQSJHbDmIfJHUZ0fDwSODpNq85uv9UBTlCVuOYl8sdZICHwTXBHgREKfpjiGu3Hmfp8P8Z0SsOkH/TDi0ZJRUWwOJBJRf59JtJcGfAvGYA3BkPhx6xdLvGESZgrJZUiEcEDjMxoHIu+nq/m1gz1//NCSR9JAK9bhpsB0DyMH5cGhIS7W+JVvKxiF4xA6NJgdbxuv0Pla9uKxrSrfHvr+jIMVzIui6FRAEZzweZfcvhx69VM1f15Z3ncncX65Uxu2G0MSdCvfPDASnaifX8GKiO6EWxwTYa4cTJDMet3KoduaGDlQ/6K1a+fKbELze7G/ZHJA5kO9vdW45aXRZNb2c3jOW2ba8Iu8Q6gsC3GbFEa2PFGGk1cPhRrM2LUEjkX1xcVyYT/WqKg8A2CmAn4B+PRdgjoDWip1XqHy5w783meij6bmhxf4NftTdgSGLQUwAAAAASUVORK5CYII=",pe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAsVJREFUWEfFl0tIVGEUx39nZsxoKpGISlqmC42gxwxCEApBUhC0iR7bMLRyhrZRC6Ntecc0CtoVRRshkbKN0iJ0RmtRBj0WLUKLoEAz0po5cWe4zdWZO/czJuauzz3n9/3P6/sE02/qwSp+fm5FM4dRbUSlDqEu+7syjeg0Iq+RwENWbxqh6eiiiWvxNZrq28z870vASdD1vvZZA5kF7hIOddN05lOpf7wB3iWq+aYXED2PEjYLvMxKmEflKrVyhfquhWI+igPkTj0A2vxPgQt+kjHCoSPF1CgEmOzZQVqGQLeWJ7jjRT4SCBxkz7mXbr9LAXInT5U/uAsiHIq4lcgD5HI+Wj7ZvfSTMWqlxamJPEDS6ga9WF7ZPSEuE43ZnUUOwJb+x6/3ntUujBOqPsbOjg+egBNWK6qDRh1jd8eaqm12KnIASasftMPTuXCKSPy2rzrPr+8jnR5Cda2vLXKDaKxTsCfc/MyXkkNGAieIdN3zdwqkevei6UfAutL2Mkt4y0ZhsvcA6fTjksYrAbAdTSaaSeuw7+QMBtuECauPjHaWFcB2lkrE0cy1kn4D0i+kekZQWsoOMJHoIJPpL+2XUSFpvQFtMAZIWneA7Xl7HSQaL2xfEwDkrZCy5nyr1l0DKasdJT+mg7xgd2yg4AAmACLfVw4wcbMGqCqqWM3CIvVd9ioGEwCYM0yBHCcSu591nLLGUY16pGyYaLzNHCCbApMidAMkdqIUv5gE5OvfbWeigNhFaNSGSwD2o7KhqAIhmWHX2afGCmTb0GgQuQCSPc+ASFEAkSdEYoeMAbKDyGgUuwCM5rFJETqj2GgZyWkisVumsXPF6jcJnWVkG/uuY3lFMNhOpsp7HbvpMgsNoPaGbSyequXrOKdCBS8kNkDFr2ROKip2KXWSVdFruQNR0YeJA1HRp5m7dyr2OF3ewP/pef4HW7pxo3nDj9QAAAAASUVORK5CYII=",xe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA75JREFUWEe1l19sU2UYxn9v2dwGzmSoEZJtRhY1StAQtN2YkEUiYOL/C6LhQtPWLQwXwXAlRKsXcjMUJQzFrUaCesGFjptBREJ0iXQmXOGCIQKJZDH4Z2Jm6UZ7HnNqCx30z2ktJ2lz8p3ned7ne8/7ft/5DI9Xb5dunonzJLDSgWVAi0GTjGlgIvM76RPDzXP5NnLMkl6krRSoe7naUileF7yAaCiFd5+bMYn4pL6Rd3Z/Y38U4xQ0EInId/4QbzhiG2KOl8DXYgwu4mP7mhb61x2wVD6NvAb6Vuj2+AyfSTxWSeDrOMaRulrW7Rm1yTwmZw+FOrQUh4MSzVUJnhUxTtfVsnbPqJ3J1Z2Vge4u3ZaMc8ItsKoGv2riVE0j7XuP2MWrQ5k7953/MsKIxOobEjwjanBozZ08ka2JKxkItyviOLx5I4NntX3GK4Mx253uGPfPbbVkip8qrfayTRsX6htoGzhmU2kDoYCGJIJehAx+NzgsuF+w1AunACYSHbO3zF3hEpe44GWRMWPKxAODY3Y2bdyvZ4B+QVu5Rsw4OxSzRRYK6HmJLzwKHI6O2dpcbN/jqotPsgmxVaLRo04a5jMedA18KNHjkfhldMyey4ft7dKC6Utsl3gxW1ulNH0+tlnQrzHg4VLgzPOCBrL8YKce4jLvA8tLaZqx383ArxJ3lAJ7NXDFSLtew2FHUV3jqIX8Sgjqqm0g013jEvcV1DZOWTCguJcOKDcDLj7o18/AokIGDH50MzAhWFjNDLid8c+f7EBsLKZrxtduDYxKdFbLwMsdejaVor/YzLOxDD61sF8fOND3fw10d2hJ0mEn4lGPWu46sMXCAT3tiK88kYyj0ZitysVuXKVbE1O8Legpdy+pNe6xzPtyl+JbSpowEjVG597jdiLSpZrzCXolIhJNJbnXAozxaMwWpzejYEDvITZ5EjESBj9I3A0s8MTJA/IZmwdjtvO/7XiFFiZnOIOor1SwLJ5xrrWVeyMHbCb3g2SD4zBQllCFYJvD+qHv7XOXPuubMOzXfgfWV6jrjWbsi8bM3bDS1ywDW1Zr3uRfxASLvamVhzLj+Nz5dO0aMfc0db0BdyTs112OMYxYUp58cXQ6+E08tes7+y0XmfdgsrlDDX87DEi8VBUTxr558+nOnXnBDOQGDPsVcox3Pa0R+Zwa58zH1mzB5YeUmOKGR9R0OcmrEiHPpyVj3AcfN7cy4LZasRAlT8dZsiTraaczKVaasUyixYwmxDTGBGIC42QNDH8Us9NeX92/T9xk1NzUiXsAAAAASUVORK5CYII=",De="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAYCAYAAADpnJ2CAAAAAXNSR0IArs4c6QAAAu5JREFUSEvlll1IU2EYx//PcW6JSuRFBRVB1I2Qtk3dh1JSXiVRF1bQXaFUBJ5tFFGCLLywTbTtUAwREoIKvIgI+iAqL3Jf0jYUpKsIiogkAsv8aOs8dWyT09zcZnrVe/m+/+f/4/2/7/ucQyhg1I+4ymeLdK0AtQHYQkT3E0LCPVbnmMjXhvIR1o72bvuZ0LSDuA2g9Wk1TIwHMsuuWL09mMtvWeAev6dWEMgBoAWAJpcZGC8Bdkct4kMQcSb9UiA7BUOo4gjAdgANOSEZBMQ0IUN2C9qSu5Ga03G1ZBFYNdZTWjSjPUUMGwg7VgJaWkPvwehLlM4PjFdf+K6sU+OwU/NVV2EH8SUAG1YHtMTlM5jcpNV5yBjwnmDC7TUCpds6qXL4RlmJLjHItHAx1nDw47m54mOLZ2gMS80sczeA3atIjYPxFIRmInRGzGLX37eUmYxBbwsTdQCo/gfwPAM3hQRflYuFMmKeyAxUEWpC3oMyQ7lIhTyNWQYPyCy7x6yOD4qdPiRV5gVMsfcEvFaBcB7AYQBCll3PMMinJbknbLZ9UmvyBur917fHrOfepTqGIdC3E6QRAT4JoDRpOkuALy5rXeP1ZyfBTPqwdJyYy6MW24CiMYQkM5iDOSM1Br0+APuZIJUk5m75Gy5+UwwahwfXTWmn6gTCJi3k50Gr48tCdEGpiQAXwAYmdMfM4uUqv2+jRvgxAmAXAW/lOJmy9lIFyMCZ5E6mwbhDJPdHLPaoOjJj8JqBIbgANKXmU0BjyNPATC8AFP9ulVMyUW2+QDXjNUAjAE8riQHYl36uKaAybwx6WxnoFwiHXpnFRysB5nwtauAfqMcUsdjCC700W3VapDkhakE6UL32PwMDUicTXykoy6SYQGLE0i5lqs0a6dGhoaI3Wz/2giAWAGUm7oqZRGf+vxhp7vqA9wAJ6ARj73JgBkYB6ohZ2p8tp8vrr00xSPZU5ZtpAmMzEbQMmgQQAfO9qFV8kk8SvwBkMTigdig/4QAAAABJRU5ErkJggg==",Ue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAABBRJREFUSEu1ln1MVXUYx7/fc87FQbRaL7PwZZZRDQTOhRxj1mLZqFz9Q8tVWyb34tVirbmsVpvOWfOPXNqGJl7kMvSfbNnLHyWbWfSuw+s95zIYTd0QFGvZ1gvG4J7ze+pc4h0uBLff38/z/Tx7fs8bMctnbuzI1RJOuRCLoSQHhAOyi1Rd4vraYo35HWOlSkLnr3PdvvUUVAJSBGAQwheZilcS6s1S7pUXIGqdCPJS2RJoJbV6QcanwOAmgWyGSPZYH4I90wLNoP0sRXaKIGeWSZjKrEWjvp8Gom7CPQfy50nAkpD4XCe+DyIb5gECyFO3XpN1/7Ha3IHiQNtaJe4RAC3jgB5MOfHPROTBecH+dSb4xS3ZWWsuX716AoJV0FgzDmgGrAMQhNIBG9EgvkvCyD8zaSwbAfqD1jOicCitsDFipPZGLFK4LQks29yT2f/br2cBLPp/gBTd51sUDeddTgKLA/bLSuStNMMugTQgsjCpq3G91VDUlAT6q+y4QArSBSTh6DTKHbhlULLL0yV4MtZYVMaVgfjtCVHn0wVLihNbYhHz7ZJQ+1I3kbgwrG2Qd9MftAKi0JA2IPGRFTErt28X7eNu+xgEFcPaGvVK+gPWVhHsSAuQ/FE3skuj4eW/+6vsnQJ5bdxoI16iP2DvF5FN8waSF3XDWBUN53cXV1uVysXRiZoE9tIMWHshqJkPkMQVzdDui4YLO0tCdrHroAUi104CknU0g/aW4UqaE5Tsg64/YNWvaL0nYN/lQr4Rwc1TaZHY5qX0cRH5YK4wQ9MeO32woMWrSJVwvhXIkum0qCFILypHpPO/Ar00AvojsUjB6dLqtoUDSn0NkTtT6fioLU82vhmwT0KkdLZQb5FqPlYM/Vn7Utdxjs8EI9gWaywqHAIG7WooqZ8NkGCnkalVtL5b0JP8M8HxVGkc7UG+ciZStCsJLK22Fw+40jMTkOCHGdlZVadqc//wqlE50jxdgUzQupR5/Y25P+xZ0j80SwPxHSJq67Sf7R1MwKuxiLnbs0n2mWLTxJslRbGsizWYh5NjryzYfkO/OF1e35A8ISKrJ0YHQ19r1Rd8742rTy7E35w4QVJmhghbEXPjsI3Xh89DyT6SX93xcOHqc83xwyLy1IgB8QuA3QsyFrw3MDBYJ5CHZkr9qC8/14zCNdEwE6PAKuvLf46bck3Hk2cOmkeeeF/0s81xb1LcO1vhKe3Iet0orBkLS6bUDNg/eUuS8OWTaoUS9zkvgLnCSPQK+bq3bKecNv4qu3tSWZN9BPcAGXWUwUcFEhJISaogSHSA2iFNv6k2Gs75a9oCMoPxpynqHQAZAG0Ijmq+7CZvxYx1WrmhPd91Vb5QboPIMggMaOyl4KLyGS3WgTzvJprx/Q3wmMIl7X6GaAAAAABJRU5ErkJggg==",Ge="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAAAstJREFUSEu9lk1oE1EQx2de06xNxaNSxS+wYltMNi0iBXsSBE/tQawnIZugXtpKUS9VCGgvFgKxF9EkRfHQFA/tSRC9qKAFm2SDKdoKSgVrPUqamK8deSFbt+km2bTb7imZN/v/vbdvvhA0j9MlTzKGk3NB+7TWrv3dfe3Lgb/Z9EsiIMRd56KhEz8r+erZUTU63fJZUugVIH5raba1vRhvzei9IEqxMBBc5GsIGI5OOC7VDSzBAgBwpCiE+JxZGgfnHrUva8U6PXKPUqA3WlsDQs9cSHxnFIr8MxJQ/4YXEJOMkScSEMN8zeslNr0U/whETq0vAkZ6D9tPeb2oGIFilzveVyDyAdHRMqEZQbBe//Cw7Tu3i27ZAwo91r0XRE805AgaAnKn8wOLwq/V1DMiusD/M2zoj4ROTqkCpwcW92SSqUUA2qsrirgiNNuOz463/qkFXQuarivzLYV8bgEJXkcnHH3r7s4ljylAN6qKIY7FQo5bhoHcsdMT67dahFn1MxZt7sQxRcknAMhaXQyzjFk6IsGOr9X81k6o58RhRPmnRNRda+el6H6PaLlcDaoLLN7Zauo2EAzVPln5VjALCH6h2XZP707XAXnozyzFXQQwCkT7jJyqog/iCgKM9B6yT2hT5n/QSLEzCqGfgDq3BCp7mecpQxpSiwM6pc/7gTI+3eQ3kczLIKAwjKIr9gkAOkzUriaVQKcUSxBB+44BebtJZ9M+tQNsGxhhqsnaNLwWNMVOoIC/vDhveQOIUcZgKBJwvC3mqlaw2BF+xCVQYLRi3TS8A/wNDEb6DtpDummh1eGJn0um7igAg5tJfAbwoHG37W7NxC/fvHh1vhVzuSfbXtrWdYqdLN4qWJTk+0B00/T2VEmwVMwXKtbXzTTgWsHnlGQ3EfFBa8OD9Y4YtWB83bQhyghM9TFlTKwHyH1NGYTrgW511P8HVz1GsEaaZFwAAAAASUVORK5CYII=",Ae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAcCAYAAAB2+A+pAAAAAXNSR0IArs4c6QAAB/FJREFUSEuVV1uInVcV/vblv51z5nIyk2ScZJI0GfCCYttJAjYv+iS+2BfxoVoFNUwKxQsK5tLWiTH44A2hD+1QUExRtNUmTdpYseiLIqKGChVJ0lwmaZO5ZObMnPv5915L1v7PxKTSgjMc/nP+/e/17bXWt9a3fnWcT21+P0+8ulNtfJ9iNg4ERvGn+lcNBVLwS9xYvsQLs4+Yjz0mS9/hV7fsckPPblcjeytIMmJSJAvBQLHbQCOCRoPz9mu9+eP7B6aOh9Vf0l/PbUH13lW00EIPPXgQh+23wQ0MYlhkiFFCjPM0/7t52z5wnxs/V0Iy1OYcHXbImUBc4CqWj4aFRqIiVFSCTEXuT7ww+Y3s/qvqZXqtt4RGtMB1rKGNDnL42z4X57ZskCJGmRNUkKKMBG24xZjsxhb30OQcbXLoEYW9AigmFBtEMCghQlWVMGYGMOfWDj86vPu76mf0Z3+ZF/WbWMEKt9AOwHd4zECECAnFKAs4MpQ4hmELSUuLcjQpR4c8euTBrMIHpKHFYzYY1ClGVRkTZggO/OxXqnseVt+nV/ILfMPO8QqWVRMdlmAzlEIwoEnBcoSYIyQcoYQECUXQbOCZ0SVC2zv0mOAZIJKNKoAq0ojYoqJSjOkKtpsqMp385ODI3i+ob9HJ7nm+GV/lW1hBC12Vg9fJQWLAQJEKHlqyIdeWIhjWIFZwxAHQExeesgb7IszCSIsoRGqTqmCnrWJYp888sWnffnWQn2+d9zeza2oFdW4HcgmL108sIRMPJG9Mushf/0CFZwIg94vwyvr6M7IOMsgQYVSXsd0MY9SUZo9u3jetvkm/alykxfIN1NBUnR96Vv+ySJQmUsJmeNlrOc+ZmfiDuaevCnPFMy2hRPS6UfGPYxI4IZNV8BrkNXvy8lyUIP76ECe7tkVDqOps9tjYvml1kJ5fu8yLA4uoo63zzwPmnEWqbK5V3C8px5ZzeO7m/sNdl58Q9or3FhYpR3+MsvhrpV7Jyx4LHQrYwbJjYupQFCv9ZEWlH9liKhg0SQF8mH5du0bLQ5JfyW2GBBVOEbOFYRPy1mMfmLtGXaxRD02fh/xKiVU4QRUlDKg01HkEG8Iuue+SR8t75MSBG5t1BWUdzR4bf2BaPUYvLL/Fy9U17krPejJC/I+EYhPDak1KkdbscuYuO9fk3t6mcwfkAEwqsHxIZRcqSL+X6ZgyJLJHGzLwmqjjmbqOIsX6SMxm64jJUDbJ7MzY3gC8dJNqI03kqJnO5Fn15Tdut623ffnk6onJju9cqFMeWCylNaDSX5ze+NmH3mmP3H947rcnU9gHN+gUqY5nj44LsH9hYYHqG5vckzCtZpwuDnJqSipRmpUigjCdVn3Pr1J3dMm1hiXcEkrpYFVd5hGULw+rjCs6MoFc0tiJucnkGy7XXe/vEYZXdSZtc3Zm655p9bg/eWOR6mMNzhGTxSBKGJbuhCTkWBgsfbhGXSz5JhZ8G2uuG2o34xgjqozNegAjOsOAFm6YUH45Mxo+x5qTzialIcCFxzNbp6bVE+7Um/NUH69TFw54yiI+N4DUxlBakZFezz1P1IF3Te93N113/+pt4ATDunRxQCU/kIOWlTWGrAa0dDXqefIt8gakDlk2W4pQJ7MzE/dNq8fdi3MLvj4h4aup3uTZdPodc/yJ2k93+R4uiieOpAIiDKjSz8+Mf/oz75bjz136/cmY7YOjNkOq7ezMRPD49JUFV9++Sl0YmJUE8UJFJTqhSIuySC57RNTyOa1yb9OK61TrXsilAvCQLvEGnV0c4oRTFekYUVHHDO56oqZ3uut5lyGtRmyKzMR9j3un31jwjZ0r1IFmMZYE0qQsFWkDe4s6dlhxHaz4bqhNuZ8gwrDKsEGXMKRSlJTUsQl1LLXb8YSGE7kErNIYtQlKJio8PtJ98cK8b0wuUTN4J1tTTpBIA4GBsDoXBRJwIYvPgyJ5AiKyoXEM6v5hgyQIsA7r3T54OKQxGIukju3s0Yk90+pI5/S/3/Rr7533jSDmskmkTP5FgaQ1ivxJm+x6jzYRemKVjTwRIiMdK4VIpxy1EA3pgjkhOKOVEuJhPC5jKEpmj4rHhztnXp9ztQ+85dYgjcERIZgMclgokbRNKavch9yBPIcDBVGQKYPF02KPCIcoW7En1HPwdtjE2BqXscGmT89smzqgDrbP/POaq33oqqthlXrBM/YqnFzaohgXfRUgqc9g0Mt9EXoD0z/AumavS6LoMXHhbaq0AGJbUsFIlD39bQE+1Hrp3Jyr3XvVrWLZt9Hujy/ibWGkr7HB+7vv/VeXi2lDfhd6LE1Ehi7Ra6BsIoxECXbEAlwqgI80z/5tztWmrrgabvWBRWtFU4MRAYP8FqPFVHHbuIw5d4l/EWYZEZllfJJngYoA2wT3pINyferott2PqEP1l59bpNanJNS3XAdt7wOTJdgSvnUgIVOYevuHCTnuR0SukpLg9fp4K0NbmKuBsrYYjTLsSCoo22T62MTUrHq0eWqcHE4u+Ob9t/K2kWnRSy4F/A7DMsRJzkOO7xjohExCxkAqqOBlmOn7HhuoEOpRm3aqUfybH+14IHS59ZcFfJT/YAfQCEPH0vX2+svE/3TCUq52K9InQHq7hv6LUupLa2nnUvHgVgDX+1f5fR2jZmfAmHrPVGdGFS8adwG/W699+9pDV175YsLmmYb3u5+b/Pjf/5+968/+B+0PhllE845BAAAAAElFTkSuQmCC",We="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAcCAYAAAAAwr0iAAAAAXNSR0IArs4c6QAABflJREFUSEu1V2tsFUUUPmdmdu+j997SQp9AEULCDxNDCCAEQoqC0R/8IRSIVqIYH7GAT2JMNKlEo4bSFowEEyXBBJUS/5AYRB4lijxU4iMSE5CWh214lL7uo3t356Ezu/e2hVsSkrrJ7s7snJ35zjnfOXMG4bbr8rkvdsVLZ9UzKxZVSiKABFA5IQS8/YcRfX8skFBBCxEQiRJuOj108/zOitlr3hg5xaj5Lvz6SV35lEX7vGwSBXdASQ6g/NVHLp1vB8CGJxkhZf7TfQQkDKgVBmpH5eClU/OrFzx7dlilEXAu/b5nbzgx+XHu9Iv0rb+35lcHAAL0TuWV/k7MDP4TjMGI7iilpG6bQbsmWjr9CRYuhmxf53uV8556qyCAjt8+PcCs+AqeHfBmzHnOvou172mo83BjbShxXzsLJ0AMDXxcteDpDQUBXDy782tCQiuFl/Zmzt80fgAONtbaicp2YheBctPbqxe98HJBABfObN9PWHiVEp43c/6GcQNw6dt3llqximOEhUC5mZbqJQ2vjgGgtY3SSB0CeNPnPj9uAC4feX+ZFS07jEhAeemW6iUbxwBwurWNWbE6goRPm7PeuidH30W463jTchop+05HlHQGm6trN71WmAOnW9uoFa8j1OI1s9eNG4Duo82P0Hj5IZAChJNqqa4dwwUXtQXsRB0hNp86u35cAbB4xSElBSgn2VI5FoCO0zvaqB373wCAlNoFdwFwckcbDWkOMD51zvi6gMXKD4GSIJzB5qraDYU50Hlq+z7CoqsRCa+Z+8y4uaDryIfLraJKQ0LlZporal8sDKDjZGsbEluHoUJkV6xwMbVCMYYsTAgyk4oRUYHSLy1lvvg7glJKCyiQgDoNC66Ul+XCSXGZHaRKyhpEBsCdbRVLG14vnIpPNO8DIKulyAKlIWChBLBQHCiLACHM31yQmFsp4QB3U3oiyiLFCtHSPjZaamSCg/SGQA4lQThJAOEBsghQ4E1lSzduHgPAtq+U4Gu4M2g2VSQhoFYEKLUBkQaLUwPGS/VsDcPQriFFQ4zFtrDwhFVm99QgDBAJimdBuo5ZXINnkWJtr6aK5S8VBtD5Y/OX0nXXeplekJ6TX5Bq7ZEC0SCIBmADYXbeKkpwUNwzC2kQqLdiA0SA4twoQ6wwsKJJQAlrKnu4YQwLtH9Qz73MYukMZBV3OAihzN4qEAljABKRUIqUWoQQi4CiqLdbCUKhEFIKLlFyBUIpCQAMpDEKYRQpK2IYTYSRhA9UPfrKNwVdMF6p917mGVVkXDzeNM9C9iZ3Bz3luVwKVxFjT2IKDZ/72gUEASlhWn9lAsA8wdc+iAi/REEFSJmNYEUYsaMWKviobFlD+x0WUOca7evigauKO+U80wfCy/h+1TGncqVWEAWgI8Fvm8ovYD9qw8vRJRzqmoky0LUAjZZoLvQk7MxkvH+1awDmkHT/vOdzFpnwpJu6ATzTD0qHkPD8ksqPd3MHevm1XmABnQm0EXwJkxN8Sf0OiEvtKNBIMbB4ua6K9pYsXFufB/DPiZ0LQqXTfnCT15mbvA5iqB+ENwQohFncLy19ILkElP+mx3IVcCBr/si3dTjrojQCNJIAligHK17BMXltYdHidb+Yea/9sf+C8tyZTv9V4MmbILJJP361BkYbP+vlQRj9RpbfowHm5InJjbpIpYA05AOITQKrZLIGdD42d8Us7P7psy0sMvFtp+8KuANdwFO9INy0yWSGfwGAPAvMpMMaBr1cQvbfhraBQ3TbALCAWlGgsVKwJlQBK50CMtO3BXv+Oph2kzeiTm/Hn7L32mbwklnPlQqopvPoSydjHd25y7T4WDJ6YISsoAjERitcRDFR9i4rn/Egi08cxK4zu4+C4A95g90pN9XzPXpZT0rpaxCQL8fU3BkAdUgGLvDjIEfNHGFzFgik8ucDCykNUVpUspiVVBcjYcf+s3IjuXo0slspuVJm0yEwxFM65SHRjFN625OIavhgYowb+HcUP3InqBEENGcUqYFoPmlCMH1C6iOUHUg8dmv9v8OxoyB3PgAEAAAAAElFTkSuQmCC",we="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAHCFJREFUeF7tnQuUXVV5x//fvnfiK6wiUFnSaoNgYiHknjuDCgUUQXloaAUMVnyAAl1VYQGhEsOcmY5zz81LeSnEqsEHal0SAV0EQQooBQVfzLkYYjNCibLEUhFTSX3M3Hv+7bm5CZkwk9nnfe65+6zFmknyfd/e33/vH+e1z7cF5khEgSU3sPToZsz30FoAkfkA9gXUXMLbSyBzAexFYO7237kXgPbfdTrzDIBtgDxDcJu0f0fnd/UM4Pl//g3IcYXS5oMWYHz9GdJKJJEeDyo9nn/k9Bc6fFmfYD48zKf/E1wA+D9xUOTgwQI8CmAckM1CjENhfJIY32jL48HCGOtdFTCABJwP1RU8xPO845SoN5A8DsDeAUOkbb5VRO726H1bKXX32GWyKe0OdHN7BpBZRq9/JQ/2PBwLzzsGIscAOLCbBxzAYyDvhVL3KoXvPLhcHunyfBLtvgFkGnkrNZ4g4p0MqKMBHp7oCGQeXH4EePeR6rbGkNyReXdy1gEDSGdArNHJo6jUYoEsBrAwZ+OUVnc2EtwgnrfBHe77blqN5rmdngakOsoKS1gsxGKCR+R5oNLum0AeoGCDtLBhbFgaabefl/Z6DpDqah7AJpaQPEWA4/MyEHnuB4G7ROQWKWP92DJ5Is99jbtvPQOItZLz0PTOhci5APaPW8geifckyHUoq3XuctnSCzkXHpDKCs6XVhuMcwDs0wuDmkKOT4O8jiW1rnGZjKfQXmZNFBaQRXUuVN5OMPy31OaIX4FtPiieUuseGpSN8YfPPmLhAFlUZ78izgHoX0rNyV7inujBBCDrPMF1Dw3Kg0XKuDCAHDrCfeb04VKSy4o0QN2Wi4isnpjEmodH5Olu6/t0/S0EIJbDsyC4FOQhRRiUrs9BZBOINa4tX+j2XLoaEGslX80WlwlwercPRBH7T+BGKclqd7n8sFvz60pADhnh3Oc9ezll7jPyPfsm/MuuP01izaYR8Zfpd9XRdYBUHb6jfZ8hqHSV0r3eWaLhgzJmy1e6SYquAWTeCJ+/d9m7HJAPdJPApq+7K8C1W5vqki0j8sdu0KYrAOkfnRjwpHw5BK/vBlFNH2dRgLhHsXnJg8Nzfpx3rXIPSLXefA+pLgewX97FNP0LpMBTIt4lY4Pl6wN5pWyca0Asp7UakEtT1sQ0l6oCXOPapdy+u8olIO31Ux6vAPCWVMfKNJaVArdSydI8ruvKHSAVh6cK2nDMy2q0TLuZKLCFkKUNW27OpPUZGs0VIFadZ4P8XJ4EMn1JWQGR97qD8vmUW52xudwAUnF4voCfyIswph/ZKUDIBQ1brsmuB8+2nAtAqg4/THBlHgQxfciHAgJZPmbLqqx7kzkgVq11BUQuzloI034OFSCvdIdKS7PsWaaAWA5vAehXETGHUWCm2+QNri2nZCVPZoBYjre5U6Izq9xNu92jwLhrK7+ka+pHJoBYjsfUMzUNdr0Crq1Sn6+pN2g5fALgS7t+tEwCGSggv3JtOSDNhlMFxHI8/3vlapoJmrYKp8CYa6v+tLJKDRDL4a0A35xWYqadIisg33RtSWUZUiqAVJzWdQJ5X5GHzOSWrgIEP9uwS36ts0SPxAGxanQgHEw0CxO8NxWg1N0hsZNMPlFAKk7rfIGY5SNJjmCPxyZ4QcMuJbYsJTFAOqtyb+rx8TPpp6AAIacltQo4EUA633N8yyxZT2F2mCZ8BbZQyYlJfE+SCCCW420wHzuZmZuyAre6top92VLsgJjPZFOeFqa5XRSI//PdWAHpFFjo+nKTZs51rwIi3llxFoKIDZB2aR5Vvt1UH+neyVWQnj+lvOZJcZUUigWQdlG3Em83dasKMsW6PQ3inq0tOSmO4nSxAGI5rWtNxcNun1VF6z/Xunbpg1GzigxIu1Yu+K9RO2L8jQJxKyCQM6PWAo4EiF9lfU6J95lC0nEPrYkXiwJEY6IlR0epKh8JkGqdoySHYknGBDEKJKCAiNTGBmU4bOjQgPib16DF+8w+gGGlN34pKTCBkhwddhOf0IBUHO9rZmenlIbYNBNJAX+nq4at3hYmSChA2nsCgrmpfhcmcePTawrI2WH2TAwMiL+bbF8f7jUbZvbaBOvyfEU2TU7imKC77wYGpFrnKrPVcpdPlh7tfnsLuEH5cJD0AwGyqM5+ReZ+V6AgAhjb3lLAExl4aFD84iFaRyBALIfXAkx3j0DyI1qZZGBEYIGI+AXN/P9emEEXgjb5CICfkXxEgKeDOmvZK0V43rPzyv+zf/h/t+PfdrXZ/e9E/G32jtVqK5SRrHVt0X7Drg3IojoXds4eqW67nEWxsKC6V1c88+de64WnichpAE4I6p+oPTEGJTcqDzc9OCQ/TbStGIJbjvftZAHBROcsslGnu9qAWLXWVRC5UCdonDbdAMiu+bbfD3m4DORb49QhRCwX9D7iDpW/HsI3M5cUAAHIq92h0kU6SWoB0vmE1r/3mKsTNE6bbgNkR+6W07oIkH8GsHeceujFkqvQxEfcEdmqZ58fq1QAAbZRyYDOJ7pagFi11hqIfCgLGbsVEF8rq04LxJcAHpqednKGa8v69NqLt6WUAPHPIh91h0qzbhA7KyDWSs5Dq/3kap94pdCL1s2A+Bm+ZgX3nfBwTxqQUMkpjcvErwfQtUdqgPgPKUoy4C6XLXsSa3ZAai0HIpkVfut2QHZectW870FwZFIztyRywI8H5VdJxU8rboqA+GeRujtU2mPhuT0CUl3NAzhJ/5nx/mkJtHs7RQGkfcmV1BOaF8mL3Yu7735jujmVmEbTT+AnpU/6x5bJEzPN7z0CYtV5IcirsoLDb7dIgBw7wvLWMv8tzseYLEl/Y7mMZTlGcbadMiCAyEXuoFwdCpCK490pwPFxChA0VpEAaZ9FanwlpA3JXwXVYnd7Kjm9cZkUqnpl2oAQuKthqzcGBqQ6ygoV3aiDGNW/aIB0IDkPwk9H0ybYG+FobaXnnTYgfmbiiTU2LI3pspzxEsuqcxCkk54007dUREDakNS5HmSobxQAPCp98ro9XTtnPW5h288CEIjY7qDUAwFSdXg/wSPCJhqXX1EBqTo8nOAPw+gk4PvH7NK/hPHNu08WgAjkgTFbpn3COO0ZxBqdPAqq5H9Om/lRVEA6Z5EvgzwzoMjjL3ihWPcvlT8E9OsK8ywAaQvjtY52h/u+u7tI0wJScVorBcHWzSelfpEBqdR5opB+NUr9Q2i7g6VpLwf0g+TXMitACK5q2KXlWoBYjvcTAAvzIGORAfH1rTjeLwR4ma7W9KS/MVycx7q7550VIAA2urY6bFZAKjWeIEJ/b49cHEUHxHJ4B8A3aYr9e9dWL9K07UqzDAEBKSc2huSOXYV7ziWWVWtdAZGL86Ju0QGp1PkxIS/R0ZuCHzcG1eE6tt1qkyUgIK90h0pLZwHEewCC1+ZF4KIDUnU4TGh/Nfkd11ZvyMvYJNGPbAHB990hNeXJ7ZQziDXCeSjzsSQSDxuz8IDUOURyVFMfA4imUKHNmnKgO/LsCt+pgIw2z4RSXw4dPAHHogNScVq2QGqa0hlANIUKbeZ573SHyzuLsU8FpM5rQGp/0B66EwEciw6I5fAygLqPbQ0gAeZOKFORa91BOX+H71RAHG8zgPmhAifkVHhAaq3lEFmhKZ8BRFOoCGbjrq38KjXtYycglRHOlzJ9QHJ1FB2QSp3LhFylKboBRFOoKGZsyoLGiIxPAcSq81yQn4kSOAnfogNiOa1LAVmtqZ0BRFOoSGYi57mDsm4qILXWVyFyRqTACTgXHxD+E8CPakpnANEUKpIZeYM7VHr7VEAcz6+09+JIgRNwLjog1TovIfkxTekMIJpCRTT7rWurdpGS9j3IQocvK4O/iBg0EfeiA1JxWksFcrmmeAYQTaGimjUhL99oy+NtQKp1Hk/yzqhBk/AvOiCWw4sAXqmpnQFEU6ioZiLyxrFBuWs7IDW+n8K1UYMm4V94QGqtCyGiWxjDAJLEJJsmplA+MDYkn2wDYjn+/8H8/5Pl7yg6INU6LyD5cU3lDSCaQkU3k6tcWy7uAOJ9E8DJ0YPGH6HogFSc1vkC+YSmcgYQTaFiMLvNtdWbdwDi7xtxUAxBYw9RdEAsx99vxd93ReswgGjJFIvRo66tDpYlN7D0s3E2YwmZQJCiAxLw/s8AksAcmynkK+dLWfpr/GtPuCnFdgM1VXRAKk7rHwXySU1RDCCaQsVhpiiHiFVrvhWibo4jYBIxCg9Inf8g5Kc0tTOAaAoVixm9UyXgWqBY2g0SpOiAWLXmeRClW2XRABJk8kS25TIfkNWAzLqRSOS2QgYoOiDVGs+hsL0wTuMwgGiIFJ8J10gmO9cGyKDogFTqzfcJ1XWakhhANIWKx0zWSsVpXS+Qd8cTMP4oRQfEqvNskJ/TVO7brq2O07TtSrNMizbsphjBL4rleH75/FPzqmbhAXF4FsDP6+kvd7q26NbQ0guZM6s8AfL/df1u9gHx96qYcX+ErPUrOiBVh+8meL2OzgL51pgtJ+nYdqtNzgC5UyqOd78AmVdxn2lAiw5Ipc53CflFzQndXv6gaduVZnkChMAD/k36TwDmog7vdCNadEAsp/lOQH1JazYTG9whdYqWbZca5QkQQDb6l1j+NriRtwNLajyKDkjV4TsI7qzDNIuO33Bt9daktM5D3HwBgp/7gDwFYN88iNOLZ5DqaPPvqdRXdPQX4qaxIXW6jm232uQMkN/4gPwJwJy8Clr0M0ilzjOE/Kqm/utdW+WusIZm37XMcgbIhAFEa9iSM7IcLgF4g2YLBhBNoWIyawNiLrFiUjNMmKrD0wl+TdPXAKIpVExm7Ussc5Mek5phwlRqPE2EN2r6GkA0hYrJzL9JN495YxIzVJiK0zxVoPzVDDqHAURHpdhsZKN5URibmOECWQ7/DuDXNb0NIJpCxWHWeVFolprEIWbYGNVa828p6hua/gYQTaFiMrvTLFaMScmwYSo1LhbhLZr+BhBNoWIyu9ksd49JybBhrDrfAnKDpr8BRFOoOMw6y939kjN+6Zl8HkV/UVit82SSfl0yncMAoqNSbDay1nxyG5uY4QL113iSJ7xN09sAoilUPGbtT24DbeAST7sBohT9DFKpT54oLN2uKYkBRFOoeMz8og2m7E88WoaMYtX5JpB3aLobQDSFisXML/tjCsfFImXoINXa5BspJf+rTp3DAKKjUkw27cJxpvRoTGqGDLOoxuOU8C5NdwOIplBxmLVLj/qBLMczxavjUDREjEqdbxDybk1XA4imUDGYbS9e3QHEbH8Qg6JhQlRX8PX0+B1NXwOIplAxmO26/YHZQCcGQUOFqDp8HcF7NJ0NIJpCRTfbZQOdgCX4o7cdIELRH/MuGp08RqnSv2tKYgDRFCqq2ZQt2MwmnlHlDO9vreBR8HifZgQDiKZQUc2mbOJptoGOKmd4f8uZ/Bug9F3NCAYQTaGimk3ZBrpzo/40gBdHDRy3f9EvsfodHuGB92vqZgDRFCqi2W9dW+3jx2g/xWoDUmt9FSK5q5hRdEAWjfK1SvEBzQE1gGgKFcmMvMEdKr19KiB1ngvyM5ECJ+BcdECslXw1WvyBpnQGEE2hIpmJnOcOSnvPlp1nkMoI50uZmyMFTsC56IBUHR5O8Iea0hlANIWKYsamLGiMyPgUQDr3IT4g86MEj9u36ID0j04MeKr8I03dDCCaQkUwG3dttWCH/84zSBuQOq8B+cEIwWN3LToglVFWRfFBTeEMIJpChTYTudYdlPOnB2S0eSaU+nLo4Ak4Fh0Qqz5hgeUxTekMIJpChTbzvHe6w+WdxcSnnkFGOA9lPhY6eAKORQekv85FHtnQlM4AoilUaLOmHOiOiF9MsX1MAaR9mVXzHoDgtaEbiNmx6IAcNsrDSooPacpmANEUKpQZ8X13SE3ZTGoaQFpXQOTiUA0k4FR0QCqjPFQUN2pKZwDRFCqUGXmlO1RauqvvcwCp1HiCCL8VqoEEnIoOSHUFD6HHhzWlM4BoChXGjJQTG0My5fPn5wDSvsxyvJ8AyMW2bEUHZGAFX9Xy+FPNATWAaAoVwmyja6vDdvebFpCK01opkA+HaCR2l6IDsqjGBUr4H5rCGUA0hQpqRnBVwy4t1wLEGp08CqqkuwQ7aF8C2RcdkMrIH+dLeY7uCgYDSKDZE8DYax3tDvc9Z1X1tGcQP2zV4f0EM98euuiA9K/kwV6LP9McSgOIplBBzATywJgtR07nMyMgVp2DIJ0gDSVhW3RABmo8qCX0i2boHAYQHZWC2ojY7qDUAwFSHWWFim7QtuK2Lzogi2o8UAn/U1M3A4imUEHMxBNrbFimfVk74xnEb6DieHcKcHyQxuK2LTog1krOQ0t79YIBJOYJRuCuhq3eOFPYPQJi1XkhyKti7lOgcEUHZGAVX95q8ueaohhANIXSNhO5yB2Uq0MBUl3NAzjZXmm6v3aDMRsWHZCA9QAMIPHOryelT/rHlskToQDxnaxay4HIYLz90o9WdEAWjfz+L1X5+Y9rKmIA0RRKy4ysu0Mle0+2e7zEagOy/Rr5xwDaH7GnfRQdkM5Z+peauhpANIXSMHsaJRlwlz+7cnc6n1kB6ZxF1kDkQxqNxm5SdEAG6nxpi5zxFL+boAaQuGYY+VF3qHTpbOG0AKms4Hzx2meRubMFjPvfiw7Iwjr3L5P/pambAURTqFnMtlHJQOOy7d+dR7rE2uFs1VpXQeTC2QLG/e9FB2TRCF+iynxSUzcDiKZQezQjr3aHShfphNI6g/iBFtW5ULF9FpmjEzgum6IDMvAx7tf6I3+tqZcBRFOoPZhNeCIDDw2K1jc42oC070Wc9HfELTogr1nBfSc8PqU57gYQTaFmNpO1ri3ahUkCAbKozv7OWSRyN3UDFB2QQ0f+Z5++8l6/0dTDAKIp1ExmnbOHbhWZ536TPlv71TpXkVw2m11s/05+JLZYcQQSbAW5Baq0BZPY4o7I1ihhrRHujTJ/qxkjMiBLlrD0aD8O9DwcSM97hQAv1Ww7HTOR1wM4NonGRGT12GCw75wCnUH8Th86wn36+nAvyEOSSKILY/qAbAH4sIj6fqs1+YOHhud8XzePgVX8s1aTupAFAsR/+qg8DHiCASEHQLwCgpfr9q1QdiKbJidxzMMj4hdp1z4CA9K5FzkL4Oe1W+k5Q/E/gLpFgFvGbNnj5jgLVnOvF0zyd5oSzQpIe+kKcRoEpwF8nWbcHjCTs11bvhA00VCA+I1UHO9rApwetMEetP8BRK52B2VnMbJdNThkhHPnlPmMpi4zAuIXf/A87wKBvCuL91Wa/c/EjMCNDVu9LUzjoQHpVCX3P8tN9bFvmCTz4CPETZTW5a7d971d+zMwwhe2yvxfzT4+B5CKw78AcL6AfrnM1F/kavY7S7MJlORod7noFgif0tfQgPhRqnWOkhzKMvtua5v03tcYKn9uR7+PvIIv+MPv+XvNPKYAUl3BI0F8luSrNP17zkxEamODMhw28UiAtC8PSrwPgkrYDvSi364VNA7+OJ8393f8o6YOOwHpX8HTPI83avr1phnRmGjJ0ZtGZFtYASIB0j6LOHwHwWmvr8N2qkf8bnVttXjgU+xr/ZoTmjm3AbFqzfMg6tOaPj1rJpAzx2z5ShQBIgPiN245rWsB+UCUjvSkr8hIaT+sCAKIeFKnol+e5kU9qZl20lzr2iXtN+YzhY0FkHkjfP7eJd4Ogf+SxxwBFNi7KX1by5zUdFkP8JeAaC2004xZPDPinq0tOWnLiOheus6oQSyA+NE7OyXdDmC/4imeXEZuU0pWmS3NFtaDOBiCqqZ9L5o9pbzmSQ8Oz/EX1kY+YgOkfT9Sb76HVIFfxkTOoosD+GvNLMejZgrrASzRtO1JMxHvrLHB8vVxJR8rIJ37kdWAzPqlVlwJ9FgcA8geB5xrXLsU6zrB2AHZDom3AcBbemzyppGuAWRmldtPBeMehEQA6Xyi6+8xMi/uDvd0POK/IXhJT2swffJbqOREnU9og2qXCCB+JyoOTxXwpqAdMvZGgaAKEHJaw5abg/rp2CcGyHZIWucL5BM6HTE2RoEwChC8oGGXrgnjq+OTKCDt+5EaHQgzKzynI4Kx6VIFKHV3SPZY+C1qZokD0jmTXCeQ90XtrPE3CuxQgOBnG3bpnKQVSQWQ9pnE4a0A35x0QiZ+Lygg33RtSeUpaWqAbIfE8z+WN2+Be2EOJ5fjmGur/uTCT42cKiCdM8kTAPNVKCAttU07ERWQX7m2HBAxSCD31AHpnEl0l1YESsYYF1uBLEpAZQJIBxK/sMH8Yg+pyS4mBcZdWy2IKVagMJkB0rncugVg7MsDAilgjHOugGxwbTklq05mCkgbklrrCohcnJUApt0cK0Be6Q6VlmbZw8wB8ZOvOvwwwZVZCmHazpcCAlk+ZsuqrHuVC0B8ESoO/dI1ZllK1jMiB+0TckHDlsSWjwRJMTeAtC+36jwb5M6SOEESMbYFUUDkve6g5KZqZ64A6ZxJ/FXAV5il8gWZ8PppbCFkaVKrcvW7MdUyd4C0Idm+5ZsPSSrLCcKKZ/xiU+BWKlmaxPccUXuYS0B2JGU5LfP5btQRzr1//J/JxplyrgFpP+HaXgjiclMtJc5hz0Wsp0S8S+IssJBEVrkHxE+6XVJIypebultJTIEMYhL3KDYvias0T5IZdAUgvgDt4nRl73JTwTHJ6ZBGbK7d2lSXxFHULY3edg0gO8Ro1wL2t4AzBbPTmB/xtUE02lugRayVG1+H9CJ1HSB+Wn5V+ef14dLOXolmfxK9sc7KasIH40+TWBOlynpWne9KQHY+5VrJV7PFZWanq6ymz57b9Xd2kpKsDrt5TR6y6mpAnn0czLMguNRsLJqHKQVAZBOINWH2BMxJBju7UQhA/Gz83XfnPHvZlTede6Y//uXUxCTWBN1NNq8CFQaQHQIvqrNfEecAPNfsn5jatJsAZJ0nuO6hQfHrDhTmKBwgu4CyUHneuRDxS8OYzS2TmbLbQF7nKbXuoUHZmEwT2UYtLCA7ZG2v62rtBGWfbOUuTOtP+2CwpNblcf1UnCoXHpBdnnjNQ7MNin/ptX+cIvZQrCdBrkNZrXOXy5ZeyLtnANkxmNXVPIBNLCF5igDH98IgR82RwF0icouUsX5smTwRNV43+fccILsOTnWUFZawWIjFBI/opoFLuq8CeYCCDdLChrFhaSTdXl7j9zQguw6KNTp5FJVaLBC/ysrCvA5Ywv3aSHCDeN4Gd7jP30m35w8DyDRToFLjCSLeyYA6GuDhxZ4l8iPAu49UtzWG5I5i5xo8OwPILJr1r+TBnodj4XnHQOQYAAcGlzlXHo+BvBdK3asUvvPgcnkkV73LWWcMIAEHpLqCh3ied5wS9QaSxwHYO2CItM23isjdHr1vK6XuHrtMNqXdgW5uzwAScfQWOnxZn2A+PMyn/xP0S2T6JVUPihg6qPujAMYB2SzEOBTGJ4nxjbY8HjSQsX9WAQNIQrNhyQ0sPboZ8z20FkDEB2ZfQM0lvL0E4r/Z34vA3O2/c6/O237/p388A2AbIM8Q3Cbt39H5XT0DeP6ffwNyXKG0+aAFGF9/hrQSSqWnw/4f5GnaW9nfPLQAAAAASUVORK5CYII=",Se=Object.defineProperty,ge=Object.defineProperties,Re=Object.getOwnPropertyDescriptors,ve=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,Fe=Object.prototype.propertyIsEnumerable,me=(Lt,gt,yt)=>gt in Lt?Se(Lt,gt,{enumerable:!0,configurable:!0,writable:!0,value:yt}):Lt[gt]=yt,oe=(Lt,gt)=>{for(var yt in gt||(gt={}))Le.call(gt,yt)&&me(Lt,yt,gt[yt]);if(ve)for(var yt of ve(gt))Fe.call(gt,yt)&&me(Lt,yt,gt[yt]);return Lt},ie=(Lt,gt)=>ge(Lt,Re(gt));const fe={\u5B9E\u8BAD:se,\u8BD5\u5377:ue,\u8BFE\u4EF6:pe,\u89C6\u9891:xe,\u4E3B\u80FD\u529B:Ue,\u5B50\u80FD\u529B:Ge,\u77E5\u8BC6\u70B9:Ae,\u8D44\u6E90:We,\u603B\u6570:De,\u6559\u6750:we};var he=({type:Lt,ImgProps:gt})=>c.createElement("img",ie(oe({src:(fe==null?void 0:fe[Lt])||(fe==null?void 0:fe.\u8BFE\u4EF6)},gt),{width:"16rem",style:oe({width:"16rem"},(gt==null?void 0:gt.style)||{})})),Te=ae(93152),Oe=ae(72664),Be=Object.defineProperty,Ze=Object.defineProperties,tt=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,Nt=(Lt,gt,yt)=>gt in Lt?Be(Lt,gt,{enumerable:!0,configurable:!0,writable:!0,value:yt}):Lt[gt]=yt,Bt=(Lt,gt)=>{for(var yt in gt||(gt={}))nt.call(gt,yt)&&Nt(Lt,yt,gt[yt]);if(dt)for(var yt of dt(gt))At.call(gt,yt)&&Nt(Lt,yt,gt[yt]);return Lt},st=(Lt,gt)=>Ze(Lt,tt(gt)),Ot=(Lt,gt,yt)=>new Promise((ir,Jt)=>{var St=Vt=>{try{Rt(yt.next(Vt))}catch(jt){Jt(jt)}},it=Vt=>{try{Rt(yt.throw(Vt))}catch(jt){Jt(jt)}},Rt=Vt=>Vt.done?ir(Vt.value):Promise.resolve(Vt.value).then(St,it);Rt((yt=yt.apply(Lt,gt)).next())});const ur=({children:Lt,cout:gt=1})=>{const yt=(0,c.useRef)(null),[ir,Jt]=(0,c.useState)(0),[St,it]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{yt.current&&setTimeout(()=>{const Rt=(0,te.ZR)(yt.current,"rem",1);Jt(Rt)},500)},[yt.current]),c.createElement("div",{className:"relative flex item-end "},c.createElement("div",{style:{height:St?"auto":`${gt*23.25}rem`,overflow:"hidden"}},c.createElement("div",{ref:yt,style:{fontSize:"14rem"}},Lt)),ir>=gt*23.25&&c.createElement("div",{className:"current c-blue",style:{whiteSpace:"nowrap"},onClick:()=>{it(!St)}},St?"\u6536\u8D77":"\u5C55\u793A"))},br=({DataProps:Lt,pathsDetail:gt,getUrl:yt})=>{var ir,Jt,St,it;const{detail:Rt}=gt,[Vt,jt]=(0,c.useState)(!1);return c.createElement("div",{id:`${Lt==null?void 0:Lt.id}`,className:"bg-white",style:{borderRadius:"4rem",padding:"15rem 30rem 30rem"}},c.createElement("div",{style:{color:"#3061D0"}},c.createElement(he,{type:"\u5B50\u80FD\u529B",ImgProps:{style:{marginRight:"5rem"}}}),"\u5B50\u80FD\u529B"),c.createElement("div",{className:"c-grey-333 flex item-center",style:{fontSize:"14rem",margin:"20rem 0 10rem 0",gap:"10rem"}},c.createElement(re.Z,{title:Lt==null?void 0:Lt.name},c.createElement("div",{className:"multi_ellipsis1 minW-0"},Lt==null?void 0:Lt.name)),c.createElement("div",{className:"flex item-center",style:{gap:"5rem"}},(ir=Lt==null?void 0:Lt.ability_tags)==null?void 0:ir.map(Yt=>c.createElement(X.default,{color:"orange",style:{fontSize:"12rem"}},Yt)))),(Lt==null?void 0:Lt.description)&&c.createElement("div",{style:{padding:"12rem",background:"#F6F7F9"}},c.createElement(ur,null,Lt==null?void 0:Lt.description)),c.createElement("div",{className:"flex item-center justify-center w-full",style:{margin:"20rem 0",padding:"12rem",background:"linear-gradient( 180deg, #ECF3FF 0%, rgba(255,255,255,0) 100%)"}},"\u8986\u76D6 ",c.createElement(he,{type:"\u77E5\u8BC6\u70B9",ImgProps:{style:{margin:"0 5rem"}}})," ",Lt==null?void 0:Lt.knowledge_count,"\u4E2A\u77E5\u8BC6\u70B9",c.createElement("span",{style:{marginLeft:"40rem"}},c.createElement(he,{type:"\u8D44\u6E90",ImgProps:{style:{marginRight:"5rem"}}}),Lt==null?void 0:Lt.resource_count,"\u4E2A\u8D44\u6E90\u6570")),c.createElement("div",{style:{marginBottom:"10rem"}},c.createElement(he,{type:"\u77E5\u8BC6\u70B9",ImgProps:{style:{marginRight:"5rem"}}}),"\u8986\u76D6\u77E5\u8BC6\u70B9",Lt==null?void 0:Lt.knowledge_count,"\u4E2A"),c.createElement("div",{style:{height:"320rem",background:"#F6F7F9"}},c.createElement(P,{loading:!1,nodes:Lt==null?void 0:Lt.nodes,relationships:Lt==null?void 0:Lt.relationships})),c.createElement("div",{style:{margin:"30rem 0 10rem"}},c.createElement(he,{type:"\u8D44\u6E90",ImgProps:{style:{marginRight:"5rem"}}}),"\u8986\u76D6\u8D44\u6E90\u6570",Lt==null?void 0:Lt.resource_count,"\u4E2A"),c.createElement("div",{className:"flex-wrap",style:{gap:"10rem",display:"grid",gridTemplateColumns:"1fr 1fr"}},(it=((Jt=Lt==null?void 0:Lt.resource_knowledge_graphs)==null?void 0:Jt.length)>4&&!Vt?(St=Lt==null?void 0:Lt.resource_knowledge_graphs)==null?void 0:St.slice(0,4):Lt==null?void 0:Lt.resource_knowledge_graphs)==null?void 0:it.map(Yt=>c.createElement("div",{key:Yt==null?void 0:Yt.id,className:"flex relative current",style:{gap:"10rem",padding:"25rem",background:"#f6f6f6",borderRadius:"10rem"},onClick:()=>Ot(void 0,null,function*(){yield yt==null?void 0:yt(Yt)})},!(Rt!=null&&Rt.can_managed)&&c.createElement("div",{className:"absolute c-white",style:{top:0,right:0,padding:"2rem 10rem",borderRadius:"0 10rem 0 10rem",color:(Yt==null?void 0:Yt.complete_rate)!=100&&"#7C3100",background:(Yt==null?void 0:Yt.complete_rate)!=100?"#FFC86B":"#37AD83"}},(Yt==null?void 0:Yt.complete_rate)==100?"\u5DF2\u5B8C\u6210":"\u672A\u5B8C\u6210"),c.createElement(D.Z,{type:"circle",percent:Yt==null?void 0:Yt.complete_rate,size:60,status:"success",format:qe=>`${qe}%`,strokeWidth:10}),c.createElement(he,{type:Yt==null?void 0:Yt.node_type,ImgProps:{style:{width:"16rem",height:"16rem",marginTop:"3rem"}}}),c.createElement("div",{className:"flex-1 minW-0"},c.createElement(re.Z,{title:Yt==null?void 0:Yt.name,placement:"topLeft"},c.createElement("div",{className:"multi_ellipsis1 c-grey-333 blod",style:{fontSize:"16rem"}},Yt==null?void 0:Yt.name)),c.createElement("div",{className:"c-grey-333",style:{marginTop:"10rem",fontSize:"14rem"}},"\u77E5\u8BC6\u70B9\uFF1A",(Yt==null?void 0:Yt.knowledge_text)||"--"),(Rt==null?void 0:Rt.can_managed)&&c.createElement("div",{className:"flex flex-wrap item-center v-grey-666",style:{marginTop:"20rem",fontSize:"12rem",gap:"10rem"}},c.createElement("div",null,"\u5B66\u4E60\u4EBA\u6570\uFF1A",Yt==null?void 0:Yt.study_count,"\u4EBA"),c.createElement("div",null,"\u638C\u63E1\u4EBA\u6570\uFF1A",Yt==null?void 0:Yt.complete_count,"\u4EBA"),c.createElement("div",null,"\u638C\u63E1\u7387\uFF1A",Yt==null?void 0:Yt.complete_rate,"%")))))),(Lt==null?void 0:Lt.resource_knowledge_graphs.length)>4&&c.createElement("div",{className:"flex item-center justify-center",style:{padding:"0 220rem"},onClick:()=>{jt(!Vt)}},c.createElement(W.Z,{style:{borderColor:"#3061D0",marginBottom:"0rem",cursor:"pointer"},dashed:!0},c.createElement("span",{style:{color:"#3061D0"}},Vt?"\u70B9\u51FB\u6536\u8D77":"\u70B9\u51FB\u5C55\u5F00\u66F4\u591A"))))},Qt=({pathsDetail:Lt,dispatch:gt,user:yt})=>{var ir,Jt,St,it,Rt,Vt,jt,Yt,qe,mt,Dt,Ft,Zt,_t,G,Y,J,le,_e,Ie,Ce,Xe,Je,bt,Ht,Pe,be,ut,ze,He,Qe,ht,pt;const{detail:kt}=Lt,Tt=(0,u.useParams)(),[Ut]=(0,u.useSearchParams)(),[ot,It]=(0,c.useState)({}),[ft,Ne]=(0,c.useState)({id:null,open:!1,resourceUrl:""}),[,je,et,Ke]=(0,i.U)(o.Ju,{subject_id:Tt.pathId,id:Tt==null?void 0:Tt.abilityId}),[Et,wt]=(0,c.useState)([{name:"\u638C\u63E1\u738759%\u4EE5\u4E0B",value:0,itemStyle:{color:"rgb(6,110,247)"}},{name:"\u638C\u63E1\u738760%\uFF5E79%",value:0,itemStyle:{color:"rgb(6,234,230)"}},{name:"\u638C\u63E1\u738780%\uFF5E100%",value:0,itemStyle:{color:"rgb(223,209,38)"}}]),Pt=new URLSearchParams(window.location.search),zt=()=>Ot(void 0,null,function*(){const Ve=yield et({subject_id:Tt==null?void 0:Tt.pathId,id:Tt==null?void 0:Tt.abilityId})}),er=Ve=>gt({type:"userDetail/logWatchHistory",payload:Bt({},Ve)});function $t(Ve){return Ot(this,null,function*(){var Xt,ar,mr;let sr=yield(0,M.ZP)("/api/knowledge/v2/get_container_type.json",{method:"get",params:{url:Ve==null?void 0:Ve.resourceUrl}});if(localStorage.setItem("container_type_tupu",sr==null?void 0:sr.container_type),(sr==null?void 0:sr.status)===0){if((Ve==null?void 0:Ve.node_type)=="\u8BD5\u5377"){const nr=yield(0,Oe.Mb)({categoryId:sr==null?void 0:sr.examination_bank_id});nr!=null&&nr.exercise_id&&(0,te.xg)(`/classrooms/coursesId/exercise/${nr.exercise_id}/${(Xt=yt.userInfo)==null?void 0:Xt.login}/initate_answer`);return}(sr==null?void 0:sr.container_type)==="video"?Ne({id:sr==null?void 0:sr.id,open:!0,resourceUrl:Ve==null?void 0:Ve.resourceUrl}):(sr==null?void 0:sr.container_type)==="att"?It({url:H.Z.API_SERVER+((ar=sr==null?void 0:sr.attachment)==null?void 0:ar.url),file_type:(mr=sr==null?void 0:sr.attachment)==null?void 0:mr.file_type}):window.open(Ve==null?void 0:Ve.resourceUrl)}})}const _r=Ve=>Ot(void 0,null,function*(){(Ve==null?void 0:Ve.resourceOrigin)===3?(0,te.xg)(Ve==null?void 0:Ve.resourceUrl):$t(Ve),!(kt!=null&&kt.can_managed)&&(yield(0,M.ZP)("/api/subject_knowledge/create_study.json",{method:"post",body:{subject_id:Tt==null?void 0:Tt.pathId,uuid:(Ve==null?void 0:Ve.last_knowledge_uuid)||(Ve==null?void 0:Ve.knowledge_uuid)}}))});return(0,c.useEffect)(()=>{var Ve,Xt;if((Ke==null?void 0:Ke.status)==0&&(kt!=null&&kt.can_managed)){const ar=(Xt=Object==null?void 0:Object.entries(((Ve=Ke==null?void 0:Ke.data)==null?void 0:Ve.study_grasp_hash)||{}))==null?void 0:Xt.map(([mr,sr],nr)=>({name:mr,value:sr,itemStyle:Et[nr].itemStyle}));wt(ar)}},[kt==null?void 0:kt.can_managed,Ke]),(0,c.useEffect)(()=>{zt()},[Tt==null?void 0:Tt.abilityId]),(0,c.useEffect)(()=>{gt({type:"pathsDetail/getKnowledgeGraphs",payload:{graphable_type:Ut.get("type")=="classrooms"?"course":"subject",graphable_id:Tt==null?void 0:Tt.pathId}}),Pt.set("tabs","5")},[]),(0,c.useEffect)(()=>(gt({type:"globalSetting/footerToggle",payload:!1}),()=>{gt({type:"globalSetting/footerToggle",payload:!0})}),[]),c.createElement(y.Z,{spinning:je},c.createElement("div",{className:"ml-auto mr-auto",style:{width:"1200rem",paddingTop:"15rem"}},c.createElement(L.Z,{style:{fontSize:"14rem",marginBottom:"20rem"},items:[{title:c.createElement("a",{className:"flex item-center",style:{fontSize:"14rem"},onClick:()=>{u.history.push(`/knowledgegraph/${Tt.pathId}?${Pt}`)}},c.createElement(re.Z,{title:"\u8FD4\u56DE"},c.createElement("i",{className:"iconfont icon-fanhui1",style:{fontSize:"14rem",marginRight:"20rem"}})),"\u80FD\u529B\u56FE\u8C31")},{title:"\u80FD\u529B\u8BE6\u60C5"}]}),c.createElement("div",{className:"w-full flex"},c.createElement("div",{className:"sticky flex flex-col",style:{width:"250rem",borderRadius:"4rem 0 0 4rem",maxHeight:"100vh",overflowY:"auto",overflowX:"hidden",top:0,background:"#F6F7F9"}},c.createElement(V,{abilityGoalItem:(ir=Ke==null?void 0:Ke.data)==null?void 0:ir.ability_goals}),c.createElement("div",{style:{padding:"10rem 20rem 20rem"}},c.createElement("div",{className:"c-grey-333",style:{fontSize:"16rem"}},"\u76EE\u5F55\u5BFC\u822A"),c.createElement(A.default,{className:"w-full",value:Number(Tt==null?void 0:Tt.abilityId),style:{marginTop:"10rem"},onChange:Ve=>{u.history.push(`/knowledgegraph/${Tt.pathId}/abilityMap/detail/${Ve}?${Pt}`)},options:((St=(Jt=Ke==null?void 0:Ke.data)==null?void 0:Jt.ability_goals)==null?void 0:St.map(Ve=>({label:Ve==null?void 0:Ve.name,value:Ve==null?void 0:Ve.id})))||[],size:"large"})),c.createElement(s.default,{className:q.AnchorDomStyle,items:(Rt=(it=Ke==null?void 0:Ke.data)==null?void 0:it.children_ability_goals)==null?void 0:Rt.map(Ve=>{var Xt;return{key:Ve==null?void 0:Ve.id,href:`#${Ve==null?void 0:Ve.id}`,title:c.createElement("div",{className:`current relative ${q.AnchorDom}`},c.createElement("div",{className:"flex item-center",style:{gap:"10rem"}},c.createElement("div",{className:"flex-1 minW-0 multi_ellipsis1 c-grey-333",style:{fontSize:"14rem"}},Ve==null?void 0:Ve.name),c.createElement("span",{style:{color:"#464F66",fontSize:"12rem"}},kt!=null&&kt.can_managed?c.createElement(c.Fragment,null,c.createElement("span",{className:"iconfont icon-a-60-kejian",style:{marginRight:"5rem",fontSize:"12rem"}}),Ve==null?void 0:Ve.knowledge_count):c.createElement("span",{style:{color:"#00C088"}},c.createElement("span",{className:"iconfont icon-xuesheng2",style:{marginRight:"5rem",fontSize:"12rem"}}),(Ve==null?void 0:Ve.grasp_rate)||0,"%"))),c.createElement("div",{className:"flex flex-wrap",style:{gap:"5rem",marginTop:"10rem"}},(Xt=Ve==null?void 0:Ve.ability_tags)==null?void 0:Xt.map(ar=>c.createElement(X.default,{color:"orange",style:{fontSize:"12rem"},key:ar},ar))),c.createElement("div",{className:"multi_ellipsis2",style:{marginTop:"20rem",color:"#464F66",fontSize:"12rem"}},Ve==null?void 0:Ve.description))}})})),c.createElement("div",{className:"flex-1 minW-0 flex flex-col",style:{gap:"20rem"}},c.createElement("div",{className:"bg-white relative",style:{borderRadius:"4rem",padding:"15rem 30rem 30rem"}},((jt=(Vt=Ke==null?void 0:Ke.data)==null?void 0:Vt.next_ability_goal)==null?void 0:jt.id)&&c.createElement("div",{className:"absolute current",style:{right:0,top:0},onClick:()=>{var Ve,Xt;u.history.push(`/knowledgegraph/${Tt.pathId}/abilityMap/detail/${(Xt=(Ve=Ke==null?void 0:Ke.data)==null?void 0:Ve.next_ability_goal)==null?void 0:Xt.id}?${Pt}`)}},c.createElement("div",{className:q.NextAbility},c.createElement("div",{className:"multi_ellipsis1"},(qe=(Yt=Ke==null?void 0:Ke.data)==null?void 0:Yt.next_ability_goal)==null?void 0:qe.name),c.createElement("div",null,c.createElement("span",{className:"iconfont icon-you2",style:{fontSize:"14rem"}})))),c.createElement("div",{style:{color:"#3061D0"}},c.createElement(he,{type:"\u4E3B\u80FD\u529B",ImgProps:{style:{marginRight:"5rem"}}}),"\u4E3B\u80FD\u529B"),c.createElement("div",{className:"c-grey-333 blod",style:{fontSize:"14rem",margin:"20rem 0 10rem 0"}},(mt=Ke==null?void 0:Ke.data)==null?void 0:mt.name),((Dt=Ke==null?void 0:Ke.data)==null?void 0:Dt.description)&&c.createElement("div",{style:{padding:"12rem",background:"#F6F7F9"}},c.createElement(ur,null,(Ft=Ke==null?void 0:Ke.data)==null?void 0:Ft.description)),(kt==null?void 0:kt.can_managed)&&c.createElement(c.Fragment,null,c.createElement("div",{className:"flex",style:{marginTop:"20rem",gap:"20rem"}},[{title:"\u5E73\u5747\u4E3B\u80FD\u529B\u638C\u63E1\u7387",value:(Zt=Ke==null?void 0:Ke.data)==null?void 0:Zt.children_ability_goal_grasp_rate,unit:"%",img:ae(46016),bg:"#E3F1FF"},{title:"\u8986\u76D6\u77E5\u8BC6\u70B9",value:(_t=Ke==null?void 0:Ke.data)==null?void 0:_t.total_knowledge_count,unit:"\u4E2A",img:ae(99755),bg:"#F1FDEF",ProgressTitle:"\u5360\u603B\u77E5\u8BC6\u70B9",percent:(G=Ke==null?void 0:Ke.data)==null?void 0:G.knowledge_rate,trailColor:"rgba(50, 199, 145, .1)",strokeColor:"#32C791"},{title:"\u8986\u76D6\u8D44\u6E90\u6570",value:(Y=Ke==null?void 0:Ke.data)==null?void 0:Y.total_resource_count,unit:"\u4E2A",img:ae(92691),bg:"#FFF9F4",ProgressTitle:"\u5360\u603B\u8D44\u6E90\u6570",percent:(J=Ke==null?void 0:Ke.data)==null?void 0:J.resource_rate,trailColor:"rgba(236, 159, 48, 0.10)",strokeColor:"#EC9F30"}].map((Ve,Xt)=>c.createElement("div",{key:Xt,className:"flex-1 minW-0 relative",style:{borderRadius:"6rem",background:Ve==null?void 0:Ve.bg,padding:"20rem 30rem"}},c.createElement("img",{src:Ve==null?void 0:Ve.img,width:"43rem",height:"43rem",className:"absolute",style:{right:"30rem",top:"20rem"}}),c.createElement("div",{className:"c-grey-666",style:{fontSize:"14rem"}},Ve==null?void 0:Ve.title),c.createElement("div",{className:"c-grey-333 blod",style:{marginTop:"10rem",fontSize:"26rem",lineHeight:"26rem"}},Ve==null?void 0:Ve.value,c.createElement("span",{style:{fontSize:"14rem"}},Ve==null?void 0:Ve.unit)),(Ve==null?void 0:Ve.ProgressTitle)&&c.createElement("div",{className:"c-grey-666",style:{fontSize:"12rem",marginTop:"20rem"}},c.createElement("div",null,Ve==null?void 0:Ve.ProgressTitle,Ve==null?void 0:Ve.percent,"%"),c.createElement(D.Z,{percent:Ve==null?void 0:Ve.percent,showInfo:!1,trailColor:Ve==null?void 0:Ve.trailColor,strokeColor:Ve==null?void 0:Ve.strokeColor,style:{marginBottom:"0",marginLeft:"0"}}))))),c.createElement("div",{className:"c-grey-333",style:{margin:"40rem 0 30rem 0",fontSize:"14rem"}},"\u5B66\u4E60\u7EDF\u8BA1"),c.createElement("div",{className:"flex"},c.createElement("div",{className:"minW-0 flex flex-col",style:{gap:"13rem",width:"200rem"}},[{title:"\u5B66\u4E60\u4EBA\u6570",value:(le=Ke==null?void 0:Ke.data)==null?void 0:le.study_count,unit:"",img:ae(37426),bg:"rgba(68, 95, 232, 0.1)"},{title:"\u5B66\u4E60\u5B8C\u6210\u7387",value:(_e=Ke==null?void 0:Ke.data)==null?void 0:_e.complete_rate,unit:"%",img:ae(19150),bg:"rgba(182, 129, 0, .1)"},{title:"\u5B66\u4E60\u638C\u63E1\u7387",value:(Ie=Ke==null?void 0:Ke.data)==null?void 0:Ie.grasp_rate,unit:"%",img:ae(55303),bg:"rgba(6, 145, 127, .1)"}].map((Ve,Xt)=>c.createElement("div",{key:Xt,className:"relative",style:{borderRadius:"6rem",padding:"20rem",background:Ve==null?void 0:Ve.bg}},c.createElement("div",{style:{fontSize:"14rem"}},Ve==null?void 0:Ve.title),c.createElement("div",{className:"blod",style:{fontSize:"26rem"}},Ve==null?void 0:Ve.value,c.createElement("span",{style:{fontSize:"14rem"}},Ve==null?void 0:Ve.unit)),c.createElement("img",{className:"absolute",style:{right:"6rem",bottom:"6rem"},height:"35rem",src:Ve==null?void 0:Ve.img})))),c.createElement("div",{className:"flex-1 minW-0"},c.createElement(f.Z,{dataSource:Et,legend:{top:null,icon:"roundRect",bottom:10,itemWidth:14,itemGap:50,left:"center",formatter:Ve=>Ve}})))),!(kt!=null&&kt.can_managed)&&c.createElement(c.Fragment,null,c.createElement("div",{className:"flex item-center",style:{gap:"20rem",marginTop:"20rem"}},[{title:"\u8986\u76D6\u77E5\u8BC6\u70B9",value:(Ce=Ke==null?void 0:Ke.data)==null?void 0:Ce.total_knowledge_count,unit:"\u4E2A",percent:(Xe=Ke==null?void 0:Ke.data)==null?void 0:Xe.knowledge_rate,percenttitle:"\u5360\u603B\u77E5\u8BC6\u70B9",trailColor:"rgba(50, 199, 145, .1)",strokeColor:"#32C791"},{title:"\u8986\u76D6\u8D44\u6E90\u6570",value:(Je=Ke==null?void 0:Ke.data)==null?void 0:Je.total_resource_count,unit:"\u4E2A",percent:(bt=Ke==null?void 0:Ke.data)==null?void 0:bt.resource_rate,percenttitle:"\u5360\u603B\u8D44\u6E90\u6570",trailColor:"rgba(236, 159, 48, 0.10)",strokeColor:"#EC9F30"}].map((Ve,Xt)=>c.createElement("div",{key:Xt,className:"flex-1 minW-0 flex justify-between c-grey-333",style:{gap:"20rem",background:"#F6F7F9",borderRadius:"6rem",padding:"30rem 60rem"}},c.createElement("div",{className:"flex flex-col justify-between"},c.createElement("div",{style:{fontSize:"14rem",whiteSpace:"nowrap"}},Ve==null?void 0:Ve.title),c.createElement("div",{className:"blod",style:{fontSize:"26rem"}},Ve==null?void 0:Ve.value,c.createElement("span",{style:{fontSize:"14rem"}},Ve==null?void 0:Ve.unit))),c.createElement("div",{className:"relative",style:{width:"133rem",height:"75rem"}},c.createElement(D.Z,{type:"dashboard",percent:Ve==null?void 0:Ve.percent,gapDegree:178,strokeWidth:10,className:"absolute",style:{right:0,top:0},trailColor:Ve==null?void 0:Ve.trailColor,strokeColor:Ve==null?void 0:Ve.strokeColor,strokeLinecap:"round",format:ar=>c.createElement("div",{className:"c-grey-333",style:{fontSize:"12rem",textAlign:"center",marginTop:"-35rem"}},ar,"%",c.createElement("br",null),c.createElement("br",null),Ve==null?void 0:Ve.percenttitle)}))))),c.createElement("div",{className:"c-grey-333 blod",style:{margin:"40rem 0 30rem 0",fontSize:"14rem"}},"\u5B66\u4E60\u7EDF\u8BA1"),c.createElement("div",{className:"flex",style:{marginTop:"20rem",gap:"20rem"}},[{title:"\u4E3B\u80FD\u529B\u638C\u63E1\u7387",value:(Ht=Ke==null?void 0:Ke.data)==null?void 0:Ht.children_ability_goal_grasp_rate,unit:"%",img:ae(46016),bg:"#E3F1FF"},{title:"\u5DF2\u638C\u63E1\u77E5\u8BC6\u70B9",value:((Pe=Ke==null?void 0:Ke.data)==null?void 0:Pe.knowledge_grasp_count)||0,unit:"\u4E2A",img:ae(99755),bg:"#F1FDEF",ProgressTitle:"\u77E5\u8BC6\u70B9\u638C\u63E1\u7387",percent:((be=Ke==null?void 0:Ke.data)==null?void 0:be.knowledge_grasp_rate)||0,trailColor:"rgba(50, 199, 145, .1)",strokeColor:"#32C791"},{title:"\u5DF2\u5B8C\u6210\u8D44\u6E90\u6570",value:((ut=Ke==null?void 0:Ke.data)==null?void 0:ut.resource_complete_count)||0,unit:"\u4E2A",img:ae(92691),bg:"#FFF9F4",ProgressTitle:"\u5B8C\u6210\u8D44\u6E90\u7387",percent:((ze=Ke==null?void 0:Ke.data)==null?void 0:ze.resource_complete_rate)||0,trailColor:"rgba(236, 159, 48, 0.10)",strokeColor:"#EC9F30"}].map((Ve,Xt)=>c.createElement("div",{key:Xt,className:"flex-1 minW-0 relative",style:{borderRadius:"6rem",background:Ve==null?void 0:Ve.bg,padding:"20rem 30rem"}},c.createElement("img",{src:Ve==null?void 0:Ve.img,width:"43rem",height:"43rem",className:"absolute",style:{right:"30rem",top:"20rem"}}),c.createElement("div",{className:"c-grey-666",style:{fontSize:"14rem"}},Ve==null?void 0:Ve.title),c.createElement("div",{className:"c-grey-333 blod",style:{marginTop:"10rem",fontSize:"26rem",lineHeight:"26rem"}},Ve==null?void 0:Ve.value,c.createElement("span",{style:{fontSize:"14rem"}},Ve==null?void 0:Ve.unit)),(Ve==null?void 0:Ve.ProgressTitle)&&c.createElement("div",{className:"c-grey-666",style:{fontSize:"12rem",marginTop:"20rem"}},c.createElement("div",null,Ve==null?void 0:Ve.ProgressTitle,Ve==null?void 0:Ve.percent,"%"),c.createElement(D.Z,{percent:Ve==null?void 0:Ve.percent,showInfo:!1,trailColor:Ve==null?void 0:Ve.trailColor,strokeColor:Ve==null?void 0:Ve.strokeColor,style:{marginBottom:"0",marginLeft:"0"}}))))),c.createElement("div",{className:"c-grey-333 blod",style:{margin:"30rem 0 10rem 0",fontSize:"14rem"}},"\u5F00\u59CB\u5B66\u4E60"),c.createElement("div",{className:"flex flex-col",style:{gap:"10rem"}},(Qe=(He=Ke==null?void 0:Ke.data)==null?void 0:He.children_ability_goals)==null?void 0:Qe.map(Ve=>c.createElement("div",{key:Ve==null?void 0:Ve.id,className:"flex item-center",style:{gap:"20rem",padding:"20rem",background:"#F6F7F9",borderRadius:"6rem"}},c.createElement("div",{className:"flex-1 minW-0 flex flex-col"},c.createElement("div",{className:"flex",style:{gap:"10rem"}},c.createElement("div",{style:{color:"#3061D0"}},c.createElement(he,{type:"\u5B50\u80FD\u529B",ImgProps:{style:{marginRight:"5rem"}}}),"\u5B50\u80FD\u529B"),c.createElement(re.Z,{title:Ve==null?void 0:Ve.name,placement:"topLeft"},c.createElement("div",{className:"multi_ellipsis1"},Ve==null?void 0:Ve.name))),c.createElement("div",{className:"flex item-center",style:{gap:"10rem",marginTop:"15rem",fontSize:"14rem"}},c.createElement(X.default,{color:"orange",style:{fontSize:"12rem",lineHeight:"1.5"}},"\u8282\u70B9"),c.createElement("span",{className:"c-grey-333"},Ve==null?void 0:Ve.last_knowledge_name),Ve!=null&&Ve.is_complete?c.createElement("span",{className:"c-green"},"\uFF08\u5DF2\u638C\u63E1\uFF09"):c.createElement("span",{className:"c-grey-666"},"\uFF08\u672A\u638C\u63E1\uFF09"))),c.createElement(C.op,{onClick:()=>Ot(void 0,null,function*(){yield _r(Ve)})},(Ve==null?void 0:Ve.complete_rate)==0?"\u5F00\u59CB\u5B66\u4E60":"\u7EE7\u7EED\u5B66\u4E60")))))),(pt=(ht=Ke==null?void 0:Ke.data)==null?void 0:ht.children_ability_goals)==null?void 0:pt.map(Ve=>c.createElement(br,{key:Ve==null?void 0:Ve.id,DataProps:Ve,pathsDetail:Lt,getUrl:_r}))))),c.createElement(x.default,{open:ft==null?void 0:ft.open,title:"\u89C6\u9891",width:800,centered:!0,onCancel:()=>{Ne(st(Bt({},ft),{open:!1}))},onOk:()=>{Ne(st(Bt({},ft),{open:!1}))}},c.createElement(Te.Z,{allow_skip:!0,videoId:ft.id,toLog:!0,src:ft==null?void 0:ft.resourceUrl,logWatchHistory:Ve=>er(st(Bt({},Ve),{container_type:localStorage.getItem("container_type_tupu")}))})),c.createElement($.Z,{close:!0,style:{zIndex:1300,background:"rgba(1, 10, 35, 0.5)"},data:ot==null?void 0:ot.url,type:ot==null?void 0:ot.file_type,disabledDownload:!0,onClose:()=>It({})}))};var Fr=(0,u.connect)(({pathsDetail:Lt,user:gt})=>({pathsDetail:Lt,user:gt}))(Qt)},2610:function(qt,$e,ae){"use strict";ae.d($e,{BU:function(){return re},Dj:function(){return te},gH:function(){return X},vp:function(){return D}});function te(W){try{W.mozRequestFullScreen?W.mozRequestFullScreen():W.webkitRequestFullScreen&&W.webkitRequestFullScreen()}catch(y){console.log(y,":e")}}function re(){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 X=()=>{if(document.webkitExitFullscreen)return"webkitfullscreenchange";if(document.exitFullscreen)return"fullscreenchange";if(document.msExitFullscreen)return"msfullscreenchange";if(document.mozCancelFullScreen)return"mozfullscreenchange"};function D(){var W=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement,y=document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",W),window.isFullScreen?window.isFullScreen:W!=null}},98072:function(qt,$e,ae){"use strict";ae.d($e,{U:function(){return s}});var te=ae(59301),re=Object.defineProperty,X=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,y=(x,c,u)=>c in x?re(x,c,{enumerable:!0,configurable:!0,writable:!0,value:u}):x[c]=u,L=(x,c)=>{for(var u in c||(c={}))D.call(c,u)&&y(x,u,c[u]);if(X)for(var u of X(c))W.call(c,u)&&y(x,u,c[u]);return x},A=(x,c,u)=>new Promise((f,i)=>{var o=_=>{try{m(u.next(_))}catch(h){i(h)}},d=_=>{try{m(u.throw(_))}catch(h){i(h)}},m=_=>_.done?f(_.value):Promise.resolve(_.value).then(o,d);m((u=u.apply(x,c)).next())});function s(x,c){const[u,f]=(0,te.useState)(c),[i,o]=(0,te.useState)(!1),[d,m]=(0,te.useState)();return[u,i,(h,v=!1)=>A(this,null,function*(){const r=v?c:L(L({},u),h);o(!0),f(r);const a=yield x(r);return o(!1),m(a),a}),d,m]}},60513:function(qt,$e,ae){"use strict";ae.d($e,{Z:function(){return Zt}});class te{static install(){Object.setPrototypeOf=Object.setPrototypeOf||function(G,Y){return G.__proto__=Y,G},Object.assign=Object.assign||function(G){if(G==null)throw new TypeError("Cannot convert undefined or null to object");let Y=Object(G);for(let J=1;J<arguments.length;J++){let le=arguments[J];if(le!=null)for(let _e in le)le.hasOwnProperty(_e)&&(Y[_e]=le[_e])}return Y},typeof self.Promise!="function"&&ae(3867).polyfill()}}te.install();var re=te,X=ae(86204),D=ae.n(X);class W{static e(G,Y){(!G||W.FORCE_GLOBAL_TAG)&&(G=W.GLOBAL_TAG);let J=`[${G}] > ${Y}`;W.ENABLE_CALLBACK&&W.emitter.emit("log","error",J),W.ENABLE_ERROR&&(console.error?console.error(J):console.warn?console.warn(J):console.log(J))}static i(G,Y){(!G||W.FORCE_GLOBAL_TAG)&&(G=W.GLOBAL_TAG);let J=`[${G}] > ${Y}`;W.ENABLE_CALLBACK&&W.emitter.emit("log","info",J),W.ENABLE_INFO&&(console.info?console.info(J):console.log(J))}static w(G,Y){(!G||W.FORCE_GLOBAL_TAG)&&(G=W.GLOBAL_TAG);let J=`[${G}] > ${Y}`;W.ENABLE_CALLBACK&&W.emitter.emit("log","warn",J),W.ENABLE_WARN&&(console.warn?console.warn(J):console.log(J))}static d(G,Y){(!G||W.FORCE_GLOBAL_TAG)&&(G=W.GLOBAL_TAG);let J=`[${G}] > ${Y}`;W.ENABLE_CALLBACK&&W.emitter.emit("log","debug",J),W.ENABLE_DEBUG&&(console.debug?console.debug(J):console.log(J))}static v(G,Y){(!G||W.FORCE_GLOBAL_TAG)&&(G=W.GLOBAL_TAG);let J=`[${G}] > ${Y}`;W.ENABLE_CALLBACK&&W.emitter.emit("log","verbose",J),W.ENABLE_VERBOSE&&console.log(J)}}W.GLOBAL_TAG="flv.js",W.FORCE_GLOBAL_TAG=!1,W.ENABLE_ERROR=!0,W.ENABLE_INFO=!0,W.ENABLE_WARN=!0,W.ENABLE_DEBUG=!0,W.ENABLE_VERBOSE=!0,W.ENABLE_CALLBACK=!1,W.emitter=new(D());var y=W;class L{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(G){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=G,this._totalBytes+=G):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=G,this._totalBytes+=G):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=G,this._totalBytes+=G,this._lastCheckpoint=this._now())}get currentKBps(){this.addBytes(0);let G=(this._now()-this._lastCheckpoint)/1e3;return G==0&&(G=1),this._intervalBytes/G/1024}get lastSecondKBps(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}get averageKBps(){let G=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/G/1024}}var A=L;class s{constructor(G){this._message=G}get name(){return"RuntimeException"}get message(){return this._message}toString(){return this.name+": "+this.message}}class x extends s{constructor(G){super(G)}get name(){return"IllegalStateException"}}class c extends s{constructor(G){super(G)}get name(){return"InvalidArgumentException"}}class u extends s{constructor(G){super(G)}get name(){return"NotImplementedException"}}const f={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},i={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"};class o{constructor(G){this._type=G||"undefined",this._status=f.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}destroy(){this._status=f.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}isWorking(){return this._status===f.kConnecting||this._status===f.kBuffering}get type(){return this._type}get status(){return this._status}get needStashBuffer(){return this._needStash}get onContentLengthKnown(){return this._onContentLengthKnown}set onContentLengthKnown(G){this._onContentLengthKnown=G}get onURLRedirect(){return this._onURLRedirect}set onURLRedirect(G){this._onURLRedirect=G}get onDataArrival(){return this._onDataArrival}set onDataArrival(G){this._onDataArrival=G}get onError(){return this._onError}set onError(G){this._onError=G}get onComplete(){return this._onComplete}set onComplete(G){this._onComplete=G}open(G,Y){throw new u("Unimplemented abstract function!")}abort(){throw new u("Unimplemented abstract function!")}}let d={};function m(){let _t=self.navigator.userAgent.toLowerCase(),G=/(edge)\/([\w.]+)/.exec(_t)||/(opr)[\/]([\w.]+)/.exec(_t)||/(chrome)[ \/]([\w.]+)/.exec(_t)||/(iemobile)[\/]([\w.]+)/.exec(_t)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(_t)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(_t)||/(webkit)[ \/]([\w.]+)/.exec(_t)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(_t)||/(msie) ([\w.]+)/.exec(_t)||_t.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(_t)||_t.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(_t)||[],Y=/(ipad)/.exec(_t)||/(ipod)/.exec(_t)||/(windows phone)/.exec(_t)||/(iphone)/.exec(_t)||/(kindle)/.exec(_t)||/(android)/.exec(_t)||/(windows)/.exec(_t)||/(mac)/.exec(_t)||/(linux)/.exec(_t)||/(cros)/.exec(_t)||[],J={browser:G[5]||G[3]||G[1]||"",version:G[2]||G[4]||"0",majorVersion:G[4]||G[2]||"0",platform:Y[0]||""},le={};if(J.browser){le[J.browser]=!0;let _e=J.majorVersion.split(".");le.version={major:parseInt(J.majorVersion,10),string:J.version},_e.length>1&&(le.version.minor=parseInt(_e[1],10)),_e.length>2&&(le.version.build=parseInt(_e[2],10))}if(J.platform&&(le[J.platform]=!0),(le.chrome||le.opr||le.safari)&&(le.webkit=!0),le.rv||le.iemobile){le.rv&&delete le.rv;let _e="msie";J.browser=_e,le[_e]=!0}if(le.edge){delete le.edge;let _e="msedge";J.browser=_e,le[_e]=!0}if(le.opr){let _e="opera";J.browser=_e,le[_e]=!0}if(le.safari&&le.android){let _e="android";J.browser=_e,le[_e]=!0}le.name=J.browser,le.platform=J.platform;for(let _e in d)d.hasOwnProperty(_e)&&delete d[_e];Object.assign(d,le)}m();var _=d;class h extends o{static isSupported(){try{let G=_.msedge&&_.version.minor>=15048,Y=_.msedge?G:!0;return self.fetch&&self.ReadableStream&&Y}catch(G){return!1}}constructor(G,Y){super("fetch-stream-loader"),this.TAG="FetchStreamLoader",this._seekHandler=G,this._config=Y,this._needStash=!0,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),super.destroy()}open(G,Y){this._dataSource=G,this._range=Y;let J=G.url;this._config.reuseRedirectedURL&&G.redirectedURL!=null&&(J=G.redirectedURL);let le=this._seekHandler.getConfig(J,Y),_e=new self.Headers;if(typeof le.headers=="object"){let Ce=le.headers;for(let Xe in Ce)Ce.hasOwnProperty(Xe)&&_e.append(Xe,Ce[Xe])}let Ie={method:"GET",headers:_e,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(let Ce in this._config.headers)_e.append(Ce,this._config.headers[Ce]);G.cors===!1&&(Ie.mode="same-origin"),G.withCredentials&&(Ie.credentials="include"),G.referrerPolicy&&(Ie.referrerPolicy=G.referrerPolicy),this._status=f.kConnecting,self.fetch(le.url,Ie).then(Ce=>{if(this._requestAbort){this._requestAbort=!1,this._status=f.kIdle;return}if(Ce.ok&&Ce.status>=200&&Ce.status<=299){if(Ce.url!==le.url&&this._onURLRedirect){let Je=this._seekHandler.removeURLParameters(Ce.url);this._onURLRedirect(Je)}let Xe=Ce.headers.get("Content-Length");return Xe!=null&&(this._contentLength=parseInt(Xe),this._contentLength!==0&&this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)),this._pump.call(this,Ce.body.getReader())}else if(this._status=f.kError,this._onError)this._onError(i.HTTP_STATUS_CODE_INVALID,{code:Ce.status,msg:Ce.statusText});else throw new s("FetchStreamLoader: Http code invalid, "+Ce.status+" "+Ce.statusText)}).catch(Ce=>{if(this._status=f.kError,this._onError)this._onError(i.EXCEPTION,{code:-1,msg:Ce.message});else throw Ce})}abort(){this._requestAbort=!0}_pump(G){return G.read().then(Y=>{if(Y.done)if(this._contentLength!==null&&this._receivedLength<this._contentLength){this._status=f.kError;let J=i.EARLY_EOF,le={code:-1,msg:"Fetch stream meet Early-EOF"};if(this._onError)this._onError(J,le);else throw new s(le.msg)}else this._status=f.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1);else{if(this._requestAbort===!0)return this._requestAbort=!1,this._status=f.kComplete,G.cancel();this._status=f.kBuffering;let J=Y.value.buffer,le=this._range.from+this._receivedLength;this._receivedLength+=J.byteLength,this._onDataArrival&&this._onDataArrival(J,le,this._receivedLength),this._pump(G)}}).catch(Y=>{if(Y.code===11&&_.msedge)return;this._status=f.kError;let J=0,le=null;if((Y.code===19||Y.message==="network error")&&(this._contentLength===null||this._contentLength!==null&&this._receivedLength<this._contentLength)?(J=i.EARLY_EOF,le={code:Y.code,msg:"Fetch stream meet Early-EOF"}):(J=i.EXCEPTION,le={code:Y.code,msg:Y.message}),this._onError)this._onError(J,le);else throw new s(le.msg)})}}var v=h;class r extends o{static isSupported(){try{let G=new XMLHttpRequest;return G.open("GET","https://example.com",!0),G.responseType="moz-chunked-arraybuffer",G.responseType==="moz-chunked-arraybuffer"}catch(G){return y.w("MozChunkedLoader",G.message),!1}}constructor(G,Y){super("xhr-moz-chunked-loader"),this.TAG="MozChunkedLoader",this._seekHandler=G,this._config=Y,this._needStash=!0,this._xhr=null,this._requestAbort=!1,this._contentLength=null,this._receivedLength=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}open(G,Y){this._dataSource=G,this._range=Y;let J=G.url;this._config.reuseRedirectedURL&&G.redirectedURL!=null&&(J=G.redirectedURL);let le=this._seekHandler.getConfig(J,Y);this._requestURL=le.url;let _e=this._xhr=new XMLHttpRequest;if(_e.open("GET",le.url,!0),_e.responseType="moz-chunked-arraybuffer",_e.onreadystatechange=this._onReadyStateChange.bind(this),_e.onprogress=this._onProgress.bind(this),_e.onloadend=this._onLoadEnd.bind(this),_e.onerror=this._onXhrError.bind(this),G.withCredentials&&(_e.withCredentials=!0),typeof le.headers=="object"){let Ie=le.headers;for(let Ce in Ie)Ie.hasOwnProperty(Ce)&&_e.setRequestHeader(Ce,Ie[Ce])}if(typeof this._config.headers=="object"){let Ie=this._config.headers;for(let Ce in Ie)Ie.hasOwnProperty(Ce)&&_e.setRequestHeader(Ce,Ie[Ce])}this._status=f.kConnecting,_e.send()}abort(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=f.kComplete}_onReadyStateChange(G){let Y=G.target;if(Y.readyState===2){if(Y.responseURL!=null&&Y.responseURL!==this._requestURL&&this._onURLRedirect){let J=this._seekHandler.removeURLParameters(Y.responseURL);this._onURLRedirect(J)}if(Y.status!==0&&(Y.status<200||Y.status>299))if(this._status=f.kError,this._onError)this._onError(i.HTTP_STATUS_CODE_INVALID,{code:Y.status,msg:Y.statusText});else throw new s("MozChunkedLoader: Http code invalid, "+Y.status+" "+Y.statusText);else this._status=f.kBuffering}}_onProgress(G){if(this._status===f.kError)return;this._contentLength===null&&G.total!==null&&G.total!==0&&(this._contentLength=G.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));let Y=G.target.response,J=this._range.from+this._receivedLength;this._receivedLength+=Y.byteLength,this._onDataArrival&&this._onDataArrival(Y,J,this._receivedLength)}_onLoadEnd(G){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===f.kError)return;this._status=f.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}_onXhrError(G){this._status=f.kError;let Y=0,J=null;if(this._contentLength&&G.loaded<this._contentLength?(Y=i.EARLY_EOF,J={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(Y=i.EXCEPTION,J={code:-1,msg:G.constructor.name+" "+G.type}),this._onError)this._onError(Y,J);else throw new s(J.msg)}}var a=r;class p extends null{static isSupported(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;let G=new XMLHttpRequest;return G.open("GET","https://example.com",!0),G.responseType="ms-stream",G.responseType==="ms-stream"}catch(G){return Log.w("MSStreamLoader",G.message),!1}}constructor(G,Y){super("xhr-msstream-loader"),this.TAG="MSStreamLoader",this._seekHandler=G,this._config=Y,this._needStash=!0,this._xhr=null,this._reader=null,this._totalRange=null,this._currentRange=null,this._currentRequestURL=null,this._currentRedirectedURL=null,this._contentLength=null,this._receivedLength=0,this._bufferLimit=16*1024*1024,this._lastTimeBufferSize=0,this._isReconnecting=!1}destroy(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),super.destroy()}open(G,Y){this._internalOpen(G,Y,!1)}_internalOpen(G,Y,J){this._dataSource=G,J?this._currentRange=Y:this._totalRange=Y;let le=G.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?le=this._currentRedirectedURL:G.redirectedURL!=null&&(le=G.redirectedURL));let _e=this._seekHandler.getConfig(le,Y);this._currentRequestURL=_e.url;let Ie=this._reader=new self.MSStreamReader;Ie.onprogress=this._msrOnProgress.bind(this),Ie.onload=this._msrOnLoad.bind(this),Ie.onerror=this._msrOnError.bind(this);let Ce=this._xhr=new XMLHttpRequest;if(Ce.open("GET",_e.url,!0),Ce.responseType="ms-stream",Ce.onreadystatechange=this._xhrOnReadyStateChange.bind(this),Ce.onerror=this._xhrOnError.bind(this),G.withCredentials&&(Ce.withCredentials=!0),typeof _e.headers=="object"){let Xe=_e.headers;for(let Je in Xe)Xe.hasOwnProperty(Je)&&Ce.setRequestHeader(Je,Xe[Je])}if(typeof this._config.headers=="object"){let Xe=this._config.headers;for(let Je in Xe)Xe.hasOwnProperty(Je)&&Ce.setRequestHeader(Je,Xe[Je])}this._isReconnecting?this._isReconnecting=!1:this._status=LoaderStatus.kConnecting,Ce.send()}abort(){this._internalAbort(),this._status=LoaderStatus.kComplete}_internalAbort(){this._reader&&(this._reader.readyState===1&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)}_xhrOnReadyStateChange(G){let Y=G.target;if(Y.readyState===2)if(Y.status>=200&&Y.status<=299){if(this._status=LoaderStatus.kBuffering,Y.responseURL!=null){let le=this._seekHandler.removeURLParameters(Y.responseURL);Y.responseURL!==this._currentRequestURL&&le!==this._currentRedirectedURL&&(this._currentRedirectedURL=le,this._onURLRedirect&&this._onURLRedirect(le))}let J=Y.getResponseHeader("Content-Length");if(J!=null&&this._contentLength==null){let le=parseInt(J);le>0&&(this._contentLength=le,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=LoaderStatus.kError,this._onError)this._onError(LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:Y.status,msg:Y.statusText});else throw new RuntimeException("MSStreamLoader: Http code invalid, "+Y.status+" "+Y.statusText);else if(Y.readyState===3&&Y.status>=200&&Y.status<=299){this._status=LoaderStatus.kBuffering;let J=Y.response;this._reader.readAsArrayBuffer(J)}}_xhrOnError(G){this._status=LoaderStatus.kError;let Y=LoaderErrors.EXCEPTION,J={code:-1,msg:G.constructor.name+" "+G.type};if(this._onError)this._onError(Y,J);else throw new RuntimeException(J.msg)}_msrOnProgress(G){let J=G.target.result;if(J==null){this._doReconnectIfNeeded();return}let le=J.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=J.byteLength;let _e=this._totalRange.from+this._receivedLength;this._receivedLength+=le.byteLength,this._onDataArrival&&this._onDataArrival(le,_e,this._receivedLength),J.byteLength>=this._bufferLimit&&(Log.v(this.TAG,`MSStream buffer exceeded max size near ${_e+le.byteLength}, reconnecting...`),this._doReconnectIfNeeded())}_doReconnectIfNeeded(){if(this._contentLength==null||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();let G={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,G,!0)}}_msrOnLoad(G){this._status=LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}_msrOnError(G){this._status=LoaderStatus.kError;let Y=0,J=null;if(this._contentLength&&this._receivedLength<this._contentLength?(Y=LoaderErrors.EARLY_EOF,J={code:-1,msg:"MSStream meet Early-Eof"}):(Y=LoaderErrors.EARLY_EOF,J={code:-1,msg:G.constructor.name+" "+G.type}),this._onError)this._onError(Y,J);else throw new RuntimeException(J.msg)}}var E=null;class S extends o{static isSupported(){try{let G=new XMLHttpRequest;return G.open("GET","https://example.com",!0),G.responseType="arraybuffer",G.responseType==="arraybuffer"}catch(G){return y.w("RangeLoader",G.message),!1}}constructor(G,Y){super("xhr-range-loader"),this.TAG="RangeLoader",this._seekHandler=G,this._config=Y,this._needStash=!1,this._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],this._currentChunkSizeKB=384,this._currentSpeedNormalized=0,this._zeroSpeedChunkCount=0,this._xhr=null,this._speedSampler=new A,this._requestAbort=!1,this._waitForTotalLength=!1,this._totalLengthReceived=!1,this._currentRequestURL=null,this._currentRedirectedURL=null,this._currentRequestRange=null,this._totalLength=null,this._contentLength=null,this._receivedLength=0,this._lastTimeLoaded=0}destroy(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),super.destroy()}get currentSpeed(){return this._speedSampler.lastSecondKBps}open(G,Y){this._dataSource=G,this._range=Y,this._status=f.kConnecting;let J=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(J=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!J?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}_openSubRange(){let G=this._currentChunkSizeKB*1024,Y=this._range.from+this._receivedLength,J=Y+G;this._contentLength!=null&&J-this._range.from>=this._contentLength&&(J=this._range.from+this._contentLength-1),this._currentRequestRange={from:Y,to:J},this._internalOpen(this._dataSource,this._currentRequestRange)}_internalOpen(G,Y){this._lastTimeLoaded=0;let J=G.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?J=this._currentRedirectedURL:G.redirectedURL!=null&&(J=G.redirectedURL));let le=this._seekHandler.getConfig(J,Y);this._currentRequestURL=le.url;let _e=this._xhr=new XMLHttpRequest;if(_e.open("GET",le.url,!0),_e.responseType="arraybuffer",_e.onreadystatechange=this._onReadyStateChange.bind(this),_e.onprogress=this._onProgress.bind(this),_e.onload=this._onLoad.bind(this),_e.onerror=this._onXhrError.bind(this),G.withCredentials&&(_e.withCredentials=!0),typeof le.headers=="object"){let Ie=le.headers;for(let Ce in Ie)Ie.hasOwnProperty(Ce)&&_e.setRequestHeader(Ce,Ie[Ce])}if(typeof this._config.headers=="object"){let Ie=this._config.headers;for(let Ce in Ie)Ie.hasOwnProperty(Ce)&&_e.setRequestHeader(Ce,Ie[Ce])}_e.send()}abort(){this._requestAbort=!0,this._internalAbort(),this._status=f.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(G){let Y=G.target;if(Y.readyState===2){if(Y.responseURL!=null){let J=this._seekHandler.removeURLParameters(Y.responseURL);Y.responseURL!==this._currentRequestURL&&J!==this._currentRedirectedURL&&(this._currentRedirectedURL=J,this._onURLRedirect&&this._onURLRedirect(J))}if(Y.status>=200&&Y.status<=299){if(this._waitForTotalLength)return;this._status=f.kBuffering}else if(this._status=f.kError,this._onError)this._onError(i.HTTP_STATUS_CODE_INVALID,{code:Y.status,msg:Y.statusText});else throw new s("RangeLoader: Http code invalid, "+Y.status+" "+Y.statusText)}}_onProgress(G){if(this._status===f.kError)return;if(this._contentLength===null){let J=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,J=!0;let le=G.total;this._internalAbort(),le!=null&le!==0&&(this._totalLength=le)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,J){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}let Y=G.loaded-this._lastTimeLoaded;this._lastTimeLoaded=G.loaded,this._speedSampler.addBytes(Y)}_normalizeSpeed(G){let Y=this._chunkSizeKBList,J=Y.length-1,le=0,_e=0,Ie=J;if(G<Y[0])return Y[0];for(;_e<=Ie;){if(le=_e+Math.floor((Ie-_e)/2),le===J||G>=Y[le]&&G<Y[le+1])return Y[le];Y[le]<G?_e=le+1:Ie=le-1}}_onLoad(G){if(this._status===f.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;let Y=this._speedSampler.lastSecondKBps;if(Y===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(Y=this._speedSampler.currentKBps)),Y!==0){let Ie=this._normalizeSpeed(Y);this._currentSpeedNormalized!==Ie&&(this._currentSpeedNormalized=Ie,this._currentChunkSizeKB=Ie)}let J=G.target.response,le=this._range.from+this._receivedLength;this._receivedLength+=J.byteLength;let _e=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():_e=!0,this._onDataArrival&&this._onDataArrival(J,le,this._receivedLength),_e&&(this._status=f.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}_onXhrError(G){this._status=f.kError;let Y=0,J=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(Y=i.EARLY_EOF,J={code:-1,msg:"RangeLoader meet Early-Eof"}):(Y=i.EXCEPTION,J={code:-1,msg:G.constructor.name+" "+G.type}),this._onError)this._onError(Y,J);else throw new s(J.msg)}}var w=S;class R extends o{static isSupported(){try{return typeof self.WebSocket!="undefined"}catch(G){return!1}}constructor(){super("websocket-loader"),this.TAG="WebSocketLoader",this._needStash=!0,this._ws=null,this._requestAbort=!1,this._receivedLength=0}destroy(){this._ws&&this.abort(),super.destroy()}open(G){try{let Y=this._ws=new self.WebSocket(G.url);Y.binaryType="arraybuffer",Y.onopen=this._onWebSocketOpen.bind(this),Y.onclose=this._onWebSocketClose.bind(this),Y.onmessage=this._onWebSocketMessage.bind(this),Y.onerror=this._onWebSocketError.bind(this),this._status=f.kConnecting}catch(Y){this._status=f.kError;let J={code:Y.code,msg:Y.message};if(this._onError)this._onError(i.EXCEPTION,J);else throw new s(J.msg)}}abort(){let G=this._ws;G&&(G.readyState===0||G.readyState===1)&&(this._requestAbort=!0,G.close()),this._ws=null,this._status=f.kComplete}_onWebSocketOpen(G){this._status=f.kBuffering}_onWebSocketClose(G){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=f.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}_onWebSocketMessage(G){if(G.data instanceof ArrayBuffer)this._dispatchArrayBuffer(G.data);else if(G.data instanceof Blob){let Y=new FileReader;Y.onload=()=>{this._dispatchArrayBuffer(Y.result)},Y.readAsArrayBuffer(G.data)}else{this._status=f.kError;let Y={code:-1,msg:"Unsupported WebSocket message type: "+G.data.constructor.name};if(this._onError)this._onError(i.EXCEPTION,Y);else throw new s(Y.msg)}}_dispatchArrayBuffer(G){let Y=G,J=this._receivedLength;this._receivedLength+=Y.byteLength,this._onDataArrival&&this._onDataArrival(Y,J,this._receivedLength)}_onWebSocketError(G){this._status=f.kError;let Y={code:G.code,msg:G.message};if(this._onError)this._onError(i.EXCEPTION,Y);else throw new s(Y.msg)}}var O=R;class z{constructor(G){this._zeroStart=G||!1}getConfig(G,Y){let J={};if(Y.from!==0||Y.to!==-1){let le;Y.to!==-1?le=`bytes=${Y.from.toString()}-${Y.to.toString()}`:le=`bytes=${Y.from.toString()}-`,J.Range=le}else this._zeroStart&&(J.Range="bytes=0-");return{url:G,headers:J}}removeURLParameters(G){return G}}var N=z;class P{constructor(G,Y){this._startName=G,this._endName=Y}getConfig(G,Y){let J=G;if(Y.from!==0||Y.to!==-1){let le=!0;J.indexOf("?")===-1&&(J+="?",le=!1),le&&(J+="&"),J+=`${this._startName}=${Y.from.toString()}`,Y.to!==-1&&(J+=`&${this._endName}=${Y.to.toString()}`)}return{url:J,headers:{}}}removeURLParameters(G){let Y=G.split("?")[0],J,le=G.indexOf("?");le!==-1&&(J=G.substring(le+1));let _e="";if(J!=null&&J.length>0){let Ie=J.split("&");for(let Ce=0;Ce<Ie.length;Ce++){let Xe=Ie[Ce].split("="),Je=Ce>0;Xe[0]!==this._startName&&Xe[0]!==this._endName&&(Je&&(_e+="&"),_e+=Ie[Ce])}}return _e.length===0?Y:Y+"?"+_e}}var F=P;class K{constructor(G,Y,J){this.TAG="IOController",this._config=Y,this._extraData=J,this._stashInitialSize=1024*384,Y.stashInitialSize!=null&&Y.stashInitialSize>0&&(this._stashInitialSize=Y.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,Y.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=G,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(G.url),this._refTotalLength=G.filesize?G.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new A,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(G){this._extraData=G}get onDataArrival(){return this._onDataArrival}set onDataArrival(G){this._onDataArrival=G}get onSeeked(){return this._onSeeked}set onSeeked(G){this._onSeeked=G}get onError(){return this._onError}set onError(G){this._onError=G}get onComplete(){return this._onComplete}set onComplete(G){this._onComplete=G}get onRedirect(){return this._onRedirect}set onRedirect(G){this._onRedirect=G}get onRecoveredEarlyEof(){return this._onRecoveredEarlyEof}set onRecoveredEarlyEof(G){this._onRecoveredEarlyEof=G}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===w?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}get loaderType(){return this._loader.type}_selectSeekHandler(){let G=this._config;if(G.seekType==="range")this._seekHandler=new N(this._config.rangeLoadZeroStart);else if(G.seekType==="param"){let Y=G.seekParamStart||"bstart",J=G.seekParamEnd||"bend";this._seekHandler=new F(Y,J)}else if(G.seekType==="custom"){if(typeof G.customSeekHandler!="function")throw new c("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new G.customSeekHandler}else throw new c(`Invalid seekType in config: ${G.seekType}`)}_selectLoader(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=O;else if(v.isSupported())this._loaderClass=v;else if(a.isSupported())this._loaderClass=a;else if(w.isSupported())this._loaderClass=w;else throw new s("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(G){this._currentRange={from:0,to:-1},G&&(this._currentRange.from=G),this._speedSampler.reset(),G||(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 G=this._resumeFrom;this._resumeFrom=0,this._internalSeek(G,!0)}}seek(G){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(G,!0)}_internalSeek(G,Y){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(Y),this._loader.destroy(),this._loader=null;let J={from:G,to:-1};this._currentRange={from:J.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,J),this._onSeeked&&this._onSeeked()}updateUrl(G){if(!G||typeof G!="string"||G.length===0)throw new c("Url must be a non-empty string!");this._dataSource.url=G}_expandBuffer(G){let Y=this._stashSize;for(;Y+1024*1024*1<G;)Y*=2;if(Y+=1024*1024*1,Y===this._bufferSize)return;let J=new ArrayBuffer(Y);if(this._stashUsed>0){let le=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(J,0,Y).set(le,0)}this._stashBuffer=J,this._bufferSize=Y}_normalizeSpeed(G){let Y=this._speedNormalizeList,J=Y.length-1,le=0,_e=0,Ie=J;if(G<Y[0])return Y[0];for(;_e<=Ie;){if(le=_e+Math.floor((Ie-_e)/2),le===J||G>=Y[le]&&G<Y[le+1])return Y[le];Y[le]<G?_e=le+1:Ie=le-1}}_adjustStashSize(G){let Y=0;this._config.isLive||G<512?Y=G:G>=512&&G<=1024?Y=Math.floor(G*1.5):Y=G*2,Y>8192&&(Y=8192);let J=Y*1024+1024*1024*1;this._bufferSize<J&&this._expandBuffer(J),this._stashSize=Y*1024}_dispatchChunks(G,Y){return this._currentRange.to=Y+G.byteLength-1,this._onDataArrival(G,Y)}_onURLRedirect(G){this._redirectedURL=G,this._onRedirect&&this._onRedirect(G)}_onContentLengthKnown(G){G&&this._fullRequestFlag&&(this._totalLength=G,this._fullRequestFlag=!1)}_onLoaderChunkArrival(G,Y,J){if(!this._onDataArrival)throw new x("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(G.byteLength);let le=this._speedSampler.lastSecondKBps;if(le!==0){let _e=this._normalizeSpeed(le);this._speedNormalized!==_e&&(this._speedNormalized=_e,this._adjustStashSize(_e))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=Y),this._stashUsed+G.byteLength<=this._stashSize)new Uint8Array(this._stashBuffer,0,this._stashSize).set(new Uint8Array(G),this._stashUsed),this._stashUsed+=G.byteLength;else{let _e=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){let Ie=this._stashBuffer.slice(0,this._stashUsed),Ce=this._dispatchChunks(Ie,this._stashByteStart);if(Ce<Ie.byteLength){if(Ce>0){let Xe=new Uint8Array(Ie,Ce);_e.set(Xe,0),this._stashUsed=Xe.byteLength,this._stashByteStart+=Ce}}else this._stashUsed=0,this._stashByteStart+=Ce;this._stashUsed+G.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+G.byteLength),_e=new Uint8Array(this._stashBuffer,0,this._bufferSize)),_e.set(new Uint8Array(G),this._stashUsed),this._stashUsed+=G.byteLength}else{let Ie=this._dispatchChunks(G,Y);if(Ie<G.byteLength){let Ce=G.byteLength-Ie;Ce>this._bufferSize&&(this._expandBuffer(Ce),_e=new Uint8Array(this._stashBuffer,0,this._bufferSize)),_e.set(new Uint8Array(G,Ie),0),this._stashUsed+=Ce,this._stashByteStart=Y+Ie}}}else if(this._stashUsed===0){let _e=this._dispatchChunks(G,Y);if(_e<G.byteLength){let Ie=G.byteLength-_e;Ie>this._bufferSize&&this._expandBuffer(Ie),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(G,_e),0),this._stashUsed+=Ie,this._stashByteStart=Y+_e}}else{this._stashUsed+G.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+G.byteLength);let _e=new Uint8Array(this._stashBuffer,0,this._bufferSize);_e.set(new Uint8Array(G),this._stashUsed),this._stashUsed+=G.byteLength;let Ie=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(Ie<this._stashUsed&&Ie>0){let Ce=new Uint8Array(this._stashBuffer,Ie);_e.set(Ce,0)}this._stashUsed-=Ie,this._stashByteStart+=Ie}}_flushStashBuffer(G){if(this._stashUsed>0){let Y=this._stashBuffer.slice(0,this._stashUsed),J=this._dispatchChunks(Y,this._stashByteStart),le=Y.byteLength-J;if(J<Y.byteLength)if(G)y.w(this.TAG,`${le} bytes unconsumed data remain when flush buffer, dropped`);else{if(J>0){let _e=new Uint8Array(this._stashBuffer,0,this._bufferSize),Ie=new Uint8Array(Y,J);_e.set(Ie,0),this._stashUsed=Ie.byteLength,this._stashByteStart+=J}return 0}return this._stashUsed=0,this._stashByteStart=0,le}return 0}_onLoaderComplete(G,Y){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}_onLoaderError(G,Y){switch(y.e(this.TAG,`Loader error, code = ${Y.code}, msg = ${Y.msg}`),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,G=i.UNRECOVERABLE_EARLY_EOF),G){case i.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){let J=this._currentRange.to+1;J<this._totalLength&&(y.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(J,!1));return}G=i.UNRECOVERABLE_EARLY_EOF;break}case i.UNRECOVERABLE_EARLY_EOF:case i.CONNECTING_TIMEOUT:case i.HTTP_STATUS_CODE_INVALID:case i.EXCEPTION:break}if(this._onError)this._onError(G,Y);else throw new s("IOException: "+Y.msg)}}var B=K;const V={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function C(){return Object.assign({},V)}class M{static supportMSEH264Playback(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}static supportNetworkStreamIO(){let G=new B({},C()),Y=G.loaderType;return G.destroy(),Y=="fetch-stream-loader"||Y=="xhr-moz-chunked-loader"}static getNetworkLoaderTypeName(){let G=new B({},C()),Y=G.loaderType;return G.destroy(),Y}static supportNativeMediaPlayback(G){M.videoElement==null&&(M.videoElement=window.document.createElement("video"));let Y=M.videoElement.canPlayType(G);return Y==="probably"||Y=="maybe"}static getFeatureList(){let G={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return G.mseFlvPlayback=M.supportMSEH264Playback(),G.networkStreamIO=M.supportNetworkStreamIO(),G.networkLoaderName=M.getNetworkLoaderTypeName(),G.mseLiveFlvPlayback=G.mseFlvPlayback&&G.networkStreamIO,G.nativeMP4H264Playback=M.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),G.nativeWebmVP8Playback=M.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),G.nativeWebmVP9Playback=M.supportNativeMediaPlayback('video/webm; codecs="vp9"'),G}}var H=M,q={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"};class se{static get forceGlobalTag(){return y.FORCE_GLOBAL_TAG}static set forceGlobalTag(G){y.FORCE_GLOBAL_TAG=G,se._notifyChange()}static get globalTag(){return y.GLOBAL_TAG}static set globalTag(G){y.GLOBAL_TAG=G,se._notifyChange()}static get enableAll(){return y.ENABLE_VERBOSE&&y.ENABLE_DEBUG&&y.ENABLE_INFO&&y.ENABLE_WARN&&y.ENABLE_ERROR}static set enableAll(G){y.ENABLE_VERBOSE=G,y.ENABLE_DEBUG=G,y.ENABLE_INFO=G,y.ENABLE_WARN=G,y.ENABLE_ERROR=G,se._notifyChange()}static get enableDebug(){return y.ENABLE_DEBUG}static set enableDebug(G){y.ENABLE_DEBUG=G,se._notifyChange()}static get enableVerbose(){return y.ENABLE_VERBOSE}static set enableVerbose(G){y.ENABLE_VERBOSE=G,se._notifyChange()}static get enableInfo(){return y.ENABLE_INFO}static set enableInfo(G){y.ENABLE_INFO=G,se._notifyChange()}static get enableWarn(){return y.ENABLE_WARN}static set enableWarn(G){y.ENABLE_WARN=G,se._notifyChange()}static get enableError(){return y.ENABLE_ERROR}static set enableError(G){y.ENABLE_ERROR=G,se._notifyChange()}static getConfig(){return{globalTag:y.GLOBAL_TAG,forceGlobalTag:y.FORCE_GLOBAL_TAG,enableVerbose:y.ENABLE_VERBOSE,enableDebug:y.ENABLE_DEBUG,enableInfo:y.ENABLE_INFO,enableWarn:y.ENABLE_WARN,enableError:y.ENABLE_ERROR,enableCallback:y.ENABLE_CALLBACK}}static applyConfig(G){y.GLOBAL_TAG=G.globalTag,y.FORCE_GLOBAL_TAG=G.forceGlobalTag,y.ENABLE_VERBOSE=G.enableVerbose,y.ENABLE_DEBUG=G.enableDebug,y.ENABLE_INFO=G.enableInfo,y.ENABLE_WARN=G.enableWarn,y.ENABLE_ERROR=G.enableError,y.ENABLE_CALLBACK=G.enableCallback}static _notifyChange(){let G=se.emitter;if(G.listenerCount("change")>0){let Y=se.getConfig();G.emit("change",Y)}}static registerListener(G){se.emitter.addListener("change",G)}static removeListener(G){se.emitter.removeListener("change",G)}static addLogListener(G){y.emitter.addListener("log",G),y.emitter.listenerCount("log")>0&&(y.ENABLE_CALLBACK=!0,se._notifyChange())}static removeLogListener(G){y.emitter.removeListener("log",G),y.emitter.listenerCount("log")===0&&(y.ENABLE_CALLBACK=!1,se._notifyChange())}}se.emitter=new(D());var ue=se;class pe{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 G=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,Y=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&&G&&Y}isSeekable(){return this.hasKeyframesIndex===!0}getNearestKeyframe(G){if(this.keyframesIndex==null)return null;let Y=this.keyframesIndex,J=this._search(Y.times,G);return{index:J,milliseconds:Y.times[J],fileposition:Y.filepositions[J]}}_search(G,Y){let J=0,le=G.length-1,_e=0,Ie=0,Ce=le;for(Y<G[0]&&(J=0,Ie=Ce+1);Ie<=Ce;)if(_e=Ie+Math.floor((Ce-Ie)/2),_e===le||Y>=G[_e]&&Y<G[_e+1]){J=_e;break}else G[_e]<Y?Ie=_e+1:Ce=_e-1;return J}}var xe=pe;function De(_t,G,Y){let J=_t;if(G+Y<J.length){for(;Y--;)if((J[++G]&192)!==128)return!1;return!0}else return!1}function Ue(_t){let G=[],Y=_t,J=0,le=_t.length;for(;J<le;){if(Y[J]<128){G.push(String.fromCharCode(Y[J])),++J;continue}else if(!(Y[J]<192)){if(Y[J]<224){if(De(Y,J,1)){let _e=(Y[J]&31)<<6|Y[J+1]&63;if(_e>=128){G.push(String.fromCharCode(_e&65535)),J+=2;continue}}}else if(Y[J]<240){if(De(Y,J,2)){let _e=(Y[J]&15)<<12|(Y[J+1]&63)<<6|Y[J+2]&63;if(_e>=2048&&(_e&63488)!==55296){G.push(String.fromCharCode(_e&65535)),J+=3;continue}}}else if(Y[J]<248&&De(Y,J,3)){let _e=(Y[J]&7)<<18|(Y[J+1]&63)<<12|(Y[J+2]&63)<<6|Y[J+3]&63;if(_e>65536&&_e<1114112){_e-=65536,G.push(String.fromCharCode(_e>>>10|55296)),G.push(String.fromCharCode(_e&1023|56320)),J+=4;continue}}}G.push("\uFFFD"),++J}return G.join("")}var Ge=Ue;let Ae=function(){let _t=new ArrayBuffer(2);return new DataView(_t).setInt16(0,256,!0),new Int16Array(_t)[0]===256}();class We{static parseScriptData(G,Y,J){let le={};try{let _e=We.parseValue(G,Y,J),Ie=We.parseValue(G,Y+_e.size,J-_e.size);le[_e.data]=Ie.data}catch(_e){y.e("AMF",_e.toString())}return le}static parseObject(G,Y,J){if(J<3)throw new x("Data not enough when parse ScriptDataObject");let le=We.parseString(G,Y,J),_e=We.parseValue(G,Y+le.size,J-le.size),Ie=_e.objectEnd;return{data:{name:le.data,value:_e.data},size:le.size+_e.size,objectEnd:Ie}}static parseVariable(G,Y,J){return We.parseObject(G,Y,J)}static parseString(G,Y,J){if(J<2)throw new x("Data not enough when parse String");let _e=new DataView(G,Y,J).getUint16(0,!Ae),Ie;return _e>0?Ie=Ge(new Uint8Array(G,Y+2,_e)):Ie="",{data:Ie,size:2+_e}}static parseLongString(G,Y,J){if(J<4)throw new x("Data not enough when parse LongString");let _e=new DataView(G,Y,J).getUint32(0,!Ae),Ie;return _e>0?Ie=Ge(new Uint8Array(G,Y+4,_e)):Ie="",{data:Ie,size:4+_e}}static parseDate(G,Y,J){if(J<10)throw new x("Data size invalid when parse Date");let le=new DataView(G,Y,J),_e=le.getFloat64(0,!Ae),Ie=le.getInt16(8,!Ae);return _e+=Ie*60*1e3,{data:new Date(_e),size:10}}static parseValue(G,Y,J){if(J<1)throw new x("Data not enough when parse Value");let le=new DataView(G,Y,J),_e=1,Ie=le.getUint8(0),Ce,Xe=!1;try{switch(Ie){case 0:Ce=le.getFloat64(1,!Ae),_e+=8;break;case 1:{Ce=!!le.getUint8(1),_e+=1;break}case 2:{let Je=We.parseString(G,Y+1,J-1);Ce=Je.data,_e+=Je.size;break}case 3:{Ce={};let Je=0;for((le.getUint32(J-4,!Ae)&16777215)===9&&(Je=3);_e<J-4;){let bt=We.parseObject(G,Y+_e,J-_e-Je);if(bt.objectEnd)break;Ce[bt.data.name]=bt.data.value,_e+=bt.size}_e<=J-3&&(le.getUint32(_e-1,!Ae)&16777215)===9&&(_e+=3);break}case 8:{Ce={},_e+=4;let Je=0;for((le.getUint32(J-4,!Ae)&16777215)===9&&(Je=3);_e<J-8;){let bt=We.parseVariable(G,Y+_e,J-_e-Je);if(bt.objectEnd)break;Ce[bt.data.name]=bt.data.value,_e+=bt.size}_e<=J-3&&(le.getUint32(_e-1,!Ae)&16777215)===9&&(_e+=3);break}case 9:Ce=void 0,_e=1,Xe=!0;break;case 10:{Ce=[];let Je=le.getUint32(1,!Ae);_e+=4;for(let bt=0;bt<Je;bt++){let Ht=We.parseValue(G,Y+_e,J-_e);Ce.push(Ht.data),_e+=Ht.size}break}case 11:{let Je=We.parseDate(G,Y+1,J-1);Ce=Je.data,_e+=Je.size;break}case 12:{let Je=We.parseString(G,Y+1,J-1);Ce=Je.data,_e+=Je.size;break}default:_e=J,y.w("AMF","Unsupported AMF value type "+Ie)}}catch(Je){y.e("AMF",Je.toString())}return{data:Ce,size:_e,objectEnd:Xe}}}var we=We;class Se{constructor(G){this.TAG="ExpGolomb",this._buffer=G,this._buffer_index=0,this._total_bytes=G.byteLength,this._total_bits=G.byteLength*8,this._current_word=0,this._current_word_bits_left=0}destroy(){this._buffer=null}_fillCurrentWord(){let G=this._total_bytes-this._buffer_index;if(G<=0)throw new x("ExpGolomb: _fillCurrentWord() but no bytes available");let Y=Math.min(4,G),J=new Uint8Array(4);J.set(this._buffer.subarray(this._buffer_index,this._buffer_index+Y)),this._current_word=new DataView(J.buffer).getUint32(0,!1),this._buffer_index+=Y,this._current_word_bits_left=Y*8}readBits(G){if(G>32)throw new c("ExpGolomb: readBits() bits exceeded max 32bits!");if(G<=this._current_word_bits_left){let Ie=this._current_word>>>32-G;return this._current_word<<=G,this._current_word_bits_left-=G,Ie}let Y=this._current_word_bits_left?this._current_word:0;Y=Y>>>32-this._current_word_bits_left;let J=G-this._current_word_bits_left;this._fillCurrentWord();let le=Math.min(J,this._current_word_bits_left),_e=this._current_word>>>32-le;return this._current_word<<=le,this._current_word_bits_left-=le,Y=Y<<le|_e,Y}readBool(){return this.readBits(1)===1}readByte(){return this.readBits(8)}_skipLeadingZero(){let G;for(G=0;G<this._current_word_bits_left;G++)if(this._current_word&2147483648>>>G)return this._current_word<<=G,this._current_word_bits_left-=G,G;return this._fillCurrentWord(),G+this._skipLeadingZero()}readUEG(){let G=this._skipLeadingZero();return this.readBits(G+1)-1}readSEG(){let G=this.readUEG();return G&1?G+1>>>1:-1*(G>>>1)}}var ge=Se;class Re{static _ebsp2rbsp(G){let Y=G,J=Y.byteLength,le=new Uint8Array(J),_e=0;for(let Ie=0;Ie<J;Ie++)Ie>=2&&Y[Ie]===3&&Y[Ie-1]===0&&Y[Ie-2]===0||(le[_e]=Y[Ie],_e++);return new Uint8Array(le.buffer,0,_e)}static parseSPS(G){let Y=Re._ebsp2rbsp(G),J=new ge(Y);J.readByte();let le=J.readByte();J.readByte();let _e=J.readByte();J.readUEG();let Ie=Re.getProfileString(le),Ce=Re.getLevelString(_e),Xe=1,Je=420,bt=[0,420,422,444],Ht=8;if((le===100||le===110||le===122||le===244||le===44||le===83||le===86||le===118||le===128||le===138||le===144)&&(Xe=J.readUEG(),Xe===3&&J.readBits(1),Xe<=3&&(Je=bt[Xe]),Ht=J.readUEG()+8,J.readUEG(),J.readBits(1),J.readBool())){let $t=Xe!==3?8:12;for(let _r=0;_r<$t;_r++)J.readBool()&&(_r<6?Re._skipScalingList(J,16):Re._skipScalingList(J,64))}J.readUEG();let Pe=J.readUEG();if(Pe===0)J.readUEG();else if(Pe===1){J.readBits(1),J.readSEG(),J.readSEG();let $t=J.readUEG();for(let _r=0;_r<$t;_r++)J.readSEG()}let be=J.readUEG();J.readBits(1);let ut=J.readUEG(),ze=J.readUEG(),He=J.readBits(1);He===0&&J.readBits(1),J.readBits(1);let Qe=0,ht=0,pt=0,kt=0;J.readBool()&&(Qe=J.readUEG(),ht=J.readUEG(),pt=J.readUEG(),kt=J.readUEG());let Ut=1,ot=1,It=0,ft=!0,Ne=0,je=0;if(J.readBool()){if(J.readBool()){let $t=J.readByte(),_r=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Ve=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];$t>0&&$t<16?(Ut=_r[$t-1],ot=Ve[$t-1]):$t===255&&(Ut=J.readByte()<<8|J.readByte(),ot=J.readByte()<<8|J.readByte())}if(J.readBool()&&J.readBool(),J.readBool()&&(J.readBits(4),J.readBool()&&J.readBits(24)),J.readBool()&&(J.readUEG(),J.readUEG()),J.readBool()){let $t=J.readBits(32),_r=J.readBits(32);ft=J.readBool(),Ne=_r,je=$t*2,It=Ne/je}}let Ke=1;(Ut!==1||ot!==1)&&(Ke=Ut/ot);let Et=0,wt=0;if(Xe===0)Et=1,wt=2-He;else{let $t=Xe===3?1:2,_r=Xe===1?2:1;Et=$t,wt=_r*(2-He)}let Pt=(ut+1)*16,zt=(2-He)*((ze+1)*16);Pt-=(Qe+ht)*Et,zt-=(pt+kt)*wt;let er=Math.ceil(Pt*Ke);return J.destroy(),J=null,{profile_string:Ie,level_string:Ce,bit_depth:Ht,ref_frames:be,chroma_format:Je,chroma_format_string:Re.getChromaFormatString(Je),frame_rate:{fixed:ft,fps:It,fps_den:je,fps_num:Ne},sar_ratio:{width:Ut,height:ot},codec_size:{width:Pt,height:zt},present_size:{width:er,height:zt}}}static _skipScalingList(G,Y){let J=8,le=8,_e=0;for(let Ie=0;Ie<Y;Ie++)le!==0&&(_e=G.readSEG(),le=(J+_e+256)%256),J=le===0?J:le}static getProfileString(G){switch(G){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}static getLevelString(G){return(G/10).toFixed(1)}static getChromaFormatString(G){switch(G){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}var ve=Re,Fe={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};function me(_t){return _t>>>8&255|(_t&255)<<8}function oe(_t){return(_t&4278190080)>>>24|(_t&16711680)>>>8|(_t&65280)<<8|(_t&255)<<24}function ie(_t,G){return _t[G]<<24|_t[G+1]<<16|_t[G+2]<<8|_t[G+3]}class fe{constructor(G,Y){this.TAG="FLVDemuxer",this._config=Y,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=G.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=G.hasAudioTrack,this._hasVideo=G.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new xe,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 J=new ArrayBuffer(2);return new DataView(J).setInt16(0,256,!0),new Int16Array(J)[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(G){let Y=new Uint8Array(G),J={match:!1};if(Y[0]!==70||Y[1]!==76||Y[2]!==86||Y[3]!==1)return J;let le=(Y[4]&4)>>>2!==0,_e=(Y[4]&1)!==0,Ie=ie(Y,5);return Ie<9?J:{match:!0,consumed:Ie,dataOffset:Ie,hasAudioTrack:le,hasVideoTrack:_e}}bindDataSource(G){return G.onDataArrival=this.parseChunks.bind(this),this}get onTrackMetadata(){return this._onTrackMetadata}set onTrackMetadata(G){this._onTrackMetadata=G}get onMediaInfo(){return this._onMediaInfo}set onMediaInfo(G){this._onMediaInfo=G}get onMetaDataArrived(){return this._onMetaDataArrived}set onMetaDataArrived(G){this._onMetaDataArrived=G}get onScriptDataArrived(){return this._onScriptDataArrived}set onScriptDataArrived(G){this._onScriptDataArrived=G}get onError(){return this._onError}set onError(G){this._onError=G}get onDataAvailable(){return this._onDataAvailable}set onDataAvailable(G){this._onDataAvailable=G}get timestampBase(){return this._timestampBase}set timestampBase(G){this._timestampBase=G}get overridedDuration(){return this._duration}set overridedDuration(G){this._durationOverrided=!0,this._duration=G,this._mediaInfo.duration=G}set overridedHasAudio(G){this._hasAudioFlagOverrided=!0,this._hasAudio=G,this._mediaInfo.hasAudio=G}set overridedHasVideo(G){this._hasVideoFlagOverrided=!0,this._hasVideo=G,this._mediaInfo.hasVideo=G}resetMediaInfo(){this._mediaInfo=new xe}_isInitialMetadataDispatched(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}parseChunks(G,Y){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new x("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");let J=0,le=this._littleEndian;if(Y===0)if(G.byteLength>13)J=fe.probe(G).dataOffset;else return 0;for(this._firstParse&&(this._firstParse=!1,Y+J!==this._dataOffset&&y.w(this.TAG,"First time parsing but chunk byteStart invalid!"),new DataView(G,J).getUint32(0,!le)!==0&&y.w(this.TAG,"PrevTagSize0 !== 0 !!!"),J+=4);J<G.byteLength;){this._dispatch=!0;let _e=new DataView(G,J);if(J+11+4>G.byteLength)break;let Ie=_e.getUint8(0),Ce=_e.getUint32(0,!le)&16777215;if(J+11+Ce+4>G.byteLength)break;if(Ie!==8&&Ie!==9&&Ie!==18){y.w(this.TAG,`Unsupported tag type ${Ie}, skipped`),J+=11+Ce+4;continue}let Xe=_e.getUint8(4),Je=_e.getUint8(5),bt=_e.getUint8(6),Ht=_e.getUint8(7),Pe=bt|Je<<8|Xe<<16|Ht<<24;(_e.getUint32(7,!le)&16777215)!==0&&y.w(this.TAG,"Meet tag which has StreamID != 0!");let ut=J+11;switch(Ie){case 8:this._parseAudioData(G,ut,Ce,Pe);break;case 9:this._parseVideoData(G,ut,Ce,Pe,Y+J);break;case 18:this._parseScriptData(G,ut,Ce);break}let ze=_e.getUint32(11+Ce,!le);ze!==11+Ce&&y.w(this.TAG,`Invalid PrevTagSize ${ze}`),J+=11+Ce+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),J}_parseScriptData(G,Y,J){let le=we.parseScriptData(G,Y,J);if(le.hasOwnProperty("onMetaData")){if(le.onMetaData==null||typeof le.onMetaData!="object"){y.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&y.w(this.TAG,"Found another onMetaData tag!"),this._metadata=le;let _e=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},_e)),typeof _e.hasAudio=="boolean"&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=_e.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),typeof _e.hasVideo=="boolean"&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=_e.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),typeof _e.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=_e.audiodatarate),typeof _e.videodatarate=="number"&&(this._mediaInfo.videoDataRate=_e.videodatarate),typeof _e.width=="number"&&(this._mediaInfo.width=_e.width),typeof _e.height=="number"&&(this._mediaInfo.height=_e.height),typeof _e.duration=="number"){if(!this._durationOverrided){let Ie=Math.floor(_e.duration*this._timescale);this._duration=Ie,this._mediaInfo.duration=Ie}}else this._mediaInfo.duration=0;if(typeof _e.framerate=="number"){let Ie=Math.floor(_e.framerate*1e3);if(Ie>0){let Ce=Ie/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=Ce,this._referenceFrameRate.fps_num=Ie,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=Ce}}if(typeof _e.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;let Ie=_e.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(Ie),_e.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=_e,y.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(le).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},le))}_parseKeyframesIndex(G){let Y=[],J=[];for(let le=1;le<G.times.length;le++){let _e=this._timestampBase+Math.floor(G.times[le]*1e3);Y.push(_e),J.push(G.filepositions[le])}return{times:Y,filepositions:J}}_parseAudioData(G,Y,J,le){if(J<=1){y.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;let _e=this._littleEndian,Ce=new DataView(G,Y,J).getUint8(0),Xe=Ce>>>4;if(Xe!==2&&Xe!==10){this._onError(Fe.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+Xe);return}let Je=0,bt=(Ce&12)>>>2;if(bt>=0&&bt<=4)Je=this._flvSoundRateTable[bt];else{this._onError(Fe.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+bt);return}let Ht=(Ce&2)>>>1,Pe=Ce&1,be=this._audioMetadata,ut=this._audioTrack;if(be||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),be=this._audioMetadata={},be.type="audio",be.id=ut.id,be.timescale=this._timescale,be.duration=this._duration,be.audioSampleRate=Je,be.channelCount=Pe===0?1:2),Xe===10){let ze=this._parseAACAudioData(G,Y+1,J-1);if(ze==null)return;if(ze.packetType===0){be.config&&y.w(this.TAG,"Found another AudioSpecificConfig!");let He=ze.data;be.audioSampleRate=He.samplingRate,be.channelCount=He.channelCount,be.codec=He.codec,be.originalCodec=He.originalCodec,be.config=He.config,be.refSampleDuration=1024/be.audioSampleRate*be.timescale,y.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",be);let Qe=this._mediaInfo;Qe.audioCodec=be.originalCodec,Qe.audioSampleRate=be.audioSampleRate,Qe.audioChannelCount=be.channelCount,Qe.hasVideo?Qe.videoCodec!=null&&(Qe.mimeType='video/x-flv; codecs="'+Qe.videoCodec+","+Qe.audioCodec+'"'):Qe.mimeType='video/x-flv; codecs="'+Qe.audioCodec+'"',Qe.isComplete()&&this._onMediaInfo(Qe)}else if(ze.packetType===1){let He=this._timestampBase+le,Qe={unit:ze.data,length:ze.data.byteLength,dts:He,pts:He};ut.samples.push(Qe),ut.length+=ze.data.length}else y.e(this.TAG,`Flv: Unsupported AAC data type ${ze.packetType}`)}else if(Xe===2){if(!be.codec){let ht=this._parseMP3AudioData(G,Y+1,J-1,!0);if(ht==null)return;be.audioSampleRate=ht.samplingRate,be.channelCount=ht.channelCount,be.codec=ht.codec,be.originalCodec=ht.originalCodec,be.refSampleDuration=1152/be.audioSampleRate*be.timescale,y.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",be);let pt=this._mediaInfo;pt.audioCodec=be.codec,pt.audioSampleRate=be.audioSampleRate,pt.audioChannelCount=be.channelCount,pt.audioDataRate=ht.bitRate,pt.hasVideo?pt.videoCodec!=null&&(pt.mimeType='video/x-flv; codecs="'+pt.videoCodec+","+pt.audioCodec+'"'):pt.mimeType='video/x-flv; codecs="'+pt.audioCodec+'"',pt.isComplete()&&this._onMediaInfo(pt)}let ze=this._parseMP3AudioData(G,Y+1,J-1,!1);if(ze==null)return;let He=this._timestampBase+le,Qe={unit:ze,length:ze.byteLength,dts:He,pts:He};ut.samples.push(Qe),ut.length+=ze.length}}_parseAACAudioData(G,Y,J){if(J<=1){y.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}let le={},_e=new Uint8Array(G,Y,J);return le.packetType=_e[0],_e[0]===0?le.data=this._parseAACAudioSpecificConfig(G,Y+1,J-1):le.data=_e.subarray(1),le}_parseAACAudioSpecificConfig(G,Y,J){let le=new Uint8Array(G,Y,J),_e=null,Ie=0,Ce=0,Xe=null,Je=0,bt=null;if(Ie=Ce=le[0]>>>3,Je=(le[0]&7)<<1|le[1]>>>7,Je<0||Je>=this._mpegSamplingRates.length){this._onError(Fe.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}let Ht=this._mpegSamplingRates[Je],Pe=(le[1]&120)>>>3;if(Pe<0||Pe>=8){this._onError(Fe.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Ie===5&&(bt=(le[1]&7)<<1|le[2]>>>7,Xe=(le[2]&124)>>>2);let be=self.navigator.userAgent.toLowerCase();return be.indexOf("firefox")!==-1?Je>=6?(Ie=5,_e=new Array(4),bt=Je-3):(Ie=2,_e=new Array(2),bt=Je):be.indexOf("android")!==-1?(Ie=2,_e=new Array(2),bt=Je):(Ie=5,bt=Je,_e=new Array(4),Je>=6?bt=Je-3:Pe===1&&(Ie=2,_e=new Array(2),bt=Je)),_e[0]=Ie<<3,_e[0]|=(Je&15)>>>1,_e[1]=(Je&15)<<7,_e[1]|=(Pe&15)<<3,Ie===5&&(_e[1]|=(bt&15)>>>1,_e[2]=(bt&1)<<7,_e[2]|=8,_e[3]=0),{config:_e,samplingRate:Ht,channelCount:Pe,codec:"mp4a.40."+Ie,originalCodec:"mp4a.40."+Ce}}_parseMP3AudioData(G,Y,J,le){if(J<4){y.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}let _e=this._littleEndian,Ie=new Uint8Array(G,Y,J),Ce=null;if(le){if(Ie[0]!==255)return;let Xe=Ie[1]>>>3&3,Je=(Ie[1]&6)>>1,bt=(Ie[2]&240)>>>4,Ht=(Ie[2]&12)>>>2,be=(Ie[3]>>>6&3)!==3?2:1,ut=0,ze=0,He=34,Qe="mp3";switch(Xe){case 0:ut=this._mpegAudioV25SampleRateTable[Ht];break;case 2:ut=this._mpegAudioV20SampleRateTable[Ht];break;case 3:ut=this._mpegAudioV10SampleRateTable[Ht];break}switch(Je){case 1:He=34,bt<this._mpegAudioL3BitRateTable.length&&(ze=this._mpegAudioL3BitRateTable[bt]);break;case 2:He=33,bt<this._mpegAudioL2BitRateTable.length&&(ze=this._mpegAudioL2BitRateTable[bt]);break;case 3:He=32,bt<this._mpegAudioL1BitRateTable.length&&(ze=this._mpegAudioL1BitRateTable[bt]);break}Ce={bitRate:ze,samplingRate:ut,channelCount:be,codec:Qe,originalCodec:Qe}}else Ce=Ie;return Ce}_parseVideoData(G,Y,J,le,_e){if(J<=1){y.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;let Ie=new Uint8Array(G,Y,J)[0],Ce=(Ie&240)>>>4,Xe=Ie&15;if(Xe!==7){this._onError(Fe.CODEC_UNSUPPORTED,`Flv: Unsupported codec in video frame: ${Xe}`);return}this._parseAVCVideoPacket(G,Y+1,J-1,le,_e,Ce)}_parseAVCVideoPacket(G,Y,J,le,_e,Ie){if(J<4){y.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}let Ce=this._littleEndian,Xe=new DataView(G,Y,J),Je=Xe.getUint8(0),Ht=(Xe.getUint32(0,!Ce)&16777215)<<8>>8;if(Je===0)this._parseAVCDecoderConfigurationRecord(G,Y+4,J-4);else if(Je===1)this._parseAVCVideoData(G,Y+4,J-4,le,_e,Ie,Ht);else if(Je!==2){this._onError(Fe.FORMAT_ERROR,`Flv: Invalid video packet type ${Je}`);return}}_parseAVCDecoderConfigurationRecord(G,Y,J){if(J<7){y.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}let le=this._videoMetadata,_e=this._videoTrack,Ie=this._littleEndian,Ce=new DataView(G,Y,J);le?typeof le.avcc!="undefined"&&y.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),le=this._videoMetadata={},le.type="video",le.id=_e.id,le.timescale=this._timescale,le.duration=this._duration);let Xe=Ce.getUint8(0),Je=Ce.getUint8(1),bt=Ce.getUint8(2),Ht=Ce.getUint8(3);if(Xe!==1||Je===0){this._onError(Fe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(Ce.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(Fe.FORMAT_ERROR,`Flv: Strange NaluLengthSizeMinusOne: ${this._naluLengthSize-1}`);return}let Pe=Ce.getUint8(5)&31;if(Pe===0){this._onError(Fe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else Pe>1&&y.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ${Pe}`);let be=6;for(let ze=0;ze<Pe;ze++){let He=Ce.getUint16(be,!Ie);if(be+=2,He===0)continue;let Qe=new Uint8Array(G,Y+be,He);be+=He;let ht=ve.parseSPS(Qe);if(ze!==0)continue;le.codecWidth=ht.codec_size.width,le.codecHeight=ht.codec_size.height,le.presentWidth=ht.present_size.width,le.presentHeight=ht.present_size.height,le.profile=ht.profile_string,le.level=ht.level_string,le.bitDepth=ht.bit_depth,le.chromaFormat=ht.chroma_format,le.sarRatio=ht.sar_ratio,le.frameRate=ht.frame_rate,(ht.frame_rate.fixed===!1||ht.frame_rate.fps_num===0||ht.frame_rate.fps_den===0)&&(le.frameRate=this._referenceFrameRate);let pt=le.frameRate.fps_den,kt=le.frameRate.fps_num;le.refSampleDuration=le.timescale*(pt/kt);let Tt=Qe.subarray(1,4),Ut="avc1.";for(let It=0;It<3;It++){let ft=Tt[It].toString(16);ft.length<2&&(ft="0"+ft),Ut+=ft}le.codec=Ut;let ot=this._mediaInfo;ot.width=le.codecWidth,ot.height=le.codecHeight,ot.fps=le.frameRate.fps,ot.profile=le.profile,ot.level=le.level,ot.refFrames=ht.ref_frames,ot.chromaFormat=ht.chroma_format_string,ot.sarNum=le.sarRatio.width,ot.sarDen=le.sarRatio.height,ot.videoCodec=Ut,ot.hasAudio?ot.audioCodec!=null&&(ot.mimeType='video/x-flv; codecs="'+ot.videoCodec+","+ot.audioCodec+'"'):ot.mimeType='video/x-flv; codecs="'+ot.videoCodec+'"',ot.isComplete()&&this._onMediaInfo(ot)}let ut=Ce.getUint8(be);if(ut===0){this._onError(Fe.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else ut>1&&y.w(this.TAG,`Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ${ut}`);be++;for(let ze=0;ze<ut;ze++){let He=Ce.getUint16(be,!Ie);be+=2,He!==0&&(be+=He)}le.avcc=new Uint8Array(J),le.avcc.set(new Uint8Array(G,Y,J),0),y.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",le)}_parseAVCVideoData(G,Y,J,le,_e,Ie,Ce){let Xe=this._littleEndian,Je=new DataView(G,Y,J),bt=[],Ht=0,Pe=0;const be=this._naluLengthSize;let ut=this._timestampBase+le,ze=Ie===1;for(;Pe<J;){if(Pe+4>=J){y.w(this.TAG,`Malformed Nalu near timestamp ${ut}, offset = ${Pe}, dataSize = ${J}`);break}let He=Je.getUint32(Pe,!Xe);if(be===3&&(He>>>=8),He>J-be){y.w(this.TAG,`Malformed Nalus near timestamp ${ut}, NaluSize > DataSize!`);return}let Qe=Je.getUint8(Pe+be)&31;Qe===5&&(ze=!0);let ht=new Uint8Array(G,Y+Pe,be+He),pt={type:Qe,data:ht};bt.push(pt),Ht+=ht.byteLength,Pe+=be+He}if(bt.length){let He=this._videoTrack,Qe={units:bt,length:Ht,isKeyframe:ze,dts:ut,cts:Ce,pts:ut+Ce};ze&&(Qe.fileposition=_e),He.samples.push(Qe),He.length+=Ht}}}var ye=fe;class he{static init(){he.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 Y in he.types)he.types.hasOwnProperty(Y)&&(he.types[Y]=[Y.charCodeAt(0),Y.charCodeAt(1),Y.charCodeAt(2),Y.charCodeAt(3)]);let G=he.constants={};G.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),G.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),G.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),G.STSC=G.STCO=G.STTS,G.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),G.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]),G.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]),G.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),G.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),G.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}static box(G){let Y=8,J=null,le=Array.prototype.slice.call(arguments,1),_e=le.length;for(let Ce=0;Ce<_e;Ce++)Y+=le[Ce].byteLength;J=new Uint8Array(Y),J[0]=Y>>>24&255,J[1]=Y>>>16&255,J[2]=Y>>>8&255,J[3]=Y&255,J.set(G,4);let Ie=8;for(let Ce=0;Ce<_e;Ce++)J.set(le[Ce],Ie),Ie+=le[Ce].byteLength;return J}static generateInitSegment(G){let Y=he.box(he.types.ftyp,he.constants.FTYP),J=he.moov(G),le=new Uint8Array(Y.byteLength+J.byteLength);return le.set(Y,0),le.set(J,Y.byteLength),le}static moov(G){let Y=he.mvhd(G.timescale,G.duration),J=he.trak(G),le=he.mvex(G);return he.box(he.types.moov,Y,J,le)}static mvhd(G,Y){return he.box(he.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,G>>>24&255,G>>>16&255,G>>>8&255,G&255,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y&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(G){return he.box(he.types.trak,he.tkhd(G),he.mdia(G))}static tkhd(G){let Y=G.id,J=G.duration,le=G.presentWidth,_e=G.presentHeight;return he.box(he.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y&255,0,0,0,0,J>>>24&255,J>>>16&255,J>>>8&255,J&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,le>>>8&255,le&255,0,0,_e>>>8&255,_e&255,0,0]))}static mdia(G){return he.box(he.types.mdia,he.mdhd(G),he.hdlr(G),he.minf(G))}static mdhd(G){let Y=G.timescale,J=G.duration;return he.box(he.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y&255,J>>>24&255,J>>>16&255,J>>>8&255,J&255,85,196,0,0]))}static hdlr(G){let Y=null;return G.type==="audio"?Y=he.constants.HDLR_AUDIO:Y=he.constants.HDLR_VIDEO,he.box(he.types.hdlr,Y)}static minf(G){let Y=null;return G.type==="audio"?Y=he.box(he.types.smhd,he.constants.SMHD):Y=he.box(he.types.vmhd,he.constants.VMHD),he.box(he.types.minf,Y,he.dinf(),he.stbl(G))}static dinf(){return he.box(he.types.dinf,he.box(he.types.dref,he.constants.DREF))}static stbl(G){return he.box(he.types.stbl,he.stsd(G),he.box(he.types.stts,he.constants.STTS),he.box(he.types.stsc,he.constants.STSC),he.box(he.types.stsz,he.constants.STSZ),he.box(he.types.stco,he.constants.STCO))}static stsd(G){return G.type==="audio"?G.codec==="mp3"?he.box(he.types.stsd,he.constants.STSD_PREFIX,he.mp3(G)):he.box(he.types.stsd,he.constants.STSD_PREFIX,he.mp4a(G)):he.box(he.types.stsd,he.constants.STSD_PREFIX,he.avc1(G))}static mp3(G){let Y=G.channelCount,J=G.audioSampleRate,le=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,Y,0,16,0,0,0,0,J>>>8&255,J&255,0,0]);return he.box(he.types[".mp3"],le)}static mp4a(G){let Y=G.channelCount,J=G.audioSampleRate,le=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,Y,0,16,0,0,0,0,J>>>8&255,J&255,0,0]);return he.box(he.types.mp4a,le,he.esds(G))}static esds(G){let Y=G.config||[],J=Y.length,le=new Uint8Array([0,0,0,0,3,23+J,0,1,0,4,15+J,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([J]).concat(Y).concat([6,1,2]));return he.box(he.types.esds,le)}static avc1(G){let Y=G.avcc,J=G.codecWidth,le=G.codecHeight,_e=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,J>>>8&255,J&255,le>>>8&255,le&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 he.box(he.types.avc1,_e,he.box(he.types.avcC,Y))}static mvex(G){return he.box(he.types.mvex,he.trex(G))}static trex(G){let Y=G.id,J=new Uint8Array([0,0,0,0,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return he.box(he.types.trex,J)}static moof(G,Y){return he.box(he.types.moof,he.mfhd(G.sequenceNumber),he.traf(G,Y))}static mfhd(G){let Y=new Uint8Array([0,0,0,0,G>>>24&255,G>>>16&255,G>>>8&255,G&255]);return he.box(he.types.mfhd,Y)}static traf(G,Y){let J=G.id,le=he.box(he.types.tfhd,new Uint8Array([0,0,0,0,J>>>24&255,J>>>16&255,J>>>8&255,J&255])),_e=he.box(he.types.tfdt,new Uint8Array([0,0,0,0,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y&255])),Ie=he.sdtp(G),Ce=he.trun(G,Ie.byteLength+16+16+8+16+8+8);return he.box(he.types.traf,le,_e,Ce,Ie)}static sdtp(G){let Y=G.samples||[],J=Y.length,le=new Uint8Array(4+J);for(let _e=0;_e<J;_e++){let Ie=Y[_e].flags;le[_e+4]=Ie.isLeading<<6|Ie.dependsOn<<4|Ie.isDependedOn<<2|Ie.hasRedundancy}return he.box(he.types.sdtp,le)}static trun(G,Y){let J=G.samples||[],le=J.length,_e=12+16*le,Ie=new Uint8Array(_e);Y+=8+_e,Ie.set([0,0,15,1,le>>>24&255,le>>>16&255,le>>>8&255,le&255,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y&255],0);for(let Ce=0;Ce<le;Ce++){let Xe=J[Ce].duration,Je=J[Ce].size,bt=J[Ce].flags,Ht=J[Ce].cts;Ie.set([Xe>>>24&255,Xe>>>16&255,Xe>>>8&255,Xe&255,Je>>>24&255,Je>>>16&255,Je>>>8&255,Je&255,bt.isLeading<<2|bt.dependsOn,bt.isDependedOn<<6|bt.hasRedundancy<<4|bt.isNonSync,0,0,Ht>>>24&255,Ht>>>16&255,Ht>>>8&255,Ht&255],12+16*Ce)}return he.box(he.types.trun,Ie)}static mdat(G){return he.box(he.types.mdat,G)}}he.init();var Te=he;class Oe{static getSilentFrame(G,Y){if(G==="mp4a.40.2"){if(Y===1)return new Uint8Array([0,200,0,128,35,128]);if(Y===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(Y===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(Y===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(Y===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(Y===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(Y===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(Y===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(Y===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 Be=Oe;class Ze{constructor(G,Y,J,le,_e){this.dts=G,this.pts=Y,this.duration=J,this.originalDts=le,this.isSyncPoint=_e,this.fileposition=null}}class tt{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(G){G.isSyncPoint=!0,this.syncPoints.push(G)}}class dt{constructor(){this._list=[]}clear(){this._list=[]}appendArray(G){let Y=this._list;G.length!==0&&(Y.length>0&&G[0].originalDts<Y[Y.length-1].originalDts&&this.clear(),Array.prototype.push.apply(Y,G))}getLastSyncPointBeforeDts(G){if(this._list.length==0)return null;let Y=this._list,J=0,le=Y.length-1,_e=0,Ie=0,Ce=le;for(G<Y[0].dts&&(J=0,Ie=Ce+1);Ie<=Ce;)if(_e=Ie+Math.floor((Ce-Ie)/2),_e===le||G>=Y[_e].dts&&G<Y[_e+1].dts){J=_e;break}else Y[_e].dts<G?Ie=_e+1:Ce=_e-1;return this._list[J]}}class nt{constructor(G){this._type=G,this._list=[],this._lastAppendLocation=-1}get type(){return this._type}get length(){return this._list.length}isEmpty(){return this._list.length===0}clear(){this._list=[],this._lastAppendLocation=-1}_searchNearestSegmentBefore(G){let Y=this._list;if(Y.length===0)return-2;let J=Y.length-1,le=0,_e=0,Ie=J,Ce=0;if(G<Y[0].originalBeginDts)return Ce=-1,Ce;for(;_e<=Ie;)if(le=_e+Math.floor((Ie-_e)/2),le===J||G>Y[le].lastSample.originalDts&&G<Y[le+1].originalBeginDts){Ce=le;break}else Y[le].originalBeginDts<G?_e=le+1:Ie=le-1;return Ce}_searchNearestSegmentAfter(G){return this._searchNearestSegmentBefore(G)+1}append(G){let Y=this._list,J=G,le=this._lastAppendLocation,_e=0;le!==-1&&le<Y.length&&J.originalBeginDts>=Y[le].lastSample.originalDts&&(le===Y.length-1||le<Y.length-1&&J.originalBeginDts<Y[le+1].originalBeginDts)?_e=le+1:Y.length>0&&(_e=this._searchNearestSegmentBefore(J.originalBeginDts)+1),this._lastAppendLocation=_e,this._list.splice(_e,0,J)}getLastSegmentBefore(G){let Y=this._searchNearestSegmentBefore(G);return Y>=0?this._list[Y]:null}getLastSampleBefore(G){let Y=this.getLastSegmentBefore(G);return Y!=null?Y.lastSample:null}getLastSyncPointBefore(G){let Y=this._searchNearestSegmentBefore(G),J=this._list[Y].syncPoints;for(;J.length===0&&Y>0;)Y--,J=this._list[Y].syncPoints;return J.length>0?J[J.length-1]:null}}class At{constructor(G){this.TAG="MP4Remuxer",this._config=G,this._isLive=G.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 nt("audio"),this._videoSegmentInfoList=new nt("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(_.chrome&&(_.version.major<50||_.version.major===50&&_.version.build<2661)),this._fillSilentAfterSeek=_.msedge||_.msie,this._mp3UseMpegAudio=!_.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(G){return G.onDataAvailable=this.remux.bind(this),G.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}get onInitSegment(){return this._onInitSegment}set onInitSegment(G){this._onInitSegment=G}get onMediaSegment(){return this._onMediaSegment}set onMediaSegment(G){this._onMediaSegment=G}insertDiscontinuity(){this._audioNextDts=this._videoNextDts=void 0}seek(G){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}remux(G,Y){if(!this._onMediaSegment)throw new x("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(G,Y),this._remuxVideo(Y),this._remuxAudio(G)}_onTrackMetadataReceived(G,Y){let J=null,le="mp4",_e=Y.codec;if(G==="audio")this._audioMeta=Y,Y.codec==="mp3"&&this._mp3UseMpegAudio?(le="mpeg",_e="",J=new Uint8Array):J=Te.generateInitSegment(Y);else if(G==="video")this._videoMeta=Y,J=Te.generateInitSegment(Y);else return;if(!this._onInitSegment)throw new x("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(G,{type:G,data:J.buffer,codec:_e,container:`${G}/${le}`,mediaDuration:Y.duration})}_calculateDtsBase(G,Y){this._dtsBaseInited||(G.samples&&G.samples.length&&(this._audioDtsBase=G.samples[0].dts),Y.samples&&Y.samples.length&&(this._videoDtsBase=Y.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}flushStashedSamples(){let G=this._videoStashedLastSample,Y=this._audioStashedLastSample,J={type:"video",id:1,sequenceNumber:0,samples:[],length:0};G!=null&&(J.samples.push(G),J.length=G.length);let le={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};Y!=null&&(le.samples.push(Y),le.length=Y.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(J,!0),this._remuxAudio(le,!0)}_remuxAudio(G,Y){if(this._audioMeta==null)return;let J=G,le=J.samples,_e,Ie=-1,Ce=-1,Xe=-1,Je=this._audioMeta.refSampleDuration,bt=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,Ht=this._dtsBaseInited&&this._audioNextDts===void 0,Pe=!1;if(!le||le.length===0||le.length===1&&!Y)return;let be=0,ut=null,ze=0;bt?(be=0,ze=J.length):(be=8,ze=8+J.length);let He=null;if(le.length>1&&(He=le.pop(),ze-=He.length),this._audioStashedLastSample!=null){let ot=this._audioStashedLastSample;this._audioStashedLastSample=null,le.unshift(ot),ze+=ot.length}He!=null&&(this._audioStashedLastSample=He);let Qe=le[0].dts-this._dtsBase;if(this._audioNextDts)_e=Qe-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())_e=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&this._audioMeta.originalCodec!=="mp3"&&(Pe=!0);else{let ot=this._audioSegmentInfoList.getLastSampleBefore(Qe);if(ot!=null){let It=Qe-(ot.originalDts+ot.duration);It<=3&&(It=0);let ft=ot.dts+ot.duration+It;_e=Qe-ft}else _e=0}if(Pe){let ot=Qe-_e,It=this._videoSegmentInfoList.getLastSegmentBefore(Qe);if(It!=null&&It.beginDts<ot){let ft=Be.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(ft){let Ne=It.beginDts,je=ot-It.beginDts;y.v(this.TAG,`InsertPrefixSilentAudio: dts: ${Ne}, duration: ${je}`),le.unshift({unit:ft,dts:Ne,pts:Ne}),ze+=ft.byteLength}}else Pe=!1}let ht=[];for(let ot=0;ot<le.length;ot++){let It=le[ot],ft=It.unit,Ne=It.dts-this._dtsBase,je=Ne-_e;Ie===-1&&(Ie=je);let et=0;ot!==le.length-1?et=le[ot+1].dts-this._dtsBase-_e-je:He!=null?et=He.dts-this._dtsBase-_e-je:ht.length>=1?et=ht[ht.length-1].duration:et=Math.floor(Je);let Ke=!1,Et=null;if(et>Je*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!_.safari){Ke=!0;let wt=Math.abs(et-Je),Pt=Math.ceil(wt/Je),zt=je+Je;y.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
|
|
dts: ${je+et} ms, expected: ${je+Math.round(Je)} ms, delta: ${Math.round(wt)} ms, generate: ${Pt} frames`);let er=Be.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);er==null&&(y.w(this.TAG,`Unable to generate silent frame for ${this._audioMeta.originalCodec} with ${this._audioMeta.channelCount} channels, repeat last frame`),er=ft),Et=[];for(let _r=0;_r<Pt;_r++){let Ve=Math.round(zt);if(Et.length>0){let ar=Et[Et.length-1];ar.duration=Ve-ar.dts}let Xt={dts:Ve,pts:Ve,cts:0,unit:er,size:er.byteLength,duration:0,originalDts:Ne,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};Et.push(Xt),ze+=Xt.size,zt+=Je}let $t=Et[Et.length-1];$t.duration=je+et-$t.dts,et=Math.round(Je)}ht.push({dts:je,pts:je,cts:0,unit:It.unit,size:It.unit.byteLength,duration:et,originalDts:Ne,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),Ke&&ht.push.apply(ht,Et)}bt?ut=new Uint8Array(ze):(ut=new Uint8Array(ze),ut[0]=ze>>>24&255,ut[1]=ze>>>16&255,ut[2]=ze>>>8&255,ut[3]=ze&255,ut.set(Te.types.mdat,4));for(let ot=0;ot<ht.length;ot++){let It=ht[ot].unit;ut.set(It,be),be+=It.byteLength}let pt=ht[ht.length-1];Ce=pt.dts+pt.duration,this._audioNextDts=Ce;let kt=new tt;kt.beginDts=Ie,kt.endDts=Ce,kt.beginPts=Ie,kt.endPts=Ce,kt.originalBeginDts=ht[0].originalDts,kt.originalEndDts=pt.originalDts+pt.duration,kt.firstSample=new Ze(ht[0].dts,ht[0].pts,ht[0].duration,ht[0].originalDts,!1),kt.lastSample=new Ze(pt.dts,pt.pts,pt.duration,pt.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(kt),J.samples=ht,J.sequenceNumber++;let Tt=null;bt?Tt=new Uint8Array:Tt=Te.moof(J,Ie),J.samples=[],J.length=0;let Ut={type:"audio",data:this._mergeBoxes(Tt,ut).buffer,sampleCount:ht.length,info:kt};bt&&Ht&&(Ut.timestampOffset=Ie),this._onMediaSegment("audio",Ut)}_remuxVideo(G,Y){if(this._videoMeta==null)return;let J=G,le=J.samples,_e,Ie=-1,Ce=-1,Xe=-1,Je=-1;if(!le||le.length===0||le.length===1&&!Y)return;let bt=8,Ht=null,Pe=8+G.length,be=null;if(le.length>1&&(be=le.pop(),Pe-=be.length),this._videoStashedLastSample!=null){let pt=this._videoStashedLastSample;this._videoStashedLastSample=null,le.unshift(pt),Pe+=pt.length}be!=null&&(this._videoStashedLastSample=be);let ut=le[0].dts-this._dtsBase;if(this._videoNextDts)_e=ut-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())_e=0;else{let pt=this._videoSegmentInfoList.getLastSampleBefore(ut);if(pt!=null){let kt=ut-(pt.originalDts+pt.duration);kt<=3&&(kt=0);let Tt=pt.dts+pt.duration+kt;_e=ut-Tt}else _e=0}let ze=new tt,He=[];for(let pt=0;pt<le.length;pt++){let kt=le[pt],Tt=kt.dts-this._dtsBase,Ut=kt.isKeyframe,ot=Tt-_e,It=kt.cts,ft=ot+It;Ie===-1&&(Ie=ot,Xe=ft);let Ne=0;if(pt!==le.length-1?Ne=le[pt+1].dts-this._dtsBase-_e-ot:be!=null?Ne=be.dts-this._dtsBase-_e-ot:He.length>=1?Ne=He[He.length-1].duration:Ne=Math.floor(this._videoMeta.refSampleDuration),Ut){let je=new Ze(ot,ft,Ne,kt.dts,!0);je.fileposition=kt.fileposition,ze.appendSyncPoint(je)}He.push({dts:ot,pts:ft,cts:It,units:kt.units,size:kt.length,isKeyframe:Ut,duration:Ne,originalDts:Tt,flags:{isLeading:0,dependsOn:Ut?2:1,isDependedOn:Ut?1:0,hasRedundancy:0,isNonSync:Ut?0:1}})}Ht=new Uint8Array(Pe),Ht[0]=Pe>>>24&255,Ht[1]=Pe>>>16&255,Ht[2]=Pe>>>8&255,Ht[3]=Pe&255,Ht.set(Te.types.mdat,4);for(let pt=0;pt<He.length;pt++){let kt=He[pt].units;for(;kt.length;){let Ut=kt.shift().data;Ht.set(Ut,bt),bt+=Ut.byteLength}}let Qe=He[He.length-1];if(Ce=Qe.dts+Qe.duration,Je=Qe.pts+Qe.duration,this._videoNextDts=Ce,ze.beginDts=Ie,ze.endDts=Ce,ze.beginPts=Xe,ze.endPts=Je,ze.originalBeginDts=He[0].originalDts,ze.originalEndDts=Qe.originalDts+Qe.duration,ze.firstSample=new Ze(He[0].dts,He[0].pts,He[0].duration,He[0].originalDts,He[0].isKeyframe),ze.lastSample=new Ze(Qe.dts,Qe.pts,Qe.duration,Qe.originalDts,Qe.isKeyframe),this._isLive||this._videoSegmentInfoList.append(ze),J.samples=He,J.sequenceNumber++,this._forceFirstIDR){let pt=He[0].flags;pt.dependsOn=2,pt.isNonSync=0}let ht=Te.moof(J,Ie);J.samples=[],J.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(ht,Ht).buffer,sampleCount:He.length,info:ze})}_mergeBoxes(G,Y){let J=new Uint8Array(G.byteLength+Y.byteLength);return J.set(G,0),J.set(Y,G.byteLength),J}}var Nt=At,st={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 Ot{constructor(G,Y){this.TAG="TransmuxingController",this._emitter=new(D()),this._config=Y,G.segments||(G.segments=[{duration:G.duration,filesize:G.filesize,url:G.url}]),typeof G.cors!="boolean"&&(G.cors=!0),typeof G.withCredentials!="boolean"&&(G.withCredentials=!1),this._mediaDataSource=G,this._currentSegmentIndex=0;let J=0;this._mediaDataSource.segments.forEach(le=>{le.timestampBase=J,J+=le.duration,le.cors=G.cors,le.withCredentials=G.withCredentials,Y.referrerPolicy&&(le.referrerPolicy=Y.referrerPolicy)}),!isNaN(J)&&this._mediaDataSource.duration!==J&&(this._mediaDataSource.duration=J),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(G,Y){this._emitter.addListener(G,Y)}off(G,Y){this._emitter.removeListener(G,Y)}start(){this._loadSegment(0),this._enableStatisticsReporter()}_loadSegment(G,Y){this._currentSegmentIndex=G;let J=this._mediaDataSource.segments[G],le=this._ioctl=new B(J,this._config,G);le.onError=this._onIOException.bind(this),le.onSeeked=this._onIOSeeked.bind(this),le.onComplete=this._onIOComplete.bind(this),le.onRedirect=this._onIORedirect.bind(this),le.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),Y?this._demuxer.bindDataSource(this._ioctl):le.onDataArrival=this._onInitChunkArrival.bind(this),le.open(Y)}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(G){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;let Y=this._searchSegmentIndexContains(G);if(Y===this._currentSegmentIndex){let J=this._mediaInfo.segments[Y];if(J==null)this._pendingSeekTime=G;else{let le=J.getNearestKeyframe(G);this._remuxer.seek(le.milliseconds),this._ioctl.seek(le.fileposition),this._pendingResolveSeekPoint=le.milliseconds}}else{let J=this._mediaInfo.segments[Y];if(J==null)this._pendingSeekTime=G,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(Y);else{let le=J.getNearestKeyframe(G);this._internalAbort(),this._remuxer.seek(G),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[Y].timestampBase,this._loadSegment(Y,le.fileposition),this._pendingResolveSeekPoint=le.milliseconds,this._reportSegmentMediaInfo(Y)}}this._enableStatisticsReporter()}_searchSegmentIndexContains(G){let Y=this._mediaDataSource.segments,J=Y.length-1;for(let le=0;le<Y.length;le++)if(G<Y[le].timestampBase){J=le-1;break}return J}_onInitChunkArrival(G,Y){let J=null,le=0;if(Y>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,le=this._demuxer.parseChunks(G,Y);else if((J=ye.probe(G)).match){this._demuxer=new ye(J,this._config),this._remuxer||(this._remuxer=new Nt(this._config));let _e=this._mediaDataSource;_e.duration!=null&&!isNaN(_e.duration)&&(this._demuxer.overridedDuration=_e.duration),typeof _e.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=_e.hasAudio),typeof _e.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=_e.hasVideo),this._demuxer.timestampBase=_e.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),le=this._demuxer.parseChunks(G,Y)}else J=null,y.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(()=>{this._internalAbort()}),this._emitter.emit(st.DEMUX_ERROR,Fe.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),le=0;return le}_onMediaInfo(G){this._mediaInfo==null&&(this._mediaInfo=Object.assign({},G),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,xe.prototype));let Y=Object.assign({},G);Object.setPrototypeOf(Y,xe.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=Y,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(()=>{let J=this._pendingSeekTime;this._pendingSeekTime=null,this.seek(J)})}_onMetaDataArrived(G){this._emitter.emit(st.METADATA_ARRIVED,G)}_onScriptDataArrived(G){this._emitter.emit(st.SCRIPTDATA_ARRIVED,G)}_onIOSeeked(){this._remuxer.insertDiscontinuity()}_onIOComplete(G){let J=G+1;J<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(J)):(this._remuxer.flushStashedSamples(),this._emitter.emit(st.LOADING_COMPLETE),this._disableStatisticsReporter())}_onIORedirect(G){let Y=this._ioctl.extraData;this._mediaDataSource.segments[Y].redirectedURL=G}_onIORecoveredEarlyEof(){this._emitter.emit(st.RECOVERED_EARLY_EOF)}_onIOException(G,Y){y.e(this.TAG,`IOException: type = ${G}, code = ${Y.code}, msg = ${Y.msg}`),this._emitter.emit(st.IO_ERROR,G,Y),this._disableStatisticsReporter()}_onDemuxException(G,Y){y.e(this.TAG,`DemuxException: type = ${G}, info = ${Y}`),this._emitter.emit(st.DEMUX_ERROR,G,Y)}_onRemuxerInitSegmentArrival(G,Y){this._emitter.emit(st.INIT_SEGMENT,G,Y)}_onRemuxerMediaSegmentArrival(G,Y){if(this._pendingSeekTime==null&&(this._emitter.emit(st.MEDIA_SEGMENT,G,Y),this._pendingResolveSeekPoint!=null&&G==="video")){let J=Y.info.syncPoints,le=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,_.safari&&J.length>0&&J[0].originalDts===le&&(le=J[0].pts),this._emitter.emit(st.RECOMMEND_SEEKPOINT,le)}}_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(G){let Y=this._mediaInfo.segments[G],J=Object.assign({},Y);J.duration=this._mediaInfo.duration,J.segmentCount=this._mediaInfo.segmentCount,delete J.segments,delete J.keyframesIndex,this._emitter.emit(st.MEDIA_INFO,J)}_reportStatisticsInfo(){let G={};G.url=this._ioctl.currentURL,G.hasRedirect=this._ioctl.hasRedirect,G.hasRedirect&&(G.redirectedURL=this._ioctl.currentRedirectedURL),G.speed=this._ioctl.currentSpeed,G.loaderType=this._ioctl.loaderType,G.currentSegmentIndex=this._currentSegmentIndex,G.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(st.STATISTICS_INFO,G)}}var ur=Ot,Qt=function(_t){let G="TransmuxingWorker",Y=null,J=ze.bind(this);re.install(),_t.addEventListener("message",function(He){switch(He.data.cmd){case"init":Y=new ur(He.data.param[0],He.data.param[1]),Y.on(st.IO_ERROR,Pe.bind(this)),Y.on(st.DEMUX_ERROR,be.bind(this)),Y.on(st.INIT_SEGMENT,le.bind(this)),Y.on(st.MEDIA_SEGMENT,_e.bind(this)),Y.on(st.LOADING_COMPLETE,Ie.bind(this)),Y.on(st.RECOVERED_EARLY_EOF,Ce.bind(this)),Y.on(st.MEDIA_INFO,Xe.bind(this)),Y.on(st.METADATA_ARRIVED,Je.bind(this)),Y.on(st.SCRIPTDATA_ARRIVED,bt.bind(this)),Y.on(st.STATISTICS_INFO,Ht.bind(this)),Y.on(st.RECOMMEND_SEEKPOINT,ut.bind(this));break;case"destroy":Y&&(Y.destroy(),Y=null),_t.postMessage({msg:"destroyed"});break;case"start":Y.start();break;case"stop":Y.stop();break;case"seek":Y.seek(He.data.param);break;case"pause":Y.pause();break;case"resume":Y.resume();break;case"logging_config":{let Qe=He.data.param;ue.applyConfig(Qe),Qe.enableCallback===!0?ue.addLogListener(J):ue.removeLogListener(J);break}}});function le(He,Qe){let ht={msg:st.INIT_SEGMENT,data:{type:He,data:Qe}};_t.postMessage(ht,[Qe.data])}function _e(He,Qe){let ht={msg:st.MEDIA_SEGMENT,data:{type:He,data:Qe}};_t.postMessage(ht,[Qe.data])}function Ie(){let He={msg:st.LOADING_COMPLETE};_t.postMessage(He)}function Ce(){let He={msg:st.RECOVERED_EARLY_EOF};_t.postMessage(He)}function Xe(He){let Qe={msg:st.MEDIA_INFO,data:He};_t.postMessage(Qe)}function Je(He){let Qe={msg:st.METADATA_ARRIVED,data:He};_t.postMessage(Qe)}function bt(He){let Qe={msg:st.SCRIPTDATA_ARRIVED,data:He};_t.postMessage(Qe)}function Ht(He){let Qe={msg:st.STATISTICS_INFO,data:He};_t.postMessage(Qe)}function Pe(He,Qe){_t.postMessage({msg:st.IO_ERROR,data:{type:He,info:Qe}})}function be(He,Qe){_t.postMessage({msg:st.DEMUX_ERROR,data:{type:He,info:Qe}})}function ut(He){_t.postMessage({msg:st.RECOMMEND_SEEKPOINT,data:He})}function ze(He,Qe){_t.postMessage({msg:"logcat_callback",data:{type:He,logcat:Qe}})}};class Fr{constructor(G,Y){if(this.TAG="Transmuxer",this._emitter=new(D()),Y.enableWorker&&typeof Worker!="undefined")try{let J=ae(82059);this._worker=J(Qt),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[G,Y]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},ue.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:ue.getConfig()})}catch(J){y.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new ur(G,Y)}else this._controller=new ur(G,Y);if(this._controller){let J=this._controller;J.on(st.IO_ERROR,this._onIOError.bind(this)),J.on(st.DEMUX_ERROR,this._onDemuxError.bind(this)),J.on(st.INIT_SEGMENT,this._onInitSegment.bind(this)),J.on(st.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),J.on(st.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),J.on(st.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),J.on(st.MEDIA_INFO,this._onMediaInfo.bind(this)),J.on(st.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),J.on(st.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),J.on(st.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),J.on(st.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}destroy(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),ue.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}on(G,Y){this._emitter.addListener(G,Y)}off(G,Y){this._emitter.removeListener(G,Y)}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(G){this._worker?this._worker.postMessage({cmd:"seek",param:G}):this._controller.seek(G)}pause(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}resume(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}_onInitSegment(G,Y){Promise.resolve().then(()=>{this._emitter.emit(st.INIT_SEGMENT,G,Y)})}_onMediaSegment(G,Y){Promise.resolve().then(()=>{this._emitter.emit(st.MEDIA_SEGMENT,G,Y)})}_onLoadingComplete(){Promise.resolve().then(()=>{this._emitter.emit(st.LOADING_COMPLETE)})}_onRecoveredEarlyEof(){Promise.resolve().then(()=>{this._emitter.emit(st.RECOVERED_EARLY_EOF)})}_onMediaInfo(G){Promise.resolve().then(()=>{this._emitter.emit(st.MEDIA_INFO,G)})}_onMetaDataArrived(G){Promise.resolve().then(()=>{this._emitter.emit(st.METADATA_ARRIVED,G)})}_onScriptDataArrived(G){Promise.resolve().then(()=>{this._emitter.emit(st.SCRIPTDATA_ARRIVED,G)})}_onStatisticsInfo(G){Promise.resolve().then(()=>{this._emitter.emit(st.STATISTICS_INFO,G)})}_onIOError(G,Y){Promise.resolve().then(()=>{this._emitter.emit(st.IO_ERROR,G,Y)})}_onDemuxError(G,Y){Promise.resolve().then(()=>{this._emitter.emit(st.DEMUX_ERROR,G,Y)})}_onRecommendSeekpoint(G){Promise.resolve().then(()=>{this._emitter.emit(st.RECOMMEND_SEEKPOINT,G)})}_onLoggingConfigChanged(G){this._worker&&this._worker.postMessage({cmd:"logging_config",param:G})}_onWorkerMessage(G){let Y=G.data,J=Y.data;if(Y.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(Y.msg){case st.INIT_SEGMENT:case st.MEDIA_SEGMENT:this._emitter.emit(Y.msg,J.type,J.data);break;case st.LOADING_COMPLETE:case st.RECOVERED_EARLY_EOF:this._emitter.emit(Y.msg);break;case st.MEDIA_INFO:Object.setPrototypeOf(J,xe.prototype),this._emitter.emit(Y.msg,J);break;case st.METADATA_ARRIVED:case st.SCRIPTDATA_ARRIVED:case st.STATISTICS_INFO:this._emitter.emit(Y.msg,J);break;case st.IO_ERROR:case st.DEMUX_ERROR:this._emitter.emit(Y.msg,J.type,J.info);break;case st.RECOMMEND_SEEKPOINT:this._emitter.emit(Y.msg,J);break;case"logcat_callback":y.emitter.emit("log",J.type,J.logcat);break;default:break}}}var Lt=Fr,yt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};class ir{constructor(G){this.TAG="MSEController",this._config=G,this._emitter=new(D()),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 dt}destroy(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}on(G,Y){this._emitter.addListener(G,Y)}off(G,Y){this._emitter.removeListener(G,Y)}attachMediaElement(G){if(this._mediaSource)throw new x("MediaSource has been attached to an HTMLMediaElement!");let Y=this._mediaSource=new window.MediaSource;Y.addEventListener("sourceopen",this.e.onSourceOpen),Y.addEventListener("sourceended",this.e.onSourceEnded),Y.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=G,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),G.src=this._mediaSourceObjectURL}detachMediaElement(){if(this._mediaSource){let G=this._mediaSource;for(let Y in this._sourceBuffers){let J=this._pendingSegments[Y];J.splice(0,J.length),this._pendingSegments[Y]=null,this._pendingRemoveRanges[Y]=null,this._lastInitSegments[Y]=null;let le=this._sourceBuffers[Y];if(le){if(G.readyState!=="closed"){try{G.removeSourceBuffer(le)}catch(_e){y.e(this.TAG,_e.message)}le.removeEventListener("error",this.e.onSourceBufferError),le.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[Y]=null,this._sourceBuffers[Y]=null}}if(G.readyState==="open")try{G.endOfStream()}catch(Y){y.e(this.TAG,Y.message)}G.removeEventListener("sourceopen",this.e.onSourceOpen),G.removeEventListener("sourceended",this.e.onSourceEnded),G.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(G,Y){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(G),this._pendingSegments[G.type].push(G);return}let J=G,le=`${J.container}`;J.codec&&J.codec.length>0&&(le+=`;codecs=${J.codec}`);let _e=!1;if(y.v(this.TAG,"Received Initialization Segment, mimeType: "+le),this._lastInitSegments[J.type]=J,le!==this._mimeTypes[J.type]){if(this._mimeTypes[J.type])y.v(this.TAG,`Notice: ${J.type} mimeType changed, origin: ${this._mimeTypes[J.type]}, target: ${le}`);else{_e=!0;try{let Ie=this._sourceBuffers[J.type]=this._mediaSource.addSourceBuffer(le);Ie.addEventListener("error",this.e.onSourceBufferError),Ie.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(Ie){y.e(this.TAG,Ie.message),this._emitter.emit(yt.ERROR,{code:Ie.code,msg:Ie.message});return}}this._mimeTypes[J.type]=le}Y||this._pendingSegments[J.type].push(J),_e||this._sourceBuffers[J.type]&&!this._sourceBuffers[J.type].updating&&this._doAppendSegments(),_.safari&&J.container==="audio/mpeg"&&J.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=J.mediaDuration/1e3,this._updateMediaSourceDuration())}appendMediaSegment(G){let Y=G;this._pendingSegments[Y.type].push(Y),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();let J=this._sourceBuffers[Y.type];J&&!J.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}seek(G){for(let Y in this._sourceBuffers){if(!this._sourceBuffers[Y])continue;let J=this._sourceBuffers[Y];if(this._mediaSource.readyState==="open")try{J.abort()}catch(_e){y.e(this.TAG,_e.message)}this._idrList.clear();let le=this._pendingSegments[Y];if(le.splice(0,le.length),this._mediaSource.readyState!=="closed"){for(let _e=0;_e<J.buffered.length;_e++){let Ie=J.buffered.start(_e),Ce=J.buffered.end(_e);this._pendingRemoveRanges[Y].push({start:Ie,end:Ce})}if(J.updating||this._doRemoveRanges(),_.safari){let _e=this._lastInitSegments[Y];_e&&(this._pendingSegments[Y].push(_e),J.updating||this._doAppendSegments())}}}}endOfStream(){let G=this._mediaSource,Y=this._sourceBuffers;if(!G||G.readyState!=="open"){G&&G.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}Y.video&&Y.video.updating||Y.audio&&Y.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,G.endOfStream())}getNearestKeyframe(G){return this._idrList.getLastSyncPointBeforeDts(G)}_needCleanupSourceBuffer(){if(!this._config.autoCleanupSourceBuffer)return!1;let G=this._mediaElement.currentTime;for(let Y in this._sourceBuffers){let J=this._sourceBuffers[Y];if(J){let le=J.buffered;if(le.length>=1&&G-le.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}_doCleanupSourceBuffer(){let G=this._mediaElement.currentTime;for(let Y in this._sourceBuffers){let J=this._sourceBuffers[Y];if(J){let le=J.buffered,_e=!1;for(let Ie=0;Ie<le.length;Ie++){let Ce=le.start(Ie),Xe=le.end(Ie);if(Ce<=G&&G<Xe+3){if(G-Ce>=this._config.autoCleanupMaxBackwardDuration){_e=!0;let Je=G-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[Y].push({start:Ce,end:Je})}}else Xe<G&&(_e=!0,this._pendingRemoveRanges[Y].push({start:Ce,end:Xe}))}_e&&!J.updating&&this._doRemoveRanges()}}}_updateMediaSourceDuration(){let G=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open"||G.video&&G.video.updating||G.audio&&G.audio.updating)return;let Y=this._mediaSource.duration,J=this._pendingMediaDuration;J>0&&(isNaN(Y)||J>Y)&&(y.v(this.TAG,`Update MediaSource duration from ${Y} to ${J}`),this._mediaSource.duration=J),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}_doRemoveRanges(){for(let G in this._pendingRemoveRanges){if(!this._sourceBuffers[G]||this._sourceBuffers[G].updating)continue;let Y=this._sourceBuffers[G],J=this._pendingRemoveRanges[G];for(;J.length&&!Y.updating;){let le=J.shift();Y.remove(le.start,le.end)}}}_doAppendSegments(){let G=this._pendingSegments;for(let Y in G)if(!(!this._sourceBuffers[Y]||this._sourceBuffers[Y].updating)&&G[Y].length>0){let J=G[Y].shift();if(J.timestampOffset){let le=this._sourceBuffers[Y].timestampOffset,_e=J.timestampOffset/1e3;Math.abs(le-_e)>.1&&(y.v(this.TAG,`Update MPEG audio timestampOffset from ${le} to ${_e}`),this._sourceBuffers[Y].timestampOffset=_e),delete J.timestampOffset}if(!J.data||J.data.byteLength===0)continue;try{this._sourceBuffers[Y].appendBuffer(J.data),this._isBufferFull=!1,Y==="video"&&J.hasOwnProperty("info")&&this._idrList.appendArray(J.info.syncPoints)}catch(le){this._pendingSegments[Y].unshift(J),le.code===22?(this._isBufferFull||this._emitter.emit(yt.BUFFER_FULL),this._isBufferFull=!0):(y.e(this.TAG,le.message),this._emitter.emit(yt.ERROR,{code:le.code,msg:le.message}))}}}_onSourceOpen(){if(y.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0){let G=this._pendingSourceBufferInit;for(;G.length;){let Y=G.shift();this.appendInitSegment(Y,!0)}}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(yt.SOURCE_OPEN)}_onSourceEnded(){y.v(this.TAG,"MediaSource onSourceEnded")}_onSourceClose(){y.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 G=this._pendingSegments;return G.video.length>0||G.audio.length>0}_hasPendingRemoveRanges(){let G=this._pendingRemoveRanges;return G.video.length>0||G.audio.length>0}_onSourceBufferUpdateEnd(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(yt.UPDATE_END)}_onSourceBufferError(G){y.e(this.TAG,`SourceBuffer Error: ${G}`)}}var Jt=ir;const St={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},it={NETWORK_EXCEPTION:i.EXCEPTION,NETWORK_STATUS_CODE_INVALID:i.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:i.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:i.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:Fe.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:Fe.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:Fe.CODEC_UNSUPPORTED};class Rt{constructor(G,Y){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(D()),this._config=C(),typeof Y=="object"&&Object.assign(this._config,Y),G.type.toLowerCase()!=="flv")throw new c("FlvPlayer requires an flv MediaDataSource input!");G.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=G,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 J=_.chrome&&(_.version.major<50||_.version.major===50&&_.version.build<2661);this._alwaysSeekKeyframe=!!(J||_.msedge||_.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(G,Y){G===q.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(q.MEDIA_INFO,this.mediaInfo)}):G===q.STATISTICS_INFO&&this._statisticsInfo!=null&&Promise.resolve().then(()=>{this._emitter.emit(q.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(G,Y)}off(G,Y){this._emitter.removeListener(G,Y)}attachMediaElement(G){if(this._mediaElement=G,G.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),G.addEventListener("seeking",this.e.onvSeeking),G.addEventListener("canplay",this.e.onvCanPlay),G.addEventListener("stalled",this.e.onvStalled),G.addEventListener("progress",this.e.onvProgress),this._msectl=new Jt(this._config),this._msectl.on(yt.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(yt.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(yt.SOURCE_OPEN,()=>{this._mseSourceOpened=!0,this._hasPendingLoad&&(this._hasPendingLoad=!1,this.load())}),this._msectl.on(yt.ERROR,Y=>{this._emitter.emit(q.ERROR,St.MEDIA_ERROR,it.MEDIA_MSE_ERROR,Y)}),this._msectl.attachMediaElement(G),this._pendingSeekTime!=null)try{G.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(Y){}}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 x("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new x("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 Lt(this._mediaDataSource,this._config),this._transmuxer.on(st.INIT_SEGMENT,(G,Y)=>{this._msectl.appendInitSegment(Y)}),this._transmuxer.on(st.MEDIA_SEGMENT,(G,Y)=>{if(this._msectl.appendMediaSegment(Y),this._config.lazyLoad&&!this._config.isLive){let J=this._mediaElement.currentTime;Y.info.endDts>=(J+this._config.lazyLoadMaxDuration)*1e3&&this._progressChecker==null&&(y.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}),this._transmuxer.on(st.LOADING_COMPLETE,()=>{this._msectl.endOfStream(),this._emitter.emit(q.LOADING_COMPLETE)}),this._transmuxer.on(st.RECOVERED_EARLY_EOF,()=>{this._emitter.emit(q.RECOVERED_EARLY_EOF)}),this._transmuxer.on(st.IO_ERROR,(G,Y)=>{this._emitter.emit(q.ERROR,St.NETWORK_ERROR,G,Y)}),this._transmuxer.on(st.DEMUX_ERROR,(G,Y)=>{this._emitter.emit(q.ERROR,St.MEDIA_ERROR,G,{code:-1,msg:Y})}),this._transmuxer.on(st.MEDIA_INFO,G=>{this._mediaInfo=G,this._emitter.emit(q.MEDIA_INFO,Object.assign({},G))}),this._transmuxer.on(st.METADATA_ARRIVED,G=>{this._emitter.emit(q.METADATA_ARRIVED,G)}),this._transmuxer.on(st.SCRIPTDATA_ARRIVED,G=>{this._emitter.emit(q.SCRIPTDATA_ARRIVED,G)}),this._transmuxer.on(st.STATISTICS_INFO,G=>{this._statisticsInfo=this._fillStatisticsInfo(G),this._emitter.emit(q.STATISTICS_INFO,Object.assign({},this._statisticsInfo))}),this._transmuxer.on(st.RECOMMEND_SEEKPOINT,G=>{this._mediaElement&&!this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=G/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(G){this._mediaElement.volume=G}get muted(){return this._mediaElement.muted}set muted(G){this._mediaElement.muted=G}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(G){this._mediaElement?this._internalSeek(G):this._pendingSeekTime=G}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(G){if(G.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return G;let Y=!0,J=0,le=0;if(this._mediaElement.getVideoPlaybackQuality){let _e=this._mediaElement.getVideoPlaybackQuality();J=_e.totalVideoFrames,le=_e.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(J=this._mediaElement.webkitDecodedFrameCount,le=this._mediaElement.webkitDroppedFrameCount):Y=!1;return Y&&(G.decodedFrames=J,G.droppedFrames=le),G}_onmseUpdateEnd(){if(!this._config.lazyLoad||this._config.isLive)return;let G=this._mediaElement.buffered,Y=this._mediaElement.currentTime,J=0,le=0;for(let _e=0;_e<G.length;_e++){let Ie=G.start(_e),Ce=G.end(_e);if(Ie<=Y&&Y<Ce){J=Ie,le=Ce;break}}le>=Y+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(y.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}_onmseBufferFull(){y.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 G=this._mediaElement.currentTime,Y=this._mediaElement.buffered,J=!1;for(let le=0;le<Y.length;le++){let _e=Y.start(le),Ie=Y.end(le);if(G>=_e&&G<Ie){G>=Ie-this._config.lazyLoadRecoverDuration&&(J=!0);break}}J&&(window.clearInterval(this._progressChecker),this._progressChecker=null,J&&(y.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}_isTimepointBuffered(G){let Y=this._mediaElement.buffered;for(let J=0;J<Y.length;J++){let le=Y.start(J),_e=Y.end(J);if(G>=le&&G<_e)return!0}return!1}_internalSeek(G){let Y=this._isTimepointBuffered(G),J=!1,le=0;if(G<1&&this._mediaElement.buffered.length>0){let _e=this._mediaElement.buffered.start(0);(_e<1&&G<_e||_.safari)&&(J=!0,le=_.safari?.1:_e)}if(J)this._requestSetTime=!0,this._mediaElement.currentTime=le;else if(Y){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=G;else{let _e=this._msectl.getNearestKeyframe(Math.floor(G*1e3));this._requestSetTime=!0,_e!=null?this._mediaElement.currentTime=_e.dts/1e3:this._mediaElement.currentTime=G}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(G),this._transmuxer.seek(Math.floor(G*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=G)}_checkAndApplyUnbufferedSeekpoint(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){let G=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(G)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(G),this._transmuxer.seek(Math.floor(G*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=G))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_checkAndResumeStuckPlayback(G){let Y=this._mediaElement;if(G||!this._receivedCanPlay||Y.readyState<2){let J=Y.buffered;J.length>0&&Y.currentTime<J.start(0)&&(y.w(this.TAG,`Playback seems stuck at ${Y.currentTime}, seek to ${J.start(0)}`),this._requestSetTime=!0,this._mediaElement.currentTime=J.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}_onvLoadedMetadata(G){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}_onvSeeking(G){let Y=this._mediaElement.currentTime,J=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(Y<1&&J.length>0){let le=J.start(0);if(le<1&&Y<le||_.safari){this._requestSetTime=!0,this._mediaElement.currentTime=_.safari?.1:le;return}}if(this._isTimepointBuffered(Y)){if(this._alwaysSeekKeyframe){let le=this._msectl.getNearestKeyframe(Math.floor(Y*1e3));le!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=le.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:Y,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}_onvCanPlay(G){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}_onvStalled(G){this._checkAndResumeStuckPlayback(!0)}_onvProgress(G){this._checkAndResumeStuckPlayback()}}var Vt=Rt;class jt{constructor(G,Y){if(this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(D()),this._config=C(),typeof Y=="object"&&Object.assign(this._config,Y),G.type.toLowerCase()==="flv")throw new c("NativePlayer does't support flv MediaDataSource input!");if(G.hasOwnProperty("segments"))throw new c(`NativePlayer(${G.type}) doesn't support multipart playback!`);this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=G,this._mediaElement=null}destroy(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}on(G,Y){G===q.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(q.MEDIA_INFO,this.mediaInfo)}):G===q.STATISTICS_INFO&&this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(()=>{this._emitter.emit(q.STATISTICS_INFO,this.statisticsInfo)}),this._emitter.addListener(G,Y)}off(G,Y){this._emitter.removeListener(G,Y)}attachMediaElement(G){if(this._mediaElement=G,G.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{G.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(Y){}}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 x("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(G){this._mediaElement.volume=G}get muted(){return this._mediaElement.muted}set muted(G){this._mediaElement.muted=G}get currentTime(){return this._mediaElement?this._mediaElement.currentTime:0}set currentTime(G){this._mediaElement?this._mediaElement.currentTime=G:this._pendingSeekTime=G}get mediaInfo(){let Y={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(Y.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(Y.width=this._mediaElement.videoWidth,Y.height=this._mediaElement.videoHeight)),Y}get statisticsInfo(){let G={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return G;let Y=!0,J=0,le=0;if(this._mediaElement.getVideoPlaybackQuality){let _e=this._mediaElement.getVideoPlaybackQuality();J=_e.totalVideoFrames,le=_e.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(J=this._mediaElement.webkitDecodedFrameCount,le=this._mediaElement.webkitDroppedFrameCount):Y=!1;return Y&&(G.decodedFrames=J,G.droppedFrames=le),G}_onvLoadedMetadata(G){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(q.MEDIA_INFO,this.mediaInfo)}_reportStatisticsInfo(){this._emitter.emit(q.STATISTICS_INFO,this.statisticsInfo)}}var Yt=jt;re.install();function qe(_t,G){let Y=_t;if(Y==null||typeof Y!="object")throw new c("MediaDataSource must be an javascript object!");if(!Y.hasOwnProperty("type"))throw new c("MediaDataSource must has type field to indicate video file type!");switch(Y.type){case"flv":return new Vt(Y,G);default:return new Yt(Y,G)}}function mt(){return H.supportMSEH264Playback()}function Dt(){return H.getFeatureList()}let Ft={};Ft.createPlayer=qe,Ft.isSupported=mt,Ft.getFeatureList=Dt,Ft.BaseLoader=o,Ft.LoaderStatus=f,Ft.LoaderErrors=i,Ft.Events=q,Ft.ErrorTypes=St,Ft.ErrorDetails=it,Ft.FlvPlayer=Vt,Ft.NativePlayer=Yt,Ft.LoggingControl=ue,Object.defineProperty(Ft,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var Zt=Ft},45685:function(qt,$e,ae){"use strict";ae.d($e,{default:function(){return N}});var te=ae(3300),re=ae(59301),X=ae(92310),D=ae.n(X),W=ae(6089),y=ae(16722),L=ae(97224),A=ae(83010),s=ae(48608),x=ae(48755),c=ae(83397),f=re.createContext(void 0),o=P=>{const{href:F,title:K,prefixCls:B,children:V,className:C,target:M,replace:H}=P,$=re.useContext(f),{registerLink:q,unregisterLink:se,scrollTo:ue,onClick:pe,activeLink:xe,direction:De}=$||{};re.useEffect(()=>(q==null||q(F),()=>{se==null||se(F)}),[F]);const Ue=ge=>{pe==null||pe(ge,{title:K,href:F}),ue==null||ue(F),H&&(ge.preventDefault(),window.location.replace(F))},{getPrefixCls:Ge}=re.useContext(x.E_),Ae=Ge("anchor",B),We=xe===F,we=D()(`${Ae}-link`,C,{[`${Ae}-link-active`]:We}),Se=D()(`${Ae}-link-title`,{[`${Ae}-link-title-active`]:We});return re.createElement("div",{className:we},re.createElement("a",{className:Se,href:F,title:typeof K=="string"?K:"",target:M,onClick:Ue},K),De!=="horizontal"?V:null)},d=ae(36237),m=ae(63356),_=ae(16931),h=ae(51636);const v=P=>{const{componentCls:F,holderOffsetBlock:K,motionDurationSlow:B,lineWidthBold:V,colorPrimary:C,lineType:M,colorSplit:H,calc:$}=P;return{[`${F}-wrapper`]:{marginBlockStart:$(K).mul(-1).equal(),paddingBlockStart:K,[F]:Object.assign(Object.assign({},(0,m.Wf)(P)),{position:"relative",paddingInlineStart:V,[`${F}-link`]:{paddingBlock:P.linkPaddingBlock,paddingInline:`${(0,d.unit)(P.linkPaddingInlineStart)} 0`,"&-title":Object.assign(Object.assign({},m.vS),{position:"relative",display:"block",marginBlockEnd:P.anchorTitleBlock,color:P.colorText,transition:`all ${P.motionDurationSlow}`,"&:only-child":{marginBlockEnd:0}}),[`&-active > ${F}-link-title`]:{color:P.colorPrimary},[`${F}-link`]:{paddingBlock:P.anchorPaddingBlockSecondary}}}),[`&:not(${F}-wrapper-horizontal)`]:{[F]:{"&::before":{position:"absolute",insetInlineStart:0,top:0,height:"100%",borderInlineStart:`${(0,d.unit)(V)} ${M} ${H}`,content:'" "'},[`${F}-ink`]:{position:"absolute",insetInlineStart:0,display:"none",transform:"translateY(-50%)",transition:`top ${B} ease-in-out`,width:V,backgroundColor:C,[`&${F}-ink-visible`]:{display:"inline-block"}}}},[`${F}-fixed ${F}-ink ${F}-ink`]:{display:"none"}}}},r=P=>{const{componentCls:F,motionDurationSlow:K,lineWidthBold:B,colorPrimary:V}=P;return{[`${F}-wrapper-horizontal`]:{position:"relative","&::before":{position:"absolute",left:{_skip_check_:!0,value:0},right:{_skip_check_:!0,value:0},bottom:0,borderBottom:`${(0,d.unit)(P.lineWidth)} ${P.lineType} ${P.colorSplit}`,content:'" "'},[F]:{overflowX:"scroll",position:"relative",display:"flex",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},[`${F}-link:first-of-type`]:{paddingInline:0},[`${F}-ink`]:{position:"absolute",bottom:0,transition:`left ${K} ease-in-out, width ${K} ease-in-out`,height:B,backgroundColor:V}}}}},a=P=>({linkPaddingBlock:P.paddingXXS,linkPaddingInlineStart:P.padding});var p=(0,_.I$)("Anchor",P=>{const{fontSize:F,fontSizeLG:K,paddingXXS:B,calc:V}=P,C=(0,h.mergeToken)(P,{holderOffsetBlock:B,anchorPaddingBlockSecondary:V(B).div(2).equal(),anchorTitleBlock:V(F).div(14).mul(3).equal(),anchorBallSize:V(K).div(2).equal()});return[v(C),r(C)]},a);function E(){return window}function S(P,F){if(!P.getClientRects().length)return 0;const K=P.getBoundingClientRect();return K.width||K.height?F===window?K.top-P.ownerDocument.documentElement.clientTop:K.top-F.getBoundingClientRect().top:K.top}const w=/#([\S ]+)$/;var O=P=>{var F;const{rootClassName:K,prefixCls:B,className:V,style:C,offsetTop:M,affix:H=!0,showInkInFixed:$=!1,children:q,items:se,direction:ue="vertical",bounds:pe,targetOffset:xe,onClick:De,onChange:Ue,getContainer:Ge,getCurrentAnchor:Ae,replace:We}=P,[we,Se]=re.useState([]),[ge,Re]=re.useState(null),ve=re.useRef(ge),Le=re.useRef(null),Fe=re.useRef(null),me=re.useRef(!1),{direction:oe,getPrefixCls:ie,className:fe,style:ye}=(0,x.dj)("anchor"),{getTargetContainer:he}=re.useContext(x.E_),Te=ie("anchor",B),Oe=(0,c.Z)(Te),[Be,Ze,tt]=p(Te,Oe),dt=(F=Ge!=null?Ge:he)!==null&&F!==void 0?F:E,nt=JSON.stringify(we),At=(0,W.Z)(it=>{we.includes(it)||Se(Rt=>[].concat((0,te.Z)(Rt),[it]))}),Nt=(0,W.Z)(it=>{we.includes(it)&&Se(Rt=>Rt.filter(Vt=>Vt!==it))}),Bt=()=>{var it;const Rt=(it=Le.current)===null||it===void 0?void 0:it.querySelector(`.${Te}-link-title-active`);if(Rt&&Fe.current){const{style:Vt}=Fe.current,jt=ue==="horizontal";Vt.top=jt?"":`${Rt.offsetTop+Rt.clientHeight/2}px`,Vt.height=jt?"":`${Rt.clientHeight}px`,Vt.left=jt?`${Rt.offsetLeft}px`:"",Vt.width=jt?`${Rt.clientWidth}px`:"",jt&&(0,y.Z)(Rt,{scrollMode:"if-needed",block:"nearest"})}},st=function(it){let Rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Vt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:5;const jt=[],Yt=dt();return it.forEach(qe=>{const mt=w.exec(qe==null?void 0:qe.toString());if(!mt)return;const Dt=document.getElementById(mt[1]);if(Dt){const Ft=S(Dt,Yt);Ft<=Rt+Vt&&jt.push({link:qe,top:Ft})}}),jt.length?jt.reduce((mt,Dt)=>Dt.top>mt.top?Dt:mt).link:""},Ot=(0,W.Z)(it=>{if(ve.current===it)return;const Rt=typeof Ae=="function"?Ae(it):it;Re(Rt),ve.current=Rt,Ue==null||Ue(it)}),ur=re.useCallback(()=>{if(me.current)return;const it=st(we,xe!==void 0?xe:M||0,pe);Ot(it)},[nt,xe,M]),br=re.useCallback(it=>{Ot(it);const Rt=w.exec(it);if(!Rt)return;const Vt=document.getElementById(Rt[1]);if(!Vt)return;const jt=dt(),Yt=(0,L.Z)(jt),qe=S(Vt,jt);let mt=Yt+qe;mt-=xe!==void 0?xe:M||0,me.current=!0,(0,A.Z)(mt,{getContainer:dt,callback(){me.current=!1}})},[xe,M]),Qt=D()(Ze,tt,Oe,K,`${Te}-wrapper`,{[`${Te}-wrapper-horizontal`]:ue==="horizontal",[`${Te}-rtl`]:oe==="rtl"},V,fe),Fr=D()(Te,{[`${Te}-fixed`]:!H&&!$}),Lt=D()(`${Te}-ink`,{[`${Te}-ink-visible`]:ge}),gt=Object.assign(Object.assign({maxHeight:M?`calc(100vh - ${M}px)`:"100vh"},ye),C),yt=it=>Array.isArray(it)?it.map(Rt=>re.createElement(o,Object.assign({replace:We},Rt,{key:Rt.key}),ue==="vertical"&&yt(Rt.children))):null,ir=re.createElement("div",{ref:Le,className:Qt,style:gt},re.createElement("div",{className:Fr},re.createElement("span",{className:Lt,ref:Fe}),"items"in P?yt(se):q));re.useEffect(()=>{const it=dt();return ur(),it==null||it.addEventListener("scroll",ur),()=>{it==null||it.removeEventListener("scroll",ur)}},[nt]),re.useEffect(()=>{typeof Ae=="function"&&Ot(Ae(ve.current||""))},[Ae]),re.useEffect(()=>{Bt()},[ue,Ae,nt,ge]);const Jt=re.useMemo(()=>({registerLink:At,unregisterLink:Nt,scrollTo:br,activeLink:ge,onClick:De,direction:ue}),[ge,De,br,ue]),St=H&&typeof H=="object"?H:void 0;return Be(re.createElement(f.Provider,{value:Jt},H?re.createElement(s.Z,Object.assign({offsetTop:M,target:dt},St),ir):ir))};const z=O;z.Link=o;var N=z},25769:function(qt,$e,ae){"use strict";var te=ae(98040),re={"text/plain":"Text","text/html":"Url",default:"Text"},X="Copy to clipboard: #{key}, Enter";function D(y){var L=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return y.replace(/#{\s*key\s*}/g,L)}function W(y,L){var A,s,x,c,u,f,i=!1;L||(L={}),A=L.debug||!1;try{x=te(),c=document.createRange(),u=document.getSelection(),f=document.createElement("span"),f.textContent=y,f.ariaHidden="true",f.style.all="unset",f.style.position="fixed",f.style.top=0,f.style.clip="rect(0, 0, 0, 0)",f.style.whiteSpace="pre",f.style.webkitUserSelect="text",f.style.MozUserSelect="text",f.style.msUserSelect="text",f.style.userSelect="text",f.addEventListener("copy",function(d){if(d.stopPropagation(),L.format)if(d.preventDefault(),typeof d.clipboardData=="undefined"){A&&console.warn("unable to use e.clipboardData"),A&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var m=re[L.format]||re.default;window.clipboardData.setData(m,y)}else d.clipboardData.clearData(),d.clipboardData.setData(L.format,y);L.onCopy&&(d.preventDefault(),L.onCopy(d.clipboardData))}),document.body.appendChild(f),c.selectNodeContents(f),u.addRange(c);var o=document.execCommand("copy");if(!o)throw new Error("copy command was unsuccessful");i=!0}catch(d){A&&console.error("unable to copy using execCommand: ",d),A&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(L.format||"text",y),L.onCopy&&L.onCopy(window.clipboardData),i=!0}catch(m){A&&console.error("unable to copy using clipboardData: ",m),A&&console.error("falling back to prompt"),s=D("message"in L?L.message:X),window.prompt(s,y)}}finally{u&&(typeof u.removeRange=="function"?u.removeRange(c):u.removeAllRanges()),f&&document.body.removeChild(f),x()}return i}qt.exports=W},97774:function(qt,$e,ae){"use strict";Object.defineProperty($e,"__esModule",{value:!0}),$e.default=void 0;var te=Object.assign||function(d){for(var m=1;m<arguments.length;m++){var _=arguments[m];for(var h in _)Object.prototype.hasOwnProperty.call(_,h)&&(d[h]=_[h])}return d},re=function(){function d(m,_){for(var h=0;h<_.length;h++){var v=_[h];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(m,v.key,v)}}return function(m,_,h){return _&&d(m.prototype,_),h&&d(m,h),m}}(),X=ae(59301),D=c(X),W=ae(12708),y=c(W),L=ae(53291),A=c(L),s=ae(47242),x=ae(65429);function c(d){return d&&d.__esModule?d:{default:d}}function u(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")}function f(d,m){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:d}function i(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(d,m):d.__proto__=m)}var o=function(d){i(m,d);function m(_){u(this,m);var h=f(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,_));return h.getEchartsInstance=function(){return h.echartsLib.getInstanceByDom(h.echartsElement)||h.echartsLib.init(h.echartsElement,h.props.theme,h.props.opts)},h.dispose=function(){if(h.echartsElement){try{(0,s.clear)(h.echartsElement)}catch(v){console.warn(v)}h.echartsLib.dispose(h.echartsElement)}},h.rerender=function(){var v=h.props,r=v.onEvents,a=v.onChartReady,p=h.renderEchartDom();h.bindEvents(p,r||{}),typeof a=="function"&&h.props.onChartReady(p),h.echartsElement&&(0,s.bind)(h.echartsElement,function(){try{p.resize()}catch(E){console.warn(E)}})},h.bindEvents=function(v,r){var a=function(S,w){typeof S=="string"&&typeof w=="function"&&v.on(S,function(R){w(R,v)})};for(var p in r)Object.prototype.hasOwnProperty.call(r,p)&&a(p,r[p])},h.renderEchartDom=function(){var v=h.getEchartsInstance();return v.setOption(h.props.option,h.props.notMerge||!1,h.props.lazyUpdate||!1),h.props.showLoading?v.showLoading(h.props.loadingOption||null):v.hideLoading(),v},h.echartsLib=_.echarts,h.echartsElement=null,h}return re(m,[{key:"componentDidMount",value:function(){this.rerender()}},{key:"componentDidUpdate",value:function(h){if(!(typeof this.props.shouldSetOption=="function"&&!this.props.shouldSetOption(h,this.props))){if(!(0,A.default)(h.theme,this.props.theme)||!(0,A.default)(h.opts,this.props.opts)||!(0,A.default)(h.onEvents,this.props.onEvents)){this.dispose(),this.rerender();return}var v=["option","notMerge","lazyUpdate","showLoading","loadingOption"];if(!(0,A.default)((0,x.pick)(this.props,v),(0,x.pick)(h,v))){var r=this.renderEchartDom();if(!(0,A.default)(h.style,this.props.style)||!(0,A.default)(h.className,this.props.className))try{r.resize()}catch(a){console.warn(a)}}}}},{key:"componentWillUnmount",value:function(){this.dispose()}},{key:"render",value:function(){var h=this,v=this.props,r=v.style,a=v.className,p=te({height:300},r);return D.default.createElement("div",{ref:function(S){h.echartsElement=S},style:p,className:"echarts-for-react "+a})}}]),m}(X.Component);$e.default=o,o.propTypes={option:y.default.object.isRequired,echarts:y.default.object,notMerge:y.default.bool,lazyUpdate:y.default.bool,style:y.default.object,className:y.default.string,theme:y.default.oneOfType([y.default.string,y.default.object]),onChartReady:y.default.func,showLoading:y.default.bool,loadingOption:y.default.object,onEvents:y.default.object,opts:y.default.shape({devicePixelRatio:y.default.number,renderer:y.default.oneOf(["canvas","svg"]),width:y.default.oneOfType([y.default.number,y.default.oneOf([null,void 0,"auto"])]),height:y.default.oneOfType([y.default.number,y.default.oneOf([null,void 0,"auto"])])}),shouldSetOption:y.default.func},o.defaultProps={echarts:{},notMerge:!1,lazyUpdate:!1,style:{},className:"",theme:null,onChartReady:function(){},showLoading:!1,loadingOption:null,onEvents:{},opts:{},shouldSetOption:function(){return!0}}},42441:function(qt,$e,ae){"use strict";var te;te={value:!0},$e.Z=void 0;var re=ae(76411),X=y(re),D=ae(97774),W=y(D);function y(c){return c&&c.__esModule?c:{default:c}}function L(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function A(c,u){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:c}function s(c,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);c.prototype=Object.create(u&&u.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(c,u):c.__proto__=u)}var x=function(c){s(u,c);function u(f){L(this,u);var i=A(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,f));return i.echartsLib=X.default,i}return u}(W.default);$e.Z=x},65429:function(qt,$e){"use strict";Object.defineProperty($e,"__esModule",{value:!0});var ae=$e.pick=function(re,X){var D={};return X.forEach(function(W){D[W]=re[W]}),D}},48961:function(qt,$e,ae){(function(re,X){qt.exports=X(ae(76411))})(this,function(te){return function(re){var X={};function D(W){if(X[W])return X[W].exports;var y=X[W]={i:W,l:!1,exports:{}};return re[W].call(y.exports,y,y.exports,D),y.l=!0,y.exports}return D.m=re,D.c=X,D.d=function(W,y,L){D.o(W,y)||Object.defineProperty(W,y,{configurable:!1,enumerable:!0,get:L})},D.n=function(W){var y=W&&W.__esModule?function(){return W.default}:function(){return W};return D.d(y,"a",y),y},D.o=function(W,y){return Object.prototype.hasOwnProperty.call(W,y)},D.p="",D(D.s=87)}([function(re,X){re.exports=te},function(re,X,D){(function(W){"use strict";var y={};y.exports=X,function(L){if(!A)var A=1e-6;if(!s)var s=typeof Float32Array!="undefined"?Float32Array:Array;if(!x)var x=Math.random;var c={};c.setMatrixArrayType=function(r){s=r},typeof L!="undefined"&&(L.glMatrix=c);var u=Math.PI/180;c.toRadian=function(r){return r*u};var f={};f.create=function(){var r=new s(2);return r[0]=0,r[1]=0,r},f.clone=function(r){var a=new s(2);return a[0]=r[0],a[1]=r[1],a},f.fromValues=function(r,a){var p=new s(2);return p[0]=r,p[1]=a,p},f.copy=function(r,a){return r[0]=a[0],r[1]=a[1],r},f.set=function(r,a,p){return r[0]=a,r[1]=p,r},f.add=function(r,a,p){return r[0]=a[0]+p[0],r[1]=a[1]+p[1],r},f.subtract=function(r,a,p){return r[0]=a[0]-p[0],r[1]=a[1]-p[1],r},f.sub=f.subtract,f.multiply=function(r,a,p){return r[0]=a[0]*p[0],r[1]=a[1]*p[1],r},f.mul=f.multiply,f.divide=function(r,a,p){return r[0]=a[0]/p[0],r[1]=a[1]/p[1],r},f.div=f.divide,f.min=function(r,a,p){return r[0]=Math.min(a[0],p[0]),r[1]=Math.min(a[1],p[1]),r},f.max=function(r,a,p){return r[0]=Math.max(a[0],p[0]),r[1]=Math.max(a[1],p[1]),r},f.scale=function(r,a,p){return r[0]=a[0]*p,r[1]=a[1]*p,r},f.scaleAndAdd=function(r,a,p,E){return r[0]=a[0]+p[0]*E,r[1]=a[1]+p[1]*E,r},f.distance=function(r,a){var p=a[0]-r[0],E=a[1]-r[1];return Math.sqrt(p*p+E*E)},f.dist=f.distance,f.squaredDistance=function(r,a){var p=a[0]-r[0],E=a[1]-r[1];return p*p+E*E},f.sqrDist=f.squaredDistance,f.length=function(r){var a=r[0],p=r[1];return Math.sqrt(a*a+p*p)},f.len=f.length,f.squaredLength=function(r){var a=r[0],p=r[1];return a*a+p*p},f.sqrLen=f.squaredLength,f.negate=function(r,a){return r[0]=-a[0],r[1]=-a[1],r},f.inverse=function(r,a){return r[0]=1/a[0],r[1]=1/a[1],r},f.normalize=function(r,a){var p=a[0],E=a[1],S=p*p+E*E;return S>0&&(S=1/Math.sqrt(S),r[0]=a[0]*S,r[1]=a[1]*S),r},f.dot=function(r,a){return r[0]*a[0]+r[1]*a[1]},f.cross=function(r,a,p){var E=a[0]*p[1]-a[1]*p[0];return r[0]=r[1]=0,r[2]=E,r},f.lerp=function(r,a,p,E){var S=a[0],w=a[1];return r[0]=S+E*(p[0]-S),r[1]=w+E*(p[1]-w),r},f.random=function(r,a){a=a||1;var p=x()*2*Math.PI;return r[0]=Math.cos(p)*a,r[1]=Math.sin(p)*a,r},f.transformMat2=function(r,a,p){var E=a[0],S=a[1];return r[0]=p[0]*E+p[2]*S,r[1]=p[1]*E+p[3]*S,r},f.transformMat2d=function(r,a,p){var E=a[0],S=a[1];return r[0]=p[0]*E+p[2]*S+p[4],r[1]=p[1]*E+p[3]*S+p[5],r},f.transformMat3=function(r,a,p){var E=a[0],S=a[1];return r[0]=p[0]*E+p[3]*S+p[6],r[1]=p[1]*E+p[4]*S+p[7],r},f.transformMat4=function(r,a,p){var E=a[0],S=a[1];return r[0]=p[0]*E+p[4]*S+p[12],r[1]=p[1]*E+p[5]*S+p[13],r},f.forEach=function(){var r=f.create();return function(a,p,E,S,w,R){var O,z;for(p||(p=2),E||(E=0),S?z=Math.min(S*p+E,a.length):z=a.length,O=E;O<z;O+=p)r[0]=a[O],r[1]=a[O+1],w(r,r,R),a[O]=r[0],a[O+1]=r[1];return a}}(),f.str=function(r){return"vec2("+r[0]+", "+r[1]+")"},typeof L!="undefined"&&(L.vec2=f);var i={};i.create=function(){var r=new s(3);return r[0]=0,r[1]=0,r[2]=0,r},i.clone=function(r){var a=new s(3);return a[0]=r[0],a[1]=r[1],a[2]=r[2],a},i.fromValues=function(r,a,p){var E=new s(3);return E[0]=r,E[1]=a,E[2]=p,E},i.copy=function(r,a){return r[0]=a[0],r[1]=a[1],r[2]=a[2],r},i.set=function(r,a,p,E){return r[0]=a,r[1]=p,r[2]=E,r},i.add=function(r,a,p){return r[0]=a[0]+p[0],r[1]=a[1]+p[1],r[2]=a[2]+p[2],r},i.subtract=function(r,a,p){return r[0]=a[0]-p[0],r[1]=a[1]-p[1],r[2]=a[2]-p[2],r},i.sub=i.subtract,i.multiply=function(r,a,p){return r[0]=a[0]*p[0],r[1]=a[1]*p[1],r[2]=a[2]*p[2],r},i.mul=i.multiply,i.divide=function(r,a,p){return r[0]=a[0]/p[0],r[1]=a[1]/p[1],r[2]=a[2]/p[2],r},i.div=i.divide,i.min=function(r,a,p){return r[0]=Math.min(a[0],p[0]),r[1]=Math.min(a[1],p[1]),r[2]=Math.min(a[2],p[2]),r},i.max=function(r,a,p){return r[0]=Math.max(a[0],p[0]),r[1]=Math.max(a[1],p[1]),r[2]=Math.max(a[2],p[2]),r},i.scale=function(r,a,p){return r[0]=a[0]*p,r[1]=a[1]*p,r[2]=a[2]*p,r},i.scaleAndAdd=function(r,a,p,E){return r[0]=a[0]+p[0]*E,r[1]=a[1]+p[1]*E,r[2]=a[2]+p[2]*E,r},i.distance=function(r,a){var p=a[0]-r[0],E=a[1]-r[1],S=a[2]-r[2];return Math.sqrt(p*p+E*E+S*S)},i.dist=i.distance,i.squaredDistance=function(r,a){var p=a[0]-r[0],E=a[1]-r[1],S=a[2]-r[2];return p*p+E*E+S*S},i.sqrDist=i.squaredDistance,i.length=function(r){var a=r[0],p=r[1],E=r[2];return Math.sqrt(a*a+p*p+E*E)},i.len=i.length,i.squaredLength=function(r){var a=r[0],p=r[1],E=r[2];return a*a+p*p+E*E},i.sqrLen=i.squaredLength,i.negate=function(r,a){return r[0]=-a[0],r[1]=-a[1],r[2]=-a[2],r},i.inverse=function(r,a){return r[0]=1/a[0],r[1]=1/a[1],r[2]=1/a[2],r},i.normalize=function(r,a){var p=a[0],E=a[1],S=a[2],w=p*p+E*E+S*S;return w>0&&(w=1/Math.sqrt(w),r[0]=a[0]*w,r[1]=a[1]*w,r[2]=a[2]*w),r},i.dot=function(r,a){return r[0]*a[0]+r[1]*a[1]+r[2]*a[2]},i.cross=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=p[0],O=p[1],z=p[2];return r[0]=S*z-w*O,r[1]=w*R-E*z,r[2]=E*O-S*R,r},i.lerp=function(r,a,p,E){var S=a[0],w=a[1],R=a[2];return r[0]=S+E*(p[0]-S),r[1]=w+E*(p[1]-w),r[2]=R+E*(p[2]-R),r},i.random=function(r,a){a=a||1;var p=x()*2*Math.PI,E=x()*2-1,S=Math.sqrt(1-E*E)*a;return r[0]=Math.cos(p)*S,r[1]=Math.sin(p)*S,r[2]=E*a,r},i.transformMat4=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=p[3]*E+p[7]*S+p[11]*w+p[15];return R=R||1,r[0]=(p[0]*E+p[4]*S+p[8]*w+p[12])/R,r[1]=(p[1]*E+p[5]*S+p[9]*w+p[13])/R,r[2]=(p[2]*E+p[6]*S+p[10]*w+p[14])/R,r},i.transformMat3=function(r,a,p){var E=a[0],S=a[1],w=a[2];return r[0]=E*p[0]+S*p[3]+w*p[6],r[1]=E*p[1]+S*p[4]+w*p[7],r[2]=E*p[2]+S*p[5]+w*p[8],r},i.transformQuat=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=p[0],O=p[1],z=p[2],N=p[3],P=N*E+O*w-z*S,F=N*S+z*E-R*w,K=N*w+R*S-O*E,B=-R*E-O*S-z*w;return r[0]=P*N+B*-R+F*-z-K*-O,r[1]=F*N+B*-O+K*-R-P*-z,r[2]=K*N+B*-z+P*-O-F*-R,r},i.rotateX=function(r,a,p,E){var S=[],w=[];return S[0]=a[0]-p[0],S[1]=a[1]-p[1],S[2]=a[2]-p[2],w[0]=S[0],w[1]=S[1]*Math.cos(E)-S[2]*Math.sin(E),w[2]=S[1]*Math.sin(E)+S[2]*Math.cos(E),r[0]=w[0]+p[0],r[1]=w[1]+p[1],r[2]=w[2]+p[2],r},i.rotateY=function(r,a,p,E){var S=[],w=[];return S[0]=a[0]-p[0],S[1]=a[1]-p[1],S[2]=a[2]-p[2],w[0]=S[2]*Math.sin(E)+S[0]*Math.cos(E),w[1]=S[1],w[2]=S[2]*Math.cos(E)-S[0]*Math.sin(E),r[0]=w[0]+p[0],r[1]=w[1]+p[1],r[2]=w[2]+p[2],r},i.rotateZ=function(r,a,p,E){var S=[],w=[];return S[0]=a[0]-p[0],S[1]=a[1]-p[1],S[2]=a[2]-p[2],w[0]=S[0]*Math.cos(E)-S[1]*Math.sin(E),w[1]=S[0]*Math.sin(E)+S[1]*Math.cos(E),w[2]=S[2],r[0]=w[0]+p[0],r[1]=w[1]+p[1],r[2]=w[2]+p[2],r},i.forEach=function(){var r=i.create();return function(a,p,E,S,w,R){var O,z;for(p||(p=3),E||(E=0),S?z=Math.min(S*p+E,a.length):z=a.length,O=E;O<z;O+=p)r[0]=a[O],r[1]=a[O+1],r[2]=a[O+2],w(r,r,R),a[O]=r[0],a[O+1]=r[1],a[O+2]=r[2];return a}}(),i.angle=function(r,a){var p=i.fromValues(r[0],r[1],r[2]),E=i.fromValues(a[0],a[1],a[2]);i.normalize(p,p),i.normalize(E,E);var S=i.dot(p,E);return S>1?0:Math.acos(S)},i.str=function(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"},typeof L!="undefined"&&(L.vec3=i);var o={};o.create=function(){var r=new s(4);return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r},o.clone=function(r){var a=new s(4);return a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],a},o.fromValues=function(r,a,p,E){var S=new s(4);return S[0]=r,S[1]=a,S[2]=p,S[3]=E,S},o.copy=function(r,a){return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r},o.set=function(r,a,p,E,S){return r[0]=a,r[1]=p,r[2]=E,r[3]=S,r},o.add=function(r,a,p){return r[0]=a[0]+p[0],r[1]=a[1]+p[1],r[2]=a[2]+p[2],r[3]=a[3]+p[3],r},o.subtract=function(r,a,p){return r[0]=a[0]-p[0],r[1]=a[1]-p[1],r[2]=a[2]-p[2],r[3]=a[3]-p[3],r},o.sub=o.subtract,o.multiply=function(r,a,p){return r[0]=a[0]*p[0],r[1]=a[1]*p[1],r[2]=a[2]*p[2],r[3]=a[3]*p[3],r},o.mul=o.multiply,o.divide=function(r,a,p){return r[0]=a[0]/p[0],r[1]=a[1]/p[1],r[2]=a[2]/p[2],r[3]=a[3]/p[3],r},o.div=o.divide,o.min=function(r,a,p){return r[0]=Math.min(a[0],p[0]),r[1]=Math.min(a[1],p[1]),r[2]=Math.min(a[2],p[2]),r[3]=Math.min(a[3],p[3]),r},o.max=function(r,a,p){return r[0]=Math.max(a[0],p[0]),r[1]=Math.max(a[1],p[1]),r[2]=Math.max(a[2],p[2]),r[3]=Math.max(a[3],p[3]),r},o.scale=function(r,a,p){return r[0]=a[0]*p,r[1]=a[1]*p,r[2]=a[2]*p,r[3]=a[3]*p,r},o.scaleAndAdd=function(r,a,p,E){return r[0]=a[0]+p[0]*E,r[1]=a[1]+p[1]*E,r[2]=a[2]+p[2]*E,r[3]=a[3]+p[3]*E,r},o.distance=function(r,a){var p=a[0]-r[0],E=a[1]-r[1],S=a[2]-r[2],w=a[3]-r[3];return Math.sqrt(p*p+E*E+S*S+w*w)},o.dist=o.distance,o.squaredDistance=function(r,a){var p=a[0]-r[0],E=a[1]-r[1],S=a[2]-r[2],w=a[3]-r[3];return p*p+E*E+S*S+w*w},o.sqrDist=o.squaredDistance,o.length=function(r){var a=r[0],p=r[1],E=r[2],S=r[3];return Math.sqrt(a*a+p*p+E*E+S*S)},o.len=o.length,o.squaredLength=function(r){var a=r[0],p=r[1],E=r[2],S=r[3];return a*a+p*p+E*E+S*S},o.sqrLen=o.squaredLength,o.negate=function(r,a){return r[0]=-a[0],r[1]=-a[1],r[2]=-a[2],r[3]=-a[3],r},o.inverse=function(r,a){return r[0]=1/a[0],r[1]=1/a[1],r[2]=1/a[2],r[3]=1/a[3],r},o.normalize=function(r,a){var p=a[0],E=a[1],S=a[2],w=a[3],R=p*p+E*E+S*S+w*w;return R>0&&(R=1/Math.sqrt(R),r[0]=a[0]*R,r[1]=a[1]*R,r[2]=a[2]*R,r[3]=a[3]*R),r},o.dot=function(r,a){return r[0]*a[0]+r[1]*a[1]+r[2]*a[2]+r[3]*a[3]},o.lerp=function(r,a,p,E){var S=a[0],w=a[1],R=a[2],O=a[3];return r[0]=S+E*(p[0]-S),r[1]=w+E*(p[1]-w),r[2]=R+E*(p[2]-R),r[3]=O+E*(p[3]-O),r},o.random=function(r,a){return a=a||1,r[0]=x(),r[1]=x(),r[2]=x(),r[3]=x(),o.normalize(r,r),o.scale(r,r,a),r},o.transformMat4=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=a[3];return r[0]=p[0]*E+p[4]*S+p[8]*w+p[12]*R,r[1]=p[1]*E+p[5]*S+p[9]*w+p[13]*R,r[2]=p[2]*E+p[6]*S+p[10]*w+p[14]*R,r[3]=p[3]*E+p[7]*S+p[11]*w+p[15]*R,r},o.transformQuat=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=p[0],O=p[1],z=p[2],N=p[3],P=N*E+O*w-z*S,F=N*S+z*E-R*w,K=N*w+R*S-O*E,B=-R*E-O*S-z*w;return r[0]=P*N+B*-R+F*-z-K*-O,r[1]=F*N+B*-O+K*-R-P*-z,r[2]=K*N+B*-z+P*-O-F*-R,r},o.forEach=function(){var r=o.create();return function(a,p,E,S,w,R){var O,z;for(p||(p=4),E||(E=0),S?z=Math.min(S*p+E,a.length):z=a.length,O=E;O<z;O+=p)r[0]=a[O],r[1]=a[O+1],r[2]=a[O+2],r[3]=a[O+3],w(r,r,R),a[O]=r[0],a[O+1]=r[1],a[O+2]=r[2],a[O+3]=r[3];return a}}(),o.str=function(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"},typeof L!="undefined"&&(L.vec4=o);var d={};d.create=function(){var r=new s(4);return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r},d.clone=function(r){var a=new s(4);return a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],a},d.copy=function(r,a){return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r},d.identity=function(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r},d.transpose=function(r,a){if(r===a){var p=a[1];r[1]=a[2],r[2]=p}else r[0]=a[0],r[1]=a[2],r[2]=a[1],r[3]=a[3];return r},d.invert=function(r,a){var p=a[0],E=a[1],S=a[2],w=a[3],R=p*w-S*E;return R?(R=1/R,r[0]=w*R,r[1]=-E*R,r[2]=-S*R,r[3]=p*R,r):null},d.adjoint=function(r,a){var p=a[0];return r[0]=a[3],r[1]=-a[1],r[2]=-a[2],r[3]=p,r},d.determinant=function(r){return r[0]*r[3]-r[2]*r[1]},d.multiply=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=a[3],O=p[0],z=p[1],N=p[2],P=p[3];return r[0]=E*O+w*z,r[1]=S*O+R*z,r[2]=E*N+w*P,r[3]=S*N+R*P,r},d.mul=d.multiply,d.rotate=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=a[3],O=Math.sin(p),z=Math.cos(p);return r[0]=E*z+w*O,r[1]=S*z+R*O,r[2]=E*-O+w*z,r[3]=S*-O+R*z,r},d.scale=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=a[3],O=p[0],z=p[1];return r[0]=E*O,r[1]=S*O,r[2]=w*z,r[3]=R*z,r},d.str=function(r){return"mat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"},d.frob=function(r){return Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)+Math.pow(r[2],2)+Math.pow(r[3],2))},d.LDU=function(r,a,p,E){return r[2]=E[2]/E[0],p[0]=E[0],p[1]=E[1],p[3]=E[3]-r[2]*p[1],[r,a,p]},typeof L!="undefined"&&(L.mat2=d);var m={};m.create=function(){var r=new s(6);return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r},m.clone=function(r){var a=new s(6);return a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],a[4]=r[4],a[5]=r[5],a},m.copy=function(r,a){return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r[4]=a[4],r[5]=a[5],r},m.identity=function(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r},m.invert=function(r,a){var p=a[0],E=a[1],S=a[2],w=a[3],R=a[4],O=a[5],z=p*w-E*S;return z?(z=1/z,r[0]=w*z,r[1]=-E*z,r[2]=-S*z,r[3]=p*z,r[4]=(S*O-w*R)*z,r[5]=(E*R-p*O)*z,r):null},m.determinant=function(r){return r[0]*r[3]-r[1]*r[2]},m.multiply=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=a[3],O=a[4],z=a[5],N=p[0],P=p[1],F=p[2],K=p[3],B=p[4],V=p[5];return r[0]=E*N+w*P,r[1]=S*N+R*P,r[2]=E*F+w*K,r[3]=S*F+R*K,r[4]=E*B+w*V+O,r[5]=S*B+R*V+z,r},m.mul=m.multiply,m.rotate=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=a[3],O=a[4],z=a[5],N=Math.sin(p),P=Math.cos(p);return r[0]=E*P+w*N,r[1]=S*P+R*N,r[2]=E*-N+w*P,r[3]=S*-N+R*P,r[4]=O,r[5]=z,r},m.scale=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=a[3],O=a[4],z=a[5],N=p[0],P=p[1];return r[0]=E*N,r[1]=S*N,r[2]=w*P,r[3]=R*P,r[4]=O,r[5]=z,r},m.translate=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=a[3],O=a[4],z=a[5],N=p[0],P=p[1];return r[0]=E,r[1]=S,r[2]=w,r[3]=R,r[4]=E*N+w*P+O,r[5]=S*N+R*P+z,r},m.str=function(r){return"mat2d("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+")"},m.frob=function(r){return Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)+Math.pow(r[2],2)+Math.pow(r[3],2)+Math.pow(r[4],2)+Math.pow(r[5],2)+1)},typeof L!="undefined"&&(L.mat2d=m);var _={};_.create=function(){var r=new s(9);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r},_.fromMat4=function(r,a){return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[4],r[4]=a[5],r[5]=a[6],r[6]=a[8],r[7]=a[9],r[8]=a[10],r},_.clone=function(r){var a=new s(9);return a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],a[4]=r[4],a[5]=r[5],a[6]=r[6],a[7]=r[7],a[8]=r[8],a},_.copy=function(r,a){return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r[4]=a[4],r[5]=a[5],r[6]=a[6],r[7]=a[7],r[8]=a[8],r},_.identity=function(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r},_.transpose=function(r,a){if(r===a){var p=a[1],E=a[2],S=a[5];r[1]=a[3],r[2]=a[6],r[3]=p,r[5]=a[7],r[6]=E,r[7]=S}else r[0]=a[0],r[1]=a[3],r[2]=a[6],r[3]=a[1],r[4]=a[4],r[5]=a[7],r[6]=a[2],r[7]=a[5],r[8]=a[8];return r},_.invert=function(r,a){var p=a[0],E=a[1],S=a[2],w=a[3],R=a[4],O=a[5],z=a[6],N=a[7],P=a[8],F=P*R-O*N,K=-P*w+O*z,B=N*w-R*z,V=p*F+E*K+S*B;return V?(V=1/V,r[0]=F*V,r[1]=(-P*E+S*N)*V,r[2]=(O*E-S*R)*V,r[3]=K*V,r[4]=(P*p-S*z)*V,r[5]=(-O*p+S*w)*V,r[6]=B*V,r[7]=(-N*p+E*z)*V,r[8]=(R*p-E*w)*V,r):null},_.adjoint=function(r,a){var p=a[0],E=a[1],S=a[2],w=a[3],R=a[4],O=a[5],z=a[6],N=a[7],P=a[8];return r[0]=R*P-O*N,r[1]=S*N-E*P,r[2]=E*O-S*R,r[3]=O*z-w*P,r[4]=p*P-S*z,r[5]=S*w-p*O,r[6]=w*N-R*z,r[7]=E*z-p*N,r[8]=p*R-E*w,r},_.determinant=function(r){var a=r[0],p=r[1],E=r[2],S=r[3],w=r[4],R=r[5],O=r[6],z=r[7],N=r[8];return a*(N*w-R*z)+p*(-N*S+R*O)+E*(z*S-w*O)},_.multiply=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=a[3],O=a[4],z=a[5],N=a[6],P=a[7],F=a[8],K=p[0],B=p[1],V=p[2],C=p[3],M=p[4],H=p[5],$=p[6],q=p[7],se=p[8];return r[0]=K*E+B*R+V*N,r[1]=K*S+B*O+V*P,r[2]=K*w+B*z+V*F,r[3]=C*E+M*R+H*N,r[4]=C*S+M*O+H*P,r[5]=C*w+M*z+H*F,r[6]=$*E+q*R+se*N,r[7]=$*S+q*O+se*P,r[8]=$*w+q*z+se*F,r},_.mul=_.multiply,_.translate=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=a[3],O=a[4],z=a[5],N=a[6],P=a[7],F=a[8],K=p[0],B=p[1];return r[0]=E,r[1]=S,r[2]=w,r[3]=R,r[4]=O,r[5]=z,r[6]=K*E+B*R+N,r[7]=K*S+B*O+P,r[8]=K*w+B*z+F,r},_.rotate=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=a[3],O=a[4],z=a[5],N=a[6],P=a[7],F=a[8],K=Math.sin(p),B=Math.cos(p);return r[0]=B*E+K*R,r[1]=B*S+K*O,r[2]=B*w+K*z,r[3]=B*R-K*E,r[4]=B*O-K*S,r[5]=B*z-K*w,r[6]=N,r[7]=P,r[8]=F,r},_.scale=function(r,a,p){var E=p[0],S=p[1];return r[0]=E*a[0],r[1]=E*a[1],r[2]=E*a[2],r[3]=S*a[3],r[4]=S*a[4],r[5]=S*a[5],r[6]=a[6],r[7]=a[7],r[8]=a[8],r},_.fromMat2d=function(r,a){return r[0]=a[0],r[1]=a[1],r[2]=0,r[3]=a[2],r[4]=a[3],r[5]=0,r[6]=a[4],r[7]=a[5],r[8]=1,r},_.fromQuat=function(r,a){var p=a[0],E=a[1],S=a[2],w=a[3],R=p+p,O=E+E,z=S+S,N=p*R,P=E*R,F=E*O,K=S*R,B=S*O,V=S*z,C=w*R,M=w*O,H=w*z;return r[0]=1-F-V,r[3]=P-H,r[6]=K+M,r[1]=P+H,r[4]=1-N-V,r[7]=B-C,r[2]=K-M,r[5]=B+C,r[8]=1-N-F,r},_.normalFromMat4=function(r,a){var p=a[0],E=a[1],S=a[2],w=a[3],R=a[4],O=a[5],z=a[6],N=a[7],P=a[8],F=a[9],K=a[10],B=a[11],V=a[12],C=a[13],M=a[14],H=a[15],$=p*O-E*R,q=p*z-S*R,se=p*N-w*R,ue=E*z-S*O,pe=E*N-w*O,xe=S*N-w*z,De=P*C-F*V,Ue=P*M-K*V,Ge=P*H-B*V,Ae=F*M-K*C,We=F*H-B*C,we=K*H-B*M,Se=$*we-q*We+se*Ae+ue*Ge-pe*Ue+xe*De;return Se?(Se=1/Se,r[0]=(O*we-z*We+N*Ae)*Se,r[1]=(z*Ge-R*we-N*Ue)*Se,r[2]=(R*We-O*Ge+N*De)*Se,r[3]=(S*We-E*we-w*Ae)*Se,r[4]=(p*we-S*Ge+w*Ue)*Se,r[5]=(E*Ge-p*We-w*De)*Se,r[6]=(C*xe-M*pe+H*ue)*Se,r[7]=(M*se-V*xe-H*q)*Se,r[8]=(V*pe-C*se+H*$)*Se,r):null},_.str=function(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"},_.frob=function(r){return Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)+Math.pow(r[2],2)+Math.pow(r[3],2)+Math.pow(r[4],2)+Math.pow(r[5],2)+Math.pow(r[6],2)+Math.pow(r[7],2)+Math.pow(r[8],2))},typeof L!="undefined"&&(L.mat3=_);var h={};h.create=function(){var r=new s(16);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},h.clone=function(r){var a=new s(16);return a[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],a[4]=r[4],a[5]=r[5],a[6]=r[6],a[7]=r[7],a[8]=r[8],a[9]=r[9],a[10]=r[10],a[11]=r[11],a[12]=r[12],a[13]=r[13],a[14]=r[14],a[15]=r[15],a},h.copy=function(r,a){return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r[4]=a[4],r[5]=a[5],r[6]=a[6],r[7]=a[7],r[8]=a[8],r[9]=a[9],r[10]=a[10],r[11]=a[11],r[12]=a[12],r[13]=a[13],r[14]=a[14],r[15]=a[15],r},h.identity=function(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},h.transpose=function(r,a){if(r===a){var p=a[1],E=a[2],S=a[3],w=a[6],R=a[7],O=a[11];r[1]=a[4],r[2]=a[8],r[3]=a[12],r[4]=p,r[6]=a[9],r[7]=a[13],r[8]=E,r[9]=w,r[11]=a[14],r[12]=S,r[13]=R,r[14]=O}else r[0]=a[0],r[1]=a[4],r[2]=a[8],r[3]=a[12],r[4]=a[1],r[5]=a[5],r[6]=a[9],r[7]=a[13],r[8]=a[2],r[9]=a[6],r[10]=a[10],r[11]=a[14],r[12]=a[3],r[13]=a[7],r[14]=a[11],r[15]=a[15];return r},h.invert=function(r,a){var p=a[0],E=a[1],S=a[2],w=a[3],R=a[4],O=a[5],z=a[6],N=a[7],P=a[8],F=a[9],K=a[10],B=a[11],V=a[12],C=a[13],M=a[14],H=a[15],$=p*O-E*R,q=p*z-S*R,se=p*N-w*R,ue=E*z-S*O,pe=E*N-w*O,xe=S*N-w*z,De=P*C-F*V,Ue=P*M-K*V,Ge=P*H-B*V,Ae=F*M-K*C,We=F*H-B*C,we=K*H-B*M,Se=$*we-q*We+se*Ae+ue*Ge-pe*Ue+xe*De;return Se?(Se=1/Se,r[0]=(O*we-z*We+N*Ae)*Se,r[1]=(S*We-E*we-w*Ae)*Se,r[2]=(C*xe-M*pe+H*ue)*Se,r[3]=(K*pe-F*xe-B*ue)*Se,r[4]=(z*Ge-R*we-N*Ue)*Se,r[5]=(p*we-S*Ge+w*Ue)*Se,r[6]=(M*se-V*xe-H*q)*Se,r[7]=(P*xe-K*se+B*q)*Se,r[8]=(R*We-O*Ge+N*De)*Se,r[9]=(E*Ge-p*We-w*De)*Se,r[10]=(V*pe-C*se+H*$)*Se,r[11]=(F*se-P*pe-B*$)*Se,r[12]=(O*Ue-R*Ae-z*De)*Se,r[13]=(p*Ae-E*Ue+S*De)*Se,r[14]=(C*q-V*ue-M*$)*Se,r[15]=(P*ue-F*q+K*$)*Se,r):null},h.adjoint=function(r,a){var p=a[0],E=a[1],S=a[2],w=a[3],R=a[4],O=a[5],z=a[6],N=a[7],P=a[8],F=a[9],K=a[10],B=a[11],V=a[12],C=a[13],M=a[14],H=a[15];return r[0]=O*(K*H-B*M)-F*(z*H-N*M)+C*(z*B-N*K),r[1]=-(E*(K*H-B*M)-F*(S*H-w*M)+C*(S*B-w*K)),r[2]=E*(z*H-N*M)-O*(S*H-w*M)+C*(S*N-w*z),r[3]=-(E*(z*B-N*K)-O*(S*B-w*K)+F*(S*N-w*z)),r[4]=-(R*(K*H-B*M)-P*(z*H-N*M)+V*(z*B-N*K)),r[5]=p*(K*H-B*M)-P*(S*H-w*M)+V*(S*B-w*K),r[6]=-(p*(z*H-N*M)-R*(S*H-w*M)+V*(S*N-w*z)),r[7]=p*(z*B-N*K)-R*(S*B-w*K)+P*(S*N-w*z),r[8]=R*(F*H-B*C)-P*(O*H-N*C)+V*(O*B-N*F),r[9]=-(p*(F*H-B*C)-P*(E*H-w*C)+V*(E*B-w*F)),r[10]=p*(O*H-N*C)-R*(E*H-w*C)+V*(E*N-w*O),r[11]=-(p*(O*B-N*F)-R*(E*B-w*F)+P*(E*N-w*O)),r[12]=-(R*(F*M-K*C)-P*(O*M-z*C)+V*(O*K-z*F)),r[13]=p*(F*M-K*C)-P*(E*M-S*C)+V*(E*K-S*F),r[14]=-(p*(O*M-z*C)-R*(E*M-S*C)+V*(E*z-S*O)),r[15]=p*(O*K-z*F)-R*(E*K-S*F)+P*(E*z-S*O),r},h.determinant=function(r){var a=r[0],p=r[1],E=r[2],S=r[3],w=r[4],R=r[5],O=r[6],z=r[7],N=r[8],P=r[9],F=r[10],K=r[11],B=r[12],V=r[13],C=r[14],M=r[15],H=a*R-p*w,$=a*O-E*w,q=a*z-S*w,se=p*O-E*R,ue=p*z-S*R,pe=E*z-S*O,xe=N*V-P*B,De=N*C-F*B,Ue=N*M-K*B,Ge=P*C-F*V,Ae=P*M-K*V,We=F*M-K*C;return H*We-$*Ae+q*Ge+se*Ue-ue*De+pe*xe},h.multiply=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=a[3],O=a[4],z=a[5],N=a[6],P=a[7],F=a[8],K=a[9],B=a[10],V=a[11],C=a[12],M=a[13],H=a[14],$=a[15],q=p[0],se=p[1],ue=p[2],pe=p[3];return r[0]=q*E+se*O+ue*F+pe*C,r[1]=q*S+se*z+ue*K+pe*M,r[2]=q*w+se*N+ue*B+pe*H,r[3]=q*R+se*P+ue*V+pe*$,q=p[4],se=p[5],ue=p[6],pe=p[7],r[4]=q*E+se*O+ue*F+pe*C,r[5]=q*S+se*z+ue*K+pe*M,r[6]=q*w+se*N+ue*B+pe*H,r[7]=q*R+se*P+ue*V+pe*$,q=p[8],se=p[9],ue=p[10],pe=p[11],r[8]=q*E+se*O+ue*F+pe*C,r[9]=q*S+se*z+ue*K+pe*M,r[10]=q*w+se*N+ue*B+pe*H,r[11]=q*R+se*P+ue*V+pe*$,q=p[12],se=p[13],ue=p[14],pe=p[15],r[12]=q*E+se*O+ue*F+pe*C,r[13]=q*S+se*z+ue*K+pe*M,r[14]=q*w+se*N+ue*B+pe*H,r[15]=q*R+se*P+ue*V+pe*$,r},h.multiplyAffine=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=a[4],O=a[5],z=a[6],N=a[8],P=a[9],F=a[10],K=a[12],B=a[13],V=a[14],C=p[0],M=p[1],H=p[2];return r[0]=C*E+M*R+H*N,r[1]=C*S+M*O+H*P,r[2]=C*w+M*z+H*F,C=p[4],M=p[5],H=p[6],r[4]=C*E+M*R+H*N,r[5]=C*S+M*O+H*P,r[6]=C*w+M*z+H*F,C=p[8],M=p[9],H=p[10],r[8]=C*E+M*R+H*N,r[9]=C*S+M*O+H*P,r[10]=C*w+M*z+H*F,C=p[12],M=p[13],H=p[14],r[12]=C*E+M*R+H*N+K,r[13]=C*S+M*O+H*P+B,r[14]=C*w+M*z+H*F+V,r},h.mul=h.multiply,h.mulAffine=h.multiplyAffine,h.translate=function(r,a,p){var E=p[0],S=p[1],w=p[2],R,O,z,N,P,F,K,B,V,C,M,H;return a===r?(r[12]=a[0]*E+a[4]*S+a[8]*w+a[12],r[13]=a[1]*E+a[5]*S+a[9]*w+a[13],r[14]=a[2]*E+a[6]*S+a[10]*w+a[14],r[15]=a[3]*E+a[7]*S+a[11]*w+a[15]):(R=a[0],O=a[1],z=a[2],N=a[3],P=a[4],F=a[5],K=a[6],B=a[7],V=a[8],C=a[9],M=a[10],H=a[11],r[0]=R,r[1]=O,r[2]=z,r[3]=N,r[4]=P,r[5]=F,r[6]=K,r[7]=B,r[8]=V,r[9]=C,r[10]=M,r[11]=H,r[12]=R*E+P*S+V*w+a[12],r[13]=O*E+F*S+C*w+a[13],r[14]=z*E+K*S+M*w+a[14],r[15]=N*E+B*S+H*w+a[15]),r},h.scale=function(r,a,p){var E=p[0],S=p[1],w=p[2];return r[0]=a[0]*E,r[1]=a[1]*E,r[2]=a[2]*E,r[3]=a[3]*E,r[4]=a[4]*S,r[5]=a[5]*S,r[6]=a[6]*S,r[7]=a[7]*S,r[8]=a[8]*w,r[9]=a[9]*w,r[10]=a[10]*w,r[11]=a[11]*w,r[12]=a[12],r[13]=a[13],r[14]=a[14],r[15]=a[15],r},h.rotate=function(r,a,p,E){var S=E[0],w=E[1],R=E[2],O=Math.sqrt(S*S+w*w+R*R),z,N,P,F,K,B,V,C,M,H,$,q,se,ue,pe,xe,De,Ue,Ge,Ae,We,we,Se,ge;return Math.abs(O)<A?null:(O=1/O,S*=O,w*=O,R*=O,z=Math.sin(p),N=Math.cos(p),P=1-N,F=a[0],K=a[1],B=a[2],V=a[3],C=a[4],M=a[5],H=a[6],$=a[7],q=a[8],se=a[9],ue=a[10],pe=a[11],xe=S*S*P+N,De=w*S*P+R*z,Ue=R*S*P-w*z,Ge=S*w*P-R*z,Ae=w*w*P+N,We=R*w*P+S*z,we=S*R*P+w*z,Se=w*R*P-S*z,ge=R*R*P+N,r[0]=F*xe+C*De+q*Ue,r[1]=K*xe+M*De+se*Ue,r[2]=B*xe+H*De+ue*Ue,r[3]=V*xe+$*De+pe*Ue,r[4]=F*Ge+C*Ae+q*We,r[5]=K*Ge+M*Ae+se*We,r[6]=B*Ge+H*Ae+ue*We,r[7]=V*Ge+$*Ae+pe*We,r[8]=F*we+C*Se+q*ge,r[9]=K*we+M*Se+se*ge,r[10]=B*we+H*Se+ue*ge,r[11]=V*we+$*Se+pe*ge,a!==r&&(r[12]=a[12],r[13]=a[13],r[14]=a[14],r[15]=a[15]),r)},h.rotateX=function(r,a,p){var E=Math.sin(p),S=Math.cos(p),w=a[4],R=a[5],O=a[6],z=a[7],N=a[8],P=a[9],F=a[10],K=a[11];return a!==r&&(r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r[12]=a[12],r[13]=a[13],r[14]=a[14],r[15]=a[15]),r[4]=w*S+N*E,r[5]=R*S+P*E,r[6]=O*S+F*E,r[7]=z*S+K*E,r[8]=N*S-w*E,r[9]=P*S-R*E,r[10]=F*S-O*E,r[11]=K*S-z*E,r},h.rotateY=function(r,a,p){var E=Math.sin(p),S=Math.cos(p),w=a[0],R=a[1],O=a[2],z=a[3],N=a[8],P=a[9],F=a[10],K=a[11];return a!==r&&(r[4]=a[4],r[5]=a[5],r[6]=a[6],r[7]=a[7],r[12]=a[12],r[13]=a[13],r[14]=a[14],r[15]=a[15]),r[0]=w*S-N*E,r[1]=R*S-P*E,r[2]=O*S-F*E,r[3]=z*S-K*E,r[8]=w*E+N*S,r[9]=R*E+P*S,r[10]=O*E+F*S,r[11]=z*E+K*S,r},h.rotateZ=function(r,a,p){var E=Math.sin(p),S=Math.cos(p),w=a[0],R=a[1],O=a[2],z=a[3],N=a[4],P=a[5],F=a[6],K=a[7];return a!==r&&(r[8]=a[8],r[9]=a[9],r[10]=a[10],r[11]=a[11],r[12]=a[12],r[13]=a[13],r[14]=a[14],r[15]=a[15]),r[0]=w*S+N*E,r[1]=R*S+P*E,r[2]=O*S+F*E,r[3]=z*S+K*E,r[4]=N*S-w*E,r[5]=P*S-R*E,r[6]=F*S-O*E,r[7]=K*S-z*E,r},h.fromRotationTranslation=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=a[3],O=E+E,z=S+S,N=w+w,P=E*O,F=E*z,K=E*N,B=S*z,V=S*N,C=w*N,M=R*O,H=R*z,$=R*N;return r[0]=1-(B+C),r[1]=F+$,r[2]=K-H,r[3]=0,r[4]=F-$,r[5]=1-(P+C),r[6]=V+M,r[7]=0,r[8]=K+H,r[9]=V-M,r[10]=1-(P+B),r[11]=0,r[12]=p[0],r[13]=p[1],r[14]=p[2],r[15]=1,r},h.fromQuat=function(r,a){var p=a[0],E=a[1],S=a[2],w=a[3],R=p+p,O=E+E,z=S+S,N=p*R,P=E*R,F=E*O,K=S*R,B=S*O,V=S*z,C=w*R,M=w*O,H=w*z;return r[0]=1-F-V,r[1]=P+H,r[2]=K-M,r[3]=0,r[4]=P-H,r[5]=1-N-V,r[6]=B+C,r[7]=0,r[8]=K+M,r[9]=B-C,r[10]=1-N-F,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},h.frustum=function(r,a,p,E,S,w,R){var O=1/(p-a),z=1/(S-E),N=1/(w-R);return r[0]=w*2*O,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=w*2*z,r[6]=0,r[7]=0,r[8]=(p+a)*O,r[9]=(S+E)*z,r[10]=(R+w)*N,r[11]=-1,r[12]=0,r[13]=0,r[14]=R*w*2*N,r[15]=0,r},h.perspective=function(r,a,p,E,S){var w=1/Math.tan(a/2),R=1/(E-S);return r[0]=w/p,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=w,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=(S+E)*R,r[11]=-1,r[12]=0,r[13]=0,r[14]=2*S*E*R,r[15]=0,r},h.ortho=function(r,a,p,E,S,w,R){var O=1/(a-p),z=1/(E-S),N=1/(w-R);return r[0]=-2*O,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*z,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*N,r[11]=0,r[12]=(a+p)*O,r[13]=(S+E)*z,r[14]=(R+w)*N,r[15]=1,r},h.lookAt=function(r,a,p,E){var S,w,R,O,z,N,P,F,K,B,V=a[0],C=a[1],M=a[2],H=E[0],$=E[1],q=E[2],se=p[0],ue=p[1],pe=p[2];return Math.abs(V-se)<A&&Math.abs(C-ue)<A&&Math.abs(M-pe)<A?h.identity(r):(P=V-se,F=C-ue,K=M-pe,B=1/Math.sqrt(P*P+F*F+K*K),P*=B,F*=B,K*=B,S=$*K-q*F,w=q*P-H*K,R=H*F-$*P,B=Math.sqrt(S*S+w*w+R*R),B?(B=1/B,S*=B,w*=B,R*=B):(S=0,w=0,R=0),O=F*R-K*w,z=K*S-P*R,N=P*w-F*S,B=Math.sqrt(O*O+z*z+N*N),B?(B=1/B,O*=B,z*=B,N*=B):(O=0,z=0,N=0),r[0]=S,r[1]=O,r[2]=P,r[3]=0,r[4]=w,r[5]=z,r[6]=F,r[7]=0,r[8]=R,r[9]=N,r[10]=K,r[11]=0,r[12]=-(S*V+w*C+R*M),r[13]=-(O*V+z*C+N*M),r[14]=-(P*V+F*C+K*M),r[15]=1,r)},h.str=function(r){return"mat4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+", "+r[9]+", "+r[10]+", "+r[11]+", "+r[12]+", "+r[13]+", "+r[14]+", "+r[15]+")"},h.frob=function(r){return Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)+Math.pow(r[2],2)+Math.pow(r[3],2)+Math.pow(r[4],2)+Math.pow(r[5],2)+Math.pow(r[6],2)+Math.pow(r[7],2)+Math.pow(r[8],2)+Math.pow(r[9],2)+Math.pow(r[10],2)+Math.pow(r[11],2)+Math.pow(r[12],2)+Math.pow(r[13],2)+Math.pow(r[14],2)+Math.pow(r[15],2))},typeof L!="undefined"&&(L.mat4=h);var v={};v.create=function(){var r=new s(4);return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r},v.rotationTo=function(){var r=i.create(),a=i.fromValues(1,0,0),p=i.fromValues(0,1,0);return function(E,S,w){var R=i.dot(S,w);return R<-.999999?(i.cross(r,a,S),i.length(r)<1e-6&&i.cross(r,p,S),i.normalize(r,r),v.setAxisAngle(E,r,Math.PI),E):R>.999999?(E[0]=0,E[1]=0,E[2]=0,E[3]=1,E):(i.cross(r,S,w),E[0]=r[0],E[1]=r[1],E[2]=r[2],E[3]=1+R,v.normalize(E,E))}}(),v.setAxes=function(){var r=_.create();return function(a,p,E,S){return r[0]=E[0],r[3]=E[1],r[6]=E[2],r[1]=S[0],r[4]=S[1],r[7]=S[2],r[2]=-p[0],r[5]=-p[1],r[8]=-p[2],v.normalize(a,v.fromMat3(a,r))}}(),v.clone=o.clone,v.fromValues=o.fromValues,v.copy=o.copy,v.set=o.set,v.identity=function(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r},v.setAxisAngle=function(r,a,p){p=p*.5;var E=Math.sin(p);return r[0]=E*a[0],r[1]=E*a[1],r[2]=E*a[2],r[3]=Math.cos(p),r},v.add=o.add,v.multiply=function(r,a,p){var E=a[0],S=a[1],w=a[2],R=a[3],O=p[0],z=p[1],N=p[2],P=p[3];return r[0]=E*P+R*O+S*N-w*z,r[1]=S*P+R*z+w*O-E*N,r[2]=w*P+R*N+E*z-S*O,r[3]=R*P-E*O-S*z-w*N,r},v.mul=v.multiply,v.scale=o.scale,v.rotateX=function(r,a,p){p*=.5;var E=a[0],S=a[1],w=a[2],R=a[3],O=Math.sin(p),z=Math.cos(p);return r[0]=E*z+R*O,r[1]=S*z+w*O,r[2]=w*z-S*O,r[3]=R*z-E*O,r},v.rotateY=function(r,a,p){p*=.5;var E=a[0],S=a[1],w=a[2],R=a[3],O=Math.sin(p),z=Math.cos(p);return r[0]=E*z-w*O,r[1]=S*z+R*O,r[2]=w*z+E*O,r[3]=R*z-S*O,r},v.rotateZ=function(r,a,p){p*=.5;var E=a[0],S=a[1],w=a[2],R=a[3],O=Math.sin(p),z=Math.cos(p);return r[0]=E*z+S*O,r[1]=S*z-E*O,r[2]=w*z+R*O,r[3]=R*z-w*O,r},v.calculateW=function(r,a){var p=a[0],E=a[1],S=a[2];return r[0]=p,r[1]=E,r[2]=S,r[3]=Math.sqrt(Math.abs(1-p*p-E*E-S*S)),r},v.dot=o.dot,v.lerp=o.lerp,v.slerp=function(r,a,p,E){var S=a[0],w=a[1],R=a[2],O=a[3],z=p[0],N=p[1],P=p[2],F=p[3],K,B,V,C,M;return B=S*z+w*N+R*P+O*F,B<0&&(B=-B,z=-z,N=-N,P=-P,F=-F),1-B>1e-6?(K=Math.acos(B),V=Math.sin(K),C=Math.sin((1-E)*K)/V,M=Math.sin(E*K)/V):(C=1-E,M=E),r[0]=C*S+M*z,r[1]=C*w+M*N,r[2]=C*R+M*P,r[3]=C*O+M*F,r},v.invert=function(r,a){var p=a[0],E=a[1],S=a[2],w=a[3],R=p*p+E*E+S*S+w*w,O=R?1/R:0;return r[0]=-p*O,r[1]=-E*O,r[2]=-S*O,r[3]=w*O,r},v.conjugate=function(r,a){return r[0]=-a[0],r[1]=-a[1],r[2]=-a[2],r[3]=a[3],r},v.length=o.length,v.len=v.length,v.squaredLength=o.squaredLength,v.sqrLen=v.squaredLength,v.normalize=o.normalize,v.fromMat3=function(r,a){var p=a[0]+a[4]+a[8],E;if(p>0)E=Math.sqrt(p+1),r[3]=.5*E,E=.5/E,r[0]=(a[5]-a[7])*E,r[1]=(a[6]-a[2])*E,r[2]=(a[1]-a[3])*E;else{var S=0;a[4]>a[0]&&(S=1),a[8]>a[S*3+S]&&(S=2);var w=(S+1)%3,R=(S+2)%3;E=Math.sqrt(a[S*3+S]-a[w*3+w]-a[R*3+R]+1),r[S]=.5*E,E=.5/E,r[3]=(a[w*3+R]-a[R*3+w])*E,r[w]=(a[w*3+S]+a[S*3+w])*E,r[R]=(a[R*3+S]+a[S*3+R])*E}return r},v.str=function(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"},typeof L!="undefined"&&(L.quat=v)}(y.exports)})(this)},function(re,X,D){"use strict";var W=D(24),y=D(46),L=D(5),A=D(6),s=D(7),x=D(17),c=D(28),u=D(13),f=D(0),i=D.n(f),o=D(29),d=D(53),m=D.n(d),_=D(54),h=D(106),v=D(107),r=D(113),a=D(114),p=D(3),E=D(68),S=D(37),w=D(69),R=D(116),O=D(70),z=D(71),N=D(72),P=D(36),F=D(30),K=D(23),B=D(4),V=D(117),C=D(50),M=D(118),H=D(119),$=D(120),q=D(9),se=D(67),ue=D(49),pe=D(15),xe=D(52),De=D(121),Ue=D(126),Ge=D(63),Ae=D(127),We=D(128),we=D(129),Se=D(130),ge=D(131),Re=D(132);i.a.util.extend(c.a.prototype,De.a),s.a.import(Ue.a),s.a.import(Ge.a),s.a.import(Ae.a),s.a.import(We.a),s.a.import(we.a),s.a.import(Se.a),s.a.import(ge.a),s.a.import(Re.a);function ve(Te){return!Te||Te==="none"}function Le(Te){return Te instanceof HTMLCanvasElement||Te instanceof HTMLImageElement||Te instanceof Image}function Fe(Te){return Te.getZr&&Te.setOption}var me=o.a.prototype.addToScene,oe=o.a.prototype.removeFromScene;o.a.prototype.addToScene=function(Te){if(me.call(this,Te),this.__zr){var Oe=this.__zr;Te.traverse(function(Be){Be.__zr=Oe,Be.addAnimatorsToZr&&Be.addAnimatorsToZr(Oe)})}},o.a.prototype.removeFromScene=function(Te){oe.call(this,Te),Te.traverse(function(Oe){var Be=Oe.__zr;Oe.__zr=null,Be&&Oe.removeAnimatorsFromZr&&Oe.removeAnimatorsFromZr(Be)})},x.a.prototype.setTextureImage=function(Te,Oe,Be,Ze){if(this.shader){var tt=Be.getZr(),dt=this,nt;return dt.autoUpdateTextureStatus=!1,dt.disableTexture(Te),ve(Oe)||(nt=ie.loadTexture(Oe,Be,Ze,function(At){dt.enableTexture(Te),tt&&tt.refresh()}),dt.set(Te,nt)),nt}};var ie={};ie.Renderer=y.a,ie.Node=c.a,ie.Mesh=W.a,ie.Shader=s.a,ie.Material=x.a,ie.Texture=A.a,ie.Texture2D=L.a,ie.Geometry=u.a,ie.SphereGeometry=E.a,ie.PlaneGeometry=S.a,ie.CubeGeometry=w.a,ie.AmbientLight=R.a,ie.DirectionalLight=O.a,ie.PointLight=z.a,ie.SpotLight=N.a,ie.PerspectiveCamera=P.a,ie.OrthographicCamera=F.a,ie.Vector2=K.a,ie.Vector3=B.a,ie.Vector4=V.a,ie.Quaternion=C.a,ie.Matrix2=M.a,ie.Matrix2d=H.a,ie.Matrix3=$.a,ie.Matrix4=q.a,ie.Plane=se.a,ie.Ray=ue.a,ie.BoundingBox=pe.a,ie.Frustum=xe.a;var fe=_.a.createBlank("rgba(255,255,255,0)").image;function ye(Te){return Math.pow(2,Math.round(Math.log(Te)/Math.LN2))}function he(Te){if((Te.wrapS===A.a.REPEAT||Te.wrapT===A.a.REPEAT)&&Te.image){var Oe=ye(Te.width),Be=ye(Te.height);if(Oe!==Te.width||Be!==Te.height){var Ze=document.createElement("canvas");Ze.width=Oe,Ze.height=Be;var tt=Ze.getContext("2d");tt.drawImage(Te.image,0,0,Oe,Be),Te.image=Ze}}}ie.loadTexture=function(Te,Oe,Be,Ze){typeof Be=="function"&&(Ze=Be,Be={}),Be=Be||{};for(var tt=Object.keys(Be).sort(),dt="",nt=0;nt<tt.length;nt++)dt+=tt[nt]+"_"+Be[tt[nt]]+"_";var At=Oe.__textureCache=Oe.__textureCache||new m.a(20);if(Fe(Te)){var Nt=Te.__textureid__,Bt=At.get(dt+Nt);if(Bt)Bt.texture.surface.setECharts(Te),Ze&&Ze(Bt.texture);else{var st=new h.a(Te);st.onupdate=function(){Oe.getZr().refresh()},Bt={texture:st.getTexture()};for(var nt=0;nt<tt.length;nt++)Bt.texture[tt[nt]]=Be[tt[nt]];Nt=Te.__textureid__||"__ecgl_ec__"+Bt.texture.__uid__,Te.__textureid__=Nt,At.put(dt+Nt,Bt),Ze&&Ze(Bt.texture)}return Bt.texture}else if(Le(Te)){var Nt=Te.__textureid__,Bt=At.get(dt+Nt);if(!Bt){Bt={texture:new ie.Texture2D({image:Te})};for(var nt=0;nt<tt.length;nt++)Bt.texture[tt[nt]]=Be[tt[nt]];Nt=Te.__textureid__||"__ecgl_image__"+Bt.texture.__uid__,Te.__textureid__=Nt,At.put(dt+Nt,Bt),he(Bt.texture),Ze&&Ze(Bt.texture)}return Bt.texture}else{var Bt=At.get(dt+Te);if(Bt)Bt.callbacks?Bt.callbacks.push(Ze):Ze&&Ze(Bt.texture);else if(Te.match(/.hdr$|^data:application\/octet-stream/)){Bt={callbacks:[Ze]};var Ot=_.a.loadTexture(Te,{exposure:Be.exposure,fileType:"hdr"},function(){Ot.dirty(),Bt.callbacks.forEach(function(Qt){Qt&&Qt(Ot)}),Bt.callbacks=null});Bt.texture=Ot,At.put(dt+Te,Bt)}else{for(var Ot=new ie.Texture2D({image:new Image}),nt=0;nt<tt.length;nt++)Ot[tt[nt]]=Be[tt[nt]];Bt={texture:Ot,callbacks:[Ze]};var ur=Ot.image;ur.onload=function(){Ot.image=ur,he(Ot),Ot.dirty(),Bt.callbacks.forEach(function(Fr){Fr&&Fr(Ot)}),Bt.callbacks=null},ur.src=Te,Ot.image=fe,At.put(dt+Te,Bt)}return Bt.texture}},ie.createAmbientCubemap=function(Te,Oe,Be,Ze){Te=Te||{};var tt=Te.texture,dt=p.a.firstNotNull(Te.exposure,1),nt=new v.a({intensity:p.a.firstNotNull(Te.specularIntensity,1)}),At=new r.a({intensity:p.a.firstNotNull(Te.diffuseIntensity,1),coefficients:[.844,.712,.691,-.037,.083,.167,.343,.288,.299,-.041,-.021,-.009,-.003,-.041,-.064,-.011,-.007,-.004,-.031,.034,.081,-.06,-.049,-.06,.046,.056,.05]});return nt.cubemap=ie.loadTexture(tt,Be,{exposure:dt},function(){nt.cubemap.flipY=!1,nt.prefilter(Oe,32),At.coefficients=a.a.projectEnvironmentMap(Oe,nt.cubemap,{lod:1}),Ze&&Ze()}),{specular:nt,diffuse:At}},ie.createBlankTexture=_.a.createBlank,ie.isImage=Le,ie.additiveBlend=function(Te){Te.blendEquation(Te.FUNC_ADD),Te.blendFunc(Te.SRC_ALPHA,Te.ONE)},ie.parseColor=function(Te,Oe){return Te instanceof Array?(Oe||(Oe=[]),Oe[0]=Te[0],Oe[1]=Te[1],Oe[2]=Te[2],Te.length>3?Oe[3]=Te[3]:Oe[3]=1,Oe):(Oe=i.a.color.parse(Te||"#000",Oe)||[0,0,0,0],Oe[0]/=255,Oe[1]/=255,Oe[2]/=255,Oe)},ie.directionFromAlphaBeta=function(Te,Oe){var Be=Te/180*Math.PI+Math.PI/2,Ze=-Oe/180*Math.PI+Math.PI/2,tt=[],dt=Math.sin(Be);return tt[0]=dt*Math.cos(Ze),tt[1]=-Math.cos(Be),tt[2]=dt*Math.sin(Ze),tt},ie.getShadowResolution=function(Te){var Oe=1024;switch(Te){case"low":Oe=512;break;case"medium":break;case"high":Oe=2048;break;case"ultra":Oe=4096;break}return Oe},ie.COMMON_SHADERS=["lambert","color","realistic","hatching"],ie.createShader=function(Te){var Oe=s.a.source(Te+".vertex"),Be=s.a.source(Te+".fragment");Oe||console.error("Vertex shader of '%s' not exits",Te),Be||console.error("Fragment shader of '%s' not exits",Te);var Ze=new s.a(Oe,Be);return Ze.name=Te,Ze},ie.createMaterial=function(Te,Oe){Oe instanceof Array||(Oe=[Oe]);var Be=ie.createShader(Te),Ze=new x.a({shader:Be});return Oe.forEach(function(tt){typeof tt=="string"&&Ze.define(tt)}),Ze},ie.setMaterialFromModel=function(Te,Oe,Be,Ze){Oe.autoUpdateTextureStatus=!1;var tt=Be.getModel(Te+"Material"),dt=tt.get("detailTexture"),nt=p.a.firstNotNull(tt.get("textureTiling"),1),At=p.a.firstNotNull(tt.get("textureOffset"),0);typeof nt=="number"&&(nt=[nt,nt]),typeof At=="number"&&(At=[At,At]);var Nt=nt[0]>1||nt[1]>1?ie.Texture.REPEAT:ie.Texture.CLAMP_TO_EDGE,Bt={anisotropic:8,wrapS:Nt,wrapT:Nt};if(Te==="realistic"){var st=tt.get("roughness"),Ot=tt.get("metalness");Ot!=null?isNaN(Ot)&&(Oe.setTextureImage("metalnessMap",Ot,Ze,Bt),Ot=p.a.firstNotNull(tt.get("metalnessAdjust"),.5)):Ot=0,st!=null?isNaN(st)&&(Oe.setTextureImage("roughnessMap",st,Ze,Bt),st=p.a.firstNotNull(tt.get("roughnessAdjust"),.5)):st=.5;var ur=tt.get("normalTexture");Oe.setTextureImage("detailMap",dt,Ze,Bt),Oe.setTextureImage("normalMap",ur,Ze,Bt),Oe.set({roughness:st,metalness:Ot,detailUvRepeat:nt,detailUvOffset:At})}else if(Te==="lambert")Oe.setTextureImage("detailMap",dt,Ze,Bt),Oe.set({detailUvRepeat:nt,detailUvOffset:At});else if(Te==="color")Oe.setTextureImage("detailMap",dt,Ze,Bt),Oe.set({detailUvRepeat:nt,detailUvOffset:At});else if(Te==="hatching"){var br=tt.get("hatchingTextures")||[];br.length<6&&console.error("Invalid hatchingTextures.");for(var Qt=0;Qt<6;Qt++)Oe.setTextureImage("hatch"+(Qt+1),br[Qt],Ze,{anisotropic:8,wrapS:ie.Texture.REPEAT,wrapT:ie.Texture.REPEAT});Oe.set({detailUvRepeat:nt,detailUvOffset:At})}},ie.updateVertexAnimation=function(Te,Oe,Be,Ze){var tt=Ze.get("animation"),dt=Ze.get("animationDurationUpdate"),nt=Ze.get("animationEasingUpdate"),At=Be.shadowDepthMaterial;if(tt&&Oe&&dt>0&&Oe.geometry.vertexCount===Be.geometry.vertexCount){Be.material.define("vertex","VERTEX_ANIMATION"),Be.ignorePreZ=!0,At&&At.define("vertex","VERTEX_ANIMATION");for(var Nt=0;Nt<Te.length;Nt++)Be.geometry.attributes[Te[Nt][0]].value=Oe.geometry.attributes[Te[Nt][1]].value;Be.geometry.dirty(),Be.__percent=0,Be.material.set("percent",0),Be.stopAnimation(),Be.animate().when(dt,{__percent:1}).during(function(){Be.material.set("percent",Be.__percent),At&&At.set("percent",Be.__percent)}).done(function(){Be.ignorePreZ=!1,Be.material.undefine("vertex","VERTEX_ANIMATION"),At&&At.undefine("vertex","VERTEX_ANIMATION")}).start(nt)}else Be.material.undefine("vertex","VERTEX_ANIMATION"),At&&At.undefine("vertex","VERTEX_ANIMATION")},X.a=ie},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L={firstNotNull:function(){for(var A=0,s=arguments.length;A<s;A++)if(arguments[A]!=null)return arguments[A]},queryDataIndex:function(A,s){if(s.dataIndexInside!=null)return s.dataIndexInside;if(s.dataIndex!=null)return y.a.util.isArray(s.dataIndex)?y.a.util.map(s.dataIndex,function(x){return A.indexOfRawIndex(x)}):A.indexOfRawIndex(s.dataIndex);if(s.name!=null)return y.a.util.isArray(s.name)?y.a.util.map(s.name,function(x){return A.indexOfName(x)}):A.indexOfName(s.name)}};X.a=L},function(re,X,D){"use strict";var W=D(1),y=D.n(W),L=y.a.vec3,A=function(o,d,m){o=o||0,d=d||0,m=m||0,this.array=L.fromValues(o,d,m),this._dirty=!0};A.prototype={constructor:A,add:function(o){return L.add(this.array,this.array,o.array),this._dirty=!0,this},set:function(o,d,m){return this.array[0]=o,this.array[1]=d,this.array[2]=m,this._dirty=!0,this},setArray:function(o){return this.array[0]=o[0],this.array[1]=o[1],this.array[2]=o[2],this._dirty=!0,this},clone:function(){return new A(this.x,this.y,this.z)},copy:function(o){return L.copy(this.array,o.array),this._dirty=!0,this},cross:function(o,d){return L.cross(this.array,o.array,d.array),this._dirty=!0,this},dist:function(o){return L.dist(this.array,o.array)},distance:function(o){return L.distance(this.array,o.array)},div:function(o){return L.div(this.array,this.array,o.array),this._dirty=!0,this},divide:function(o){return L.divide(this.array,this.array,o.array),this._dirty=!0,this},dot:function(o){return L.dot(this.array,o.array)},len:function(){return L.len(this.array)},length:function(){return L.length(this.array)},lerp:function(o,d,m){return L.lerp(this.array,o.array,d.array,m),this._dirty=!0,this},min:function(o){return L.min(this.array,this.array,o.array),this._dirty=!0,this},max:function(o){return L.max(this.array,this.array,o.array),this._dirty=!0,this},mul:function(o){return L.mul(this.array,this.array,o.array),this._dirty=!0,this},multiply:function(o){return L.multiply(this.array,this.array,o.array),this._dirty=!0,this},negate:function(){return L.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return L.normalize(this.array,this.array),this._dirty=!0,this},random:function(o){return L.random(this.array,o),this._dirty=!0,this},scale:function(o){return L.scale(this.array,this.array,o),this._dirty=!0,this},scaleAndAdd:function(o,d){return L.scaleAndAdd(this.array,this.array,o.array,d),this._dirty=!0,this},sqrDist:function(o){return L.sqrDist(this.array,o.array)},squaredDistance:function(o){return L.squaredDistance(this.array,o.array)},sqrLen:function(){return L.sqrLen(this.array)},squaredLength:function(){return L.squaredLength(this.array)},sub:function(o){return L.sub(this.array,this.array,o.array),this._dirty=!0,this},subtract:function(o){return L.subtract(this.array,this.array,o.array),this._dirty=!0,this},transformMat3:function(o){return L.transformMat3(this.array,this.array,o.array),this._dirty=!0,this},transformMat4:function(o){return L.transformMat4(this.array,this.array,o.array),this._dirty=!0,this},transformQuat:function(o){return L.transformQuat(this.array,this.array,o.array),this._dirty=!0,this},applyProjection:function(o){var d=this.array;if(o=o.array,o[15]===0){var m=-1/d[2];d[0]=o[0]*d[0]*m,d[1]=o[5]*d[1]*m,d[2]=(o[10]*d[2]+o[14])*m}else d[0]=o[0]*d[0]+o[12],d[1]=o[5]*d[1]+o[13],d[2]=o[10]*d[2]+o[14];return this._dirty=!0,this},eulerFromQuat:function(o,d){A.eulerFromQuat(this,o,d)},eulerFromMat3:function(o,d){A.eulerFromMat3(this,o,d)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var s=Object.defineProperty;if(s){var x=A.prototype;s(x,"x",{get:function(){return this.array[0]},set:function(o){this.array[0]=o,this._dirty=!0}}),s(x,"y",{get:function(){return this.array[1]},set:function(o){this.array[1]=o,this._dirty=!0}}),s(x,"z",{get:function(){return this.array[2]},set:function(o){this.array[2]=o,this._dirty=!0}})}A.add=function(o,d,m){return L.add(o.array,d.array,m.array),o._dirty=!0,o},A.set=function(o,d,m,_){L.set(o.array,d,m,_),o._dirty=!0},A.copy=function(o,d){return L.copy(o.array,d.array),o._dirty=!0,o},A.cross=function(o,d,m){return L.cross(o.array,d.array,m.array),o._dirty=!0,o},A.dist=function(o,d){return L.distance(o.array,d.array)},A.distance=A.dist,A.div=function(o,d,m){return L.divide(o.array,d.array,m.array),o._dirty=!0,o},A.divide=A.div,A.dot=function(o,d){return L.dot(o.array,d.array)},A.len=function(o){return L.length(o.array)},A.lerp=function(o,d,m,_){return L.lerp(o.array,d.array,m.array,_),o._dirty=!0,o},A.min=function(o,d,m){return L.min(o.array,d.array,m.array),o._dirty=!0,o},A.max=function(o,d,m){return L.max(o.array,d.array,m.array),o._dirty=!0,o},A.mul=function(o,d,m){return L.multiply(o.array,d.array,m.array),o._dirty=!0,o},A.multiply=A.mul,A.negate=function(o,d){return L.negate(o.array,d.array),o._dirty=!0,o},A.normalize=function(o,d){return L.normalize(o.array,d.array),o._dirty=!0,o},A.random=function(o,d){return L.random(o.array,d),o._dirty=!0,o},A.scale=function(o,d,m){return L.scale(o.array,d.array,m),o._dirty=!0,o},A.scaleAndAdd=function(o,d,m,_){return L.scaleAndAdd(o.array,d.array,m.array,_),o._dirty=!0,o},A.sqrDist=function(o,d){return L.sqrDist(o.array,d.array)},A.squaredDistance=A.sqrDist,A.sqrLen=function(o){return L.sqrLen(o.array)},A.squaredLength=A.sqrLen,A.sub=function(o,d,m){return L.subtract(o.array,d.array,m.array),o._dirty=!0,o},A.subtract=A.sub,A.transformMat3=function(o,d,m){return L.transformMat3(o.array,d.array,m.array),o._dirty=!0,o},A.transformMat4=function(o,d,m){return L.transformMat4(o.array,d.array,m.array),o._dirty=!0,o},A.transformQuat=function(o,d,m){return L.transformQuat(o.array,d.array,m.array),o._dirty=!0,o};function c(o,d,m){return o<d?d:o>m?m:o}var u=Math.atan2,f=Math.asin,i=Math.abs;A.eulerFromQuat=function(o,d,R){o._dirty=!0,d=d.array;var _=o.array,h=d[0],v=d[1],r=d[2],a=d[3],p=h*h,E=v*v,S=r*r,w=a*a,R=(R||"XYZ").toUpperCase();switch(R){case"XYZ":_[0]=u(2*(h*a-v*r),w-p-E+S),_[1]=f(c(2*(h*r+v*a),-1,1)),_[2]=u(2*(r*a-h*v),w+p-E-S);break;case"YXZ":_[0]=f(c(2*(h*a-v*r),-1,1)),_[1]=u(2*(h*r+v*a),w-p-E+S),_[2]=u(2*(h*v+r*a),w-p+E-S);break;case"ZXY":_[0]=f(c(2*(h*a+v*r),-1,1)),_[1]=u(2*(v*a-r*h),w-p-E+S),_[2]=u(2*(r*a-h*v),w-p+E-S);break;case"ZYX":_[0]=u(2*(h*a+r*v),w-p-E+S),_[1]=f(c(2*(v*a-h*r),-1,1)),_[2]=u(2*(h*v+r*a),w+p-E-S);break;case"YZX":_[0]=u(2*(h*a-r*v),w-p+E-S),_[1]=u(2*(v*a-h*r),w+p-E-S),_[2]=f(c(2*(h*v+r*a),-1,1));break;case"XZY":_[0]=u(2*(h*a+v*r),w-p+E-S),_[1]=u(2*(h*r+v*a),w+p-E-S),_[2]=f(c(2*(r*a-h*v),-1,1));break;default:console.warn("Unkown order: "+R)}return o},A.eulerFromMat3=function(o,d,z){var _=d.array,h=_[0],v=_[3],r=_[6],a=_[1],p=_[4],E=_[7],S=_[2],w=_[5],R=_[8],O=o.array,z=(z||"XYZ").toUpperCase();switch(z){case"XYZ":O[1]=f(c(r,-1,1)),i(r)<.99999?(O[0]=u(-E,R),O[2]=u(-v,h)):(O[0]=u(w,p),O[2]=0);break;case"YXZ":O[0]=f(-c(E,-1,1)),i(E)<.99999?(O[1]=u(r,R),O[2]=u(a,p)):(O[1]=u(-S,h),O[2]=0);break;case"ZXY":O[0]=f(c(w,-1,1)),i(w)<.99999?(O[1]=u(-S,R),O[2]=u(-v,p)):(O[1]=0,O[2]=u(a,h));break;case"ZYX":O[1]=f(-c(S,-1,1)),i(S)<.99999?(O[0]=u(w,R),O[2]=u(a,h)):(O[0]=0,O[2]=u(-v,p));break;case"YZX":O[2]=f(c(a,-1,1)),i(a)<.99999?(O[0]=u(-E,p),O[1]=u(-S,h)):(O[0]=0,O[1]=u(r,R));break;case"XZY":O[2]=f(-c(v,-1,1)),i(v)<.99999?(O[0]=u(w,p),O[1]=u(r,h)):(O[0]=u(-E,R),O[1]=0);break;default:console.warn("Unkown order: "+z)}return o._dirty=!0,o},A.POSITIVE_X=new A(1,0,0),A.NEGATIVE_X=new A(-1,0,0),A.POSITIVE_Y=new A(0,1,0),A.NEGATIVE_Y=new A(0,-1,0),A.POSITIVE_Z=new A(0,0,1),A.NEGATIVE_Z=new A(0,0,-1),A.UP=new A(0,1,0),A.ZERO=new A(0,0,0),X.a=A},function(re,X,D){"use strict";var W=D(6),y=D(11),L=D(66),A=L.a.isPowerOfTwo,s=W.a.extend(function(){return{image:null,pixels:null,mipmaps:[]}},{update:function(x){var c=x.gl;c.bindTexture(c.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(x);var u=this.format,f=this.type;c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,this.getAvailableWrapS()),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,this.getAvailableWrapT()),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var i=x.getGLExtension("EXT_texture_filter_anisotropic");if(i&&this.anisotropic>1&&c.texParameterf(c.TEXTURE_2D,i.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),f===36193){var o=x.getGLExtension("OES_texture_half_float");o||(f=y.a.FLOAT)}if(this.mipmaps.length)for(var d=this.width,m=this.height,_=0;_<this.mipmaps.length;_++){var h=this.mipmaps[_];this._updateTextureData(c,h,_,d,m,u,f),d/=2,m/=2}else this._updateTextureData(c,this,0,this.width,this.height,u,f),this.useMipmap&&!this.NPOT&&c.generateMipmap(c.TEXTURE_2D);c.bindTexture(c.TEXTURE_2D,null)},_updateTextureData:function(x,c,u,f,i,o,d){c.image?x.texImage2D(x.TEXTURE_2D,u,o,o,d,c.image):o<=W.a.COMPRESSED_RGBA_S3TC_DXT5_EXT&&o>=W.a.COMPRESSED_RGB_S3TC_DXT1_EXT?x.compressedTexImage2D(x.TEXTURE_2D,u,o,f,i,0,c.pixels):x.texImage2D(x.TEXTURE_2D,u,o,f,i,0,o,d,c.pixels)},generateMipmap:function(x){var c=x.gl;this.useMipmap&&!this.NPOT&&(c.bindTexture(c.TEXTURE_2D,this._cache.get("webgl_texture")),c.generateMipmap(c.TEXTURE_2D))},isPowerOfTwo:function(){var x,c;return this.image?(x=this.image.width,c=this.image.height):(x=this.width,c=this.height),A(x)&&A(c)},isRenderable:function(){return this.image?this.image.nodeName==="CANVAS"||this.image.nodeName==="VIDEO"||this.image.complete:!!(this.width&&this.height)},bind:function(x){x.gl.bindTexture(x.gl.TEXTURE_2D,this.getWebGLTexture(x))},unbind:function(x){x.gl.bindTexture(x.gl.TEXTURE_2D,null)},load:function(x,c){var u=new Image;c&&(u.crossOrigin=c);var f=this;return u.onload=function(){f.dirty(),f.trigger("success",f),u.onload=null},u.onerror=function(){f.trigger("error",f),u.onerror=null},u.src=x,this.image=u,this}});Object.defineProperty(s.prototype,"width",{get:function(){return this.image?this.image.width:this._width},set:function(x){this.image?console.warn("Texture from image can't set width"):(this._width!==x&&this.dirty(),this._width=x)}}),Object.defineProperty(s.prototype,"height",{get:function(){return this.image?this.image.height:this._height},set:function(x){this.image?console.warn("Texture from image can't set height"):(this._height!==x&&this.dirty(),this._height=x)}}),X.a=s},function(re,X,D){"use strict";var W=D(8),y=D(11),L=D(48),A=W.a.extend({width:512,height:512,type:y.a.UNSIGNED_BYTE,format:y.a.RGBA,wrapS:y.a.REPEAT,wrapT:y.a.REPEAT,minFilter:y.a.LINEAR_MIPMAP_LINEAR,magFilter:y.a.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,sRGB:!0,unpackAlignment:4,premultiplyAlpha:!1,dynamic:!1,NPOT:!1},function(){this._cache=new L.a},{getWebGLTexture:function(s){var x=s.gl,c=this._cache;return c.use(s.__uid__),c.miss("webgl_texture")&&c.put("webgl_texture",x.createTexture()),this.dynamic?this.update(s):c.isDirty()&&(this.update(s),c.fresh()),c.get("webgl_texture")},bind:function(){},unbind:function(){},dirty:function(){this._cache&&this._cache.dirtyAll()},update:function(s){},updateCommon:function(s){var x=s.gl;x.pixelStorei(x.UNPACK_FLIP_Y_WEBGL,this.flipY),x.pixelStorei(x.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),x.pixelStorei(x.UNPACK_ALIGNMENT,this.unpackAlignment),this.format===y.a.DEPTH_COMPONENT&&(this.useMipmap=!1);var c=s.getGLExtension("EXT_sRGB");this.format===A.SRGB&&!c&&(this.format=A.RGB),this.format===A.SRGB_ALPHA&&!c&&(this.format=A.RGBA),this.NPOT=!this.isPowerOfTwo()},getAvailableWrapS:function(){return this.NPOT?y.a.CLAMP_TO_EDGE:this.wrapS},getAvailableWrapT:function(){return this.NPOT?y.a.CLAMP_TO_EDGE:this.wrapT},getAvailableMinFilter:function(){var s=this.minFilter;return this.NPOT||!this.useMipmap?s==y.a.NEAREST_MIPMAP_NEAREST||s==y.a.NEAREST_MIPMAP_LINEAR?y.a.NEAREST:s==y.a.LINEAR_MIPMAP_LINEAR||s==y.a.LINEAR_MIPMAP_NEAREST?y.a.LINEAR:s:s},getAvailableMagFilter:function(){return this.magFilter},nextHighestPowerOfTwo:function(s){--s;for(var x=1;x<32;x<<=1)s=s|s>>x;return s+1},dispose:function(s){var x=this._cache;x.use(s.__uid__);var c=x.get("webgl_texture");c&&s.gl.deleteTexture(c),x.deleteContext(s.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(A.prototype,"width",{get:function(){return this._width},set:function(s){this._width=s}}),Object.defineProperty(A.prototype,"height",{get:function(){return this._height},set:function(s){this._height=s}}),A.BYTE=y.a.BYTE,A.UNSIGNED_BYTE=y.a.UNSIGNED_BYTE,A.SHORT=y.a.SHORT,A.UNSIGNED_SHORT=y.a.UNSIGNED_SHORT,A.INT=y.a.INT,A.UNSIGNED_INT=y.a.UNSIGNED_INT,A.FLOAT=y.a.FLOAT,A.HALF_FLOAT=36193,A.UNSIGNED_INT_24_8_WEBGL=34042,A.DEPTH_COMPONENT=y.a.DEPTH_COMPONENT,A.DEPTH_STENCIL=y.a.DEPTH_STENCIL,A.ALPHA=y.a.ALPHA,A.RGB=y.a.RGB,A.RGBA=y.a.RGBA,A.LUMINANCE=y.a.LUMINANCE,A.LUMINANCE_ALPHA=y.a.LUMINANCE_ALPHA,A.SRGB=35904,A.SRGB_ALPHA=35906,A.COMPRESSED_RGB_S3TC_DXT1_EXT=33776,A.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777,A.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778,A.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779,A.NEAREST=y.a.NEAREST,A.LINEAR=y.a.LINEAR,A.NEAREST_MIPMAP_NEAREST=y.a.NEAREST_MIPMAP_NEAREST,A.LINEAR_MIPMAP_NEAREST=y.a.LINEAR_MIPMAP_NEAREST,A.NEAREST_MIPMAP_LINEAR=y.a.NEAREST_MIPMAP_LINEAR,A.LINEAR_MIPMAP_LINEAR=y.a.LINEAR_MIPMAP_LINEAR,A.REPEAT=y.a.REPEAT,A.CLAMP_TO_EDGE=y.a.CLAMP_TO_EDGE,A.MIRRORED_REPEAT=y.a.MIRRORED_REPEAT,X.a=A},function(re,X,D){"use strict";var W=D(21),y=D(18),L=D(1),A=D.n(L),s=A.a.mat2,x=A.a.mat3,c=A.a.mat4,u=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\w\,]+)?(\[.*?\])?\s*(:\s*([\S\s]+?))?;/g,f=/attribute\s+(float|int|vec2|vec3|vec4)\s+(\w*)\s*(:\s*(\w+))?;/g,i=/#define\s+(\w+)?(\s+[\w-.]+)?\s*;?\s*\n/g,o={bool:"1i",int:"1i",sampler2D:"t",samplerCube:"t",float:"1f",vec2:"2f",vec3:"3f",vec4:"4f",ivec2:"2i",ivec3:"3i",ivec4:"4i",mat2:"m2",mat3:"m3",mat4:"m4"},d={bool:function(){return!0},int:function(){return 0},float:function(){return 0},sampler2D:function(){return null},samplerCube:function(){return null},vec2:function(){return[0,0]},vec3:function(){return[0,0,0]},vec4:function(){return[0,0,0,0]},ivec2:function(){return[0,0]},ivec3:function(){return[0,0,0]},ivec4:function(){return[0,0,0,0]},mat2:function(){return s.create()},mat3:function(){return x.create()},mat4:function(){return c.create()},array:function(){return[]}},m=["POSITION","NORMAL","BINORMAL","TANGENT","TEXCOORD","TEXCOORD_0","TEXCOORD_1","COLOR","JOINT","WEIGHT"],_=["SKIN_MATRIX","VIEWPORT_SIZE","VIEWPORT","DEVICEPIXELRATIO","WINDOW_SIZE","NEAR","FAR","TIME"],h=["WORLD","VIEW","PROJECTION","WORLDVIEW","VIEWPROJECTION","WORLDVIEWPROJECTION","WORLDINVERSE","VIEWINVERSE","PROJECTIONINVERSE","WORLDVIEWINVERSE","VIEWPROJECTIONINVERSE","WORLDVIEWPROJECTIONINVERSE","WORLDTRANSPOSE","VIEWTRANSPOSE","PROJECTIONTRANSPOSE","WORLDVIEWTRANSPOSE","VIEWPROJECTIONTRANSPOSE","WORLDVIEWPROJECTIONTRANSPOSE","WORLDINVERSETRANSPOSE","VIEWINVERSETRANSPOSE","PROJECTIONINVERSETRANSPOSE","WORLDVIEWINVERSETRANSPOSE","VIEWPROJECTIONINVERSETRANSPOSE","WORLDVIEWPROJECTIONINVERSETRANSPOSE"],v={},r={};function a(w,R){var O="vertex:"+w+"fragment:"+R;if(v[O])return v[O];var z=W.a.genGUID();return v[O]=z,r[z]={vertex:w,fragment:R},z}function p(w,R){typeof w=="object"&&(R=w.fragment,w=w.vertex),this._shaderID=a(w,R),this._vertexCode=p.parseImport(w),this._fragmentCode=p.parseImport(R),this.attributeSemantics={},this.matrixSemantics={},this.uniformSemantics={},this.matrixSemanticKeys=[],this.uniformTemplates={},this.attributes={},this.textures={},this.vertexDefines={},this.fragmentDefines={},this._parseAttributes(),this._parseUniforms(),this._parseDefines()}p.prototype={constructor:p,createUniforms:function(){var w={};for(var R in this.uniformTemplates){var O=this.uniformTemplates[R];w[R]={type:O.type,value:O.value()}}return w},_parseImport:function(){this._vertexCode=p.parseImport(this.vertex),this._fragmentCode=p.parseImport(this.fragment)},_parseUniforms:function(){var w={},R=this,O="vertex";this._uniformList=[],this._vertexCode=this._vertexCode.replace(u,z),O="fragment",this._fragmentCode=this._fragmentCode.replace(u,z),R.matrixSemanticKeys=Object.keys(this.matrixSemantics);function z(N,P,F,K,B,V){if(P&&F){var C=o[P],M=!0,H;if(C){if(R._uniformList.push(F),(P==="sampler2D"||P==="samplerCube")&&(R.textures[F]={shaderType:O,type:P}),K&&(C+="v"),V)if(m.indexOf(V)>=0)R.attributeSemantics[V]={symbol:F,type:C},M=!1;else if(h.indexOf(V)>=0){var $=!1,q=V;V.match(/TRANSPOSE$/)&&($=!0,q=V.slice(0,-9)),R.matrixSemantics[V]={symbol:F,type:C,isTranspose:$,semanticNoTranspose:q},M=!1}else if(_.indexOf(V)>=0)R.uniformSemantics[V]={symbol:F,type:C},M=!1;else if(V==="unconfigurable")M=!1;else if(H=R._parseDefaultValue(P,V),H)V="";else throw new Error('Unkown semantic "'+V+'"');M&&(w[F]={type:C,value:K?d.array:H||d[P],semantic:V||null})}return["uniform",P,F,K].join(" ")+`;
|
|
`}}this.uniformTemplates=w},_parseDefaultValue:function(w,R){var O=/\[\s*(.*)\s*\]/;if(w==="vec2"||w==="vec3"||w==="vec4"){var z=O.exec(R)[1];if(z){var N=z.split(/\s*,\s*/);return function(){return new y.a.Float32Array(N)}}else return}else{if(w==="bool")return function(){return R.toLowerCase()==="true"};if(w==="float")return function(){return parseFloat(R)};if(w==="int")return function(){return parseInt(R)}}},_parseAttributes:function(){var w={},R=this;this._vertexCode=this._vertexCode.replace(f,O);function O(z,N,P,F,K){if(N&&P){var B=1;switch(N){case"vec4":B=4;break;case"vec3":B=3;break;case"vec2":B=2;break;case"float":B=1;break}if(w[P]={type:"float",size:B,semantic:K||null},K){if(m.indexOf(K)<0)throw new Error('Unkown semantic "'+K+'"');R.attributeSemantics[K]={symbol:P,type:N}}}return["attribute",N,P].join(" ")+`;
|
|
`}this.attributes=w},_parseDefines:function(){var w=this,R="vertex";this._vertexCode=this._vertexCode.replace(i,O),R="fragment",this._fragmentCode=this._fragmentCode.replace(i,O);function O(z,N,P){var F=R==="vertex"?w.vertexDefines:w.fragmentDefines;return F[N]||(P=="false"?F[N]=!1:P=="true"?F[N]=!0:F[N]=P?isNaN(parseFloat(P))?P.trim():parseFloat(P):null),""}},clone:function(){var w=r[this._shaderID],R=new p(w.vertex,w.fragment);return R}},Object.defineProperty&&(Object.defineProperty(p.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(p.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(p.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(p.prototype,"uniforms",{get:function(){return this._uniformList}}));var E=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;p.parseImport=function(w){return w=w.replace(E,function(N,O,z){var N=p.source(z);return N?p.parseImport(N):(console.error('Shader chunk "'+z+'" not existed in library'),"")}),w};var S=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;p.import=function(w){w.replace(S,function(R,O,z,P){var P=P.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"");if(P){for(var F=z.split("."),K=p.codes,B=0,V;B<F.length-1;)V=F[B++],K[V]||(K[V]={}),K=K[V];V=F[B],K[V]=P}return P})},p.codes={},p.source=function(w){for(var R=w.split("."),O=p.codes,z=0;O&&z<R.length;){var N=R[z++];O=O[N]}return typeof O!="string"?(console.error('Shader "'+w+'" not existed in library'),""):O},X.a=p},function(re,X,D){"use strict";var W=D(91),y=D(47),L=D(21),A=function(){this.__uid__=L.a.genGUID()};A.__initializers__=[function(s){L.a.extend(this,s)}],L.a.extend(A,W.a),L.a.extend(A.prototype,y.a),X.a=A},function(re,X,D){"use strict";var W=D(1),y=D.n(W),L=D(4),A=y.a.mat4,s=y.a.vec3,x=y.a.mat3,c=y.a.quat,u=function(){this._axisX=new L.a,this._axisY=new L.a,this._axisZ=new L.a,this.array=A.create(),this._dirty=!0};u.prototype={constructor:u,setArray:function(o){for(var d=0;d<this.array.length;d++)this.array[d]=o[d];return this._dirty=!0,this},adjoint:function(){return A.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return new u().copy(this)},copy:function(o){return A.copy(this.array,o.array),this._dirty=!0,this},determinant:function(){return A.determinant(this.array)},fromQuat:function(o){return A.fromQuat(this.array,o.array),this._dirty=!0,this},fromRotationTranslation:function(o,d){return A.fromRotationTranslation(this.array,o.array,d.array),this._dirty=!0,this},fromMat2d:function(o){return u.fromMat2d(this,o),this},frustum:function(o,d,m,_,h,v){return A.frustum(this.array,o,d,m,_,h,v),this._dirty=!0,this},identity:function(){return A.identity(this.array),this._dirty=!0,this},invert:function(){return A.invert(this.array,this.array),this._dirty=!0,this},lookAt:function(o,d,m){return A.lookAt(this.array,o.array,d.array,m.array),this._dirty=!0,this},mul:function(o){return A.mul(this.array,this.array,o.array),this._dirty=!0,this},mulLeft:function(o){return A.mul(this.array,o.array,this.array),this._dirty=!0,this},multiply:function(o){return A.multiply(this.array,this.array,o.array),this._dirty=!0,this},multiplyLeft:function(o){return A.multiply(this.array,o.array,this.array),this._dirty=!0,this},ortho:function(o,d,m,_,h,v){return A.ortho(this.array,o,d,m,_,h,v),this._dirty=!0,this},perspective:function(o,d,m,_){return A.perspective(this.array,o,d,m,_),this._dirty=!0,this},rotate:function(o,d){return A.rotate(this.array,this.array,o,d.array),this._dirty=!0,this},rotateX:function(o){return A.rotateX(this.array,this.array,o),this._dirty=!0,this},rotateY:function(o){return A.rotateY(this.array,this.array,o),this._dirty=!0,this},rotateZ:function(o){return A.rotateZ(this.array,this.array,o),this._dirty=!0,this},scale:function(o){return A.scale(this.array,this.array,o.array),this._dirty=!0,this},translate:function(o){return A.translate(this.array,this.array,o.array),this._dirty=!0,this},transpose:function(){return A.transpose(this.array,this.array),this._dirty=!0,this},decomposeMatrix:function(){var o=s.create(),d=s.create(),m=s.create(),_=x.create();return function(h,v,r){var a=this.array;s.set(o,a[0],a[1],a[2]),s.set(d,a[4],a[5],a[6]),s.set(m,a[8],a[9],a[10]);var p=s.length(o),E=s.length(d),S=s.length(m),w=this.determinant();w<0&&(p=-p),h&&h.set(p,E,S),r.set(a[12],a[13],a[14]),x.fromMat4(_,a),_[0]/=p,_[1]/=p,_[2]/=p,_[3]/=E,_[4]/=E,_[5]/=E,_[6]/=S,_[7]/=S,_[8]/=S,c.fromMat3(v.array,_),c.normalize(v.array,v.array),v._dirty=!0,r._dirty=!0}}(),toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var f=Object.defineProperty;if(f){var i=u.prototype;f(i,"z",{get:function(){var o=this.array;return this._axisZ.set(o[8],o[9],o[10]),this._axisZ},set:function(o){var d=this.array;o=o.array,d[8]=o[0],d[9]=o[1],d[10]=o[2],this._dirty=!0}}),f(i,"y",{get:function(){var o=this.array;return this._axisY.set(o[4],o[5],o[6]),this._axisY},set:function(o){var d=this.array;o=o.array,d[4]=o[0],d[5]=o[1],d[6]=o[2],this._dirty=!0}}),f(i,"x",{get:function(){var o=this.array;return this._axisX.set(o[0],o[1],o[2]),this._axisX},set:function(o){var d=this.array;o=o.array,d[0]=o[0],d[1]=o[1],d[2]=o[2],this._dirty=!0}})}u.adjoint=function(o,d){return A.adjoint(o.array,d.array),o._dirty=!0,o},u.copy=function(o,d){return A.copy(o.array,d.array),o._dirty=!0,o},u.determinant=function(o){return A.determinant(o.array)},u.identity=function(o){return A.identity(o.array),o._dirty=!0,o},u.ortho=function(o,d,m,_,h,v,r){return A.ortho(o.array,d,m,_,h,v,r),o._dirty=!0,o},u.perspective=function(o,d,m,_,h){return A.perspective(o.array,d,m,_,h),o._dirty=!0,o},u.lookAt=function(o,d,m,_){return A.lookAt(o.array,d.array,m.array,_.array),o._dirty=!0,o},u.invert=function(o,d){return A.invert(o.array,d.array),o._dirty=!0,o},u.mul=function(o,d,m){return A.mul(o.array,d.array,m.array),o._dirty=!0,o},u.multiply=u.mul,u.fromQuat=function(o,d){return A.fromQuat(o.array,d.array),o._dirty=!0,o},u.fromRotationTranslation=function(o,d,m){return A.fromRotationTranslation(o.array,d.array,m.array),o._dirty=!0,o},u.fromMat2d=function(_,m){_._dirty=!0;var m=m.array,_=_.array;return _[0]=m[0],_[4]=m[2],_[12]=m[4],_[1]=m[1],_[5]=m[3],_[13]=m[5],_},u.rotate=function(o,d,m,_){return A.rotate(o.array,d.array,m,_.array),o._dirty=!0,o},u.rotateX=function(o,d,m){return A.rotateX(o.array,d.array,m),o._dirty=!0,o},u.rotateY=function(o,d,m){return A.rotateY(o.array,d.array,m),o._dirty=!0,o},u.rotateZ=function(o,d,m){return A.rotateZ(o.array,d.array,m),o._dirty=!0,o},u.scale=function(o,d,m){return A.scale(o.array,d.array,m.array),o._dirty=!0,o},u.transpose=function(o,d){return A.transpose(o.array,d.array),o._dirty=!0,o},u.translate=function(o,d,m){return A.translate(o.array,d.array,m.array),o._dirty=!0,o},X.a=u},function(re,X,D){"use strict";var W=D(8),y=D(6),L=D(25),A=D(11),s=D(48),x="framebuffer",c="renderbuffer",u=c+"_width",f=c+"_height",i=c+"_attached",o="depthtexture_attached",d=A.a.FRAMEBUFFER,m=A.a.RENDERBUFFER,_=A.a.DEPTH_ATTACHMENT,h=A.a.COLOR_ATTACHMENT0,v=W.a.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},function(){this._cache=new s.a,this._textures={}},{getTextureWidth:function(){return this._width},getTextureHeight:function(){return this._height},bind:function(r){if(r.__currentFrameBuffer){if(r.__currentFrameBuffer===this)return;console.warn("Renderer already bound with another framebuffer. Unbind it first")}r.__currentFrameBuffer=this;var a=r.gl;a.bindFramebuffer(d,this._getFrameBufferGL(r)),this._boundRenderer=r;var p=this._cache;p.put("viewport",r.viewport);var E=!1,S,w;for(var R in this._textures){E=!0;var O=this._textures[R];O&&(S=O.texture.width,w=O.texture.height,this._doAttach(r,O.texture,R,O.target))}this._width=S,this._height=w,!E&&this.depthBuffer&&console.error("Must attach texture before bind, or renderbuffer may have incorrect width and height."),this.viewport?r.setViewport(this.viewport):r.setViewport(0,0,S,w,1);var z=p.get("attached_textures");if(z){for(var R in z)if(!this._textures[R]){var N=z[R];this._doDetach(a,R,N)}}if(!p.get(o)&&this.depthBuffer){p.miss(c)&&p.put(c,a.createRenderbuffer());var P=p.get(c);(S!==p.get(u)||w!==p.get(f))&&(a.bindRenderbuffer(m,P),a.renderbufferStorage(m,a.DEPTH_COMPONENT16,S,w),p.put(u,S),p.put(f,w),a.bindRenderbuffer(m,null)),p.get(i)||(a.framebufferRenderbuffer(d,_,m,P),p.put(i,!0))}},unbind:function(r){r.__currentFrameBuffer=null;var a=r.gl;a.bindFramebuffer(d,null),this._boundRenderer=null,this._cache.use(r.__uid__);var p=this._cache.get("viewport");p&&r.setViewport(p),this.updateMipmap(r)},updateMipmap:function(r){var a=r.gl;for(var p in this._textures){var E=this._textures[p];if(E){var S=E.texture;if(!S.NPOT&&S.useMipmap&&S.minFilter===y.a.LINEAR_MIPMAP_LINEAR){var w=S instanceof L.a?A.a.TEXTURE_CUBE_MAP:A.a.TEXTURE_2D;a.bindTexture(w,S.getWebGLTexture(r)),a.generateMipmap(w),a.bindTexture(w,null)}}}},checkStatus:function(r){return r.checkFramebufferStatus(d)},_getFrameBufferGL:function(r){var a=this._cache;return a.use(r.__uid__),a.miss(x)&&a.put(x,r.gl.createFramebuffer()),a.get(x)},attach:function(r,a,p){if(!r.width)throw new Error("The texture attached to color buffer is not a valid.");a=a||h,p=p||A.a.TEXTURE_2D;var E=this._boundRenderer,S=E&&E.gl,w;if(S){var R=this._cache;R.use(E.__uid__),w=R.get("attached_textures")}var O=this._textures[a];if(!(O&&O.target===p&&O.texture===r&&w&&w[a]!=null)){var z=!0;E&&(z=this._doAttach(E,r,a,p),this.viewport||E.setViewport(0,0,r.width,r.height,1)),z&&(this._textures[a]=this._textures[a]||{},this._textures[a].texture=r,this._textures[a].target=p)}},_doAttach:function(r,a,p,E){var S=r.gl,w=a.getWebGLTexture(r),R=this._cache.get("attached_textures");if(R&&R[p]){var O=R[p];if(O.texture===a&&O.target===E)return}p=+p;var z=!0;if(p===_||p===A.a.DEPTH_STENCIL_ATTACHMENT){var N=r.getGLExtension("WEBGL_depth_texture");if(N||(console.error("Depth texture is not supported by the browser"),z=!1),a.format!==A.a.DEPTH_COMPONENT&&a.format!==A.a.DEPTH_STENCIL&&(console.error("The texture attached to depth buffer is not a valid."),z=!1),z){var P=this._cache.get(c);P&&(S.framebufferRenderbuffer(d,_,m,null),S.deleteRenderbuffer(P),this._cache.put(c,!1)),this._cache.put(i,!1),this._cache.put(o,!0)}}return S.framebufferTexture2D(d,p,E,w,0),R||(R={},this._cache.put("attached_textures",R)),R[p]=R[p]||{},R[p].texture=a,R[p].target=E,z},_doDetach:function(r,a,p){r.framebufferTexture2D(d,a,p,null,0);var E=this._cache.get("attached_textures");E&&E[a]&&(E[a]=null),(a===_||a===A.a.DEPTH_STENCIL_ATTACHMENT)&&this._cache.put(o,!1)},detach:function(r,a){if(this._textures[r]=null,this._boundRenderer){var p=this._cache;p.use(this._boundRenderer.__uid__),this._doDetach(this._boundRenderer.gl,r,a)}},dispose:function(r){var a=r.gl,p=this._cache;p.use(r.__uid__);var E=p.get(c);E&&a.deleteRenderbuffer(E);var S=p.get(x);S&&a.deleteFramebuffer(S),p.deleteContext(r.__uid__),this._textures={}}});v.DEPTH_ATTACHMENT=_,v.COLOR_ATTACHMENT0=h,v.STENCIL_ATTACHMENT=A.a.STENCIL_ATTACHMENT,v.DEPTH_STENCIL_ATTACHMENT=A.a.DEPTH_STENCIL_ATTACHMENT,X.a=v},function(re,X,D){"use strict";X.a={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444}},function(re,X){var D={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},W={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},y=Object.prototype.toString,L=Array.prototype,A=L.forEach,s=L.filter,x=L.slice,c=L.map,u=L.reduce,f={};function i(me,oe){f[me]=oe}function o(me){if(me==null||typeof me!="object")return me;var oe=me,ie=y.call(me);if(ie==="[object Array]"){if(!we(me)){oe=[];for(var fe=0,ye=me.length;fe<ye;fe++)oe[fe]=o(me[fe])}}else if(W[ie]){if(!we(me)){var he=me.constructor;if(me.constructor.from)oe=he.from(me);else{oe=new he(me.length);for(var fe=0,ye=me.length;fe<ye;fe++)oe[fe]=o(me[fe])}}}else if(!D[ie]&&!we(me)&&!q(me)){oe={};for(var Te in me)me.hasOwnProperty(Te)&&(oe[Te]=o(me[Te]))}return oe}function d(me,oe,ie){if(!M(oe)||!M(me))return ie?o(oe):me;for(var fe in oe)if(oe.hasOwnProperty(fe)){var ye=me[fe],he=oe[fe];M(he)&&M(ye)&&!B(he)&&!B(ye)&&!q(he)&&!q(ye)&&!H(he)&&!H(ye)&&!we(he)&&!we(ye)?d(ye,he,ie):(ie||!(fe in me))&&(me[fe]=o(oe[fe],!0))}return me}function m(me,oe){for(var ie=me[0],fe=1,ye=me.length;fe<ye;fe++)ie=d(ie,me[fe],oe);return ie}function _(me,oe){for(var ie in oe)oe.hasOwnProperty(ie)&&(me[ie]=oe[ie]);return me}function h(me,oe,ie){for(var fe in oe)oe.hasOwnProperty(fe)&&(ie?oe[fe]!=null:me[fe]==null)&&(me[fe]=oe[fe]);return me}var v=function(){return f.createCanvas()};f.createCanvas=function(){return document.createElement("canvas")};var r;function a(){return r||(r=v().getContext("2d")),r}function p(me,oe){if(me){if(me.indexOf)return me.indexOf(oe);for(var ie=0,fe=me.length;ie<fe;ie++)if(me[ie]===oe)return ie}return-1}function E(me,oe){var ie=me.prototype;function fe(){}fe.prototype=oe.prototype,me.prototype=new fe;for(var ye in ie)me.prototype[ye]=ie[ye];me.prototype.constructor=me,me.superClass=oe}function S(me,oe,ie){me="prototype"in me?me.prototype:me,oe="prototype"in oe?oe.prototype:oe,h(me,oe,ie)}function w(me){if(me)return typeof me=="string"?!1:typeof me.length=="number"}function R(me,oe,ie){if(me&&oe)if(me.forEach&&me.forEach===A)me.forEach(oe,ie);else if(me.length===+me.length)for(var fe=0,ye=me.length;fe<ye;fe++)oe.call(ie,me[fe],fe,me);else for(var he in me)me.hasOwnProperty(he)&&oe.call(ie,me[he],he,me)}function O(me,oe,ie){if(me&&oe){if(me.map&&me.map===c)return me.map(oe,ie);for(var fe=[],ye=0,he=me.length;ye<he;ye++)fe.push(oe.call(ie,me[ye],ye,me));return fe}}function z(me,oe,ie,fe){if(me&&oe){if(me.reduce&&me.reduce===u)return me.reduce(oe,ie,fe);for(var ye=0,he=me.length;ye<he;ye++)ie=oe.call(fe,ie,me[ye],ye,me);return ie}}function N(me,oe,ie){if(me&&oe){if(me.filter&&me.filter===s)return me.filter(oe,ie);for(var fe=[],ye=0,he=me.length;ye<he;ye++)oe.call(ie,me[ye],ye,me)&&fe.push(me[ye]);return fe}}function P(me,oe,ie){if(me&&oe){for(var fe=0,ye=me.length;fe<ye;fe++)if(oe.call(ie,me[fe],fe,me))return me[fe]}}function F(me,oe){var ie=x.call(arguments,2);return function(){return me.apply(oe,ie.concat(x.call(arguments)))}}function K(me){var oe=x.call(arguments,1);return function(){return me.apply(this,oe.concat(x.call(arguments)))}}function B(me){return y.call(me)==="[object Array]"}function V(me){return typeof me=="function"}function C(me){return y.call(me)==="[object String]"}function M(me){var oe=typeof me;return oe==="function"||!!me&&oe=="object"}function H(me){return!!D[y.call(me)]}function $(me){return!!W[y.call(me)]}function q(me){return typeof me=="object"&&typeof me.nodeType=="number"&&typeof me.ownerDocument=="object"}function se(me){return me!==me}function ue(me){for(var oe=0,ie=arguments.length;oe<ie;oe++)if(arguments[oe]!=null)return arguments[oe]}function pe(me,oe){return me!=null?me:oe}function xe(me,oe,ie){return me!=null?me:oe!=null?oe:ie}function De(){return Function.call.apply(x,arguments)}function Ue(me){if(typeof me=="number")return[me,me,me,me];var oe=me.length;return oe===2?[me[0],me[1],me[0],me[1]]:oe===3?[me[0],me[1],me[2],me[1]]:me}function Ge(me,oe){if(!me)throw new Error(oe)}var Ae="__ec_primitive__";function We(me){me[Ae]=!0}function we(me){return me[Ae]}function Se(me){var oe=B(me);me&&R(me,function(ie,fe){oe?this.set(ie,1):this.set(fe,ie)},this)}var ge="_ec_",Re=4;Se.prototype={constructor:Se,get:function(me){return this[ge+me]},set:function(me,oe){return this[ge+me]=oe,oe},each:function(me,oe){oe!==void 0&&(me=F(me,oe));for(var ie in this)this.hasOwnProperty(ie)&&me(this[ie],ie.slice(Re))},removeKey:function(me){delete this[ge+me]}};function ve(me){return new Se(me)}function Le(me,oe){for(var ie=new me.constructor(me.length+oe.length),fe=0;fe<me.length;fe++)ie[fe]=me[fe];var ye=me.length;for(fe=0;fe<oe.length;fe++)ie[fe+ye]=oe[fe];return ie}function Fe(){}X.$override=i,X.clone=o,X.merge=d,X.mergeAll=m,X.extend=_,X.defaults=h,X.createCanvas=v,X.getContext=a,X.indexOf=p,X.inherits=E,X.mixin=S,X.isArrayLike=w,X.each=R,X.map=O,X.reduce=z,X.filter=N,X.find=P,X.bind=F,X.curry=K,X.isArray=B,X.isFunction=V,X.isString=C,X.isObject=M,X.isBuiltInObject=H,X.isTypedArray=$,X.isDom=q,X.eqNaN=se,X.retrieve=ue,X.retrieve2=pe,X.retrieve3=xe,X.slice=De,X.normalizeCssArray=Ue,X.assert=Ge,X.setAsPrimitive=We,X.isPrimitive=we,X.createHashMap=ve,X.concatArray=Le,X.noop=Fe},function(re,X,D){"use strict";var W=D(8),y=D(11),L=D(48),A=D(18),s=D(1),x=D.n(s),c=D(15),u=x.a.vec3,f=x.a.mat4,i=u.create,o=u.add,d=u.set;function m(p){return{byte:A.a.Int8Array,ubyte:A.a.Uint8Array,short:A.a.Int16Array,ushort:A.a.Uint16Array}[p]||A.a.Float32Array}function _(p){return"attr_"+p}function h(p,E,S,w){switch(this.name=p,this.type=E,this.size=S,this.semantic=w||"",this.value=null,S){case 1:this.get=function(R){return this.value[R]},this.set=function(R,O){this.value[R]=O},this.copy=function(R,O){this.value[R]=this.value[R]};break;case 2:this.get=function(R,O){var z=this.value;return O[0]=z[R*2],O[1]=z[R*2+1],O},this.set=function(R,O){var z=this.value;z[R*2]=O[0],z[R*2+1]=O[1]},this.copy=function(R,O){var z=this.value;O*=2,R*=2,z[R]=z[O],z[R+1]=z[O+1]};break;case 3:this.get=function(R,O){var z=R*3,N=this.value;return O[0]=N[z],O[1]=N[z+1],O[2]=N[z+2],O},this.set=function(R,O){var z=R*3,N=this.value;N[z]=O[0],N[z+1]=O[1],N[z+2]=O[2]},this.copy=function(R,O){var z=this.value;O*=3,R*=3,z[R]=z[O],z[R+1]=z[O+1],z[R+2]=z[O+2]};break;case 4:this.get=function(R,O){var z=this.value,N=R*4;return O[0]=z[N],O[1]=z[N+1],O[2]=z[N+2],O[3]=z[N+3],O},this.set=function(R,O){var z=this.value,N=R*4;z[N]=O[0],z[N+1]=O[1],z[N+2]=O[2],z[N+3]=O[3]},this.copy=function(R,O){var z=this.value;O*=4,R*=4,z[R]=z[O],z[R+1]=z[O+1],z[R+2]=z[O+2],z[R+3]=z[O+3]}}}h.prototype.init=function(p){if(!this.value||this.value.length!=p*this.size){var E=m(this.type);this.value=new E(p*this.size)}},h.prototype.fromArray=function(p){var E=m(this.type),S;if(p[0]&&p[0].length){var w=0,R=this.size;S=new E(p.length*R);for(var O=0;O<p.length;O++)for(var z=0;z<R;z++)S[w++]=p[O][z]}else S=new E(p);this.value=S},h.prototype.clone=function(p){var E=new h(this.name,this.type,this.size,this.semantic);return p&&console.warn("todo"),E};function v(p,E,S,w,R){this.name=p,this.type=E,this.buffer=S,this.size=w,this.semantic=R,this.symbol="",this.needsRemove=!1}function r(p){this.buffer=p,this.count=0}var a=W.a.extend(function(){return{attributes:{position:new h("position","float",3,"POSITION"),texcoord0:new h("texcoord0","float",2,"TEXCOORD_0"),texcoord1:new h("texcoord1","float",2,"TEXCOORD_1"),normal:new h("normal","float",3,"NORMAL"),tangent:new h("tangent","float",4,"TANGENT"),color:new h("color","float",4,"COLOR"),weight:new h("weight","float",3,"WEIGHT"),joint:new h("joint","float",4,"JOINT"),barycentric:new h("barycentric","float",3,null)},boundingBox:null,indices:null,dynamic:!0,_enabledAttributes:null}},function(){this._cache=new L.a,this._attributeList=Object.keys(this.attributes)},{mainAttribute:"position",pick:null,pickByRay:null,updateBoundingBox:function(){var p=this.boundingBox;p||(p=this.boundingBox=new c.a);var E=this.attributes.position.value;if(E&&E.length){var S=p.min,w=p.max,R=S.array,O=w.array;u.set(R,E[0],E[1],E[2]),u.set(O,E[0],E[1],E[2]);for(var z=3;z<E.length;){var N=E[z++],P=E[z++],F=E[z++];N<R[0]&&(R[0]=N),P<R[1]&&(R[1]=P),F<R[2]&&(R[2]=F),N>O[0]&&(O[0]=N),P>O[1]&&(O[1]=P),F>O[2]&&(O[2]=F)}S._dirty=!0,w._dirty=!0}},dirty:function(){for(var p=this.getEnabledAttributes(),E=0;E<p.length;E++)this.dirtyAttribute(p[E]);this.dirtyIndices(),this._enabledAttributes=null,this._cache.dirty("any")},dirtyIndices:function(){this._cache.dirtyAll("indices")},dirtyAttribute:function(p){this._cache.dirtyAll(_(p)),this._cache.dirtyAll("attributes")},getTriangleIndices:function(p,E){if(p<this.triangleCount&&p>=0){E||(E=i());var S=this.indices;return E[0]=S[p*3],E[1]=S[p*3+1],E[2]=S[p*3+2],E}},setTriangleIndices:function(p,E){var S=this.indices;S[p*3]=E[0],S[p*3+1]=E[1],S[p*3+2]=E[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(p){var E,S=this.vertexCount>65535?A.a.Uint32Array:A.a.Uint16Array;if(p[0]&&p[0].length){var w=0,R=3;E=new S(p.length*R);for(var O=0;O<p.length;O++)for(var z=0;z<R;z++)E[w++]=p[O][z]}else E=new S(p);this.indices=E},createAttribute:function(p,E,S,w){var R=new h(p,E,S,w);return this.attributes[p]&&this.removeAttribute(p),this.attributes[p]=R,this._attributeList.push(p),R},removeAttribute:function(p){var E=this._attributeList,S=E.indexOf(p);return S>=0?(E.splice(S,1),delete this.attributes[p],!0):!1},getAttribute:function(p){return this.attributes[p]},getEnabledAttributes:function(){var p=this._enabledAttributes,E=this._attributeList;if(p)return p;for(var S=[],w=this.vertexCount,R=0;R<E.length;R++){var O=E[R],z=this.attributes[O];z.value&&z.value.length===w*z.size&&S.push(O)}return this._enabledAttributes=S,S},getBufferChunks:function(p){var E=this._cache;E.use(p.__uid__);var S=E.isDirty("attributes"),w=E.isDirty("indices");if(S||w){this._updateBuffer(p.gl,S,w);for(var R=this.getEnabledAttributes(),O=0;O<R.length;O++)E.fresh(_(R[O]));E.fresh("attributes"),E.fresh("indices")}return E.fresh("any"),E.get("chunks")},_updateBuffer:function(p,E,S){var w=this._cache,R=w.get("chunks"),O=!1;R||(R=[],R[0]={attributeBuffers:[],indicesBuffer:null},w.put("chunks",R),O=!0);var z=R[0],N=z.attributeBuffers,P=z.indicesBuffer;if(E||O){var F=this.getEnabledAttributes(),K={};if(!O)for(var B=0;B<N.length;B++)K[N[B].name]=N[B];for(var V=0;V<F.length;V++){var C=F[V],M=this.attributes[C],H;O||(H=K[C]);var $;H?$=H.buffer:$=p.createBuffer(),w.isDirty(_(C))&&(p.bindBuffer(p.ARRAY_BUFFER,$),p.bufferData(p.ARRAY_BUFFER,M.value,this.dynamic?y.a.DYNAMIC_DRAW:y.a.STATIC_DRAW)),N[V]=new v(C,M.type,$,M.size,M.semantic)}for(var B=V;B<N.length;B++)p.deleteBuffer(N[B].buffer);N.length=V}this.isUseIndices()&&(S||O)&&(P||(P=new r(p.createBuffer()),z.indicesBuffer=P),P.count=this.indices.length,p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,P.buffer),p.bufferData(p.ELEMENT_ARRAY_BUFFER,this.indices,this.dynamic?y.a.DYNAMIC_DRAW:y.a.STATIC_DRAW))},generateVertexNormals:function(){if(this.vertexCount){var p=this.indices,E=this.attributes,S=E.position.value,w=E.normal.value;if(!w||w.length!==S.length)w=E.normal.value=new A.a.Float32Array(S.length);else for(var R=0;R<w.length;R++)w[R]=0;for(var O=i(),z=i(),N=i(),P=i(),F=i(),K=i(),B=p?p.length:this.vertexCount,V,C,M,H=0;H<B;){p?(V=p[H++],C=p[H++],M=p[H++]):(V=H++,C=H++,M=H++),d(O,S[V*3],S[V*3+1],S[V*3+2]),d(z,S[C*3],S[C*3+1],S[C*3+2]),d(N,S[M*3],S[M*3+1],S[M*3+2]),u.sub(P,O,z),u.sub(F,z,N),u.cross(K,P,F);for(var R=0;R<3;R++)w[V*3+R]=w[V*3+R]+K[R],w[C*3+R]=w[C*3+R]+K[R],w[M*3+R]=w[M*3+R]+K[R]}for(var R=0;R<w.length;)d(K,w[R],w[R+1],w[R+2]),u.normalize(K,K),w[R++]=K[0],w[R++]=K[1],w[R++]=K[2];this.dirty()}},generateFaceNormals:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var p=this.indices,E=this.attributes,S=E.position.value,w=E.normal.value,R=i(),O=i(),z=i(),N=i(),P=i(),F=i();w||(w=E.normal.value=new Float32Array(S.length));for(var K=p?p.length:this.vertexCount,B,V,C,M=0;M<K;){p?(B=p[M++],V=p[M++],C=p[M++]):(B=M++,V=M++,C=M++),d(R,S[B*3],S[B*3+1],S[B*3+2]),d(O,S[V*3],S[V*3+1],S[V*3+2]),d(z,S[C*3],S[C*3+1],S[C*3+2]),u.sub(N,R,O),u.sub(P,O,z),u.cross(F,N,P),u.normalize(F,F);for(var H=0;H<3;H++)w[B*3+H]=F[H],w[V*3+H]=F[H],w[C*3+H]=F[H]}this.dirty()}},generateTangents:function(){if(this.vertexCount){var p=this.vertexCount,E=this.attributes;E.tangent.value||(E.tangent.value=new Float32Array(p*4));var S=E.texcoord0.value,w=E.position.value,R=E.tangent.value,O=E.normal.value;if(!S){console.warn("Geometry without texcoords can't generate tangents.");return}for(var z=[],N=[],P=0;P<p;P++)z[P]=[0,0,0],N[P]=[0,0,0];for(var F=[0,0,0],K=[0,0,0],B=this.indices,V=B?B.length:this.vertexCount,C,M,H,P=0;P<V;){B?(C=B[P++],M=B[P++],H=B[P++]):(C=P++,M=P++,H=P++);var $=S[C*2],q=S[M*2],se=S[H*2],ue=S[C*2+1],pe=S[M*2+1],xe=S[H*2+1],De=w[C*3],Ue=w[M*3],Ge=w[H*3],Ae=w[C*3+1],We=w[M*3+1],we=w[H*3+1],Se=w[C*3+2],ge=w[M*3+2],Re=w[H*3+2],ve=Ue-De,Le=Ge-De,Fe=We-Ae,me=we-Ae,oe=ge-Se,ie=Re-Se,fe=q-$,ye=se-$,he=pe-ue,Te=xe-ue,Oe=1/(fe*Te-he*ye);F[0]=(Te*ve-he*Le)*Oe,F[1]=(Te*Fe-he*me)*Oe,F[2]=(Te*oe-he*ie)*Oe,K[0]=(fe*Le-ye*ve)*Oe,K[1]=(fe*me-ye*Fe)*Oe,K[2]=(fe*ie-ye*oe)*Oe,o(z[C],z[C],F),o(z[M],z[M],F),o(z[H],z[H],F),o(N[C],N[C],K),o(N[M],N[M],K),o(N[H],N[H],K)}for(var Be=i(),Ze=i(),tt=i(),P=0;P<p;P++){tt[0]=O[P*3],tt[1]=O[P*3+1],tt[2]=O[P*3+2];var dt=z[P];u.scale(Be,tt,u.dot(tt,dt)),u.sub(Be,dt,Be),u.normalize(Be,Be),u.cross(Ze,tt,dt),R[P*4]=Be[0],R[P*4+1]=Be[1],R[P*4+2]=Be[2],R[P*4+3]=u.dot(Ze,N[P])<0?-1:1}this.dirty()}},isUniqueVertex:function(){return this.isUseIndices()?this.vertexCount===this.indices.length:!0},generateUniqueVertex:function(){if(!(!this.vertexCount||!this.indices)){this.indices.length>65535&&(this.indices=new A.a.Uint32Array(this.indices));for(var p=this.attributes,E=this.indices,S=this.getEnabledAttributes(),w={},R=0;R<S.length;R++){var O=S[R];w[O]=p[O].value,p[O].init(this.indices.length)}for(var z=0,N=0;N<E.length;N++){for(var P=E[N],R=0;R<S.length;R++)for(var O=S[R],F=p[O].value,K=p[O].size,B=0;B<K;B++)F[z*K+B]=w[O][P*K+B];E[N]=z,z++}this.dirty()}},generateBarycentric:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var p=this.attributes,E=p.barycentric.value,S=this.indices;if(!(E&&E.length===S.length*3)){E=p.barycentric.value=new Float32Array(S.length*3);for(var w=0;w<(S?S.length:this.vertexCount/3);)for(var R=0;R<3;R++){var O=S?S[w++]:w*3+R;E[O*3+R]=1}this.dirty()}}},applyTransform:function(p){var E=this.attributes,S=E.position.value,w=E.normal.value,R=E.tangent.value;p=p.array;var O=f.create();f.invert(O,p),f.transpose(O,O);var z=u.transformMat4,N=u.forEach;N(S,3,0,null,z,p),w&&N(w,3,0,null,z,O),R&&N(R,4,0,null,z,O),this.boundingBox&&this.updateBoundingBox()},dispose:function(p){var E=this._cache;E.use(p.__uid__);var S=E.get("chunks");if(S)for(var w=0;w<S.length;w++){for(var R=S[w],O=0;O<R.attributeBuffers.length;O++){var z=R.attributeBuffers[O];p.gl.deleteBuffer(z.buffer)}R.indicesBuffer&&p.gl.deleteBuffer(R.indicesBuffer.buffer)}E.deleteContext(p.__uid__)}});Object.defineProperty&&(Object.defineProperty(a.prototype,"vertexCount",{enumerable:!1,get:function(){var p=this.attributes[this.mainAttribute];return!p||!p.value?0:p.value.length/p.size}}),Object.defineProperty(a.prototype,"triangleCount",{enumerable:!1,get:function(){var p=this.indices;return p?p.length/3:0}})),a.STATIC_DRAW=y.a.STATIC_DRAW,a.DYNAMIC_DRAW=y.a.DYNAMIC_DRAW,a.STREAM_DRAW=y.a.STREAM_DRAW,a.AttributeBuffer=v,a.IndicesBuffer=r,a.Attribute=h,X.a=a},function(re,X,D){"use strict";var W=D(8),y=D(30),L=D(37),A=D(7),s=D(17),x=D(24),c=D(11),u=D(109);A.a.import(u.a);var f=new L.a,i=new x.a({geometry:f,frustumCulling:!1}),o=new y.a,d=W.a.extend(function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}},function(){var m=new A.a(A.a.source("clay.compositor.vertex"),this.fragment),_=new s.a({shader:m});_.enableTexturesAll(),this.material=_},{setUniform:function(m,_){this.material.setUniform(m,_)},getUniform:function(m){var _=this.material.uniforms[m];if(_)return _.value},attachOutput:function(m,_){this.outputs||(this.outputs={}),_=_||c.a.COLOR_ATTACHMENT0,this.outputs[_]=m},detachOutput:function(m){for(var _ in this.outputs)this.outputs[_]===m&&(this.outputs[_]=null)},bind:function(m,_){if(this.outputs)for(var h in this.outputs){var v=this.outputs[h];v&&_.attach(v,h)}_&&_.bind(m)},unbind:function(m,_){_.unbind(m)},render:function(m,_){var h=m.gl;if(_){this.bind(m,_);var v=m.getGLExtension("EXT_draw_buffers");if(v&&this.outputs){var r=[];for(var a in this.outputs)a=+a,a>=h.COLOR_ATTACHMENT0&&a<=h.COLOR_ATTACHMENT0+8&&r.push(a);v.drawBuffersEXT(r)}}this.trigger("beforerender",this,m);var p=this.clearDepth?h.DEPTH_BUFFER_BIT:0;if(h.depthMask(!0),this.clearColor){p=p|h.COLOR_BUFFER_BIT,h.colorMask(!0,!0,!0,!0);var E=this.clearColor;Array.isArray(E)&&h.clearColor(E[0],E[1],E[2],E[3])}h.clear(p),this.blendWithPrevious?(h.enable(h.BLEND),this.material.transparent=!0):(h.disable(h.BLEND),this.material.transparent=!1),this.renderQuad(m),this.trigger("afterrender",this,m),_&&this.unbind(m,_)},renderQuad:function(m){i.material=this.material,m.renderPass([i],o)},dispose:function(m){}});X.a=d},function(re,X,D){"use strict";var W=D(4),y=D(1),L=D.n(y),A=L.a.vec3,s=A.copy,x=A.set,c=function(u,f){this.min=u||new W.a(1/0,1/0,1/0),this.max=f||new W.a(-1/0,-1/0,-1/0)};c.prototype={constructor:c,updateFromVertices:function(u){if(u.length>0){var f=this.min,i=this.max,o=f.array,d=i.array;s(o,u[0]),s(d,u[0]);for(var m=1;m<u.length;m++){var _=u[m];_[0]<o[0]&&(o[0]=_[0]),_[1]<o[1]&&(o[1]=_[1]),_[2]<o[2]&&(o[2]=_[2]),_[0]>d[0]&&(d[0]=_[0]),_[1]>d[1]&&(d[1]=_[1]),_[2]>d[2]&&(d[2]=_[2])}f._dirty=!0,i._dirty=!0}},union:function(u){var f=this.min,i=this.max;return A.min(f.array,f.array,u.min.array),A.max(i.array,i.array,u.max.array),f._dirty=!0,i._dirty=!0,this},intersection:function(u){var f=this.min,i=this.max;return A.max(f.array,f.array,u.min.array),A.min(i.array,i.array,u.max.array),f._dirty=!0,i._dirty=!0,this},intersectBoundingBox:function(u){var f=this.min.array,i=this.max.array,o=u.min.array,d=u.max.array;return!(f[0]>d[0]||f[1]>d[1]||f[2]>d[2]||i[0]<o[0]||i[1]<o[1]||i[2]<o[2])},containBoundingBox:function(u){var f=this.min.array,i=this.max.array,o=u.min.array,d=u.max.array;return f[0]<=o[0]&&f[1]<=o[1]&&f[2]<=o[2]&&i[0]>=d[0]&&i[1]>=d[1]&&i[2]>=d[2]},containPoint:function(u){var f=this.min.array,i=this.max.array,o=u.array;return f[0]<=o[0]&&f[1]<=o[1]&&f[2]<=o[2]&&i[0]>=o[0]&&i[1]>=o[1]&&i[2]>=o[2]},isFinite:function(){var u=this.min.array,f=this.max.array;return isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(f[0])&&isFinite(f[1])&&isFinite(f[2])},applyTransform:function(){var u=A.create(),f=A.create(),i=A.create(),o=A.create(),d=A.create(),m=A.create();return function(_){var h=this.min.array,v=this.max.array,r=_.array;return u[0]=r[0]*h[0],u[1]=r[1]*h[0],u[2]=r[2]*h[0],f[0]=r[0]*v[0],f[1]=r[1]*v[0],f[2]=r[2]*v[0],i[0]=r[4]*h[1],i[1]=r[5]*h[1],i[2]=r[6]*h[1],o[0]=r[4]*v[1],o[1]=r[5]*v[1],o[2]=r[6]*v[1],d[0]=r[8]*h[2],d[1]=r[9]*h[2],d[2]=r[10]*h[2],m[0]=r[8]*v[2],m[1]=r[9]*v[2],m[2]=r[10]*v[2],h[0]=Math.min(u[0],f[0])+Math.min(i[0],o[0])+Math.min(d[0],m[0])+r[12],h[1]=Math.min(u[1],f[1])+Math.min(i[1],o[1])+Math.min(d[1],m[1])+r[13],h[2]=Math.min(u[2],f[2])+Math.min(i[2],o[2])+Math.min(d[2],m[2])+r[14],v[0]=Math.max(u[0],f[0])+Math.max(i[0],o[0])+Math.max(d[0],m[0])+r[12],v[1]=Math.max(u[1],f[1])+Math.max(i[1],o[1])+Math.max(d[1],m[1])+r[13],v[2]=Math.max(u[2],f[2])+Math.max(i[2],o[2])+Math.max(d[2],m[2])+r[14],this.min._dirty=!0,this.max._dirty=!0,this}}(),applyProjection:function(u){var f=this.min.array,i=this.max.array,o=u.array,d=f[0],m=f[1],_=f[2],h=i[0],v=i[1],r=f[2],a=i[0],p=i[1],E=i[2];if(o[15]===1)f[0]=o[0]*d+o[12],f[1]=o[5]*m+o[13],i[2]=o[10]*_+o[14],i[0]=o[0]*a+o[12],i[1]=o[5]*p+o[13],f[2]=o[10]*E+o[14];else{var S=-1/_;f[0]=o[0]*d*S,f[1]=o[5]*m*S,i[2]=(o[10]*_+o[14])*S,S=-1/r,i[0]=o[0]*h*S,i[1]=o[5]*v*S,S=-1/E,f[2]=(o[10]*E+o[14])*S}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){var u=this.vertices;if(!u){for(var u=[],f=0;f<8;f++)u[f]=A.fromValues(0,0,0);this.vertices=u}var i=this.min.array,o=this.max.array;return x(u[0],i[0],i[1],i[2]),x(u[1],i[0],o[1],i[2]),x(u[2],o[0],i[1],i[2]),x(u[3],o[0],o[1],i[2]),x(u[4],i[0],i[1],o[2]),x(u[5],i[0],o[1],o[2]),x(u[6],o[0],i[1],o[2]),x(u[7],o[0],o[1],o[2]),this},copy:function(u){var f=this.min,i=this.max;return s(f.array,u.min.array),s(i.array,u.max.array),f._dirty=!0,i._dirty=!0,this},clone:function(){var u=new c;return u.copy(this),u}},X.a=c},function(re,X,D){"use strict";X.a=function(W,y,L){return{seriesType:W,reset:function(A,s){var x=A.getData(),c=A.visualColorAccessPath.split(".");c[c.length-1]="opacity";var u=A.get(c);x.setVisual("opacity",u==null?1:u);function f(i){var o=x.getItemModel(i),d=o.get(c);d!=null&&x.setItemVisual(i,"opacity",d)}return{dataEach:x.hasItemOption?f:null}}}}},function(re,X,D){"use strict";var W=D(8),y=D(6),L=D(21),A=D(93),s=A.a.parseToFloat,x={};function c(i,o,d){var m=Object.keys(i);m.sort();for(var _=[],h=0;h<m.length;h++){var v=m[h],r=i[v];r===null?_.push(v):_.push(v+" "+r.toString())}return _.join(`
|
|
`)}function u(i,o,d){d.sort();for(var m=[],_=0;_<d.length;_++){var h=d[_];m.push(h)}var v=c(i)+`
|
|
`+c(o)+`
|
|
`+m.join(`
|
|
`);if(x[v])return x[v];var r=L.a.genGUID();return x[v]=r,r}var f=W.a.extend(function(){return{name:"",depthTest:!0,depthMask:!0,transparent:!1,blend:null,autoUpdateTextureStatus:!0,uniforms:{},vertexDefines:{},fragmentDefines:{},_textureStatus:{},_enabledUniforms:null}},function(){this.name||(this.name="MATERIAL_"+this.__uid__),this.shader&&this.attachShader(this.shader,!0)},{precision:"highp",bind:function(i,o,d,m){for(var _=i.gl,h=o.currentTextureSlot(),v=0;v<this._enabledUniforms.length;v++){var r=this._enabledUniforms[v],a=this.uniforms[r].value;if(a instanceof y.a)a.__slot=-1;else if(Array.isArray(a))for(var p=0;p<a.length;p++)a[p]instanceof y.a&&(a[p].__slot=-1)}for(var v=0;v<this._enabledUniforms.length;v++){var r=this._enabledUniforms[v],E=this.uniforms[r],a=E.value;if(a===null){if(E.type==="t"){var S=o.currentTextureSlot(),w=o.setUniform(_,"1i",r,S);w&&o.takeCurrentTextureSlot(i,null)}continue}else if(a instanceof y.a)if(a.__slot<0){var S=o.currentTextureSlot(),w=o.setUniform(_,"1i",r,S);if(!w)continue;o.takeCurrentTextureSlot(i,a),a.__slot=S}else o.setUniform(_,"1i",r,a.__slot);else if(Array.isArray(a)){if(a.length===0)continue;var R=a[0];if(R instanceof y.a){if(!o.hasUniform(r))continue;for(var O=[],p=0;p<a.length;p++){var z=a[p];if(z.__slot<0){var S=o.currentTextureSlot();O.push(S),o.takeCurrentTextureSlot(i,z),z.__slot=S}else O.push(z.__slot)}o.setUniform(_,"1iv",r,O)}else o.setUniform(_,E.type,r,a)}else o.setUniform(_,E.type,r,a)}o.resetTextureSlot(h)},setUniform:function(i,o){o===void 0&&console.warn('Uniform value "'+i+'" is undefined');var d=this.uniforms[i];d&&(typeof o=="string"&&(o=s(o)||o),d.value=o,this.autoUpdateTextureStatus&&d.type==="t"&&(o?this.enableTexture(i):this.disableTexture(i)))},setUniforms:function(i){for(var o in i){var d=i[o];this.setUniform(o,d)}},isUniformEnabled:function(i){return this._enabledUniforms.indexOf(i)>=0},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(i,o){if(typeof i=="object")for(var d in i){var m=i[d];this.setUniform(d,m)}else this.setUniform(i,o)},get:function(i){var o=this.uniforms[i];if(o)return o.value},attachShader:function(i,o){var d=this.uniforms;this.uniforms=i.createUniforms(),this.shader=i;var m=this.uniforms;this._enabledUniforms=Object.keys(m),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter(function(p){var E=this.uniforms[p].type;return E==="t"||E==="tv"},this);var _=this.vertexDefines,h=this.fragmentDefines;if(this.vertexDefines=L.a.clone(i.vertexDefines),this.fragmentDefines=L.a.clone(i.fragmentDefines),o){for(var v in d)m[v]&&(m[v].value=d[v].value);L.a.defaults(this.vertexDefines,_),L.a.defaults(this.fragmentDefines,h)}var r={};for(var a in i.textures)r[a]={shaderType:i.textures[a].shaderType,type:i.textures[a].type,enabled:o&&this._textureStatus[a]?this._textureStatus[a].enabled:!1};this._textureStatus=r,this._programKey=""},clone:function(){var i=new this.constructor({name:this.name,shader:this.shader});for(var o in this.uniforms)i.uniforms[o].value=this.uniforms[o].value;return i.depthTest=this.depthTest,i.depthMask=this.depthMask,i.transparent=this.transparent,i.blend=this.blend,i.vertexDefines=L.a.clone(this.vertexDefines),i.fragmentDefines=L.a.clone(this.fragmentDefines),i.enableTexture(this.getEnabledTextures()),i.precision=this.precision,i},define:function(i,o,d){var m=this.vertexDefines,_=this.fragmentDefines;i!=="vertex"&&i!=="fragment"&&i!=="both"&&arguments.length<3&&(d=o,o=i,i="both"),d=d!=null?d:null,(i==="vertex"||i==="both")&&m[o]!==d&&(m[o]=d,this._programKey=""),(i==="fragment"||i==="both")&&_[o]!==d&&(_[o]=d,i!=="both"&&(this._programKey=""))},undefine:function(i,o){i!=="vertex"&&i!=="fragment"&&i!=="both"&&arguments.length<2&&(o=i,i="both"),(i==="vertex"||i==="both")&&this.isDefined("vertex",o)&&(delete this.vertexDefines[o],this._programKey=""),(i==="fragment"||i==="both")&&this.isDefined("fragment",o)&&(delete this.fragmentDefines[o],i!=="both"&&(this._programKey=""))},isDefined:function(i,o){switch(i){case"vertex":return this.vertexDefines[o]!==void 0;case"fragment":return this.fragmentDefines[o]!==void 0}},getDefine:function(i,o){switch(i){case"vertex":return this.vertexDefines[o];case"fragment":return this.fragmentDefines[o]}},enableTexture:function(i){if(Array.isArray(i)){for(var o=0;o<i.length;o++)this.enableTexture(i[o]);return}var d=this._textureStatus[i];if(d){var m=d.enabled;m||(d.enabled=!0,this._programKey="")}},enableTexturesAll:function(){var i=this._textureStatus;for(var o in i)i[o].enabled=!0;this._programKey=""},disableTexture:function(i){if(Array.isArray(i)){for(var o=0;o<i.length;o++)this.disableTexture(i[o]);return}var d=this._textureStatus[i];if(d){var m=!d.enabled;m||(d.enabled=!1,this._programKey="")}},disableTexturesAll:function(){var i=this._textureStatus;for(var o in i)i[o].enabled=!1;this._programKey=""},isTextureEnabled:function(i){var o=this._textureStatus;return!!o[i]&&o[i].enabled},getEnabledTextures:function(){var i=[],o=this._textureStatus;for(var d in o)o[d].enabled&&i.push(d);return i},dirtyDefines:function(){this._programKey=""}});Object.defineProperty&&(Object.defineProperty(f.prototype,"shader",{get:function(){return this._shader||null},set:function(i){this._shader=i}}),Object.defineProperty(f.prototype,"programKey",{get:function(){return this._programKey||(this._programKey=u(this.vertexDefines,this.fragmentDefines,this.getEnabledTextures())),this._programKey}})),X.a=f},function(re,X,D){"use strict";var W=!0;try{var y=document.createElement("canvas"),L=y.getContext("webgl")||y.getContext("experimental-webgl");if(!L)throw new Error}catch(s){W=!1}var A={};A.supportWebGL=function(){return W},A.Int8Array=typeof Int8Array=="undefined"?Array:Int8Array,A.Uint8Array=typeof Uint8Array=="undefined"?Array:Uint8Array,A.Uint16Array=typeof Uint16Array=="undefined"?Array:Uint16Array,A.Uint32Array=typeof Uint32Array=="undefined"?Array:Uint32Array,A.Int16Array=typeof Int16Array=="undefined"?Array:Int16Array,A.Float32Array=typeof Float32Array=="undefined"?Array:Float32Array,A.Float64Array=typeof Float64Array=="undefined"?Array:Float64Array,X.a=A},function(re,X,D){"use strict";var W=D(28),y=W.a.extend(function(){return{color:[1,1,1],intensity:1,castShadow:!0,shadowResolution:512,group:0}},{type:"",clone:function(){var L=W.a.prototype.clone.call(this);return L.color=Array.prototype.slice.call(this.color),L.intensity=this.intensity,L.castShadow=this.castShadow,L.shadowResolution=this.shadowResolution,L}});X.a=y},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(29),A=D(152),s=D(36),x=D(30),c=D(9),u=D(4),f=D(23),i=D(47),o=D(155),d=D(182),m=D(43);function _(v){v=v||"perspective",this.layer=null,this.scene=new L.a,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(v),this._compositor=new o.a,this._temporalSS=new d.a,this._shadowMapPass=new A.a;for(var r=[],a=0,p=0;p<30;p++){for(var E=[],S=0;S<6;S++)E.push(Object(m.a)(a,2)*4-2),E.push(Object(m.a)(a,3)*4-2),a++;r.push(E)}this._pcfKernels=r,this.scene.on("beforerender",function(w,R,O){this.needsTemporalSS()&&this._temporalSS.jitterProjection(w,O)},this)}_.prototype.setProjection=function(v){var r=this.camera;r&&r.update(),v==="perspective"?this.camera instanceof s.a||(this.camera=new s.a,r&&this.camera.setLocalTransform(r.localTransform)):this.camera instanceof x.a||(this.camera=new x.a,r&&this.camera.setLocalTransform(r.localTransform)),this.camera.near=.1,this.camera.far=2e3},_.prototype.setViewport=function(v,r,a,p,E){this.camera instanceof s.a&&(this.camera.aspect=a/p),E=E||1,this.viewport.x=v,this.viewport.y=r,this.viewport.width=a,this.viewport.height=p,this.viewport.devicePixelRatio=E,this._compositor.resize(a*E,p*E),this._temporalSS.resize(a*E,p*E)},_.prototype.containPoint=function(v,r){var a=this.viewport,p=this.layer.renderer.getHeight();return r=p-r,v>=a.x&&r>=a.y&&v<=a.x+a.width&&r<=a.y+a.height};var h=new f.a;_.prototype.castRay=function(v,r,a){var p=this.layer.renderer,E=p.viewport;return p.viewport=this.viewport,p.screenToNDC(v,r,h),this.camera.castRay(h,a),p.viewport=E,a},_.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this._needsSortProgressively=!1;for(var v=0;v<this.scene.transparentList.length;v++){var r=this.scene.transparentList[v],a=r.geometry;a.needsSortVerticesProgressively&&a.needsSortVerticesProgressively()&&(this._needsSortProgressively=!0),a.needsSortTrianglesProgressively&&a.needsSortTrianglesProgressively()&&(this._needsSortProgressively=!0)}this._frame=0,this._temporalSS.resetFrame()},_.prototype.render=function(v,r){this._doRender(v,r,this._frame),this._frame++},_.prototype.needsAccumulate=function(){return this.needsTemporalSS()||this._needsSortProgressively},_.prototype.needsTemporalSS=function(){var v=this._enableTemporalSS;return v=="auto"&&(v=this._enablePostEffect),v},_.prototype.hasDOF=function(){return this._enableDOF},_.prototype.isAccumulateFinished=function(){return this.needsTemporalSS()?this._temporalSS.isFinished():this._frame>30},_.prototype._doRender=function(v,r,a){var p=this.scene,E=this.camera;if(a=a||0,this._updateTransparent(v,p,E,a),r||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(v,p,E,!0)),this._updateShadowPCFKernel(a),v.gl.clearColor(0,0,0,0),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(v,E),this._compositor.updateNormal(v,p,E,this._temporalSS.getFrame())),this._updateSSAO(v,p,E,this._temporalSS.getFrame()),this._enablePostEffect){var S=this._compositor.getSourceFrameBuffer();S.bind(v),v.gl.clear(v.gl.DEPTH_BUFFER_BIT|v.gl.COLOR_BUFFER_BIT),v.render(p,E,!0,!0),S.unbind(v),this.needsTemporalSS()&&r?(this._compositor.composite(v,E,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),v.setViewport(this.viewport),this._temporalSS.render(v)):(v.setViewport(this.viewport),this._compositor.composite(v,E,null,0))}else if(this.needsTemporalSS()&&r){var S=this._temporalSS.getSourceFrameBuffer();S.bind(v),v.saveClear(),v.clearBit=v.gl.DEPTH_BUFFER_BIT|v.gl.COLOR_BUFFER_BIT,v.render(p,E,!0,!0),v.restoreClear(),S.unbind(v),v.setViewport(this.viewport),this._temporalSS.render(v)}else v.setViewport(this.viewport),v.render(p,E,!0,!0)},_.prototype._updateTransparent=function(v,r,a,p){for(var E=new u.a,S=new c.a,w=a.getWorldPosition(),R=0;R<r.transparentList.length;R++){var O=r.transparentList[R],z=O.geometry;c.a.invert(S,O.worldTransform),u.a.transformMat4(E,w,S),z.needsSortTriangles&&z.needsSortTriangles()&&z.doSortTriangles(E,p),z.needsSortVertices&&z.needsSortVertices()&&z.doSortVertices(E,p)}},_.prototype._updateSSAO=function(v,r,a,p){var E=this._enableSSAO&&this._enablePostEffect;E&&this._compositor.updateSSAO(v,r,a,this._temporalSS.getFrame());for(var S=0;S<r.opaqueList.length;S++){var w=r.opaqueList[S];w.renderNormal&&w.material[E?"enableTexture":"disableTexture"]("ssaoMap"),E&&w.material.set("ssaoMap",this._compositor.getSSAOTexture())}},_.prototype._updateShadowPCFKernel=function(v){for(var r=this._pcfKernels[v%this._pcfKernels.length],a=this.scene.opaqueList,p=0;p<a.length;p++)a[p].receiveShadow&&(a[p].material.set("pcfKernel",r),a[p].material.define("fragment","PCF_KERNEL_SIZE",r.length/2))},_.prototype.dispose=function(v){this._compositor.dispose(v.gl),this._temporalSS.dispose(v.gl),this._shadowMapPass.dispose(v)},_.prototype.setPostEffect=function(v,r){var a=this._compositor;this._enablePostEffect=v.get("enable");var p=v.getModel("bloom"),E=v.getModel("edge"),S=v.getModel("DOF",v.getModel("depthOfField")),w=v.getModel("SSAO",v.getModel("screenSpaceAmbientOcclusion")),R=v.getModel("SSR",v.getModel("screenSpaceReflection")),O=v.getModel("FXAA"),z=v.getModel("colorCorrection");p.get("enable")?a.enableBloom():a.disableBloom(),S.get("enable")?a.enableDOF():a.disableDOF(),R.get("enable")?a.enableSSR():a.disableSSR(),z.get("enable")?a.enableColorCorrection():a.disableColorCorrection(),E.get("enable")?a.enableEdge():a.disableEdge(),O.get("enable")?a.enableFXAA():a.disableFXAA(),this._enableDOF=S.get("enable"),this._enableSSAO=w.get("enable"),this._enableSSAO?a.enableSSAO():a.disableSSAO(),a.setBloomIntensity(p.get("intensity")),a.setEdgeColor(E.get("color")),a.setColorLookupTexture(z.get("lookupTexture"),r),a.setExposure(z.get("exposure")),["radius","quality","intensity"].forEach(function(N){a.setSSAOParameter(N,w.get(N))}),["quality","maxRoughness"].forEach(function(N){a.setSSRParameter(N,R.get(N))}),["quality","focalDistance","focalRange","blurRadius","fstop"].forEach(function(N){a.setDOFParameter(N,S.get(N))}),["brightness","contrast","saturation"].forEach(function(N){a.setColorCorrection(N,z.get(N))})},_.prototype.setDOFFocusOnPoint=function(v){if(this._enablePostEffect)return v>this.camera.far||v<this.camera.near?void 0:(this._compositor.setDOFParameter("focalDistance",v),!0)},_.prototype.setTemporalSuperSampling=function(v){this._enableTemporalSS=v.get("enable")},_.prototype.isLinearSpace=function(){return this._enablePostEffect},_.prototype.setRootNode=function(v){if(this.rootNode!==v){for(var r=this.rootNode.children(),a=0;a<r.length;a++)v.add(r[a]);v!==this.scene&&this.scene.add(v),this.rootNode=v}},_.prototype.add=function(v){this.rootNode.add(v)},_.prototype.remove=function(v){this.rootNode.remove(v)},_.prototype.removeAll=function(v){this.rootNode.removeAll(v)},y.a.util.extend(_.prototype,i.a),X.a=_},function(re,X,D){"use strict";var W=0,y=Array.prototype,L=y.forEach,A={genGUID:function(){return++W},relative2absolute:function(s,x){if(!x||s.match(/^\//))return s;for(var c=s.split("/"),u=x.split("/"),f=c[0];f==="."||f==="..";)f===".."&&u.pop(),c.shift(),f=c[0];return u.join("/")+"/"+c.join("/")},extend:function(s,x){if(x)for(var c in x)x.hasOwnProperty(c)&&(s[c]=x[c]);return s},defaults:function(s,x){if(x)for(var c in x)s[c]===void 0&&(s[c]=x[c]);return s},extendWithPropList:function(s,x,c){if(x)for(var u=0;u<c.length;u++){var f=c[u];s[f]=x[f]}return s},defaultsWithPropList:function(s,x,c){if(x)for(var u=0;u<c.length;u++){var f=c[u];s[f]==null&&(s[f]=x[f])}return s},each:function(s,x,c){if(s&&x)if(s.forEach&&s.forEach===L)s.forEach(x,c);else if(s.length===+s.length)for(var u=0,f=s.length;u<f;u++)x.call(c,s[u],u,s);else for(var i in s)s.hasOwnProperty(i)&&x.call(c,s[i],i,s)},isObject:function(s){return s===Object(s)},isArray:function(s){return Array.isArray(s)},isArrayLike:function(s){return s?s.length===+s.length:!1},clone:function(s){if(A.isObject(s)){if(A.isArray(s))return s.slice();if(A.isArrayLike(s)){for(var x=new s.constructor(s.length),c=0;c<s.length;c++)x[c]=s[c];return x}else return A.extend({},s)}else return s}};X.a=A},function(re,X,D){"use strict";var W=D(13),y=D(0),L=D.n(y),A=D(33),s=D(1),x=D.n(s),c=x.a.vec3,u=[[0,0],[1,1]],f=W.a.extend(function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new W.a.Attribute("position","float",3,"POSITION"),positionPrev:new W.a.Attribute("positionPrev","float",3),positionNext:new W.a.Attribute("positionNext","float",3),prevPositionPrev:new W.a.Attribute("prevPositionPrev","float",3),prevPosition:new W.a.Attribute("prevPosition","float",3),prevPositionNext:new W.a.Attribute("prevPositionNext","float",3),offset:new W.a.Attribute("offset","float",1),color:new W.a.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(i){var o=this.attributes;this.vertexCount!==i&&(o.position.init(i),o.color.init(i),this.useNativeLine||(o.positionPrev.init(i),o.positionNext.init(i),o.offset.init(i)),i>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(i){this.triangleCount!==i&&(i===0?this.indices=null:this.indices=this.vertexCount>65535?new Uint32Array(i*3):new Uint16Array(i*3))},_getCubicCurveApproxStep:function(i,o,d,m){var _=c.dist(i,o)+c.dist(d,o)+c.dist(m,d),h=1/(_+1)*this.segmentScale;return h},getCubicCurveVertexCount:function(i,o,d,m){var _=this._getCubicCurveApproxStep(i,o,d,m),h=Math.ceil(1/_);return this.useNativeLine?h*2:h*2+2},getCubicCurveTriangleCount:function(i,o,d,m){var _=this._getCubicCurveApproxStep(i,o,d,m),h=Math.ceil(1/_);return this.useNativeLine?0:h*2},getLineVertexCount:function(){return this.getPolylineVertexCount(u)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(u)},getPolylineVertexCount:function(i){var o;if(typeof i=="number")o=i;else{var d=typeof i[0]!="number";o=d?i.length:i.length/3}return this.useNativeLine?(o-1)*2:(o-1)*2+2},getPolylineTriangleCount:function(i){var o;if(typeof i=="number")o=i;else{var d=typeof i[0]!="number";o=d?i.length:i.length/3}return this.useNativeLine?0:Math.max(o-1,0)*2},addCubicCurve:function(i,o,d,m,_,h){h==null&&(h=1);for(var v=i[0],r=i[1],a=i[2],p=o[0],E=o[1],S=o[2],w=d[0],R=d[1],O=d[2],z=m[0],N=m[1],P=m[2],F=this._getCubicCurveApproxStep(i,o,d,m),K=F*F,B=K*F,V=3*F,C=3*K,M=6*K,H=6*B,$=v-p*2+w,q=r-E*2+R,se=a-S*2+O,ue=(p-w)*3-v+z,pe=(E-R)*3-r+N,xe=(S-O)*3-a+P,De=v,Ue=r,Ge=a,Ae=(p-v)*V+$*C+ue*B,We=(E-r)*V+q*C+pe*B,we=(S-a)*V+se*C+xe*B,Se=$*M+ue*H,ge=q*M+pe*H,Re=se*M+xe*H,ve=ue*H,Le=pe*H,Fe=xe*H,me=0,oe=0,ie=Math.ceil(1/F),fe=new Float32Array((ie+1)*3),fe=[],ye=0,oe=0;oe<ie+1;oe++)fe[ye++]=De,fe[ye++]=Ue,fe[ye++]=Ge,De+=Ae,Ue+=We,Ge+=we,Ae+=Se,We+=ge,we+=Re,Se+=ve,ge+=Le,Re+=Fe,me+=F,me>1&&(De=Ae>0?Math.min(De,z):Math.max(De,z),Ue=We>0?Math.min(Ue,N):Math.max(Ue,N),Ge=we>0?Math.min(Ge,P):Math.max(Ge,P));return this.addPolyline(fe,_,h)},addLine:function(i,o,d,m){return this.addPolyline([i,o],d,m)},addPolyline:function(i,o,d,m,_){if(i.length){var h=typeof i[0]!="number";if(_==null&&(_=h?i.length:i.length/3),!(_<2)){m==null&&(m=0),d==null&&(d=1),this._itemVertexOffsets.push(this._vertexOffset);var h=typeof i[0]!="number",v=h?typeof o[0]!="number":o.length/4===_,r=this.attributes.position,a=this.attributes.positionPrev,p=this.attributes.positionNext,E=this.attributes.color,S=this.attributes.offset,w=this.indices,R=this._vertexOffset,O,z;d=Math.max(d,.01);for(var N=m;N<_;N++){if(h)O=i[N],v?z=o[N]:z=o;else{var P=N*3;if(O=O||[],O[0]=i[P],O[1]=i[P+1],O[2]=i[P+2],v){var F=N*4;z=z||[],z[0]=o[F],z[1]=o[F+1],z[2]=o[F+2],z[3]=o[F+3]}else z=o}if(this.useNativeLine?N>1&&(r.copy(R,R-1),E.copy(R,R-1),R++):(N<_-1&&(a.set(R+2,O),a.set(R+3,O)),N>0&&(p.set(R-2,O),p.set(R-1,O)),r.set(R,O),r.set(R+1,O),E.set(R,z),E.set(R+1,z),S.set(R,d/2),S.set(R+1,-d/2),R+=2),this.useNativeLine)E.set(R,z),r.set(R,O),R++;else if(N>0){var K=this._triangleOffset*3,w=this.indices;w[K]=R-4,w[K+1]=R-3,w[K+2]=R-2,w[K+3]=R-3,w[K+4]=R-1,w[K+5]=R-2,this._triangleOffset+=2}}if(!this.useNativeLine){var B=this._vertexOffset,V=this._vertexOffset+_*2;a.copy(B,B+2),a.copy(B+1,B+3),p.copy(V-1,V-3),p.copy(V-2,V-4)}return this._vertexOffset=R,this._vertexOffset}}},setItemColor:function(i,o){for(var d=this._itemVertexOffsets[i],m=i<this._itemVertexOffsets.length-1?this._itemVertexOffsets[i+1]:this._vertexOffset,_=d;_<m;_++)this.attributes.color.set(_,o);this.dirty("color")},currentTriangleOffset:function(){return this._triangleOffset},currentVertexOffset:function(){return this._vertexOffset}});L.a.util.defaults(f.prototype,A.a),X.a=f},function(re,X,D){"use strict";var W=D(1),y=D.n(W),L=y.a.vec2,A=function(x,c){x=x||0,c=c||0,this.array=L.fromValues(x,c),this._dirty=!0};if(A.prototype={constructor:A,add:function(x){return L.add(this.array,this.array,x.array),this._dirty=!0,this},set:function(x,c){return this.array[0]=x,this.array[1]=c,this._dirty=!0,this},setArray:function(x){return this.array[0]=x[0],this.array[1]=x[1],this._dirty=!0,this},clone:function(){return new A(this.x,this.y)},copy:function(x){return L.copy(this.array,x.array),this._dirty=!0,this},cross:function(x,c){return L.cross(x.array,this.array,c.array),x._dirty=!0,this},dist:function(x){return L.dist(this.array,x.array)},distance:function(x){return L.distance(this.array,x.array)},div:function(x){return L.div(this.array,this.array,x.array),this._dirty=!0,this},divide:function(x){return L.divide(this.array,this.array,x.array),this._dirty=!0,this},dot:function(x){return L.dot(this.array,x.array)},len:function(){return L.len(this.array)},length:function(){return L.length(this.array)},lerp:function(x,c,u){return L.lerp(this.array,x.array,c.array,u),this._dirty=!0,this},min:function(x){return L.min(this.array,this.array,x.array),this._dirty=!0,this},max:function(x){return L.max(this.array,this.array,x.array),this._dirty=!0,this},mul:function(x){return L.mul(this.array,this.array,x.array),this._dirty=!0,this},multiply:function(x){return L.multiply(this.array,this.array,x.array),this._dirty=!0,this},negate:function(){return L.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return L.normalize(this.array,this.array),this._dirty=!0,this},random:function(x){return L.random(this.array,x),this._dirty=!0,this},scale:function(x){return L.scale(this.array,this.array,x),this._dirty=!0,this},scaleAndAdd:function(x,c){return L.scaleAndAdd(this.array,this.array,x.array,c),this._dirty=!0,this},sqrDist:function(x){return L.sqrDist(this.array,x.array)},squaredDistance:function(x){return L.squaredDistance(this.array,x.array)},sqrLen:function(){return L.sqrLen(this.array)},squaredLength:function(){return L.squaredLength(this.array)},sub:function(x){return L.sub(this.array,this.array,x.array),this._dirty=!0,this},subtract:function(x){return L.subtract(this.array,this.array,x.array),this._dirty=!0,this},transformMat2:function(x){return L.transformMat2(this.array,this.array,x.array),this._dirty=!0,this},transformMat2d:function(x){return L.transformMat2d(this.array,this.array,x.array),this._dirty=!0,this},transformMat3:function(x){return L.transformMat3(this.array,this.array,x.array),this._dirty=!0,this},transformMat4:function(x){return L.transformMat4(this.array,this.array,x.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},Object.defineProperty){var s=A.prototype;Object.defineProperty(s,"x",{get:function(){return this.array[0]},set:function(x){this.array[0]=x,this._dirty=!0}}),Object.defineProperty(s,"y",{get:function(){return this.array[1]},set:function(x){this.array[1]=x,this._dirty=!0}})}A.add=function(x,c,u){return L.add(x.array,c.array,u.array),x._dirty=!0,x},A.set=function(x,c,u){return L.set(x.array,c,u),x._dirty=!0,x},A.copy=function(x,c){return L.copy(x.array,c.array),x._dirty=!0,x},A.cross=function(x,c,u){return L.cross(x.array,c.array,u.array),x._dirty=!0,x},A.dist=function(x,c){return L.distance(x.array,c.array)},A.distance=A.dist,A.div=function(x,c,u){return L.divide(x.array,c.array,u.array),x._dirty=!0,x},A.divide=A.div,A.dot=function(x,c){return L.dot(x.array,c.array)},A.len=function(x){return L.length(x.array)},A.lerp=function(x,c,u,f){return L.lerp(x.array,c.array,u.array,f),x._dirty=!0,x},A.min=function(x,c,u){return L.min(x.array,c.array,u.array),x._dirty=!0,x},A.max=function(x,c,u){return L.max(x.array,c.array,u.array),x._dirty=!0,x},A.mul=function(x,c,u){return L.multiply(x.array,c.array,u.array),x._dirty=!0,x},A.multiply=A.mul,A.negate=function(x,c){return L.negate(x.array,c.array),x._dirty=!0,x},A.normalize=function(x,c){return L.normalize(x.array,c.array),x._dirty=!0,x},A.random=function(x,c){return L.random(x.array,c),x._dirty=!0,x},A.scale=function(x,c,u){return L.scale(x.array,c.array,u),x._dirty=!0,x},A.scaleAndAdd=function(x,c,u,f){return L.scaleAndAdd(x.array,c.array,u.array,f),x._dirty=!0,x},A.sqrDist=function(x,c){return L.sqrDist(x.array,c.array)},A.squaredDistance=A.sqrDist,A.sqrLen=function(x){return L.sqrLen(x.array)},A.squaredLength=A.sqrLen,A.sub=function(x,c,u){return L.subtract(x.array,c.array,u.array),x._dirty=!0,x},A.subtract=A.sub,A.transformMat2=function(x,c,u){return L.transformMat2(x.array,c.array,u.array),x._dirty=!0,x},A.transformMat2d=function(x,c,u){return L.transformMat2d(x.array,c.array,u.array),x._dirty=!0,x},A.transformMat3=function(x,c,u){return L.transformMat3(x.array,c.array,u.array),x._dirty=!0,x},A.transformMat4=function(x,c,u){return L.transformMat4(x.array,c.array,u.array),x._dirty=!0,x},X.a=A},function(re,X,D){"use strict";var W=D(64),y=D(11),L=D(5),A=W.a.extend({skeleton:null,joints:null,useSkinMatricesTexture:!1},function(){this.joints||(this.joints=[])},{isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&this.joints.length>0)},render:function(s,x,c){var u=s.gl;if(this.skeleton){this.skeleton.update();var f=this.skeleton.getSubSkinMatrices(this.__uid__,this.joints);c.setUniformOfSemantic(u,"SKIN_MATRIX",f)}return W.a.prototype.render.call(this,s,x,c)},getSkinMatricesTexture:function(){return this._skinMatricesTexture=this._skinMatricesTexture||new L.a({type:y.a.FLOAT,minFilter:y.a.NEAREST,magFilter:y.a.NEAREST,useMipmap:!1,flipY:!1}),this._skinMatricesTexture}});A.POINTS=y.a.POINTS,A.LINES=y.a.LINES,A.LINE_LOOP=y.a.LINE_LOOP,A.LINE_STRIP=y.a.LINE_STRIP,A.TRIANGLES=y.a.TRIANGLES,A.TRIANGLE_STRIP=y.a.TRIANGLE_STRIP,A.TRIANGLE_FAN=y.a.TRIANGLE_FAN,A.BACK=y.a.BACK,A.FRONT=y.a.FRONT,A.FRONT_AND_BACK=y.a.FRONT_AND_BACK,A.CW=y.a.CW,A.CCW=y.a.CCW,X.a=A},function(re,X,D){"use strict";var W=D(6),y=D(11),L=D(21),A=D(66),s=A.a.isPowerOfTwo,x=["px","nx","py","ny","pz","nz"],c=W.a.extend(function(){return{image:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},pixels:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},mipmaps:[]}},{update:function(f){var i=f.gl;i.bindTexture(i.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),this.updateCommon(f);var o=this.format,d=this.type;i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_S,this.getAvailableWrapS()),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_T,this.getAvailableWrapT()),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var m=f.getGLExtension("EXT_texture_filter_anisotropic");if(m&&this.anisotropic>1&&i.texParameterf(i.TEXTURE_CUBE_MAP,m.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),d===36193){var _=f.getGLExtension("OES_texture_half_float");_||(d=y.a.FLOAT)}if(this.mipmaps.length)for(var h=this.width,v=this.height,r=0;r<this.mipmaps.length;r++){var a=this.mipmaps[r];this._updateTextureData(i,a,r,h,v,o,d),h/=2,v/=2}else this._updateTextureData(i,this,0,this.width,this.height,o,d),!this.NPOT&&this.useMipmap&&i.generateMipmap(i.TEXTURE_CUBE_MAP);i.bindTexture(i.TEXTURE_CUBE_MAP,null)},_updateTextureData:function(f,i,o,d,m,_,h){for(var v=0;v<6;v++){var r=x[v],a=i.image&&i.image[r];a?f.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+v,o,_,_,h,a):f.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+v,o,_,d,m,0,_,h,i.pixels&&i.pixels[r])}},generateMipmap:function(f){var i=f.gl;this.useMipmap&&!this.NPOT&&(i.bindTexture(i.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),i.generateMipmap(i.TEXTURE_CUBE_MAP))},bind:function(f){f.gl.bindTexture(f.gl.TEXTURE_CUBE_MAP,this.getWebGLTexture(f))},unbind:function(f){f.gl.bindTexture(f.gl.TEXTURE_CUBE_MAP,null)},isPowerOfTwo:function(){return this.image.px?s(this.image.px.width)&&s(this.image.px.height):s(this.width)&&s(this.height)},isRenderable:function(){return this.image.px?u(this.image.px)&&u(this.image.nx)&&u(this.image.py)&&u(this.image.ny)&&u(this.image.pz)&&u(this.image.nz):!!(this.width&&this.height)},load:function(f,i){var o=0,d=this;return L.a.each(f,function(m,_){var h=new Image;i&&(h.crossOrigin=i),h.onload=function(){o--,o===0&&(d.dirty(),d.trigger("success",d)),h.onload=null},h.onerror=function(){o--,h.onerror=null},o++,h.src=m,d.image[_]=h}),this}});Object.defineProperty(c.prototype,"width",{get:function(){return this.image&&this.image.px?this.image.px.width:this._width},set:function(f){this.image&&this.image.px?console.warn("Texture from image can't set width"):(this._width!==f&&this.dirty(),this._width=f)}}),Object.defineProperty(c.prototype,"height",{get:function(){return this.image&&this.image.px?this.image.px.height:this._height},set:function(f){this.image&&this.image.px?console.warn("Texture from image can't set height"):(this._height!==f&&this.dirty(),this._height=f)}});function u(f){return f.nodeName==="CANVAS"||f.nodeName==="VIDEO"||f.complete}X.a=c},function(re,X,D){"use strict";X.a={defaultOption:{shading:null,realisticMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},lambertMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},colorMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},hatchingMaterial:{textureTiling:1,textureOffset:0,paperColor:"#fff"}}}},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L={};L.getFormattedLabel=function(A,s,x,c,u){x=x||"normal";var f=A.getData(c),i=f.getItemModel(s),o=A.getDataParams(s,c);u!=null&&o.value instanceof Array&&(o.value=o.value[u]);var d=i.get(x==="normal"?["label","formatter"]:["emphasis","label","formatter"]);d==null&&(d=i.get(["label","formatter"]));var m;return typeof d=="function"?(o.status=x,m=d(o)):typeof d=="string"&&(m=y.a.format.formatTpl(d,o)),m},L.normalizeToArray=function(A){return A instanceof Array?A:A==null?[]:[A]},X.a=L},function(re,X,D){"use strict";var W=D(8),y=D(4),L=D(50),A=D(9),s=D(1),x=D.n(s),c=D(15),u=x.a.mat4,f=0,i=W.a.extend({name:"",position:null,rotation:null,scale:null,worldTransform:null,localTransform:null,autoUpdateLocalTransform:!0,_parent:null,_scene:null,_needsUpdateWorldTransform:!0,_inIterating:!1,__depth:0},function(){this.name||(this.name=(this.type||"NODE")+"_"+f++),this.position||(this.position=new y.a),this.rotation||(this.rotation=new L.a),this.scale||(this.scale=new y.a(1,1,1)),this.worldTransform=new A.a,this.localTransform=new A.a,this._children=[]},{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(o){var d=this._scene;if(d){var m=d._nodeRepository;delete m[this.name],m[o]=this}this.name=o},add:function(o){this._inIterating&&console.warn("Add operation can cause unpredictable error when in iterating");var d=o._parent;if(d!==this){d&&d.remove(o),o._parent=this,this._children.push(o);var m=this._scene;m&&m!==o.scene&&o.traverse(this._addSelfToScene,this),o._needsUpdateWorldTransform=!0}},remove:function(o){this._inIterating&&console.warn("Remove operation can cause unpredictable error when in iterating");var d=this._children,m=d.indexOf(o);m<0||(d.splice(m,1),o._parent=null,this._scene&&o.traverse(this._removeSelfFromScene,this))},removeAll:function(){for(var o=this._children,d=0;d<o.length;d++)o[d]._parent=null,this._scene&&o[d].traverse(this._removeSelfFromScene,this);this._children=[]},getScene:function(){return this._scene},getParent:function(){return this._parent},_removeSelfFromScene:function(o){o._scene.removeFromScene(o),o._scene=null},_addSelfToScene:function(o){this._scene.addToScene(o),o._scene=this._scene},isAncestor:function(o){for(var d=o._parent;d;){if(d===this)return!0;d=d._parent}return!1},children:function(){return this._children.slice()},childAt:function(o){return this._children[o]},getChildByName:function(o){for(var d=this._children,m=0;m<d.length;m++)if(d[m].name===o)return d[m]},getDescendantByName:function(o){for(var d=this._children,m=0;m<d.length;m++){var _=d[m];if(_.name===o)return _;var h=_.getDescendantByName(o);if(h)return h}},queryNode:function(o){if(o){for(var d=o.split("/"),m=this,_=0;_<d.length;_++){var h=d[_];if(h){for(var v=!1,r=m._children,a=0;a<r.length;a++){var p=r[a];if(p.name===h){m=p,v=!0;break}}if(!v)return}}return m}},getPath:function(o){if(!this._parent)return"/";for(var d=this._parent,m=this.name;d._parent&&(m=d.name+"/"+m,d._parent!=o);)d=d._parent;return!d._parent&&o?null:m},traverse:function(o,d,m){this._inIterating=!0,(!m||m.call(d,this))&&o.call(d,this);for(var _=this._children,h=0,v=_.length;h<v;h++)_[h].traverse(o,d,m);this._inIterating=!1},eachChild:function(o,d,m){this._inIterating=!0;for(var _=this._children,h=m==null,v=0,r=_.length;v<r;v++){var a=_[v];(h||a.constructor===m)&&o.call(d,a,v)}this._inIterating=!1},setLocalTransform:function(o){u.copy(this.localTransform.array,o.array),this.decomposeLocalTransform()},decomposeLocalTransform:function(o){var d=o?null:this.scale;this.localTransform.decomposeMatrix(d,this.rotation,this.position)},setWorldTransform:function(o){u.copy(this.worldTransform.array,o.array),this.decomposeWorldTransform()},decomposeWorldTransform:function(){var o=u.create();return function(d){var m=this.localTransform,_=this.worldTransform;this._parent?(u.invert(o,this._parent.worldTransform.array),u.multiply(m.array,o,_.array)):u.copy(m.array,_.array);var h=d?null:this.scale;m.decomposeMatrix(h,this.rotation,this.position)}}(),transformNeedsUpdate:function(){return this.position._dirty||this.rotation._dirty||this.scale._dirty},updateLocalTransform:function(){var o=this.position,d=this.rotation,m=this.scale;if(this.transformNeedsUpdate()){var _=this.localTransform.array;u.fromRotationTranslation(_,d.array,o.array),u.scale(_,_,m.array),d._dirty=!1,m._dirty=!1,o._dirty=!1,this._needsUpdateWorldTransform=!0}},_updateWorldTransformTopDown:function(){var o=this.localTransform.array,d=this.worldTransform.array;this._parent?u.multiplyAffine(d,this._parent.worldTransform.array,o):u.copy(d,o)},updateWorldTransform:function(){for(var o=this;o&&o.getParent()&&o.getParent().transformNeedsUpdate();)o=o.getParent();o.update()},update:function(o){this.autoUpdateLocalTransform?this.updateLocalTransform():o=!0,(o||this._needsUpdateWorldTransform)&&(this._updateWorldTransformTopDown(),o=!0,this._needsUpdateWorldTransform=!1);for(var d=this._children,m=0,_=d.length;m<_;m++)d[m].update(o)},getBoundingBox:function(){function o(h){return!h.invisible&&h.geometry}var d=new c.a,m=new A.a,_=new A.a;return function(h,v){return v=v||new c.a,h=h||o,this._parent?A.a.invert(_,this._parent.worldTransform):A.a.identity(_),this.traverse(function(r){r.geometry&&r.geometry.boundingBox&&(d.copy(r.geometry.boundingBox),A.a.multiply(m,_,r.worldTransform),d.applyTransform(m),v.union(d))},this,o),v}}(),getWorldPosition:function(o){this.transformNeedsUpdate()&&this.updateWorldTransform();var d=this.worldTransform.array;if(o){var m=o.array;return m[0]=d[12],m[1]=d[13],m[2]=d[14],o}else return new y.a(d[12],d[13],d[14])},clone:function(){var o=new this.constructor,d=this._children;o.setName(this.name),o.position.copy(this.position),o.rotation.copy(this.rotation),o.scale.copy(this.scale);for(var m=0;m<d.length;m++)o.add(d[m].clone());return o},rotateAround:function(){var o=new y.a,d=new A.a;return function(m,_,h){o.copy(this.position).subtract(m);var v=this.localTransform;v.identity(),v.translate(m),v.rotate(h,_),d.fromRotationTranslation(this.rotation,o),v.multiply(d),v.scale(this.scale),this.decomposeLocalTransform(),this._needsUpdateWorldTransform=!0}}(),lookAt:function(){var o=new A.a;return function(d,m){o.lookAt(this.position,d,m||this.localTransform.y).invert(),this.setLocalTransform(o),this.target=d}}()});X.a=i},function(re,X,D){"use strict";var W=D(28),y=D(19),L=D(51),A=D(15),s=D(21),x={};function c(i){var o=[],d=Object.keys(i);d.sort();for(var m=0;m<d.length;m++){var _=i[m];o.push(_+" "+i[_])}var h=o.join(`
|
|
`);if(x[h])return x[h];var v=s.a.genGUID();return x[h]=v,v}var u=W.a.extend(function(){return{material:null,autoUpdate:!0,opaqueList:[],transparentList:[],lights:[],viewBoundingBoxLastFrame:new A.a,shadowUniforms:{},_cameraList:[],_lightUniforms:{},_previousLightNumber:{},_lightNumber:{},_lightProgramKeys:{},_opaqueObjectCount:0,_transparentObjectCount:0,_nodeRepository:{}}},function(){this._scene=this},{addToScene:function(i){i instanceof L.a&&(this._cameraList.length>0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(i)),i.name&&(this._nodeRepository[i.name]=i)},removeFromScene:function(i){if(i instanceof L.a){var o=this._cameraList.indexOf(i);o>=0&&this._cameraList.splice(o,1)}i.name&&delete this._nodeRepository[i.name]},getNode:function(i){return this._nodeRepository[i]},cloneNode:function(i){var o=i.clone(),d={},m=function(h,v){h.skeleton&&(v.skeleton=h.skeleton.clone(i,o),v.joints=h.joints.slice()),h.material&&(d[h.material.__uid__]={oldMat:h.material});for(var r=0;r<h._children.length;r++)m(h._children[r],v._children[r])};m(i,o);for(var _ in d)d[_].newMat=d[_].oldMat.clone();return o.traverse(function(h){h.material&&(h.material=d[h.material.__uid__].newMat)}),o},update:function(i,o){if(this.autoUpdate||i){W.a.prototype.update.call(this,i);var d=this.lights,m=this.material&&this.material.transparent;if(this._opaqueObjectCount=0,this._transparentObjectCount=0,d.length=0,this._updateRenderList(this,m),this.opaqueList.length=this._opaqueObjectCount,this.transparentList.length=this._transparentObjectCount,!o){this._previousLightNumber=this._lightNumber;for(var _={},h=0;h<d.length;h++){var v=d[h],r=v.group;_[r]||(_[r]={}),_[r][v.type]=_[r][v.type]||0,_[r][v.type]++}this._lightNumber=_;for(var a in _)this._lightProgramKeys[a]=c(_[a]);this._updateLightUniforms()}}},getMainCamera:function(){return this._cameraList[0]},_updateRenderList:function(i,o){if(!i.invisible)for(var d=0;d<i._children.length;d++){var m=i._children[d];m instanceof y.a?this.lights.push(m):m.isRenderable()&&(m.material.transparent||o?this.transparentList[this._transparentObjectCount++]=m:this.opaqueList[this._opaqueObjectCount++]=m),m._children.length>0&&this._updateRenderList(m)}},_updateLightUniforms:function(){var i=this.lights;i.sort(f);var o=this._lightUniforms;for(var d in o)for(var m in o[d])o[d][m].value.length=0;for(var _=0;_<i.length;_++){var h=i[_],d=h.group;for(var m in h.uniformTemplates){var v=h.uniformTemplates[m],r=v.value(h);if(r!=null){o[d]||(o[d]={}),o[d][m]||(o[d][m]={type:"",value:[]});var a=o[d][m];switch(a.type=v.type+"v",v.type){case"1i":case"1f":case"t":a.value.push(r);break;case"2f":case"3f":case"4f":for(var p=0;p<r.length;p++)a.value.push(r[p]);break;default:console.error("Unkown light uniform type "+v.type)}}}}},getLightGroups:function(){var i=[];for(var o in this._lightNumber)i.push(o);return i},getNumberChangedLightGroups:function(){var i=[];for(var o in this._lightNumber)this.isLightNumberChanged(o)&&i.push(o);return i},isLightNumberChanged:function(i){var o=this._previousLightNumber,d=this._lightNumber;for(var m in d[i])if(!o[i]||d[i][m]!==o[i][m])return!0;for(var m in o[i])if(!d[i]||d[i][m]!==o[i][m])return!0;return!1},getLightsNumbers:function(i){return this._lightNumber[i]},getProgramKey:function(i){return this._lightProgramKeys[i]},setLightUniforms:function(){function i(o,d,m){for(var _ in o){var h=o[_];if(h.type==="tv"){if(!d.hasUniform(_))continue;for(var v=[],r=0;r<h.value.length;r++){var a=h.value[r],p=d.takeCurrentTextureSlot(m,a);v.push(p)}d.setUniform(m.gl,"1iv",_,v)}else d.setUniform(m.gl,h.type,_,h.value)}}return function(o,d,m){i(this._lightUniforms[d],o,m),i(this.shadowUniforms,o,m)}}(),dispose:function(){this.material=null,this.opaqueList=[],this.transparentList=[],this.lights=[],this._lightUniforms={},this._lightNumber={},this._nodeRepository={}}});function f(i,o){if(o.castShadow&&!i.castShadow)return!0}X.a=u},function(re,X,D){"use strict";var W=D(51),y=W.a.extend({left:-1,right:1,near:-1,far:1,top:1,bottom:-1},{updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},decomposeProjectionMatrix:function(){var L=this.projectionMatrix.array;this.left=(-1-L[12])/L[0],this.right=(1-L[12])/L[0],this.top=(1-L[13])/L[5],this.bottom=(-1-L[13])/L[5],this.near=-(-1-L[14])/L[10],this.far=-(1-L[14])/L[10]},clone:function(){var L=W.a.prototype.clone.call(this);return L.left=this.left,L.right=this.right,L.near=this.near,L.far=this.far,L.top=this.top,L.bottom=this.bottom,L}});X.a=y},function(re,X,D){"use strict";X.a={defaultOption:{postEffect:{enable:!1,bloom:{enable:!0,intensity:.1},depthOfField:{enable:!1,focalRange:20,focalDistance:50,blurRadius:10,fstop:2.8,quality:"medium"},screenSpaceAmbientOcclusion:{enable:!1,radius:2,quality:"medium",intensity:1},screenSpaceReflection:{enable:!1,quality:"medium",maxRoughness:.8},colorCorrection:{enable:!0,exposure:0,brightness:0,contrast:1,saturation:1,lookupTexture:""},edge:{enable:!1},FXAA:{enable:!1}},temporalSuperSampling:{enable:"auto"}}}},function(re,X,D){"use strict";X.a={defaultOption:{light:{main:{shadow:!1,shadowQuality:"high",color:"#fff",intensity:1,alpha:0,beta:0},ambient:{color:"#fff",intensity:.2},ambientCubemap:{texture:null,exposure:1,diffuseIntensity:.5,specularIntensity:.5}}}}},function(re,X,D){"use strict";X.a={convertToDynamicArray:function(W){W&&this.resetOffset();var y=this.attributes;for(var L in y)W||!y[L].value?y[L].value=[]:y[L].value=Array.prototype.slice.call(y[L].value);W||!this.indices?this.indices=[]:this.indices=Array.prototype.slice.call(this.indices)},convertToTypedArray:function(){var W=this.attributes;for(var y in W)W[y].value&&W[y].value.length>0?W[y].value=new Float32Array(W[y].value):W[y].value=null;this.indices&&this.indices.length>0&&(this.indices=this.vertexCount>65535?new Uint32Array(this.indices):new Uint16Array(this.indices)),this.dirty()}}},function(re,X,D){"use strict";var W=D(2),y=D(57),L=D(56),A=D(0),s=D.n(A);function x(){}x.prototype={constructor:x,setScene:function(c){this._scene=c,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(c){this._lightRoot=c,this.mainLight=new W.a.DirectionalLight({shadowBias:.005}),this.ambientLight=new W.a.AmbientLight,c.add(this.mainLight),c.add(this.ambientLight)},dispose:function(){this._lightRoot&&(this._lightRoot.remove(this.mainLight),this._lightRoot.remove(this.ambientLight))},updateLight:function(c){var u=this.mainLight,f=this.ambientLight,i=c.getModel("light"),o=i.getModel("main"),d=i.getModel("ambient");u.intensity=o.get("intensity"),f.intensity=d.get("intensity"),u.color=W.a.parseColor(o.get("color")).slice(0,3),f.color=W.a.parseColor(d.get("color")).slice(0,3);var m=o.get("alpha")||0,_=o.get("beta")||0;u.position.setArray(W.a.directionFromAlphaBeta(m,_)),u.lookAt(W.a.Vector3.ZERO),u.castShadow=o.get("shadow"),u.shadowResolution=W.a.getShadowResolution(o.get("shadowQuality"))},updateAmbientCubemap:function(c,u,f){var i=u.getModel("light.ambientCubemap"),o=i.get("texture");if(o){this._cubemapLightsCache=this._cubemapLightsCache||{};var d=this._cubemapLightsCache[o];if(!d){var m=this;d=this._cubemapLightsCache[o]=W.a.createAmbientCubemap(i.option,c,f,function(){m._skybox instanceof y.a&&m._skybox.setEnvironmentMap(d.specular.cubemap),f.getZr().refresh()})}this._lightRoot.add(d.diffuse),this._lightRoot.add(d.specular),this._currentCubemapLights=d}else this._currentCubemapLights&&(this._lightRoot.remove(this._currentCubemapLights.diffuse),this._lightRoot.remove(this._currentCubemapLights.specular),this._currentCubemapLights=null)},updateSkybox:function(c,u,f){var i=u.get("environment"),o=this;function d(){return o._skybox instanceof y.a||(o._skybox&&o._skybox.dispose(c),o._skybox=new y.a),o._skybox}function m(){return o._skybox instanceof L.a||(o._skybox&&o._skybox.dispose(c),o._skybox=new L.a),o._skybox}if(i&&i!=="none")if(i==="auto")if(this._currentCubemapLights){var _=d(),h=this._currentCubemapLights.specular.cubemap;_.setEnvironmentMap(h),this._scene&&_.attachScene(this._scene),_.material.set("lod",2)}else this._skybox&&this._skybox.detachScene();else if(typeof i=="object"&&i.colorStops||typeof i=="string"&&s.a.color.parse(i)){var v=m(),r=new W.a.Texture2D({anisotropic:8,flipY:!1});v.setEnvironmentMap(r);var a=r.image=document.createElement("canvas");a.width=a.height=16;var p=a.getContext("2d"),E=new s.a.graphic.Rect({shape:{x:0,y:0,width:16,height:16},style:{fill:i}});E.brush(p),v.attachScene(this._scene)}else{var v=m(),r=W.a.loadTexture(i,f,{anisotropic:8,flipY:!1});v.setEnvironmentMap(r),v.attachScene(this._scene)}else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var S=u.coordinateSystem;if(this._skybox)if(S&&S.viewGL&&i!=="auto"&&!(i.match&&i.match(/.hdr$/))){var w=S.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[w]("fragment","SRGB_DECODE")}else this._skybox.material.undefine("fragment","SRGB_DECODE")}},X.a=x},function(re,X,D){"use strict";var W=D(0),y=D.n(W);function L(A,s){var x=[];return y.a.util.each(A.dimensions,function(c){var u=A.getDimensionInfo(c),f=u.otherDims,i=f[s];i!=null&&i!==!1&&(x[i]=u.name)}),x}X.a=function(A,s,x){function c(h){var v=!0,r=[],a=L(u,"tooltip");a.length?y.a.util.each(a,function(E){p(u.get(E,s),E)}):y.a.util.each(h,p);function p(E,S){var w=u.getDimensionInfo(S);if(!(!w||w.otherDims.tooltip===!1)){var R=w.type,O=(v?"- "+(w.tooltipName||w.name)+": ":"")+(R==="ordinal"?E+"":R==="time"?x?"":y.a.format.formatTime("yyyy/MM/dd hh:mm:ss",E):y.a.format.addCommas(E));O&&r.push(y.a.format.encodeHTML(O))}}return(v?"<br/>":"")+r.join(v?"<br/>":", ")}var u=A.getData(),f=A.getRawValue(s),i=y.a.util.isArray(f)?c(f):y.a.format.encodeHTML(y.a.format.addCommas(f)),o=u.getName(s),d=u.getItemVisual(s,"color");y.a.util.isObject(d)&&d.colorStops&&(d=(d.colorStops[0]||{}).color),d=d||"transparent";var m=y.a.format.getTooltipMarker(d),_=A.name;return _==="\0-"&&(_=""),_=_?y.a.format.encodeHTML(_)+(x?": ":"<br/>"):"",x?m+_+i:_+m+(o?y.a.format.encodeHTML(o)+": "+i:i)}},function(re,X,D){"use strict";var W=D(51),y=W.a.extend({fov:50,aspect:1,near:.1,far:2e3},{updateProjectionMatrix:function(){var L=this.fov/180*Math.PI;this.projectionMatrix.perspective(L,this.aspect,this.near,this.far)},decomposeProjectionMatrix:function(){var L=this.projectionMatrix.array,A=Math.atan(1/L[5])*2;this.fov=A/Math.PI*180,this.aspect=L[5]/L[0],this.near=L[14]/(L[10]-1),this.far=L[14]/(L[10]+1)},clone:function(){var L=W.a.prototype.clone.call(this);return L.fov=this.fov,L.aspect=this.aspect,L.near=this.near,L.far=this.far,L}});X.a=y},function(re,X,D){"use strict";var W=D(13),y=D(15),L=W.a.extend({dynamic:!1,widthSegments:1,heightSegments:1},function(){this.build()},{build:function(){for(var A=this.heightSegments,s=this.widthSegments,x=this.attributes,c=[],u=[],f=[],i=[],o=0;o<=A;o++)for(var d=o/A,m=0;m<=s;m++){var _=m/s;if(c.push([2*_-1,2*d-1,0]),u&&u.push([_,d]),f&&f.push([0,0,1]),m<s&&o<A){var h=m+o*(s+1);i.push([h,h+1,h+s+1]),i.push([h+s+1,h+1,h+s+2])}}x.position.fromArray(c),x.texcoord0.fromArray(u),x.normal.fromArray(f),this.initIndicesFromArray(i),this.boundingBox=new y.a,this.boundingBox.min.set(-1,-1,0),this.boundingBox.max.set(1,1,0)}});X.a=L},function(re,X,D){"use strict";X.a={defaultOption:{viewControl:{projection:"perspective",autoRotate:!1,autoRotateDirection:"cw",autoRotateSpeed:10,autoRotateAfterStill:3,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",distance:150,minDistance:40,maxDistance:400,orthographicSize:150,maxOrthographicSize:400,minOrthographicSize:20,center:[0,0,0],alpha:0,beta:0,minAlpha:-90,maxAlpha:90}},setView:function(W){W=W||{},this.option.viewControl=this.option.viewControl||{},W.alpha!=null&&(this.option.viewControl.alpha=W.alpha),W.beta!=null&&(this.option.viewControl.beta=W.beta),W.distance!=null&&(this.option.viewControl.distance=W.distance),W.center!=null&&(this.option.viewControl.center=W.center)}}},function(re,X,D){"use strict";var W=D(8),y=D(23),L=D(4),A=D(50),s=D(3),x=s.a.firstNotNull,c={left:0,middle:1,right:2};function u(i){return i instanceof Array||(i=[i,i]),i}var f=W.a.extend(function(){return{zr:null,viewGL:null,_center:new L.a,minDistance:.5,maxDistance:1.5,maxOrthographicSize:300,minOrthographicSize:30,minAlpha:-90,maxAlpha:90,minBeta:-1/0,maxBeta:1/0,autoRotateAfterStill:0,autoRotateDirection:"cw",autoRotateSpeed:60,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",_mode:"rotate",_camera:null,_needsUpdate:!1,_rotating:!1,_phi:0,_theta:0,_mouseX:0,_mouseY:0,_rotateVelocity:new y.a,_panVelocity:new y.a,_distance:500,_zoomSpeed:0,_stillTimeout:0,_animators:[]}},function(){["_mouseDownHandler","_mouseWheelHandler","_mouseMoveHandler","_mouseUpHandler","_pinchHandler","_contextMenuHandler","_update"].forEach(function(i){this[i]=this[i].bind(this)},this)},{init:function(){var i=this.zr;i&&(i.on("mousedown",this._mouseDownHandler),i.on("globalout",this._mouseUpHandler),i.on("mousewheel",this._mouseWheelHandler),i.on("pinch",this._pinchHandler),i.animation.on("frame",this._update),i.dom.addEventListener("contextmenu",this._contextMenuHandler))},dispose:function(){var i=this.zr;i&&(i.off("mousedown",this._mouseDownHandler),i.off("mousemove",this._mouseMoveHandler),i.off("mouseup",this._mouseUpHandler),i.off("mousewheel",this._mouseWheelHandler),i.off("pinch",this._pinchHandler),i.off("globalout",this._mouseUpHandler),i.dom.removeEventListener("contextmenu",this._contextMenuHandler),i.animation.off("frame",this._update)),this.stopAllAnimation()},getDistance:function(){return this._distance},setDistance:function(i){this._distance=i,this._needsUpdate=!0},getOrthographicSize:function(){return this._orthoSize},setOrthographicSize:function(i){this._orthoSize=i,this._needsUpdate=!0},getAlpha:function(){return this._theta/Math.PI*180},getBeta:function(){return-this._phi/Math.PI*180},getCenter:function(){return this._center.toArray()},setAlpha:function(i){i=Math.max(Math.min(this.maxAlpha,i),this.minAlpha),this._theta=i/180*Math.PI,this._needsUpdate=!0},setBeta:function(i){i=Math.max(Math.min(this.maxBeta,i),this.minBeta),this._phi=-i/180*Math.PI,this._needsUpdate=!0},setCenter:function(i){this._center.setArray(i)},setViewGL:function(i){this.viewGL=i},getCamera:function(){return this.viewGL.camera},setFromViewControlModel:function(i,o){o=o||{};var d=o.baseDistance||0,m=o.baseOrthoSize||1,_=i.get("projection");_!=="perspective"&&_!=="orthographic"&&_!=="isometric"&&(console.error("Unkown projection type %s, use perspective projection instead.",_),_="perspective"),this._projection=_,this.viewGL.setProjection(_);var h=i.get("distance")+d,v=i.get("orthographicSize")+m;[["damping",.8],["autoRotate",!1],["autoRotateAfterStill",3],["autoRotateDirection","cw"],["autoRotateSpeed",10],["minDistance",30],["maxDistance",400],["minOrthographicSize",30],["maxOrthographicSize",300],["minAlpha",-90],["maxAlpha",90],["minBeta",-1/0],["maxBeta",1/0],["rotateSensitivity",1],["zoomSensitivity",1],["panSensitivity",1],["panMouseButton","left"],["rotateMouseButton","middle"]].forEach(function(w){this[w[0]]=x(i.get(w[0]),w[1])},this),this.minDistance+=d,this.maxDistance+=d,this.minOrthographicSize+=m,this.maxOrthographicSize+=m;var r=i.ecModel,a={};["animation","animationDurationUpdate","animationEasingUpdate"].forEach(function(w){a[w]=x(i.get(w),r&&r.get(w))});var p=x(o.alpha,i.get("alpha"))||0,E=x(o.beta,i.get("beta"))||0,S=x(o.center,i.get("center"))||[0,0,0];a.animation&&a.animationDurationUpdate>0&&this._notFirst?this.animateTo({alpha:p,beta:E,center:S,distance:h,targetOrthographicSize:v,easing:a.animationEasingUpdate,duration:a.animationDurationUpdate}):(this.setDistance(h),this.setAlpha(p),this.setBeta(E),this.setCenter(S),this.setOrthographicSize(v)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){c[this.panMouseButton]==null&&console.error("Unkown panMouseButton %s. It should be left|middle|right",this.panMouseButton),c[this.rotateMouseButton]==null&&console.error("Unkown rotateMouseButton %s. It should be left|middle|right",this.rotateMouseButton),this.autoRotateDirection!=="cw"&&this.autoRotateDirection!=="ccw"&&console.error("Unkown autoRotateDirection %s. It should be cw|ccw",this.autoRotateDirection)},animateTo:function(i){var o=this.zr,d=this,m={},_={};return i.distance!=null&&(m.distance=this.getDistance(),_.distance=i.distance),i.orthographicSize!=null&&(m.orthographicSize=this.getOrthographicSize(),_.orthographicSize=i.orthographicSize),i.alpha!=null&&(m.alpha=this.getAlpha(),_.alpha=i.alpha),i.beta!=null&&(m.beta=this.getBeta(),_.beta=i.beta),i.center!=null&&(m.center=this.getCenter(),_.center=i.center),this._addAnimator(o.animation.animate(m).when(i.duration||1e3,_).during(function(){m.alpha!=null&&d.setAlpha(m.alpha),m.beta!=null&&d.setBeta(m.beta),m.distance!=null&&d.setDistance(m.distance),m.center!=null&&d.setCenter(m.center),m.orthographicSize!=null&&d.setOrthographicSize(m.orthographicSize),d._needsUpdate=!0})).start(i.easing||"linear")},stopAllAnimation:function(){for(var i=0;i<this._animators.length;i++)this._animators[i].stop();this._animators.length=0},_isAnimating:function(){return this._animators.length>0},_update:function(i){if(this._rotating){var o=(this.autoRotateDirection==="cw"?1:-1)*this.autoRotateSpeed/180*Math.PI;this._phi-=o*i/1e3,this._needsUpdate=!0}else this._rotateVelocity.len()>0&&(this._needsUpdate=!0);(Math.abs(this._zoomSpeed)>.1||this._panVelocity.len()>0)&&(this._needsUpdate=!0),this._needsUpdate&&(i=Math.min(i,50),this._updateDistanceOrSize(i),this._updatePan(i),this._updateRotate(i),this._updateTransform(),this.getCamera().update(),this.zr&&this.zr.refresh(),this.trigger("update"),this._needsUpdate=!1)},_updateRotate:function(i){var o=this._rotateVelocity;this._phi=o.y*i/20+this._phi,this._theta=o.x*i/20+this._theta,this.setAlpha(this.getAlpha()),this.setBeta(this.getBeta()),this._vectorDamping(o,Math.pow(this.damping,i/16))},_updateDistanceOrSize:function(i){this._projection==="perspective"?this._setDistance(this._distance+this._zoomSpeed*i/20):this._setOrthoSize(this._orthoSize+this._zoomSpeed*i/20),this._zoomSpeed*=Math.pow(this.damping,i/16)},_setDistance:function(i){this._distance=Math.max(Math.min(i,this.maxDistance),this.minDistance)},_setOrthoSize:function(i){this._orthoSize=Math.max(Math.min(i,this.maxOrthographicSize),this.minOrthographicSize);var o=this.getCamera(),d=this._orthoSize,m=d/this.viewGL.viewport.height*this.viewGL.viewport.width;o.left=-m/2,o.right=m/2,o.top=d/2,o.bottom=-d/2},_updatePan:function(i){var o=this._panVelocity,d=this._distance,m=this.getCamera(),_=m.worldTransform.y,h=m.worldTransform.x;this._center.scaleAndAdd(h,-o.x*d/200).scaleAndAdd(_,-o.y*d/200),this._vectorDamping(o,0)},_updateTransform:function(){var i=this.getCamera(),o=new L.a,d=this._theta+Math.PI/2,m=this._phi+Math.PI/2,_=Math.sin(d);o.x=_*Math.cos(m),o.y=-Math.cos(d),o.z=_*Math.sin(m),i.position.copy(this._center).scaleAndAdd(o,this._distance),i.rotation.identity().rotateY(-this._phi).rotateX(-this._theta)},_startCountingStill:function(){clearTimeout(this._stillTimeout);var i=this.autoRotateAfterStill,o=this;!isNaN(i)&&i>0&&(this._stillTimeout=setTimeout(function(){o._rotating=!0},i*1e3))},_vectorDamping:function(i,o){var d=i.len();d=d*o,d<1e-4&&(d=0),i.normalize().scale(d)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var i=this.getCamera().worldTransform.z,o=Math.asin(i.y),d=Math.atan2(i.x,i.z);this._theta=o,this._phi=-d,this.setBeta(this.getBeta()),this.setAlpha(this.getAlpha()),this.getCamera().aspect?this._setDistance(this.getCamera().position.dist(this._center)):this._setOrthoSize(this.getCamera().top-this.getCamera().bottom)}},_mouseDownHandler:function(i){if(!i.target&&!this._isAnimating()){var o=i.offsetX,d=i.offsetY;this.viewGL&&!this.viewGL.containPoint(o,d)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),i.event.targetTouches?i.event.targetTouches.length===1&&(this._mode="rotate"):i.event.button===c[this.rotateMouseButton]?this._mode="rotate":i.event.button===c[this.panMouseButton]?this._mode="pan":this._mode="",this._rotateVelocity.set(0,0),this._rotating=!1,this.autoRotate&&this._startCountingStill(),this._mouseX=i.offsetX,this._mouseY=i.offsetY)}},_mouseMoveHandler:function(i){if(!(i.target&&i.target.__isGLToZRProxy)&&!this._isAnimating()){var o=u(this.panSensitivity),d=u(this.rotateSensitivity);this._mode==="rotate"?(this._rotateVelocity.y=(i.offsetX-this._mouseX)/this.zr.getHeight()*2*d[0],this._rotateVelocity.x=(i.offsetY-this._mouseY)/this.zr.getWidth()*2*d[1]):this._mode==="pan"&&(this._panVelocity.x=(i.offsetX-this._mouseX)/this.zr.getWidth()*o[0]*400,this._panVelocity.y=(-i.offsetY+this._mouseY)/this.zr.getHeight()*o[1]*400),this._mouseX=i.offsetX,this._mouseY=i.offsetY,i.event.preventDefault()}},_mouseWheelHandler:function(i){if(!this._isAnimating()){var o=i.event.wheelDelta||-i.event.detail;this._zoomHandler(i,o)}},_pinchHandler:function(i){this._isAnimating()||(this._zoomHandler(i,i.pinchScale>1?1:-1),this._mode="")},_zoomHandler:function(i,o){if(o!==0){var d=i.offsetX,m=i.offsetY;if(!(this.viewGL&&!this.viewGL.containPoint(d,m))){var _;this._projection==="perspective"?_=Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):_=Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(o>0?-1:1)*_*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&this._mode==="rotate"&&this._startCountingStill(),i.event.preventDefault()}}},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return this.rotateMouseButton==="right"||this.panMouseButton==="right"},_contextMenuHandler:function(i){this._isRightMouseButtonUsed()&&i.preventDefault()},_addAnimator:function(i){var o=this._animators;return o.push(i),i.done(function(){var d=o.indexOf(i);d>=0&&o.splice(d,1)}),i}});Object.defineProperty(f.prototype,"autoRotate",{get:function(i){return this._autoRotate},set:function(i){this._autoRotate=i,this._rotating=i}}),X.a=f},function(re,X,D){"use strict";X.a=`@export ecgl.lines3D.vertex
|
|
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
|
|
attribute vec3 position: POSITION;
|
|
attribute vec4 a_Color : COLOR;
|
|
varying vec4 v_Color;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = worldViewProjection * vec4(position, 1.0);
|
|
v_Color = a_Color;
|
|
}
|
|
|
|
@end
|
|
|
|
@export ecgl.lines3D.fragment
|
|
|
|
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
|
|
|
|
varying vec4 v_Color;
|
|
|
|
@import clay.util.srgb
|
|
|
|
void main()
|
|
{
|
|
#ifdef SRGB_DECODE
|
|
gl_FragColor = sRGBToLinear(color * v_Color);
|
|
#else
|
|
gl_FragColor = color * v_Color;
|
|
#endif
|
|
}
|
|
@end
|
|
|
|
|
|
|
|
@export ecgl.lines3D.clipNear
|
|
|
|
vec4 clipNear(vec4 p1, vec4 p2) {
|
|
float n = (p1.w - near) / (p1.w - p2.w);
|
|
return vec4(mix(p1.xy, p2.xy, n), -near, near);
|
|
}
|
|
|
|
@end
|
|
|
|
@export ecgl.lines3D.expandLine
|
|
#ifdef VERTEX_ANIMATION
|
|
vec4 prevProj = worldViewProjection * vec4(mix(prevPositionPrev, positionPrev, percent), 1.0);
|
|
vec4 currProj = worldViewProjection * vec4(mix(prevPosition, position, percent), 1.0);
|
|
vec4 nextProj = worldViewProjection * vec4(mix(prevPositionNext, positionNext, percent), 1.0);
|
|
#else
|
|
vec4 prevProj = worldViewProjection * vec4(positionPrev, 1.0);
|
|
vec4 currProj = worldViewProjection * vec4(position, 1.0);
|
|
vec4 nextProj = worldViewProjection * vec4(positionNext, 1.0);
|
|
#endif
|
|
|
|
if (currProj.w < 0.0) {
|
|
if (nextProj.w > 0.0) {
|
|
currProj = clipNear(currProj, nextProj);
|
|
}
|
|
else if (prevProj.w > 0.0) {
|
|
currProj = clipNear(currProj, prevProj);
|
|
}
|
|
}
|
|
|
|
vec2 prevScreen = (prevProj.xy / abs(prevProj.w) + 1.0) * 0.5 * viewport.zw;
|
|
vec2 currScreen = (currProj.xy / abs(currProj.w) + 1.0) * 0.5 * viewport.zw;
|
|
vec2 nextScreen = (nextProj.xy / abs(nextProj.w) + 1.0) * 0.5 * viewport.zw;
|
|
|
|
vec2 dir;
|
|
float len = offset;
|
|
if (position == positionPrev) {
|
|
dir = normalize(nextScreen - currScreen);
|
|
}
|
|
else if (position == positionNext) {
|
|
dir = normalize(currScreen - prevScreen);
|
|
}
|
|
else {
|
|
vec2 dirA = normalize(currScreen - prevScreen);
|
|
vec2 dirB = normalize(nextScreen - currScreen);
|
|
|
|
vec2 tanget = normalize(dirA + dirB);
|
|
|
|
float miter = 1.0 / max(dot(tanget, dirA), 0.5);
|
|
len *= miter;
|
|
dir = tanget;
|
|
}
|
|
|
|
dir = vec2(-dir.y, dir.x) * len;
|
|
currScreen += dir;
|
|
|
|
currProj.xy = (currScreen / viewport.zw - 0.5) * 2.0 * abs(currProj.w);
|
|
@end
|
|
|
|
|
|
@export ecgl.meshLines3D.vertex
|
|
|
|
attribute vec3 position: POSITION;
|
|
attribute vec3 positionPrev;
|
|
attribute vec3 positionNext;
|
|
attribute float offset;
|
|
attribute vec4 a_Color : COLOR;
|
|
|
|
#ifdef VERTEX_ANIMATION
|
|
attribute vec3 prevPosition;
|
|
attribute vec3 prevPositionPrev;
|
|
attribute vec3 prevPositionNext;
|
|
uniform float percent : 1.0;
|
|
#endif
|
|
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
uniform vec4 viewport : VIEWPORT;
|
|
uniform float near : NEAR;
|
|
|
|
varying vec4 v_Color;
|
|
|
|
@import ecgl.common.wireframe.vertexHeader
|
|
|
|
@import ecgl.lines3D.clipNear
|
|
|
|
void main()
|
|
{
|
|
@import ecgl.lines3D.expandLine
|
|
|
|
gl_Position = currProj;
|
|
|
|
v_Color = a_Color;
|
|
|
|
@import ecgl.common.wireframe.vertexMain
|
|
}
|
|
@end
|
|
|
|
|
|
@export ecgl.meshLines3D.fragment
|
|
|
|
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
|
|
|
|
varying vec4 v_Color;
|
|
|
|
@import ecgl.common.wireframe.fragmentHeader
|
|
|
|
@import clay.util.srgb
|
|
|
|
void main()
|
|
{
|
|
#ifdef SRGB_DECODE
|
|
gl_FragColor = sRGBToLinear(color * v_Color);
|
|
#else
|
|
gl_FragColor = color * v_Color;
|
|
#endif
|
|
|
|
@import ecgl.common.wireframe.fragmentMain
|
|
}
|
|
|
|
@end`},function(re,X,D){var W=D(12),y=D(75),L=D(78),A=L.parsePercent,s=D(149),x=W.each,c=["left","right","top","bottom","width","height"],u=[["width","left","right"],["height","top","bottom"]];function f(E,S,w,R,O){var z=0,N=0;R==null&&(R=1/0),O==null&&(O=1/0);var P=0;S.eachChild(function(F,K){var B=F.position,V=F.getBoundingRect(),C=S.childAt(K+1),M=C&&C.getBoundingRect(),H,$;if(E==="horizontal"){var q=V.width+(M?-M.x+V.x:0);H=z+q,H>R||F.newline?(z=0,H=q,N+=P+w,P=V.height):P=Math.max(P,V.height)}else{var se=V.height+(M?-M.y+V.y:0);$=N+se,$>O||F.newline?(z+=P+w,N=0,$=se,P=V.width):P=Math.max(P,V.width)}F.newline||(B[0]=z,B[1]=N,E==="horizontal"?z=H+w:N=$+w)})}var i=f,o=W.curry(f,"vertical"),d=W.curry(f,"horizontal");function m(E,S,w){var R=S.width,O=S.height,z=A(E.x,R),N=A(E.y,O),P=A(E.x2,R),F=A(E.y2,O);return(isNaN(z)||isNaN(parseFloat(E.x)))&&(z=0),(isNaN(P)||isNaN(parseFloat(E.x2)))&&(P=R),(isNaN(N)||isNaN(parseFloat(E.y)))&&(N=0),(isNaN(F)||isNaN(parseFloat(E.y2)))&&(F=O),w=s.normalizeCssArray(w||0),{width:Math.max(P-z-w[1]-w[3],0),height:Math.max(F-N-w[0]-w[2],0)}}function _(E,S,w){w=s.normalizeCssArray(w||0);var R=S.width,O=S.height,z=A(E.left,R),N=A(E.top,O),P=A(E.right,R),F=A(E.bottom,O),K=A(E.width,R),B=A(E.height,O),V=w[2]+w[0],C=w[1]+w[3],M=E.aspect;switch(isNaN(K)&&(K=R-P-C-z),isNaN(B)&&(B=O-F-V-N),M!=null&&(isNaN(K)&&isNaN(B)&&(M>R/O?K=R*.8:B=O*.8),isNaN(K)&&(K=M*B),isNaN(B)&&(B=K/M)),isNaN(z)&&(z=R-P-K-C),isNaN(N)&&(N=O-F-B-V),E.left||E.right){case"center":z=R/2-K/2-w[3];break;case"right":z=R-K-C;break}switch(E.top||E.bottom){case"middle":case"center":N=O/2-B/2-w[0];break;case"bottom":N=O-B-V;break}z=z||0,N=N||0,isNaN(K)&&(K=R-C-z-(P||0)),isNaN(B)&&(B=O-V-N-(F||0));var H=new y(z+w[3],N+w[0],K,B);return H.margin=w,H}function h(E,S,w,R,O){var z=!O||!O.hv||O.hv[0],N=!O||!O.hv||O.hv[1],P=O&&O.boundingMode||"all";if(!(!z&&!N)){var F;if(P==="raw")F=E.type==="group"?new y(0,0,+S.width||0,+S.height||0):E.getBoundingRect();else if(F=E.getBoundingRect(),E.needLocalTransform()){var K=E.getLocalTransform();F=F.clone(),F.applyTransform(K)}S=_(W.defaults({width:F.width,height:F.height},S),w,R);var B=E.position,V=z?S.x-F.x:0,C=N?S.y-F.y:0;E.attr("position",P==="raw"?[V,C]:[B[0]+V,B[1]+C])}}function v(E,S){return E[u[S][0]]!=null||E[u[S][1]]!=null&&E[u[S][2]]!=null}function r(E,S,w){!W.isObject(w)&&(w={});var R=w.ignoreSize;!W.isArray(R)&&(R=[R,R]);var O=N(u[0],0),z=N(u[1],1);K(u[0],E,O),K(u[1],E,z);function N(B,V){var C={},M=0,H={},$=0,q=2;if(x(B,function(pe){H[pe]=E[pe]}),x(B,function(pe){P(S,pe)&&(C[pe]=H[pe]=S[pe]),F(C,pe)&&M++,F(H,pe)&&$++}),R[V])return F(S,B[1])?H[B[2]]=null:F(S,B[2])&&(H[B[1]]=null),H;if($===q||!M)return H;if(M>=q)return C;for(var se=0;se<B.length;se++){var ue=B[se];if(!P(C,ue)&&P(E,ue)){C[ue]=E[ue];break}}return C}function P(B,V){return B.hasOwnProperty(V)}function F(B,V){return B[V]!=null&&B[V]!=="auto"}function K(B,V,C){x(B,function(M){V[M]=C[M]})}}function a(E){return p({},E)}function p(E,S){return S&&E&&x(c,function(w){S.hasOwnProperty(w)&&(E[w]=S[w])}),E}X.LOCATION_PARAMS=c,X.HV_NAMES=u,X.box=i,X.vbox=o,X.hbox=d,X.getAvailableSize=m,X.getLayoutRect=_,X.positionElement=h,X.sizeCalculable=v,X.mergeLayoutParam=r,X.getLayoutParams=a,X.copyLayoutParams=p},function(re,X,D){"use strict";var W=D(8),y=W.a.extend(function(){return{name:"",inputLinks:{},outputLinks:{},_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}},{updateParameter:function(L,A){var s=this.outputs[L],x=s.parameters,c=s._parametersCopy;if(c||(c=s._parametersCopy={}),x)for(var u in x)u!=="width"&&u!=="height"&&(c[u]=x[u]);var f,i;return x.width instanceof Function?f=x.width.call(this,A):f=x.width,x.height instanceof Function?i=x.height.call(this,A):i=x.height,(c.width!==f||c.height!==i)&&this._outputTextures[L]&&this._outputTextures[L].dispose(A.gl),c.width=f,c.height=i,c},setParameter:function(L,A){},getParameter:function(L){},setParameters:function(L){for(var A in L)this.setParameter(A,L[A])},render:function(){},getOutput:function(L,A){if(A==null)return A=L,this._outputTextures[A];var s=this.outputs[A];if(s)return this._rendered?s.outputLastFrame?this._prevOutputTextures[A]:this._outputTextures[A]:this._rendering?(this._prevOutputTextures[A]||(this._prevOutputTextures[A]=this._compositor.allocateTexture(s.parameters||{})),this._prevOutputTextures[A]):(this.render(L),this._outputTextures[A])},removeReference:function(L){if(this._outputReferences[L]--,this._outputReferences[L]===0){var A=this.outputs[L];A.keepLastFrame?(this._prevOutputTextures[L]&&this._compositor.releaseTexture(this._prevOutputTextures[L]),this._prevOutputTextures[L]=this._outputTextures[L]):this._compositor.releaseTexture(this._outputTextures[L])}},link:function(L,A,s){this.inputLinks[L]={node:A,pin:s},A.outputLinks[s]||(A.outputLinks[s]=[]),A.outputLinks[s].push({node:this,pin:L}),this.pass.material.enableTexture(L)},clear:function(){this.inputLinks={},this.outputLinks={}},updateReference:function(L){if(!this._rendering){this._rendering=!0;for(var A in this.inputLinks){var s=this.inputLinks[A];s.node.updateReference(s.pin)}this._rendering=!1}L&&this._outputReferences[L]++},beforeFrame:function(){this._rendered=!1;for(var L in this.outputLinks)this._outputReferences[L]=0},afterFrame:function(){for(var L in this.outputLinks)if(this._outputReferences[L]>0){var A=this.outputs[L];A.keepLastFrame?(this._prevOutputTextures[L]&&this._compositor.releaseTexture(this._prevOutputTextures[L]),this._prevOutputTextures[L]=this._outputTextures[L]):this._compositor.releaseTexture(this._outputTextures[L])}}});X.a=y},function(re,X,D){"use strict";function W(y,L){for(var A=0,s=1/L,x=y;x>0;)A=A+s*(x%L),x=Math.floor(x/L),s=s/L;return A}X.a=W},function(re,X,D){"use strict";var W=D(0),y=D.n(W);X.a=function(L,A,s){s=s||L.getSource();var x=A||y.a.getCoordinateSystemDimensions(L.get("coordinateSystem"))||["x","y","z"],c=y.a.helper.createDimensions(s,{dimensionsDefine:s.dimensionsDefine||L.get("dimensions"),encodeDefine:s.encodeDefine||L.get("encode"),coordDimensions:x.map(function(f){var i=L.getReferringComponents(f+"Axis3D")[0];return{type:i&&i.get("type")==="category"?"ordinal":"float",name:f,stackable:f==="z"}})});L.get("coordinateSystem")==="cartesian3D"&&c.forEach(function(f){if(x.indexOf(f.coordDim)>=0){var i=L.getReferringComponents(f.coordDim+"Axis3D")[0];i&&i.get("type")==="category"&&(f.ordinalMeta=i.getOrdinalMeta())}});var u=new y.a.List(c,L);return u.initData(s),u}},function(re,X){function D(W,y,L){return{seriesType:W,performRawSeries:!0,reset:function(A,s,x){var c=A.getData(),u=A.get("symbol")||y,f=A.get("symbolSize");if(c.setVisual({legendSymbol:L||u,symbol:u,symbolSize:f}),s.isSeriesFiltered(A))return;var i=typeof f=="function";function o(d,m){if(typeof f=="function"){var _=A.getRawValue(m),h=A.getDataParams(m);d.setItemVisual(m,"symbolSize",f(_,h))}if(d.hasItemOption){var v=d.getItemModel(m),r=v.getShallow("symbol",!0),a=v.getShallow("symbolSize",!0);r!=null&&d.setItemVisual(m,"symbol",r),a!=null&&d.setItemVisual(m,"symbolSize",a)}}return{dataEach:c.hasItemOption||i?o:null}}}}re.exports=D},function(re,X,D){"use strict";var W=D(8),y=D(92),L=D(11),A=D(18),s=D(15),x=D(9),c=D(17),u=D(23),f=D(96),i=D(7),o=D(98),d=D(63),m=D(1),_=D.n(m);i.a.import(o.a),i.a.import(d.a);var h=_.a.mat4,v=_.a.vec3,r=h.create,a={};function p(R){return R.material}function E(){}var S=W.a.extend(function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:window.devicePixelRatio||1,clearColor:[0,0,0,0],clearBit:17664,alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,throwError:!0,gl:null,viewport:{},__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}},function(){this.canvas||(this.canvas=document.createElement("canvas"));var R=this.canvas;try{var O={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer};if(this.gl=R.getContext("webgl",O)||R.getContext("experimental-webgl",O),!this.gl)throw new Error;this._glinfo=new y.a(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),this.gl.targetRenderer=this,this.resize()}catch(z){throw"Error creating WebGL Context "+z}this._programMgr=new f.a(this)},{resize:function(R,O){var z=this.canvas,N=this.devicePixelRatio;R!=null?(z.style.width=R+"px",z.style.height=O+"px",z.width=R*N,z.height=O*N,this._width=R,this._height=O):(this._width=z.width/N,this._height=z.height/N),this.setViewport(0,0,this._width,this._height)},getWidth:function(){return this._width},getHeight:function(){return this._height},getViewportAspect:function(){var R=this.viewport;return R.width/R.height},setDevicePixelRatio:function(R){this.devicePixelRatio=R,this.resize(this._width,this._height)},getDevicePixelRatio:function(){return this.devicePixelRatio},getGLExtension:function(R){return this._glinfo.getExtension(R)},getGLParameter:function(R){return this._glinfo.getParameter(R)},setViewport:function(R,O,z,N,P){if(typeof R=="object"){var F=R;R=F.x,O=F.y,z=F.width,N=F.height,P=F.devicePixelRatio}P=P||this.devicePixelRatio,this.gl.viewport(R*P,O*P,z*P,N*P),this.viewport={x:R,y:O,width:z,height:N,devicePixelRatio:P}},saveViewport:function(){this._viewportStack.push(this.viewport)},restoreViewport:function(){this._viewportStack.length>0&&this.setViewport(this._viewportStack.pop())},saveClear:function(){this._clearStack.push({clearBit:this.clearBit,clearColor:this.clearColor})},restoreClear:function(){if(this._clearStack.length>0){var R=this._clearStack.pop();this.clearColor=R.clearColor,this.clearBit=R.clearBit}},bindSceneRendering:function(R){this._sceneRendering=R},render:function(R,O,z,N){var P=this.gl,F=this.clearColor;if(this.clearBit){P.colorMask(!0,!0,!0,!0),P.depthMask(!0);var K=this.viewport,B=!1,V=K.devicePixelRatio;(K.width!==this._width||K.height!==this._height||V&&V!==this.devicePixelRatio||K.x||K.y)&&(B=!0,P.enable(P.SCISSOR_TEST),P.scissor(K.x*V,K.y*V,K.width*V,K.height*V)),P.clearColor(F[0],F[1],F[2],F[3]),P.clear(this.clearBit),B&&P.disable(P.SCISSOR_TEST)}if(z||R.update(!1),O=O||R.getMainCamera(),!O){console.error("Can't find camera in the scene.");return}O.getScene()||O.update(!0),this._sceneRendering=R,R.viewBoundingBoxLastFrame.min.set(1/0,1/0,1/0),R.viewBoundingBoxLastFrame.max.set(-1/0,-1/0,-1/0);var C=this.cullRenderList(R.opaqueList,R,O),M=this.cullRenderList(R.transparentList,R,O),H=R.material;R.trigger("beforerender",this,R,O),N?(this.renderPreZ(C,R,O),P.depthFunc(P.LEQUAL)):P.depthFunc(P.LESS);for(var $=r(),q=v.create(),se=0;se<M.length;se++){var ue=M[se];h.multiplyAffine($,O.viewMatrix.array,ue.worldTransform.array),v.transformMat4(q,ue.position.array,$),ue.__depth=q[2]}var pe=this.renderPass(C,O,{getMaterial:function(Ge){return H||Ge.material},sortCompare:this.opaqueSortCompare}),xe=this.renderPass(M,O,{getMaterial:function(Ge){return H||Ge.material},sortCompare:this.transparentSortCompare}),De={};for(var Ue in pe)De[Ue]=pe[Ue]+xe[Ue];return R.trigger("afterrender",this,R,O,De),this._sceneRendering=null,De},getProgram:function(R,O,z){return O=O||R.material,this._programMgr.getProgram(R,O,z)},validateProgram:function(R){if(R.__error){var O=R.__error;if(a[R.__uid__])return;if(a[R.__uid__]=!0,this.throwError)throw new Error(O);this.trigger("error",O)}},updatePrograms:function(R,O,z){var N=z&&z.getMaterial||p;O=O||null;for(var P=0;P<R.length;P++){var F=R[P],K=N.call(this,F);if(P>0){var B=R[P-1],V=B.joints?B.joints.length:0,C=F.joints.length?F.joints.length:0;if(C===V&&F.material===B.material&&F.lightGroup===B.lightGroup){F.__program=B.__program;continue}}var M=this._programMgr.getProgram(F,K,O);this.validateProgram(M),F.__program=M}},cullRenderList:function(R,O,z){for(var N=[],P=0;P<R.length;P++){var F=R[P],K=F.isSkinnedMesh()?w.IDENTITY:F.worldTransform.array,B=F.geometry;h.multiplyAffine(w.WORLDVIEW,z.viewMatrix.array,K),!(B.boundingBox&&this.isFrustumCulled(F,O,z,w.WORLDVIEW,z.projectionMatrix.array))&&N.push(F)}return N},renderPass:function(R,O,z){this.trigger("beforerenderpass",this,R,O,z);var N={triangleCount:0,vertexCount:0,drawCallCount:0,meshCount:R.length,renderedMeshCount:0};z=z||{},z.getMaterial=z.getMaterial||p,z.beforeRender=z.beforeRender||E,z.afterRender=z.afterRender||E,this.updatePrograms(R,this._sceneRendering,z),z.sortCompare&&R.sort(z.sortCompare);var P=this.viewport,F=P.devicePixelRatio,K=[P.x*F,P.y*F,P.width*F,P.height*F],B=this.devicePixelRatio,V=this.__currentFrameBuffer?[this.__currentFrameBuffer.getTextureWidth(),this.__currentFrameBuffer.getTextureHeight()]:[this._width*B,this._height*B],C=[K[2],K[3]],M=Date.now();h.copy(w.VIEW,O.viewMatrix.array),h.copy(w.PROJECTION,O.projectionMatrix.array),h.multiply(w.VIEWPROJECTION,O.projectionMatrix.array,w.VIEW),h.copy(w.VIEWINVERSE,O.worldTransform.array),h.invert(w.PROJECTIONINVERSE,w.PROJECTION),h.invert(w.VIEWPROJECTIONINVERSE,w.VIEWPROJECTION);for(var H=this.gl,$=this._sceneRendering,q,se,ue,pe,xe,De,Ue,Ge,Ae=0;Ae<R.length;Ae++){var We=R[Ae];if(!(z.ifRender&&!z.ifRender(We))){var we=We.isSkinnedMesh()?w.IDENTITY:We.worldTransform.array,Se=z.getMaterial.call(this,We),ge=We.__program,Re=Se.shader;h.copy(w.WORLD,we),h.multiply(w.WORLDVIEWPROJECTION,w.VIEWPROJECTION,we),(Re.matrixSemantics.WORLDINVERSE||Re.matrixSemantics.WORLDINVERSETRANSPOSE)&&h.invert(w.WORLDINVERSE,we),(Re.matrixSemantics.WORLDVIEWINVERSE||Re.matrixSemantics.WORLDVIEWINVERSETRANSPOSE)&&h.invert(w.WORLDVIEWINVERSE,w.WORLDVIEW),(Re.matrixSemantics.WORLDVIEWPROJECTIONINVERSE||Re.matrixSemantics.WORLDVIEWPROJECTIONINVERSETRANSPOSE)&&h.invert(w.WORLDVIEWPROJECTIONINVERSE,w.WORLDVIEWPROJECTION),We.beforeRender(this),z.beforeRender.call(this,We,Se,q);var ve=ge!==se;ve?(ge.bind(this),ge.setUniformOfSemantic(H,"VIEWPORT",K),ge.setUniformOfSemantic(H,"WINDOW_SIZE",V),ge.setUniformOfSemantic(H,"NEAR",O.near),ge.setUniformOfSemantic(H,"FAR",O.far),ge.setUniformOfSemantic(H,"DEVICEPIXELRATIO",F),ge.setUniformOfSemantic(H,"TIME",M),ge.setUniformOfSemantic(H,"VIEWPORT_SIZE",C),$&&$.setLightUniforms(ge,We.lightGroup,this)):ge=se,(q!==Se||ve)&&(Se.depthTest!==ue&&(Se.depthTest?H.enable(H.DEPTH_TEST):H.disable(H.DEPTH_TEST),ue=Se.depthTest),Se.depthMask!==pe&&(H.depthMask(Se.depthMask),pe=Se.depthMask),Se.transparent!==Ge&&(Se.transparent?H.enable(H.BLEND):H.disable(H.BLEND),Ge=Se.transparent),Se.transparent&&(Se.blend?Se.blend(H):(H.blendEquationSeparate(H.FUNC_ADD,H.FUNC_ADD),H.blendFuncSeparate(H.SRC_ALPHA,H.ONE_MINUS_SRC_ALPHA,H.ONE,H.ONE_MINUS_SRC_ALPHA))),Se.bind(this,ge,q,se),q=Se);for(var Le=Re.matrixSemanticKeys,Fe=0;Fe<Le.length;Fe++){var me=Le[Fe],oe=Re.matrixSemantics[me],ie=w[me];if(oe.isTranspose){var fe=w[oe.semanticNoTranspose];h.transpose(ie,fe)}ge.setUniform(H,oe.type,oe.symbol,ie)}We.cullFace!==De&&(De=We.cullFace,H.cullFace(De)),We.frontFace!==Ue&&(Ue=We.frontFace,H.frontFace(Ue)),We.culling!==xe&&(xe=We.culling,xe?H.enable(H.CULL_FACE):H.disable(H.CULL_FACE));var ye=We.render(this,Se,ge);ye&&(N.triangleCount+=ye.triangleCount,N.vertexCount+=ye.vertexCount,N.drawCallCount+=ye.drawCallCount,N.renderedMeshCount++),z.afterRender.call(this,We,ye),We.afterRender(this,ye),se=ge}}for(var Ae=0;Ae<R.length;Ae++)R[Ae].__program=null;return this.trigger("afterrenderpass",this,R,O,z),N},renderPreZ:function(R,O,z){var N=this.gl,P=this._prezMaterial||new c.a({shader:new i.a(i.a.source("clay.prez.vertex"),i.a.source("clay.prez.fragment"))});this._prezMaterial=P,N.colorMask(!1,!1,!1,!1),N.depthMask(!0),this.renderPass(R,z,{ifRender:function(F){return!F.ignorePreZ},getMaterial:function(){return P},sort:this.opaqueSortCompare}),N.colorMask(!0,!0,!0,!0),N.depthMask(!0)},isFrustumCulled:function(){var R=new s.a,O=new x.a;return function(z,N,P,F,K){var B=z.boundingBox||z.geometry.boundingBox;if(O.array=F,R.copy(B),R.applyTransform(O),N&&z.isRenderable()&&z.castShadow&&N.viewBoundingBoxLastFrame.union(R),z.frustumCulling&&!z.isSkinnedMesh()){if(!R.intersectBoundingBox(P.frustum.boundingBox))return!0;O.array=K,R.max.array[2]>0&&R.min.array[2]<0&&(R.max.array[2]=-1e-20),R.applyProjection(O);var V=R.min.array,C=R.max.array;if(C[0]<-1||V[0]>1||C[1]<-1||V[1]>1||C[2]<-1||V[2]>1)return!0}return!1}}(),disposeScene:function(R){this.disposeNode(R,!0,!0),R.dispose()},disposeNode:function(R,O,z){R.getParent()&&R.getParent().remove(R),R.traverse(function(N){N.geometry&&O&&N.geometry.dispose(this),N.dispose&&N.dispose(this)},this)},disposeGeometry:function(R){R.dispose(this)},disposeTexture:function(R){R.dispose(this)},disposeFrameBuffer:function(R){R.dispose(this)},dispose:function(){},screenToNDC:function(R,O,z){z||(z=new u.a),O=this._height-O;var N=this.viewport,P=z.array;return P[0]=(R-N.x)/N.width,P[0]=P[0]*2-1,P[1]=(O-N.y)/N.height,P[1]=P[1]*2-1,z}});S.opaqueSortCompare=S.prototype.opaqueSortCompare=function(R,O){return R.renderOrder===O.renderOrder?R.__program===O.__program?R.material===O.material?R.geometry.__uid__-O.geometry.__uid__:R.material.__uid__-O.material.__uid__:R.__program&&O.__program?R.__program.__uid__-O.__program.__uid__:0:R.renderOrder-O.renderOrder},S.transparentSortCompare=S.prototype.transparentSortCompare=function(R,O){return R.renderOrder===O.renderOrder?R.__depth===O.__depth?R.__program===O.__program?R.material===O.material?R.geometry.__uid__-O.geometry.__uid__:R.material.__uid__-O.material.__uid__:R.__program&&O.__program?R.__program.__uid__-O.__program.__uid__:0:R.__depth-O.__depth:R.renderOrder-O.renderOrder};var w={IDENTITY:r(),WORLD:r(),VIEW:r(),PROJECTION:r(),WORLDVIEW:r(),VIEWPROJECTION:r(),WORLDVIEWPROJECTION:r(),WORLDINVERSE:r(),VIEWINVERSE:r(),PROJECTIONINVERSE:r(),WORLDVIEWINVERSE:r(),VIEWPROJECTIONINVERSE:r(),WORLDVIEWPROJECTIONINVERSE:r(),WORLDTRANSPOSE:r(),VIEWTRANSPOSE:r(),PROJECTIONTRANSPOSE:r(),WORLDVIEWTRANSPOSE:r(),VIEWPROJECTIONTRANSPOSE:r(),WORLDVIEWPROJECTIONTRANSPOSE:r(),WORLDINVERSETRANSPOSE:r(),VIEWINVERSETRANSPOSE:r(),PROJECTIONINVERSETRANSPOSE:r(),WORLDVIEWINVERSETRANSPOSE:r(),VIEWPROJECTIONINVERSETRANSPOSE:r(),WORLDVIEWPROJECTIONINVERSETRANSPOSE:r()};S.COLOR_BUFFER_BIT=L.a.COLOR_BUFFER_BIT,S.DEPTH_BUFFER_BIT=L.a.DEPTH_BUFFER_BIT,S.STENCIL_BUFFER_BIT=L.a.STENCIL_BUFFER_BIT,X.a=S},function(re,X,D){"use strict";function W(L,A){this.action=L,this.context=A}var y={trigger:function(L){if(this.hasOwnProperty("__handlers__")&&this.__handlers__.hasOwnProperty(L)){var A=this.__handlers__[L],s=A.length,x=-1,c=arguments;switch(c.length){case 1:for(;++x<s;)A[x].action.call(A[x].context);return;case 2:for(;++x<s;)A[x].action.call(A[x].context,c[1]);return;case 3:for(;++x<s;)A[x].action.call(A[x].context,c[1],c[2]);return;case 4:for(;++x<s;)A[x].action.call(A[x].context,c[1],c[2],c[3]);return;case 5:for(;++x<s;)A[x].action.call(A[x].context,c[1],c[2],c[3],c[4]);return;default:for(;++x<s;)A[x].action.apply(A[x].context,Array.prototype.slice.call(c,1));return}}},on:function(L,A,s){if(!(!L||!A)){var x=this.__handlers__||(this.__handlers__={});if(!x[L])x[L]=[];else if(this.has(L,A))return;var c=new W(A,s||this);return x[L].push(c),this}},once:function(L,A,s){if(!L||!A)return;var x=this;function c(){x.off(L,c),A.apply(this,arguments)}return this.on(L,c,s)},before:function(L,A,s){if(!(!L||!A))return L="before"+L,this.on(L,A,s)},after:function(L,A,s){if(!(!L||!A))return L="after"+L,this.on(L,A,s)},success:function(L,A){return this.once("success",L,A)},error:function(L,A){return this.once("error",L,A)},off:function(L,A){var s=this.__handlers__||(this.__handlers__={});if(!A){s[L]=[];return}if(s[L]){for(var x=s[L],c=[],u=0;u<x.length;u++)A&&x[u].action!==A&&c.push(x[u]);s[L]=c}return this},has:function(L,A){var s=this.__handlers__;if(!s||!s[L])return!1;for(var x=s[L],c=0;c<x.length;c++)if(x[c].action===A)return!0}};X.a=y},function(re,X,D){"use strict";var W="__dt__",y=function(){this._contextId=0,this._caches=[],this._context={}};y.prototype={use:function(L,A){var s=this._caches;s[L]||(s[L]={},A&&(s[L]=A())),this._contextId=L,this._context=s[L]},put:function(L,A){this._context[L]=A},get:function(L){return this._context[L]},dirty:function(L){L=L||"";var A=W+L;this.put(A,!0)},dirtyAll:function(L){L=L||"";for(var A=W+L,s=this._caches,x=0;x<s.length;x++)s[x]&&(s[x][A]=!0)},fresh:function(L){L=L||"";var A=W+L;this.put(A,!1)},freshAll:function(L){L=L||"";for(var A=W+L,s=this._caches,x=0;x<s.length;x++)s[x]&&(s[x][A]=!1)},isDirty:function(L){L=L||"";var A=W+L,s=this._context;return!s.hasOwnProperty(A)||s[A]===!0},deleteContext:function(L){delete this._caches[L],this._context={}},delete:function(L){delete this._context[L]},clearAll:function(){this._caches={}},getContext:function(){return this._context},eachContext:function(L,A){var s=Object.keys(this._caches);s.forEach(function(x){L&&L.call(A,x)})},miss:function(L){return!this._context.hasOwnProperty(L)}},y.prototype.constructor=y,X.a=y},function(re,X,D){"use strict";var W=D(4),y=D(1),L=D.n(y),A=L.a.vec3,s=1e-5,x=function(c,u){this.origin=c||new W.a,this.direction=u||new W.a};x.prototype={constructor:x,intersectPlane:function(c,u){var f=c.normal.array,i=c.distance,o=this.origin.array,d=this.direction.array,m=A.dot(f,d);if(m===0)return null;u||(u=new W.a);var _=(A.dot(f,o)-i)/m;return A.scaleAndAdd(u.array,o,d,-_),u._dirty=!0,u},mirrorAgainstPlane:function(c){var u=A.dot(c.normal.array,this.direction.array);A.scaleAndAdd(this.direction.array,this.direction.array,c.normal.array,-u*2),this.direction._dirty=!0},distanceToPoint:function(){var c=A.create();return function(u){A.sub(c,u,this.origin.array);var f=A.dot(c,this.direction.array);if(f<0)return A.distance(this.origin.array,u);var i=A.lenSquared(c);return Math.sqrt(i-f*f)}}(),intersectSphere:function(){var c=A.create();return function(u,f,i){var o=this.origin.array,d=this.direction.array;u=u.array,A.sub(c,u,o);var m=A.dot(c,d),_=A.squaredLength(c),h=_-m*m,v=f*f;if(!(h>v)){var r=Math.sqrt(v-h),a=m-r,p=m+r;return i||(i=new W.a),a<0?p<0?null:(A.scaleAndAdd(i.array,o,d,p),i):(A.scaleAndAdd(i.array,o,d,a),i)}}}(),intersectBoundingBox:function(c,u){var f=this.direction.array,i=this.origin.array,o=c.min.array,d=c.max.array,m=1/f[0],_=1/f[1],h=1/f[2],v,r,a,p,E,S;if(m>=0?(v=(o[0]-i[0])*m,r=(d[0]-i[0])*m):(r=(o[0]-i[0])*m,v=(d[0]-i[0])*m),_>=0?(a=(o[1]-i[1])*_,p=(d[1]-i[1])*_):(p=(o[1]-i[1])*_,a=(d[1]-i[1])*_),v>p||a>r||((a>v||v!==v)&&(v=a),(p<r||r!==r)&&(r=p),h>=0?(E=(o[2]-i[2])*h,S=(d[2]-i[2])*h):(S=(o[2]-i[2])*h,E=(d[2]-i[2])*h),v>S||E>r)||((E>v||v!==v)&&(v=E),(S<r||r!==r)&&(r=S),r<0))return null;var w=v>=0?v:r;return u||(u=new W.a),A.scaleAndAdd(u.array,i,f,w),u},intersectTriangle:function(){var c=A.create(),u=A.create(),f=A.create(),i=A.create();return function(o,d,m,_,h,v){var r=this.direction.array,a=this.origin.array;o=o.array,d=d.array,m=m.array,A.sub(c,d,o),A.sub(u,m,o),A.cross(i,u,r);var p=A.dot(c,i);if(_){if(p>-s)return null}else if(p>-s&&p<s)return null;A.sub(f,a,o);var E=A.dot(i,f)/p;if(E<0||E>1)return null;A.cross(i,c,f);var S=A.dot(r,i)/p;if(S<0||S>1||E+S>1)return null;A.cross(i,c,u);var w=-A.dot(f,i)/p;return w<0?null:(h||(h=new W.a),v&&W.a.set(v,1-E-S,E,S),A.scaleAndAdd(h.array,a,r,w),h)}}(),applyTransform:function(c){W.a.add(this.direction,this.direction,this.origin),W.a.transformMat4(this.origin,this.origin,c),W.a.transformMat4(this.direction,this.direction,c),W.a.sub(this.direction,this.direction,this.origin),W.a.normalize(this.direction,this.direction)},copy:function(c){W.a.copy(this.origin,c.origin),W.a.copy(this.direction,c.direction)},clone:function(){var c=new x;return c.copy(this),c}},X.a=x},function(re,X,D){"use strict";var W=D(1),y=D.n(W),L=y.a.quat,A=function(c,u,f,i){c=c||0,u=u||0,f=f||0,i=i===void 0?1:i,this.array=L.fromValues(c,u,f,i),this._dirty=!0};A.prototype={constructor:A,add:function(c){return L.add(this.array,this.array,c.array),this._dirty=!0,this},calculateW:function(){return L.calculateW(this.array,this.array),this._dirty=!0,this},set:function(c,u,f,i){return this.array[0]=c,this.array[1]=u,this.array[2]=f,this.array[3]=i,this._dirty=!0,this},setArray:function(c){return this.array[0]=c[0],this.array[1]=c[1],this.array[2]=c[2],this.array[3]=c[3],this._dirty=!0,this},clone:function(){return new A(this.x,this.y,this.z,this.w)},conjugate:function(){return L.conjugate(this.array,this.array),this._dirty=!0,this},copy:function(c){return L.copy(this.array,c.array),this._dirty=!0,this},dot:function(c){return L.dot(this.array,c.array)},fromMat3:function(c){return L.fromMat3(this.array,c.array),this._dirty=!0,this},fromMat4:function(){var c=y.a.mat3,u=c.create();return function(f){return c.fromMat4(u,f.array),c.transpose(u,u),L.fromMat3(this.array,u),this._dirty=!0,this}}(),identity:function(){return L.identity(this.array),this._dirty=!0,this},invert:function(){return L.invert(this.array,this.array),this._dirty=!0,this},len:function(){return L.len(this.array)},length:function(){return L.length(this.array)},lerp:function(c,u,f){return L.lerp(this.array,c.array,u.array,f),this._dirty=!0,this},mul:function(c){return L.mul(this.array,this.array,c.array),this._dirty=!0,this},mulLeft:function(c){return L.multiply(this.array,c.array,this.array),this._dirty=!0,this},multiply:function(c){return L.multiply(this.array,this.array,c.array),this._dirty=!0,this},multiplyLeft:function(c){return L.multiply(this.array,c.array,this.array),this._dirty=!0,this},normalize:function(){return L.normalize(this.array,this.array),this._dirty=!0,this},rotateX:function(c){return L.rotateX(this.array,this.array,c),this._dirty=!0,this},rotateY:function(c){return L.rotateY(this.array,this.array,c),this._dirty=!0,this},rotateZ:function(c){return L.rotateZ(this.array,this.array,c),this._dirty=!0,this},rotationTo:function(c,u){return L.rotationTo(this.array,c.array,u.array),this._dirty=!0,this},setAxes:function(c,u,f){return L.setAxes(this.array,c.array,u.array,f.array),this._dirty=!0,this},setAxisAngle:function(c,u){return L.setAxisAngle(this.array,c.array,u),this._dirty=!0,this},slerp:function(c,u,f){return L.slerp(this.array,c.array,u.array,f),this._dirty=!0,this},sqrLen:function(){return L.sqrLen(this.array)},squaredLength:function(){return L.squaredLength(this.array)},fromEuler:function(c,u){return A.fromEuler(this,c,u)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var s=Object.defineProperty;if(s){var x=A.prototype;s(x,"x",{get:function(){return this.array[0]},set:function(c){this.array[0]=c,this._dirty=!0}}),s(x,"y",{get:function(){return this.array[1]},set:function(c){this.array[1]=c,this._dirty=!0}}),s(x,"z",{get:function(){return this.array[2]},set:function(c){this.array[2]=c,this._dirty=!0}}),s(x,"w",{get:function(){return this.array[3]},set:function(c){this.array[3]=c,this._dirty=!0}})}A.add=function(c,u,f){return L.add(c.array,u.array,f.array),c._dirty=!0,c},A.set=function(c,u,f,i,o){L.set(c.array,u,f,i,o),c._dirty=!0},A.copy=function(c,u){return L.copy(c.array,u.array),c._dirty=!0,c},A.calculateW=function(c,u){return L.calculateW(c.array,u.array),c._dirty=!0,c},A.conjugate=function(c,u){return L.conjugate(c.array,u.array),c._dirty=!0,c},A.identity=function(c){return L.identity(c.array),c._dirty=!0,c},A.invert=function(c,u){return L.invert(c.array,u.array),c._dirty=!0,c},A.dot=function(c,u){return L.dot(c.array,u.array)},A.len=function(c){return L.length(c.array)},A.lerp=function(c,u,f,i){return L.lerp(c.array,u.array,f.array,i),c._dirty=!0,c},A.slerp=function(c,u,f,i){return L.slerp(c.array,u.array,f.array,i),c._dirty=!0,c},A.mul=function(c,u,f){return L.multiply(c.array,u.array,f.array),c._dirty=!0,c},A.multiply=A.mul,A.rotateX=function(c,u,f){return L.rotateX(c.array,u.array,f),c._dirty=!0,c},A.rotateY=function(c,u,f){return L.rotateY(c.array,u.array,f),c._dirty=!0,c},A.rotateZ=function(c,u,f){return L.rotateZ(c.array,u.array,f),c._dirty=!0,c},A.setAxisAngle=function(c,u,f){return L.setAxisAngle(c.array,u.array,f),c._dirty=!0,c},A.normalize=function(c,u){return L.normalize(c.array,u.array),c._dirty=!0,c},A.sqrLen=function(c){return L.sqrLen(c.array)},A.squaredLength=A.sqrLen,A.fromMat3=function(c,u){return L.fromMat3(c.array,u.array),c._dirty=!0,c},A.setAxes=function(c,u,f,i){return L.setAxes(c.array,u.array,f.array,i.array),c._dirty=!0,c},A.rotationTo=function(c,u,f){return L.rotationTo(c.array,u.array,f.array),c._dirty=!0,c},A.fromEuler=function(c,u,r){c._dirty=!0,u=u.array;var i=c.array,o=Math.cos(u[0]/2),d=Math.cos(u[1]/2),m=Math.cos(u[2]/2),_=Math.sin(u[0]/2),h=Math.sin(u[1]/2),v=Math.sin(u[2]/2),r=(r||"XYZ").toUpperCase();switch(r){case"XYZ":i[0]=_*d*m+o*h*v,i[1]=o*h*m-_*d*v,i[2]=o*d*v+_*h*m,i[3]=o*d*m-_*h*v;break;case"YXZ":i[0]=_*d*m+o*h*v,i[1]=o*h*m-_*d*v,i[2]=o*d*v-_*h*m,i[3]=o*d*m+_*h*v;break;case"ZXY":i[0]=_*d*m-o*h*v,i[1]=o*h*m+_*d*v,i[2]=o*d*v+_*h*m,i[3]=o*d*m-_*h*v;break;case"ZYX":i[0]=_*d*m-o*h*v,i[1]=o*h*m+_*d*v,i[2]=o*d*v-_*h*m,i[3]=o*d*m+_*h*v;break;case"YZX":i[0]=_*d*m+o*h*v,i[1]=o*h*m+_*d*v,i[2]=o*d*v-_*h*m,i[3]=o*d*m-_*h*v;break;case"XZY":i[0]=_*d*m-o*h*v,i[1]=o*h*m-_*d*v,i[2]=o*d*v+_*h*m,i[3]=o*d*m+_*h*v;break}},X.a=A},function(re,X,D){"use strict";var W=D(28),y=D(9),L=D(52),A=D(49),s=D(1),x=D.n(s),c=x.a.vec3,u=x.a.vec4,f=W.a.extend(function(){return{projectionMatrix:new y.a,invProjectionMatrix:new y.a,viewMatrix:new y.a,frustum:new L.a}},function(){this.update(!0)},{update:function(i){W.a.prototype.update.call(this,i),y.a.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),y.a.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(i){y.a.copy(this.viewMatrix,i),y.a.invert(this.worldTransform,i),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(i){y.a.copy(this.projectionMatrix,i),y.a.invert(this.invProjectionMatrix,i),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:function(){var i=u.create();return function(o,d){var m=d!==void 0?d:new A.a,_=o.array[0],h=o.array[1];return u.set(i,_,h,-1,1),u.transformMat4(i,i,this.invProjectionMatrix.array),u.transformMat4(i,i,this.worldTransform.array),c.scale(m.origin.array,i,1/i[3]),u.set(i,_,h,1,1),u.transformMat4(i,i,this.invProjectionMatrix.array),u.transformMat4(i,i,this.worldTransform.array),c.scale(i,i,1/i[3]),c.sub(m.direction.array,i,m.origin.array),c.normalize(m.direction.array,m.direction.array),m.direction._dirty=!0,m.origin._dirty=!0,m}}()});X.a=f},function(re,X,D){"use strict";var W=D(4),y=D(15),L=D(67),A=D(1),s=D.n(A),x=s.a.vec3,c=x.set,u=x.copy,f=x.transformMat4,i=Math.min,o=Math.max,d=function(){this.planes=[];for(var m=0;m<6;m++)this.planes.push(new L.a);this.boundingBox=new y.a,this.vertices=[];for(var m=0;m<8;m++)this.vertices[m]=x.fromValues(0,0,0)};d.prototype={setFromProjection:function(m){var _=this.planes,h=m.array,v=h[0],r=h[1],a=h[2],p=h[3],E=h[4],S=h[5],w=h[6],R=h[7],O=h[8],z=h[9],N=h[10],P=h[11],F=h[12],K=h[13],B=h[14],V=h[15];c(_[0].normal.array,p-v,R-E,P-O),_[0].distance=-(V-F),_[0].normalize(),c(_[1].normal.array,p+v,R+E,P+O),_[1].distance=-(V+F),_[1].normalize(),c(_[2].normal.array,p+r,R+S,P+z),_[2].distance=-(V+K),_[2].normalize(),c(_[3].normal.array,p-r,R-S,P-z),_[3].distance=-(V-K),_[3].normalize(),c(_[4].normal.array,p-a,R-w,P-N),_[4].distance=-(V-B),_[4].normalize(),c(_[5].normal.array,p+a,R+w,P+N),_[5].distance=-(V+B),_[5].normalize();var C=this.boundingBox;if(V===0){var M=S/v,H=-B/(N-1),$=-B/(N+1),q=-$/S,se=-H/S;C.min.set(-q*M,-q,$),C.max.set(q*M,q,H);var ue=this.vertices;c(ue[0],-q*M,-q,$),c(ue[1],-q*M,q,$),c(ue[2],q*M,-q,$),c(ue[3],q*M,q,$),c(ue[4],-se*M,-se,H),c(ue[5],-se*M,se,H),c(ue[6],se*M,-se,H),c(ue[7],se*M,se,H)}else{var pe=(-1-F)/v,xe=(1-F)/v,De=(1-K)/S,Ue=(-1-K)/S,Ge=(-1-B)/N,Ae=(1-B)/N;C.min.set(Math.min(pe,xe),Math.min(Ue,De),Math.min(Ae,Ge)),C.max.set(Math.max(xe,pe),Math.max(De,Ue),Math.max(Ge,Ae));var We=C.min.array,we=C.max.array,ue=this.vertices;c(ue[0],We[0],We[1],We[2]),c(ue[1],We[0],we[1],We[2]),c(ue[2],we[0],We[1],We[2]),c(ue[3],we[0],we[1],We[2]),c(ue[4],We[0],We[1],we[2]),c(ue[5],We[0],we[1],we[2]),c(ue[6],we[0],We[1],we[2]),c(ue[7],we[0],we[1],we[2])}},getTransformedBoundingBox:function(){var m=x.create();return function(_,h){var v=this.vertices,r=h.array,a=_.min,p=_.max,E=a.array,S=p.array,w=v[0];f(m,w,r),u(E,m),u(S,m);for(var R=1;R<8;R++)w=v[R],f(m,w,r),E[0]=i(m[0],E[0]),E[1]=i(m[1],E[1]),E[2]=i(m[2],E[2]),S[0]=o(m[0],S[0]),S[1]=o(m[1],S[1]),S[2]=o(m[2],S[2]);return a._dirty=!0,p._dirty=!0,_}}()},X.a=d},function(re,X){var D=function(){this.head=null,this.tail=null,this._len=0},W=D.prototype;W.insert=function(x){var c=new y(x);return this.insertEntry(c),c},W.insertEntry=function(x){this.head?(this.tail.next=x,x.prev=this.tail,x.next=null,this.tail=x):this.head=this.tail=x,this._len++},W.remove=function(x){var c=x.prev,u=x.next;c?c.next=u:this.head=u,u?u.prev=c:this.tail=c,x.next=x.prev=null,this._len--},W.len=function(){return this._len},W.clear=function(){this.head=this.tail=null,this._len=0};var y=function(x){this.value=x,this.next,this.prev},L=function(x){this._list=new D,this._map={},this._maxSize=x||10,this._lastRemovedEntry=null},A=L.prototype;A.put=function(x,c){var u=this._list,f=this._map,i=null;if(f[x]==null){var o=u.len(),d=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var m=u.head;u.remove(m),delete f[m.key],i=m.value,this._lastRemovedEntry=m}d?d.value=c:d=new y(c),d.key=x,u.insertEntry(d),f[x]=d}return i},A.get=function(x){var c=this._map[x],u=this._list;if(c!=null)return c!==u.tail&&(u.remove(c),u.insertEntry(c)),c.value},A.clear=function(){this._list.clear(),this._map={}};var s=L;re.exports=s},function(re,X,D){"use strict";var W=D(5),y=D(25),L=D(102),A=D(55),s=D(56),x=D(29),c=D(104),u=D(105),f={loadTexture:function(i,o,d,m){var _;if(typeof o=="function"?(d=o,m=d,o={}):o=o||{},typeof i=="string"){if(i.match(/.hdr$/)||o.fileType==="hdr")return _=new W.a({width:0,height:0,sRGB:!1}),f._fetchTexture(i,function(h){u.a.parseRGBE(h,_,o.exposure),_.dirty(),d&&d(_)},m),_;i.match(/.dds$/)||o.fileType==="dds"?(_=new W.a({width:0,height:0}),f._fetchTexture(i,function(h){c.a.parse(h,_),_.dirty(),d&&d(_)},m)):(_=new W.a,_.load(i),_.success(d),_.error(m))}else if(typeof i=="object"&&typeof i.px!="undefined"){var _=new y.a;_.load(i),_.success(d),_.error(m)}return _},loadPanorama:function(i,o,d,m,_,h){var v=this;typeof m=="function"?(_=m,h=_,m={}):m=m||{},f.loadTexture(o,m,function(r){r.flipY=m.flipY||!1,v.panoramaToCubeMap(i,r,d,m),r.dispose(i),_&&_(d)},h)},panoramaToCubeMap:function(i,o,d,m){var _=new A.a,h=new s.a({scene:new x.a});return h.material.set("diffuseMap",o),m=m||{},m.encodeRGBM&&h.material.define("fragment","RGBM_ENCODE"),d.sRGB=o.sRGB,_.texture=d,_.render(i,h.scene),_.texture=null,_.dispose(i),d},heightToNormal:function(i,o){var d=document.createElement("canvas"),m=d.width=i.width,_=d.height=i.height,h=d.getContext("2d");h.drawImage(i,0,0,m,_),o=o||!1;for(var v=h.getImageData(0,0,m,_),r=h.createImageData(m,_),a=0;a<v.data.length;a+=4){if(o){var p=v.data[a],E=v.data[a+1],S=v.data[a+2],w=Math.abs(p-E)+Math.abs(E-S);if(w>20)return console.warn("Given image is not a height map"),i}var R,O,z,N;a%(m*4)===0?(R=v.data[a],z=v.data[a+4]):a%(m*4)===(m-1)*4?(R=v.data[a-4],z=v.data[a]):(R=v.data[a-4],z=v.data[a+4]),a<m*4?(O=v.data[a],N=v.data[a+m*4]):a>m*(_-1)*4?(O=v.data[a-m*4],N=v.data[a]):(O=v.data[a-m*4],N=v.data[a+m*4]),r.data[a]=R-z+127,r.data[a+1]=O-N+127,r.data[a+2]=255,r.data[a+3]=255}return h.putImageData(r,0,0),d},isHeightImage:function(i,o,d){if(!i||!i.width||!i.height)return!1;var m=document.createElement("canvas"),_=m.getContext("2d"),h=o||32;d=d||20,m.width=m.height=h,_.drawImage(i,0,0,h,h);for(var v=_.getImageData(0,0,h,h),r=0;r<v.data.length;r+=4){var a=v.data[r],p=v.data[r+1],E=v.data[r+2],S=Math.abs(a-p)+Math.abs(p-E);if(S>d)return!1}return!0},_fetchTexture:function(i,o,d){L.a.get({url:i,responseType:"arraybuffer",onload:o,onerror:d})},createChessboard:function(i,o,d,m){i=i||512,o=o||64,d=d||"black",m=m||"white";var _=Math.ceil(i/o),h=document.createElement("canvas");h.width=i,h.height=i;var v=h.getContext("2d");v.fillStyle=m,v.fillRect(0,0,i,i),v.fillStyle=d;for(var r=0;r<_;r++)for(var a=0;a<_;a++){var p=a%2?r%2:r%2-1;p&&v.fillRect(r*o,a*o,o,o)}var E=new W.a({image:h,anisotropic:8});return E},createBlank:function(i){var o=document.createElement("canvas");o.width=1,o.height=1;var d=o.getContext("2d");d.fillStyle=i,d.fillRect(0,0,1,1);var m=new W.a({image:o});return m}};X.a=f},function(re,X,D){"use strict";var W=D(8),y=D(4),L=D(36),A=D(10),s=["px","nx","py","ny","pz","nz"],x=W.a.extend(function(){var c={position:new y.a,far:1e3,near:.1,texture:null,shadowMapPass:null},u=c._cameras={px:new L.a({fov:90}),nx:new L.a({fov:90}),py:new L.a({fov:90}),ny:new L.a({fov:90}),pz:new L.a({fov:90}),nz:new L.a({fov:90})};return u.px.lookAt(y.a.POSITIVE_X,y.a.NEGATIVE_Y),u.nx.lookAt(y.a.NEGATIVE_X,y.a.NEGATIVE_Y),u.py.lookAt(y.a.POSITIVE_Y,y.a.POSITIVE_Z),u.ny.lookAt(y.a.NEGATIVE_Y,y.a.NEGATIVE_Z),u.pz.lookAt(y.a.POSITIVE_Z,y.a.NEGATIVE_Y),u.nz.lookAt(y.a.NEGATIVE_Z,y.a.NEGATIVE_Y),c._frameBuffer=new A.a,c},{getCamera:function(c){return this._cameras[c]},render:function(c,u,f){var i=c.gl;f||u.update();for(var o=this.texture.width,d=2*Math.atan(o/(o-.5))/Math.PI*180,m=0;m<6;m++){var _=s[m],h=this._cameras[_];if(y.a.copy(h.position,this.position),h.far=this.far,h.near=this.near,h.fov=d,this.shadowMapPass){h.update();var v=u.getBoundingBox();v.applyTransform(h.viewMatrix),u.viewBoundingBoxLastFrame.copy(v),this.shadowMapPass.render(c,u,h,!0)}this._frameBuffer.attach(this.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+m),this._frameBuffer.bind(c),c.render(u,h,!0),this._frameBuffer.unbind(c)}},dispose:function(c){this._frameBuffer.dispose(c)}});X.a=x},function(re,X,D){"use strict";var W=D(24),y=D(68),L=D(7),A=D(17),s=D(103);L.a.import(s.a);var x=W.a.extend(function(){var c=new L.a(L.a.source("clay.basic.vertex"),L.a.source("clay.basic.fragment")),u=new A.a({shader:c,depthMask:!1});return u.enableTexture("diffuseMap"),{scene:null,geometry:new y.a({widthSegments:30,heightSegments:30}),material:u,environmentMap:null,culling:!1}},function(){var c=this.scene;c&&this.attachScene(c),this.environmentMap&&this.setEnvironmentMap(this.environmentMap)},{attachScene:function(c){this.scene&&this.detachScene(),c.skydome=this,this.scene=c,c.on("beforerender",this._beforeRenderScene,this)},detachScene:function(){this.scene&&(this.scene.off("beforerender",this._beforeRenderScene),this.scene.skydome=null),this.scene=null},_beforeRenderScene:function(c,u,f){this.position.copy(f.getWorldPosition()),this.update(),c.renderPass([this],f)},setEnvironmentMap:function(c){this.material.set("diffuseMap",c)},getEnvironmentMap:function(){return this.material.get("diffuseMap")},dispose:function(c){this.detachScene(),this.geometry.dispose(c)}});X.a=x},function(re,X,D){"use strict";var W=D(24),y=D(69),L=D(7),A=D(17),s=D(110);L.a.import(s.a);var x=W.a.extend(function(){var c=new L.a({vertex:L.a.source("clay.skybox.vertex"),fragment:L.a.source("clay.skybox.fragment")}),u=new A.a({shader:c,depthMask:!1});return{scene:null,geometry:new y.a,material:u,environmentMap:null,culling:!1}},function(){var c=this.scene;c&&this.attachScene(c),this.environmentMap&&this.setEnvironmentMap(this.environmentMap)},{attachScene:function(c){this.scene&&this.detachScene(),c.skybox=this,this.scene=c,c.on("beforerender",this._beforeRenderScene,this)},detachScene:function(){this.scene&&(this.scene.off("beforerender",this._beforeRenderScene),this.scene.skybox=null),this.scene=null},dispose:function(c){this.detachScene(),this.geometry.dispose(c)},setEnvironmentMap:function(c){this.material.set("environmentMap",c)},getEnvironmentMap:function(){return this.material.get("environmentMap")},_beforeRenderScene:function(c,u,f){this.renderSkybox(c,f)},renderSkybox:function(c,u){this.position.copy(u.getWorldPosition()),this.update(),c.gl.disable(c.gl.BLEND),this.material.get("lod")>0?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),c.renderPass([this],u)}});X.a=x},function(re,X,D){"use strict";var W=D(2),y=D(143),L=D(144);W.a.Shader.import(L.a),X.a=W.a.Mesh.extend(function(){var A=new y.a({dynamic:!0}),s=new W.a.Material({shader:W.a.createShader("ecgl.labels"),transparent:!0,depthMask:!1});return{geometry:A,material:s,culling:!1,castShadow:!1,ignorePicking:!0}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(186),s=D(22),x=D(3),c=D(1),u=D.n(c),f=D(60),i=D(61),o=D(40),d=u.a.vec3;L.a.Shader.import(o.a);function m(_){this.rootNode=new L.a.Node,this._triangulationResults={},this._shadersMap=L.a.COMMON_SHADERS.reduce(function(v,r){return v[r]=L.a.createShader("ecgl."+r),v},{}),this._linesShader=L.a.createShader("ecgl.meshLines3D");var h={};L.a.COMMON_SHADERS.forEach(function(v){h[v]=new L.a.Material({shader:L.a.createShader("ecgl."+v)})}),this._groundMaterials=h,this._groundMesh=new L.a.Mesh({geometry:new L.a.PlaneGeometry({dynamic:!0}),castShadow:!1,renderNormal:!0,$ignorePicking:!0}),this._groundMesh.rotation.rotateX(-Math.PI/2),this._labelsBuilder=new i.a(512,512,_),this._labelsBuilder.getMesh().renderOrder=100,this._labelsBuilder.getMesh().material.depthTest=!1,this.rootNode.add(this._labelsBuilder.getMesh()),this._initMeshes(),this._api=_}m.prototype={constructor:m,extrudeY:!0,update:function(_,h,v,r,a){var p=_.getData();r==null&&(r=0),a==null&&(a=p.count()),this._startIndex=r,this._endIndex=a-1,this._triangulation(_,r,a);var E=this._getShader(_.get("shading"));this._prepareMesh(_,E,v,r,a),this.rootNode.updateWorldTransform(),this._updateRegionMesh(_,v,r,a);var S=_.coordinateSystem;S.type==="geo3D"&&this._updateGroundPlane(_,S,v);var w=this;this._labelsBuilder.updateData(p,r,a),this._labelsBuilder.getLabelPosition=function(R,O,z){var N=p.getName(R),P,F=z;if(S.type==="geo3D"){var K=S.getRegion(N);return P=K.center,S.dataToPoint([P[0],P[1],F])}else var B=w._triangulationResults[R-w._startIndex],P=w.extrudeY?[(B.max[0]+B.min[0])/2,B.max[1]+F,(B.max[2]+B.min[2])/2]:[(B.max[0]+B.min[0])/2,(B.max[1]+B.min[1])/2,B.max[2]+F]},this._data=p,this._labelsBuilder.updateLabels(),this._updateDebugWireframe(_),this._lastHoverDataIndex=0},_initMeshes:function(){this.rootNode.removeAll();var _=this;function h(){var a=new L.a.Mesh({name:"Polygon",material:new L.a.Material({shader:_._shadersMap.lambert}),culling:!1,geometry:new L.a.Geometry({sortTriangles:!0,dynamic:!0}),ignorePicking:!0,renderNormal:!0});return y.a.util.extend(a.geometry,f.a),a}var v=h(),r=new L.a.Mesh({material:new L.a.Material({shader:this._linesShader}),castShadow:!1,ignorePicking:!0,$ignorePicking:!0,geometry:new s.a({useNativeLine:!1})});this.rootNode.add(v),this.rootNode.add(r),v.material.define("both","VERTEX_COLOR"),v.material.define("fragment","DOUBLE_SIDED"),this._polygonMesh=v,this._linesMesh=r,this.rootNode.add(this._groundMesh)},_getShader:function(_){var h=this._shadersMap[_];return h||(console.warn("Unkown shading "+_),h=this._shadersMap.lambert),h.__shading=_,h},_prepareMesh:function(_,h,v,r,a){for(var p=0,E=0,S=0,w=0,R=r;R<a;R++){var O=this._getRegionPolygonInfo(R),z=this._getRegionLinesInfo(R,_,this._linesMesh.geometry);p+=O.vertexCount,E+=O.triangleCount,S+=z.vertexCount,w+=z.triangleCount}var N=this._polygonMesh,P=N.geometry;["position","normal","texcoord0","color"].forEach(function(F){P.attributes[F].init(p)}),P.indices=p>65535?new Uint32Array(E*3):new Uint16Array(E*3),N.material.shader!==h&&N.material.attachShader(h,!0),L.a.setMaterialFromModel(h.__shading,N.material,_,v),S>0&&(this._linesMesh.geometry.resetOffset(),this._linesMesh.geometry.setVertexCount(S),this._linesMesh.geometry.setTriangleCount(w)),this._dataIndexOfVertex=new Uint32Array(p),this._vertexRangeOfDataIndex=new Uint32Array((a-r)*2)},_updateRegionMesh:function(_,h,v,r){for(var a=_.getData(),p=0,E=0,S=!1,q=this._polygonMesh,w=this._linesMesh,R=v;R<r;R++){var O=_.getRegionModel(R),z=O.getModel("itemStyle"),N=z.get("color"),P=x.a.firstNotNull(z.get("opacity"),1),F=a.getItemVisual(R,"color",!0);F!=null&&a.hasValue(R)&&(N=F),a.setItemVisual(R,"color",N),a.setItemVisual(R,"opacity",P),N=L.a.parseColor(N);var K=L.a.parseColor(z.get("borderColor"));N[3]*=P,K[3]*=P;var B=N[3]<.99;q.material.set("color",[1,1,1,1]),S=S||B;for(var V=x.a.firstNotNull(O.get("height",!0),_.get("regionHeight")),C=this._updatePolygonGeometry(_,q.geometry,R,V,p,E,N),M=p;M<C.vertexOffset;M++)this._dataIndexOfVertex[M]=R;this._vertexRangeOfDataIndex[(R-v)*2]=p,this._vertexRangeOfDataIndex[(R-v)*2+1]=C.vertexOffset,p=C.vertexOffset,E=C.triangleOffset;var H=z.get("borderWidth"),$=H>0;$&&(H*=h.getDevicePixelRatio(),this._updateLinesGeometry(w.geometry,_,R,V,H,_.coordinateSystem.transform)),w.invisible=!$,w.material.set({color:K})}var q=this._polygonMesh;q.material.transparent=S,q.material.depthMask=!S,q.geometry.updateBoundingBox(),q.material.get("normalMap")&&q.geometry.generateTangents(),q.seriesIndex=_.seriesIndex,q.on("mousemove",this._onmousemove,this),q.on("mouseout",this._onmouseout,this)},_updateDebugWireframe:function(_){var h=_.getModel("debug.wireframe");if(h.get("show")){var v=L.a.parseColor(h.get("lineStyle.color")||"rgba(0,0,0,0.5)"),r=x.a.firstNotNull(h.get("lineStyle.width"),1),a=this._polygonMesh;a.geometry.generateBarycentric(),a.material.define("both","WIREFRAME_TRIANGLE"),a.material.set("wireframeLineColor",v),a.material.set("wireframeLineWidth",r)}},_onmousemove:function(_){var h=this._dataIndexOfVertex[_.triangle[0]];h==null&&(h=-1),h!==this._lastHoverDataIndex&&(this.downplay(this._lastHoverDataIndex),this.highlight(h)),this._lastHoverDataIndex=h,this._polygonMesh.dataIndex=h},_onmouseover:function(_){if(_.target){var h=_.target.eventData?this._data.indexOfName(_.target.eventData.name):_.target.dataIndex;h!=null&&(this.highlight(h),this._labelsBuilder.updateLabels([h]))}},_onmouseout:function(_){_.target&&(this.downplay(this._lastHoverDataIndex),this._lastHoverDataIndex=-1,this._polygonMesh.dataIndex=-1)},_updateGroundPlane:function(_,h,v){var r=_.getModel("groundPlane",_);if(this._groundMesh.invisible=!r.get("show",!0),!this._groundMesh.invisible){var a=_.get("shading"),p=this._groundMaterials[a];p||(console.warn("Unkown shading "+a),p=this._groundMaterials.lambert),L.a.setMaterialFromModel(a,p,r,v),p.get("normalMap")&&this._groundMesh.geometry.generateTangents(),this._groundMesh.material=p,this._groundMesh.material.set("color",L.a.parseColor(r.get("color"))),this._groundMesh.scale.set(h.size[0],h.size[2],1)}},_triangulation:function(_,h,v){this._triangulationResults=[];for(var r=[1/0,1/0,1/0],a=[-1/0,-1/0,-1/0],p=_.coordinateSystem,E=h;E<v;E++){for(var S=[],w=_.getRegionPolygonCoords(E),R=0;R<w.length;R++){var O=w[R].exterior,z=w[R].interiors,N=[],P=[];if(!(O.length<3)){for(var F=0,K=0;K<O.length;K++){var B=O[K];N[F++]=B[0],N[F++]=B[1]}for(var K=0;K<z.length;K++)if(!(z[K].length<3)){for(var V=N.length/2,C=0;C<z[K].length;C++){var B=z[K][C];N.push(B[0]),N.push(B[1])}P.push(V)}for(var M=Object(A.a)(N,P),H=new Float64Array(N.length/2*3),$=[],q=[1/0,1/0,1/0],se=[-1/0,-1/0,-1/0],ue=0,K=0;K<N.length;)d.set($,N[K++],0,N[K++]),p&&p.transform&&d.transformMat4($,$,p.transform),d.min(q,q,$),d.max(se,se,$),H[ue++]=$[0],H[ue++]=$[1],H[ue++]=$[2];d.min(r,r,q),d.max(a,a,se),S.push({points:H,indices:M,min:q,max:se})}}this._triangulationResults.push(S)}this._geoBoundingBox=[r,a]},_getRegionPolygonInfo:function(_){for(var h=this._triangulationResults[_-this._startIndex],v=0,r=0,a=0;a<h.length;a++)v+=h[a].points.length/3,r+=h[a].indices.length/3;var p=v*2+v*4,E=r*2+v*2;return{vertexCount:p,triangleCount:E}},_updatePolygonGeometry:function(_,h,v,r,a,p,E){var S=_.get("projectUVOnGround"),w=h.attributes.position,R=h.attributes.normal,O=h.attributes.texcoord0,z=h.attributes.color,N=this._triangulationResults[v-this._startIndex],P=z.value&&E,F=h.indices,K=this.extrudeY?1:2,B=this.extrudeY?2:1,V=[this.rootNode.worldTransform.x.len(),this.rootNode.worldTransform.y.len(),this.rootNode.worldTransform.z.len()],C=d.mul([],this._geoBoundingBox[0],V),M=d.mul([],this._geoBoundingBox[1],V),H=Math.max(M[0]-C[0],M[2]-C[2]);function $(he,Te,Oe){for(var Be=he.points,Ze=Be.length,tt=[],dt=[],nt=0;nt<Ze;nt+=3)tt[0]=Be[nt],tt[K]=Te,tt[B]=Be[nt+2],dt[0]=(Be[nt]*V[0]-C[0])/H,dt[1]=(Be[nt+2]*V[B]-C[2])/H,w.set(a,tt),P&&z.set(a,E),O.set(a++,dt)}function q(he,Te,Oe){var Be=a;$(he,Te,Oe);for(var Ze=0;Ze<he.indices.length;Ze++)F[p*3+Ze]=he.indices[Ze]+Be;p+=he.indices.length/3}for(var se=this.extrudeY?[0,1,0]:[0,0,1],ue=d.negate([],se),pe=0;pe<N.length;pe++){var xe=a,De=N[pe];q(De,0,0),q(De,r,0);for(var Ue=De.points.length/3,Ge=0;Ge<Ue;Ge++)R.set(xe+Ge,ue),R.set(xe+Ge+Ue,se);for(var Ae=[0,3,1,1,3,2],We=[[],[],[],[]],we=[],Se=[],ge=[],Re=[],ve=0,Ge=0;Ge<Ue;Ge++){for(var Le=(Ge+1)%Ue,Fe=(De.points[Le*3]-De.points[Ge*3])*V[0],me=(De.points[Le*3+2]-De.points[Ge*3+2])*V[B],oe=Math.sqrt(Fe*Fe+me*me),ie=0;ie<4;ie++){var fe=ie===0||ie===3,ye=(fe?Ge:Le)*3;We[ie][0]=De.points[ye],We[ie][K]=ie>1?r:0,We[ie][B]=De.points[ye+2],w.set(a+ie,We[ie]),S?(Re[0]=(De.points[ye]*V[0]-C[0])/H,Re[1]=(De.points[ye+2]*V[B]-C[B])/H):(Re[0]=(fe?ve:ve+oe)/H,Re[1]=(We[ie][K]*V[K]-C[K])/H),O.set(a+ie,Re)}d.sub(we,We[1],We[0]),d.sub(Se,We[3],We[0]),d.cross(ge,we,Se),d.normalize(ge,ge);for(var ie=0;ie<4;ie++)R.set(a+ie,ge),P&&z.set(a+ie,E);for(var ie=0;ie<6;ie++)F[p*3+ie]=Ae[ie]+a;a+=4,p+=2,ve+=oe}}return h.dirty(),{vertexOffset:a,triangleOffset:p}},_getRegionLinesInfo:function(_,h,v){var r=0,a=0,p=h.getRegionModel(_),E=p.getModel("itemStyle"),S=E.get("borderWidth");if(S>0){var w=h.getRegionPolygonCoords(_);w.forEach(function(R){var O=R.exterior,z=R.interiors;r+=v.getPolylineVertexCount(O),a+=v.getPolylineTriangleCount(O);for(var N=0;N<z.length;N++)r+=v.getPolylineVertexCount(z[N]),a+=v.getPolylineTriangleCount(z[N])},this)}return{vertexCount:r,triangleCount:a}},_updateLinesGeometry:function(_,h,v,r,a,p){function E(R){for(var O=new Float64Array(R.length*3),z=0,N=[],P=0;P<R.length;P++)N[0]=R[P][0],N[1]=r+.1,N[2]=R[P][1],p&&d.transformMat4(N,N,p),O[z++]=N[0],O[z++]=N[1],O[z++]=N[2];return O}var S=[1,1,1,1],w=h.getRegionPolygonCoords(v);w.forEach(function(R){var O=R.exterior,z=R.interiors;_.addPolyline(E(O),S,a);for(var N=0;N<z.length;N++)_.addPolyline(E(z[N]),S,a)})},highlight:function(_){var h=this._data;if(h){var v=h.getItemModel(_),r=v.getModel("emphasis.itemStyle"),a=r.get("color"),p=x.a.firstNotNull(r.get("opacity"),h.getItemVisual(_,"opacity"),1);if(a==null){var E=h.getItemVisual(_,"color");a=y.a.color.lift(E,-.4)}p==null&&(p=h.getItemVisual(_,"opacity"));var S=L.a.parseColor(a);S[3]*=p,this._setColorOfDataIndex(h,_,S)}},downplay:function(_){var h=this._data;if(h){var v=h.getItemVisual(_,"color"),r=x.a.firstNotNull(h.getItemVisual(_,"opacity"),1),a=L.a.parseColor(v);a[3]*=r,this._setColorOfDataIndex(h,_,a)}},_setColorOfDataIndex:function(_,h,v){if(!(h<this._startIndex&&h>this._endIndex)){h-=this._startIndex;for(var r=this._vertexRangeOfDataIndex[h*2];r<this._vertexRangeOfDataIndex[h*2+1];r++)this._polygonMesh.geometry.attributes.color.set(r,v);this._polygonMesh.geometry.dirty(),this._api.getZr().refresh()}}},X.a=m},function(re,X,D){"use strict";var W=D(81),y=D(1),L=D.n(y),A=L.a.vec3,s=A.create(),x=A.create(),c=A.create();X.a={needsSortTriangles:function(){return this.indices&&this.sortTriangles},needsSortTrianglesProgressively:function(){return this.needsSortTriangles()&&this.triangleCount>=2e4},doSortTriangles:function(u,f){var i=this.indices;if(f===0){var o=this.attributes.position,u=u.array;(!this._triangleZList||this._triangleZList.length!==this.triangleCount)&&(this._triangleZList=new Float32Array(this.triangleCount),this._sortedTriangleIndices=new Uint32Array(this.triangleCount),this._indicesTmp=new i.constructor(i.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var d=0,m,_=0;_<i.length;){o.get(i[_++],s),o.get(i[_++],x),o.get(i[_++],c);var h=A.sqrDist(s,u),v=A.sqrDist(x,u),r=A.sqrDist(c,u),a=Math.min(h,v);a=Math.min(a,r),_===3?(m=a,a=0):a=a-m,this._triangleZList[d++]=a}}for(var p=this._sortedTriangleIndices,_=0;_<p.length;_++)p[_]=_;if(this.triangleCount<2e4)f===0&&this._simpleSort(!0);else for(var _=0;_<3;_++)this._progressiveQuickSort(f*3+_);for(var E=this._indicesTmp,S=this._triangleZListTmp,w=this._triangleZList,_=0;_<this.triangleCount;_++){var R=p[_]*3,O=_*3;E[O++]=i[R++],E[O++]=i[R++],E[O]=i[R],S[_]=w[p[_]]}var z=this._indicesTmp;this._indicesTmp=this.indices,this.indices=z;var z=this._triangleZListTmp;this._triangleZListTmp=this._triangleZList,this._triangleZList=z,this.dirtyIndices()},_simpleSort:function(u){var f=this._triangleZList,i=this._sortedTriangleIndices;function o(d,m){return f[m]-f[d]}u?Array.prototype.sort.call(i,o):W.a.sort(i,o,0,i.length-1)},_progressiveQuickSort:function(u){var f=this._triangleZList,i=this._sortedTriangleIndices;this._quickSort=this._quickSort||new W.a,this._quickSort.step(i,function(o,d){return f[d]-f[o]},u)}}},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(73),A=D(58),s=D(3),x=1,c=2;function u(f,i,o){this._labelsMesh=new A.a,this._labelTextureSurface=new L.a({width:512,height:512,devicePixelRatio:o.getDevicePixelRatio(),onupdate:function(){o.getZr().refresh()}}),this._api=o,this._labelsMesh.material.set("textureAtlas",this._labelTextureSurface.getTexture())}u.prototype.getLabelPosition=function(f,i,o){return[0,0,0]},u.prototype.getLabelDistance=function(f,i,o){return 0},u.prototype.getMesh=function(){return this._labelsMesh},u.prototype.updateData=function(f,i,o){i==null&&(i=0),o==null&&(o=f.count()),(!this._labelsVisibilitiesBits||this._labelsVisibilitiesBits.length!==o-i)&&(this._labelsVisibilitiesBits=new Uint8Array(o-i));for(var d=["label","show"],m=["emphasis","label","show"],_=i;_<o;_++){var h=f.getItemModel(_),v=h.get(d),r=h.get(m);r==null&&(r=v);var a=(v?x:0)|(r?c:0);this._labelsVisibilitiesBits[_-i]=a}this._start=i,this._end=o,this._data=f},u.prototype.updateLabels=function(f){if(this._data){f=f||[];for(var i=f.length>0,o={},d=0;d<f.length;d++)o[f[d]]=!0;this._labelsMesh.geometry.convertToDynamicArray(!0),this._labelTextureSurface.clear();for(var m=["label"],_=["emphasis","label"],h=this._data.hostModel,v=this._data,r=h.getModel(m),a=h.getModel(_,r),p={left:"right",right:"left",top:"center",bottom:"center"},E={left:"middle",right:"middle",top:"bottom",bottom:"top"},S=this._start;S<this._end;S++){var w=!1;i&&o[S]&&(w=!0);var R=this._labelsVisibilitiesBits[S-this._start]&(w?c:x);if(R){var O=v.getItemModel(S),z=O.getModel(w?_:m,w?a:r),N=z.get("distance")||0,P=z.get("position"),F=z.getModel("textStyle"),K=this._api.getDevicePixelRatio(),B=h.getFormattedLabel(S,w?"emphasis":"normal");if(B==null||B==="")return;var V=new y.a.graphic.Text;y.a.graphic.setTextStyle(V.style,F,{text:B,textFill:F.get("color")||v.getItemVisual(S,"color")||"#000",textAlign:"left",textVerticalAlign:"top",opacity:s.a.firstNotNull(F.get("opacity"),v.getItemVisual(S,"opacity"),1)});var C=V.getBoundingRect(),M=1.2;C.height*=M;var H=this._labelTextureSurface.add(V),$=p[P]||"center",q=E[P]||"bottom";this._labelsMesh.geometry.addSprite(this.getLabelPosition(S,P,N),[C.width*K,C.height*K],H,$,q,this.getLabelDistance(S,P,N)*K)}}this._labelsMesh.material.set("uvScale",this._labelTextureSurface.getCoordsScale()),this._labelTextureSurface.getZr().refreshImmediately(),this._labelsMesh.geometry.convertToTypedArray(),this._labelsMesh.geometry.dirty()}},X.a=u},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(216),s=D(217),x=D(61),c=D(9),u=D(3),f=20,i=-10;function o(m,_){return m&&_&&m[0]===_[0]&&m[1]===_[1]}function d(m,_){this.rootNode=new L.a.Node,this.is2D=m,this._labelsBuilder=new x.a(256,256,_),this._labelsBuilder.getMesh().renderOrder=100,this.rootNode.add(this._labelsBuilder.getMesh()),this._api=_,this._spriteImageCanvas=document.createElement("canvas"),this._startDataIndex=0,this._endDataIndex=0,this._sizeScale=1}d.prototype={constructor:d,highlightOnMouseover:!0,update:function(m,_,h,v,r){var a=this._prevMesh;this._prevMesh=this._mesh,this._mesh=a;var p=m.getData();if(v==null&&(v=0),r==null&&(r=p.count()),this._startDataIndex=v,this._endDataIndex=r-1,!this._mesh){var E=this._prevMesh&&this._prevMesh.material;this._mesh=new s.a({renderOrder:10,frustumCulling:!1}),E&&(this._mesh.material=E)}var E=this._mesh.material,S=this._mesh.geometry,w=S.attributes;this.rootNode.remove(this._prevMesh),this.rootNode.add(this._mesh),this._setPositionTextureToMesh(this._mesh,this._positionTexture);var R=this._getSymbolInfo(m,v,r),O=h.getDevicePixelRatio(),z=m.getModel("itemStyle").getItemStyle(),N=m.get("large"),P=1;R.maxSize>2?(P=this._updateSymbolSprite(m,z,R,O),E.enableTexture("sprite")):E.disableTexture("sprite"),w.position.init(r-v);var F=[];if(N){E.undefine("VERTEX_SIZE"),E.undefine("VERTEX_COLOR");var K=p.getVisual("color"),B=p.getVisual("opacity");L.a.parseColor(K,F),F[3]*=B,E.set({color:F,u_Size:R.maxSize*this._sizeScale})}else E.set({color:[1,1,1,1]}),E.define("VERTEX_SIZE"),E.define("VERTEX_COLOR"),w.size.init(r-v),w.color.init(r-v),this._originalOpacity=new Float32Array(r-v);for(var V=p.getLayout("points"),C=w.position.value,M=!1,H=0;H<r-v;H++){var $=H*3,q=H*2;if(this.is2D?(C[$]=V[q],C[$+1]=V[q+1],C[$+2]=i):(C[$]=V[$],C[$+1]=V[$+1],C[$+2]=V[$+2]),!N){var K=p.getItemVisual(H,"color"),B=p.getItemVisual(H,"opacity");L.a.parseColor(K,F),F[3]*=B,w.color.set(H,F),F[3]<.99&&(M=!0);var se=p.getItemVisual(H,"symbolSize");se=se instanceof Array?Math.max(se[0],se[1]):se,isNaN(se)&&(se=0),w.size.value[H]=se*P*this._sizeScale,this._originalOpacity[H]=F[3]}}this._mesh.sizeScale=P,S.updateBoundingBox(),S.dirty(),this._updateMaterial(m,z);var ue=m.coordinateSystem;if(ue&&ue.viewGL){var pe=ue.viewGL.isLinearSpace()?"define":"undefine";E[pe]("fragment","SRGB_DECODE")}N||this._updateLabelBuilder(m,v,r),this._updateHandler(m,_,h),this._updateAnimation(m),this._api=h},getPointsMesh:function(){return this._mesh},updateLabels:function(m){this._labelsBuilder.updateLabels(m)},hideLabels:function(){this.rootNode.remove(this._labelsBuilder.getMesh())},showLabels:function(){this.rootNode.add(this._labelsBuilder.getMesh())},_updateSymbolSprite:function(m,_,h,v){h.maxSize=Math.min(h.maxSize*2,200);var r=[];return h.aspect>1?(r[0]=h.maxSize,r[1]=h.maxSize/h.aspect):(r[1]=h.maxSize,r[0]=h.maxSize*h.aspect),r[0]=r[0]||1,r[1]=r[1]||1,(this._symbolType!==h.type||!o(this._symbolSize,r)||this._lineWidth!==_.lineWidth)&&(A.a.createSymbolSprite(h.type,r,{fill:"#fff",lineWidth:_.lineWidth,stroke:"transparent",shadowColor:"transparent",minMargin:Math.min(r[0]/2,10)},this._spriteImageCanvas),A.a.createSDFFromCanvas(this._spriteImageCanvas,Math.min(this._spriteImageCanvas.width,32),f,this._mesh.material.get("sprite").image),this._symbolType=h.type,this._symbolSize=r,this._lineWidth=_.lineWidth),this._spriteImageCanvas.width/h.maxSize*v},_updateMaterial:function(m,_){var h=m.get("blendMode")==="lighter"?L.a.additiveBlend:null,v=this._mesh.material;v.blend=h,v.set("lineWidth",_.lineWidth/f);var r=L.a.parseColor(_.stroke);v.set("strokeColor",r),v.transparent=!0,v.depthMask=!1,v.depthTest=!this.is2D,v.sortVertices=!this.is2D},_updateLabelBuilder:function(m,p,h){var v=m.getData(),r=this._mesh.geometry,a=r.attributes.position.value,p=this._startDataIndex,E=this._mesh.sizeScale;this._labelsBuilder.updateData(v,p,h),this._labelsBuilder.getLabelPosition=function(S,w,R){var O=(S-p)*3;return[a[O],a[O+1],a[O+2]]},this._labelsBuilder.getLabelDistance=function(S,w,R){var O=r.attributes.size.get(S-p)/E;return O/2+R},this._labelsBuilder.updateLabels()},_updateAnimation:function(m){L.a.updateVertexAnimation([["prevPosition","position"],["prevSize","size"]],this._prevMesh,this._mesh,m)},_updateHandler:function(m,_,h){var v=m.getData(),r=this._mesh,a=this,p=-1,E=m.coordinateSystem&&m.coordinateSystem.type==="cartesian3D",S;E&&(S=m.coordinateSystem.model),r.seriesIndex=m.seriesIndex,r.off("mousemove"),r.off("mouseout"),r.on("mousemove",function(w){var R=w.vertexIndex+a._startDataIndex;R!==p&&(this.highlightOnMouseover&&(this.downplay(v,p),this.highlight(v,R),this._labelsBuilder.updateLabels([R])),E&&h.dispatchAction({type:"grid3DShowAxisPointer",value:[v.get(m.coordDimToDataDim("x")[0],R),v.get(m.coordDimToDataDim("y")[0],R),v.get(m.coordDimToDataDim("z")[0],R)],grid3DIndex:S.componentIndex})),r.dataIndex=R,p=R},this),r.on("mouseout",function(w){var R=w.vertexIndex+a._startDataIndex;this.highlightOnMouseover&&(this.downplay(v,R),this._labelsBuilder.updateLabels()),p=-1,r.dataIndex=-1,E&&h.dispatchAction({type:"grid3DHideAxisPointer",grid3DIndex:S.componentIndex})},this)},updateLayout:function(m,_,h){var v=m.getData();if(this._mesh){var r=this._mesh.geometry.attributes.position.value,a=v.getLayout("points");if(this.is2D)for(var p=0;p<a.length/2;p++){var E=p*3,S=p*2;r[E]=a[S],r[E+1]=a[S+1],r[E+2]=i}else for(var p=0;p<a.length;p++)r[p]=a[p];this._mesh.geometry.dirty(),h.getZr().refresh()}},updateView:function(m){if(this._mesh){var _=new c.a;c.a.mul(_,m.viewMatrix,this._mesh.worldTransform),c.a.mul(_,m.projectionMatrix,_),this._mesh.updateNDCPosition(_,this.is2D,this._api)}},highlight:function(m,_){if(!(_>this._endDataIndex||_<this._startDataIndex)){var h=m.getItemModel(_),v=h.getModel("emphasis.itemStyle"),r=v.get("color"),a=v.get("opacity");if(r==null){var p=m.getItemVisual(_,"color");r=y.a.color.lift(p,-.4)}a==null&&(a=m.getItemVisual(_,"opacity"));var E=L.a.parseColor(r);E[3]*=a,this._mesh.geometry.attributes.color.set(_-this._startDataIndex,E),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},downplay:function(m,_){if(!(_>this._endDataIndex||_<this._startDataIndex)){var h=m.getItemVisual(_,"color"),v=m.getItemVisual(_,"opacity"),r=L.a.parseColor(h);r[3]*=v,this._mesh.geometry.attributes.color.set(_-this._startDataIndex,r),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeOutAll:function(m){if(this._originalOpacity){for(var _=this._mesh.geometry,h=0;h<_.vertexCount;h++){var v=this._originalOpacity[h]*m;_.attributes.color.value[h*4+3]=v}_.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeInAll:function(){this.fadeOutAll(1)},setPositionTexture:function(m){this._mesh&&this._setPositionTextureToMesh(this._mesh,m),this._positionTexture=m},removePositionTexture:function(){this._positionTexture=null,this._mesh&&this._setPositionTextureToMesh(this._mesh,null)},setSizeScale:function(m){if(m!==this._sizeScale){if(this._mesh){var _=this._mesh.material.get("u_Size");this._mesh.material.set("u_Size",_/this._sizeScale*m);var h=this._mesh.geometry.attributes;if(h.size.value)for(var v=0;v<h.size.value.length;v++)h.size.value[v]=h.size.value[v]/this._sizeScale*m}this._sizeScale=m}},_setPositionTextureToMesh:function(m,_){_&&m.material.set("positionTexture",_),m.material[_?"enableTexture":"disableTexture"]("positionTexture")},_getSymbolInfo:function(m,_,h){if(m.get("large")){var v=u.a.firstNotNull(m.get("symbolSize"),1),w,a;return v instanceof Array?(w=Math.max(v[0],v[1]),a=v[0]/v[1]):(w=v,a=1),{maxSize:v,type:m.get("symbol"),aspect:a}}for(var r=m.getData(),a,p=!1,E=r.getItemVisual(0,"symbol")||"circle",S=!1,w=0,R=_;R<h;R++){var v=r.getItemVisual(R,"symbolSize"),O=r.getItemVisual(R,"symbol"),z;if(v instanceof Array)z=v[0]/v[1],w=Math.max(Math.max(v[0],v[1]),w);else{if(isNaN(v))return;z=1,w=Math.max(v,w)}a!=null&&Math.abs(z-a)>.05&&(p=!0),O!==E&&(S=!0),E=O,a=z}return p&&console.warn("Different symbol width / height ratio will be ignored."),S&&console.warn("Different symbol type will be ignored."),{maxSize:w,type:E,aspect:a}}},X.a=d},function(re,X,D){"use strict";X.a=`@export clay.prez.vertex
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
attribute vec3 position : POSITION;
|
|
@import clay.chunk.skinning_header
|
|
void main()
|
|
{
|
|
vec3 skinnedPosition = position;
|
|
#ifdef SKINNING
|
|
@import clay.chunk.skin_matrix
|
|
skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;
|
|
#endif
|
|
gl_Position = worldViewProjection * vec4(skinnedPosition, 1.0);
|
|
}
|
|
@end
|
|
@export clay.prez.fragment
|
|
void main()
|
|
{
|
|
gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
}
|
|
@end`},function(re,X,D){"use strict";var W=D(28),y=D(11),L=0,A=null,s=!0,x,c=function(){this.triangleCount=0,this.vertexCount=0,this.drawCallCount=0};function u(i,o,d){this.availableAttributes=i,this.availableAttributeSymbols=o,this.indicesBuffer=d,this.vao=null}var f=W.a.extend({material:null,geometry:null,mode:y.a.TRIANGLES,_drawCache:null,_renderInfo:null},function(){this._drawCache={},this._renderInfo=new c},{__program:null,lightGroup:0,renderOrder:0,lineWidth:1,culling:!0,cullFace:y.a.BACK,frontFace:y.a.CCW,frustumCulling:!0,receiveShadow:!0,castShadow:!0,ignorePicking:!1,ignorePreZ:!1,ignoreGBuffer:!1,isRenderable:function(){return this.geometry&&this.material&&this.material.shader&&!this.invisible&&this.geometry.vertexCount>0},beforeRender:function(i){},afterRender:function(i,o){},getBoundingBox:function(i,o){return o=W.a.prototype.getBoundingBox.call(this,i,o),this.geometry&&this.geometry.boundingBox&&o.union(this.geometry.boundingBox),o},render:function(i,o,d){var m=i.gl;o=o||this.material;var _=o.shader,h=this.geometry,v=this.mode,r=h.vertexCount,a=h.isUseIndices(),p=i.getGLExtension("OES_element_index_uint"),E=p&&r>65535,S=E?m.UNSIGNED_INT:m.UNSIGNED_SHORT,w=i.getGLExtension("OES_vertex_array_object"),R=!h.dynamic,O=this._renderInfo;O.vertexCount=r,O.triangleCount=0,O.drawCallCount=0;var z=!1;if(x=i.__uid__+"-"+h.__uid__+"-"+d.__uid__,(x!==L||w&&R||h._cache.isDirty("any"))&&(z=!0),L=x,!z)s?(m.drawElements(v,A.count,S,0),O.triangleCount=A.count/3):m.drawArrays(v,0,r),O.drawCallCount=1;else{var N=this._drawCache[x];if(!N){var P=h.getBufferChunks(i);if(!P)return;N=[];for(var F=0;F<P.length;F++){for(var K=P[F],B=K.attributeBuffers,V=K.indicesBuffer,C=[],M=[],H=0;H<B.length;H++){var $=B[H],q=$.name,se=$.semantic,ue;if(se){var pe=_.attributeSemantics[se];ue=pe&&pe.symbol}else ue=q;ue&&d.attributes[ue]&&(C.push($),M.push(ue))}var xe=new u(C,M,V);N.push(xe)}R&&(this._drawCache[x]=N)}for(var De=0;De<N.length;De++){var xe=N[De],Ue=!0;w&&R&&(xe.vao==null?xe.vao=w.createVertexArrayOES():Ue=!1,w.bindVertexArrayOES(xe.vao));var C=xe.availableAttributes,V=xe.indicesBuffer;if(Ue)for(var Ge=d.enableAttributes(i,xe.availableAttributeSymbols,w&&R&&xe.vao),H=0;H<C.length;H++){var Ae=Ge[H];if(Ae!==-1){var $=C[H],We=$.buffer,we=$.size,Se;switch($.type){case"float":Se=m.FLOAT;break;case"byte":Se=m.BYTE;break;case"ubyte":Se=m.UNSIGNED_BYTE;break;case"short":Se=m.SHORT;break;case"ushort":Se=m.UNSIGNED_SHORT;break;default:Se=m.FLOAT;break}m.bindBuffer(m.ARRAY_BUFFER,We),m.vertexAttribPointer(Ae,we,Se,!1,0,0)}}(v==y.a.LINES||v==y.a.LINE_STRIP||v==y.a.LINE_LOOP)&&m.lineWidth(this.lineWidth),A=V,s=h.isUseIndices(),s?(Ue&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,V.buffer),m.drawElements(v,V.count,S,0),O.triangleCount+=V.count/3):m.drawArrays(v,0,r),w&&R&&w.bindVertexArrayOES(null),O.drawCallCount++}}return O},clone:function(){var i=["castShadow","receiveShadow","mode","culling","cullFace","frontFace","frustumCulling","renderOrder","lineWidth","ignorePicking","ignorePreZ","ignoreGBuffer"];return function(){var o=W.a.prototype.clone.call(this);o.geometry=this.geometry,o.material=this.material;for(var d=0;d<i.length;d++){var m=i[d];o[m]!==this[m]&&(o[m]=this[m])}return o}}()});f.POINTS=y.a.POINTS,f.LINES=y.a.LINES,f.LINE_LOOP=y.a.LINE_LOOP,f.LINE_STRIP=y.a.LINE_STRIP,f.TRIANGLES=y.a.TRIANGLES,f.TRIANGLE_STRIP=y.a.TRIANGLE_STRIP,f.TRIANGLE_FAN=y.a.TRIANGLE_FAN,f.BACK=y.a.BACK,f.FRONT=y.a.FRONT,f.FRONT_AND_BACK=y.a.FRONT_AND_BACK,f.CW=y.a.CW,f.CCW=y.a.CCW,f.RenderInfo=c,X.a=f},function(re,X){var D=typeof window!="undefined"&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(W){setTimeout(W,16)};re.exports=D},function(re,X,D){"use strict";var W={};W.isPowerOfTwo=function(y){return(y&y-1)===0},W.nextPowerOfTwo=function(y){return y--,y|=y>>1,y|=y>>2,y|=y>>4,y|=y>>8,y|=y>>16,y++,y},W.nearestPowerOfTwo=function(y){return Math.pow(2,Math.round(Math.log(y)/Math.LN2))},X.a=W},function(re,X,D){"use strict";var W=D(4),y=D(1),L=D.n(y),A=L.a.vec3,s=L.a.mat4,x=L.a.vec4,c=function(u,f){this.normal=u||new W.a(0,1,0),this.distance=f||0};c.prototype={constructor:c,distanceToPoint:function(u){return A.dot(u.array,this.normal.array)-this.distance},projectPoint:function(u,f){f||(f=new W.a);var i=this.distanceToPoint(u);return A.scaleAndAdd(f.array,u.array,this.normal.array,-i),f._dirty=!0,f},normalize:function(){var u=1/A.len(this.normal.array);A.scale(this.normal.array,u),this.distance*=u},intersectFrustum:function(u){for(var f=u.vertices,i=this.normal.array,o=A.dot(f[0].array,i)>this.distance,d=1;d<8;d++)if(A.dot(f[d].array,i)>this.distance!=o)return!0},intersectLine:function(){var u=A.create();return function(f,i,o){var d=this.distanceToPoint(f),m=this.distanceToPoint(i);if(d>0&&m>0||d<0&&m<0)return null;var _=this.normal.array,h=this.distance,v=f.array;A.sub(u,i.array,f.array),A.normalize(u,u);var r=A.dot(_,u);if(r===0)return null;o||(o=new W.a);var a=(A.dot(_,v)-h)/r;return A.scaleAndAdd(o.array,v,u,-a),o._dirty=!0,o}}(),applyTransform:function(){var u=s.create(),f=x.create(),i=x.create();return i[3]=1,function(o){o=o.array,A.scale(i,this.normal.array,this.distance),x.transformMat4(i,i,o),this.distance=A.dot(i,this.normal.array),s.invert(u,o),s.transpose(u,u),f[3]=0,A.copy(f,this.normal.array),x.transformMat4(f,f,u),A.copy(this.normal.array,f)}}(),copy:function(u){A.copy(this.normal.array,u.normal.array),this.normal._dirty=!0,this.distance=u.distance},clone:function(){var u=new c;return u.copy(this),u}},X.a=c},function(re,X,D){"use strict";var W=D(13),y=D(15),L=W.a.extend({dynamic:!1,widthSegments:40,heightSegments:20,phiStart:0,phiLength:Math.PI*2,thetaStart:0,thetaLength:Math.PI,radius:1},function(){this.build()},{build:function(){var A=this.heightSegments,s=this.widthSegments,x=this.attributes.position,c=this.attributes.texcoord0,u=this.attributes.normal,f=(s+1)*(A+1);x.init(f),c.init(f),u.init(f);var i=f>65535?Uint32Array:Uint16Array,o=this.indices=new i(s*A*6),d,m,_,h,v,r,a,R=this.radius,p=this.phiStart,E=this.phiLength,S=this.thetaStart,w=this.thetaLength,R=this.radius,O=[],z=[],N=0,P=1/R;for(a=0;a<=A;a++)for(r=0;r<=s;r++)h=r/s,v=a/A,d=-R*Math.cos(p+h*E)*Math.sin(S+v*w),m=R*Math.cos(S+v*w),_=R*Math.sin(p+h*E)*Math.sin(S+v*w),O[0]=d,O[1]=m,O[2]=_,z[0]=h,z[1]=v,x.set(N,O),c.set(N,z),O[0]*=P,O[1]*=P,O[2]*=P,u.set(N,O),N++;var F,K,B,V,C=s+1,M=0;for(a=0;a<A;a++)for(r=0;r<s;r++)K=a*C+r,F=a*C+r+1,V=(a+1)*C+r+1,B=(a+1)*C+r,o[M++]=F,o[M++]=K,o[M++]=V,o[M++]=K,o[M++]=B,o[M++]=V;this.boundingBox=new y.a,this.boundingBox.max.set(R,R,R),this.boundingBox.min.set(-R,-R,-R)}});X.a=L},function(re,X,D){"use strict";var W=D(13),y=D(37),L=D(9),A=D(4),s=D(15),x=D(18),c=new L.a,u=W.a.extend({dynamic:!1,widthSegments:1,heightSegments:1,depthSegments:1,inside:!1},function(){this.build()},{build:function(){var i={px:f("px",this.depthSegments,this.heightSegments),nx:f("nx",this.depthSegments,this.heightSegments),py:f("py",this.widthSegments,this.depthSegments),ny:f("ny",this.widthSegments,this.depthSegments),pz:f("pz",this.widthSegments,this.heightSegments),nz:f("nz",this.widthSegments,this.heightSegments)},o=["position","texcoord0","normal"],d=0,m=0;for(var _ in i)d+=i[_].vertexCount,m+=i[_].indices.length;for(var h=0;h<o.length;h++)this.attributes[o[h]].init(d);this.indices=new x.a.Uint16Array(m);var v=0,r=0;for(var _ in i){for(var a=i[_],h=0;h<o.length;h++)for(var p=o[h],E=a.attributes[p].value,S=a.attributes[p].size,w=p==="normal",R=0;R<E.length;R++){var O=E[R];this.inside&&w&&(O=-O),this.attributes[p].value[R+S*r]=O}for(var z=a.indices.length,R=0;R<a.indices.length;R++)this.indices[R+v]=r+a.indices[this.inside?z-R-1:R];v+=a.indices.length,r+=a.vertexCount}this.boundingBox=new s.a,this.boundingBox.max.set(1,1,1),this.boundingBox.min.set(-1,-1,-1)}});function f(i,o,d){c.identity();var m=new y.a({widthSegments:o,heightSegments:d});switch(i){case"px":L.a.translate(c,c,A.a.POSITIVE_X),L.a.rotateY(c,c,Math.PI/2);break;case"nx":L.a.translate(c,c,A.a.NEGATIVE_X),L.a.rotateY(c,c,-Math.PI/2);break;case"py":L.a.translate(c,c,A.a.POSITIVE_Y),L.a.rotateX(c,c,-Math.PI/2);break;case"ny":L.a.translate(c,c,A.a.NEGATIVE_Y),L.a.rotateX(c,c,Math.PI/2);break;case"pz":L.a.translate(c,c,A.a.POSITIVE_Z);break;case"nz":L.a.translate(c,c,A.a.NEGATIVE_Z),L.a.rotateY(c,c,Math.PI);break}return m.applyTransform(c),m}X.a=u},function(re,X,D){"use strict";var W=D(19),y=D(4),L=W.a.extend({shadowBias:.001,shadowSlopeScale:2,shadowCascade:1,cascadeSplitLogFactor:.2},{type:"DIRECTIONAL_LIGHT",uniformTemplates:{directionalLightDirection:{type:"3f",value:function(A){return A.__dir=A.__dir||new y.a,A.__dir.copy(A.worldTransform.z).normalize().negate().array}},directionalLightColor:{type:"3f",value:function(A){var s=A.color,x=A.intensity;return[s[0]*x,s[1]*x,s[2]*x]}}},clone:function(){var A=W.a.prototype.clone.call(this);return A.shadowBias=this.shadowBias,A.shadowSlopeScale=this.shadowSlopeScale,A}});X.a=L},function(re,X,D){"use strict";var W=D(19),y=W.a.extend({range:100,castShadow:!1},{type:"POINT_LIGHT",uniformTemplates:{pointLightPosition:{type:"3f",value:function(L){return L.getWorldPosition().array}},pointLightRange:{type:"1f",value:function(L){return L.range}},pointLightColor:{type:"3f",value:function(L){var A=L.color,s=L.intensity;return[A[0]*s,A[1]*s,A[2]*s]}}},clone:function(){var L=W.a.prototype.clone.call(this);return L.range=this.range,L}});X.a=y},function(re,X,D){"use strict";var W=D(19),y=D(4),L=W.a.extend({range:20,umbraAngle:30,penumbraAngle:45,falloffFactor:2,shadowBias:2e-4,shadowSlopeScale:2},{type:"SPOT_LIGHT",uniformTemplates:{spotLightPosition:{type:"3f",value:function(A){return A.getWorldPosition().array}},spotLightRange:{type:"1f",value:function(A){return A.range}},spotLightUmbraAngleCosine:{type:"1f",value:function(A){return Math.cos(A.umbraAngle*Math.PI/180)}},spotLightPenumbraAngleCosine:{type:"1f",value:function(A){return Math.cos(A.penumbraAngle*Math.PI/180)}},spotLightFalloffFactor:{type:"1f",value:function(A){return A.falloffFactor}},spotLightDirection:{type:"3f",value:function(A){return A.__dir=A.__dir||new y.a,A.__dir.copy(A.worldTransform.z).negate().array}},spotLightColor:{type:"3f",value:function(A){var s=A.color,x=A.intensity;return[s[0]*x,s[1]*x,s[2]*x]}}},clone:function(){var A=W.a.prototype.clone.call(this);return A.range=this.range,A.umbraAngle=this.umbraAngle,A.penumbraAngle=this.penumbraAngle,A.falloffFactor=this.falloffFactor,A.shadowBias=this.shadowBias,A.shadowSlopeScale=this.shadowSlopeScale,A}});X.a=L},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(5);function A(x,c,u,f,i,o,d){this._zr=x,this._x=0,this._y=0,this._rowHeight=0,this.width=f,this.height=i,this.offsetX=c,this.offsetY=u,this.dpr=d,this.gap=o}A.prototype={constructor:A,clear:function(){this._x=0,this._y=0,this._rowHeight=0},add:function(x,c,u){var f=x.getBoundingRect();c==null&&(c=f.width),u==null&&(u=f.height),c*=this.dpr,u*=this.dpr,this._fitElement(x,c,u);var i=this._x,o=this._y,d=this.width*this.dpr,m=this.height*this.dpr,_=this.gap;if(i+c+_>d&&(i=this._x=0,o+=this._rowHeight+_,this._y=o,this._rowHeight=0),this._x+=c+_,this._rowHeight=Math.max(this._rowHeight,u),o+u+_>m)return null;x.position[0]+=this.offsetX*this.dpr+i,x.position[1]+=this.offsetY*this.dpr+o,this._zr.add(x);var h=[this.offsetX/this.width,this.offsetY/this.height],v=[[i/d+h[0],o/m+h[1]],[(i+c)/d+h[0],(o+u)/m+h[1]]];return v},_fitElement:function(x,c,u){var f=x.getBoundingRect(),i=c/f.width,o=u/f.height;x.position=[-f.x*i,-f.y*o],x.scale=[i,o],x.update()}};function s(x){x=x||{},x.width=x.width||512,x.height=x.height||512,x.devicePixelRatio=x.devicePixelRatio||1,x.gap=x.gap==null?2:x.gap;var c=document.createElement("canvas");c.width=x.width*x.devicePixelRatio,c.height=x.height*x.devicePixelRatio,this._canvas=c,this._texture=new L.a({image:c,flipY:!1});var u=this;this._zr=y.a.zrender.init(c);var f=this._zr.refreshImmediately;this._zr.refreshImmediately=function(){f.call(this),u._texture.dirty(),u.onupdate&&u.onupdate()},this._dpr=x.devicePixelRatio,this._coords={},this.onupdate=x.onupdate,this._gap=x.gap,this._textureAtlasNodes=[new A(this._zr,0,0,x.width,x.height,this._gap,this._dpr)],this._nodeWidth=x.width,this._nodeHeight=x.height,this._currentNodeIdx=0}s.prototype={clear:function(){for(var x=0;x<this._textureAtlasNodes.length;x++)this._textureAtlasNodes[x].clear();this._currentNodeIdx=0,this._zr.clear(),this._coords={}},getWidth:function(){return this._width},getHeight:function(){return this._height},getTexture:function(){return this._texture},getDevicePixelRatio:function(){return this._dpr},getZr:function(){return this._zr},_getCurrentNode:function(){return this._textureAtlasNodes[this._currentNodeIdx]},_expand:function(){if(this._currentNodeIdx++,this._textureAtlasNodes[this._currentNodeIdx])return this._textureAtlasNodes[this._currentNodeIdx];var x=4096/this._dpr,c=this._textureAtlasNodes,u=c.length,f=u*this._nodeWidth%x,i=Math.floor(u*this._nodeWidth/x)*this._nodeHeight;if(i>=x){console.error("Too much labels. Some will be ignored.");return}var o=(f+this._nodeWidth)*this._dpr,d=(i+this._nodeHeight)*this._dpr;try{this._zr.resize({width:o,height:d})}catch(_){this._canvas.width=o,this._canvas.height=d}var m=new A(this._zr,f,i,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(m),m},add:function(x,c,u){if(this._coords[x.id])return console.warn("Element already been add"),this._coords[x.id];var f=this._getCurrentNode().add(x,c,u);if(!f){var i=this._expand();if(!i)return;f=i.add(x,c,u)}return this._coords[x.id]=f,f},getCoordsScale:function(){var x=this._dpr;return[this._nodeWidth/this._canvas.width*x,this._nodeHeight/this._canvas.height*x]},getCoords:function(x){return this._coords[x]}},X.a=s},function(re,X,D){"use strict";X.a=W;function W(y,L,A){var s,x=y.scale;return x.type==="ordinal"&&(typeof A=="function"?(s=x.getTicks()[L],!A(s,x.getLabel(s))):L%(A+1))}},function(re,X,D){var W=D(76),y=D(77),L=W.applyTransform,A=Math.min,s=Math.max;function x(u,f,i,o){i<0&&(u=u+i,i=-i),o<0&&(f=f+o,o=-o),this.x=u,this.y=f,this.width=i,this.height=o}x.prototype={constructor:x,union:function(u){var f=A(u.x,this.x),i=A(u.y,this.y);this.width=s(u.x+u.width,this.x+this.width)-f,this.height=s(u.y+u.height,this.y+this.height)-i,this.x=f,this.y=i},applyTransform:function(){var u=[],f=[],i=[],o=[];return function(d){if(d){u[0]=i[0]=this.x,u[1]=o[1]=this.y,f[0]=o[0]=this.x+this.width,f[1]=i[1]=this.y+this.height,L(u,u,d),L(f,f,d),L(i,i,d),L(o,o,d),this.x=A(u[0],f[0],i[0],o[0]),this.y=A(u[1],f[1],i[1],o[1]);var m=s(u[0],f[0],i[0],o[0]),_=s(u[1],f[1],i[1],o[1]);this.width=m-this.x,this.height=_-this.y}}}(),calculateTransform:function(u){var f=this,i=u.width/f.width,o=u.height/f.height,d=y.create();return y.translate(d,d,[-f.x,-f.y]),y.scale(d,d,[i,o]),y.translate(d,d,[u.x,u.y]),d},intersect:function(u){if(!u)return!1;u instanceof x||(u=x.create(u));var f=this,i=f.x,o=f.x+f.width,d=f.y,m=f.y+f.height,_=u.x,h=u.x+u.width,v=u.y,r=u.y+u.height;return!(o<_||h<i||m<v||r<d)},contain:function(u,f){var i=this;return u>=i.x&&u<=i.x+i.width&&f>=i.y&&f<=i.y+i.height},clone:function(){return new x(this.x,this.y,this.width,this.height)},copy:function(u){this.x=u.x,this.y=u.y,this.width=u.width,this.height=u.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},x.create=function(u){return new x(u.x,u.y,u.width,u.height)};var c=x;re.exports=c},function(re,X){var D=typeof Float32Array=="undefined"?Array:Float32Array;function W(N,P){var F=new D(2);return N==null&&(N=0),P==null&&(P=0),F[0]=N,F[1]=P,F}function y(N,P){return N[0]=P[0],N[1]=P[1],N}function L(N){var P=new D(2);return P[0]=N[0],P[1]=N[1],P}function A(N,P,F){return N[0]=P,N[1]=F,N}function s(N,P,F){return N[0]=P[0]+F[0],N[1]=P[1]+F[1],N}function x(N,P,F,K){return N[0]=P[0]+F[0]*K,N[1]=P[1]+F[1]*K,N}function c(N,P,F){return N[0]=P[0]-F[0],N[1]=P[1]-F[1],N}function u(N){return Math.sqrt(i(N))}var f=u;function i(N){return N[0]*N[0]+N[1]*N[1]}var o=i;function d(N,P,F){return N[0]=P[0]*F[0],N[1]=P[1]*F[1],N}function m(N,P,F){return N[0]=P[0]/F[0],N[1]=P[1]/F[1],N}function _(N,P){return N[0]*P[0]+N[1]*P[1]}function h(N,P,F){return N[0]=P[0]*F,N[1]=P[1]*F,N}function v(N,P){var F=u(P);return F===0?(N[0]=0,N[1]=0):(N[0]=P[0]/F,N[1]=P[1]/F),N}function r(N,P){return Math.sqrt((N[0]-P[0])*(N[0]-P[0])+(N[1]-P[1])*(N[1]-P[1]))}var a=r;function p(N,P){return(N[0]-P[0])*(N[0]-P[0])+(N[1]-P[1])*(N[1]-P[1])}var E=p;function S(N,P){return N[0]=-P[0],N[1]=-P[1],N}function w(N,P,F,K){return N[0]=P[0]+K*(F[0]-P[0]),N[1]=P[1]+K*(F[1]-P[1]),N}function R(N,P,F){var K=P[0],B=P[1];return N[0]=F[0]*K+F[2]*B+F[4],N[1]=F[1]*K+F[3]*B+F[5],N}function O(N,P,F){return N[0]=Math.min(P[0],F[0]),N[1]=Math.min(P[1],F[1]),N}function z(N,P,F){return N[0]=Math.max(P[0],F[0]),N[1]=Math.max(P[1],F[1]),N}X.create=W,X.copy=y,X.clone=L,X.set=A,X.add=s,X.scaleAndAdd=x,X.sub=c,X.len=u,X.length=f,X.lenSquare=i,X.lengthSquare=o,X.mul=d,X.div=m,X.dot=_,X.scale=h,X.normalize=v,X.distance=r,X.dist=a,X.distanceSquare=p,X.distSquare=E,X.negate=S,X.lerp=w,X.applyTransform=R,X.min=O,X.max=z},function(re,X){var D=typeof Float32Array=="undefined"?Array:Float32Array;function W(){var i=new D(6);return y(i),i}function y(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=1,i[4]=0,i[5]=0,i}function L(i,o){return i[0]=o[0],i[1]=o[1],i[2]=o[2],i[3]=o[3],i[4]=o[4],i[5]=o[5],i}function A(i,o,d){var m=o[0]*d[0]+o[2]*d[1],_=o[1]*d[0]+o[3]*d[1],h=o[0]*d[2]+o[2]*d[3],v=o[1]*d[2]+o[3]*d[3],r=o[0]*d[4]+o[2]*d[5]+o[4],a=o[1]*d[4]+o[3]*d[5]+o[5];return i[0]=m,i[1]=_,i[2]=h,i[3]=v,i[4]=r,i[5]=a,i}function s(i,o,d){return i[0]=o[0],i[1]=o[1],i[2]=o[2],i[3]=o[3],i[4]=o[4]+d[0],i[5]=o[5]+d[1],i}function x(i,o,d){var m=o[0],_=o[2],h=o[4],v=o[1],r=o[3],a=o[5],p=Math.sin(d),E=Math.cos(d);return i[0]=m*E+v*p,i[1]=-m*p+v*E,i[2]=_*E+r*p,i[3]=-_*p+E*r,i[4]=E*h+p*a,i[5]=E*a-p*h,i}function c(i,o,d){var m=d[0],_=d[1];return i[0]=o[0]*m,i[1]=o[1]*_,i[2]=o[2]*m,i[3]=o[3]*_,i[4]=o[4]*m,i[5]=o[5]*_,i}function u(i,o){var d=o[0],m=o[2],_=o[4],h=o[1],v=o[3],r=o[5],a=d*v-h*m;return a?(a=1/a,i[0]=v*a,i[1]=-h*a,i[2]=-m*a,i[3]=d*a,i[4]=(m*r-v*_)*a,i[5]=(h*_-d*r)*a,i):null}function f(i){var o=W();return L(o,i),o}X.create=W,X.identity=y,X.copy=L,X.mul=A,X.translate=s,X.rotate=x,X.scale=c,X.invert=u,X.clone=f},function(re,X,D){var W=D(12),y=1e-4;function L(w){return w.replace(/^\s+/,"").replace(/\s+$/,"")}function A(w,R,O,z){var N=R[1]-R[0],P=O[1]-O[0];if(N===0)return P===0?O[0]:(O[0]+O[1])/2;if(z)if(N>0){if(w<=R[0])return O[0];if(w>=R[1])return O[1]}else{if(w>=R[0])return O[0];if(w<=R[1])return O[1]}else{if(w===R[0])return O[0];if(w===R[1])return O[1]}return(w-R[0])/N*P+O[0]}function s(w,R){switch(w){case"center":case"middle":w="50%";break;case"left":case"top":w="0%";break;case"right":case"bottom":w="100%";break}return typeof w=="string"?L(w).match(/%$/)?parseFloat(w)/100*R:parseFloat(w):w==null?NaN:+w}function x(w,R,O){return R==null&&(R=10),R=Math.min(Math.max(0,R),20),w=(+w).toFixed(R),O?w:+w}function c(w){return w.sort(function(R,O){return R-O}),w}function u(w){if(w=+w,isNaN(w))return 0;for(var R=1,O=0;Math.round(w*R)/R!==w;)R*=10,O++;return O}function f(w){var R=w.toString(),O=R.indexOf("e");if(O>0){var z=+R.slice(O+1);return z<0?-z:0}else{var N=R.indexOf(".");return N<0?0:R.length-1-N}}function i(w,R){var O=Math.log,z=Math.LN10,N=Math.floor(O(w[1]-w[0])/z),P=Math.round(O(Math.abs(R[1]-R[0]))/z),F=Math.min(Math.max(-N+P,0),20);return isFinite(F)?F:20}function o(w,R,O){if(!w[R])return 0;var z=W.reduce(w,function(q,se){return q+(isNaN(se)?0:se)},0);if(z===0)return 0;for(var N=Math.pow(10,O),P=W.map(w,function(q){return(isNaN(q)?0:q)/z*N*100}),F=N*100,K=W.map(P,function(q){return Math.floor(q)}),B=W.reduce(K,function(q,se){return q+se},0),V=W.map(P,function(q,se){return q-K[se]});B<F;){for(var C=Number.NEGATIVE_INFINITY,M=null,H=0,$=V.length;H<$;++H)V[H]>C&&(C=V[H],M=H);++K[M],V[M]=0,++B}return K[R]/N}var d=9007199254740991;function m(w){var R=Math.PI*2;return(w%R+R)%R}function _(w){return w>-y&&w<y}var h=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function v(w){if(w instanceof Date)return w;if(typeof w=="string"){var R=h.exec(w);if(!R)return new Date(NaN);if(R[8]){var O=+R[4]||0;return R[8].toUpperCase()!=="Z"&&(O-=R[8].slice(0,3)),new Date(Date.UTC(+R[1],+(R[2]||1)-1,+R[3]||1,O,+(R[5]||0),+R[6]||0,+R[7]||0))}else return new Date(+R[1],+(R[2]||1)-1,+R[3]||1,+R[4]||0,+(R[5]||0),+R[6]||0,+R[7]||0)}else if(w==null)return new Date(NaN);return new Date(Math.round(w))}function r(w){return Math.pow(10,a(w))}function a(w){return Math.floor(Math.log(w)/Math.LN10)}function p(w,R){var O=a(w),z=Math.pow(10,O),N=w/z,P;return R?N<1.5?P=1:N<2.5?P=2:N<4?P=3:N<7?P=5:P=10:N<1?P=1:N<2?P=2:N<3?P=3:N<5?P=5:P=10,w=P*z,O>=-20?+w.toFixed(O<0?-O:0):w}function E(w){w.sort(function(B,V){return K(B,V,0)?-1:1});for(var R=-1/0,O=1,z=0;z<w.length;){for(var N=w[z].interval,P=w[z].close,F=0;F<2;F++)N[F]<=R&&(N[F]=R,P[F]=F?1:1-O),R=N[F],O=P[F];N[0]===N[1]&&P[0]*P[1]!==1?w.splice(z,1):z++}return w;function K(B,V,C){return B.interval[C]<V.interval[C]||B.interval[C]===V.interval[C]&&(B.close[C]-V.close[C]===(C?-1:1)||!C&&K(B,V,1))}}function S(w){return w-parseFloat(w)>=0}X.linearMap=A,X.parsePercent=s,X.round=x,X.asc=c,X.getPrecision=u,X.getPrecisionSafe=f,X.getPixelPrecision=i,X.getPercentWithPrecision=o,X.MAX_SAFE_INTEGER=d,X.remRadian=m,X.isRadianAroundZero=_,X.parseDate=v,X.quantity=r,X.nice=p,X.reformIntervals=E,X.isNumeric=S},function(re,X,D){"use strict";var W=D(5),y=D(11),L=D(21),A=function(){this._pool={},this._allocatedTextures=[]};A.prototype={constructor:A,get:function(i){var o=c(i);this._pool.hasOwnProperty(o)||(this._pool[o]=[]);var d=this._pool[o];if(!d.length){var m=new W.a(i);return this._allocatedTextures.push(m),m}return d.pop()},put:function(i){var o=c(i);this._pool.hasOwnProperty(o)||(this._pool[o]=[]);var d=this._pool[o];d.push(i)},clear:function(i){for(var o=0;o<this._allocatedTextures.length;o++)this._allocatedTextures[o].dispose(i);this._pool={},this._allocatedTextures=[]}};var s={width:512,height:512,type:y.a.UNSIGNED_BYTE,format:y.a.RGBA,wrapS:y.a.CLAMP_TO_EDGE,wrapT:y.a.CLAMP_TO_EDGE,minFilter:y.a.LINEAR_MIPMAP_LINEAR,magFilter:y.a.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,unpackAlignment:4,premultiplyAlpha:!1},x=Object.keys(s);function c(i){L.a.defaultsWithPropList(i,s,x),u(i);for(var o="",d=0;d<x.length;d++){var m=x[d],_=i[m].toString();o+=_}return o}function u(i){var o=f(i.width,i.height);i.format===y.a.DEPTH_COMPONENT&&(i.useMipmap=!1),(!o||!i.useMipmap)&&(i.minFilter==y.a.NEAREST_MIPMAP_NEAREST||i.minFilter==y.a.NEAREST_MIPMAP_LINEAR?i.minFilter=y.a.NEAREST:(i.minFilter==y.a.LINEAR_MIPMAP_LINEAR||i.minFilter==y.a.LINEAR_MIPMAP_NEAREST)&&(i.minFilter=y.a.LINEAR)),o||(i.wrapS=y.a.CLAMP_TO_EDGE,i.wrapT=y.a.CLAMP_TO_EDGE)}function f(i,o){return(i&i-1)===0&&(o&o-1)===0}X.a=A},function(re,X,D){"use strict";var W=D(0),y=D.n(W);X.a={getFilledRegions:function(L,A){var s=(L||[]).slice(),x;if(typeof A=="string"?(A=y.a.getMap(A),x=A&&A.geoJson):A&&A.features&&(x=A),!x)return console.error("Map "+A+" not exists. You can download map file on http://echarts.baidu.com/download-map.html"),x.features||console.error("Invalid GeoJSON for map3D"),[];for(var c={},u=x.features,f=0;f<s.length;f++)c[s[f].name]=s[f];for(var f=0;f<u.length;f++){var i=u[f].properties.name;c[i]||s.push({name:i})}return s},defaultOption:{show:!0,zlevel:-10,map:"",left:0,top:0,width:"100%",height:"100%",boxWidth:100,boxHeight:10,boxDepth:"auto",regionHeight:3,environment:"auto",groundPlane:{show:!1,color:"#aaa"},shading:"lambert",light:{main:{alpha:40,beta:30}},viewControl:{alpha:40,beta:0,distance:100,orthographicSize:60,minAlpha:5,minBeta:-80,maxBeta:80},label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}}},function(re,X,D){"use strict";function W(s,x,c){var u=s[x];s[x]=s[c],s[c]=u}function y(s,x,c,u,f){var i=c,o=s[x];W(s,x,u);for(var d=c;d<u;d++)f(s[d],o)<0&&(W(s,d,i),i++);return W(s,u,i),i}function L(s,x,c,u){if(c<u){var f=Math.floor((c+u)/2),i=y(s,f,c,u,x);L(s,x,c,i-1),L(s,x,i+1,u)}}function A(){this._parts=[]}A.prototype.step=function(s,x,c){var u=s.length;if(c===0){this._parts=[],this._sorted=!1;var f=Math.floor(u/2);this._parts.push({pivot:f,left:0,right:u-1}),this._currentSortPartIdx=0}if(!this._sorted){var i=this._parts;if(i.length===0)return this._sorted=!0,!0;if(i.length<512){for(var o=0;o<i.length;o++)i[o].pivot=y(s,i[o].pivot,i[o].left,i[o].right,x);for(var d=[],o=0;o<i.length;o++){var m=i[o].left,_=i[o].pivot-1;_>m&&d.push({pivot:Math.floor((_+m)/2),left:m,right:_});var m=i[o].pivot+1,_=i[o].right;_>m&&d.push({pivot:Math.floor((_+m)/2),left:m,right:_})}i=this._parts=d}else for(var o=0;o<Math.floor(i.length/10);o++){var h=i.length-1-this._currentSortPartIdx;if(L(s,x,i[h].left,i[h].right),this._currentSortPartIdx++,this._currentSortPartIdx===i.length)return this._sorted=!0,!0}return!1}},A.sort=L,X.a=A},function(re,X,D){"use strict";var W=D(83),y=D(0),L=D.n(y),A=D(41),s=D.n(A),x=D(20),c=D(3);function u(m,_){var h=m.getBoxLayoutParams(),v=s.a.getLayoutRect(h,{width:_.getWidth(),height:_.getHeight()});v.y=_.getHeight()-v.y-v.height,this.viewGL.setViewport(v.x,v.y,v.width,v.height,_.getDevicePixelRatio());var r=this.getGeoBoundingRect(),a=r.width/r.height*(m.get("aspectScale")||.75),p=m.get("boxWidth"),E=m.get("boxDepth"),S=m.get("boxHeight");S==null&&(S=5),isNaN(p)&&isNaN(E)&&(p=100),isNaN(E)?E=p/a:isNaN(p)&&(p=E/a),this.setSize(p,S,E),this.regionHeight=m.get("regionHeight"),this.altitudeAxis&&this.altitudeAxis.setExtent(0,Math.max(S-this.regionHeight,0))}function f(m,_){var h=[1/0,-1/0];if(m.eachSeries(function(r){if(r.coordinateSystem===this&&r.type!=="series.map3D"){var a=r.getData(),p=r.coordDimToDataDim("alt")[0];if(p){var E=a.getDataExtent(p,!0);h[0]=Math.min(h[0],E[0]),h[1]=Math.max(h[1],E[1])}}},this),h&&isFinite(h[1]-h[0])){var v=L.a.helper.createScale(h,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new L.a.Axis("altitude",v),this.resize(this.model,_)}}var i=function(m){console.error("Map "+m+" not exists. You can download map file on http://echarts.baidu.com/download-map.html")},o=0,d={dimensions:W.a.prototype.dimensions,create:function(m,_){var h=[];if(!L.a.getMap)throw new Error("geo3D component depends on geo component");function v(r,a){var p=d.createGeo3D(r);r.__viewGL=r.__viewGL||new x.a,p.viewGL=r.__viewGL,r.coordinateSystem=p,p.model=r,h.push(p),p.resize=u,p.resize(r,_),p.update=f}return m.eachComponent("geo3D",function(r,a){v(r,a)}),m.eachSeriesByType("map3D",function(r,a){var p=r.get("coordinateSystem");p==null&&(p="geo3D"),p==="geo3D"&&v(r,a)}),m.eachSeries(function(r){if(r.get("coordinateSystem")==="geo3D"){if(r.type==="series.map3D")return;var a=r.getReferringComponents("geo3D")[0];if(a||(a=m.getComponent("geo3D")),!a)throw new Error('geo "'+c.a.firstNotNull(r.get("geo3DIndex"),r.get("geo3DId"),0)+'" not found');r.coordinateSystem=a.coordinateSystem}}),h},createGeo3D:function(m){var _=m.get("map"),h;if(typeof _=="string"?(h=_,_=L.a.getMap(_)):_&&_.features&&(_={geoJson:_}),_||i(_),!_.geoJson.features)throw new Error("Invalid GeoJSON for map3D");return h==null&&(h="GEO_ANONYMOUS_"+o++),new W.a(h+o++,h,_&&_.geoJson,_&&_.specialAreas,m.get("nameMap"))}};L.a.registerCoordinateSystem("geo3D",d),X.a=d},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(1),A=D.n(L),s=D(187),x=D.n(s),c=D(188),u=D.n(c),f=A.a.vec3,i=A.a.mat4,o=[x.a,u.a];function d(m,_,h,v,r){this.name=m,this.map=_,this.regionHeight=0,this.regions=[],this._nameCoordMap={},this.loadGeoJson(h,v,r),this.transform=i.identity(new Float64Array(16)),this.invTransform=i.identity(new Float64Array(16)),this.extrudeY=!0,this.altitudeAxis}d.prototype={constructor:d,type:"geo3D",dimensions:["lng","lat","alt"],containPoint:function(){},loadGeoJson:function(m,_,h){var v=y.a.parseGeoJSON||y.a.parseGeoJson;try{this.regions=m?v(m):[]}catch(w){throw`Invalid geoJson format
|
|
`+w}_=_||{},h=h||{};for(var r=this.regions,a={},p=0;p<r.length;p++){var E=r[p].name;E=h[E]||E,r[p].name=E,a[E]=r[p],this.addGeoCoord(E,r[p].center);var S=_[E];S&&r[p].transformTo(S.left,S.top,S.width,S.height)}this._regionsMap=a,this._geoRect=null,o.forEach(function(w){w(this)},this)},getGeoBoundingRect:function(){if(this._geoRect)return this._geoRect;for(var m,_=this.regions,h=0;h<_.length;h++){var v=_[h].getBoundingRect();m=m||v.clone(),m.union(v)}return this._geoRect=m||new y.a.graphic.BoundingRect(0,0,0,0)},addGeoCoord:function(m,_){this._nameCoordMap[m]=_},getRegion:function(m){return this._regionsMap[m]},getRegionByCoord:function(m){for(var _=this.regions,h=0;h<_.length;h++)if(_[h].contain(m))return _[h]},setSize:function(m,_,h){this.size=[m,_,h];var v=this.getGeoBoundingRect(),r=m/v.width,a=-h/v.height,p=-m/2-v.x*r,E=h/2-v.y*a,S=this.extrudeY?[p,0,E]:[p,E,0],w=this.extrudeY?[r,1,a]:[r,a,1],R=this.transform;i.identity(R),i.translate(R,R,S),i.scale(R,R,w),i.invert(this.invTransform,R)},dataToPoint:function(m,_){_=_||[];var h=this.extrudeY?1:2,v=this.extrudeY?2:1,r=m[2];return isNaN(r)&&(r=0),_[0]=m[0],_[v]=m[1],this.altitudeAxis?_[h]=this.altitudeAxis.dataToCoord(r):_[h]=0,_[h]+=this.regionHeight,f.transformMat4(_,_,this.transform),_},pointToData:function(m,_){}},X.a=d},function(re,X,D){"use strict";var W=D(77),y=D.n(W),L=D(76),A=D.n(L);function s(x){this.viewGL=x}s.prototype.reset=function(x,c){this._updateCamera(c.getWidth(),c.getHeight(),c.getDevicePixelRatio()),this._viewTransform=y.a.create(),this.updateTransform(x,c)},s.prototype.updateTransform=function(x,c){var u=x.coordinateSystem;u.getRoamTransform&&(y.a.invert(this._viewTransform,u.getRoamTransform()),this._setCameraTransform(this._viewTransform),c.getZr().refresh())},s.prototype.dataToPoint=function(x,c,u){u=x.dataToPoint(c,null,u);var f=this._viewTransform;f&&A.a.applyTransform(u,u,f)},s.prototype.removeTransformInPoint=function(x){return this._viewTransform&&A.a.applyTransform(x,x,this._viewTransform),x},s.prototype.getZoom=function(){if(this._viewTransform){var x=this._viewTransform;return 1/Math.max(Math.sqrt(x[0]*x[0]+x[1]*x[1]),Math.sqrt(x[2]*x[2]+x[3]*x[3]))}return 1},s.prototype._setCameraTransform=function(x){var c=this.viewGL.camera;c.position.set(x[4],x[5],0),c.scale.set(Math.sqrt(x[0]*x[0]+x[1]*x[1]),Math.sqrt(x[2]*x[2]+x[3]*x[3]),1)},s.prototype._updateCamera=function(x,c,u){this.viewGL.setViewport(0,0,x,c,u);var f=this.viewGL.camera;f.left=f.top=0,f.bottom=c,f.right=x,f.near=0,f.far=100},X.a=s},function(re,X,D){(function(W){var y;typeof window!="undefined"?y=window.__DEV__:typeof W!="undefined"&&(y=W.__DEV__),typeof y=="undefined"&&(y=!0);var L=y;X.__DEV__=L}).call(X,D(243))},function(re,X,D){"use strict";var W=D(13),y=D(0),L=D.n(y),A=D(33),s=D(1),x=D.n(s),c=x.a.vec2,u=[[0,0],[1,1]],f=W.a.extend(function(){return{segmentScale:4,dynamic:!0,useNativeLine:!0,attributes:{position:new W.a.Attribute("position","float",2,"POSITION"),normal:new W.a.Attribute("normal","float",2),offset:new W.a.Attribute("offset","float",1),color:new W.a.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(i){var o=this.attributes;this.vertexCount!==i&&(o.position.init(i),o.color.init(i),this.useNativeLine||(o.offset.init(i),o.normal.init(i)),i>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(i){this.triangleCount!==i&&(i===0?this.indices=null:this.indices=this.vertexCount>65535?new Uint32Array(i*3):new Uint16Array(i*3))},_getCubicCurveApproxStep:function(i,o,d,m){var _=c.dist(i,o)+c.dist(d,o)+c.dist(m,d),h=1/(_+1)*this.segmentScale;return h},getCubicCurveVertexCount:function(i,o,d,m){var _=this._getCubicCurveApproxStep(i,o,d,m),h=Math.ceil(1/_);return this.useNativeLine?h*2:h*2+2},getCubicCurveTriangleCount:function(i,o,d,m){var _=this._getCubicCurveApproxStep(i,o,d,m),h=Math.ceil(1/_);return this.useNativeLine?0:h*2},getLineVertexCount:function(){return this.getPolylineVertexCount(u)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(u)},getPolylineVertexCount:function(i){var o;if(typeof i=="number")o=i;else{var d=typeof i[0]!="number";o=d?i.length:i.length/2}return this.useNativeLine?(o-1)*2:(o-1)*2+2},getPolylineTriangleCount:function(i){var o;if(typeof i=="number")o=i;else{var d=typeof i[0]!="number";o=d?i.length:i.length/2}return this.useNativeLine?0:(o-1)*2},addCubicCurve:function(i,o,d,m,_,h){h==null&&(h=1);for(var v=i[0],r=i[1],a=o[0],p=o[1],E=d[0],S=d[1],w=m[0],R=m[1],O=this._getCubicCurveApproxStep(i,o,d,m),z=O*O,N=z*O,P=3*O,F=3*z,K=6*z,B=6*N,V=v-a*2+E,C=r-p*2+S,M=(a-E)*3-v+w,H=(p-S)*3-r+R,$=v,q=r,se=(a-v)*P+V*F+M*N,ue=(p-r)*P+C*F+H*N,pe=V*K+M*B,xe=C*K+H*B,De=M*B,Ue=H*B,Ge=0,Ae=0,We=Math.ceil(1/O),we=new Float32Array((We+1)*3),we=[],Se=0,Ae=0;Ae<We+1;Ae++)we[Se++]=$,we[Se++]=q,$+=se,q+=ue,se+=pe,ue+=xe,pe+=De,xe+=Ue,Ge+=O,Ge>1&&($=se>0?Math.min($,w):Math.max($,w),q=ue>0?Math.min(q,R):Math.max(q,R));this.addPolyline(we,_,h)},addLine:function(i,o,d,m){this.addPolyline([i,o],d,m)},addPolyline:function(){var i=c.create(),o=c.create(),d=c.create(),m=c.create(),_=[],h=[],v=[];return function(r,a,p,E,S){if(r.length){var w=typeof r[0]!="number";if(S==null&&(S=w?r.length:r.length/2),!(S<2)){E==null&&(E=0),p==null&&(p=1),this._itemVertexOffsets.push(this._vertexOffset);for(var R=w?typeof a[0]!="number":a.length/4===S,O=this.attributes.position,z=this.attributes.color,N=this.attributes.offset,P=this.attributes.normal,F=this.indices,K=this._vertexOffset,B,V=0;V<S;V++){if(w)_=r[V+E],R?B=a[V+E]:B=a;else{var C=V*2+E;if(_=_||[],_[0]=r[C],_[1]=r[C+1],R){var M=V*4+E;B=B||[],B[0]=a[M],B[1]=a[M+1],B[2]=a[M+2],B[3]=a[M+3]}else B=a}if(this.useNativeLine)V>1&&(O.copy(K,K-1),z.copy(K,K-1),K++);else{var H;if(V<S-1){if(w)c.copy(h,r[V+1]);else{var C=(V+1)*2+E;h=h||[],h[0]=r[C],h[1]=r[C+1]}if(V>0){c.sub(i,_,v),c.sub(o,h,_),c.normalize(i,i),c.normalize(o,o),c.add(m,i,o),c.normalize(m,m);var $=p/2*Math.min(1/c.dot(i,m),2);d[0]=-m[1],d[1]=m[0],H=$}else c.sub(i,h,_),c.normalize(i,i),d[0]=-i[1],d[1]=i[0],H=p/2}else c.sub(i,_,v),c.normalize(i,i),d[0]=-i[1],d[1]=i[0],H=p/2;P.set(K,d),P.set(K+1,d),N.set(K,H),N.set(K+1,-H),c.copy(v,_),O.set(K,_),O.set(K+1,_),z.set(K,B),z.set(K+1,B),K+=2}if(this.useNativeLine)z.set(K,B),O.set(K,_),K++;else if(V>0){var q=this._faceOffset*3,F=this.indices;F[q]=K-4,F[q+1]=K-3,F[q+2]=K-2,F[q+3]=K-3,F[q+4]=K-1,F[q+5]=K-2,this._faceOffset+=2}}this._vertexOffset=K}}}}(),setItemColor:function(i,o){for(var d=this._itemVertexOffsets[i],m=i<this._itemVertexOffsets.length-1?this._itemVertexOffsets[i+1]:this._vertexOffset,_=d;_<m;_++)this.attributes.color.set(_,o);this.dirty("color")}});L.a.util.defaults(f.prototype,A.a),X.a=f},function(re,X,D){"use strict";Object.defineProperty(X,"__esModule",{value:!0});var W=D(88),y=D(133),L=D(183),A=D(189),s=D(195),x=D(202),c=D(209),u=D(213),f=D(220),i=D(226),o=D(229),d=D(233),m=D(236),_=D(239),h=D(253),v=D(259)},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(89),A=D(90),s=D(101),x=D(2),c={version:"1.0.0",dependencies:{echarts:"4.0.0",claygl:"1.0.0"}},u=c.dependencies;function f(_){throw new Error(_+" version is too old, needs "+u[_]+" or higher")}function i(_,h){_.replace(".","")-0<u[h].replace(".","")-0&&f(h),console.log("Loaded "+h+", version "+_)}i(L.a,"claygl"),i(y.a.version,"echarts");function o(_){this._layers={},this._zr=_}o.prototype.update=function(_,h){var v=this,r=h.getZr();if(!r.getWidth()||!r.getHeight()){console.warn("Dom has no width or height");return}function a(S){var w;S.coordinateSystem&&S.coordinateSystem.model,w=S.get("zlevel");var R=v._layers,O=R[w];if(!O){if(O=R[w]=new A.a("gl-"+w,r),r.painter.isSingleCanvas()){O.virtual=!0;var z=new y.a.graphic.Image({z:1e4,style:{image:O.renderer.canvas},silent:!0});O.__hostImage=z,r.add(z)}r.painter.insertLayer(w,O)}return O.__hostImage&&O.__hostImage.setStyle({width:O.renderer.getWidth(),height:O.renderer.getHeight()}),O}function p(S,w){S&&S.traverse(function(R){R.isRenderable&&R.isRenderable()&&(R.ignorePicking=R.$ignorePicking!=null?R.$ignorePicking:w)})}for(var E in this._layers)this._layers[E].removeViewsAll();_.eachComponent(function(S,w){if(S!=="series"){var R=h.getViewOfComponentModel(w),O=w.coordinateSystem;if(R.__ecgl__){var z;if(O){if(!O.viewGL){console.error("Can't find viewGL in coordinateSystem of component "+w.id);return}z=O.viewGL}else{if(!w.viewGL){console.error("Can't find viewGL of component "+w.id);return}z=O.viewGL}var z=O.viewGL,N=a(w);N.addView(z),R.afterRender&&R.afterRender(w,_,h,N),p(R.groupGL,w.get("silent"))}}}),_.eachSeries(function(S){var w=h.getViewOfSeriesModel(S),R=S.coordinateSystem;if(w.__ecgl__){if(R&&!R.viewGL&&!w.viewGL){console.error("Can't find viewGL of series "+w.id);return}var O=R&&R.viewGL||w.viewGL,z=a(S);z.addView(O),w.afterRender&&w.afterRender(S,_,h,z),p(w.groupGL,S.get("silent"))}})};var d=y.a.init;y.a.init=function(){var _=d.apply(this,arguments);return _.getZr().painter.getRenderedCanvas=function(h){if(h=h||{},this._singleCanvas)return this._layers[0].dom;var v=document.createElement("canvas"),r=h.pixelRatio||this.dpr;v.width=this.getWidth()*r,v.height=this.getHeight()*r;var a=v.getContext("2d");a.dpr=r,a.clearRect(0,0,v.width,v.height),h.backgroundColor&&(a.fillStyle=h.backgroundColor,a.fillRect(0,0,v.width,v.height));var p=this.storage.getDisplayList(!0),E={},S,w=this;function R(P,F){var K=w._zlevelList;P==null&&(P=-1/0);for(var B,V=0;V<K.length;V++){var C=K[V],M=w._layers[C];if(!M.__builtin__&&C>P&&C<F){B=M;break}}B&&B.renderToCanvas&&(a.save(),B.renderToCanvas(a),a.restore())}for(var O={ctx:a},z=0;z<p.length;z++){var N=p[z];N.zlevel!==S&&(R(S,N.zlevel),S=N.zlevel),this._doPaintEl(N,O,!0,E)}return R(S,1/0),v},_},y.a.registerPostUpdate(function(_,h){var v=h.getZr(),r=v.__egl=v.__egl||new o(v);r.update(_,h)}),y.a.registerPreprocessor(s.a),y.a.graphicGL=x.a;var m=o},function(re,X,D){"use strict";X.a="1.0.0"},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(46),A=D(100),s=D(6),x=D(47),c=D(65),u=D.n(c),f=function(v,r){this.id=v,this.zr=r;try{this.renderer=new L.a({clearBit:0,devicePixelRatio:r.painter.dpr,preserveDrawingBuffer:!0,premultipliedAlpha:!0}),this.renderer.resize(r.painter.getWidth(),r.painter.getHeight())}catch(p){this.renderer=null,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute; left: 0; top: 0; right: 0; bottom: 0;",this.dom.className="ecgl-nowebgl",this.dom.innerHTML="Sorry, your browser does support WebGL",console.error(p);return}this.onglobalout=this.onglobalout.bind(this),r.on("globalout",this.onglobalout),this.dom=this.renderer.canvas;var a=this.dom.style;a.position="absolute",a.left="0",a.top="0",this.views=[],this._picking=new A.a({renderer:this.renderer}),this._viewsToDispose=[],this._accumulatingId=0,this._zrEventProxy=new y.a.graphic.Rect({shape:{x:-1,y:-1,width:2,height:2},__isGLToZRProxy:!0})};f.prototype.addView=function(v){if(v.layer!==this){var r=this._viewsToDispose.indexOf(v);r>=0&&this._viewsToDispose.splice(r,1),this.views.push(v),v.layer=this;var a=this.zr;v.scene.traverse(function(p){p.__zr=a,p.addAnimatorsToZr&&p.addAnimatorsToZr(a)})}};function i(v){var r=v.__zr;v.__zr=null,r&&v.removeAnimatorsFromZr&&v.removeAnimatorsFromZr(r)}f.prototype.removeView=function(v){if(v.layer===this){var r=this.views.indexOf(v);r>=0&&(this.views.splice(r,1),v.scene.traverse(i,this),v.layer=null,this._viewsToDispose.push(v))}},f.prototype.removeViewsAll=function(){this.views.forEach(function(v){v.scene.traverse(i,this),v.layer=null,this._viewsToDispose.push(v)},this),this.views.length=0},f.prototype.resize=function(v,r){var a=this.renderer;a.resize(v,r)},f.prototype.clear=function(){var v=this.renderer.gl;v.clearColor(0,0,0,0),v.depthMask(!0),v.colorMask(!0,!0,!0,!0),v.clear(v.DEPTH_BUFFER_BIT|v.COLOR_BUFFER_BIT)},f.prototype.clearDepth=function(){var v=this.renderer.gl;v.clear(v.DEPTH_BUFFER_BIT)},f.prototype.clearColor=function(){var v=this.renderer.gl;v.clearColor(0,0,0,0),v.clear(v.COLOR_BUFFER_BIT)},f.prototype.needsRefresh=function(){this.zr.refresh()},f.prototype.refresh=function(){for(var v=0;v<this.views.length;v++)this.views[v].prepareRender();this._doRender(!1),this._trackAndClean();for(var v=0;v<this._viewsToDispose.length;v++)this._viewsToDispose[v].dispose(this.renderer);this._viewsToDispose.length=0,this._startAccumulating()},f.prototype.renderToCanvas=function(v){this._startAccumulating(!0),v.drawImage(this.dom,0,0,v.canvas.width,v.canvas.height)},f.prototype._doRender=function(v){this.clear(),this.renderer.saveViewport();for(var r=0;r<this.views.length;r++)this.views[r].render(this.renderer,v);this.renderer.restoreViewport()},f.prototype._stopAccumulating=function(){this._accumulatingId=0,clearTimeout(this._accumulatingTimeout)};var o=1;f.prototype._startAccumulating=function(v){var r=this;this._stopAccumulating();for(var a=!1,p=0;p<this.views.length;p++)a=this.views[p].needsAccumulate()||a;if(!a)return;function E(S){if(!(!r._accumulatingId||S!==r._accumulatingId)){for(var w=!0,R=0;R<r.views.length;R++)w=r.views[R].isAccumulateFinished()&&a;w||(r._doRender(!0),v?E(S):u()(function(){E(S)}))}}this._accumulatingId=o++,v?E(r._accumulatingId):this._accumulatingTimeout=setTimeout(function(){E(r._accumulatingId)},50)},f.prototype._trackAndClean=function(){var v=[],r=[];this._textureList&&(d(this._textureList),d(this._geometriesList));for(var a=0;a<this.views.length;a++)h(this.views[a].scene,v,r);this._textureList&&(m(this.renderer,this._textureList),m(this.renderer,this._geometriesList)),this._textureList=v,this._geometriesList=r};function d(v){for(var r=0;r<v.length;r++)v[r].__used__=0}function m(v,r){for(var a=0;a<r.length;a++)r[a].__used__||r[a].dispose(v)}function _(v,r){v.__used__=v.__used__||0,v.__used__++,v.__used__===1&&r.push(v)}function h(v,r,a){function p(S){for(var w,R,O=0;O<S.length;O++){var z=S[O],N=z.geometry,P=z.material;if(P!==w)for(var F=P.getTextureUniforms(),K=0;K<F.length;K++){var B=F[K],V=P.uniforms[B].value;if(V){if(V instanceof s.a)_(V,r);else if(V instanceof Array)for(var C=0;C<V.length;C++)V[C]instanceof s.a&&_(V[C],r)}}N!==R&&_(N,a),w=P,R=N}}p(v.opaqueList),p(v.transparentList);for(var E=0;E<v.lights.length;E++)v.lights[E].cubemap&&_(v.lights[E].cubemap,r)}f.prototype.dispose=function(){this._stopAccumulating(),this.renderer.disposeScene(this.scene),this.zr.off("globalout",this.onglobalout)},f.prototype.onmousedown=function(v){if(!(v.target&&v.target.__isGLToZRProxy)){v=v.event;var r=this.pickObject(v.offsetX,v.offsetY);r&&(this._dispatchEvent("mousedown",v,r),this._dispatchDataEvent("mousedown",v,r)),this._downX=v.offsetX,this._downY=v.offsetY}},f.prototype.onmousemove=function(v){if(!(v.target&&v.target.__isGLToZRProxy)){v=v.event;var r=this.pickObject(v.offsetX,v.offsetY),a=r&&r.target,p=this._hovered;this._hovered=r,p&&a!==p.target&&(p.relatedTarget=a,this._dispatchEvent("mouseout",v,p),this.zr.setCursorStyle("default")),this._dispatchEvent("mousemove",v,r),r&&(this.zr.setCursorStyle("pointer"),(!p||a!==p.target)&&this._dispatchEvent("mouseover",v,r)),this._dispatchDataEvent("mousemove",v,r)}},f.prototype.onmouseup=function(v){if(!(v.target&&v.target.__isGLToZRProxy)){v=v.event;var r=this.pickObject(v.offsetX,v.offsetY);r&&(this._dispatchEvent("mouseup",v,r),this._dispatchDataEvent("mouseup",v,r)),this._upX=v.offsetX,this._upY=v.offsetY}},f.prototype.onclick=f.prototype.dblclick=function(v){if(!(v.target&&v.target.__isGLToZRProxy)){var r=this._upX-this._downX,a=this._upY-this._downY;if(!(Math.sqrt(r*r+a*a)>20)){v=v.event;var p=this.pickObject(v.offsetX,v.offsetY);p&&(this._dispatchEvent(v.type,v,p),this._dispatchDataEvent(v.type,v,p));var E=this._clickToSetFocusPoint(v);if(E){var S=E.view.setDOFFocusOnPoint(E.distance);S&&this.zr.refresh()}}}},f.prototype._clickToSetFocusPoint=function(v){for(var r=this.renderer,a=r.viewport,p=this.views.length-1;p>=0;p--){var E=this.views[p];if(E.hasDOF()&&E.containPoint(v.offsetX,v.offsetY)){this._picking.scene=E.scene,this._picking.camera=E.camera,r.viewport=E.viewport;var S=this._picking.pick(v.offsetX,v.offsetY,!0);if(S)return S.view=E,S}}r.viewport=a},f.prototype.onglobalout=function(v){var r=this._hovered;r&&this._dispatchEvent("mouseout",v,{target:r.target})},f.prototype.pickObject=function(v,r){for(var a=[],p=this.renderer,E=p.viewport,S=0;S<this.views.length;S++){var w=this.views[S];w.containPoint(v,r)&&(this._picking.scene=w.scene,this._picking.camera=w.camera,p.viewport=w.viewport,this._picking.pickAll(v,r,a))}return p.viewport=E,a.sort(function(R,O){return R.distance-O.distance}),a[0]},f.prototype._dispatchEvent=function(v,r,a){a||(a={});var p=a.target;for(a.cancelBubble=!1,a.event=r,a.type=v,a.offsetX=r.offsetX,a.offsetY=r.offsetY;p&&(p.trigger(v,a),p=p.getParent(),!a.cancelBubble););this._dispatchToView(v,a)},f.prototype._dispatchDataEvent=function(v,r,a){var p=a&&a.target,E=p&&p.dataIndex,S=p&&p.seriesIndex,w=p&&p.eventData,R=!1,O=this._zrEventProxy;O.position=[r.offsetX,r.offsetY],O.update();var z={target:O};v==="mousemove"&&(E!=null?E!==this._lastDataIndex&&(parseInt(this._lastDataIndex,10)>=0&&(O.dataIndex=this._lastDataIndex,O.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(z,"mouseout",r)),R=!0):w!=null&&w!==this._lastEventData&&(this._lastEventData!=null&&(O.eventData=this._lastEventData,this.zr.handler.dispatchToElement(z,"mouseout",r)),R=!0),this._lastEventData=w,this._lastDataIndex=E,this._lastSeriesIndex=S),O.eventData=w,O.dataIndex=E,O.seriesIndex=S,(w!=null||parseInt(E,10)>=0)&&(this.zr.handler.dispatchToElement(z,v,r),R&&this.zr.handler.dispatchToElement(z,"mouseover",r))},f.prototype._dispatchToView=function(v,r){for(var a=0;a<this.views.length;a++)this.views[a].containPoint(r.offsetX,r.offsetY)&&this.views[a].trigger(v,r)},y.a.util.extend(f.prototype,x.a),X.a=f},function(re,X,D){"use strict";function W(A,s,x){typeof s=="object"&&(x=s,s=null);var c=this,u;if(!(A instanceof Function)){u=[];for(var f in A)A.hasOwnProperty(f)&&u.push(f)}var i=function(d){if(c.apply(this,arguments),A instanceof Function?y(this,A.call(this,d)):L(this,A,u),this.constructor===i)for(var m=i.__initializers__,_=0;_<m.length;_++)m[_].apply(this,arguments)};i.__super__=c,c.__initializers__?i.__initializers__=c.__initializers__.slice():i.__initializers__=[],s&&i.__initializers__.push(s);var o=function(){};return o.prototype=c.prototype,i.prototype=new o,i.prototype.constructor=i,y(i.prototype,x),i.extend=c.extend,i.derive=c.extend,i}function y(A,s){if(s)for(var x in s)s.hasOwnProperty(x)&&(A[x]=s[x])}function L(A,s,x){for(var c=0;c<x.length;c++){var u=x[c];A[u]=s[u]}}X.a={extend:W,derive:W}},function(re,X,D){"use strict";var W=["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear","OES_standard_derivatives","OES_vertex_array_object","OES_element_index_uint","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","EXT_texture_filter_anisotropic","EXT_shader_texture_lod","WEBGL_draw_buffers","EXT_frag_depth","EXT_sRGB"],y=["MAX_TEXTURE_SIZE","MAX_CUBE_MAP_TEXTURE_SIZE"];function L(A){for(var s={},x={},c=0;c<W.length;c++){var u=W[c];i(u)}for(var c=0;c<y.length;c++){var f=y[c];x[f]=A.getParameter(A[f])}this.getExtension=function(o){return o in s||i(o),s[o]},this.getParameter=function(o){return x[o]};function i(o){var d=A.getExtension(o);d||(d=A.getExtension("MOZ_"+o)),d||(d=A.getExtension("WEBKIT_"+o)),s[o]=d}}X.a=L},function(re,X,D){"use strict";var W=D(94),y={},L={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function A(a){return a=Math.round(a),a<0?0:a>255?255:a}function s(a){return a=Math.round(a),a<0?0:a>360?360:a}function x(a){return a<0?0:a>1?1:a}function c(a){return a.length&&a.charAt(a.length-1)==="%"?A(parseFloat(a)/100*255):A(parseInt(a,10))}function u(a){return a.length&&a.charAt(a.length-1)==="%"?x(parseFloat(a)/100):x(parseFloat(a))}function f(a,p,E){return E<0?E+=1:E>1&&(E-=1),E*6<1?a+(p-a)*E*6:E*2<1?p:E*3<2?a+(p-a)*(2/3-E)*6:a}function i(a,p,E){return a+(p-a)*E}function o(a,p,E,S,w){return a[0]=p,a[1]=E,a[2]=S,a[3]=w,a}function d(a,p){return a[0]=p[0],a[1]=p[1],a[2]=p[2],a[3]=p[3],a}var m=new W.a(20),_=null;function h(a,p){_&&d(_,p),_=m.put(a,_||p.slice())}y.parse=function(a,p){if(a){p=p||[];var E=m.get(a);if(E)return d(p,E);a=a+"";var S=a.replace(/ /g,"").toLowerCase();if(S in L)return d(p,L[S]),h(a,p),p;if(S.charAt(0)==="#"){if(S.length===4){var w=parseInt(S.substr(1),16);if(!(w>=0&&w<=4095)){o(p,0,0,0,1);return}return o(p,(w&3840)>>4|(w&3840)>>8,w&240|(w&240)>>4,w&15|(w&15)<<4,1),h(a,p),p}else if(S.length===7){var w=parseInt(S.substr(1),16);if(!(w>=0&&w<=16777215)){o(p,0,0,0,1);return}return o(p,(w&16711680)>>16,(w&65280)>>8,w&255,1),h(a,p),p}return}var R=S.indexOf("("),O=S.indexOf(")");if(R!==-1&&O+1===S.length){var z=S.substr(0,R),N=S.substr(R+1,O-(R+1)).split(","),P=1;switch(z){case"rgba":if(N.length!==4){o(p,0,0,0,1);return}P=u(N.pop());case"rgb":if(N.length!==3){o(p,0,0,0,1);return}return o(p,c(N[0]),c(N[1]),c(N[2]),P),h(a,p),p;case"hsla":if(N.length!==4){o(p,0,0,0,1);return}return N[3]=u(N[3]),v(N,p),h(a,p),p;case"hsl":if(N.length!==3){o(p,0,0,0,1);return}return v(N,p),h(a,p),p;default:return}}o(p,0,0,0,1)}},y.parseToFloat=function(a,p){if(p=y.parse(a,p),!!p)return p[0]/=255,p[1]/=255,p[2]/=255,p};function v(a,p){var E=(parseFloat(a[0])%360+360)%360/360,S=u(a[1]),w=u(a[2]),R=w<=.5?w*(S+1):w+S-w*S,O=w*2-R;return p=p||[],o(p,A(f(O,R,E+1/3)*255),A(f(O,R,E)*255),A(f(O,R,E-1/3)*255),1),a.length===4&&(p[3]=a[3]),p}function r(a){if(a){var p=a[0]/255,E=a[1]/255,S=a[2]/255,w=Math.min(p,E,S),R=Math.max(p,E,S),O=R-w,z=(R+w)/2,N,P;if(O===0)N=0,P=0;else{z<.5?P=O/(R+w):P=O/(2-R-w);var F=((R-p)/6+O/2)/O,K=((R-E)/6+O/2)/O,B=((R-S)/6+O/2)/O;p===R?N=B-K:E===R?N=1/3+F-B:S===R&&(N=2/3+K-F),N<0&&(N+=1),N>1&&(N-=1)}var V=[N*360,P,z];return a[3]!=null&&V.push(a[3]),V}}y.lift=function(a,p){var E=y.parse(a);if(E){for(var S=0;S<3;S++)p<0?E[S]=E[S]*(1-p)|0:E[S]=(255-E[S])*p+E[S]|0;return y.stringify(E,E.length===4?"rgba":"rgb")}},y.toHex=function(a){var p=y.parse(a);if(p)return((1<<24)+(p[0]<<16)+(p[1]<<8)+ +p[2]).toString(16).slice(1)},y.fastLerp=function(a,p,E){if(!(!(p&&p.length)||!(a>=0&&a<=1))){E=E||[];var S=a*(p.length-1),w=Math.floor(S),R=Math.ceil(S),O=p[w],z=p[R],N=S-w;return E[0]=A(i(O[0],z[0],N)),E[1]=A(i(O[1],z[1],N)),E[2]=A(i(O[2],z[2],N)),E[3]=x(i(O[3],z[3],N)),E}},y.fastMapToColor=y.fastLerp,y.lerp=function(a,p,E){if(!(!(p&&p.length)||!(a>=0&&a<=1))){var S=a*(p.length-1),w=Math.floor(S),R=Math.ceil(S),O=y.parse(p[w]),z=y.parse(p[R]),N=S-w,P=y.stringify([A(i(O[0],z[0],N)),A(i(O[1],z[1],N)),A(i(O[2],z[2],N)),x(i(O[3],z[3],N))],"rgba");return E?{color:P,leftIndex:w,rightIndex:R,value:S}:P}},y.mapToColor=y.lerp,y.modifyHSL=function(a,p,E,S){if(a=y.parse(a),a)return a=r(a),p!=null&&(a[0]=s(p)),E!=null&&(a[1]=u(E)),S!=null&&(a[2]=u(S)),y.stringify(v(a),"rgba")},y.modifyAlpha=function(a,p){if(a=y.parse(a),a&&p!=null)return a[3]=x(p),y.stringify(a,"rgba")},y.stringify=function(a,p){if(!(!a||!a.length)){var E=a[0]+","+a[1]+","+a[2];return(p==="rgba"||p==="hsva"||p==="hsla")&&(E+=","+a[3]),p+"("+E+")"}},X.a=y},function(re,X,D){"use strict";var W=D(95),y=function(L){this._list=new W.a,this._map={},this._maxSize=L||10};y.prototype.setMaxSize=function(L){this._maxSize=L},y.prototype.put=function(L,A){if(typeof this._map[L]=="undefined"){var s=this._list.length();if(s>=this._maxSize&&s>0){var x=this._list.head;this._list.remove(x),delete this._map[x.key]}var c=this._list.insert(A);c.key=L,this._map[L]=c}},y.prototype.get=function(L){var A=this._map[L];if(typeof A!="undefined")return A!==this._list.tail&&(this._list.remove(A),this._list.insertEntry(A)),A.value},y.prototype.remove=function(L){var A=this._map[L];typeof A!="undefined"&&(delete this._map[L],this._list.remove(A))},y.prototype.clear=function(){this._list.clear(),this._map={}},X.a=y},function(re,X,D){"use strict";var W=function(){this.head=null,this.tail=null,this._length=0};W.prototype.insert=function(y){var L=new W.Entry(y);return this.insertEntry(L),L},W.prototype.insertAt=function(y,L){if(!(y<0)){for(var A=this.head,s=0;A&&s!=y;)A=A.next,s++;if(A){var x=new W.Entry(L),c=A.prev;c?(c.next=x,x.prev=c):this.head=x,x.next=A,A.prev=x}else this.insert(L)}},W.prototype.insertBeforeEntry=function(y,L){var A=new W.Entry(y),s=L.prev;s?(s.next=A,A.prev=s):this.head=A,A.next=L,L.prev=A,this._length++},W.prototype.insertEntry=function(y){this.head?(this.tail.next=y,y.prev=this.tail,this.tail=y):this.head=this.tail=y,this._length++},W.prototype.remove=function(y){var L=y.prev,A=y.next;L?L.next=A:this.head=A,A?A.prev=L:this.tail=L,y.next=y.prev=null,this._length--},W.prototype.removeAt=function(y){if(!(y<0)){for(var L=this.head,A=0;L&&A!=y;)L=L.next,A++;if(L)return this.remove(L),L.value}},W.prototype.getHead=function(){if(this.head)return this.head.value},W.prototype.getTail=function(){if(this.tail)return this.tail.value},W.prototype.getAt=function(y){if(!(y<0)){for(var L=this.head,A=0;L&&A!=y;)L=L.next,A++;return L.value}},W.prototype.indexOf=function(y){for(var L=this.head,A=0;L;){if(L.value===y)return A;L=L.next,A++}},W.prototype.length=function(){return this._length},W.prototype.isEmpty=function(){return this._length===0},W.prototype.forEach=function(y,L){for(var A=this.head,s=0,x=typeof L!="undefined";A;)x?y.call(L,A.value,s):y(A.value,s),A=A.next,s++},W.prototype.clear=function(){this.tail=this.head=null,this._length=0},W.Entry=function(y){this.value=y,this.next=null,this.prev=null},X.a=W},function(re,X,D){"use strict";var W=D(97),y=/for\s*?\(int\s*?_idx_\s*\=\s*([\w-]+)\;\s*_idx_\s*<\s*([\w-]+);\s*_idx_\s*\+\+\s*\)\s*\{\{([\s\S]+?)(?=\}\})\}\}/g;function L(u,f,i){function o(_,h,v,r){var a="";isNaN(h)&&(h in f?h=f[h]:h=d[h]),isNaN(v)&&(v in f?v=f[v]:v=d[v]);for(var p=parseInt(h);p<parseInt(v);p++)a+="{"+r.replace(/float\s*\(\s*_idx_\s*\)/g,p.toFixed(1)).replace(/_idx_/g,p)+"}";return a}var d={};for(var m in i)d[m+"_COUNT"]=i[m];return u.replace(y,o)}function A(u,f,i){var o=[];if(f)for(var d in f){var m=f[d];m>0&&o.push("#define "+d.toUpperCase()+"_COUNT "+m)}if(i)for(var _=0;_<i.length;_++){var h=i[_];o.push("#define "+h.toUpperCase()+"_ENABLED")}for(var h in u){var v=u[h];v===null?o.push("#define "+h):o.push("#define "+h+" "+v.toString())}return o.join(`
|
|
`)}function s(u){for(var f=[],i=0;i<u.length;i++)f.push("#extension GL_"+u[i]+" : enable");return f.join(`
|
|
`)}function x(u){return["precision",u,"float"].join(" ")+`;
|
|
`+["precision",u,"int"].join(" ")+`;
|
|
`+["precision",u,"sampler2D"].join(" ")+`;
|
|
`}function c(u){this._renderer=u,this._cache={}}c.prototype.getProgram=function(u,f,i){var o=this._cache,d="s"+f.shader.shaderID+"m"+f.programKey;i&&(d+="se"+i.getProgramKey(u.lightGroup)),u.isSkinnedMesh()&&(d+=","+u.joints.length);var O=o[d];if(O)return O;var m=i?i.getLightsNumbers(u.lightGroup):{},_=this._renderer,h=_.gl,v=f.getEnabledTextures(),r="";u.isSkinnedMesh()&&(r=`
|
|
`+A({SKINNING:null,JOINT_COUNT:u.joints.length})+`
|
|
`);var a=r+A(f.vertexDefines,m,v),p=r+A(f.fragmentDefines,m,v),E=a+`
|
|
`+f.shader.vertex,S=s(["OES_standard_derivatives","EXT_shader_texture_lod"])+`
|
|
`+x(f.precision)+`
|
|
`+p+`
|
|
`+f.shader.fragment,w=L(E,f.vertexDefines,m),R=L(S,f.fragmentDefines,m),O=new W.a;O.uniformSemantics=f.shader.uniformSemantics,O.attributes=f.shader.attributes;var z=O.buildProgram(h,f.shader,w,R);return O.__error=z,o[d]=O,O},X.a=c},function(re,X,D){"use strict";var W=D(18),y=D(8),L=1,A=2,s=3,x={};function c(i){for(var o=i.split(`
|
|
`),d=0,m=o.length;d<m;d++)o[d]=d+1+": "+o[d];return o.join(`
|
|
`)}function u(i,o,d){if(!i.getShaderParameter(o,i.COMPILE_STATUS))return[i.getShaderInfoLog(o),c(d)].join(`
|
|
`)}var f=y.a.extend({uniformSemantics:{},attributes:{}},function(){this._locations={},this._textureSlot=0,this._program=null},{bind:function(i){this._textureSlot=0,i.gl.useProgram(this._program)},hasUniform:function(i){var o=this._locations[i];return o!=null},useTextureSlot:function(i,o,d){o&&(i.gl.activeTexture(i.gl.TEXTURE0+d),o.isRenderable()?o.bind(i):o.unbind(i))},currentTextureSlot:function(){return this._textureSlot},resetTextureSlot:function(i){this._textureSlot=i||0},takeCurrentTextureSlot:function(i,o){var d=this._textureSlot;return this.useTextureSlot(i,o,d),this._textureSlot++,d},setUniform:function(i,o,d,m){var _=this._locations,h=_[d];if(h==null)return!1;switch(o){case"m4":i.uniformMatrix4fv(h,!1,m);break;case"2i":i.uniform2i(h,m[0],m[1]);break;case"2f":i.uniform2f(h,m[0],m[1]);break;case"3i":i.uniform3i(h,m[0],m[1],m[2]);break;case"3f":i.uniform3f(h,m[0],m[1],m[2]);break;case"4i":i.uniform4i(h,m[0],m[1],m[2],m[3]);break;case"4f":i.uniform4f(h,m[0],m[1],m[2],m[3]);break;case"1i":i.uniform1i(h,m);break;case"1f":i.uniform1f(h,m);break;case"1fv":i.uniform1fv(h,m);break;case"1iv":i.uniform1iv(h,m);break;case"2iv":i.uniform2iv(h,m);break;case"2fv":i.uniform2fv(h,m);break;case"3iv":i.uniform3iv(h,m);break;case"3fv":i.uniform3fv(h,m);break;case"4iv":i.uniform4iv(h,m);break;case"4fv":i.uniform4fv(h,m);break;case"m2":case"m2v":i.uniformMatrix2fv(h,!1,m);break;case"m3":case"m3v":i.uniformMatrix3fv(h,!1,m);break;case"m4v":if(Array.isArray(m)){for(var v=new W.a.Float32Array(m.length*16),r=0,a=0;a<m.length;a++)for(var p=m[a],E=0;E<16;E++)v[r++]=p[E];i.uniformMatrix4fv(h,!1,v)}else m instanceof W.a.Float32Array&&i.uniformMatrix4fv(h,!1,m);break}return!0},setUniformOfSemantic:function(i,o,d){var m=this.uniformSemantics[o];return m?this.setUniform(i,m.type,m.symbol,d):!1},enableAttributes:function(i,o,d){var m=i.gl,_=this._program,h=this._locations,v;d?v=d.__enabledAttributeList:v=x[i.__uid__],v||(d?v=d.__enabledAttributeList=[]:v=x[i.__uid__]=[]);for(var r=[],a=0;a<o.length;a++){var p=o[a];if(!this.attributes[p]){r[a]=-1;continue}var E=h[p];if(E==null){if(E=m.getAttribLocation(_,p),E===-1){r[a]=-1;continue}h[p]=E}r[a]=E,v[E]?v[E]=A:v[E]=L}for(var a=0;a<v.length;a++)switch(v[a]){case L:m.enableVertexAttribArray(a),v[a]=s;break;case A:v[a]=s;break;case s:m.disableVertexAttribArray(a),v[a]=0;break}return r},buildProgram:function(i,o,d,m){var _=i.createShader(i.VERTEX_SHADER),h=i.createProgram();i.shaderSource(_,d),i.compileShader(_);var v=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(v,m),i.compileShader(v);var r=u(i,_,d);if(r||(r=u(i,v,m),r))return r;if(i.attachShader(h,_),i.attachShader(h,v),o.attributeSemantics.POSITION)i.bindAttribLocation(h,0,o.attributeSemantics.POSITION.symbol);else{var a=Object.keys(this.attributes);i.bindAttribLocation(h,0,a[0])}if(i.linkProgram(h),!i.getProgramParameter(h,i.LINK_STATUS))return`Could not link program
|
|
VALIDATE_STATUS: `+i.getProgramParameter(h,i.VALIDATE_STATUS)+", gl error ["+i.getError()+"]";for(var p=0;p<o.uniforms.length;p++){var E=o.uniforms[p];this._locations[E]=i.getUniformLocation(h,E)}i.deleteShader(_),i.deleteShader(v),this._program=h,this.vertexCode=d,this.fragmentCode=m}});X.a=f},function(re,X,D){"use strict";var W=D(99),y="uniform vec3 ",L="uniform float ",A="@export clay.header.",s="@end",x=":unconfigurable;";X.a=[A+"directional_light",y+"directionalLightDirection[DIRECTIONAL_LIGHT_COUNT]"+x,y+"directionalLightColor[DIRECTIONAL_LIGHT_COUNT]"+x,s,A+"ambient_light",y+"ambientLightColor[AMBIENT_LIGHT_COUNT]"+x,s,A+"ambient_sh_light",y+"ambientSHLightColor[AMBIENT_SH_LIGHT_COUNT]"+x,y+"ambientSHLightCoefficients[AMBIENT_SH_LIGHT_COUNT * 9]"+x,W.a,s,A+"ambient_cubemap_light",y+"ambientCubemapLightColor[AMBIENT_CUBEMAP_LIGHT_COUNT]"+x,"uniform samplerCube ambientCubemapLightCubemap[AMBIENT_CUBEMAP_LIGHT_COUNT]"+x,"uniform sampler2D ambientCubemapLightBRDFLookup[AMBIENT_CUBEMAP_LIGHT_COUNT]"+x,s,A+"point_light",y+"pointLightPosition[POINT_LIGHT_COUNT]"+x,L+"pointLightRange[POINT_LIGHT_COUNT]"+x,y+"pointLightColor[POINT_LIGHT_COUNT]"+x,s,A+"spot_light",y+"spotLightPosition[SPOT_LIGHT_COUNT]"+x,y+"spotLightDirection[SPOT_LIGHT_COUNT]"+x,L+"spotLightRange[SPOT_LIGHT_COUNT]"+x,L+"spotLightUmbraAngleCosine[SPOT_LIGHT_COUNT]"+x,L+"spotLightPenumbraAngleCosine[SPOT_LIGHT_COUNT]"+x,L+"spotLightFalloffFactor[SPOT_LIGHT_COUNT]"+x,y+"spotLightColor[SPOT_LIGHT_COUNT]"+x,s].join(`
|
|
`)},function(re,X,D){"use strict";X.a=`vec3 calcAmbientSHLight(int idx, vec3 N) {
|
|
int offset = 9 * idx;
|
|
return ambientSHLightCoefficients[0]
|
|
+ ambientSHLightCoefficients[1] * N.x
|
|
+ ambientSHLightCoefficients[2] * N.y
|
|
+ ambientSHLightCoefficients[3] * N.z
|
|
+ ambientSHLightCoefficients[4] * N.x * N.z
|
|
+ ambientSHLightCoefficients[5] * N.z * N.y
|
|
+ ambientSHLightCoefficients[6] * N.y * N.x
|
|
+ ambientSHLightCoefficients[7] * (3.0 * N.z * N.z - 1.0)
|
|
+ ambientSHLightCoefficients[8] * (N.x * N.x - N.y * N.y);
|
|
}`},function(re,X,D){"use strict";var W=D(8),y=D(49),L=D(23),A=D(4),s=D(9),x=D(64),c=D(11),u=D(1),f=D.n(u),i=f.a.vec3,o=W.a.extend({scene:null,camera:null,renderer:null},function(){this._ray=new y.a,this._ndc=new L.a},{pick:function(d,m,_){var h=this.pickAll(d,m,[],_);return h[0]||null},pickAll:function(d,m,_,h){return this.renderer.screenToNDC(d,m,this._ndc),this.camera.castRay(this._ndc,this._ray),_=_||[],this._intersectNode(this.scene,_,h||!1),_.sort(this._intersectionCompareFunc),_},_intersectNode:function(d,m,_){d instanceof x.a&&d.isRenderable()&&(!d.ignorePicking||_)&&(d.mode===c.a.TRIANGLES&&d.geometry.isUseIndices()||d.geometry.pickByRay||d.geometry.pick)&&this._intersectRenderable(d,m);for(var h=0;h<d._children.length;h++)this._intersectNode(d._children[h],m,_)},_intersectRenderable:function(){var d=new A.a,m=new A.a,_=new A.a,h=new y.a,v=new s.a;return function(r,a){var p=r.isSkinnedMesh();h.copy(this._ray),s.a.invert(v,r.worldTransform),p||h.applyTransform(v);var E=r.geometry;if(!(!p&&E.boundingBox&&!h.intersectBoundingBox(E.boundingBox))){if(E.pick){E.pick(this._ndc.x,this._ndc.y,this.renderer,this.camera,r,a);return}else if(E.pickByRay){E.pickByRay(h,r,a);return}var S=r.cullFace===c.a.BACK&&r.frontFace===c.a.CCW||r.cullFace===c.a.FRONT&&r.frontFace===c.a.CW,w,R=E.indices,O=E.attributes.position,z=E.attributes.weight,N=E.attributes.joint,P,F=[];if(!(!O||!O.value||!R)){if(p){P=r.skeleton.getSubSkinMatrices(r.__uid__,r.joints);for(var K=0;K<r.joints.length;K++){F[K]=F[K]||[];for(var B=0;B<16;B++)F[K][B]=P[K*16+B]}var V=[],C=[],M=[],H=[],$=[],q=E.attributes.skinnedPosition;(!q||!q.value)&&(E.createAttribute("skinnedPosition","f",3),q=E.attributes.skinnedPosition,q.init(E.vertexCount));for(var K=0;K<E.vertexCount;K++){O.get(K,V),z.get(K,C),N.get(K,M),C[3]=1-C[0]-C[1]-C[2],i.set(H,0,0,0);for(var B=0;B<4;B++)M[B]>=0&&C[B]>1e-4&&(i.transformMat4($,V,F[M[B]]),i.scaleAndAdd(H,H,$,C[B]));q.set(K,H)}}for(var K=0;K<R.length;K+=3){var se=R[K],ue=R[K+1],pe=R[K+2],xe=p?E.attributes.skinnedPosition:O;if(xe.get(se,d.array),xe.get(ue,m.array),xe.get(pe,_.array),S?w=h.intersectTriangle(d,m,_,r.culling):w=h.intersectTriangle(d,_,m,r.culling),w){var De=new A.a;p?A.a.copy(De,w):A.a.transformMat4(De,w,r.worldTransform),a.push(new o.Intersection(w,De,r,[se,ue,pe],K/3,A.a.dist(De,this._ray.origin)))}}}}}}(),_intersectionCompareFunc:function(d,m){return d.distance-m.distance}});o.Intersection=function(d,m,_,h,v,r){this.point=d,this.pointWorld=m,this.target=_,this.triangle=h,this.triangleIndex=v,this.distance=r},X.a=o},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=["bar3D","line3D","map3D","scatter3D","surface","lines3D","scatterGL","scatter3D"];function A(c,u){if(c&&c[u]&&(c[u].normal||c[u].emphasis)){var f=c[u].normal,i=c[u].emphasis;f&&(c[u]=f),i&&(c.emphasis=c.emphasis||{},c.emphasis[u]=i)}}function s(c){A(c,"itemStyle"),A(c,"lineStyle"),A(c,"areaStyle"),A(c,"label")}function x(c){c&&(c instanceof Array||(c=[c]),y.a.util.each(c,function(u){if(u.axisLabel){var f=u.axisLabel;y.a.util.extend(f,f.textStyle),f.textStyle=null}}))}X.a=function(c){y.a.util.each(c.series,function(u){y.a.util.indexOf(L,u.type)>=0&&(s(u),u.coordinateSystem==="mapbox"&&(u.coordinateSystem="mapbox3D",c.mapbox3D=c.mapbox))}),x(c.xAxis3D),x(c.yAxis3D),x(c.zAxis3D),x(c.grid3D),A(c.geo3D)}},function(re,X,D){"use strict";function W(y){var L=new XMLHttpRequest;L.open("get",y.url),L.responseType=y.responseType||"text",y.onprogress&&(L.onprogress=function(A){if(A.lengthComputable){var s=A.loaded/A.total;y.onprogress(s,A.loaded,A.total)}else y.onprogress(null)}),L.onload=function(A){L.status>=400?y.onerror&&y.onerror():y.onload&&y.onload(L.response)},y.onerror&&(L.onerror=y.onerror),L.send(null)}X.a={get:W}},function(re,X,D){"use strict";X.a=`@export clay.basic.vertex
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
uniform vec2 uvRepeat : [1.0, 1.0];
|
|
uniform vec2 uvOffset : [0.0, 0.0];
|
|
attribute vec2 texcoord : TEXCOORD_0;
|
|
attribute vec3 position : POSITION;
|
|
attribute vec3 barycentric;
|
|
@import clay.chunk.skinning_header
|
|
varying vec2 v_Texcoord;
|
|
varying vec3 v_Barycentric;
|
|
#ifdef VERTEX_COLOR
|
|
attribute vec4 a_Color : COLOR;
|
|
varying vec4 v_Color;
|
|
#endif
|
|
void main()
|
|
{
|
|
vec3 skinnedPosition = position;
|
|
#ifdef SKINNING
|
|
@import clay.chunk.skin_matrix
|
|
skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;
|
|
#endif
|
|
v_Texcoord = texcoord * uvRepeat + uvOffset;
|
|
v_Barycentric = barycentric;
|
|
gl_Position = worldViewProjection * vec4(skinnedPosition, 1.0);
|
|
#ifdef VERTEX_COLOR
|
|
v_Color = a_Color;
|
|
#endif
|
|
}
|
|
@end
|
|
@export clay.basic.fragment
|
|
varying vec2 v_Texcoord;
|
|
uniform sampler2D diffuseMap;
|
|
uniform vec3 color : [1.0, 1.0, 1.0];
|
|
uniform vec3 emission : [0.0, 0.0, 0.0];
|
|
uniform float alpha : 1.0;
|
|
#ifdef ALPHA_TEST
|
|
uniform float alphaCutoff: 0.9;
|
|
#endif
|
|
#ifdef VERTEX_COLOR
|
|
varying vec4 v_Color;
|
|
#endif
|
|
uniform float lineWidth : 0.0;
|
|
uniform vec4 lineColor : [0.0, 0.0, 0.0, 0.6];
|
|
varying vec3 v_Barycentric;
|
|
@import clay.util.edge_factor
|
|
@import clay.util.rgbm
|
|
@import clay.util.srgb
|
|
@import clay.util.ACES
|
|
void main()
|
|
{
|
|
#ifdef RENDER_TEXCOORD
|
|
gl_FragColor = vec4(v_Texcoord, 1.0, 1.0);
|
|
return;
|
|
#endif
|
|
gl_FragColor = vec4(color, alpha);
|
|
#ifdef VERTEX_COLOR
|
|
gl_FragColor *= v_Color;
|
|
#endif
|
|
#ifdef DIFFUSEMAP_ENABLED
|
|
vec4 tex = decodeHDR(texture2D(diffuseMap, v_Texcoord));
|
|
#ifdef SRGB_DECODE
|
|
tex = sRGBToLinear(tex);
|
|
#endif
|
|
#if defined(DIFFUSEMAP_ALPHA_ALPHA)
|
|
gl_FragColor.a = tex.a;
|
|
#endif
|
|
gl_FragColor.rgb *= tex.rgb;
|
|
#endif
|
|
gl_FragColor.rgb += emission;
|
|
if( lineWidth > 0.)
|
|
{
|
|
gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor(lineWidth)) * lineColor.a);
|
|
}
|
|
#ifdef ALPHA_TEST
|
|
if (gl_FragColor.a < alphaCutoff) {
|
|
discard;
|
|
}
|
|
#endif
|
|
#ifdef TONEMAPPING
|
|
gl_FragColor.rgb = ACESToneMapping(gl_FragColor.rgb);
|
|
#endif
|
|
#ifdef SRGB_ENCODE
|
|
gl_FragColor = linearTosRGB(gl_FragColor);
|
|
#endif
|
|
gl_FragColor = encodeHDR(gl_FragColor);
|
|
}
|
|
@end`},function(re,X,D){"use strict";var W=D(6),y=D(5),L=D(25),A=542327876,s=1,x=2,c=4,u=8,f=4096,i=131072,o=524288,d=8388608,m=8,_=4194304,h=4096,v=512,r=1024,a=2048,p=4096,E=8192,S=16384,w=32768,R=2097152,O=1,z=2,N=4,P=64,F=512,K=131072;function B(Re){return Re.charCodeAt(0)+(Re.charCodeAt(1)<<8)+(Re.charCodeAt(2)<<16)+(Re.charCodeAt(3)<<24)}function V(Re){return String.fromCharCode(Re&255,Re>>8&255,Re>>16&255,Re>>24&255)}var C=31,M=B("DXT1"),H=B("DXT3"),$=B("DXT5"),q=0,se=1,ue=2,pe=3,xe=4,De=7,Ue=20,Ge=21,Ae=27,We=28,we=29,Se=30,ge={parse:function(Re,ve){var Le=new Int32Array(Re,0,C);if(Le[q]!==A||!Le(Ue)&N)return null;var Fe=Le(Ge),me=Le[xe],oe=Le[pe],ie=Le[We]&v,fe=Le[ue]&i,ye,he;switch(Fe){case M:ye=8,he=W.a.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case H:ye=16,he=W.a.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case $:ye=16,he=W.a.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var Te=Le[se]+4,Oe=ie?6:1,Be=1;fe&&(Be=Math.max(1,Le[De]));for(var Ze=[],tt=0;tt<Oe;tt++){var dt=me,nt=oe;Ze[tt]=new y.a({width:dt,height:nt,format:he});for(var At=[],Nt=0;Nt<Be;Nt++){var Bt=Math.max(4,dt)/4*Math.max(4,nt)/4*ye,st=new Uint8Array(Re,Te,Bt);Te+=Bt,dt*=.5,nt*=.5,At[Nt]=st}Ze[tt].pixels=At[0],fe&&(Ze[tt].mipmaps=At)}if(ve)ve.width=Ze[0].width,ve.height=Ze[0].height,ve.format=Ze[0].format,ve.pixels=Ze[0].pixels,ve.mipmaps=Ze[0].mipmaps;else return Ze[0]}};X.a=ge},function(re,X,D){"use strict";var W=D(6),y=D(5),L=String.fromCharCode,A=8,s=32767;function x(d,m,_,h){if(d[3]>0){var v=Math.pow(2,d[3]-128-8+h);m[_+0]=d[0]*v,m[_+1]=d[1]*v,m[_+2]=d[2]*v}else m[_+0]=0,m[_+1]=0,m[_+2]=0;return m[_+3]=1,m}function c(d,m,_){for(var h="",v=m;v<_;v++)h+=L(d[v]);return h}function u(d,m){m[0]=d[0],m[1]=d[1],m[2]=d[2],m[3]=d[3]}function f(d,m,_,h){for(var v=0,r=0,a=h;a>0;)if(d[r][0]=m[_++],d[r][1]=m[_++],d[r][2]=m[_++],d[r][3]=m[_++],d[r][0]===1&&d[r][1]===1&&d[r][2]===1){for(var p=d[r][3]<<v>>>0;p>0;p--)u(d[r-1],d[r]),r++,a--;v+=8}else r++,a--,v=0;return _}function i(d,m,_,h){if(h<A|h>s)return f(d,m,_,h);var v=m[_++];if(v!=2)return f(d,m,_-1,h);if(d[0][1]=m[_++],d[0][2]=m[_++],v=m[_++],(d[0][2]<<8>>>0|v)>>>0!==h)return null;for(var v=0;v<4;v++)for(var r=0;r<h;){var a=m[_++];if(a>128){a=(a&127)>>>0;for(var p=m[_++];a--;)d[r++][v]=p}else for(;a--;)d[r++][v]=m[_++]}return _}var o={parseRGBE:function(d,m,_){_==null&&(_=0);var h=new Uint8Array(d),v=h.length;if(c(h,0,2)==="#?"){for(var r=2;r<v&&!(L(h[r])===`
|
|
`&&L(h[r+1])===`
|
|
`);r++);if(!(r>=v)){r+=2;for(var a="";r<v;r++){var p=L(h[r]);if(p===`
|
|
`)break;a+=p}var E=a.split(" "),S=parseInt(E[1]),w=parseInt(E[3]);if(!(!w||!S)){for(var R=r+1,O=[],z=0;z<w;z++){O[z]=[];for(var N=0;N<4;N++)O[z][N]=0}for(var P=new Float32Array(w*S*4),F=0,K=0;K<S;K++){var R=i(O,h,R,w);if(!R)return null;for(var z=0;z<w;z++)x(O[z],P,F,_),F+=4}return m||(m=new y.a),m.width=w,m.height=S,m.pixels=P,m.type=W.a.FLOAT,m}}}},parseRGBEFromPNG:function(d){}};X.a=o},function(re,X,D){"use strict";var W=D(5),y=D(4),L=D(23),A=["mousedown","mouseup","mousemove","mouseover","mouseout","click","dblclick","contextmenu"];function s(c){return"_on"+c}var x=function(c){var u=this;this._texture=new W.a({anisotropic:32,flipY:!1,surface:this,dispose:function(f){u.dispose(),W.a.prototype.dispose.call(this,f)}}),A.forEach(function(f){this[s(f)]=function(i){i.triangle&&this._meshes.forEach(function(o){this.dispatchEvent(f,o,i.triangle,i.point)},this)}},this),this._meshes=[],c&&this.setECharts(c),this.onupdate=null};x.prototype={constructor:x,getTexture:function(){return this._texture},setECharts:function(c){this._chart=c;var u=c.getDom();if(!(u instanceof HTMLCanvasElement))console.error("ECharts must init on canvas if it is used as texture."),u=document.createElement("canvas");else{var f=this,i=c.getZr(),o=i.__oldRefreshImmediately||i.refreshImmediately;i.refreshImmediately=function(){o.call(this),f._texture.dirty(),f.onupdate&&f.onupdate()},i.__oldRefreshImmediately=o}this._texture.image=u,this._texture.dirty(),this.onupdate&&this.onupdate()},dispatchEvent:function(){var c=new y.a,u=new y.a,f=new y.a,i=new L.a,o=new L.a,d=new L.a,m=new L.a,_=new y.a;return function(h,v,r,a){var p=v.geometry,E=p.attributes.position,S=p.attributes.texcoord0,w=y.a.dot,R=y.a.cross;E.get(r[0],c.array),E.get(r[1],u.array),E.get(r[2],f.array),S.get(r[0],i.array),S.get(r[1],o.array),S.get(r[2],d.array),R(_,u,f);var O=w(c,_),z=w(a,_)/O;R(_,f,c);var N=w(a,_)/O;R(_,c,u);var P=w(a,_)/O;L.a.scale(m,i,z),L.a.scaleAndAdd(m,m,o,N),L.a.scaleAndAdd(m,m,d,P);var F=m.x*this._chart.getWidth(),K=m.y*this._chart.getHeight();this._chart.getZr().handler.dispatch(h,{zrX:F,zrY:K})}}(),attachToMesh:function(c){this._meshes.indexOf(c)>=0||(A.forEach(function(u){c.on(u,this[s(u)],this)},this),this._meshes.push(c))},detachFromMesh:function(c){var u=this._meshes.indexOf(c);u>=0&&this._meshes.splice(u,1),A.forEach(function(f){c.off(f,this[s(f)])},this)},dispose:function(){this._meshes.forEach(function(c){this.detachFromMesh(c)},this)}},X.a=x},function(re,X,D){"use strict";var W=D(19),y=D(108),L=W.a.extend({cubemap:null,castShadow:!1,_normalDistribution:null,_brdfLookup:null},{type:"AMBIENT_CUBEMAP_LIGHT",prefilter:function(A,s){this._brdfLookup||(this._normalDistribution=y.a.generateNormalDistribution(),this._brdfLookup=y.a.integrateBRDF(A,this._normalDistribution));var x=this.cubemap;if(!x.__prefiltered){var c=y.a.prefilterEnvironmentMap(A,x,{encodeRGBM:!0,width:s,height:s},this._normalDistribution,this._brdfLookup);this.cubemap=c.environmentMap,this.cubemap.__prefiltered=!0,x.dispose(A)}},uniformTemplates:{ambientCubemapLightColor:{type:"3f",value:function(A){var s=A.color,x=A.intensity;return[s[0]*x,s[1]*x,s[2]*x]}},ambientCubemapLightCubemap:{type:"t",value:function(A){return A.cubemap}},ambientCubemapLightBRDFLookup:{type:"t",value:function(A){return A._brdfLookup}}}});X.a=L},function(re,X,D){"use strict";var W=D(5),y=D(25),L=D(6),A=D(10),s=D(14),x=D(17),c=D(7),u=D(57),f=D(29),i=D(55),o=D(18),d=D(54),m=D(111),_=D(112),h={},v=["px","nx","py","ny","pz","nz"];h.prefilterEnvironmentMap=function(r,a,p,E,S){(!S||!E)&&(E=h.generateNormalDistribution(),S=h.integrateBRDF(r,E)),p=p||{};var w=p.width||64,R=p.height||64,O=p.type||a.type,z=new y.a({width:w,height:R,type:O,flipY:!1,mipmaps:[]});z.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var N=Math.min(w,R),P=Math.log(N)/Math.log(2)+1,F=new x.a({shader:new c.a({vertex:c.a.source("clay.skybox.vertex"),fragment:_.a})});F.set("normalDistribution",E),p.encodeRGBM&&F.define("fragment","RGBM_ENCODE"),p.decodeRGBM&&F.define("fragment","RGBM_DECODE");var K=new f.a,B;if(a instanceof W.a){var V=new y.a({width:w,height:R,type:O===L.a.FLOAT?L.a.HALF_FLOAT:O});d.a.panoramaToCubeMap(r,a,V,{encodeRGBM:p.decodeRGBM}),a=V}B=new u.a({scene:K,material:F}),B.material.set("environmentMap",a);var C=new i.a({texture:z});p.encodeRGBM&&(O=z.type=L.a.UNSIGNED_BYTE);for(var M=new W.a({width:w,height:R,type:O}),H=new A.a({depthBuffer:!1}),$=o.a[O===L.a.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],q=0;q<P;q++){z.mipmaps[q]={pixels:{}},B.material.set("roughness",q/(v.length-1));for(var se=M.width,ue=2*Math.atan(se/(se-.5))/Math.PI*180,pe=0;pe<v.length;pe++){var xe=new $(M.width*M.height*4);H.attach(M),H.bind(r);var De=C.getCamera(v[pe]);De.fov=ue,r.render(K,De),r.gl.readPixels(0,0,M.width,M.height,L.a.RGBA,O,xe),H.unbind(r),z.mipmaps[q].pixels[v[pe]]=xe}M.width/=2,M.height/=2,M.dirty()}return H.dispose(r),M.dispose(r),B.dispose(r),E.dispose(r),{environmentMap:z,brdfLookup:S,normalDistribution:E,maxMipmapLevel:P}},h.integrateBRDF=function(r,a){a=a||h.generateNormalDistribution();var p=new A.a({depthBuffer:!1}),E=new s.a({fragment:m.a}),S=new W.a({width:512,height:256,type:L.a.HALF_FLOAT,minFilter:L.a.NEAREST,magFilter:L.a.NEAREST,useMipmap:!1});return E.setUniform("normalDistribution",a),E.setUniform("viewportSize",[512,256]),E.attachOutput(S),E.render(r,p),p.dispose(r),S},h.generateNormalDistribution=function(p,E){for(var p=p||256,E=E||1024,S=new W.a({width:p,height:E,type:L.a.FLOAT,minFilter:L.a.NEAREST,magFilter:L.a.NEAREST,useMipmap:!1}),w=new Float32Array(E*p*4),R=0;R<E;R++){var O=R/E,z=(R<<16|R>>>16)>>>0;z=((z&1431655765)<<1|(z&2863311530)>>>1)>>>0,z=((z&858993459)<<2|(z&3435973836)>>>2)>>>0,z=((z&252645135)<<4|(z&4042322160)>>>4)>>>0,z=(((z&16711935)<<8|(z&4278255360)>>>8)>>>0)/4294967296;for(var N=0;N<p;N++){var P=N/p,F=P*P,K=2*Math.PI*O,B=Math.sqrt((1-z)/(1+(F*F-1)*z)),V=Math.sqrt(1-B*B),C=(R*p+N)*4;w[C]=V*Math.cos(K),w[C+1]=V*Math.sin(K),w[C+2]=B,w[C+3]=1}}return S.pixels=w,S},X.a=h},function(re,X,D){"use strict";X.a=`
|
|
@export clay.compositor.vertex
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
attribute vec3 position : POSITION;
|
|
attribute vec2 texcoord : TEXCOORD_0;
|
|
varying vec2 v_Texcoord;
|
|
void main()
|
|
{
|
|
v_Texcoord = texcoord;
|
|
gl_Position = worldViewProjection * vec4(position, 1.0);
|
|
}
|
|
@end`},function(re,X,D){"use strict";X.a=`@export clay.skybox.vertex
|
|
uniform mat4 world : WORLD;
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
attribute vec3 position : POSITION;
|
|
varying vec3 v_WorldPosition;
|
|
void main()
|
|
{
|
|
v_WorldPosition = (world * vec4(position, 1.0)).xyz;
|
|
gl_Position = worldViewProjection * vec4(position, 1.0);
|
|
}
|
|
@end
|
|
@export clay.skybox.fragment
|
|
uniform mat4 viewInverse : VIEWINVERSE;
|
|
uniform samplerCube environmentMap;
|
|
uniform float lod: 0.0;
|
|
varying vec3 v_WorldPosition;
|
|
@import clay.util.rgbm
|
|
@import clay.util.srgb
|
|
@import clay.util.ACES
|
|
void main()
|
|
{
|
|
vec3 eyePos = viewInverse[3].xyz;
|
|
vec3 viewDirection = normalize(v_WorldPosition - eyePos);
|
|
#ifdef LOD
|
|
vec4 texel = decodeHDR(textureCubeLodEXT(environmentMap, viewDirection, lod));
|
|
#else
|
|
vec4 texel = decodeHDR(textureCube(environmentMap, viewDirection));
|
|
#endif
|
|
#ifdef SRGB_DECODE
|
|
texel = sRGBToLinear(texel);
|
|
#endif
|
|
#ifdef TONEMAPPING
|
|
texel.rgb = ACESToneMapping(texel.rgb);
|
|
#endif
|
|
#ifdef SRGB_ENCODE
|
|
texel = linearTosRGB(texel);
|
|
#endif
|
|
gl_FragColor = encodeHDR(vec4(texel.rgb, 1.0));
|
|
}
|
|
@end`},function(re,X,D){"use strict";X.a=`#define SAMPLE_NUMBER 1024
|
|
#define PI 3.14159265358979
|
|
uniform sampler2D normalDistribution;
|
|
uniform vec2 viewportSize : [512, 256];
|
|
const vec3 N = vec3(0.0, 0.0, 1.0);
|
|
const float fSampleNumber = float(SAMPLE_NUMBER);
|
|
vec3 importanceSampleNormal(float i, float roughness, vec3 N) {
|
|
vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;
|
|
vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
|
|
vec3 tangentX = normalize(cross(upVector, N));
|
|
vec3 tangentY = cross(N, tangentX);
|
|
return tangentX * H.x + tangentY * H.y + N * H.z;
|
|
}
|
|
float G_Smith(float roughness, float NoV, float NoL) {
|
|
float k = roughness * roughness / 2.0;
|
|
float G1V = NoV / (NoV * (1.0 - k) + k);
|
|
float G1L = NoL / (NoL * (1.0 - k) + k);
|
|
return G1L * G1V;
|
|
}
|
|
void main() {
|
|
vec2 uv = gl_FragCoord.xy / viewportSize;
|
|
float NoV = uv.x;
|
|
float roughness = uv.y;
|
|
vec3 V;
|
|
V.x = sqrt(1.0 - NoV * NoV);
|
|
V.y = 0.0;
|
|
V.z = NoV;
|
|
float A = 0.0;
|
|
float B = 0.0;
|
|
for (int i = 0; i < SAMPLE_NUMBER; i++) {
|
|
vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);
|
|
vec3 L = reflect(-V, H);
|
|
float NoL = clamp(L.z, 0.0, 1.0);
|
|
float NoH = clamp(H.z, 0.0, 1.0);
|
|
float VoH = clamp(dot(V, H), 0.0, 1.0);
|
|
if (NoL > 0.0) {
|
|
float G = G_Smith(roughness, NoV, NoL);
|
|
float G_Vis = G * VoH / (NoH * NoV);
|
|
float Fc = pow(1.0 - VoH, 5.0);
|
|
A += (1.0 - Fc) * G_Vis;
|
|
B += Fc * G_Vis;
|
|
}
|
|
}
|
|
gl_FragColor = vec4(vec2(A, B) / fSampleNumber, 0.0, 1.0);
|
|
}
|
|
`},function(re,X,D){"use strict";X.a=`#define SAMPLE_NUMBER 1024
|
|
#define PI 3.14159265358979
|
|
uniform mat4 viewInverse : VIEWINVERSE;
|
|
uniform samplerCube environmentMap;
|
|
uniform sampler2D normalDistribution;
|
|
uniform float roughness : 0.5;
|
|
varying vec2 v_Texcoord;
|
|
varying vec3 v_WorldPosition;
|
|
const float fSampleNumber = float(SAMPLE_NUMBER);
|
|
@import clay.util.rgbm
|
|
vec3 importanceSampleNormal(float i, float roughness, vec3 N) {
|
|
vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;
|
|
vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
|
|
vec3 tangentX = normalize(cross(upVector, N));
|
|
vec3 tangentY = cross(N, tangentX);
|
|
return tangentX * H.x + tangentY * H.y + N * H.z;
|
|
}
|
|
void main() {
|
|
vec3 eyePos = viewInverse[3].xyz;
|
|
vec3 V = normalize(v_WorldPosition - eyePos);
|
|
vec3 N = V;
|
|
vec3 R = V;
|
|
vec3 prefilteredColor = vec3(0.0);
|
|
float totalWeight = 0.0;
|
|
for (int i = 0; i < SAMPLE_NUMBER; i++) {
|
|
vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);
|
|
vec3 L = reflect(-V, H);
|
|
float NoL = clamp(dot(N, L), 0.0, 1.0);
|
|
if (NoL > 0.0) {
|
|
prefilteredColor += decodeHDR(textureCube(environmentMap, L)).rgb * NoL;
|
|
totalWeight += NoL;
|
|
}
|
|
}
|
|
gl_FragColor = encodeHDR(vec4(prefilteredColor / totalWeight, 1.0));
|
|
}
|
|
`},function(re,X,D){"use strict";var W=D(19),y=D(18),L=W.a.extend({castShadow:!1,coefficients:[]},function(){this._coefficientsTmpArr=new y.a.Float32Array(9*3)},{type:"AMBIENT_SH_LIGHT",uniformTemplates:{ambientSHLightColor:{type:"3f",value:function(A){var s=A.color,x=A.intensity;return[s[0]*x,s[1]*x,s[2]*x]}},ambientSHLightCoefficients:{type:"3f",value:function(A){for(var s=A._coefficientsTmpArr,x=0;x<A.coefficients.length;x++)s[x]=A.coefficients[x];return s}}}});X.a=L},function(re,X,D){"use strict";var W=D(6),y=D(10),L=D(5),A=D(14),s=D(18),x=D(57),c=D(56),u=D(55),f=D(29),i=D(1),o=D.n(i),d=D(115),m=o.a.vec3,_={},h=["px","nx","py","ny","pz","nz"];function v(E,S){var w=new L.a({width:9,height:1,type:W.a.FLOAT}),R=new A.a({fragment:d.a});R.material.define("fragment","TEXTURE_SIZE",S.width),R.setUniform("environmentMap",S);var O=new y.a;O.attach(w),R.render(E,O),O.bind(E);var z=new s.a.Float32Array(9*4);E.gl.readPixels(0,0,9,1,W.a.RGBA,W.a.FLOAT,z);for(var N=new s.a.Float32Array(9*3),P=0;P<9;P++)N[P*3]=z[P*4],N[P*3+1]=z[P*4+1],N[P*3+2]=z[P*4+2];return O.unbind(E),O.dispose(E),R.dispose(E),N}function r(E,S){var w=E[0],R=E[1],O=E[2];return S===0?1:S===1?w:S===2?R:S===3?O:S===4?w*O:S===5?R*O:S===6?w*R:S===7?3*O*O-1:w*w-R*R}var a={px:[2,1,0,-1,-1,1],nx:[2,1,0,1,-1,-1],py:[0,2,1,1,-1,-1],ny:[0,2,1,1,1,1],pz:[0,1,2,-1,-1,-1],nz:[0,1,2,1,-1,1]};function p(E,S,w,R){for(var O=new s.a.Float32Array(27),z=m.create(),N=m.create(),P=m.create(),F=0;F<9;F++){for(var K=m.create(),B=0;B<h.length;B++){for(var V=S[h[B]],C=m.create(),M=0,H=0,$=a[h[B]],q=0;q<R;q++)for(var se=0;se<w;se++){z[0]=se/(w-1)*2-1,z[1]=q/(R-1)*2-1,z[2]=-1,m.normalize(z,z),P[0]=z[$[0]]*$[3],P[1]=z[$[1]]*$[4],P[2]=z[$[2]]*$[5],N[0]=V[H++]/255,N[1]=V[H++]/255,N[2]=V[H++]/255;var ue=V[H++]/255*51.5;N[0]*=ue,N[1]*=ue,N[2]*=ue,m.scaleAndAdd(C,C,N,r(P,F)*-z[2]),M+=-z[2]}m.scaleAndAdd(K,K,C,1/M)}O[F*3]=K[0]/6,O[F*3+1]=K[1]/6,O[F*3+2]=K[2]/6}return O}_.projectEnvironmentMap=function(E,S,w){w=w||{},w.lod=w.lod||0;var R,O=new f.a,z=64;S instanceof L.a?R=new c.a({scene:O,environmentMap:S}):(z=S.image&&S.image.px?S.image.px.width:S.width,R=new x.a({scene:O,environmentMap:S}));var N=Math.ceil(z/Math.pow(2,w.lod)),P=Math.ceil(z/Math.pow(2,w.lod)),F=new L.a({width:N,height:P}),K=new y.a;R.material.define("fragment","RGBM_ENCODE"),w.decodeRGBM&&R.material.define("fragment","RGBM_DECODE"),R.material.set("lod",w.lod);for(var B=new u.a({texture:F}),V={},C=0;C<h.length;C++){V[h[C]]=new Uint8Array(N*P*4);var M=B.getCamera(h[C]);M.fov=90,K.attach(F),K.bind(E),E.render(O,M),E.gl.readPixels(0,0,N,P,W.a.RGBA,W.a.UNSIGNED_BYTE,V[h[C]]),K.unbind(E)}return R.dispose(E),K.dispose(E),F.dispose(E),p(E,V,N,P)},X.a=_},function(re,X,D){"use strict";X.a=`uniform samplerCube environmentMap;
|
|
varying vec2 v_Texcoord;
|
|
#define TEXTURE_SIZE 16
|
|
mat3 front = mat3(
|
|
1.0, 0.0, 0.0,
|
|
0.0, 1.0, 0.0,
|
|
0.0, 0.0, 1.0
|
|
);
|
|
mat3 back = mat3(
|
|
-1.0, 0.0, 0.0,
|
|
0.0, 1.0, 0.0,
|
|
0.0, 0.0, -1.0
|
|
);
|
|
mat3 left = mat3(
|
|
0.0, 0.0, -1.0,
|
|
0.0, 1.0, 0.0,
|
|
1.0, 0.0, 0.0
|
|
);
|
|
mat3 right = mat3(
|
|
0.0, 0.0, 1.0,
|
|
0.0, 1.0, 0.0,
|
|
-1.0, 0.0, 0.0
|
|
);
|
|
mat3 up = mat3(
|
|
1.0, 0.0, 0.0,
|
|
0.0, 0.0, 1.0,
|
|
0.0, -1.0, 0.0
|
|
);
|
|
mat3 down = mat3(
|
|
1.0, 0.0, 0.0,
|
|
0.0, 0.0, -1.0,
|
|
0.0, 1.0, 0.0
|
|
);
|
|
float harmonics(vec3 normal){
|
|
int index = int(gl_FragCoord.x);
|
|
float x = normal.x;
|
|
float y = normal.y;
|
|
float z = normal.z;
|
|
if(index==0){
|
|
return 1.0;
|
|
}
|
|
else if(index==1){
|
|
return x;
|
|
}
|
|
else if(index==2){
|
|
return y;
|
|
}
|
|
else if(index==3){
|
|
return z;
|
|
}
|
|
else if(index==4){
|
|
return x*z;
|
|
}
|
|
else if(index==5){
|
|
return y*z;
|
|
}
|
|
else if(index==6){
|
|
return x*y;
|
|
}
|
|
else if(index==7){
|
|
return 3.0*z*z - 1.0;
|
|
}
|
|
else{
|
|
return x*x - y*y;
|
|
}
|
|
}
|
|
vec3 sampleSide(mat3 rot)
|
|
{
|
|
vec3 result = vec3(0.0);
|
|
float divider = 0.0;
|
|
for (int i = 0; i < TEXTURE_SIZE * TEXTURE_SIZE; i++) {
|
|
float x = mod(float(i), float(TEXTURE_SIZE));
|
|
float y = float(i / TEXTURE_SIZE);
|
|
vec2 sidecoord = ((vec2(x, y) + vec2(0.5, 0.5)) / vec2(TEXTURE_SIZE)) * 2.0 - 1.0;
|
|
vec3 normal = normalize(vec3(sidecoord, -1.0));
|
|
vec3 fetchNormal = rot * normal;
|
|
vec3 texel = textureCube(environmentMap, fetchNormal).rgb;
|
|
result += harmonics(fetchNormal) * texel * -normal.z;
|
|
divider += -normal.z;
|
|
}
|
|
return result / divider;
|
|
}
|
|
void main()
|
|
{
|
|
vec3 result = (
|
|
sampleSide(front) +
|
|
sampleSide(back) +
|
|
sampleSide(left) +
|
|
sampleSide(right) +
|
|
sampleSide(up) +
|
|
sampleSide(down)
|
|
) / 6.0;
|
|
gl_FragColor = vec4(result, 1.0);
|
|
}`},function(re,X,D){"use strict";var W=D(19),y=W.a.extend({castShadow:!1},{type:"AMBIENT_LIGHT",uniformTemplates:{ambientLightColor:{type:"3f",value:function(L){var A=L.color,s=L.intensity;return[A[0]*s,A[1]*s,A[2]*s]}}}});X.a=y},function(re,X,D){"use strict";var W=D(1),y=D.n(W),L=y.a.vec4,A=function(c,u,f,i){c=c||0,u=u||0,f=f||0,i=i||0,this.array=L.fromValues(c,u,f,i),this._dirty=!0};A.prototype={constructor:A,add:function(c){return L.add(this.array,this.array,c.array),this._dirty=!0,this},set:function(c,u,f,i){return this.array[0]=c,this.array[1]=u,this.array[2]=f,this.array[3]=i,this._dirty=!0,this},setArray:function(c){return this.array[0]=c[0],this.array[1]=c[1],this.array[2]=c[2],this.array[3]=c[3],this._dirty=!0,this},clone:function(){return new A(this.x,this.y,this.z,this.w)},copy:function(c){return L.copy(this.array,c.array),this._dirty=!0,this},dist:function(c){return L.dist(this.array,c.array)},distance:function(c){return L.distance(this.array,c.array)},div:function(c){return L.div(this.array,this.array,c.array),this._dirty=!0,this},divide:function(c){return L.divide(this.array,this.array,c.array),this._dirty=!0,this},dot:function(c){return L.dot(this.array,c.array)},len:function(){return L.len(this.array)},length:function(){return L.length(this.array)},lerp:function(c,u,f){return L.lerp(this.array,c.array,u.array,f),this._dirty=!0,this},min:function(c){return L.min(this.array,this.array,c.array),this._dirty=!0,this},max:function(c){return L.max(this.array,this.array,c.array),this._dirty=!0,this},mul:function(c){return L.mul(this.array,this.array,c.array),this._dirty=!0,this},multiply:function(c){return L.multiply(this.array,this.array,c.array),this._dirty=!0,this},negate:function(){return L.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return L.normalize(this.array,this.array),this._dirty=!0,this},random:function(c){return L.random(this.array,c),this._dirty=!0,this},scale:function(c){return L.scale(this.array,this.array,c),this._dirty=!0,this},scaleAndAdd:function(c,u){return L.scaleAndAdd(this.array,this.array,c.array,u),this._dirty=!0,this},sqrDist:function(c){return L.sqrDist(this.array,c.array)},squaredDistance:function(c){return L.squaredDistance(this.array,c.array)},sqrLen:function(){return L.sqrLen(this.array)},squaredLength:function(){return L.squaredLength(this.array)},sub:function(c){return L.sub(this.array,this.array,c.array),this._dirty=!0,this},subtract:function(c){return L.subtract(this.array,this.array,c.array),this._dirty=!0,this},transformMat4:function(c){return L.transformMat4(this.array,this.array,c.array),this._dirty=!0,this},transformQuat:function(c){return L.transformQuat(this.array,this.array,c.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var s=Object.defineProperty;if(s){var x=A.prototype;s(x,"x",{get:function(){return this.array[0]},set:function(c){this.array[0]=c,this._dirty=!0}}),s(x,"y",{get:function(){return this.array[1]},set:function(c){this.array[1]=c,this._dirty=!0}}),s(x,"z",{get:function(){return this.array[2]},set:function(c){this.array[2]=c,this._dirty=!0}}),s(x,"w",{get:function(){return this.array[3]},set:function(c){this.array[3]=c,this._dirty=!0}})}A.add=function(c,u,f){return L.add(c.array,u.array,f.array),c._dirty=!0,c},A.set=function(c,u,f,i,o){L.set(c.array,u,f,i,o),c._dirty=!0},A.copy=function(c,u){return L.copy(c.array,u.array),c._dirty=!0,c},A.dist=function(c,u){return L.distance(c.array,u.array)},A.distance=A.dist,A.div=function(c,u,f){return L.divide(c.array,u.array,f.array),c._dirty=!0,c},A.divide=A.div,A.dot=function(c,u){return L.dot(c.array,u.array)},A.len=function(c){return L.length(c.array)},A.lerp=function(c,u,f,i){return L.lerp(c.array,u.array,f.array,i),c._dirty=!0,c},A.min=function(c,u,f){return L.min(c.array,u.array,f.array),c._dirty=!0,c},A.max=function(c,u,f){return L.max(c.array,u.array,f.array),c._dirty=!0,c},A.mul=function(c,u,f){return L.multiply(c.array,u.array,f.array),c._dirty=!0,c},A.multiply=A.mul,A.negate=function(c,u){return L.negate(c.array,u.array),c._dirty=!0,c},A.normalize=function(c,u){return L.normalize(c.array,u.array),c._dirty=!0,c},A.random=function(c,u){return L.random(c.array,u),c._dirty=!0,c},A.scale=function(c,u,f){return L.scale(c.array,u.array,f),c._dirty=!0,c},A.scaleAndAdd=function(c,u,f,i){return L.scaleAndAdd(c.array,u.array,f.array,i),c._dirty=!0,c},A.sqrDist=function(c,u){return L.sqrDist(c.array,u.array)},A.squaredDistance=A.sqrDist,A.sqrLen=function(c){return L.sqrLen(c.array)},A.squaredLength=A.sqrLen,A.sub=function(c,u,f){return L.subtract(c.array,u.array,f.array),c._dirty=!0,c},A.subtract=A.sub,A.transformMat4=function(c,u,f){return L.transformMat4(c.array,u.array,f.array),c._dirty=!0,c},A.transformQuat=function(c,u,f){return L.transformQuat(c.array,u.array,f.array),c._dirty=!0,c},X.a=A},function(re,X,D){"use strict";var W=D(1),y=D.n(W),L=y.a.mat2,A=function(){this.array=L.create(),this._dirty=!0};A.prototype={constructor:A,setArray:function(s){for(var x=0;x<this.array.length;x++)this.array[x]=s[x];return this._dirty=!0,this},clone:function(){return new A().copy(this)},copy:function(s){return L.copy(this.array,s.array),this._dirty=!0,this},adjoint:function(){return L.adjoint(this.array,this.array),this._dirty=!0,this},determinant:function(){return L.determinant(this.array)},identity:function(){return L.identity(this.array),this._dirty=!0,this},invert:function(){return L.invert(this.array,this.array),this._dirty=!0,this},mul:function(s){return L.mul(this.array,this.array,s.array),this._dirty=!0,this},mulLeft:function(s){return L.mul(this.array,s.array,this.array),this._dirty=!0,this},multiply:function(s){return L.multiply(this.array,this.array,s.array),this._dirty=!0,this},multiplyLeft:function(s){return L.multiply(this.array,s.array,this.array),this._dirty=!0,this},rotate:function(s){return L.rotate(this.array,this.array,s),this._dirty=!0,this},scale:function(s){return L.scale(this.array,this.array,s.array),this._dirty=!0,this},transpose:function(){return L.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},A.adjoint=function(s,x){return L.adjoint(s.array,x.array),s._dirty=!0,s},A.copy=function(s,x){return L.copy(s.array,x.array),s._dirty=!0,s},A.determinant=function(s){return L.determinant(s.array)},A.identity=function(s){return L.identity(s.array),s._dirty=!0,s},A.invert=function(s,x){return L.invert(s.array,x.array),s._dirty=!0,s},A.mul=function(s,x,c){return L.mul(s.array,x.array,c.array),s._dirty=!0,s},A.multiply=A.mul,A.rotate=function(s,x,c){return L.rotate(s.array,x.array,c),s._dirty=!0,s},A.scale=function(s,x,c){return L.scale(s.array,x.array,c.array),s._dirty=!0,s},A.transpose=function(s,x){return L.transpose(s.array,x.array),s._dirty=!0,s},X.a=A},function(re,X,D){"use strict";var W=D(1),y=D.n(W),L=y.a.mat2d,A=function(){this.array=L.create(),this._dirty=!0};A.prototype={constructor:A,setArray:function(s){for(var x=0;x<this.array.length;x++)this.array[x]=s[x];return this._dirty=!0,this},clone:function(){return new A().copy(this)},copy:function(s){return L.copy(this.array,s.array),this._dirty=!0,this},determinant:function(){return L.determinant(this.array)},identity:function(){return L.identity(this.array),this._dirty=!0,this},invert:function(){return L.invert(this.array,this.array),this._dirty=!0,this},mul:function(s){return L.mul(this.array,this.array,s.array),this._dirty=!0,this},mulLeft:function(s){return L.mul(this.array,s.array,this.array),this._dirty=!0,this},multiply:function(s){return L.multiply(this.array,this.array,s.array),this._dirty=!0,this},multiplyLeft:function(s){return L.multiply(this.array,s.array,this.array),this._dirty=!0,this},rotate:function(s){return L.rotate(this.array,this.array,s),this._dirty=!0,this},scale:function(s){return L.scale(this.array,this.array,s.array),this._dirty=!0,this},translate:function(s){return L.translate(this.array,this.array,s.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},A.copy=function(s,x){return L.copy(s.array,x.array),s._dirty=!0,s},A.determinant=function(s){return L.determinant(s.array)},A.identity=function(s){return L.identity(s.array),s._dirty=!0,s},A.invert=function(s,x){return L.invert(s.array,x.array),s._dirty=!0,s},A.mul=function(s,x,c){return L.mul(s.array,x.array,c.array),s._dirty=!0,s},A.multiply=A.mul,A.rotate=function(s,x,c){return L.rotate(s.array,x.array,c),s._dirty=!0,s},A.scale=function(s,x,c){return L.scale(s.array,x.array,c.array),s._dirty=!0,s},A.translate=function(s,x,c){return L.translate(s.array,x.array,c.array),s._dirty=!0,s},X.a=A},function(re,X,D){"use strict";var W=D(1),y=D.n(W),L=y.a.mat3,A=function(){this.array=L.create(),this._dirty=!0};A.prototype={constructor:A,setArray:function(s){for(var x=0;x<this.array.length;x++)this.array[x]=s[x];return this._dirty=!0,this},adjoint:function(){return L.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return new A().copy(this)},copy:function(s){return L.copy(this.array,s.array),this._dirty=!0,this},determinant:function(){return L.determinant(this.array)},fromMat2d:function(s){return L.fromMat2d(this.array,s.array),this._dirty=!0,this},fromMat4:function(s){return L.fromMat4(this.array,s.array),this._dirty=!0,this},fromQuat:function(s){return L.fromQuat(this.array,s.array),this._dirty=!0,this},identity:function(){return L.identity(this.array),this._dirty=!0,this},invert:function(){return L.invert(this.array,this.array),this._dirty=!0,this},mul:function(s){return L.mul(this.array,this.array,s.array),this._dirty=!0,this},mulLeft:function(s){return L.mul(this.array,s.array,this.array),this._dirty=!0,this},multiply:function(s){return L.multiply(this.array,this.array,s.array),this._dirty=!0,this},multiplyLeft:function(s){return L.multiply(this.array,s.array,this.array),this._dirty=!0,this},rotate:function(s){return L.rotate(this.array,this.array,s),this._dirty=!0,this},scale:function(s){return L.scale(this.array,this.array,s.array),this._dirty=!0,this},translate:function(s){return L.translate(this.array,this.array,s.array),this._dirty=!0,this},normalFromMat4:function(s){return L.normalFromMat4(this.array,s.array),this._dirty=!0,this},transpose:function(){return L.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},A.adjoint=function(s,x){return L.adjoint(s.array,x.array),s._dirty=!0,s},A.copy=function(s,x){return L.copy(s.array,x.array),s._dirty=!0,s},A.determinant=function(s){return L.determinant(s.array)},A.identity=function(s){return L.identity(s.array),s._dirty=!0,s},A.invert=function(s,x){return L.invert(s.array,x.array),s},A.mul=function(s,x,c){return L.mul(s.array,x.array,c.array),s._dirty=!0,s},A.multiply=A.mul,A.fromMat2d=function(s,x){return L.fromMat2d(s.array,x.array),s._dirty=!0,s},A.fromMat4=function(s,x){return L.fromMat4(s.array,x.array),s._dirty=!0,s},A.fromQuat=function(s,x){return L.fromQuat(s.array,x.array),s._dirty=!0,s},A.normalFromMat4=function(s,x){return L.normalFromMat4(s.array,x.array),s._dirty=!0,s},A.rotate=function(s,x,c){return L.rotate(s.array,x.array,c),s._dirty=!0,s},A.scale=function(s,x,c){return L.scale(s.array,x.array,c.array),s._dirty=!0,s},A.transpose=function(s,x){return L.transpose(s.array,x.array),s._dirty=!0,s},A.translate=function(s,x,c){return L.translate(s.array,x.array,c.array),s._dirty=!0,s},X.a=A},function(re,X,D){"use strict";var W=D(122),y=D.n(W),L={_animators:null,getAnimators:function(){return this._animators=this._animators||[],this._animators},animate:function(A,s){this._animators=this._animators||[];var x=this,c;if(A){for(var u=A.split("."),f=x,i=0,o=u.length;i<o;i++)f&&(f=f[u[i]]);f&&(c=f)}else c=x;if(c==null)throw new Error("Target "+A+" not exists");var d=this._animators,m=new y.a(c,s),_=this;return m.during(function(){_.__zr&&_.__zr.refresh()}).done(function(){var h=d.indexOf(m);h>=0&&d.splice(h,1)}),d.push(m),this.__zr&&this.__zr.animation.addAnimator(m),m},stopAnimation:function(A){this._animators=this._animators||[];for(var s=this._animators,x=s.length,c=0;c<x;c++)s[c].stop(A);return s.length=0,this},addAnimatorsToZr:function(A){if(this._animators)for(var s=0;s<this._animators.length;s++)A.animation.addAnimator(this._animators[s])},removeAnimatorsFromZr:function(A){if(this._animators)for(var s=0;s<this._animators.length;s++)A.animation.removeAnimator(this._animators[s])}};X.a=L},function(re,X,D){var W=D(123),y=D(125),L=D(12),A=L.isArrayLike,s=Array.prototype.slice;function x(S,w){return S[w]}function c(S,w,R){S[w]=R}function u(S,w,R){return(w-S)*R+S}function f(S,w,R){return R>.5?w:S}function i(S,w,R,O,z){var N=S.length;if(z==1)for(var P=0;P<N;P++)O[P]=u(S[P],w[P],R);else for(var F=N&&S[0].length,P=0;P<N;P++)for(var K=0;K<F;K++)O[P][K]=u(S[P][K],w[P][K],R)}function o(S,w,R){var O=S.length,z=w.length;if(O!==z){var N=O>z;if(N)S.length=z;else for(var P=O;P<z;P++)S.push(R===1?w[P]:s.call(w[P]))}for(var F=S[0]&&S[0].length,P=0;P<S.length;P++)if(R===1)isNaN(S[P])&&(S[P]=w[P]);else for(var K=0;K<F;K++)isNaN(S[P][K])&&(S[P][K]=w[P][K])}function d(S,w,R){if(S===w)return!0;var O=S.length;if(O!==w.length)return!1;if(R===1){for(var z=0;z<O;z++)if(S[z]!==w[z])return!1}else for(var N=S[0].length,z=0;z<O;z++)for(var P=0;P<N;P++)if(S[z][P]!==w[z][P])return!1;return!0}function m(S,w,R,O,z,N,P,F,K){var B=S.length;if(K==1)for(var V=0;V<B;V++)F[V]=_(S[V],w[V],R[V],O[V],z,N,P);else for(var C=S[0].length,V=0;V<B;V++)for(var M=0;M<C;M++)F[V][M]=_(S[V][M],w[V][M],R[V][M],O[V][M],z,N,P)}function _(S,w,R,O,z,N,P){var F=(R-S)*.5,K=(O-w)*.5;return(2*(w-R)+F+K)*P+(-3*(w-R)-2*F-K)*N+F*z+w}function h(S){if(A(S)){var w=S.length;if(A(S[0])){for(var R=[],O=0;O<w;O++)R.push(s.call(S[O]));return R}return s.call(S)}return S}function v(S){return S[0]=Math.floor(S[0]),S[1]=Math.floor(S[1]),S[2]=Math.floor(S[2]),"rgba("+S.join(",")+")"}function r(S){var w=S[S.length-1].value;return A(w&&w[0])?2:1}function a(S,w,R,O,z,N){var P=S._getter,F=S._setter,K=w==="spline",B=O.length;if(B){var V=O[0].value,C=A(V),M=!1,H=!1,$=C?r(O):0,q;O.sort(function(fe,ye){return fe.time-ye.time}),q=O[B-1].time;for(var se=[],ue=[],pe=O[0].value,xe=!0,De=0;De<B;De++){se.push(O[De].time/q);var Ue=O[De].value;if(C&&d(Ue,pe,$)||!C&&Ue===pe||(xe=!1),pe=Ue,typeof Ue=="string"){var Ge=y.parse(Ue);Ge?(Ue=Ge,M=!0):H=!0}ue.push(Ue)}if(!(!N&&xe)){for(var Ae=ue[B-1],De=0;De<B-1;De++)C?o(ue[De],Ae,$):isNaN(ue[De])&&!isNaN(Ae)&&!H&&!M&&(ue[De]=Ae);C&&o(P(S._target,z),Ae,$);var We=0,we=0,Se,ge,Re,ve,Le,Fe;if(M)var me=[0,0,0,0];var oe=function(fe,ye){var he;if(ye<0)he=0;else if(ye<we){for(Se=Math.min(We+1,B-1),he=Se;he>=0&&!(se[he]<=ye);he--);he=Math.min(he,B-2)}else{for(he=We;he<B&&!(se[he]>ye);he++);he=Math.min(he-1,B-2)}We=he,we=ye;var Te=se[he+1]-se[he];if(Te!==0)if(ge=(ye-se[he])/Te,K)if(ve=ue[he],Re=ue[he===0?he:he-1],Le=ue[he>B-2?B-1:he+1],Fe=ue[he>B-3?B-1:he+2],C)m(Re,ve,Le,Fe,ge,ge*ge,ge*ge*ge,P(fe,z),$);else{var Oe;if(M)Oe=m(Re,ve,Le,Fe,ge,ge*ge,ge*ge*ge,me,1),Oe=v(me);else{if(H)return f(ve,Le,ge);Oe=_(Re,ve,Le,Fe,ge,ge*ge,ge*ge*ge)}F(fe,z,Oe)}else if(C)i(ue[he],ue[he+1],ge,P(fe,z),$);else{var Oe;if(M)i(ue[he],ue[he+1],ge,me,1),Oe=v(me);else{if(H)return f(ue[he],ue[he+1],ge);Oe=u(ue[he],ue[he+1],ge)}F(fe,z,Oe)}},ie=new W({target:S._target,life:q,loop:S._loop,delay:S._delay,onframe:oe,ondestroy:R});return w&&w!=="spline"&&(ie.easing=w),ie}}}var p=function(S,w,R,O){this._tracks={},this._target=S,this._loop=w||!1,this._getter=R||x,this._setter=O||c,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};p.prototype={when:function(S,w){var R=this._tracks;for(var O in w)if(w.hasOwnProperty(O)){if(!R[O]){R[O]=[];var z=this._getter(this._target,O);if(z==null)continue;S!==0&&R[O].push({time:0,value:h(z)})}R[O].push({time:S,value:w[O]})}return this},during:function(S){return this._onframeList.push(S),this},pause:function(){for(var S=0;S<this._clipList.length;S++)this._clipList[S].pause();this._paused=!0},resume:function(){for(var S=0;S<this._clipList.length;S++)this._clipList[S].resume();this._paused=!1},isPaused:function(){return!!this._paused},_doneCallback:function(){this._tracks={},this._clipList.length=0;for(var S=this._doneList,w=S.length,R=0;R<w;R++)S[R].call(this)},start:function(S,w){var R=this,O=0,z=function(){O--,O||R._doneCallback()},N;for(var P in this._tracks)if(this._tracks.hasOwnProperty(P)){var F=a(this,S,z,this._tracks[P],P,w);F&&(this._clipList.push(F),O++,this.animation&&this.animation.addClip(F),N=F)}if(N){var K=N.onframe;N.onframe=function(B,V){K(B,V);for(var C=0;C<R._onframeList.length;C++)R._onframeList[C](B,V)}}return O||this._doneCallback(),this},stop:function(S){for(var w=this._clipList,R=this.animation,O=0;O<w.length;O++){var z=w[O];S&&z.onframe(this._target,1),R&&R.removeClip(z)}w.length=0},delay:function(S){return this._delay=S,this},done:function(S){return S&&this._doneList.push(S),this},getClips:function(){return this._clipList}};var E=p;re.exports=E},function(re,X,D){var W=D(124);function y(A){this._target=A.target,this._life=A.life||1e3,this._delay=A.delay||0,this._initialized=!1,this.loop=A.loop==null?!1:A.loop,this.gap=A.gap||0,this.easing=A.easing||"Linear",this.onframe=A.onframe,this.ondestroy=A.ondestroy,this.onrestart=A.onrestart,this._pausedTime=0,this._paused=!1}y.prototype={constructor:y,step:function(A,s){if(this._initialized||(this._startTime=A+this._delay,this._initialized=!0),this._paused){this._pausedTime+=s;return}var x=(A-this._startTime-this._pausedTime)/this._life;if(!(x<0)){x=Math.min(x,1);var c=this.easing,u=typeof c=="string"?W[c]:c,f=typeof u=="function"?u(x):x;return this.fire("frame",f),x==1?this.loop?(this.restart(A),"restart"):(this._needsRemove=!0,"destroy"):null}},restart:function(A){var s=(A-this._startTime-this._pausedTime)%this._life;this._startTime=A-s+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(A,s){A="on"+A,this[A]&&this[A](this._target,s)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var L=y;re.exports=L},function(re,X){var D={linear:function(y){return y},quadraticIn:function(y){return y*y},quadraticOut:function(y){return y*(2-y)},quadraticInOut:function(y){return(y*=2)<1?.5*y*y:-.5*(--y*(y-2)-1)},cubicIn:function(y){return y*y*y},cubicOut:function(y){return--y*y*y+1},cubicInOut:function(y){return(y*=2)<1?.5*y*y*y:.5*((y-=2)*y*y+2)},quarticIn:function(y){return y*y*y*y},quarticOut:function(y){return 1- --y*y*y*y},quarticInOut:function(y){return(y*=2)<1?.5*y*y*y*y:-.5*((y-=2)*y*y*y-2)},quinticIn:function(y){return y*y*y*y*y},quinticOut:function(y){return--y*y*y*y*y+1},quinticInOut:function(y){return(y*=2)<1?.5*y*y*y*y*y:.5*((y-=2)*y*y*y*y+2)},sinusoidalIn:function(y){return 1-Math.cos(y*Math.PI/2)},sinusoidalOut:function(y){return Math.sin(y*Math.PI/2)},sinusoidalInOut:function(y){return .5*(1-Math.cos(Math.PI*y))},exponentialIn:function(y){return y===0?0:Math.pow(1024,y-1)},exponentialOut:function(y){return y===1?1:1-Math.pow(2,-10*y)},exponentialInOut:function(y){return y===0?0:y===1?1:(y*=2)<1?.5*Math.pow(1024,y-1):.5*(-Math.pow(2,-10*(y-1))+2)},circularIn:function(y){return 1-Math.sqrt(1-y*y)},circularOut:function(y){return Math.sqrt(1- --y*y)},circularInOut:function(y){return(y*=2)<1?-.5*(Math.sqrt(1-y*y)-1):.5*(Math.sqrt(1-(y-=2)*y)+1)},elasticIn:function(y){var L,A=.1,s=.4;return y===0?0:y===1?1:(!A||A<1?(A=1,L=s/4):L=s*Math.asin(1/A)/(2*Math.PI),-(A*Math.pow(2,10*(y-=1))*Math.sin((y-L)*(2*Math.PI)/s)))},elasticOut:function(y){var L,A=.1,s=.4;return y===0?0:y===1?1:(!A||A<1?(A=1,L=s/4):L=s*Math.asin(1/A)/(2*Math.PI),A*Math.pow(2,-10*y)*Math.sin((y-L)*(2*Math.PI)/s)+1)},elasticInOut:function(y){var L,A=.1,s=.4;return y===0?0:y===1?1:(!A||A<1?(A=1,L=s/4):L=s*Math.asin(1/A)/(2*Math.PI),(y*=2)<1?-.5*(A*Math.pow(2,10*(y-=1))*Math.sin((y-L)*(2*Math.PI)/s)):A*Math.pow(2,-10*(y-=1))*Math.sin((y-L)*(2*Math.PI)/s)*.5+1)},backIn:function(y){var L=1.70158;return y*y*((L+1)*y-L)},backOut:function(y){var L=1.70158;return--y*y*((L+1)*y+L)+1},backInOut:function(y){var L=2.5949095;return(y*=2)<1?.5*(y*y*((L+1)*y-L)):.5*((y-=2)*y*((L+1)*y+L)+2)},bounceIn:function(y){return 1-D.bounceOut(1-y)},bounceOut:function(y){return y<.36363636363636365?7.5625*y*y:y<.7272727272727273?7.5625*(y-=.5454545454545454)*y+.75:y<.9090909090909091?7.5625*(y-=.8181818181818182)*y+.9375:7.5625*(y-=.9545454545454546)*y+.984375},bounceInOut:function(y){return y<.5?D.bounceIn(y*2)*.5:D.bounceOut(y*2-1)*.5+.5}},W=D;re.exports=W},function(re,X,D){var W=D(53),y={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function L(P){return P=Math.round(P),P<0?0:P>255?255:P}function A(P){return P=Math.round(P),P<0?0:P>360?360:P}function s(P){return P<0?0:P>1?1:P}function x(P){return P.length&&P.charAt(P.length-1)==="%"?L(parseFloat(P)/100*255):L(parseInt(P,10))}function c(P){return P.length&&P.charAt(P.length-1)==="%"?s(parseFloat(P)/100):s(parseFloat(P))}function u(P,F,K){return K<0?K+=1:K>1&&(K-=1),K*6<1?P+(F-P)*K*6:K*2<1?F:K*3<2?P+(F-P)*(2/3-K)*6:P}function f(P,F,K){return P+(F-P)*K}function i(P,F,K,B,V){return P[0]=F,P[1]=K,P[2]=B,P[3]=V,P}function o(P,F){return P[0]=F[0],P[1]=F[1],P[2]=F[2],P[3]=F[3],P}var d=new W(20),m=null;function _(P,F){m&&o(m,F),m=d.put(P,m||F.slice())}function h(P,F){if(P){F=F||[];var K=d.get(P);if(K)return o(F,K);P=P+"";var B=P.replace(/ /g,"").toLowerCase();if(B in y)return o(F,y[B]),_(P,F),F;if(B.charAt(0)==="#"){if(B.length===4){var V=parseInt(B.substr(1),16);if(!(V>=0&&V<=4095)){i(F,0,0,0,1);return}return i(F,(V&3840)>>4|(V&3840)>>8,V&240|(V&240)>>4,V&15|(V&15)<<4,1),_(P,F),F}else if(B.length===7){var V=parseInt(B.substr(1),16);if(!(V>=0&&V<=16777215)){i(F,0,0,0,1);return}return i(F,(V&16711680)>>16,(V&65280)>>8,V&255,1),_(P,F),F}return}var C=B.indexOf("("),M=B.indexOf(")");if(C!==-1&&M+1===B.length){var H=B.substr(0,C),$=B.substr(C+1,M-(C+1)).split(","),q=1;switch(H){case"rgba":if($.length!==4){i(F,0,0,0,1);return}q=c($.pop());case"rgb":if($.length!==3){i(F,0,0,0,1);return}return i(F,x($[0]),x($[1]),x($[2]),q),_(P,F),F;case"hsla":if($.length!==4){i(F,0,0,0,1);return}return $[3]=c($[3]),v($,F),_(P,F),F;case"hsl":if($.length!==3){i(F,0,0,0,1);return}return v($,F),_(P,F),F;default:return}}i(F,0,0,0,1)}}function v(P,F){var K=(parseFloat(P[0])%360+360)%360/360,B=c(P[1]),V=c(P[2]),C=V<=.5?V*(B+1):V+B-V*B,M=V*2-C;return F=F||[],i(F,L(u(M,C,K+1/3)*255),L(u(M,C,K)*255),L(u(M,C,K-1/3)*255),1),P.length===4&&(F[3]=P[3]),F}function r(P){if(P){var F=P[0]/255,K=P[1]/255,B=P[2]/255,V=Math.min(F,K,B),C=Math.max(F,K,B),M=C-V,H=(C+V)/2,$,q;if(M===0)$=0,q=0;else{H<.5?q=M/(C+V):q=M/(2-C-V);var se=((C-F)/6+M/2)/M,ue=((C-K)/6+M/2)/M,pe=((C-B)/6+M/2)/M;F===C?$=pe-ue:K===C?$=1/3+se-pe:B===C&&($=2/3+ue-se),$<0&&($+=1),$>1&&($-=1)}var xe=[$*360,q,H];return P[3]!=null&&xe.push(P[3]),xe}}function a(P,F){var K=h(P);if(K){for(var B=0;B<3;B++)F<0?K[B]=K[B]*(1-F)|0:K[B]=(255-K[B])*F+K[B]|0;return N(K,K.length===4?"rgba":"rgb")}}function p(P){var F=h(P);if(F)return((1<<24)+(F[0]<<16)+(F[1]<<8)+ +F[2]).toString(16).slice(1)}function E(P,F,K){if(!(!(F&&F.length)||!(P>=0&&P<=1))){K=K||[];var B=P*(F.length-1),V=Math.floor(B),C=Math.ceil(B),M=F[V],H=F[C],$=B-V;return K[0]=L(f(M[0],H[0],$)),K[1]=L(f(M[1],H[1],$)),K[2]=L(f(M[2],H[2],$)),K[3]=s(f(M[3],H[3],$)),K}}var S=E;function w(P,F,K){if(!(!(F&&F.length)||!(P>=0&&P<=1))){var B=P*(F.length-1),V=Math.floor(B),C=Math.ceil(B),M=h(F[V]),H=h(F[C]),$=B-V,q=N([L(f(M[0],H[0],$)),L(f(M[1],H[1],$)),L(f(M[2],H[2],$)),s(f(M[3],H[3],$))],"rgba");return K?{color:q,leftIndex:V,rightIndex:C,value:B}:q}}var R=w;function O(P,F,K,B){if(P=h(P),P)return P=r(P),F!=null&&(P[0]=A(F)),K!=null&&(P[1]=c(K)),B!=null&&(P[2]=c(B)),N(v(P),"rgba")}function z(P,F){if(P=h(P),P&&F!=null)return P[3]=s(F),N(P,"rgba")}function N(P,F){if(!(!P||!P.length)){var K=P[0]+","+P[1]+","+P[2];return(F==="rgba"||F==="hsva"||F==="hsla")&&(K+=","+P[3]),F+"("+K+")"}}X.parse=h,X.lift=a,X.toHex=p,X.fastLerp=E,X.fastMapToColor=S,X.lerp=w,X.mapToColor=R,X.modifyHSL=O,X.modifyAlpha=z,X.stringify=N},function(re,X,D){"use strict";X.a=`
|
|
@export clay.util.rand
|
|
highp float rand(vec2 uv) {
|
|
const highp float a = 12.9898, b = 78.233, c = 43758.5453;
|
|
highp float dt = dot(uv.xy, vec2(a,b)), sn = mod(dt, 3.141592653589793);
|
|
return fract(sin(sn) * c);
|
|
}
|
|
@end
|
|
@export clay.util.calculate_attenuation
|
|
uniform float attenuationFactor : 5.0;
|
|
float lightAttenuation(float dist, float range)
|
|
{
|
|
float attenuation = 1.0;
|
|
attenuation = dist*dist/(range*range+1.0);
|
|
float att_s = attenuationFactor;
|
|
attenuation = 1.0/(attenuation*att_s+1.0);
|
|
att_s = 1.0/(att_s+1.0);
|
|
attenuation = attenuation - att_s;
|
|
attenuation /= 1.0 - att_s;
|
|
return clamp(attenuation, 0.0, 1.0);
|
|
}
|
|
@end
|
|
@export clay.util.edge_factor
|
|
float edgeFactor(float width)
|
|
{
|
|
vec3 d = fwidth(v_Barycentric);
|
|
vec3 a3 = smoothstep(vec3(0.0), d * width, v_Barycentric);
|
|
return min(min(a3.x, a3.y), a3.z);
|
|
}
|
|
@end
|
|
@export clay.util.encode_float
|
|
vec4 encodeFloat(const in float depth)
|
|
{
|
|
const vec4 bitShifts = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);
|
|
const vec4 bit_mask = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);
|
|
vec4 res = fract(depth * bitShifts);
|
|
res -= res.xxyz * bit_mask;
|
|
return res;
|
|
}
|
|
@end
|
|
@export clay.util.decode_float
|
|
float decodeFloat(const in vec4 color)
|
|
{
|
|
const vec4 bitShifts = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);
|
|
return dot(color, bitShifts);
|
|
}
|
|
@end
|
|
@export clay.util.float
|
|
@import clay.util.encode_float
|
|
@import clay.util.decode_float
|
|
@end
|
|
@export clay.util.rgbm_decode
|
|
vec3 RGBMDecode(vec4 rgbm, float range) {
|
|
return range * rgbm.rgb * rgbm.a;
|
|
}
|
|
@end
|
|
@export clay.util.rgbm_encode
|
|
vec4 RGBMEncode(vec3 color, float range) {
|
|
if (dot(color, color) == 0.0) {
|
|
return vec4(0.0);
|
|
}
|
|
vec4 rgbm;
|
|
color /= range;
|
|
rgbm.a = clamp(max(max(color.r, color.g), max(color.b, 1e-6)), 0.0, 1.0);
|
|
rgbm.a = ceil(rgbm.a * 255.0) / 255.0;
|
|
rgbm.rgb = color / rgbm.a;
|
|
return rgbm;
|
|
}
|
|
@end
|
|
@export clay.util.rgbm
|
|
@import clay.util.rgbm_decode
|
|
@import clay.util.rgbm_encode
|
|
vec4 decodeHDR(vec4 color)
|
|
{
|
|
#if defined(RGBM_DECODE) || defined(RGBM)
|
|
return vec4(RGBMDecode(color, 51.5), 1.0);
|
|
#else
|
|
return color;
|
|
#endif
|
|
}
|
|
vec4 encodeHDR(vec4 color)
|
|
{
|
|
#if defined(RGBM_ENCODE) || defined(RGBM)
|
|
return RGBMEncode(color.xyz, 51.5);
|
|
#else
|
|
return color;
|
|
#endif
|
|
}
|
|
@end
|
|
@export clay.util.srgb
|
|
vec4 sRGBToLinear(in vec4 value) {
|
|
return vec4(mix(pow(value.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), value.rgb * 0.0773993808, vec3(lessThanEqual(value.rgb, vec3(0.04045)))), value.w);
|
|
}
|
|
vec4 linearTosRGB(in vec4 value) {
|
|
return vec4(mix(pow(value.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), value.rgb * 12.92, vec3(lessThanEqual(value.rgb, vec3(0.0031308)))), value.w);
|
|
}
|
|
@end
|
|
@export clay.chunk.skinning_header
|
|
#ifdef SKINNING
|
|
attribute vec3 weight : WEIGHT;
|
|
attribute vec4 joint : JOINT;
|
|
uniform mat4 skinMatrix[JOINT_COUNT] : SKIN_MATRIX;
|
|
mat4 getSkinMatrix(float idx) {
|
|
return skinMatrix[int(idx)];
|
|
}
|
|
#endif
|
|
@end
|
|
@export clay.chunk.skin_matrix
|
|
mat4 skinMatrixWS = getSkinMatrix(joint.x) * weight.x;
|
|
if (weight.y > 1e-4)
|
|
{
|
|
skinMatrixWS += getSkinMatrix(joint.y) * weight.y;
|
|
}
|
|
if (weight.z > 1e-4)
|
|
{
|
|
skinMatrixWS += getSkinMatrix(joint.z) * weight.z;
|
|
}
|
|
float weightW = 1.0-weight.x-weight.y-weight.z;
|
|
if (weightW > 1e-4)
|
|
{
|
|
skinMatrixWS += getSkinMatrix(joint.w) * weightW;
|
|
}
|
|
@end
|
|
@export clay.util.parallax_correct
|
|
vec3 parallaxCorrect(in vec3 dir, in vec3 pos, in vec3 boxMin, in vec3 boxMax) {
|
|
vec3 first = (boxMax - pos) / dir;
|
|
vec3 second = (boxMin - pos) / dir;
|
|
vec3 further = max(first, second);
|
|
float dist = min(further.x, min(further.y, further.z));
|
|
vec3 fixedPos = pos + dir * dist;
|
|
vec3 boxCenter = (boxMax + boxMin) * 0.5;
|
|
return normalize(fixedPos - boxCenter);
|
|
}
|
|
@end
|
|
@export clay.util.clamp_sample
|
|
vec4 clampSample(const in sampler2D texture, const in vec2 coord)
|
|
{
|
|
#ifdef STEREO
|
|
float eye = step(0.5, coord.x) * 0.5;
|
|
vec2 coordClamped = clamp(coord, vec2(eye, 0.0), vec2(0.5 + eye, 1.0));
|
|
#else
|
|
vec2 coordClamped = clamp(coord, vec2(0.0), vec2(1.0));
|
|
#endif
|
|
return texture2D(texture, coordClamped);
|
|
}
|
|
@end
|
|
@export clay.util.ACES
|
|
vec3 ACESToneMapping(vec3 color)
|
|
{
|
|
const float A = 2.51;
|
|
const float B = 0.03;
|
|
const float C = 2.43;
|
|
const float D = 0.59;
|
|
const float E = 0.14;
|
|
return (color * (A * color + B)) / (color * (C * color + D) + E);
|
|
}
|
|
@end`},function(re,X,D){"use strict";X.a=`
|
|
@export ecgl.common.transformUniforms
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
uniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;
|
|
uniform mat4 world : WORLD;
|
|
@end
|
|
|
|
@export ecgl.common.attributes
|
|
attribute vec3 position : POSITION;
|
|
attribute vec2 texcoord : TEXCOORD_0;
|
|
attribute vec3 normal : NORMAL;
|
|
@end
|
|
|
|
@export ecgl.common.uv.header
|
|
uniform vec2 uvRepeat : [1.0, 1.0];
|
|
uniform vec2 uvOffset : [0.0, 0.0];
|
|
uniform vec2 detailUvRepeat : [1.0, 1.0];
|
|
uniform vec2 detailUvOffset : [0.0, 0.0];
|
|
|
|
varying vec2 v_Texcoord;
|
|
varying vec2 v_DetailTexcoord;
|
|
@end
|
|
|
|
@export ecgl.common.uv.main
|
|
v_Texcoord = texcoord * uvRepeat + uvOffset;
|
|
v_DetailTexcoord = texcoord * detailUvRepeat + detailUvOffset;
|
|
@end
|
|
|
|
@export ecgl.common.uv.fragmentHeader
|
|
varying vec2 v_Texcoord;
|
|
varying vec2 v_DetailTexcoord;
|
|
@end
|
|
|
|
|
|
@export ecgl.common.albedo.main
|
|
|
|
vec4 albedoTexel = vec4(1.0);
|
|
#ifdef DIFFUSEMAP_ENABLED
|
|
albedoTexel = texture2D(diffuseMap, v_Texcoord);
|
|
#ifdef SRGB_DECODE
|
|
albedoTexel = sRGBToLinear(albedoTexel);
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef DETAILMAP_ENABLED
|
|
vec4 detailTexel = texture2D(detailMap, v_DetailTexcoord);
|
|
#ifdef SRGB_DECODE
|
|
detailTexel = sRGBToLinear(detailTexel);
|
|
#endif
|
|
albedoTexel.rgb = mix(albedoTexel.rgb, detailTexel.rgb, detailTexel.a);
|
|
albedoTexel.a = detailTexel.a + (1.0 - detailTexel.a) * albedoTexel.a;
|
|
#endif
|
|
|
|
@end
|
|
|
|
@export ecgl.common.wireframe.vertexHeader
|
|
|
|
#ifdef WIREFRAME_QUAD
|
|
attribute vec4 barycentric;
|
|
varying vec4 v_Barycentric;
|
|
#elif defined(WIREFRAME_TRIANGLE)
|
|
attribute vec3 barycentric;
|
|
varying vec3 v_Barycentric;
|
|
#endif
|
|
|
|
@end
|
|
|
|
@export ecgl.common.wireframe.vertexMain
|
|
|
|
#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)
|
|
v_Barycentric = barycentric;
|
|
#endif
|
|
|
|
@end
|
|
|
|
|
|
@export ecgl.common.wireframe.fragmentHeader
|
|
|
|
uniform float wireframeLineWidth : 1;
|
|
uniform vec4 wireframeLineColor: [0, 0, 0, 0.5];
|
|
|
|
#ifdef WIREFRAME_QUAD
|
|
varying vec4 v_Barycentric;
|
|
float edgeFactor () {
|
|
vec4 d = fwidth(v_Barycentric);
|
|
vec4 a4 = smoothstep(vec4(0.0), d * wireframeLineWidth, v_Barycentric);
|
|
return min(min(min(a4.x, a4.y), a4.z), a4.w);
|
|
}
|
|
#elif defined(WIREFRAME_TRIANGLE)
|
|
varying vec3 v_Barycentric;
|
|
float edgeFactor () {
|
|
vec3 d = fwidth(v_Barycentric);
|
|
vec3 a3 = smoothstep(vec3(0.0), d * wireframeLineWidth, v_Barycentric);
|
|
return min(min(a3.x, a3.y), a3.z);
|
|
}
|
|
#endif
|
|
|
|
@end
|
|
|
|
|
|
@export ecgl.common.wireframe.fragmentMain
|
|
|
|
#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)
|
|
if (wireframeLineWidth > 0.) {
|
|
vec4 lineColor = wireframeLineColor;
|
|
#ifdef SRGB_DECODE
|
|
lineColor = sRGBToLinear(lineColor);
|
|
#endif
|
|
|
|
gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor()) * lineColor.a);
|
|
}
|
|
#endif
|
|
@end
|
|
|
|
|
|
|
|
|
|
@export ecgl.common.bumpMap.header
|
|
|
|
#ifdef BUMPMAP_ENABLED
|
|
uniform sampler2D bumpMap;
|
|
uniform float bumpScale : 1.0;
|
|
|
|
|
|
vec3 bumpNormal(vec3 surfPos, vec3 surfNormal, vec3 baseNormal)
|
|
{
|
|
vec2 dSTdx = dFdx(v_Texcoord);
|
|
vec2 dSTdy = dFdy(v_Texcoord);
|
|
|
|
float Hll = bumpScale * texture2D(bumpMap, v_Texcoord).x;
|
|
float dHx = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdx).x - Hll;
|
|
float dHy = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdy).x - Hll;
|
|
|
|
vec3 vSigmaX = dFdx(surfPos);
|
|
vec3 vSigmaY = dFdy(surfPos);
|
|
vec3 vN = surfNormal;
|
|
|
|
vec3 R1 = cross(vSigmaY, vN);
|
|
vec3 R2 = cross(vN, vSigmaX);
|
|
|
|
float fDet = dot(vSigmaX, R1);
|
|
|
|
vec3 vGrad = sign(fDet) * (dHx * R1 + dHy * R2);
|
|
return normalize(abs(fDet) * baseNormal - vGrad);
|
|
|
|
}
|
|
#endif
|
|
|
|
@end
|
|
|
|
@export ecgl.common.normalMap.vertexHeader
|
|
|
|
#ifdef NORMALMAP_ENABLED
|
|
attribute vec4 tangent : TANGENT;
|
|
varying vec3 v_Tangent;
|
|
varying vec3 v_Bitangent;
|
|
#endif
|
|
|
|
@end
|
|
|
|
@export ecgl.common.normalMap.vertexMain
|
|
|
|
#ifdef NORMALMAP_ENABLED
|
|
if (dot(tangent, tangent) > 0.0) {
|
|
v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);
|
|
v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);
|
|
}
|
|
#endif
|
|
|
|
@end
|
|
|
|
|
|
@export ecgl.common.normalMap.fragmentHeader
|
|
|
|
#ifdef NORMALMAP_ENABLED
|
|
uniform sampler2D normalMap;
|
|
varying vec3 v_Tangent;
|
|
varying vec3 v_Bitangent;
|
|
#endif
|
|
|
|
@end
|
|
|
|
@export ecgl.common.normalMap.fragmentMain
|
|
#ifdef NORMALMAP_ENABLED
|
|
if (dot(v_Tangent, v_Tangent) > 0.0) {
|
|
vec3 normalTexel = texture2D(normalMap, v_DetailTexcoord).xyz;
|
|
if (dot(normalTexel, normalTexel) > 0.0) { N = normalTexel * 2.0 - 1.0;
|
|
mat3 tbn = mat3(v_Tangent, v_Bitangent, v_Normal);
|
|
N = normalize(tbn * N);
|
|
}
|
|
}
|
|
#endif
|
|
@end
|
|
|
|
|
|
|
|
@export ecgl.common.vertexAnimation.header
|
|
|
|
#ifdef VERTEX_ANIMATION
|
|
attribute vec3 prevPosition;
|
|
attribute vec3 prevNormal;
|
|
uniform float percent;
|
|
#endif
|
|
|
|
@end
|
|
|
|
@export ecgl.common.vertexAnimation.main
|
|
|
|
#ifdef VERTEX_ANIMATION
|
|
vec3 pos = mix(prevPosition, position, percent);
|
|
vec3 norm = mix(prevNormal, normal, percent);
|
|
#else
|
|
vec3 pos = position;
|
|
vec3 norm = normal;
|
|
#endif
|
|
|
|
@end
|
|
|
|
|
|
@export ecgl.common.ssaoMap.header
|
|
#ifdef SSAOMAP_ENABLED
|
|
uniform sampler2D ssaoMap;
|
|
uniform vec4 viewport : VIEWPORT;
|
|
#endif
|
|
@end
|
|
|
|
@export ecgl.common.ssaoMap.main
|
|
float ao = 1.0;
|
|
#ifdef SSAOMAP_ENABLED
|
|
ao = texture2D(ssaoMap, (gl_FragCoord.xy - viewport.xy) / viewport.zw).r;
|
|
#endif
|
|
@end
|
|
|
|
|
|
|
|
|
|
@export ecgl.common.diffuseLayer.header
|
|
|
|
#if (LAYER_DIFFUSEMAP_COUNT > 0)
|
|
uniform float layerDiffuseIntensity[LAYER_DIFFUSEMAP_COUNT];
|
|
uniform sampler2D layerDiffuseMap[LAYER_DIFFUSEMAP_COUNT];
|
|
#endif
|
|
|
|
@end
|
|
|
|
@export ecgl.common.emissiveLayer.header
|
|
|
|
#if (LAYER_EMISSIVEMAP_COUNT > 0)
|
|
uniform float layerEmissionIntensity[LAYER_EMISSIVEMAP_COUNT];
|
|
uniform sampler2D layerEmissiveMap[LAYER_EMISSIVEMAP_COUNT];
|
|
#endif
|
|
|
|
@end
|
|
|
|
@export ecgl.common.layers.header
|
|
@import ecgl.common.diffuseLayer.header
|
|
@import ecgl.common.emissiveLayer.header
|
|
@end
|
|
|
|
@export ecgl.common.diffuseLayer.main
|
|
|
|
#if (LAYER_DIFFUSEMAP_COUNT > 0)
|
|
for (int _idx_ = 0; _idx_ < LAYER_DIFFUSEMAP_COUNT; _idx_++) {{
|
|
float intensity = layerDiffuseIntensity[_idx_];
|
|
vec4 texel2 = texture2D(layerDiffuseMap[_idx_], v_Texcoord);
|
|
#ifdef SRGB_DECODE
|
|
texel2 = sRGBToLinear(texel2);
|
|
#endif
|
|
albedoTexel.rgb = mix(albedoTexel.rgb, texel2.rgb * intensity, texel2.a);
|
|
albedoTexel.a = texel2.a + (1.0 - texel2.a) * albedoTexel.a;
|
|
}}
|
|
#endif
|
|
|
|
@end
|
|
|
|
@export ecgl.common.emissiveLayer.main
|
|
|
|
#if (LAYER_EMISSIVEMAP_COUNT > 0)
|
|
for (int _idx_ = 0; _idx_ < LAYER_EMISSIVEMAP_COUNT; _idx_++)
|
|
{{
|
|
vec4 texel2 = texture2D(layerEmissiveMap[_idx_], v_Texcoord) * layerEmissionIntensity[_idx_];
|
|
#ifdef SRGB_DECODE
|
|
texel2 = sRGBToLinear(texel2);
|
|
#endif
|
|
float intensity = layerEmissionIntensity[_idx_];
|
|
gl_FragColor.rgb += texel2.rgb * texel2.a * intensity;
|
|
}}
|
|
#endif
|
|
|
|
@end
|
|
`},function(re,X,D){"use strict";X.a=`@export ecgl.color.vertex
|
|
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
|
|
@import ecgl.common.uv.header
|
|
|
|
attribute vec2 texcoord : TEXCOORD_0;
|
|
attribute vec3 position: POSITION;
|
|
|
|
@import ecgl.common.wireframe.vertexHeader
|
|
|
|
#ifdef VERTEX_COLOR
|
|
attribute vec4 a_Color : COLOR;
|
|
varying vec4 v_Color;
|
|
#endif
|
|
|
|
#ifdef VERTEX_ANIMATION
|
|
attribute vec3 prevPosition;
|
|
uniform float percent : 1.0;
|
|
#endif
|
|
|
|
void main()
|
|
{
|
|
#ifdef VERTEX_ANIMATION
|
|
vec3 pos = mix(prevPosition, position, percent);
|
|
#else
|
|
vec3 pos = position;
|
|
#endif
|
|
|
|
gl_Position = worldViewProjection * vec4(pos, 1.0);
|
|
|
|
@import ecgl.common.uv.main
|
|
|
|
#ifdef VERTEX_COLOR
|
|
v_Color = a_Color;
|
|
#endif
|
|
|
|
@import ecgl.common.wireframe.vertexMain
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
@export ecgl.color.fragment
|
|
|
|
#define LAYER_DIFFUSEMAP_COUNT 0
|
|
#define LAYER_EMISSIVEMAP_COUNT 0
|
|
|
|
uniform sampler2D diffuseMap;
|
|
uniform sampler2D detailMap;
|
|
|
|
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
|
|
|
|
#ifdef VERTEX_COLOR
|
|
varying vec4 v_Color;
|
|
#endif
|
|
|
|
@import ecgl.common.layers.header
|
|
|
|
@import ecgl.common.uv.fragmentHeader
|
|
|
|
@import ecgl.common.wireframe.fragmentHeader
|
|
|
|
@import clay.util.srgb
|
|
|
|
void main()
|
|
{
|
|
#ifdef SRGB_DECODE
|
|
gl_FragColor = sRGBToLinear(color);
|
|
#else
|
|
gl_FragColor = color;
|
|
#endif
|
|
|
|
#ifdef VERTEX_COLOR
|
|
gl_FragColor *= v_Color;
|
|
#endif
|
|
|
|
@import ecgl.common.albedo.main
|
|
|
|
@import ecgl.common.diffuseLayer.main
|
|
|
|
gl_FragColor *= albedoTexel;
|
|
|
|
@import ecgl.common.emissiveLayer.main
|
|
|
|
@import ecgl.common.wireframe.fragmentMain
|
|
|
|
}
|
|
@end`},function(re,X,D){"use strict";X.a=`/**
|
|
* http: */
|
|
|
|
@export ecgl.lambert.vertex
|
|
|
|
@import ecgl.common.transformUniforms
|
|
|
|
@import ecgl.common.uv.header
|
|
|
|
|
|
@import ecgl.common.attributes
|
|
|
|
@import ecgl.common.wireframe.vertexHeader
|
|
|
|
#ifdef VERTEX_COLOR
|
|
attribute vec4 a_Color : COLOR;
|
|
varying vec4 v_Color;
|
|
#endif
|
|
|
|
|
|
@import ecgl.common.vertexAnimation.header
|
|
|
|
|
|
varying vec3 v_Normal;
|
|
varying vec3 v_WorldPosition;
|
|
|
|
void main()
|
|
{
|
|
@import ecgl.common.uv.main
|
|
|
|
@import ecgl.common.vertexAnimation.main
|
|
|
|
|
|
gl_Position = worldViewProjection * vec4(pos, 1.0);
|
|
|
|
v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);
|
|
v_WorldPosition = (world * vec4(pos, 1.0)).xyz;
|
|
|
|
#ifdef VERTEX_COLOR
|
|
v_Color = a_Color;
|
|
#endif
|
|
|
|
@import ecgl.common.wireframe.vertexMain
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
@export ecgl.lambert.fragment
|
|
|
|
#define LAYER_DIFFUSEMAP_COUNT 0
|
|
#define LAYER_EMISSIVEMAP_COUNT 0
|
|
|
|
#define NORMAL_UP_AXIS 1
|
|
#define NORMAL_FRONT_AXIS 2
|
|
|
|
@import ecgl.common.uv.fragmentHeader
|
|
|
|
varying vec3 v_Normal;
|
|
varying vec3 v_WorldPosition;
|
|
|
|
uniform sampler2D diffuseMap;
|
|
uniform sampler2D detailMap;
|
|
|
|
@import ecgl.common.layers.header
|
|
|
|
uniform float emissionIntensity: 1.0;
|
|
|
|
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
|
|
|
|
uniform mat4 viewInverse : VIEWINVERSE;
|
|
|
|
#ifdef AMBIENT_LIGHT_COUNT
|
|
@import clay.header.ambient_light
|
|
#endif
|
|
#ifdef AMBIENT_SH_LIGHT_COUNT
|
|
@import clay.header.ambient_sh_light
|
|
#endif
|
|
|
|
#ifdef DIRECTIONAL_LIGHT_COUNT
|
|
@import clay.header.directional_light
|
|
#endif
|
|
|
|
#ifdef VERTEX_COLOR
|
|
varying vec4 v_Color;
|
|
#endif
|
|
|
|
|
|
@import ecgl.common.ssaoMap.header
|
|
|
|
@import ecgl.common.bumpMap.header
|
|
|
|
@import clay.util.srgb
|
|
|
|
@import ecgl.common.wireframe.fragmentHeader
|
|
|
|
@import clay.plugin.compute_shadow_map
|
|
|
|
void main()
|
|
{
|
|
#ifdef SRGB_DECODE
|
|
gl_FragColor = sRGBToLinear(color);
|
|
#else
|
|
gl_FragColor = color;
|
|
#endif
|
|
|
|
#ifdef VERTEX_COLOR
|
|
#ifdef SRGB_DECODE
|
|
gl_FragColor *= sRGBToLinear(v_Color);
|
|
#else
|
|
gl_FragColor *= v_Color;
|
|
#endif
|
|
#endif
|
|
|
|
@import ecgl.common.albedo.main
|
|
|
|
@import ecgl.common.diffuseLayer.main
|
|
|
|
gl_FragColor *= albedoTexel;
|
|
|
|
vec3 N = v_Normal;
|
|
#ifdef DOUBLE_SIDED
|
|
vec3 eyePos = viewInverse[3].xyz;
|
|
vec3 V = normalize(eyePos - v_WorldPosition);
|
|
|
|
if (dot(N, V) < 0.0) {
|
|
N = -N;
|
|
}
|
|
#endif
|
|
|
|
float ambientFactor = 1.0;
|
|
|
|
#ifdef BUMPMAP_ENABLED
|
|
N = bumpNormal(v_WorldPosition, v_Normal, N);
|
|
ambientFactor = dot(v_Normal, N);
|
|
#endif
|
|
|
|
vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);
|
|
|
|
vec3 diffuseColor = vec3(0.0, 0.0, 0.0);
|
|
|
|
@import ecgl.common.ssaoMap.main
|
|
|
|
#ifdef AMBIENT_LIGHT_COUNT
|
|
for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)
|
|
{
|
|
diffuseColor += ambientLightColor[i] * ambientFactor * ao;
|
|
}
|
|
#endif
|
|
#ifdef AMBIENT_SH_LIGHT_COUNT
|
|
for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)
|
|
{{
|
|
diffuseColor += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;
|
|
}}
|
|
#endif
|
|
#ifdef DIRECTIONAL_LIGHT_COUNT
|
|
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
|
|
float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];
|
|
if(shadowEnabled)
|
|
{
|
|
computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);
|
|
}
|
|
#endif
|
|
for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)
|
|
{
|
|
vec3 lightDirection = -directionalLightDirection[i];
|
|
vec3 lightColor = directionalLightColor[i];
|
|
|
|
float shadowContrib = 1.0;
|
|
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
|
|
if (shadowEnabled)
|
|
{
|
|
shadowContrib = shadowContribsDir[i];
|
|
}
|
|
#endif
|
|
|
|
float ndl = dot(N, normalize(lightDirection)) * shadowContrib;
|
|
|
|
diffuseColor += lightColor * clamp(ndl, 0.0, 1.0);
|
|
}
|
|
#endif
|
|
|
|
gl_FragColor.rgb *= diffuseColor;
|
|
|
|
@import ecgl.common.emissiveLayer.main
|
|
|
|
@import ecgl.common.wireframe.fragmentMain
|
|
}
|
|
|
|
@end`},function(re,X,D){"use strict";X.a=`@export ecgl.realistic.vertex
|
|
|
|
@import ecgl.common.transformUniforms
|
|
|
|
@import ecgl.common.uv.header
|
|
|
|
@import ecgl.common.attributes
|
|
|
|
|
|
@import ecgl.common.wireframe.vertexHeader
|
|
|
|
#ifdef VERTEX_COLOR
|
|
attribute vec4 a_Color : COLOR;
|
|
varying vec4 v_Color;
|
|
#endif
|
|
|
|
#ifdef NORMALMAP_ENABLED
|
|
attribute vec4 tangent : TANGENT;
|
|
varying vec3 v_Tangent;
|
|
varying vec3 v_Bitangent;
|
|
#endif
|
|
|
|
@import ecgl.common.vertexAnimation.header
|
|
|
|
varying vec3 v_Normal;
|
|
varying vec3 v_WorldPosition;
|
|
|
|
void main()
|
|
{
|
|
|
|
@import ecgl.common.uv.main
|
|
|
|
@import ecgl.common.vertexAnimation.main
|
|
|
|
gl_Position = worldViewProjection * vec4(pos, 1.0);
|
|
|
|
v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);
|
|
v_WorldPosition = (world * vec4(pos, 1.0)).xyz;
|
|
|
|
#ifdef VERTEX_COLOR
|
|
v_Color = a_Color;
|
|
#endif
|
|
|
|
#ifdef NORMALMAP_ENABLED
|
|
v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);
|
|
v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);
|
|
#endif
|
|
|
|
@import ecgl.common.wireframe.vertexMain
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@export ecgl.realistic.fragment
|
|
|
|
#define LAYER_DIFFUSEMAP_COUNT 0
|
|
#define LAYER_EMISSIVEMAP_COUNT 0
|
|
#define PI 3.14159265358979
|
|
#define ROUGHNESS_CHANEL 0
|
|
#define METALNESS_CHANEL 1
|
|
|
|
#define NORMAL_UP_AXIS 1
|
|
#define NORMAL_FRONT_AXIS 2
|
|
|
|
#ifdef VERTEX_COLOR
|
|
varying vec4 v_Color;
|
|
#endif
|
|
|
|
@import ecgl.common.uv.fragmentHeader
|
|
|
|
varying vec3 v_Normal;
|
|
varying vec3 v_WorldPosition;
|
|
|
|
uniform sampler2D diffuseMap;
|
|
|
|
uniform sampler2D detailMap;
|
|
uniform sampler2D metalnessMap;
|
|
uniform sampler2D roughnessMap;
|
|
|
|
@import ecgl.common.layers.header
|
|
|
|
uniform float emissionIntensity: 1.0;
|
|
|
|
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
|
|
|
|
uniform float metalness : 0.0;
|
|
uniform float roughness : 0.5;
|
|
|
|
uniform mat4 viewInverse : VIEWINVERSE;
|
|
|
|
#ifdef AMBIENT_LIGHT_COUNT
|
|
@import clay.header.ambient_light
|
|
#endif
|
|
|
|
#ifdef AMBIENT_SH_LIGHT_COUNT
|
|
@import clay.header.ambient_sh_light
|
|
#endif
|
|
|
|
#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT
|
|
@import clay.header.ambient_cubemap_light
|
|
#endif
|
|
|
|
#ifdef DIRECTIONAL_LIGHT_COUNT
|
|
@import clay.header.directional_light
|
|
#endif
|
|
|
|
@import ecgl.common.normalMap.fragmentHeader
|
|
|
|
@import ecgl.common.ssaoMap.header
|
|
|
|
@import ecgl.common.bumpMap.header
|
|
|
|
@import clay.util.srgb
|
|
|
|
@import clay.util.rgbm
|
|
|
|
@import ecgl.common.wireframe.fragmentHeader
|
|
|
|
@import clay.plugin.compute_shadow_map
|
|
|
|
vec3 F_Schlick(float ndv, vec3 spec) {
|
|
return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);
|
|
}
|
|
|
|
float D_Phong(float g, float ndh) {
|
|
float a = pow(8192.0, g);
|
|
return (a + 2.0) / 8.0 * pow(ndh, a);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
vec4 albedoColor = color;
|
|
|
|
vec3 eyePos = viewInverse[3].xyz;
|
|
vec3 V = normalize(eyePos - v_WorldPosition);
|
|
#ifdef VERTEX_COLOR
|
|
#ifdef SRGB_DECODE
|
|
albedoColor *= sRGBToLinear(v_Color);
|
|
#else
|
|
albedoColor *= v_Color;
|
|
#endif
|
|
#endif
|
|
|
|
@import ecgl.common.albedo.main
|
|
|
|
@import ecgl.common.diffuseLayer.main
|
|
|
|
albedoColor *= albedoTexel;
|
|
|
|
float m = metalness;
|
|
|
|
#ifdef METALNESSMAP_ENABLED
|
|
float m2 = texture2D(metalnessMap, v_DetailTexcoord)[METALNESS_CHANEL];
|
|
m = clamp(m2 + (m - 0.5) * 2.0, 0.0, 1.0);
|
|
#endif
|
|
|
|
vec3 baseColor = albedoColor.rgb;
|
|
albedoColor.rgb = baseColor * (1.0 - m);
|
|
vec3 specFactor = mix(vec3(0.04), baseColor, m);
|
|
|
|
float g = 1.0 - roughness;
|
|
|
|
#ifdef ROUGHNESSMAP_ENABLED
|
|
float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];
|
|
g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);
|
|
#endif
|
|
|
|
vec3 N = v_Normal;
|
|
|
|
#ifdef DOUBLE_SIDED
|
|
if (dot(N, V) < 0.0) {
|
|
N = -N;
|
|
}
|
|
#endif
|
|
|
|
float ambientFactor = 1.0;
|
|
|
|
#ifdef BUMPMAP_ENABLED
|
|
N = bumpNormal(v_WorldPosition, v_Normal, N);
|
|
ambientFactor = dot(v_Normal, N);
|
|
#endif
|
|
|
|
@import ecgl.common.normalMap.fragmentMain
|
|
|
|
vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);
|
|
|
|
vec3 diffuseTerm = vec3(0.0);
|
|
vec3 specularTerm = vec3(0.0);
|
|
|
|
float ndv = clamp(dot(N, V), 0.0, 1.0);
|
|
vec3 fresnelTerm = F_Schlick(ndv, specFactor);
|
|
|
|
@import ecgl.common.ssaoMap.main
|
|
|
|
#ifdef AMBIENT_LIGHT_COUNT
|
|
for(int _idx_ = 0; _idx_ < AMBIENT_LIGHT_COUNT; _idx_++)
|
|
{{
|
|
diffuseTerm += ambientLightColor[_idx_] * ambientFactor * ao;
|
|
}}
|
|
#endif
|
|
|
|
#ifdef AMBIENT_SH_LIGHT_COUNT
|
|
for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)
|
|
{{
|
|
diffuseTerm += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;
|
|
}}
|
|
#endif
|
|
|
|
#ifdef DIRECTIONAL_LIGHT_COUNT
|
|
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
|
|
float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];
|
|
if(shadowEnabled)
|
|
{
|
|
computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);
|
|
}
|
|
#endif
|
|
for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++)
|
|
{{
|
|
vec3 L = -directionalLightDirection[_idx_];
|
|
vec3 lc = directionalLightColor[_idx_];
|
|
|
|
vec3 H = normalize(L + V);
|
|
float ndl = clamp(dot(N, normalize(L)), 0.0, 1.0);
|
|
float ndh = clamp(dot(N, H), 0.0, 1.0);
|
|
|
|
float shadowContrib = 1.0;
|
|
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
|
|
if (shadowEnabled)
|
|
{
|
|
shadowContrib = shadowContribsDir[_idx_];
|
|
}
|
|
#endif
|
|
|
|
vec3 li = lc * ndl * shadowContrib;
|
|
|
|
diffuseTerm += li;
|
|
specularTerm += li * fresnelTerm * D_Phong(g, ndh);
|
|
}}
|
|
#endif
|
|
|
|
|
|
#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT
|
|
vec3 L = reflect(-V, N);
|
|
L = vec3(L.x, L[NORMAL_UP_AXIS], L[NORMAL_FRONT_AXIS]);
|
|
float rough2 = clamp(1.0 - g, 0.0, 1.0);
|
|
float bias2 = rough2 * 5.0;
|
|
vec2 brdfParam2 = texture2D(ambientCubemapLightBRDFLookup[0], vec2(rough2, ndv)).xy;
|
|
vec3 envWeight2 = specFactor * brdfParam2.x + brdfParam2.y;
|
|
vec3 envTexel2;
|
|
for(int _idx_ = 0; _idx_ < AMBIENT_CUBEMAP_LIGHT_COUNT; _idx_++)
|
|
{{
|
|
envTexel2 = RGBMDecode(textureCubeLodEXT(ambientCubemapLightCubemap[_idx_], L, bias2), 51.5);
|
|
specularTerm += ambientCubemapLightColor[_idx_] * envTexel2 * envWeight2 * ao;
|
|
}}
|
|
#endif
|
|
|
|
gl_FragColor.rgb = albedoColor.rgb * diffuseTerm + specularTerm;
|
|
gl_FragColor.a = albedoColor.a;
|
|
|
|
#ifdef SRGB_ENCODE
|
|
gl_FragColor = linearTosRGB(gl_FragColor);
|
|
#endif
|
|
|
|
@import ecgl.common.emissiveLayer.main
|
|
|
|
@import ecgl.common.wireframe.fragmentMain
|
|
}
|
|
|
|
@end`},function(re,X,D){"use strict";X.a=`@export ecgl.hatching.vertex
|
|
|
|
@import ecgl.realistic.vertex
|
|
|
|
@end
|
|
|
|
|
|
@export ecgl.hatching.fragment
|
|
|
|
#define NORMAL_UP_AXIS 1
|
|
#define NORMAL_FRONT_AXIS 2
|
|
|
|
@import ecgl.common.uv.fragmentHeader
|
|
|
|
varying vec3 v_Normal;
|
|
varying vec3 v_WorldPosition;
|
|
|
|
uniform vec4 color : [0.0, 0.0, 0.0, 1.0];
|
|
uniform vec4 paperColor : [1.0, 1.0, 1.0, 1.0];
|
|
|
|
uniform mat4 viewInverse : VIEWINVERSE;
|
|
|
|
#ifdef AMBIENT_LIGHT_COUNT
|
|
@import clay.header.ambient_light
|
|
#endif
|
|
#ifdef AMBIENT_SH_LIGHT_COUNT
|
|
@import clay.header.ambient_sh_light
|
|
#endif
|
|
|
|
#ifdef DIRECTIONAL_LIGHT_COUNT
|
|
@import clay.header.directional_light
|
|
#endif
|
|
|
|
#ifdef VERTEX_COLOR
|
|
varying vec4 v_Color;
|
|
#endif
|
|
|
|
|
|
@import ecgl.common.ssaoMap.header
|
|
|
|
@import ecgl.common.bumpMap.header
|
|
|
|
@import clay.util.srgb
|
|
|
|
@import ecgl.common.wireframe.fragmentHeader
|
|
|
|
@import clay.plugin.compute_shadow_map
|
|
|
|
uniform sampler2D hatch1;
|
|
uniform sampler2D hatch2;
|
|
uniform sampler2D hatch3;
|
|
uniform sampler2D hatch4;
|
|
uniform sampler2D hatch5;
|
|
uniform sampler2D hatch6;
|
|
|
|
float shade(in float tone) {
|
|
vec4 c = vec4(1. ,1., 1., 1.);
|
|
float step = 1. / 6.;
|
|
vec2 uv = v_DetailTexcoord;
|
|
if (tone <= step / 2.0) {
|
|
c = mix(vec4(0.), texture2D(hatch6, uv), 12. * tone);
|
|
}
|
|
else if (tone <= step) {
|
|
c = mix(texture2D(hatch6, uv), texture2D(hatch5, uv), 6. * tone);
|
|
}
|
|
if(tone > step && tone <= 2. * step){
|
|
c = mix(texture2D(hatch5, uv), texture2D(hatch4, uv) , 6. * (tone - step));
|
|
}
|
|
if(tone > 2. * step && tone <= 3. * step){
|
|
c = mix(texture2D(hatch4, uv), texture2D(hatch3, uv), 6. * (tone - 2. * step));
|
|
}
|
|
if(tone > 3. * step && tone <= 4. * step){
|
|
c = mix(texture2D(hatch3, uv), texture2D(hatch2, uv), 6. * (tone - 3. * step));
|
|
}
|
|
if(tone > 4. * step && tone <= 5. * step){
|
|
c = mix(texture2D(hatch2, uv), texture2D(hatch1, uv), 6. * (tone - 4. * step));
|
|
}
|
|
if(tone > 5. * step){
|
|
c = mix(texture2D(hatch1, uv), vec4(1.), 6. * (tone - 5. * step));
|
|
}
|
|
|
|
return c.r;
|
|
}
|
|
|
|
const vec3 w = vec3(0.2125, 0.7154, 0.0721);
|
|
|
|
void main()
|
|
{
|
|
#ifdef SRGB_DECODE
|
|
vec4 inkColor = sRGBToLinear(color);
|
|
#else
|
|
vec4 inkColor = color;
|
|
#endif
|
|
|
|
#ifdef VERTEX_COLOR
|
|
#ifdef SRGB_DECODE
|
|
inkColor *= sRGBToLinear(v_Color);
|
|
#else
|
|
inkColor *= v_Color;
|
|
#endif
|
|
#endif
|
|
|
|
vec3 N = v_Normal;
|
|
#ifdef DOUBLE_SIDED
|
|
vec3 eyePos = viewInverse[3].xyz;
|
|
vec3 V = normalize(eyePos - v_WorldPosition);
|
|
|
|
if (dot(N, V) < 0.0) {
|
|
N = -N;
|
|
}
|
|
#endif
|
|
|
|
float tone = 0.0;
|
|
|
|
float ambientFactor = 1.0;
|
|
|
|
#ifdef BUMPMAP_ENABLED
|
|
N = bumpNormal(v_WorldPosition, v_Normal, N);
|
|
ambientFactor = dot(v_Normal, N);
|
|
#endif
|
|
|
|
vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);
|
|
|
|
@import ecgl.common.ssaoMap.main
|
|
|
|
#ifdef AMBIENT_LIGHT_COUNT
|
|
for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)
|
|
{
|
|
tone += dot(ambientLightColor[i], w) * ambientFactor * ao;
|
|
}
|
|
#endif
|
|
#ifdef AMBIENT_SH_LIGHT_COUNT
|
|
for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)
|
|
{{
|
|
tone += dot(calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_], w) * ao;
|
|
}}
|
|
#endif
|
|
#ifdef DIRECTIONAL_LIGHT_COUNT
|
|
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
|
|
float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];
|
|
if(shadowEnabled)
|
|
{
|
|
computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);
|
|
}
|
|
#endif
|
|
for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)
|
|
{
|
|
vec3 lightDirection = -directionalLightDirection[i];
|
|
float lightTone = dot(directionalLightColor[i], w);
|
|
|
|
float shadowContrib = 1.0;
|
|
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
|
|
if (shadowEnabled)
|
|
{
|
|
shadowContrib = shadowContribsDir[i];
|
|
}
|
|
#endif
|
|
|
|
float ndl = dot(N, normalize(lightDirection)) * shadowContrib;
|
|
|
|
tone += lightTone * clamp(ndl, 0.0, 1.0);
|
|
}
|
|
#endif
|
|
|
|
gl_FragColor = mix(inkColor, paperColor, shade(clamp(tone, 0.0, 1.0)));
|
|
}
|
|
@end
|
|
`},function(re,X,D){"use strict";X.a=`@export ecgl.sm.depth.vertex
|
|
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
|
|
attribute vec3 position : POSITION;
|
|
|
|
#ifdef VERTEX_ANIMATION
|
|
attribute vec3 prevPosition;
|
|
uniform float percent : 1.0;
|
|
#endif
|
|
|
|
varying vec4 v_ViewPosition;
|
|
|
|
void main(){
|
|
|
|
#ifdef VERTEX_ANIMATION
|
|
vec3 pos = mix(prevPosition, position, percent);
|
|
#else
|
|
vec3 pos = position;
|
|
#endif
|
|
|
|
v_ViewPosition = worldViewProjection * vec4(pos, 1.0);
|
|
gl_Position = v_ViewPosition;
|
|
|
|
}
|
|
@end
|
|
|
|
|
|
|
|
@export ecgl.sm.depth.fragment
|
|
|
|
@import clay.sm.depth.fragment
|
|
|
|
@end`},function(re,X,D){"use strict";var W=D(134),y=D(138),L=D(139),A=D(145),s=D(0),x=D.n(s);x.a.registerAction({type:"grid3DChangeCamera",event:"grid3dcamerachanged",update:"series:updateCamera"},function(c,u){u.eachComponent({mainType:"grid3D",query:c},function(f){f.setView(c)})}),x.a.registerAction({type:"grid3DShowAxisPointer",event:"grid3dshowaxispointer",update:"grid3D:showAxisPointer"},function(c,u){}),x.a.registerAction({type:"grid3DHideAxisPointer",event:"grid3dhideaxispointer",update:"grid3D:hideAxisPointer"},function(c,u){})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(135),A=y.a.extendComponentModel({type:"cartesian3DAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid3D",index:this.option.gridIndex,id:this.option.gridId})[0]}});y.a.helper.mixinAxisModelCommonMethods(A);function s(x,c){return c.type||(c.data?"category":"value")}Object(L.a)("x",A,s,{name:"X"}),Object(L.a)("y",A,s,{name:"Y"}),Object(L.a)("z",A,s,{name:"Z"})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(136),A=D(137),s=D.n(A),x=["value","category","time","log"];X.a=function(c,u,f,i){y.a.util.each(x,function(o){u.extend({type:c+"Axis3D."+o,__ordinalMeta:null,mergeDefaultAndTheme:function(d,m){var _=m.getTheme();y.a.util.merge(d,_.get(o+"Axis3D")),y.a.util.merge(d,this.getDefaultOption()),d.type=f(c,d)},optionUpdated:function(){var d=this.option;d.type==="category"&&(this.__ordinalMeta=s.a.createByAxisModel(this))},getCategories:function(){if(this.option.type==="category")return this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:y.a.util.merge(y.a.util.clone(L.a[o+"Axis3D"]),i||{},!0)})}),u.superClass.registerSubTypeDefaulter(c+"Axis3D",y.a.util.curry(f,c))}},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L={show:!0,grid3DIndex:0,inverse:!1,name:"",nameLocation:"middle",nameTextStyle:{fontSize:16},nameGap:20,axisPointer:{},axisLine:{},axisTick:{},axisLabel:{},splitArea:{}},A=y.a.util.merge({boundaryGap:!0,axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"},axisPointer:{label:{show:!1}}},L),s=y.a.util.merge({boundaryGap:[0,0],splitNumber:5,axisPointer:{label:{}}},L),x=y.a.util.defaults({scale:!0,min:"dataMin",max:"dataMax"},s),c=y.a.util.defaults({logBase:10},s);c.scale=!0,X.a={categoryAxis3D:A,valueAxis3D:s,timeAxis3D:x,logAxis3D:c}},function(re,X,D){var W=D(12),y=W.createHashMap,L=W.isObject,A=W.map;function s(i){this.categories=i.categories||[],this._needCollect=i.needCollect,this._deduplication=i.deduplication,this._map}s.createByAxisModel=function(i){var o=i.option,d=o.data,m=d&&A(d,u);return new s({categories:m,needCollect:!m,deduplication:o.dedplication!==!1})};var x=s.prototype;x.getOrdinal=function(i){return c(this).get(i)},x.parseAndCollect=function(i){var o,d=this._needCollect;if(typeof i!="string"&&!d)return i;if(d&&!this._deduplication)return o=this.categories.length,this.categories[o]=i,o;var m=c(this);return o=m.get(i),o==null&&(d?(o=this.categories.length,this.categories[o]=i,m.set(i,o)):o=NaN),o};function c(i){return i._map||(i._map=y(i.categories))}function u(i){return L(i)&&i.value!=null?i.value:i+""}var f=s;re.exports=f},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(38),A=D(31),s=D(32),x=y.a.extendComponentModel({type:"grid3D",dependencies:["xAxis3D","yAxis3D","zAxis3D"],defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",boxWidth:100,boxHeight:100,boxDepth:100,axisPointer:{show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.8)",width:1},label:{show:!0,formatter:null,margin:8,textStyle:{fontSize:14,color:"#fff",backgroundColor:"rgba(0,0,0,0.5)",padding:3,borderRadius:3}}},axisLine:{show:!0,lineStyle:{color:"#333",width:2,type:"solid"}},axisTick:{show:!0,inside:!1,length:3,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,margin:8,textStyle:{fontSize:12}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},light:{main:{alpha:30,beta:40},ambient:{intensity:.4}},viewControl:{alpha:20,beta:40,autoRotate:!1,distance:200,minDistance:40,maxDistance:400}}});y.a.util.merge(x.prototype,L.a),y.a.util.merge(x.prototype,A.a),y.a.util.merge(x.prototype,s.a);var c=x},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(39),s=D(22),x=D(3),c=D(73),u=D(34),f=D(140),i=D(142),o=D(58),d=D(40),m=x.a.firstNotNull;L.a.Shader.import(d.a),["x","y","z"].forEach(function(v){y.a.extendComponentView({type:v+"Axis3D"})});var _={x:0,y:2,z:1},h=y.a.extendComponentView({type:"grid3D",__ecgl__:!0,init:function(v,r){var a=[["y","z","x",-1,"left"],["y","z","x",1,"right"],["x","y","z",-1,"bottom"],["x","y","z",1,"top"],["x","z","y",-1,"far"],["x","z","y",1,"near"]],p=["x","y","z"],E=new L.a.Material({shader:L.a.createShader("ecgl.color"),depthMask:!1,transparent:!0}),S=new L.a.Material({shader:L.a.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});E.define("fragment","DOUBLE_SIDED"),E.define("both","VERTEX_COLOR"),this.groupGL=new L.a.Node,this._control=new A.a({zr:r.getZr()}),this._control.init(),this._faces=a.map(function(R){var O=new f.a(R,S,E);return this.groupGL.add(O.rootNode),O},this),this._axes=p.map(function(R){var O=new i.a(R,S);return this.groupGL.add(O.rootNode),O},this);var w=r.getDevicePixelRatio();this._axisLabelSurface=new c.a({width:256,height:256,devicePixelRatio:w}),this._axisLabelSurface.onupdate=function(){r.getZr().refresh()},this._axisPointerLineMesh=new L.a.Mesh({geometry:new s.a({useNativeLine:!1}),material:S,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new c.a({width:128,height:128,devicePixelRatio:w}),this._axisPointerLabelsMesh=new o.a({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new L.a.Node,this._sceneHelper=new u.a,this._sceneHelper.initLight(this._lightRoot)},render:function(v,r,a){this._model=v,this._api=a;var p=v.coordinateSystem;p.viewGL.add(this._lightRoot),v.get("show")?p.viewGL.add(this.groupGL):p.viewGL.remove(this.groupGL);var E=this._control;E.setViewGL(p.viewGL);var S=v.getModel("viewControl");E.setFromViewControlModel(S,0),this._axisLabelSurface.clear();var w=["x","y","z"].reduce(function(R,O){var z=p.getAxis(O),N=z.model;return R[O]=m(N.get("axisLabel.interval"),v.get("axisLabel.interval")),z.scale.type==="ordinal"&&(R[O]==null||R[O]=="auto")&&(R[O]=Math.floor(z.scale.getTicks().length/8)),R},{});E.off("update"),v.get("show")&&(this._faces.forEach(function(R){R.update(w,v,r,a)},this),this._axes.forEach(function(R){R.update(v,w,this._axisLabelSurface,a)},this)),E.on("update",this._onCameraChange.bind(this,v,a),this),this._sceneHelper.setScene(p.viewGL.scene),this._sceneHelper.updateLight(v),p.viewGL.setPostEffect(v.getModel("postEffect"),a),p.viewGL.setTemporalSuperSampling(v.getModel("temporalSuperSampling")),this._initMouseHandler(v)},afterRender:function(v,r,a,p){var E=p.renderer;this._sceneHelper.updateAmbientCubemap(E,v,a),this._sceneHelper.updateSkybox(E,v,a)},showAxisPointer:function(v,r,a,p){this._doShowAxisPointer(),this._updateAxisPointer(p.value)},hideAxisPointer:function(v,r,a,p){this._doHideAxisPointer()},_initMouseHandler:function(v){var r=v.coordinateSystem,a=r.viewGL;v.get("show")&&v.get("axisPointer.show")?a.on("mousemove",this._updateAxisPointerOnMousePosition,this):a.off("mousemove",this._updateAxisPointerOnMousePosition)},_updateAxisPointerOnMousePosition:function(v){if(!v.target){for(var r=this._model,a=r.coordinateSystem,p=a.viewGL,E=p.castRay(v.offsetX,v.offsetY,new L.a.Ray),S,w=0;w<this._faces.length;w++){var R=this._faces[w];if(!R.rootNode.invisible){R.plane.normal.dot(p.camera.worldTransform.z)<0&&R.plane.normal.negate();var O=E.intersectPlane(R.plane);if(O){var z=a.getAxis(R.faceInfo[0]),N=a.getAxis(R.faceInfo[1]),P=_[R.faceInfo[0]],F=_[R.faceInfo[1]];z.contain(O.array[P])&&N.contain(O.array[F])&&(S=O)}}}if(S){var K=a.pointToData(S.array,[],!0);this._updateAxisPointer(K),this._doShowAxisPointer()}else this._doHideAxisPointer()}},_onCameraChange:function(v,r){v.get("show")&&(this._updateFaceVisibility(),this._updateAxisLinePosition());var a=this._control;r.dispatchAction({type:"grid3DChangeCamera",alpha:a.getAlpha(),beta:a.getBeta(),distance:a.getDistance(),center:a.getCenter(),from:this.uid,grid3DId:v.id})},_updateFaceVisibility:function(){var v=this._control.getCamera(),r=new L.a.Vector3;v.update();for(var a=0;a<this._faces.length/2;a++){for(var p=[],E=0;E<2;E++){var S=this._faces[a*2+E];S.rootNode.getWorldPosition(r),r.transformMat4(v.viewMatrix),p[E]=r.z}var w=p[0]>p[1]?0:1,R=this._faces[a*2+w],O=this._faces[a*2+1-w];R.rootNode.invisible=!0,O.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var v=this._model.coordinateSystem,r=v.getAxis("x"),a=v.getAxis("y"),p=v.getAxis("z"),E=p.getExtentMax(),S=p.getExtentMin(),w=r.getExtentMin(),R=r.getExtentMax(),O=a.getExtentMax(),z=a.getExtentMin(),N=this._axes[0].rootNode,P=this._axes[1].rootNode,F=this._axes[2].rootNode,K=this._faces,B=K[4].rootNode.invisible?z:O,V=K[2].rootNode.invisible?E:S,C=K[0].rootNode.invisible?w:R,M=K[2].rootNode.invisible?E:S,H=K[0].rootNode.invisible?R:w,$=K[4].rootNode.invisible?z:O;N.rotation.identity(),P.rotation.identity(),F.rotation.identity(),K[4].rootNode.invisible&&(this._axes[0].flipped=!0,N.rotation.rotateX(Math.PI)),K[0].rootNode.invisible&&(this._axes[1].flipped=!0,P.rotation.rotateZ(Math.PI)),K[4].rootNode.invisible&&(this._axes[2].flipped=!0,F.rotation.rotateY(Math.PI)),N.position.set(0,V,B),P.position.set(C,M,0),F.position.set(H,0,$),N.update(),P.update(),F.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var v=this._control.getCamera(),r=[new L.a.Vector4,new L.a.Vector4],a=new L.a.Vector4;this.groupGL.getWorldPosition(a),a.w=1,a.transformMat4(v.viewMatrix).transformMat4(v.projectionMatrix),a.x/=a.w,a.y/=a.w,this._axes.forEach(function(p){for(var E=p.axisLineCoords,S=p.labelsMesh.geometry,w=0;w<r.length;w++)r[w].setArray(E[w]),r[w].w=1,r[w].transformMat4(p.rootNode.worldTransform).transformMat4(v.viewMatrix).transformMat4(v.projectionMatrix),r[w].x/=r[w].w,r[w].y/=r[w].w;var R=r[1].x-r[0].x,O=r[1].y-r[0].y,z=(r[1].x+r[0].x)/2,N=(r[1].y+r[0].y)/2,P,F;Math.abs(O/R)<.5?(P="center",F=N>a.y?"bottom":"top"):(F="middle",P=z>a.x?"left":"right"),p.setSpriteAlign(P,F,this._api)},this)},_doShowAxisPointer:function(){this._axisPointerLineMesh.invisible&&(this._axisPointerLineMesh.invisible=!1,this._axisPointerLabelsMesh.invisible=!1,this._api.getZr().refresh())},_doHideAxisPointer:function(){this._axisPointerLineMesh.invisible||(this._axisPointerLineMesh.invisible=!0,this._axisPointerLabelsMesh.invisible=!0,this._api.getZr().refresh())},_updateAxisPointer:function(v){var r=this._model.coordinateSystem,a=r.dataToPoint(v),p=this._axisPointerLineMesh,E=p.geometry,S=this._model.getModel("axisPointer"),w=this._api.getDevicePixelRatio();E.convertToDynamicArray(!0);function R(xe){return x.a.firstNotNull(xe.model.get("axisPointer.show"),S.get("show"))}function O(xe){var De=xe.model.getModel("axisPointer",S),Ue=De.getModel("lineStyle"),Ge=L.a.parseColor(Ue.get("color")),Ae=m(Ue.get("width"),1),We=m(Ue.get("opacity"),1);return Ge[3]*=We,{color:Ge,lineWidth:Ae}}for(var z=0;z<this._faces.length;z++){var N=this._faces[z];if(!N.rootNode.invisible){for(var P=N.faceInfo,F=P[3]<0?r.getAxis(P[2]).getExtentMin():r.getAxis(P[2]).getExtentMax(),K=_[P[2]],B=0;B<2;B++){var V=P[B],C=P[1-B],M=r.getAxis(V),H=r.getAxis(C);if(R(M)){var $=[0,0,0],q=[0,0,0],se=_[V],ue=_[C];$[se]=q[se]=a[se],$[K]=q[K]=F,$[ue]=H.getExtentMin(),q[ue]=H.getExtentMax();var pe=O(M);E.addLine($,q,pe.color,pe.lineWidth*w)}}if(R(r.getAxis(P[2]))){var $=a.slice(),q=a.slice();q[K]=F;var pe=O(r.getAxis(P[2]));E.addLine($,q,pe.color,pe.lineWidth*w)}}}E.convertToTypedArray(),this._updateAxisPointerLabelsMesh(v),this._api.getZr().refresh()},_updateAxisPointerLabelsMesh:function(v){var r=this._model,a=this._axisPointerLabelsMesh,p=this._axisPointerLabelsSurface,E=r.coordinateSystem,S=r.getModel("axisPointer");a.geometry.convertToDynamicArray(!0),p.clear();var w={x:"y",y:"x",z:"y"};this._axes.forEach(function(R,O){var z=E.getAxis(R.dim),N=z.model,P=N.getModel("axisPointer",S),F=P.getModel("label"),K=P.get("lineStyle.color");if(!(!F.get("show")||!P.get("show"))){var B=v[O],V=F.get("formatter"),C=z.scale.getLabel(B);if(V!=null)C=V(C,v);else if(z.scale.type==="interval"||z.scale.type==="log"){var M=y.a.number.getPrecisionSafe(z.scale.getTicks()[0]);C=B.toFixed(M+2)}var H=F.getModel("textStyle"),$=H.get("color"),q=new y.a.graphic.Text;y.a.graphic.setTextStyle(q.style,H,{text:C,textFill:$||K,textAlign:"left",textVerticalAlign:"top"});var se=p.add(q),ue=q.getBoundingRect(),pe=this._api.getDevicePixelRatio(),xe=R.rootNode.position.toArray(),De=_[w[R.dim]];xe[De]+=(R.flipped?-1:1)*F.get("margin"),xe[_[R.dim]]=z.dataToCoord(v[O]),a.geometry.addSprite(xe,[ue.width*pe,ue.height*pe],se,R.textAlign,R.textVerticalAlign)}},this),p.getZr().refreshImmediately(),a.material.set("uvScale",p.getCoordsScale()),a.geometry.convertToTypedArray()},dispose:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(3),s=D(22),x=D(141),c=D(74),u=A.a.firstNotNull,f={x:0,y:2,z:1};function i(d,m,_,h){var v=[0,0,0],r=h<0?_.getExtentMin():_.getExtentMax();v[f[_.dim]]=r,d.position.setArray(v),d.rotation.identity(),m.distance=-Math.abs(r),m.normal.set(0,0,0),_.dim==="x"?(d.rotation.rotateY(h*Math.PI/2),m.normal.x=-h):_.dim==="z"?(d.rotation.rotateX(-h*Math.PI/2),m.normal.y=-h):(h>0&&d.rotation.rotateY(Math.PI),m.normal.z=-h)}function o(d,m,_){this.rootNode=new L.a.Node;var h=new L.a.Mesh({geometry:new s.a({useNativeLine:!1}),material:m,castShadow:!1,ignorePicking:!0,renderOrder:1}),v=new L.a.Mesh({geometry:new x.a,material:_,castShadow:!1,culling:!1,ignorePicking:!0,renderOrder:0});this.rootNode.add(v),this.rootNode.add(h),this.faceInfo=d,this.plane=new L.a.Plane,this.linesMesh=h,this.quadsMesh=v}o.prototype.update=function(d,m,_,h){var v=m.coordinateSystem,r=[v.getAxis(this.faceInfo[0]),v.getAxis(this.faceInfo[1])],a=this.linesMesh.geometry,p=this.quadsMesh.geometry;a.convertToDynamicArray(!0),p.convertToDynamicArray(!0),this._updateSplitLines(a,r,m,d,h),this._udpateSplitAreas(p,r,m,d,h),a.convertToTypedArray(),p.convertToTypedArray();var E=v.getAxis(this.faceInfo[2]);i(this.rootNode,this.plane,E,this.faceInfo[3])},o.prototype._updateSplitLines=function(d,m,_,h,v){var r=v.getDevicePixelRatio();m.forEach(function(a,p){var E=a.model,S=m[1-p].getExtent();if(!a.scale.isBlank()){var w=E.getModel("splitLine",_.getModel("splitLine"));if(w.get("show")){var R=w.getModel("lineStyle"),O=R.get("color"),z=u(R.get("opacity"),1),N=u(R.get("width"),1),P=w.get("interval");(P==null||P==="auto")&&(P=h[a.dim]),O=y.a.util.isArray(O)?O:[O];for(var F=a.getTicksCoords(),K=0,B=0;B<F.length;B++)if(!Object(c.a)(a,B,P)){var V=F[B],C=L.a.parseColor(O[K%O.length]);C[3]*=z;var M=[0,0,0],H=[0,0,0];M[p]=H[p]=V,M[1-p]=S[0],H[1-p]=S[1],d.addLine(M,H,C,N*r),K++}}}})},o.prototype._udpateSplitAreas=function(d,m,_,h,v){m.forEach(function(r,a){var p=r.model,E=m[1-a].getExtent();if(!r.scale.isBlank()){var S=p.getModel("splitArea",_.getModel("splitArea"));if(S.get("show")){var w=S.getModel("areaStyle"),R=w.get("color"),O=u(w.get("opacity"),1),z=S.get("interval");(z==null||z==="auto")&&(z=h[r.dim]),R=y.a.util.isArray(R)?R:[R];for(var N=r.getTicksCoords(),P=0,F=[0,0,0],K=[0,0,0],B=0;B<N.length;B++){var V=N[B],C=[0,0,0],M=[0,0,0];if(C[a]=M[a]=V,C[1-a]=E[0],M[1-a]=E[1],B===0){F=C,K=M;continue}if(!Object(c.a)(r,B,z)){var H=L.a.parseColor(R[P%R.length]);H[3]*=O,d.addQuad([F,C,M,K],H),F=C,K=M,P++}}}}})},X.a=o},function(re,X,D){"use strict";var W=D(13),y=D(0),L=D.n(y),A=D(33),s=D(1),x=D.n(s),c=x.a.vec3,u=W.a.extend(function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new W.a.Attribute("position","float",3,"POSITION"),normal:new W.a.Attribute("normal","float",3,"NORMAL"),color:new W.a.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(f){var i=this.attributes,o=this.getQuadVertexCount()*f,d=this.getQuadTriangleCount()*f;this.vertexCount!==o&&(i.position.init(o),i.normal.init(o),i.color.init(o)),this.triangleCount!==d&&(this.indices=o>65535?new Uint32Array(d*3):new Uint16Array(d*3))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:function(){var f=c.create(),i=c.create(),o=c.create(),d=[0,3,1,3,2,1];return function(m,_){var h=this.attributes.position,v=this.attributes.normal,r=this.attributes.color;c.sub(f,m[1],m[0]),c.sub(i,m[2],m[1]),c.cross(o,f,i),c.normalize(o,o);for(var a=0;a<4;a++)h.set(this._vertexOffset+a,m[a]),r.set(this._vertexOffset+a,_),v.set(this._vertexOffset+a,o);for(var p=this._faceOffset*3,a=0;a<6;a++)this.indices[p+a]=d[a]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2}}()});L.a.util.defaults(u.prototype,A.a),X.a=u},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(22),s=D(3),x=D(58),c=D(74),u=s.a.firstNotNull,f={x:0,y:2,z:1};function i(d,m){var _=new L.a.Mesh({geometry:new A.a({useNativeLine:!1}),material:m,castShadow:!1,ignorePicking:!0,renderOrder:2}),h=new x.a;h.material.depthMask=!1;var v=new L.a.Node;v.add(_),v.add(h),this.rootNode=v,this.dim=d,this.linesMesh=_,this.labelsMesh=h,this.axisLineCoords=null,this.labelElements=[]}var o={x:"y",y:"x",z:"y"};i.prototype.update=function(d,m,_,h){var v=d.coordinateSystem,r=v.getAxis(this.dim),a=m[this.dim],p=this.linesMesh.geometry,E=this.labelsMesh.geometry;p.convertToDynamicArray(!0),E.convertToDynamicArray(!0);var S=r.model,w=r.getExtent(),Ue=h.getDevicePixelRatio(),R=S.getModel("axisLine",d.getModel("axisLine")),O=S.getModel("axisTick",d.getModel("axisTick")),z=S.getModel("axisLabel",d.getModel("axisLabel")),N=R.get("lineStyle.color");if(R.get("show")){var P=R.getModel("lineStyle"),F=[0,0,0],K=[0,0,0],B=f[r.dim];F[B]=w[0],K[B]=w[1],this.axisLineCoords=[F,K];var V=L.a.parseColor(N),C=u(P.get("width"),1),M=u(P.get("opacity"),1);V[3]*=M,p.addLine(F,K,V,C*Ue)}if(O.get("show")){var H=O.getModel("lineStyle"),$=L.a.parseColor(u(H.get("color"),N)),C=u(H.get("width"),1);$[3]*=u(H.get("opacity"),1);var q=r.getTicksCoords(),se=O.get("interval");(se==null||se==="auto")&&(se=a);for(var ue=O.get("length"),pe=0;pe<q.length;pe++)if(!Object(c.a)(r,pe,se)){var xe=q[pe],F=[0,0,0],K=[0,0,0],B=f[r.dim],De=f[o[r.dim]];F[B]=K[B]=xe,K[De]=ue,p.addLine(F,K,$,C*Ue)}}this.labelElements=[];var Ue=h.getDevicePixelRatio();if(z.get("show")){for(var Ge=r.getLabelsCoords(),Ae=S.get("data"),se=a,We=z.get("margin"),we=S.getFormattedLabels(),Se=r.scale.getTicks(),pe=0;pe<Ge.length;pe++)if(!Object(c.a)(r,pe,se)){var xe=Ge[pe],ge=[0,0,0],B=f[r.dim],De=f[o[r.dim]];ge[B]=ge[B]=xe,ge[De]=We;var Re=z;Ae&&Ae[Se[pe]]&&Ae[Se[pe]].textStyle&&(Re=new y.a.Model(Ae[Se[pe]].textStyle,z,S.ecModel));var ve=u(Re.get("color"),N),Le=new y.a.graphic.Text;y.a.graphic.setTextStyle(Le.style,Re,{text:we[pe],textFill:typeof ve=="function"?ve(r.type==="category"?we[pe]:r.type==="value"?Se[pe]+"":Se[pe],pe):ve,textVerticalAlign:"top",textAlign:"left"});var Fe=_.add(Le),me=Le.getBoundingRect();E.addSprite(ge,[me.width*Ue,me.height*Ue],Fe),this.labelElements.push(Le)}}if(S.get("name")){var oe=S.getModel("nameTextStyle"),ge=[0,0,0],B=f[r.dim],De=f[o[r.dim]],ie=u(oe.get("color"),N),fe=oe.get("borderColor"),C=oe.get("borderWidth");ge[B]=ge[B]=(w[0]+w[1])/2,ge[De]=S.get("nameGap");var Le=new y.a.graphic.Text;y.a.graphic.setTextStyle(Le.style,oe,{text:S.get("name"),textFill:ie,textStroke:fe,lineWidth:C});var Fe=_.add(Le),me=Le.getBoundingRect();E.addSprite(ge,[me.width*Ue,me.height*Ue],Fe),Le.__idx=this.labelElements.length,this.nameLabelElement=Le}this.labelsMesh.material.set("textureAtlas",_.getTexture()),this.labelsMesh.material.set("uvScale",_.getCoordsScale()),p.convertToTypedArray(),E.convertToTypedArray()},i.prototype.setSpriteAlign=function(d,m,_){for(var h=_.getDevicePixelRatio(),v=this.labelsMesh.geometry,r=0;r<this.labelElements.length;r++){var a=this.labelElements[r],p=a.getBoundingRect();v.setSpriteAlign(r,[p.width*h,p.height*h],d,m)}var E=this.nameLabelElement;if(E){var p=E.getBoundingRect();v.setSpriteAlign(E.__idx,[p.width*h,p.height*h],d,m),v.dirty()}this.textAlign=d,this.textVerticalAlign=m},X.a=i},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(13),A=D(33),s=[0,1,2,0,2,3],x=L.a.extend(function(){return{attributes:{position:new L.a.Attribute("position","float",3,"POSITION"),texcoord:new L.a.Attribute("texcoord","float",2,"TEXCOORD_0"),offset:new L.a.Attribute("offset","float",2),color:new L.a.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setSpriteCount:function(c){this._spriteCount=c;var u=c*4,f=c*2;this.vertexCount!==u&&(this.attributes.position.init(u),this.attributes.offset.init(u),this.attributes.color.init(u)),this.triangleCount!==f&&(this.indices=u>65535?new Uint32Array(f*3):new Uint16Array(f*3))},setSpriteAlign:function(c,u,f,i,o){f==null&&(f="left"),i==null&&(i="top");var d,m,_,h;switch(o=o||0,f){case"left":d=o,_=u[0]+o;break;case"center":case"middle":d=-u[0]/2,_=u[0]/2;break;case"right":d=-u[0]-o,_=-o;break}switch(i){case"bottom":m=o,h=u[1]+o;break;case"middle":m=-u[1]/2,h=u[1]/2;break;case"top":m=-u[1]-o,h=-o;break}var v=c*4,r=this.attributes.offset;r.set(v,[d,h]),r.set(v+1,[_,h]),r.set(v+2,[_,m]),r.set(v+3,[d,m])},addSprite:function(c,u,f,i,o,d){var m=this._vertexOffset;this.setSprite(this._vertexOffset/4,c,u,f,i,o,d);for(var _=0;_<s.length;_++)this.indices[this._faceOffset*3+_]=s[_]+m;return this._faceOffset+=2,this._vertexOffset+=4,m/4},setSprite:function(c,u,f,i,o,d,m){for(var _=c*4,h=this.attributes,v=0;v<4;v++)h.position.set(_+v,u);var r=h.texcoord;r.set(_,[i[0][0],i[0][1]]),r.set(_+1,[i[1][0],i[0][1]]),r.set(_+2,[i[1][0],i[1][1]]),r.set(_+3,[i[0][0],i[1][1]]),this.setSpriteAlign(c,f,o,d,m)}});y.a.util.defaults(x.prototype,A.a),X.a=x},function(re,X,D){"use strict";X.a=`@export ecgl.labels.vertex
|
|
|
|
attribute vec3 position: POSITION;
|
|
attribute vec2 texcoord: TEXCOORD_0;
|
|
attribute vec2 offset;
|
|
#ifdef VERTEX_COLOR
|
|
attribute vec4 a_Color : COLOR;
|
|
varying vec4 v_Color;
|
|
#endif
|
|
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
uniform vec4 viewport : VIEWPORT;
|
|
|
|
varying vec2 v_Texcoord;
|
|
|
|
void main()
|
|
{
|
|
vec4 proj = worldViewProjection * vec4(position, 1.0);
|
|
|
|
vec2 screen = (proj.xy / abs(proj.w) + 1.0) * 0.5 * viewport.zw;
|
|
|
|
screen += offset;
|
|
|
|
proj.xy = (screen / viewport.zw - 0.5) * 2.0 * abs(proj.w);
|
|
gl_Position = proj;
|
|
#ifdef VERTEX_COLOR
|
|
v_Color = a_Color;
|
|
#endif
|
|
v_Texcoord = texcoord;
|
|
}
|
|
@end
|
|
|
|
|
|
@export ecgl.labels.fragment
|
|
|
|
uniform vec3 color : [1.0, 1.0, 1.0];
|
|
uniform float alpha : 1.0;
|
|
uniform sampler2D textureAtlas;
|
|
uniform vec2 uvScale: [1.0, 1.0];
|
|
|
|
#ifdef VERTEX_COLOR
|
|
varying vec4 v_Color;
|
|
#endif
|
|
varying float v_Miter;
|
|
|
|
varying vec2 v_Texcoord;
|
|
|
|
void main()
|
|
{
|
|
gl_FragColor = vec4(color, alpha) * texture2D(textureAtlas, v_Texcoord * uvScale);
|
|
#ifdef VERTEX_COLOR
|
|
gl_FragColor *= v_Color;
|
|
#endif
|
|
}
|
|
|
|
@end`},function(re,X,D){"use strict";var W=D(146),y=D(148),L=D(0),A=D.n(L),s=D(41),x=D.n(s),c=D(20),u=D(3);function f(m,_){var h=m.getBoxLayoutParams(),v=x.a.getLayoutRect(h,{width:_.getWidth(),height:_.getHeight()});v.y=_.getHeight()-v.y-v.height,this.viewGL.setViewport(v.x,v.y,v.width,v.height,_.getDevicePixelRatio());var r=m.get("boxWidth"),a=m.get("boxHeight"),p=m.get("boxDepth");["x","y","z"].forEach(function(E){if(!this.getAxis(E))throw new Error("Grid"+m.id+" don't have "+E+"Axis")},this),this.getAxis("x").setExtent(-r/2,r/2),this.getAxis("y").setExtent(p/2,-p/2),this.getAxis("z").setExtent(-a/2,a/2),this.size=[r,a,p]}function i(m,_){var h={};function v(r,a){h[r]=h[r]||[1/0,-1/0],h[r][0]=Math.min(a[0],h[r][0]),h[r][1]=Math.max(a[1],h[r][1])}m.eachSeries(function(r){if(r.coordinateSystem===this){var a=r.getData();["x","y","z"].forEach(function(p){v(p,a.getDataExtent(r.coordDimToDataDim(p)[0],!0))})}},this),["xAxis3D","yAxis3D","zAxis3D"].forEach(function(r){m.eachComponent(r,function(a){var p=r.charAt(0),E=a.getReferringComponents("grid3D")[0],S=E.coordinateSystem;if(S===this){var w=S.getAxis(p);if(w){console.warn("Can't have two %s in one grid3D",r);return}var R=A.a.helper.createScale(h[p]||[1/0,-1/0],a);w=new y.a(p,R),w.type=a.get("type");var O=w.type==="category";w.onBand=O&&a.get("boundaryGap"),w.inverse=a.get("inverse"),a.axis=w,w.model=a,S.addAxis(w)}},this)},this),this.resize(this.model,_)}var o={dimensions:W.a.prototype.dimensions,create:function(m,_){var h=[];m.eachComponent("grid3D",function(a){a.__viewGL=a.__viewGL||new c.a;var p=new W.a;p.model=a,p.viewGL=a.__viewGL,a.coordinateSystem=p,h.push(p),p.resize=f,p.update=i});var v=["xAxis3D","yAxis3D","zAxis3D"];function r(a,p){return v.map(function(E){var S=a.getReferringComponents(E)[0];if(S==null&&(S=p.getComponent(E)),!S)throw new Error(E+' "'+u.a.firstNotNull(a.get(E+"Index"),a.get(E+"Id"),0)+'" not found');return S})}return m.eachSeries(function(a){if(a.get("coordinateSystem")==="cartesian3D"){var p=a.getReferringComponents("grid3D")[0];if(p==null){var E=r(a,m),p=E[0].getCoordSysModel();E.forEach(function(R){var O=R.getCoordSysModel();if(!O)throw new Error('grid3D "'+u.a.firstNotNull(R.get("gridIndex"),R.get("gridId"),0)+'" not found');if(O!==p)throw new Error("xAxis3D, yAxis3D, zAxis3D must use the same grid")})}var S=p.coordinateSystem;a.coordinateSystem=S}}),h}};A.a.registerCoordinateSystem("grid3D",o);var d=o},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(147),A=D.n(L);function s(x){A.a.call(this,x),this.size=[0,0,0]}s.prototype={constructor:s,type:"cartesian3D",dimensions:["x","y","z"],model:null,containPoint:function(x){return this.getAxis("x").contain(x[0])&&this.getAxis("y").contain(x[2])&&this.getAxis("z").contain(x[1])},containData:function(x){return this.getAxis("x").containData(x[0])&&this.getAxis("y").containData(x[1])&&this.getAxis("z").containData(x[2])},dataToPoint:function(x,c,u){return c=c||[],c[0]=this.getAxis("x").dataToCoord(x[0],u),c[2]=this.getAxis("y").dataToCoord(x[1],u),c[1]=this.getAxis("z").dataToCoord(x[2],u),c},pointToData:function(x,c,u){return c=c||[],c[0]=this.getAxis("x").coordToData(x[0],u),c[1]=this.getAxis("y").coordToData(x[2],u),c[2]=this.getAxis("z").coordToData(x[1],u),c}},y.a.util.inherits(s,A.a),X.a=s},function(re,X,D){var W=D(12);function y(s){return this._axes[s]}var L=function(s){this._axes={},this._dimList=[],this.name=s||""};L.prototype={constructor:L,type:"cartesian",getAxis:function(s){return this._axes[s]},getAxes:function(){return W.map(this._dimList,y,this)},getAxesByScale:function(s){return s=s.toLowerCase(),W.filter(this.getAxes(),function(x){return x.scale.type===s})},addAxis:function(s){var x=s.dim;this._axes[x]=s,this._dimList.push(x)},dataToCoord:function(s){return this._dataCoordConvert(s,"dataToCoord")},coordToData:function(s){return this._dataCoordConvert(s,"coordToData")},_dataCoordConvert:function(s,x){for(var c=this._dimList,u=s instanceof Array?[]:{},f=0;f<c.length;f++){var i=c[f],o=this._axes[i];u[i]=o[x](s[i])}return u}};var A=L;re.exports=A},function(re,X,D){"use strict";var W=D(0),y=D.n(W);function L(A,s,x){y.a.Axis.call(this,A,s,x)}L.prototype={constructor:L,getExtentMin:function(){var A=this._extent;return Math.min(A[0],A[1])},getExtentMax:function(){var A=this._extent;return Math.max(A[0],A[1])}},y.a.util.inherits(L,y.a.Axis),X.a=L},function(re,X,D){var W=D(12),y=D(150),L=D(78);function A(a){return isNaN(a)?"-":(a=(a+"").split("."),a[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(a.length>1?"."+a[1]:""))}function s(a,p){return a=(a||"").toLowerCase().replace(/-(.)/g,function(E,S){return S.toUpperCase()}),p&&a&&(a=a.charAt(0).toUpperCase()+a.slice(1)),a}var x=W.normalizeCssArray;function c(a){return String(a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var u=["a","b","c","d","e","f","g"],f=function(a,p){return"{"+a+(p==null?"":p)+"}"};function i(a,p,E){W.isArray(p)||(p=[p]);var S=p.length;if(!S)return"";for(var w=p[0].$vars||[],R=0;R<w.length;R++){var O=u[R];a=a.replace(f(O),f(O,0))}for(var z=0;z<S;z++)for(var N=0;N<w.length;N++){var P=p[z][w[N]];a=a.replace(f(u[N],z),E?c(P):P)}return a}function o(a,p,E){return W.each(p,function(S,w){a=a.replace("{"+w+"}",E?c(S):S)}),a}function d(a,w){a=W.isString(a)?{color:a,extraCssText:w}:a||{};var E=a.color,S=a.type,w=a.extraCssText;return E?S==="subItem"?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+c(E)+";"+(w||"")+'"></span>':'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:'+c(E)+";"+(w||"")+'"></span>':""}var m=function(a){return a<10?"0"+a:a};function _(a,p,E){(a==="week"||a==="month"||a==="quarter"||a==="half-year"||a==="year")&&(a=`MM-dd
|
|
yyyy`);var S=L.parseDate(p),w=E?"UTC":"",R=S["get"+w+"FullYear"](),O=S["get"+w+"Month"]()+1,z=S["get"+w+"Date"](),N=S["get"+w+"Hours"](),P=S["get"+w+"Minutes"](),F=S["get"+w+"Seconds"]();return a=a.replace("MM",m(O)).replace("M",O).replace("yyyy",R).replace("yy",R%100).replace("dd",m(z)).replace("d",z).replace("hh",m(N)).replace("h",N).replace("mm",m(P)).replace("m",P).replace("ss",m(F)).replace("s",F),a}function h(a){return a&&a.charAt(0).toUpperCase()+a.substr(1)}var v=y.truncateText,r=y.getBoundingRect;X.addCommas=A,X.toCamelCase=s,X.normalizeCssArray=x,X.encodeHTML=c,X.formatTpl=i,X.formatTplSimple=o,X.getTooltipMarker=d,X.formatTime=_,X.capitalFirst=h,X.truncateText=v,X.getTextRect=r},function(re,X,D){var W=D(75),y=D(151),L=D(12),A=L.getContext,s=L.extend,x=L.retrieve2,c=L.retrieve3,u={},f=0,i=5e3,o=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,d="12px sans-serif",m={};function _(C,M){m[C]=M}function h(C,M){M=M||d;var H=C+":"+M;if(u[H])return u[H];for(var $=(C+"").split(`
|
|
`),q=0,se=0,ue=$.length;se<ue;se++)q=Math.max(P($[se],M).width,q);return f>i&&(f=0,u={}),f++,u[H]=q,q}function v(C,M,H,$,q,se,ue){return se?a(C,M,H,$,q,se,ue):r(C,M,H,$,q,ue)}function r(C,M,H,$,q,se){var ue=F(C,M,q,se),pe=h(C,M);q&&(pe+=q[1]+q[3]);var xe=ue.outerHeight,De=p(0,pe,H),Ue=E(0,xe,$),Ge=new W(De,Ue,pe,xe);return Ge.lineHeight=ue.lineHeight,Ge}function a(C,M,H,$,q,se,ue){var pe=K(C,{rich:se,truncate:ue,font:M,textAlign:H,textPadding:q}),xe=pe.outerWidth,De=pe.outerHeight,Ue=p(0,xe,H),Ge=E(0,De,$);return new W(Ue,Ge,xe,De)}function p(C,M,H){return H==="right"?C-=M:H==="center"&&(C-=M/2),C}function E(C,M,H){return H==="middle"?C-=M/2:H==="bottom"&&(C-=M),C}function S(C,M,H){var $=M.x,q=M.y,se=M.height,ue=M.width,pe=se/2,xe="left",De="top";switch(C){case"left":$-=H,q+=pe,xe="right",De="middle";break;case"right":$+=H+ue,q+=pe,De="middle";break;case"top":$+=ue/2,q-=H,xe="center",De="bottom";break;case"bottom":$+=ue/2,q+=se+H,xe="center";break;case"inside":$+=ue/2,q+=pe,xe="center",De="middle";break;case"insideLeft":$+=H,q+=pe,De="middle";break;case"insideRight":$+=ue-H,q+=pe,xe="right",De="middle";break;case"insideTop":$+=ue/2,q+=H,xe="center";break;case"insideBottom":$+=ue/2,q+=se-H,xe="center",De="bottom";break;case"insideTopLeft":$+=H,q+=H;break;case"insideTopRight":$+=ue-H,q+=H,xe="right";break;case"insideBottomLeft":$+=H,q+=se-H,De="bottom";break;case"insideBottomRight":$+=ue-H,q+=se-H,xe="right",De="bottom";break}return{x:$,y:q,textAlign:xe,textVerticalAlign:De}}function w(C,M,H,$,q){if(!M)return"";var se=(C+"").split(`
|
|
`);q=R(M,H,$,q);for(var ue=0,pe=se.length;ue<pe;ue++)se[ue]=O(se[ue],q);return se.join(`
|
|
`)}function R(C,M,q,$){$=s({},$),$.font=M;var q=x(q,"...");$.maxIterations=x($.maxIterations,2);var se=$.minChar=x($.minChar,0);$.cnCharWidth=h("\u56FD",M);var ue=$.ascCharWidth=h("a",M);$.placeholder=x($.placeholder,"");for(var pe=C=Math.max(0,C-1),xe=0;xe<se&&pe>=ue;xe++)pe-=ue;var De=h(q);return De>pe&&(q="",De=0),pe=C-De,$.ellipsis=q,$.ellipsisWidth=De,$.contentWidth=pe,$.containerWidth=C,$}function O(C,M){var H=M.containerWidth,$=M.font,q=M.contentWidth;if(!H)return"";var se=h(C,$);if(se<=H)return C;for(var ue=0;;ue++){if(se<=q||ue>=M.maxIterations){C+=M.ellipsis;break}var pe=ue===0?z(C,q,M.ascCharWidth,M.cnCharWidth):se>0?Math.floor(C.length*q/se):0;C=C.substr(0,pe),se=h(C,$)}return C===""&&(C=M.placeholder),C}function z(C,M,H,$){for(var q=0,se=0,ue=C.length;se<ue&&q<M;se++){var pe=C.charCodeAt(se);q+=0<=pe&&pe<=127?H:$}return se}function N(C){return h("\u56FD",C)}function P(C,M){return m.measureText(C,M)}m.measureText=function(C,M){var H=A();return H.font=M||d,H.measureText(C)};function F(C,M,H,$){C!=null&&(C+="");var q=N(M),se=C?C.split(`
|
|
`):[],ue=se.length*q,pe=ue;if(H&&(pe+=H[0]+H[2]),C&&$){var xe=$.outerHeight,De=$.outerWidth;if(xe!=null&&pe>xe)C="",se=[];else if(De!=null)for(var Ue=R(De-(H?H[1]+H[3]:0),M,$.ellipsis,{minChar:$.minChar,placeholder:$.placeholder}),Ge=0,Ae=se.length;Ge<Ae;Ge++)se[Ge]=O(se[Ge],Ue)}return{lines:se,height:ue,outerHeight:pe,lineHeight:q}}function K(C,M){var H={lines:[],width:0,height:0};if(C!=null&&(C+=""),!C)return H;for(var $=o.lastIndex=0,q;(q=o.exec(C))!=null;){var se=q.index;se>$&&B(H,C.substring($,se)),B(H,q[2],q[1]),$=o.lastIndex}$<C.length&&B(H,C.substring($,C.length));var ue=H.lines,pe=0,xe=0,De=[],Ue=M.textPadding,Ge=M.truncate,Ae=Ge&&Ge.outerWidth,We=Ge&&Ge.outerHeight;Ue&&(Ae!=null&&(Ae-=Ue[1]+Ue[3]),We!=null&&(We-=Ue[0]+Ue[2]));for(var we=0;we<ue.length;we++){for(var Se=ue[we],ge=0,Re=0,ve=0;ve<Se.tokens.length;ve++){var Le=Se.tokens[ve],Fe=Le.styleName&&M.rich[Le.styleName]||{},me=Le.textPadding=Fe.textPadding,oe=Le.font=Fe.font||M.font,ie=Le.textHeight=x(Fe.textHeight,N(oe));if(me&&(ie+=me[0]+me[2]),Le.height=ie,Le.lineHeight=c(Fe.textLineHeight,M.textLineHeight,ie),Le.textAlign=Fe&&Fe.textAlign||M.textAlign,Le.textVerticalAlign=Fe&&Fe.textVerticalAlign||"middle",We!=null&&pe+Le.lineHeight>We)return{lines:[],width:0,height:0};Le.textWidth=h(Le.text,oe);var fe=Fe.textWidth,ye=fe==null||fe==="auto";if(typeof fe=="string"&&fe.charAt(fe.length-1)==="%")Le.percentWidth=fe,De.push(Le),fe=0;else{if(ye){fe=Le.textWidth;var he=Fe.textBackgroundColor,Te=he&&he.image;Te&&(Te=y.findExistImage(Te),y.isImageReady(Te)&&(fe=Math.max(fe,Te.width*ie/Te.height)))}var Oe=me?me[1]+me[3]:0;fe+=Oe;var Be=Ae!=null?Ae-Re:null;Be!=null&&Be<fe&&(!ye||Be<Oe?(Le.text="",Le.textWidth=fe=0):(Le.text=w(Le.text,Be-Oe,oe,Ge.ellipsis,{minChar:Ge.minChar}),Le.textWidth=h(Le.text,oe),fe=Le.textWidth+Oe))}Re+=Le.width=fe,Fe&&(ge=Math.max(ge,Le.lineHeight))}Se.width=Re,Se.lineHeight=ge,pe+=ge,xe=Math.max(xe,Re)}H.outerWidth=H.width=x(M.textWidth,xe),H.outerHeight=H.height=x(M.textHeight,pe),Ue&&(H.outerWidth+=Ue[1]+Ue[3],H.outerHeight+=Ue[0]+Ue[2]);for(var we=0;we<De.length;we++){var Le=De[we],Ze=Le.percentWidth;Le.width=parseInt(Ze,10)/100*xe}return H}function B(C,M,H){for(var $=M==="",q=M.split(`
|
|
`),se=C.lines,ue=0;ue<q.length;ue++){var pe=q[ue],xe={styleName:H,text:pe,isLineHolder:!pe&&!$};if(ue)se.push({tokens:[xe]});else{var De=(se[se.length-1]||(se[0]={tokens:[]})).tokens,Ue=De.length;Ue===1&&De[0].isLineHolder?De[0]=xe:(pe||!Ue||$)&&De.push(xe)}}}function V(C){return(C.fontSize||C.fontFamily)&&[C.fontStyle,C.fontWeight,(C.fontSize||12)+"px",C.fontFamily||"sans-serif"].join(" ")||C.textFont||C.font}X.DEFAULT_FONT=d,X.$override=_,X.getWidth=h,X.getBoundingRect=v,X.adjustTextX=p,X.adjustTextY=E,X.adjustTextPositionOnRect=S,X.truncateText=w,X.getLineHeight=N,X.measureText=P,X.parsePlainText=F,X.parseRichText=K,X.makeFont=V},function(re,X,D){var W=D(53),y=new W(50);function L(c){if(typeof c=="string"){var u=y.get(c);return u&&u.image}else return c}function A(c,u,f,i,o){if(c)if(typeof c=="string"){if(u&&u.__zrImageSrc===c||!f)return u;var d=y.get(c),m={hostEl:f,cb:i,cbPayload:o};return d?(u=d.image,!x(u)&&d.pending.push(m)):(!u&&(u=new Image),u.onload=s,y.put(c,u.__cachedImgObj={image:u,pending:[m]}),u.src=u.__zrImageSrc=c),u}else return c;else return u}function s(){var c=this.__cachedImgObj;this.onload=this.__cachedImgObj=null;for(var u=0;u<c.pending.length;u++){var f=c.pending[u],i=f.cb;i&&i(this,f.cbPayload),f.hostEl.dirty()}c.pending.length=0}function x(c){return c&&c.width&&c.height}X.findExistImage=L,X.createOrUpdateImage=A,X.isImageReady=x},function(re,X,D){"use strict";var W=D(8),y=D(11),L=D(4),A=D(15),s=D(52),x=D(9),c=D(46),u=D(7),f=D(19),i=D(24),o=D(72),d=D(70),m=D(71),_=D(153),h=D(17),v=D(10),r=D(6),a=D(5),p=D(25),E=D(36),S=D(30),w=D(14),R=D(79),O=D(1),z=D.n(O),N=D(154),P=z.a.mat4,F=z.a.vec3,K=["px","nx","py","ny","pz","nz"];u.a.import(N.a);var B=W.a.extend(function(){return{softShadow:B.PCF,shadowBlur:1,lightFrustumBias:"auto",kernelPCF:new Float32Array([1,0,1,1,-1,1,0,1,-1,0,-1,-1,1,-1,0,-1]),precision:"mediump",_lastRenderNotCastShadow:!1,_frameBuffer:new v.a,_textures:{},_shadowMapNumber:{POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},_depthMaterials:{},_distanceMaterials:{},_opaqueCasters:[],_receivers:[],_lightsCastShadow:[],_lightCameras:{},_lightMaterials:{},_texturePool:new R.a}},function(){this._gaussianPassH=new w.a({fragment:u.a.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new w.a({fragment:u.a.source("clay.compositor.gaussian_blur")}),this._gaussianPassH.setUniform("blurSize",this.shadowBlur),this._gaussianPassH.setUniform("blurDir",0),this._gaussianPassV.setUniform("blurSize",this.shadowBlur),this._gaussianPassV.setUniform("blurDir",1),this._outputDepthPass=new w.a({fragment:u.a.source("clay.sm.debug_depth")})},{render:function(V,C,M,H){M||(M=C.getMainCamera()),this.trigger("beforerender",this,V,C,M),this._renderShadowPass(V,C,M,H),this.trigger("afterrender",this,V,C,M)},renderDebug:function(V,C){V.saveClear();var M=V.viewport,H=0,$=0,q=C||M.width/4,se=q;this.softShadow===B.VSM?this._outputDepthPass.material.define("fragment","USE_VSM"):this._outputDepthPass.material.undefine("fragment","USE_VSM");for(var ue in this._textures){var pe=this._textures[ue];V.setViewport(H,$,q*pe.width/pe.height,se),this._outputDepthPass.setUniform("depthMap",pe),this._outputDepthPass.render(V),H+=q*pe.width/pe.height}V.setViewport(M),V.restoreClear()},_updateCasterAndReceiver:function(V,C){if(C.castShadow&&this._opaqueCasters.push(C),C.receiveShadow?(this._receivers.push(C),C.material.set("shadowEnabled",1),C.material.set("pcfKernel",this.kernelPCF)):C.material.set("shadowEnabled",0),!C.material.shader&&C.material.updateShader&&C.material.updateShader(V),this.softShadow===B.VSM)C.material.define("fragment","USE_VSM"),C.material.undefine("fragment","PCF_KERNEL_SIZE");else{C.material.undefine("fragment","USE_VSM");var M=this.kernelPCF;M&&M.length?C.material.define("fragment","PCF_KERNEL_SIZE",M.length/2):C.material.undefine("fragment","PCF_KERNEL_SIZE")}},_update:function(V,C){for(var M=0;M<C.opaqueList.length;M++)this._updateCasterAndReceiver(V,C.opaqueList[M]);for(var M=0;M<C.transparentList.length;M++)this._updateCasterAndReceiver(V,C.transparentList[M]);for(var M=0;M<C.lights.length;M++){var H=C.lights[M];H.castShadow&&this._lightsCastShadow.push(H)}},_renderShadowPass:function(V,C,M,H){for(var $ in this._shadowMapNumber)this._shadowMapNumber[$]=0;this._lightsCastShadow.length=0,this._opaqueCasters.length=0,this._receivers.length=0;var q=V.gl;if(H||C.update(),M&&M.update(),this._update(V,C),!this._lightsCastShadow.length&&this._lastRenderNotCastShadow)return;this._lastRenderNotCastShadow=this._lightsCastShadow===0,q.enable(q.DEPTH_TEST),q.depthMask(!0),q.disable(q.BLEND),q.clearColor(1,1,1,1);for(var se=[],ue=[],pe=[],xe=[],De=[],Ue=[],Ge,Ae=0;Ae<this._lightsCastShadow.length;Ae++){var We=this._lightsCastShadow[Ae];if(We instanceof d.a){if(Ge){console.warn("Only one direectional light supported with shadow cascade");continue}if(We.shadowCascade>4){console.warn("Support at most 4 cascade");continue}We.shadowCascade>1&&(Ge=We.shadowCascade),this.renderDirectionalLightShadow(V,C,M,We,this._opaqueCasters,De,xe,pe)}else We instanceof o.a?this.renderSpotLightShadow(V,C,We,this._opaqueCasters,ue,se):We instanceof m.a&&this.renderPointLightShadow(V,C,We,this._opaqueCasters,Ue);this._shadowMapNumber[We.type]++}for(var we in this._shadowMapNumber)for(var Se=this._shadowMapNumber[we],ge=we+"_SHADOWMAP_COUNT",Ae=0;Ae<this._receivers.length;Ae++){var Re=this._receivers[Ae],ve=Re.material;ve.fragmentDefines[ge]!==Se&&(Se>0?ve.define("fragment",ge,Se):ve.isDefined("fragment",ge)&&ve.undefine("fragment",ge))}for(var Ae=0;Ae<this._receivers.length;Ae++){var Re=this._receivers[Ae],ve=Re.material;Ge?ve.define("fragment","SHADOW_CASCADE",Ge.shadowCascade):ve.undefine("fragment","SHADOW_CASCADE")}var Le=C.shadowUniforms;function Fe(ye){return ye.height}if(pe.length>0){var me=pe.map(Fe);if(Le.directionalLightShadowMaps={value:pe,type:"tv"},Le.directionalLightMatrices={value:xe,type:"m4v"},Le.directionalLightShadowMapSizes={value:me,type:"1fv"},Ge){var oe=De.slice(),ie=De.slice();oe.pop(),ie.shift(),oe.reverse(),ie.reverse(),xe.reverse(),Le.shadowCascadeClipsNear={value:oe,type:"1fv"},Le.shadowCascadeClipsFar={value:ie,type:"1fv"}}}if(se.length>0){var fe=se.map(Fe),Le=C.shadowUniforms;Le.spotLightShadowMaps={value:se,type:"tv"},Le.spotLightMatrices={value:ue,type:"m4v"},Le.spotLightShadowMapSizes={value:fe,type:"1fv"}}Ue.length>0&&(Le.pointLightShadowMaps={value:Ue,type:"tv"})},renderDirectionalLightShadow:function(){var V=new s.a,C=new x.a,M=new A.a,H=new x.a,$=new x.a,q=new x.a,se=new x.a;return function(ue,pe,xe,De,Ue,Ge,Ae,We){var we=this._getDepthMaterial(De),Se={getMaterial:function(Ot){return Ot.shadowDepthMaterial||we},sortCompare:c.a.opaqueSortCompare};if(!pe.viewBoundingBoxLastFrame.isFinite()){var ge=pe.getBoundingBox();pe.viewBoundingBoxLastFrame.copy(ge).applyTransform(xe.viewMatrix)}var Re=Math.min(-pe.viewBoundingBoxLastFrame.min.z,xe.far),ve=Math.max(-pe.viewBoundingBoxLastFrame.max.z,xe.near),Le=this._getDirectionalLightCamera(De,pe,xe),Fe=q.array;se.copy(Le.projectionMatrix),P.invert($.array,Le.worldTransform.array),P.multiply($.array,$.array,xe.worldTransform.array),P.multiply(Fe,se.array,$.array);for(var me=[],oe=xe instanceof E.a,ie=(xe.near+xe.far)/(xe.near-xe.far),fe=2*xe.near*xe.far/(xe.near-xe.far),ye=0;ye<=De.shadowCascade;ye++){var he=ve*Math.pow(Re/ve,ye/De.shadowCascade),Te=ve+(Re-ve)*ye/De.shadowCascade,Oe=he*De.cascadeSplitLogFactor+Te*(1-De.cascadeSplitLogFactor);me.push(Oe),Ge.push(-(-Oe*ie+fe)/-Oe)}var Be=this._getTexture(De,De.shadowCascade);We.push(Be);var Ze=ue.viewport,tt=ue.gl;this._frameBuffer.attach(Be),this._frameBuffer.bind(ue),tt.clear(tt.COLOR_BUFFER_BIT|tt.DEPTH_BUFFER_BIT);for(var ye=0;ye<De.shadowCascade;ye++){var dt=me[ye],nt=me[ye+1];oe?P.perspective(C.array,xe.fov/180*Math.PI,xe.aspect,dt,nt):P.ortho(C.array,xe.left,xe.right,xe.bottom,xe.top,dt,nt),V.setFromProjection(C),V.getTransformedBoundingBox(M,$),M.applyProjection(se);var At=M.min.array,Nt=M.max.array;At[0]=Math.max(At[0],-1),At[1]=Math.max(At[1],-1),Nt[0]=Math.min(Nt[0],1),Nt[1]=Math.min(Nt[1],1),H.ortho(At[0],Nt[0],At[1],Nt[1],1,-1),Le.projectionMatrix.multiplyLeft(H);var Bt=De.shadowResolution||512;ue.setViewport((De.shadowCascade-ye-1)*Bt,0,Bt,Bt,1),ue.renderPass(Ue,Le,Se),this.softShadow===B.VSM&&this._gaussianFilter(ue,Be,Be.width);var st=new x.a;st.copy(Le.viewMatrix).multiplyLeft(Le.projectionMatrix),Ae.push(st.array),Le.projectionMatrix.copy(se)}this._frameBuffer.unbind(ue),ue.setViewport(Ze)}}(),renderSpotLightShadow:function(V,C,M,H,$,q){var se=this._getTexture(M),ue=this._getSpotLightCamera(M),pe=V.gl;this._frameBuffer.attach(se),this._frameBuffer.bind(V),pe.clear(pe.COLOR_BUFFER_BIT|pe.DEPTH_BUFFER_BIT);var xe=this._getDepthMaterial(M),De={getMaterial:function(Ge){return Ge.shadowDepthMaterial||xe},sortCompare:c.a.opaqueSortCompare};V.renderPass(V.cullRenderList(H,null,ue),ue,De),this._frameBuffer.unbind(V),this.softShadow===B.VSM&&this._gaussianFilter(V,se,se.width);var Ue=new x.a;Ue.copy(ue.worldTransform).invert().multiplyLeft(ue.projectionMatrix),q.push(se),$.push(Ue.array)},renderPointLightShadow:function(V,C,M,H,$){var q=this._getTexture(M),se=V.gl;$.push(q);for(var ue=this._getDepthMaterial(M),pe={getMaterial:function(Ge){return Ge.shadowDepthMaterial||ue},sortCompare:c.a.opaqueSortCompare},xe=0;xe<6;xe++){var De=K[xe],Ue=this._getPointLightCamera(M,De);this._frameBuffer.attach(q,se.COLOR_ATTACHMENT0,se.TEXTURE_CUBE_MAP_POSITIVE_X+xe),this._frameBuffer.bind(V),se.clear(se.COLOR_BUFFER_BIT|se.DEPTH_BUFFER_BIT),V.renderPass(V.cullRenderList(H,null,Ue),Ue,pe)}this._frameBuffer.unbind(V)},_getDepthMaterial:function(V){var C=this._lightMaterials[V.__uid__],M=V instanceof m.a;if(!C){var H=M?"clay.sm.distance.":"clay.sm.depth.";C=new h.a({precision:this.precision,shader:new u.a(u.a.source(H+"vertex"),u.a.source(H+"fragment"))}),this._lightMaterials[V.__uid__]=C}return V.shadowSlopeScale!=null&&C.setUniform("slopeScale",V.shadowSlopeScale),V.shadowBias!=null&&C.setUniform("shadowBias",V.shadowBias),this.softShadow===B.VSM?C.define("fragment","USE_VSM"):C.undefine("fragment","USE_VSM"),M&&(C.set("lightPosition",V.getWorldPosition().array),C.set("range",V.range)),C},_gaussianFilter:function(V,C,M){var H={width:M,height:M,type:r.a.FLOAT},$=this._texturePool.get(H);this._frameBuffer.attach($),this._frameBuffer.bind(V),this._gaussianPassH.setUniform("texture",C),this._gaussianPassH.setUniform("textureWidth",M),this._gaussianPassH.render(V),this._frameBuffer.attach(C),this._gaussianPassV.setUniform("texture",$),this._gaussianPassV.setUniform("textureHeight",M),this._gaussianPassV.render(V),this._frameBuffer.unbind(V),this._texturePool.put($)},_getTexture:function(V,C){var M=V.__uid__,H=this._textures[M],$=V.shadowResolution||512;return C=C||1,H||(V instanceof m.a?H=new p.a:H=new a.a,H.width=$*C,H.height=$,this.softShadow===B.VSM?(H.type=r.a.FLOAT,H.anisotropic=4):(H.minFilter=y.a.NEAREST,H.magFilter=y.a.NEAREST,H.useMipmap=!1),this._textures[M]=H),H},_getPointLightCamera:function(V,C){this._lightCameras.point||(this._lightCameras.point={px:new E.a,nx:new E.a,py:new E.a,ny:new E.a,pz:new E.a,nz:new E.a});var M=this._lightCameras.point[C];switch(M.far=V.range,M.fov=90,M.position.set(0,0,0),C){case"px":M.lookAt(L.a.POSITIVE_X,L.a.NEGATIVE_Y);break;case"nx":M.lookAt(L.a.NEGATIVE_X,L.a.NEGATIVE_Y);break;case"py":M.lookAt(L.a.POSITIVE_Y,L.a.POSITIVE_Z);break;case"ny":M.lookAt(L.a.NEGATIVE_Y,L.a.NEGATIVE_Z);break;case"pz":M.lookAt(L.a.POSITIVE_Z,L.a.NEGATIVE_Y);break;case"nz":M.lookAt(L.a.NEGATIVE_Z,L.a.NEGATIVE_Y);break}return V.getWorldPosition(M.position),M.update(),M},_getDirectionalLightCamera:function(){var V=new x.a,C=new A.a,M=new A.a;return function(H,$,q){this._lightCameras.directional||(this._lightCameras.directional=new S.a);var se=this._lightCameras.directional;C.copy($.viewBoundingBoxLastFrame),C.intersection(q.frustum.boundingBox),se.position.copy(C.min).add(C.max).scale(.5).transformMat4(q.worldTransform),se.rotation.copy(H.rotation),se.scale.copy(H.scale),se.updateWorldTransform(),x.a.invert(V,se.worldTransform),x.a.multiply(V,V,q.worldTransform),M.copy(C).applyTransform(V);var ue=M.min.array,pe=M.max.array;return se.position.set((ue[0]+pe[0])/2,(ue[1]+pe[1])/2,pe[2]).transformMat4(se.worldTransform),se.near=0,se.far=-ue[2]+pe[2],isNaN(this.lightFrustumBias)?se.far*=4:se.far+=this.lightFrustumBias,se.left=ue[0],se.right=pe[0],se.top=pe[1],se.bottom=ue[1],se.update(!0),se}}(),_getSpotLightCamera:function(V){this._lightCameras.spot||(this._lightCameras.spot=new E.a);var C=this._lightCameras.spot;return C.fov=V.penumbraAngle*2,C.far=V.range,C.worldTransform.copy(V.worldTransform),C.updateProjectionMatrix(),P.invert(C.viewMatrix.array,C.worldTransform.array),C},dispose:function(V){var C=V.gl||V;this._frameBuffer&&this._frameBuffer.dispose(C);for(var M in this._textures)this._textures[M].dispose(C);this._texturePool.clear(V.gl),this._depthMaterials={},this._distanceMaterials={},this._textures={},this._lightCameras={},this._shadowMapNumber={POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},this._meshMaterials={};for(var H=0;H<this._receivers.length;H++){var $=this._receivers[H];if($.material&&$.material.shader){var q=$.material,se=q.shader;se.undefine("fragment","POINT_LIGHT_SHADOW_COUNT"),se.undefine("fragment","DIRECTIONAL_LIGHT_SHADOW_COUNT"),se.undefine("fragment","AMBIENT_LIGHT_SHADOW_COUNT"),q.set("shadowEnabled",0)}}this._opaqueCasters=[],this._receivers=[],this._lightsCastShadow=[]}});B.VSM=1,B.PCF=2,X.a=B},function(re,X,D){"use strict";var W=D(7),y={};function L(){this._pool={}}L.prototype.get=function(c){var u=c;if(this._pool[u])return this._pool[u];var f=y[c];if(!f){console.error('Shader "'+c+'" is not in the library');return}var i=new W.a(f.vertex,f.fragment);return this._pool[u]=i,i},L.prototype.clear=function(){this._pool={}};function A(c,u,f){y[c]={vertex:u,fragment:f}}var s=new L,x={createLibrary:function(){return new L},get:function(){return s.get.apply(s,arguments)},template:A,clear:function(){return s.clear()}}},function(re,X,D){"use strict";X.a=`@export clay.sm.depth.vertex
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
attribute vec3 position : POSITION;
|
|
#ifdef SHADOW_TRANSPARENT
|
|
attribute vec2 texcoord : TEXCOORD_0;
|
|
#endif
|
|
@import clay.chunk.skinning_header
|
|
varying vec4 v_ViewPosition;
|
|
#ifdef SHADOW_TRANSPARENT
|
|
varying vec2 v_Texcoord;
|
|
#endif
|
|
void main(){
|
|
vec3 skinnedPosition = position;
|
|
#ifdef SKINNING
|
|
@import clay.chunk.skin_matrix
|
|
skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;
|
|
#endif
|
|
v_ViewPosition = worldViewProjection * vec4(skinnedPosition, 1.0);
|
|
gl_Position = v_ViewPosition;
|
|
#ifdef SHADOW_TRANSPARENT
|
|
v_Texcoord = texcoord;
|
|
#endif
|
|
}
|
|
@end
|
|
@export clay.sm.depth.fragment
|
|
varying vec4 v_ViewPosition;
|
|
#ifdef SHADOW_TRANSPARENT
|
|
varying vec2 v_Texcoord;
|
|
#endif
|
|
uniform float bias : 0.001;
|
|
uniform float slopeScale : 1.0;
|
|
#ifdef SHADOW_TRANSPARENT
|
|
uniform sampler2D transparentMap;
|
|
#endif
|
|
@import clay.util.encode_float
|
|
void main(){
|
|
float depth = v_ViewPosition.z / v_ViewPosition.w;
|
|
#ifdef USE_VSM
|
|
depth = depth * 0.5 + 0.5;
|
|
float moment1 = depth;
|
|
float moment2 = depth * depth;
|
|
float dx = dFdx(depth);
|
|
float dy = dFdy(depth);
|
|
moment2 += 0.25*(dx*dx+dy*dy);
|
|
gl_FragColor = vec4(moment1, moment2, 0.0, 1.0);
|
|
#else
|
|
float dx = dFdx(depth);
|
|
float dy = dFdy(depth);
|
|
depth += sqrt(dx*dx + dy*dy) * slopeScale + bias;
|
|
#ifdef SHADOW_TRANSPARENT
|
|
if (texture2D(transparentMap, v_Texcoord).a <= 0.1) {
|
|
gl_FragColor = encodeFloat(0.9999);
|
|
return;
|
|
}
|
|
#endif
|
|
gl_FragColor = encodeFloat(depth * 0.5 + 0.5);
|
|
#endif
|
|
}
|
|
@end
|
|
@export clay.sm.debug_depth
|
|
uniform sampler2D depthMap;
|
|
varying vec2 v_Texcoord;
|
|
@import clay.util.decode_float
|
|
void main() {
|
|
vec4 tex = texture2D(depthMap, v_Texcoord);
|
|
#ifdef USE_VSM
|
|
gl_FragColor = vec4(tex.rgb, 1.0);
|
|
#else
|
|
float depth = decodeFloat(tex);
|
|
gl_FragColor = vec4(depth, depth, depth, 1.0);
|
|
#endif
|
|
}
|
|
@end
|
|
@export clay.sm.distance.vertex
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
uniform mat4 world : WORLD;
|
|
attribute vec3 position : POSITION;
|
|
@import clay.chunk.skinning_header
|
|
varying vec3 v_WorldPosition;
|
|
void main (){
|
|
vec3 skinnedPosition = position;
|
|
#ifdef SKINNING
|
|
@import clay.chunk.skin_matrix
|
|
skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;
|
|
#endif
|
|
gl_Position = worldViewProjection * vec4(skinnedPosition , 1.0);
|
|
v_WorldPosition = (world * vec4(skinnedPosition, 1.0)).xyz;
|
|
}
|
|
@end
|
|
@export clay.sm.distance.fragment
|
|
uniform vec3 lightPosition;
|
|
uniform float range : 100;
|
|
varying vec3 v_WorldPosition;
|
|
@import clay.util.encode_float
|
|
void main(){
|
|
float dist = distance(lightPosition, v_WorldPosition);
|
|
#ifdef USE_VSM
|
|
gl_FragColor = vec4(dist, dist * dist, 0.0, 0.0);
|
|
#else
|
|
dist = dist / range;
|
|
gl_FragColor = encodeFloat(dist);
|
|
#endif
|
|
}
|
|
@end
|
|
@export clay.plugin.shadow_map_common
|
|
@import clay.util.decode_float
|
|
float tapShadowMap(sampler2D map, vec2 uv, float z){
|
|
vec4 tex = texture2D(map, uv);
|
|
return step(z, decodeFloat(tex) * 2.0 - 1.0);
|
|
}
|
|
float pcf(sampler2D map, vec2 uv, float z, float textureSize, vec2 scale) {
|
|
float shadowContrib = tapShadowMap(map, uv, z);
|
|
vec2 offset = vec2(1.0 / textureSize) * scale;
|
|
#ifdef PCF_KERNEL_SIZE
|
|
for (int _idx_ = 0; _idx_ < PCF_KERNEL_SIZE; _idx_++) {{
|
|
shadowContrib += tapShadowMap(map, uv + offset * pcfKernel[_idx_], z);
|
|
}}
|
|
return shadowContrib / float(PCF_KERNEL_SIZE + 1);
|
|
#else
|
|
shadowContrib += tapShadowMap(map, uv+vec2(offset.x, 0.0), z);
|
|
shadowContrib += tapShadowMap(map, uv+vec2(offset.x, offset.y), z);
|
|
shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, offset.y), z);
|
|
shadowContrib += tapShadowMap(map, uv+vec2(0.0, offset.y), z);
|
|
shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, 0.0), z);
|
|
shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, -offset.y), z);
|
|
shadowContrib += tapShadowMap(map, uv+vec2(offset.x, -offset.y), z);
|
|
shadowContrib += tapShadowMap(map, uv+vec2(0.0, -offset.y), z);
|
|
return shadowContrib / 9.0;
|
|
#endif
|
|
}
|
|
float pcf(sampler2D map, vec2 uv, float z, float textureSize) {
|
|
return pcf(map, uv, z, textureSize, vec2(1.0));
|
|
}
|
|
float chebyshevUpperBound(vec2 moments, float z){
|
|
float p = 0.0;
|
|
z = z * 0.5 + 0.5;
|
|
if (z <= moments.x) {
|
|
p = 1.0;
|
|
}
|
|
float variance = moments.y - moments.x * moments.x;
|
|
variance = max(variance, 0.0000001);
|
|
float mD = moments.x - z;
|
|
float pMax = variance / (variance + mD * mD);
|
|
pMax = clamp((pMax-0.4)/(1.0-0.4), 0.0, 1.0);
|
|
return max(p, pMax);
|
|
}
|
|
float computeShadowContrib(
|
|
sampler2D map, mat4 lightVPM, vec3 position, float textureSize, vec2 scale, vec2 offset
|
|
) {
|
|
vec4 posInLightSpace = lightVPM * vec4(position, 1.0);
|
|
posInLightSpace.xyz /= posInLightSpace.w;
|
|
float z = posInLightSpace.z;
|
|
if(all(greaterThan(posInLightSpace.xyz, vec3(-0.99, -0.99, -1.0))) &&
|
|
all(lessThan(posInLightSpace.xyz, vec3(0.99, 0.99, 1.0)))){
|
|
vec2 uv = (posInLightSpace.xy+1.0) / 2.0;
|
|
#ifdef USE_VSM
|
|
vec2 moments = texture2D(map, uv * scale + offset).xy;
|
|
return chebyshevUpperBound(moments, z);
|
|
#else
|
|
return pcf(map, uv * scale + offset, z, textureSize, scale);
|
|
#endif
|
|
}
|
|
return 1.0;
|
|
}
|
|
float computeShadowContrib(sampler2D map, mat4 lightVPM, vec3 position, float textureSize) {
|
|
return computeShadowContrib(map, lightVPM, position, textureSize, vec2(1.0), vec2(0.0));
|
|
}
|
|
float computeShadowContribOmni(samplerCube map, vec3 direction, float range)
|
|
{
|
|
float dist = length(direction);
|
|
vec4 shadowTex = textureCube(map, direction);
|
|
#ifdef USE_VSM
|
|
vec2 moments = shadowTex.xy;
|
|
float variance = moments.y - moments.x * moments.x;
|
|
float mD = moments.x - dist;
|
|
float p = variance / (variance + mD * mD);
|
|
if(moments.x + 0.001 < dist){
|
|
return clamp(p, 0.0, 1.0);
|
|
}else{
|
|
return 1.0;
|
|
}
|
|
#else
|
|
return step(dist, (decodeFloat(shadowTex) + 0.0002) * range);
|
|
#endif
|
|
}
|
|
@end
|
|
@export clay.plugin.compute_shadow_map
|
|
#if defined(SPOT_LIGHT_SHADOWMAP_COUNT) || defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT) || defined(POINT_LIGHT_SHADOWMAP_COUNT)
|
|
#ifdef SPOT_LIGHT_SHADOWMAP_COUNT
|
|
uniform sampler2D spotLightShadowMaps[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
|
|
uniform mat4 spotLightMatrices[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
|
|
uniform float spotLightShadowMapSizes[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
|
|
#endif
|
|
#ifdef DIRECTIONAL_LIGHT_SHADOWMAP_COUNT
|
|
#if defined(SHADOW_CASCADE)
|
|
uniform sampler2D directionalLightShadowMaps[1]:unconfigurable;
|
|
uniform mat4 directionalLightMatrices[SHADOW_CASCADE]:unconfigurable;
|
|
uniform float directionalLightShadowMapSizes[1]:unconfigurable;
|
|
uniform float shadowCascadeClipsNear[SHADOW_CASCADE]:unconfigurable;
|
|
uniform float shadowCascadeClipsFar[SHADOW_CASCADE]:unconfigurable;
|
|
#else
|
|
uniform sampler2D directionalLightShadowMaps[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
|
|
uniform mat4 directionalLightMatrices[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
|
|
uniform float directionalLightShadowMapSizes[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
|
|
#endif
|
|
#endif
|
|
#ifdef POINT_LIGHT_SHADOWMAP_COUNT
|
|
uniform samplerCube pointLightShadowMaps[POINT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
|
|
#endif
|
|
uniform bool shadowEnabled : true;
|
|
#ifdef PCF_KERNEL_SIZE
|
|
uniform vec2 pcfKernel[PCF_KERNEL_SIZE];
|
|
#endif
|
|
@import clay.plugin.shadow_map_common
|
|
#if defined(SPOT_LIGHT_SHADOWMAP_COUNT)
|
|
void computeShadowOfSpotLights(vec3 position, inout float shadowContribs[SPOT_LIGHT_COUNT] ) {
|
|
float shadowContrib;
|
|
for(int _idx_ = 0; _idx_ < SPOT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{
|
|
shadowContrib = computeShadowContrib(
|
|
spotLightShadowMaps[_idx_], spotLightMatrices[_idx_], position,
|
|
spotLightShadowMapSizes[_idx_]
|
|
);
|
|
shadowContribs[_idx_] = shadowContrib;
|
|
}}
|
|
for(int _idx_ = SPOT_LIGHT_SHADOWMAP_COUNT; _idx_ < SPOT_LIGHT_COUNT; _idx_++){{
|
|
shadowContribs[_idx_] = 1.0;
|
|
}}
|
|
}
|
|
#endif
|
|
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
|
|
#ifdef SHADOW_CASCADE
|
|
void computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){
|
|
float depth = (2.0 * gl_FragCoord.z - gl_DepthRange.near - gl_DepthRange.far)
|
|
/ (gl_DepthRange.far - gl_DepthRange.near);
|
|
float shadowContrib;
|
|
shadowContribs[0] = 1.0;
|
|
for (int _idx_ = 0; _idx_ < SHADOW_CASCADE; _idx_++) {{
|
|
if (
|
|
depth >= shadowCascadeClipsNear[_idx_] &&
|
|
depth <= shadowCascadeClipsFar[_idx_]
|
|
) {
|
|
shadowContrib = computeShadowContrib(
|
|
directionalLightShadowMaps[0], directionalLightMatrices[_idx_], position,
|
|
directionalLightShadowMapSizes[0],
|
|
vec2(1.0 / float(SHADOW_CASCADE), 1.0),
|
|
vec2(float(_idx_) / float(SHADOW_CASCADE), 0.0)
|
|
);
|
|
shadowContribs[0] = shadowContrib;
|
|
}
|
|
}}
|
|
for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{
|
|
shadowContribs[_idx_] = 1.0;
|
|
}}
|
|
}
|
|
#else
|
|
void computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){
|
|
float shadowContrib;
|
|
for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_++) {{
|
|
shadowContrib = computeShadowContrib(
|
|
directionalLightShadowMaps[_idx_], directionalLightMatrices[_idx_], position,
|
|
directionalLightShadowMapSizes[_idx_]
|
|
);
|
|
shadowContribs[_idx_] = shadowContrib;
|
|
}}
|
|
for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{
|
|
shadowContribs[_idx_] = 1.0;
|
|
}}
|
|
}
|
|
#endif
|
|
#endif
|
|
#if defined(POINT_LIGHT_SHADOWMAP_COUNT)
|
|
void computeShadowOfPointLights(vec3 position, inout float shadowContribs[POINT_LIGHT_COUNT] ){
|
|
vec3 lightPosition;
|
|
vec3 direction;
|
|
for(int _idx_ = 0; _idx_ < POINT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{
|
|
lightPosition = pointLightPosition[_idx_];
|
|
direction = position - lightPosition;
|
|
shadowContribs[_idx_] = computeShadowContribOmni(pointLightShadowMaps[_idx_], direction, pointLightRange[_idx_]);
|
|
}}
|
|
for(int _idx_ = POINT_LIGHT_SHADOWMAP_COUNT; _idx_ < POINT_LIGHT_COUNT; _idx_++) {{
|
|
shadowContribs[_idx_] = 1.0;
|
|
}}
|
|
}
|
|
#endif
|
|
#endif
|
|
@end`},function(re,X,D){"use strict";var W=D(7),y=D(5),L=D(6),A=D(10),s=D(156),x=D(162),c=D(164),u=D(166),f=D(2),i=D(167),o=D(169),d=D(9),m=D(170),_=D(171),h=D(172),v=D(173),r=D(174),a=D(175),p=D(176),E=D(177),S=D(178),w=D(179),R=D(180),O=D(181);W.a.import(_.a),W.a.import(h.a),W.a.import(v.a),W.a.import(r.a),W.a.import(a.a),W.a.import(p.a),W.a.import(E.a),W.a.import(S.a),W.a.import(w.a),W.a.import(R.a),W.a.import(O.a);var z={color:{parameters:{width:function(F){return F.getWidth()},height:function(F){return F.getHeight()}}}},N=["composite","FXAA"];function P(){this._sourceTexture=new y.a({type:L.a.HALF_FLOAT}),this._depthTexture=new y.a({format:L.a.DEPTH_COMPONENT,type:L.a.UNSIGNED_INT}),this._framebuffer=new A.a,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,A.a.DEPTH_ATTACHMENT),this._normalPass=new i.a,this._compositor=Object(s.a)(m.a);var F=this._compositor.getNodeByName("source");F.texture=this._sourceTexture;var K=this._compositor.getNodeByName("coc");this._sourceNode=F,this._cocNode=K,this._compositeNode=this._compositor.getNodeByName("composite"),this._fxaaNode=this._compositor.getNodeByName("FXAA"),this._dofBlurNodes=["dof_far_blur","dof_near_blur","dof_coc_blur"].map(function(V){return this._compositor.getNodeByName(V)},this),this._dofBlurKernel=0,this._dofBlurKernelSize=new Float32Array(0),this._finalNodesChain=N.map(function(V){return this._compositor.getNodeByName(V)},this);var B={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new x.a(B),this._ssrPass=new c.a(B),this._edgePass=new o.a(B)}P.prototype.resize=function(V,C,B){B=B||1;var V=V*B,C=C*B,M=this._sourceTexture,H=this._depthTexture;M.width=V,M.height=C,H.width=V,H.height=C},P.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR},P.prototype._getPrevNode=function(F){for(var K=N.indexOf(F.name)-1,B=this._finalNodesChain[K];B&&!this._compositor.getNodeByName(B.name);)K-=1,B=this._finalNodesChain[K];return B},P.prototype._getNextNode=function(F){for(var K=N.indexOf(F.name)+1,B=this._finalNodesChain[K];B&&!this._compositor.getNodeByName(B.name);)K+=1,B=this._finalNodesChain[K];return B},P.prototype._addChainNode=function(F){var K=this._getPrevNode(F),B=this._getNextNode(F);K&&(K.outputs=z,F.inputs.texture=K.name,B?(F.outputs=z,B.inputs.texture=F.name):F.outputs=null,this._compositor.addNode(F))},P.prototype._removeChainNode=function(F){var K=this._getPrevNode(F),B=this._getNextNode(F);K&&(B?(K.outputs=z,B.inputs.texture=K.name):K.outputs=null,this._compositor.removeNode(F))},P.prototype.updateNormal=function(F,K,B,V){this._ifRenderNormalPass()&&this._normalPass.update(F,K,B)},P.prototype.updateSSAO=function(F,K,B,V){this._ssaoPass.update(F,B,V)},P.prototype.enableSSAO=function(){this._enableSSAO=!0},P.prototype.disableSSAO=function(){this._enableSSAO=!1},P.prototype.enableSSR=function(){this._enableSSR=!0},P.prototype.disableSSR=function(){this._enableSSR=!1},P.prototype.getSSAOTexture=function(F,K,B,V){return this._ssaoPass.getTargetTexture()},P.prototype.getSourceFrameBuffer=function(){return this._framebuffer},P.prototype.getSourceTexture=function(){return this._sourceTexture},P.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)},P.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)},P.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()},P.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()},P.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()},P.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()},P.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0},P.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1},P.prototype.enableEdge=function(){this._enableEdge=!0},P.prototype.disableEdge=function(){this._enableEdge=!1},P.prototype.setBloomIntensity=function(F){this._compositeNode.setParameter("bloomIntensity",F)},P.prototype.setSSAOParameter=function(F,K){switch(F){case"quality":var B={low:6,medium:12,high:32,ultra:62}[K]||12;this._ssaoPass.setParameter("kernelSize",B);break;case"radius":this._ssaoPass.setParameter(F,K),this._ssaoPass.setParameter("bias",K/200);break;case"intensity":this._ssaoPass.setParameter(F,K);break;default:console.warn("Unkown SSAO parameter "+F)}},P.prototype.setDOFParameter=function(F,K){switch(F){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(F,K);break;case"blurRadius":for(var B=0;B<this._dofBlurNodes.length;B++)this._dofBlurNodes[B].setParameter("blurRadius",K);break;case"quality":var V={low:4,medium:8,high:16,ultra:32}[K]||8;this._dofBlurKernelSize=V;for(var B=0;B<this._dofBlurNodes.length;B++)this._dofBlurNodes[B].pass.material.define("POISSON_KERNEL_SIZE",V);this._dofBlurKernel=new Float32Array(V*2);break;default:console.warn("Unkown DOF parameter "+F)}},P.prototype.setSSRParameter=function(F,K){switch(F){case"quality":var B={low:10,medium:20,high:40,ultra:80}[K]||20,V={low:32,medium:16,high:8,ultra:4}[K]||16;this._ssrPass.setParameter("maxIteration",B),this._ssrPass.setParameter("pixelStride",V);break;case"maxRoughness":this._ssrPass.setParameter("minGlossiness",Math.max(Math.min(1-K,1),0));break;default:console.warn("Unkown SSR parameter "+F)}},P.prototype.setEdgeColor=function(F){var K=f.a.parseColor(F);this._edgePass.setParameter("edgeColor",K)},P.prototype.setExposure=function(F){this._compositeNode.setParameter("exposure",Math.pow(2,F))},P.prototype.setColorLookupTexture=function(F,K){this._compositeNode.pass.material.setTextureImage("lut",this._enableColorCorrection?F:"none",K,{minFilter:f.a.Texture.NEAREST,magFilter:f.a.Texture.NEAREST,flipY:!1})},P.prototype.setColorCorrection=function(F,K){this._compositeNode.setParameter(F,K)},P.prototype.composite=function(F,K,B,V){var C=this._sourceTexture,M=C;this._enableEdge&&(this._edgePass.update(F,K,C,V),C=M=this._edgePass.getTargetTexture()),this._enableSSR&&(this._ssrPass.update(F,K,C,V),M=this._ssrPass.getTargetTexture(),this._ssrPass.setSSAOTexture(this._enableSSAO?this._ssaoPass.getTargetTexture():null)),this._sourceNode.texture=M,this._cocNode.setParameter("depth",this._depthTexture);for(var H=this._dofBlurKernel,$=this._dofBlurKernelSize,q=Math.floor(u.a.length/2/$),se=V%q,ue=0;ue<$*2;ue++)H[ue]=u.a[ue+se*$*2];for(var ue=0;ue<this._dofBlurNodes.length;ue++)this._dofBlurNodes[ue].setParameter("percent",V/30),this._dofBlurNodes[ue].setParameter("poissonKernel",H);this._cocNode.setParameter("zNear",K.near),this._cocNode.setParameter("zFar",K.far),this._compositor.render(F,B)},P.prototype.dispose=function(F){this._sourceTexture.dispose(F),this._depthTexture.dispose(F),this._framebuffer.dispose(F),this._compositor.dispose(F),this._normalPass.dispose(F),this._ssaoPass.dispose(F)},X.a=P},function(re,X,D){"use strict";var W=D(21),y=D(157),L=D(159),A=D(160),s=D(161),x=D(7),c=D(6),u=D(5),f=D(25),i=/^#source\((.*?)\)/;function o(a,p){var E=new y.a;p=p||{};var S={textures:{},parameters:{}},w=function(z,N){for(var P=0;P<a.nodes.length;P++){var F=a.nodes[P],K=d(F,S,p);K&&E.addNode(K)}};for(var R in a.parameters){var O=a.parameters[R];S.parameters[R]=m(O)}return _(a,S,p,function(z){S.textures=z,w()}),E}function d(a,p,E){var S=a.type||"filter",w,R,O;if(S==="filter"){var z=a.shader.trim(),N=i.exec(z);if(N?w=x.a.source(N[1].trim()):z.charAt(0)==="#"&&(w=p.shaders[z.substr(1)]),w||(w=z),!w)return}if(a.inputs){R={};for(var P in a.inputs)typeof a.inputs[P]=="string"?R[P]=a.inputs[P]:R[P]={node:a.inputs[P].node,pin:a.inputs[P].pin}}if(a.outputs){O={};for(var P in a.outputs){var F=a.outputs[P];O[P]={},F.attachment!=null&&(O[P].attachment=F.attachment),F.keepLastFrame!=null&&(O[P].keepLastFrame=F.keepLastFrame),F.outputLastFrame!=null&&(O[P].outputLastFrame=F.outputLastFrame),F.parameters&&(O[P].parameters=m(F.parameters))}}var K;if(S==="scene"?K=new L.a({name:a.name,scene:E.scene,camera:E.camera,outputs:O}):S==="texture"?K=new A.a({name:a.name,outputs:O}):K=new s.a({name:a.name,shader:w,inputs:R,outputs:O}),K){if(a.parameters)for(var P in a.parameters){var B=a.parameters[P];typeof B=="string"&&(B=B.trim(),B.charAt(0)==="#"?B=p.textures[B.substr(1)]:K.on("beforerender",h(P,r(B)))),K.setParameter(P,B)}if(a.defines&&K.pass)for(var P in a.defines){var B=a.defines[P];K.pass.material.define("fragment",P,B)}}return K}function m(a){var p={};return a&&(["type","minFilter","magFilter","wrapS","wrapT","flipY","useMipmap"].forEach(function(E){var S=a[E];S!=null&&(typeof S=="string"&&(S=c.a[S]),p[E]=S)}),["width","height"].forEach(function(E){if(a[E]!=null){var S=a[E];typeof S=="string"?(S=S.trim(),p[E]=v(E,r(S))):p[E]=S}}),a.useMipmap!=null&&(p.useMipmap=a.useMipmap)),p}function _(a,p,E,S){if(!a.textures){S({});return}var w={},R=0,O=!1,z=E.textureRootPath;W.a.each(a.textures,function(N,P){var F,K=N.path,B=m(N.parameters);if(Array.isArray(K)&&K.length===6)z&&(K=K.map(function(V){return W.a.relative2absolute(V,z)})),F=new f.a(B);else if(typeof K=="string")z&&(K=W.a.relative2absolute(K,z)),F=new u.a(B);else return;F.load(K),R++,F.once("success",function(){w[P]=F,R--,R===0&&(S(w),O=!0)})}),R===0&&!O&&S(w)}function h(a,p){return function(E){var S=E.getDevicePixelRatio(),w=E.getWidth(),R=E.getHeight(),O=p(w,R,S);this.setParameter(a,O)}}function v(a,p){return function(E){var S=E.getDevicePixelRatio(),w=E.getWidth(),R=E.getHeight();return p(w,R,S)}}function r(a){var p=/^expr\((.*)\)$/.exec(a);if(p)try{var E=new Function("width","height","dpr","return "+p[1]);return E(1,1),E}catch(S){throw new Error("Invalid expression.")}}X.a=o},function(re,X,D){"use strict";var W=D(158),y=D(79),L=D(10),A=W.a.extend(function(){return{_outputs:[],_texturePool:new y.a,_frameBuffer:new L.a({depthBuffer:!1})}},{addNode:function(s){W.a.prototype.addNode.call(this,s),s._compositor=this},render:function(s,x){if(this._dirty){this.update(),this._dirty=!1,this._outputs.length=0;for(var c=0;c<this.nodes.length;c++)this.nodes[c].outputs||this._outputs.push(this.nodes[c])}for(var c=0;c<this.nodes.length;c++)this.nodes[c].beforeFrame();for(var c=0;c<this._outputs.length;c++)this._outputs[c].updateReference();for(var c=0;c<this._outputs.length;c++)this._outputs[c].render(s,x);for(var c=0;c<this.nodes.length;c++)this.nodes[c].afterFrame()},allocateTexture:function(s){return this._texturePool.get(s)},releaseTexture:function(s){this._texturePool.put(s)},getFrameBuffer:function(){return this._frameBuffer},dispose:function(s){this._texturePool.clear(s)}});X.a=A},function(re,X,D){"use strict";var W=D(8),y=D(42),L=W.a.extend(function(){return{nodes:[]}},{dirty:function(){this._dirty=!0},addNode:function(A){this.nodes.indexOf(A)>=0||(this.nodes.push(A),this._dirty=!0)},removeNode:function(A){typeof A=="string"&&(A=this.getNodeByName(A));var s=this.nodes.indexOf(A);s>=0&&(this.nodes.splice(s,1),this._dirty=!0)},getNodeByName:function(A){for(var s=0;s<this.nodes.length;s++)if(this.nodes[s].name===A)return this.nodes[s]},update:function(){for(var A=0;A<this.nodes.length;A++)this.nodes[A].clear();for(var A=0;A<this.nodes.length;A++){var s=this.nodes[A];if(s.inputs){for(var x in s.inputs)if(s.inputs[x]){if(s.pass&&!s.pass.material.isUniformEnabled(x)){console.warn("Pin "+s.name+"."+x+" not used.");continue}var c=s.inputs[x],u=this.findPin(c);u?s.link(x,u.node,u.pin):console.warn(typeof c=="string"?"Node "+c+" not exist":"Pin of "+c.node+"."+c.pin+" not exist")}}}},findPin:function(A){var s;if((typeof A=="string"||A instanceof y.a)&&(A={node:A}),typeof A.node=="string")for(var x=0;x<this.nodes.length;x++){var c=this.nodes[x];c.name===A.node&&(s=c)}else s=A.node;if(s){var u=A.pin;if(u||s.outputs&&(u=Object.keys(s.outputs)[0]),s.outputs[u])return{node:s,pin:u}}}});X.a=L},function(re,X,D){"use strict";var W=D(42),y=D(11),L=D(10),A=W.a.extend({name:"scene",scene:null,camera:null,autoUpdateScene:!0,preZ:!1},function(){this.frameBuffer=new L.a},{render:function(s){this._rendering=!0;var x=s.gl;this.trigger("beforerender");var c;if(!this.outputs)c=s.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ);else{var u=this.frameBuffer;for(var f in this.outputs){var i=this.updateParameter(f,s),o=this.outputs[f],d=this._compositor.allocateTexture(i);this._outputTextures[f]=d;var m=o.attachment||x.COLOR_ATTACHMENT0;typeof m=="string"&&(m=x[m]),u.attach(d,m)}u.bind(s);var _=s.getGLExtension("EXT_draw_buffers");if(_){var h=[];for(var m in this.outputs)m=parseInt(m),m>=x.COLOR_ATTACHMENT0&&m<=x.COLOR_ATTACHMENT0+8&&h.push(m);_.drawBuffersEXT(h)}s.saveClear(),s.clearBit=y.a.DEPTH_BUFFER_BIT|y.a.COLOR_BUFFER_BIT,c=s.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),s.restoreClear(),u.unbind(s)}this.trigger("afterrender",c),this._rendering=!1,this._rendered=!0}});X.a=A},function(re,X,D){"use strict";var W=D(42),y=W.a.extend(function(){return{texture:null,outputs:{color:{}}}},function(){},{getOutput:function(L,A){return this.texture},beforeFrame:function(){},afterFrame:function(){}});X.a=y},function(re,X,D){"use strict";var W=D(14),y=D(42),L=y.a.extend(function(){return{name:"",inputs:{},outputs:null,shader:"",inputLinks:{},outputLinks:{},pass:null,_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}},function(){var A=new W.a({fragment:this.shader});this.pass=A},{render:function(A,s){this.trigger("beforerender",A),this._rendering=!0;var x=A.gl;for(var c in this.inputLinks){var u=this.inputLinks[c],f=u.node.getOutput(A,u.pin);this.pass.setUniform(c,f)}if(!this.outputs)this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(A),this.pass.render(A,s);else{this.pass.outputs={};var i={};for(var o in this.outputs){var d=this.updateParameter(o,A);isNaN(d.width)&&this.updateParameter(o,A);var m=this.outputs[o],_=this._compositor.allocateTexture(d);this._outputTextures[o]=_;var h=m.attachment||x.COLOR_ATTACHMENT0;typeof h=="string"&&(h=x[h]),i[h]=_}this._compositor.getFrameBuffer().bind(A);for(var h in i)this._compositor.getFrameBuffer().attach(i[h],h);this.pass.render(A),this._compositor.getFrameBuffer().updateMipmap(A.gl)}for(var c in this.inputLinks){var u=this.inputLinks[c];u.node.removeReference(u.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",A)},updateParameter:function(A,s){var x=this.outputs[A],c=x.parameters,u=x._parametersCopy;if(u||(u=x._parametersCopy={}),c)for(var f in c)f!=="width"&&f!=="height"&&(u[f]=c[f]);var i,o;return c.width instanceof Function?i=c.width.call(this,s):i=c.width,c.height instanceof Function?o=c.height.call(this,s):o=c.height,(u.width!==i||u.height!==o)&&this._outputTextures[A]&&this._outputTextures[A].dispose(s),u.width=i,u.height=o,u},setParameter:function(A,s){this.pass.setUniform(A,s)},getParameter:function(A){return this.pass.getUniform(A)},setParameters:function(A){for(var s in A)this.setParameter(s,A[s])},define:function(A,s){this.pass.material.define("fragment",A,s)},undefine:function(A){this.pass.material.undefine("fragment",A)},removeReference:function(A){if(this._outputReferences[A]--,this._outputReferences[A]===0){var s=this.outputs[A];s.keepLastFrame?(this._prevOutputTextures[A]&&this._compositor.releaseTexture(this._prevOutputTextures[A]),this._prevOutputTextures[A]=this._outputTextures[A]):this._compositor.releaseTexture(this._outputTextures[A])}},clear:function(){y.a.prototype.clear.call(this),this.pass.material.disableTexturesAll()}});X.a=L},function(re,X,D){"use strict";var W=D(9),y=D(4),L=D(5),A=D(6),s=D(14),x=D(7),c=D(10),u=D(43),f=D(163);x.a.import(f.a);function i(_){for(var h=new Uint8Array(_*_*4),v=0,r=new y.a,a=0;a<_;a++)for(var p=0;p<_;p++)r.set(Math.random()*2-1,Math.random()*2-1,0).normalize(),h[v++]=(r.x*.5+.5)*255,h[v++]=(r.y*.5+.5)*255,h[v++]=0,h[v++]=255;return h}function o(_){return new L.a({pixels:i(_),wrapS:A.a.REPEAT,wrapT:A.a.REPEAT,width:_,height:_})}function d(_,h,v){var r=new Float32Array(_*3);h=h||0;for(var a=0;a<_;a++){var p=Object(u.a)(a+h,2)*(v?1:2)*Math.PI,E=Object(u.a)(a+h,3)*Math.PI,S=Math.random(),w=Math.cos(p)*Math.sin(E)*S,R=Math.cos(E)*S,O=Math.sin(p)*Math.sin(E)*S;r[a*3]=w,r[a*3+1]=R,r[a*3+2]=O}return r}function m(_){_=_||{},this._ssaoPass=new s.a({fragment:x.a.source("ecgl.ssao.estimate")}),this._blurPass=new s.a({fragment:x.a.source("ecgl.ssao.blur")}),this._framebuffer=new c.a({depthBuffer:!1}),this._ssaoTexture=new L.a,this._blurTexture=new L.a,this._blurTexture2=new L.a,this._depthTex=_.depthTexture,this._normalTex=_.normalTexture,this.setNoiseSize(4),this.setKernelSize(_.kernelSize||12),_.radius!=null&&this.setParameter("radius",_.radius),_.power!=null&&this.setParameter("power",_.power),this._normalTex||(this._ssaoPass.material.disableTexture("normalTex"),this._blurPass.material.disableTexture("normalTex")),this._depthTex||this._blurPass.material.disableTexture("depthTex"),this._blurPass.material.setUniform("normalTex",this._normalTex),this._blurPass.material.setUniform("depthTex",this._depthTex)}m.prototype.setDepthTexture=function(_){this._depthTex=_},m.prototype.setNormalTexture=function(_){this._normalTex=_,this._ssaoPass.material[_?"enableTexture":"disableTexture"]("normalTex"),this.setKernelSize(this._kernelSize)},m.prototype.update=function(_,h,v){var r=_.getWidth(),a=_.getHeight(),p=this._ssaoPass,E=this._blurPass;p.setUniform("kernel",this._kernels[v%this._kernels.length]),p.setUniform("depthTex",this._depthTex),this._normalTex!=null&&p.setUniform("normalTex",this._normalTex),p.setUniform("depthTexSize",[this._depthTex.width,this._depthTex.height]);var S=new W.a;W.a.transpose(S,h.worldTransform),p.setUniform("projection",h.projectionMatrix.array),p.setUniform("projectionInv",h.invProjectionMatrix.array),p.setUniform("viewInverseTranspose",S.array);var w=this._ssaoTexture,R=this._blurTexture,O=this._blurTexture2;w.width=r/2,w.height=a/2,R.width=r,R.height=a,O.width=r,O.height=a,this._framebuffer.attach(w),this._framebuffer.bind(_),_.gl.clearColor(1,1,1,1),_.gl.clear(_.gl.COLOR_BUFFER_BIT),p.render(_),E.setUniform("textureSize",[r/2,a/2]),E.setUniform("projection",h.projectionMatrix.array),this._framebuffer.attach(R),E.setUniform("direction",0),E.setUniform("ssaoTexture",w),E.render(_),this._framebuffer.attach(O),E.setUniform("textureSize",[r,a]),E.setUniform("direction",1),E.setUniform("ssaoTexture",R),E.render(_),this._framebuffer.unbind(_);var z=_.clearColor;_.gl.clearColor(z[0],z[1],z[2],z[3])},m.prototype.getTargetTexture=function(){return this._blurTexture2},m.prototype.setParameter=function(_,h){_==="noiseTexSize"?this.setNoiseSize(h):_==="kernelSize"?this.setKernelSize(h):_==="intensity"?this._ssaoPass.material.set("intensity",h):this._ssaoPass.setUniform(_,h)},m.prototype.setKernelSize=function(_){this._kernelSize=_,this._ssaoPass.material.define("fragment","KERNEL_SIZE",_),this._kernels=this._kernels||[];for(var h=0;h<30;h++)this._kernels[h]=d(_,h*_,!!this._normalTex)},m.prototype.setNoiseSize=function(_){var h=this._ssaoPass.getUniform("noiseTex");h?(h.data=i(_),h.width=h.height=_,h.dirty()):(h=o(_),this._ssaoPass.setUniform("noiseTex",o(_))),this._ssaoPass.setUniform("noiseTexSize",[_,_])},m.prototype.dispose=function(_){this._blurTexture.dispose(_),this._ssaoTexture.dispose(_),this._blurTexture2.dispose(_)},X.a=m},function(re,X,D){"use strict";X.a=`@export ecgl.ssao.estimate
|
|
|
|
uniform sampler2D depthTex;
|
|
|
|
uniform sampler2D normalTex;
|
|
|
|
uniform sampler2D noiseTex;
|
|
|
|
uniform vec2 depthTexSize;
|
|
|
|
uniform vec2 noiseTexSize;
|
|
|
|
uniform mat4 projection;
|
|
|
|
uniform mat4 projectionInv;
|
|
|
|
uniform mat4 viewInverseTranspose;
|
|
|
|
uniform vec3 kernel[KERNEL_SIZE];
|
|
|
|
uniform float radius : 1;
|
|
|
|
uniform float power : 1;
|
|
|
|
uniform float bias: 1e-2;
|
|
|
|
uniform float intensity: 1.0;
|
|
|
|
varying vec2 v_Texcoord;
|
|
|
|
float ssaoEstimator(in vec3 originPos, in mat3 kernelBasis) {
|
|
float occlusion = 0.0;
|
|
|
|
for (int i = 0; i < KERNEL_SIZE; i++) {
|
|
vec3 samplePos = kernel[i];
|
|
#ifdef NORMALTEX_ENABLED
|
|
samplePos = kernelBasis * samplePos;
|
|
#endif
|
|
samplePos = samplePos * radius + originPos;
|
|
|
|
vec4 texCoord = projection * vec4(samplePos, 1.0);
|
|
texCoord.xy /= texCoord.w;
|
|
|
|
vec4 depthTexel = texture2D(depthTex, texCoord.xy * 0.5 + 0.5);
|
|
|
|
float sampleDepth = depthTexel.r * 2.0 - 1.0;
|
|
if (projection[3][3] == 0.0) {
|
|
sampleDepth = projection[3][2] / (sampleDepth * projection[2][3] - projection[2][2]);
|
|
}
|
|
else {
|
|
sampleDepth = (sampleDepth - projection[3][2]) / projection[2][2];
|
|
}
|
|
|
|
float rangeCheck = smoothstep(0.0, 1.0, radius / abs(originPos.z - sampleDepth));
|
|
occlusion += rangeCheck * step(samplePos.z, sampleDepth - bias);
|
|
}
|
|
#ifdef NORMALTEX_ENABLED
|
|
occlusion = 1.0 - occlusion / float(KERNEL_SIZE);
|
|
#else
|
|
occlusion = 1.0 - clamp((occlusion / float(KERNEL_SIZE) - 0.6) * 2.5, 0.0, 1.0);
|
|
#endif
|
|
return pow(occlusion, power);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
|
|
vec4 depthTexel = texture2D(depthTex, v_Texcoord);
|
|
|
|
#ifdef NORMALTEX_ENABLED
|
|
vec4 tex = texture2D(normalTex, v_Texcoord);
|
|
if (dot(tex.rgb, tex.rgb) == 0.0) {
|
|
gl_FragColor = vec4(1.0);
|
|
return;
|
|
}
|
|
vec3 N = tex.rgb * 2.0 - 1.0;
|
|
N = (viewInverseTranspose * vec4(N, 0.0)).xyz;
|
|
|
|
vec2 noiseTexCoord = depthTexSize / vec2(noiseTexSize) * v_Texcoord;
|
|
vec3 rvec = texture2D(noiseTex, noiseTexCoord).rgb * 2.0 - 1.0;
|
|
vec3 T = normalize(rvec - N * dot(rvec, N));
|
|
vec3 BT = normalize(cross(N, T));
|
|
mat3 kernelBasis = mat3(T, BT, N);
|
|
#else
|
|
if (depthTexel.r > 0.99999) {
|
|
gl_FragColor = vec4(1.0);
|
|
return;
|
|
}
|
|
mat3 kernelBasis;
|
|
#endif
|
|
|
|
float z = depthTexel.r * 2.0 - 1.0;
|
|
|
|
vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);
|
|
vec4 p4 = projectionInv * projectedPos;
|
|
|
|
vec3 position = p4.xyz / p4.w;
|
|
|
|
float ao = ssaoEstimator(position, kernelBasis);
|
|
ao = clamp(1.0 - (1.0 - ao) * intensity, 0.0, 1.0);
|
|
gl_FragColor = vec4(vec3(ao), 1.0);
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
@export ecgl.ssao.blur
|
|
#define SHADER_NAME SSAO_BLUR
|
|
|
|
uniform sampler2D ssaoTexture;
|
|
|
|
#ifdef NORMALTEX_ENABLED
|
|
uniform sampler2D normalTex;
|
|
#endif
|
|
|
|
varying vec2 v_Texcoord;
|
|
|
|
uniform vec2 textureSize;
|
|
uniform float blurSize : 1.0;
|
|
|
|
uniform int direction: 0.0;
|
|
|
|
#ifdef DEPTHTEX_ENABLED
|
|
uniform sampler2D depthTex;
|
|
uniform mat4 projection;
|
|
uniform float depthRange : 0.5;
|
|
|
|
float getLinearDepth(vec2 coord)
|
|
{
|
|
float depth = texture2D(depthTex, coord).r * 2.0 - 1.0;
|
|
return projection[3][2] / (depth * projection[2][3] - projection[2][2]);
|
|
}
|
|
#endif
|
|
|
|
void main()
|
|
{
|
|
float kernel[5];
|
|
kernel[0] = 0.122581;
|
|
kernel[1] = 0.233062;
|
|
kernel[2] = 0.288713;
|
|
kernel[3] = 0.233062;
|
|
kernel[4] = 0.122581;
|
|
|
|
vec2 off = vec2(0.0);
|
|
if (direction == 0) {
|
|
off[0] = blurSize / textureSize.x;
|
|
}
|
|
else {
|
|
off[1] = blurSize / textureSize.y;
|
|
}
|
|
|
|
vec2 coord = v_Texcoord;
|
|
|
|
float sum = 0.0;
|
|
float weightAll = 0.0;
|
|
|
|
#ifdef NORMALTEX_ENABLED
|
|
vec3 centerNormal = texture2D(normalTex, v_Texcoord).rgb * 2.0 - 1.0;
|
|
#endif
|
|
#if defined(DEPTHTEX_ENABLED)
|
|
float centerDepth = getLinearDepth(v_Texcoord);
|
|
#endif
|
|
|
|
for (int i = 0; i < 5; i++) {
|
|
vec2 coord = clamp(v_Texcoord + vec2(float(i) - 2.0) * off, vec2(0.0), vec2(1.0));
|
|
|
|
float w = kernel[i];
|
|
#ifdef NORMALTEX_ENABLED
|
|
vec3 normal = texture2D(normalTex, coord).rgb * 2.0 - 1.0;
|
|
w *= clamp(dot(normal, centerNormal), 0.0, 1.0);
|
|
#endif
|
|
#ifdef DEPTHTEX_ENABLED
|
|
float d = getLinearDepth(coord);
|
|
w *= (1.0 - smoothstep(abs(centerDepth - d) / depthRange, 0.0, 1.0));
|
|
#endif
|
|
|
|
weightAll += w;
|
|
sum += texture2D(ssaoTexture, coord).r * w;
|
|
}
|
|
|
|
gl_FragColor = vec4(vec3(sum / weightAll), 1.0);
|
|
}
|
|
|
|
@end
|
|
`},function(re,X,D){"use strict";var W=D(9),y=D(4),L=D(5),A=D(6),s=D(14),x=D(7),c=D(10),u=D(43),f=D(165);x.a.import(f.a);function i(o){o=o||{},this._ssrPass=new s.a({fragment:x.a.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new s.a({fragment:x.a.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new s.a({fragment:x.a.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._ssrPass.setUniform("gBufferTexture1",o.normalTexture),this._ssrPass.setUniform("gBufferTexture2",o.depthTexture),this._blurPass1.setUniform("gBufferTexture1",o.normalTexture),this._blurPass1.setUniform("gBufferTexture2",o.depthTexture),this._blurPass2.setUniform("gBufferTexture1",o.normalTexture),this._blurPass2.setUniform("gBufferTexture2",o.depthTexture),this._blurPass2.material.define("fragment","VERTICAL"),this._blurPass2.material.define("fragment","BLEND"),this._texture1=new L.a({type:A.a.HALF_FLOAT}),this._texture2=new L.a({type:A.a.HALF_FLOAT}),this._texture3=new L.a({type:A.a.HALF_FLOAT}),this._frameBuffer=new c.a({depthBuffer:!1})}i.prototype.update=function(o,d,m,_){var h=o.getWidth(),v=o.getHeight(),r=o.getDevicePixelRatio(),a=this._texture1,p=this._texture2,E=this._texture3;p.width=h/2,p.height=v/2,a.width=h,a.height=v,E.width=h*r,E.height=v*r;var S=this._frameBuffer,w=this._ssrPass,R=this._blurPass1,O=this._blurPass2,z=new W.a;W.a.transpose(z,d.worldTransform),w.setUniform("sourceTexture",m),w.setUniform("projection",d.projectionMatrix.array),w.setUniform("projectionInv",d.invProjectionMatrix.array),w.setUniform("viewInverseTranspose",z.array),w.setUniform("nearZ",d.near),w.setUniform("jitterOffset",_/30),R.setUniform("textureSize",[h/2,v/2]),O.setUniform("textureSize",[h,v]),O.setUniform("sourceTexture",m),R.setUniform("projection",d.projectionMatrix.array),O.setUniform("projection",d.projectionMatrix.array),S.attach(a),S.bind(o),w.render(o),S.attach(p),R.setUniform("texture",a),R.render(o),S.attach(E),O.setUniform("texture",p),O.render(o),S.unbind(o)},i.prototype.getTargetTexture=function(){return this._texture3},i.prototype.setParameter=function(o,d){o==="maxIteration"?this._ssrPass.material.define("fragment","MAX_ITERATION",d):this._ssrPass.setUniform(o,d)},i.prototype.setSSAOTexture=function(o){var d=this._blurPass2;o?(d.material.enableTexture("ssaoTex"),d.material.set("ssaoTex",o)):d.material.disableTexture("ssaoTex")},i.prototype.dispose=function(o){this._texture1.dispose(o),this._texture2.dispose(o),this._texture3.dispose(o),this._frameBuffer.dispose(o)},X.a=i},function(re,X,D){"use strict";X.a=`@export ecgl.ssr.main
|
|
|
|
#define MAX_ITERATION 20;
|
|
|
|
uniform sampler2D sourceTexture;
|
|
uniform sampler2D gBufferTexture1;
|
|
uniform sampler2D gBufferTexture2;
|
|
|
|
uniform mat4 projection;
|
|
uniform mat4 projectionInv;
|
|
uniform mat4 viewInverseTranspose;
|
|
|
|
uniform float maxRayDistance: 50;
|
|
|
|
uniform float pixelStride: 16;
|
|
uniform float pixelStrideZCutoff: 50;
|
|
uniform float screenEdgeFadeStart: 0.9;
|
|
uniform float eyeFadeStart : 0.2; uniform float eyeFadeEnd: 0.8;
|
|
uniform float minGlossiness: 0.2; uniform float zThicknessThreshold: 10;
|
|
|
|
uniform float nearZ;
|
|
uniform vec2 viewportSize : VIEWPORT_SIZE;
|
|
|
|
uniform float jitterOffset: 0;
|
|
|
|
varying vec2 v_Texcoord;
|
|
|
|
#ifdef DEPTH_DECODE
|
|
@import clay.util.decode_float
|
|
#endif
|
|
|
|
float fetchDepth(sampler2D depthTexture, vec2 uv)
|
|
{
|
|
vec4 depthTexel = texture2D(depthTexture, uv);
|
|
return depthTexel.r * 2.0 - 1.0;
|
|
}
|
|
|
|
float linearDepth(float depth)
|
|
{
|
|
if (projection[3][3] == 0.0) {
|
|
return projection[3][2] / (depth * projection[2][3] - projection[2][2]);
|
|
}
|
|
else {
|
|
return (depth - projection[3][2]) / projection[2][2];
|
|
}
|
|
}
|
|
|
|
bool rayIntersectDepth(float rayZNear, float rayZFar, vec2 hitPixel)
|
|
{
|
|
if (rayZFar > rayZNear)
|
|
{
|
|
float t = rayZFar; rayZFar = rayZNear; rayZNear = t;
|
|
}
|
|
float cameraZ = linearDepth(fetchDepth(gBufferTexture2, hitPixel));
|
|
return rayZFar <= cameraZ && rayZNear >= cameraZ - zThicknessThreshold;
|
|
}
|
|
|
|
|
|
bool traceScreenSpaceRay(
|
|
vec3 rayOrigin, vec3 rayDir, float jitter,
|
|
out vec2 hitPixel, out vec3 hitPoint, out float iterationCount
|
|
)
|
|
{
|
|
float rayLength = ((rayOrigin.z + rayDir.z * maxRayDistance) > -nearZ)
|
|
? (-nearZ - rayOrigin.z) / rayDir.z : maxRayDistance;
|
|
|
|
vec3 rayEnd = rayOrigin + rayDir * rayLength;
|
|
|
|
vec4 H0 = projection * vec4(rayOrigin, 1.0);
|
|
vec4 H1 = projection * vec4(rayEnd, 1.0);
|
|
|
|
float k0 = 1.0 / H0.w, k1 = 1.0 / H1.w;
|
|
|
|
vec3 Q0 = rayOrigin * k0, Q1 = rayEnd * k1;
|
|
|
|
vec2 P0 = (H0.xy * k0 * 0.5 + 0.5) * viewportSize;
|
|
vec2 P1 = (H1.xy * k1 * 0.5 + 0.5) * viewportSize;
|
|
|
|
P1 += dot(P1 - P0, P1 - P0) < 0.0001 ? 0.01 : 0.0;
|
|
vec2 delta = P1 - P0;
|
|
|
|
bool permute = false;
|
|
if (abs(delta.x) < abs(delta.y)) {
|
|
permute = true;
|
|
delta = delta.yx;
|
|
P0 = P0.yx;
|
|
P1 = P1.yx;
|
|
}
|
|
float stepDir = sign(delta.x);
|
|
float invdx = stepDir / delta.x;
|
|
|
|
vec3 dQ = (Q1 - Q0) * invdx;
|
|
float dk = (k1 - k0) * invdx;
|
|
|
|
vec2 dP = vec2(stepDir, delta.y * invdx);
|
|
|
|
float strideScaler = 1.0 - min(1.0, -rayOrigin.z / pixelStrideZCutoff);
|
|
float pixStride = 1.0 + strideScaler * pixelStride;
|
|
|
|
dP *= pixStride; dQ *= pixStride; dk *= pixStride;
|
|
|
|
vec4 pqk = vec4(P0, Q0.z, k0);
|
|
vec4 dPQK = vec4(dP, dQ.z, dk);
|
|
|
|
pqk += dPQK * jitter;
|
|
float rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);
|
|
float rayZNear;
|
|
|
|
bool intersect = false;
|
|
|
|
vec2 texelSize = 1.0 / viewportSize;
|
|
|
|
iterationCount = 0.0;
|
|
|
|
for (int i = 0; i < MAX_ITERATION; i++)
|
|
{
|
|
pqk += dPQK;
|
|
|
|
rayZNear = rayZFar;
|
|
rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);
|
|
|
|
hitPixel = permute ? pqk.yx : pqk.xy;
|
|
hitPixel *= texelSize;
|
|
|
|
intersect = rayIntersectDepth(rayZNear, rayZFar, hitPixel);
|
|
|
|
iterationCount += 1.0;
|
|
|
|
if (intersect) {
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
Q0.xy += dQ.xy * iterationCount;
|
|
Q0.z = pqk.z;
|
|
hitPoint = Q0 / pqk.w;
|
|
|
|
return intersect;
|
|
}
|
|
|
|
float calculateAlpha(
|
|
float iterationCount, float reflectivity,
|
|
vec2 hitPixel, vec3 hitPoint, float dist, vec3 rayDir
|
|
)
|
|
{
|
|
float alpha = clamp(reflectivity, 0.0, 1.0);
|
|
alpha *= 1.0 - (iterationCount / float(MAX_ITERATION));
|
|
vec2 hitPixelNDC = hitPixel * 2.0 - 1.0;
|
|
float maxDimension = min(1.0, max(abs(hitPixelNDC.x), abs(hitPixelNDC.y)));
|
|
alpha *= 1.0 - max(0.0, maxDimension - screenEdgeFadeStart) / (1.0 - screenEdgeFadeStart);
|
|
|
|
float _eyeFadeStart = eyeFadeStart;
|
|
float _eyeFadeEnd = eyeFadeEnd;
|
|
if (_eyeFadeStart > _eyeFadeEnd) {
|
|
float tmp = _eyeFadeEnd;
|
|
_eyeFadeEnd = _eyeFadeStart;
|
|
_eyeFadeStart = tmp;
|
|
}
|
|
|
|
float eyeDir = clamp(rayDir.z, _eyeFadeStart, _eyeFadeEnd);
|
|
alpha *= 1.0 - (eyeDir - _eyeFadeStart) / (_eyeFadeEnd - _eyeFadeStart);
|
|
|
|
alpha *= 1.0 - clamp(dist / maxRayDistance, 0.0, 1.0);
|
|
|
|
return alpha;
|
|
}
|
|
|
|
@import clay.util.rand
|
|
|
|
@import clay.util.rgbm
|
|
|
|
void main()
|
|
{
|
|
vec4 normalAndGloss = texture2D(gBufferTexture1, v_Texcoord);
|
|
|
|
if (dot(normalAndGloss.rgb, vec3(1.0)) == 0.0) {
|
|
discard;
|
|
}
|
|
|
|
float g = normalAndGloss.a;
|
|
if (g <= minGlossiness) {
|
|
discard;
|
|
}
|
|
|
|
float reflectivity = (g - minGlossiness) / (1.0 - minGlossiness);
|
|
|
|
vec3 N = normalAndGloss.rgb * 2.0 - 1.0;
|
|
N = normalize((viewInverseTranspose * vec4(N, 0.0)).xyz);
|
|
|
|
vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, fetchDepth(gBufferTexture2, v_Texcoord), 1.0);
|
|
vec4 pos = projectionInv * projectedPos;
|
|
vec3 rayOrigin = pos.xyz / pos.w;
|
|
|
|
vec3 rayDir = normalize(reflect(normalize(rayOrigin), N));
|
|
vec2 hitPixel;
|
|
vec3 hitPoint;
|
|
float iterationCount;
|
|
|
|
vec2 uv2 = v_Texcoord * viewportSize;
|
|
float jitter = rand(fract(v_Texcoord + jitterOffset));
|
|
|
|
bool intersect = traceScreenSpaceRay(rayOrigin, rayDir, jitter, hitPixel, hitPoint, iterationCount);
|
|
|
|
float dist = distance(rayOrigin, hitPoint);
|
|
|
|
float alpha = calculateAlpha(iterationCount, reflectivity, hitPixel, hitPoint, dist, rayDir) * float(intersect);
|
|
|
|
vec3 hitNormal = texture2D(gBufferTexture1, hitPixel).rgb * 2.0 - 1.0;
|
|
hitNormal = normalize((viewInverseTranspose * vec4(hitNormal, 0.0)).xyz);
|
|
|
|
if (dot(hitNormal, rayDir) >= 0.0) {
|
|
discard;
|
|
}
|
|
|
|
|
|
if (!intersect) {
|
|
discard;
|
|
}
|
|
vec4 color = decodeHDR(texture2D(sourceTexture, hitPixel));
|
|
gl_FragColor = encodeHDR(vec4(color.rgb * alpha, color.a));
|
|
}
|
|
@end
|
|
|
|
@export ecgl.ssr.blur
|
|
|
|
uniform sampler2D texture;
|
|
uniform sampler2D gBufferTexture1;
|
|
uniform sampler2D gBufferTexture2;
|
|
uniform mat4 projection;
|
|
uniform float depthRange : 0.05;
|
|
|
|
varying vec2 v_Texcoord;
|
|
|
|
uniform vec2 textureSize;
|
|
uniform float blurSize : 4.0;
|
|
|
|
#ifdef BLEND
|
|
#ifdef SSAOTEX_ENABLED
|
|
uniform sampler2D ssaoTex;
|
|
#endif
|
|
uniform sampler2D sourceTexture;
|
|
#endif
|
|
|
|
float getLinearDepth(vec2 coord)
|
|
{
|
|
float depth = texture2D(gBufferTexture2, coord).r * 2.0 - 1.0;
|
|
return projection[3][2] / (depth * projection[2][3] - projection[2][2]);
|
|
}
|
|
|
|
@import clay.util.rgbm
|
|
|
|
|
|
void main()
|
|
{
|
|
@import clay.compositor.kernel.gaussian_9
|
|
|
|
vec4 centerNTexel = texture2D(gBufferTexture1, v_Texcoord);
|
|
float g = centerNTexel.a;
|
|
float maxBlurSize = clamp(1.0 - g + 0.1, 0.0, 1.0) * blurSize;
|
|
#ifdef VERTICAL
|
|
vec2 off = vec2(0.0, maxBlurSize / textureSize.y);
|
|
#else
|
|
vec2 off = vec2(maxBlurSize / textureSize.x, 0.0);
|
|
#endif
|
|
|
|
vec2 coord = v_Texcoord;
|
|
|
|
vec4 sum = vec4(0.0);
|
|
float weightAll = 0.0;
|
|
|
|
vec3 cN = centerNTexel.rgb * 2.0 - 1.0;
|
|
float cD = getLinearDepth(v_Texcoord);
|
|
for (int i = 0; i < 9; i++) {
|
|
vec2 coord = clamp((float(i) - 4.0) * off + v_Texcoord, vec2(0.0), vec2(1.0));
|
|
float w = gaussianKernel[i]
|
|
* clamp(dot(cN, texture2D(gBufferTexture1, coord).rgb * 2.0 - 1.0), 0.0, 1.0);
|
|
float d = getLinearDepth(coord);
|
|
w *= (1.0 - smoothstep(abs(cD - d) / depthRange, 0.0, 1.0));
|
|
|
|
weightAll += w;
|
|
sum += decodeHDR(texture2D(texture, coord)) * w;
|
|
}
|
|
|
|
#ifdef BLEND
|
|
float aoFactor = 1.0;
|
|
#ifdef SSAOTEX_ENABLED
|
|
aoFactor = texture2D(ssaoTex, v_Texcoord).r;
|
|
#endif
|
|
gl_FragColor = encodeHDR(
|
|
sum / weightAll * aoFactor + decodeHDR(texture2D(sourceTexture, v_Texcoord))
|
|
);
|
|
#else
|
|
gl_FragColor = encodeHDR(sum / weightAll);
|
|
#endif
|
|
}
|
|
|
|
@end`},function(re,X,D){"use strict";X.a=[0,0,-.321585265978,-.154972575841,.458126042375,.188473391593,.842080129861,.527766490688,.147304551086,-.659453822776,-.331943915203,-.940619700594,.0479226680259,.54812163202,.701581552186,-.709825561388,-.295436780218,.940589268233,-.901489676764,.237713156085,.973570876096,-.109899459384,-.866792314779,-.451805525005,.330975007087,.800048655954,-.344275183665,.381779221166,-.386139432542,-.437418421534,-.576478634965,-.0148463392551,.385798197415,-.262426961053,-.666302061145,.682427250835,-.628010632582,-.732836215494,.10163141741,-.987658134403,.711995289051,-.320024291314,.0296005138058,.950296523438,.0130612307608,-.351024443122,-.879596633704,-.10478487883,.435712737232,.504254490347,.779203817497,.206477676721,.388264289969,-.896736162545,-.153106280781,-.629203242522,-.245517550697,.657969239148,.126830499058,.26862328493,-.634888119007,-.302301223431,.617074219636,.779817204925]},function(re,X,D){"use strict";var W=D(5),y=D(6),L=D(7),A=D(10),s=D(17),x=D(14),c=D(54),u=D(168);L.a.import(u.a);function f(d,m,_,h,v){var r=d.gl;m.setUniform(r,"1i",_,v),r.activeTexture(r.TEXTURE0+v),h.isRenderable()?h.bind(d):h.unbind(d)}function i(d,m,_,h,v){var r,a,p,E,S=d.gl;return function(w,R,O){if(!(E&&E.material===w.material)){var z=w.material,N=w.__program,P=z.get("roughness");P==null&&(P=1);var F=z.get("normalMap")||m,K=z.get("roughnessMap"),B=z.get("bumpMap"),V=z.get("uvRepeat"),C=z.get("uvOffset"),M=z.get("detailUvRepeat"),H=z.get("detailUvOffset"),$=!!B&&z.isTextureEnabled("bumpMap"),q=!!K&&z.isTextureEnabled("roughnessMap"),se=z.isDefined("fragment","DOUBLE_SIDED");B=B||_,K=K||h,O!==R?(R.set("normalMap",F),R.set("bumpMap",B),R.set("roughnessMap",K),R.set("useBumpMap",$),R.set("useRoughnessMap",q),R.set("doubleSide",se),V!=null&&R.set("uvRepeat",V),C!=null&&R.set("uvOffset",C),M!=null&&R.set("detailUvRepeat",M),H!=null&&R.set("detailUvOffset",H),R.set("roughness",P)):(N.setUniform(S,"1f","roughness",P),r!==F&&f(d,N,"normalMap",F,0),a!==B&&B&&f(d,N,"bumpMap",B,1),p!==K&&K&&f(d,N,"roughnessMap",K,2),V!=null&&N.setUniform(S,"2f","uvRepeat",V),C!=null&&N.setUniform(S,"2f","uvOffset",C),M!=null&&N.setUniform(S,"2f","detailUvRepeat",M),H!=null&&N.setUniform(S,"2f","detailUvOffset",H),N.setUniform(S,"1i","useBumpMap",+$),N.setUniform(S,"1i","useRoughnessMap",+q),N.setUniform(S,"1i","doubleSide",+se)),r=F,a=B,p=K,E=w}}}function o(d){d=d||{},this._depthTex=new W.a({format:y.a.DEPTH_COMPONENT,type:y.a.UNSIGNED_INT}),this._normalTex=new W.a({type:y.a.HALF_FLOAT}),this._framebuffer=new A.a,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,A.a.DEPTH_ATTACHMENT),this._normalMaterial=new s.a({shader:new L.a(L.a.source("ecgl.normal.vertex"),L.a.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=c.a.createBlank("#000"),this._defaultBumpMap=c.a.createBlank("#000"),this._defaultRoughessMap=c.a.createBlank("#000"),this._debugPass=new x.a({fragment:L.a.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}o.prototype.getDepthTexture=function(){return this._depthTex},o.prototype.getNormalTexture=function(){return this._normalTex},o.prototype.update=function(d,m,_){var h=d.getWidth(),v=d.getHeight(),r=this._depthTex,a=this._normalTex,p=this._normalMaterial;r.width=h,r.height=v,a.width=h,a.height=v;var E=m.opaqueList;this._framebuffer.bind(d),d.gl.clearColor(0,0,0,0),d.gl.clear(d.gl.COLOR_BUFFER_BIT|d.gl.DEPTH_BUFFER_BIT),d.gl.disable(d.gl.BLEND),d.renderPass(E,_,{getMaterial:function(){return p},ifRender:function(S){return S.renderNormal},beforeRender:i(d,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:d.opaqueSortCompare}),this._framebuffer.unbind(d)},o.prototype.renderDebug=function(d){this._debugPass.render(d)},o.prototype.dispose=function(d){this._depthTex.dispose(d),this._normalTex.dispose(d)},X.a=o},function(re,X,D){"use strict";X.a=`@export ecgl.normal.vertex
|
|
|
|
@import ecgl.common.transformUniforms
|
|
|
|
@import ecgl.common.uv.header
|
|
|
|
@import ecgl.common.attributes
|
|
|
|
varying vec3 v_Normal;
|
|
varying vec3 v_WorldPosition;
|
|
|
|
@import ecgl.common.normalMap.vertexHeader
|
|
|
|
@import ecgl.common.vertexAnimation.header
|
|
|
|
void main()
|
|
{
|
|
|
|
@import ecgl.common.vertexAnimation.main
|
|
|
|
@import ecgl.common.uv.main
|
|
|
|
v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);
|
|
v_WorldPosition = (world * vec4(pos, 1.0)).xyz;
|
|
|
|
@import ecgl.common.normalMap.vertexMain
|
|
|
|
gl_Position = worldViewProjection * vec4(pos, 1.0);
|
|
|
|
}
|
|
|
|
|
|
@end
|
|
|
|
|
|
@export ecgl.normal.fragment
|
|
|
|
#define ROUGHNESS_CHANEL 0
|
|
|
|
uniform bool useBumpMap;
|
|
uniform bool useRoughnessMap;
|
|
uniform bool doubleSide;
|
|
uniform float roughness;
|
|
|
|
@import ecgl.common.uv.fragmentHeader
|
|
|
|
varying vec3 v_Normal;
|
|
varying vec3 v_WorldPosition;
|
|
|
|
uniform mat4 viewInverse : VIEWINVERSE;
|
|
|
|
@import ecgl.common.normalMap.fragmentHeader
|
|
@import ecgl.common.bumpMap.header
|
|
|
|
uniform sampler2D roughnessMap;
|
|
|
|
void main()
|
|
{
|
|
vec3 N = v_Normal;
|
|
|
|
bool flipNormal = false;
|
|
if (doubleSide) {
|
|
vec3 eyePos = viewInverse[3].xyz;
|
|
vec3 V = normalize(eyePos - v_WorldPosition);
|
|
|
|
if (dot(N, V) < 0.0) {
|
|
flipNormal = true;
|
|
}
|
|
}
|
|
|
|
@import ecgl.common.normalMap.fragmentMain
|
|
|
|
if (useBumpMap) {
|
|
N = bumpNormal(v_WorldPosition, v_Normal, N);
|
|
}
|
|
|
|
float g = 1.0 - roughness;
|
|
|
|
if (useRoughnessMap) {
|
|
float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];
|
|
g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);
|
|
}
|
|
|
|
if (flipNormal) {
|
|
N = -N;
|
|
}
|
|
|
|
gl_FragColor.rgb = (N.xyz + 1.0) * 0.5;
|
|
gl_FragColor.a = g;
|
|
}
|
|
@end`},function(re,X,D){"use strict";var W=D(9),y=D(4),L=D(5),A=D(6),s=D(14),x=D(7),c=D(10);function u(f){f=f||{},this._edgePass=new s.a({fragment:x.a.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",f.normalTexture),this._edgePass.setUniform("depthTexture",f.depthTexture),this._targetTexture=new L.a({type:A.a.HALF_FLOAT}),this._frameBuffer=new c.a,this._frameBuffer.attach(this._targetTexture)}u.prototype.update=function(f,i,o,d){var m=f.getWidth(),_=f.getHeight(),h=this._targetTexture;h.width=m,h.height=_;var v=this._frameBuffer;v.bind(f),this._edgePass.setUniform("projectionInv",i.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[m,_]),this._edgePass.setUniform("texture",o),this._edgePass.render(f),v.unbind(f)},u.prototype.getTargetTexture=function(){return this._targetTexture},u.prototype.setParameter=function(f,i){this._edgePass.setUniform(f,i)},u.prototype.dispose=function(f){this._targetTexture.dispose(f),this._frameBuffer.dispose(f)},X.a=u},function(re,X,D){"use strict";X.a={type:"compositor",nodes:[{name:"source",type:"texture",outputs:{color:{}}},{name:"source_half",shader:"#source(clay.compositor.downsample)",inputs:{texture:"source"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bright",shader:"#source(clay.compositor.bright)",inputs:{texture:"source_half"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{threshold:2,scale:4,textureSize:"expr([width * 1.0 / 2, height / 2])"}},{name:"bright_downsample_4",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 2, height / 2] )"}},{name:"bright_downsample_8",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 4, height / 4] )"}},{name:"bright_downsample_16",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 8, height / 8] )"}},{name:"bright_downsample_32",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 32)",height:"expr(height * 1.0 / 32)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 16, height / 16] )"}},{name:"bright_upsample_16_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_32"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 32, height / 32] )"}},{name:"bright_upsample_16_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_16_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_8_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_8_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_8_blur_v",texture2:"bright_upsample_16_blur_v"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_4_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_4_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_4_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_4_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_4_blur_v",texture2:"bright_upsample_8_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_2_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_2_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_2_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_2_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_2_blur_v",texture2:"bright_upsample_4_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_full_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_full_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_full_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bloom_composite",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_full_blur_v",texture2:"bright_upsample_2_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"coc",shader:"#source(ecgl.dof.coc)",outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{focalDist:50,focalRange:30}},{name:"dof_far_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"dof_near_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_NEARFIELD:null}},{name:"dof_coc_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"coc"},outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_COC:null}},{name:"dof_composite",shader:"#source(ecgl.dof.composite)",inputs:{original:"source",blurred:"dof_far_blur",nearfield:"dof_near_blur",coc:"coc",nearcoc:"dof_coc_blur"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}}},{name:"composite",shader:"#source(clay.compositor.hdr.composite)",inputs:{texture:"source",bloom:"bloom_composite"},defines:{}},{name:"FXAA",shader:"#source(clay.compositor.fxaa)",inputs:{texture:"composite"}}]}},function(re,X,D){"use strict";X.a=`@export clay.compositor.kernel.gaussian_9
|
|
float gaussianKernel[9];
|
|
gaussianKernel[0] = 0.07;
|
|
gaussianKernel[1] = 0.09;
|
|
gaussianKernel[2] = 0.12;
|
|
gaussianKernel[3] = 0.14;
|
|
gaussianKernel[4] = 0.16;
|
|
gaussianKernel[5] = 0.14;
|
|
gaussianKernel[6] = 0.12;
|
|
gaussianKernel[7] = 0.09;
|
|
gaussianKernel[8] = 0.07;
|
|
@end
|
|
@export clay.compositor.kernel.gaussian_13
|
|
float gaussianKernel[13];
|
|
gaussianKernel[0] = 0.02;
|
|
gaussianKernel[1] = 0.03;
|
|
gaussianKernel[2] = 0.06;
|
|
gaussianKernel[3] = 0.08;
|
|
gaussianKernel[4] = 0.11;
|
|
gaussianKernel[5] = 0.13;
|
|
gaussianKernel[6] = 0.14;
|
|
gaussianKernel[7] = 0.13;
|
|
gaussianKernel[8] = 0.11;
|
|
gaussianKernel[9] = 0.08;
|
|
gaussianKernel[10] = 0.06;
|
|
gaussianKernel[11] = 0.03;
|
|
gaussianKernel[12] = 0.02;
|
|
@end
|
|
@export clay.compositor.gaussian_blur
|
|
#define SHADER_NAME gaussian_blur
|
|
uniform sampler2D texture;varying vec2 v_Texcoord;
|
|
uniform float blurSize : 2.0;
|
|
uniform vec2 textureSize : [512.0, 512.0];
|
|
uniform float blurDir : 0.0;
|
|
@import clay.util.rgbm
|
|
@import clay.util.clamp_sample
|
|
void main (void)
|
|
{
|
|
@import clay.compositor.kernel.gaussian_9
|
|
vec2 off = blurSize / textureSize;
|
|
off *= vec2(1.0 - blurDir, blurDir);
|
|
vec4 sum = vec4(0.0);
|
|
float weightAll = 0.0;
|
|
for (int i = 0; i < 9; i++) {
|
|
float w = gaussianKernel[i];
|
|
vec4 texel = decodeHDR(clampSample(texture, v_Texcoord + float(i - 4) * off));
|
|
sum += texel * w;
|
|
weightAll += w;
|
|
}
|
|
gl_FragColor = encodeHDR(sum / max(weightAll, 0.01));
|
|
}
|
|
@end
|
|
`},function(re,X,D){"use strict";X.a=`
|
|
@export clay.compositor.lut
|
|
varying vec2 v_Texcoord;
|
|
uniform sampler2D texture;
|
|
uniform sampler2D lookup;
|
|
void main()
|
|
{
|
|
vec4 tex = texture2D(texture, v_Texcoord);
|
|
float blueColor = tex.b * 63.0;
|
|
vec2 quad1;
|
|
quad1.y = floor(floor(blueColor) / 8.0);
|
|
quad1.x = floor(blueColor) - (quad1.y * 8.0);
|
|
vec2 quad2;
|
|
quad2.y = floor(ceil(blueColor) / 8.0);
|
|
quad2.x = ceil(blueColor) - (quad2.y * 8.0);
|
|
vec2 texPos1;
|
|
texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);
|
|
texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);
|
|
vec2 texPos2;
|
|
texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);
|
|
texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);
|
|
vec4 newColor1 = texture2D(lookup, texPos1);
|
|
vec4 newColor2 = texture2D(lookup, texPos2);
|
|
vec4 newColor = mix(newColor1, newColor2, fract(blueColor));
|
|
gl_FragColor = vec4(newColor.rgb, tex.w);
|
|
}
|
|
@end`},function(re,X,D){"use strict";X.a=`@export clay.compositor.output
|
|
#define OUTPUT_ALPHA
|
|
varying vec2 v_Texcoord;
|
|
uniform sampler2D texture;
|
|
@import clay.util.rgbm
|
|
void main()
|
|
{
|
|
vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));
|
|
gl_FragColor.rgb = tex.rgb;
|
|
#ifdef OUTPUT_ALPHA
|
|
gl_FragColor.a = tex.a;
|
|
#else
|
|
gl_FragColor.a = 1.0;
|
|
#endif
|
|
gl_FragColor = encodeHDR(gl_FragColor);
|
|
#ifdef PREMULTIPLY_ALPHA
|
|
gl_FragColor.rgb *= gl_FragColor.a;
|
|
#endif
|
|
}
|
|
@end`},function(re,X,D){"use strict";X.a=`@export clay.compositor.bright
|
|
uniform sampler2D texture;
|
|
uniform float threshold : 1;
|
|
uniform float scale : 1.0;
|
|
uniform vec2 textureSize: [512, 512];
|
|
varying vec2 v_Texcoord;
|
|
const vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);
|
|
@import clay.util.rgbm
|
|
vec4 median(vec4 a, vec4 b, vec4 c)
|
|
{
|
|
return a + b + c - min(min(a, b), c) - max(max(a, b), c);
|
|
}
|
|
void main()
|
|
{
|
|
vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));
|
|
#ifdef ANTI_FLICKER
|
|
vec3 d = 1.0 / textureSize.xyx * vec3(1.0, 1.0, 0.0);
|
|
vec4 s1 = decodeHDR(texture2D(texture, v_Texcoord - d.xz));
|
|
vec4 s2 = decodeHDR(texture2D(texture, v_Texcoord + d.xz));
|
|
vec4 s3 = decodeHDR(texture2D(texture, v_Texcoord - d.zy));
|
|
vec4 s4 = decodeHDR(texture2D(texture, v_Texcoord + d.zy));
|
|
texel = median(median(texel, s1, s2), s3, s4);
|
|
#endif
|
|
float lum = dot(texel.rgb , lumWeight);
|
|
vec4 color;
|
|
if (lum > threshold && texel.a > 0.0)
|
|
{
|
|
color = vec4(texel.rgb * scale, texel.a * scale);
|
|
}
|
|
else
|
|
{
|
|
color = vec4(0.0);
|
|
}
|
|
gl_FragColor = encodeHDR(color);
|
|
}
|
|
@end
|
|
`},function(re,X,D){"use strict";X.a=`@export clay.compositor.downsample
|
|
uniform sampler2D texture;
|
|
uniform vec2 textureSize : [512, 512];
|
|
varying vec2 v_Texcoord;
|
|
@import clay.util.rgbm
|
|
float brightness(vec3 c)
|
|
{
|
|
return max(max(c.r, c.g), c.b);
|
|
}
|
|
@import clay.util.clamp_sample
|
|
void main()
|
|
{
|
|
vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;
|
|
#ifdef ANTI_FLICKER
|
|
vec3 s1 = decodeHDR(clampSample(texture, v_Texcoord + d.xy)).rgb;
|
|
vec3 s2 = decodeHDR(clampSample(texture, v_Texcoord + d.zy)).rgb;
|
|
vec3 s3 = decodeHDR(clampSample(texture, v_Texcoord + d.xw)).rgb;
|
|
vec3 s4 = decodeHDR(clampSample(texture, v_Texcoord + d.zw)).rgb;
|
|
float s1w = 1.0 / (brightness(s1) + 1.0);
|
|
float s2w = 1.0 / (brightness(s2) + 1.0);
|
|
float s3w = 1.0 / (brightness(s3) + 1.0);
|
|
float s4w = 1.0 / (brightness(s4) + 1.0);
|
|
float oneDivideSum = 1.0 / (s1w + s2w + s3w + s4w);
|
|
vec4 color = vec4(
|
|
(s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * oneDivideSum,
|
|
1.0
|
|
);
|
|
#else
|
|
vec4 color = decodeHDR(clampSample(texture, v_Texcoord + d.xy));
|
|
color += decodeHDR(clampSample(texture, v_Texcoord + d.zy));
|
|
color += decodeHDR(clampSample(texture, v_Texcoord + d.xw));
|
|
color += decodeHDR(clampSample(texture, v_Texcoord + d.zw));
|
|
color *= 0.25;
|
|
#endif
|
|
gl_FragColor = encodeHDR(color);
|
|
}
|
|
@end`},function(re,X,D){"use strict";X.a=`
|
|
@export clay.compositor.upsample
|
|
#define HIGH_QUALITY
|
|
uniform sampler2D texture;
|
|
uniform vec2 textureSize : [512, 512];
|
|
uniform float sampleScale: 0.5;
|
|
varying vec2 v_Texcoord;
|
|
@import clay.util.rgbm
|
|
@import clay.util.clamp_sample
|
|
void main()
|
|
{
|
|
#ifdef HIGH_QUALITY
|
|
vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;
|
|
vec4 s;
|
|
s = decodeHDR(clampSample(texture, v_Texcoord - d.xy));
|
|
s += decodeHDR(clampSample(texture, v_Texcoord - d.wy)) * 2.0;
|
|
s += decodeHDR(clampSample(texture, v_Texcoord - d.zy));
|
|
s += decodeHDR(clampSample(texture, v_Texcoord + d.zw)) * 2.0;
|
|
s += decodeHDR(clampSample(texture, v_Texcoord )) * 4.0;
|
|
s += decodeHDR(clampSample(texture, v_Texcoord + d.xw)) * 2.0;
|
|
s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));
|
|
s += decodeHDR(clampSample(texture, v_Texcoord + d.wy)) * 2.0;
|
|
s += decodeHDR(clampSample(texture, v_Texcoord + d.xy));
|
|
gl_FragColor = encodeHDR(s / 16.0);
|
|
#else
|
|
vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;
|
|
vec4 s;
|
|
s = decodeHDR(clampSample(texture, v_Texcoord + d.xy));
|
|
s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));
|
|
s += decodeHDR(clampSample(texture, v_Texcoord + d.xw));
|
|
s += decodeHDR(clampSample(texture, v_Texcoord + d.zw));
|
|
gl_FragColor = encodeHDR(s / 4.0);
|
|
#endif
|
|
}
|
|
@end`},function(re,X,D){"use strict";X.a=`@export clay.compositor.hdr.composite
|
|
uniform sampler2D texture;
|
|
#ifdef BLOOM_ENABLED
|
|
uniform sampler2D bloom;
|
|
#endif
|
|
#ifdef LENSFLARE_ENABLED
|
|
uniform sampler2D lensflare;
|
|
uniform sampler2D lensdirt;
|
|
#endif
|
|
#ifdef LUM_ENABLED
|
|
uniform sampler2D lum;
|
|
#endif
|
|
#ifdef LUT_ENABLED
|
|
uniform sampler2D lut;
|
|
#endif
|
|
#ifdef COLOR_CORRECTION
|
|
uniform float brightness : 0.0;
|
|
uniform float contrast : 1.0;
|
|
uniform float saturation : 1.0;
|
|
#endif
|
|
#ifdef VIGNETTE
|
|
uniform float vignetteDarkness: 1.0;
|
|
uniform float vignetteOffset: 1.0;
|
|
#endif
|
|
uniform float exposure : 1.0;
|
|
uniform float bloomIntensity : 0.25;
|
|
uniform float lensflareIntensity : 1;
|
|
varying vec2 v_Texcoord;
|
|
@import clay.util.srgb
|
|
vec3 ACESToneMapping(vec3 color)
|
|
{
|
|
const float A = 2.51;
|
|
const float B = 0.03;
|
|
const float C = 2.43;
|
|
const float D = 0.59;
|
|
const float E = 0.14;
|
|
return (color * (A * color + B)) / (color * (C * color + D) + E);
|
|
}
|
|
float eyeAdaption(float fLum)
|
|
{
|
|
return mix(0.2, fLum, 0.5);
|
|
}
|
|
#ifdef LUT_ENABLED
|
|
vec3 lutTransform(vec3 color) {
|
|
float blueColor = color.b * 63.0;
|
|
vec2 quad1;
|
|
quad1.y = floor(floor(blueColor) / 8.0);
|
|
quad1.x = floor(blueColor) - (quad1.y * 8.0);
|
|
vec2 quad2;
|
|
quad2.y = floor(ceil(blueColor) / 8.0);
|
|
quad2.x = ceil(blueColor) - (quad2.y * 8.0);
|
|
vec2 texPos1;
|
|
texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);
|
|
texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);
|
|
vec2 texPos2;
|
|
texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);
|
|
texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);
|
|
vec4 newColor1 = texture2D(lut, texPos1);
|
|
vec4 newColor2 = texture2D(lut, texPos2);
|
|
vec4 newColor = mix(newColor1, newColor2, fract(blueColor));
|
|
return newColor.rgb;
|
|
}
|
|
#endif
|
|
@import clay.util.rgbm
|
|
void main()
|
|
{
|
|
vec4 texel = vec4(0.0);
|
|
vec4 originalTexel = vec4(0.0);
|
|
#ifdef TEXTURE_ENABLED
|
|
texel = decodeHDR(texture2D(texture, v_Texcoord));
|
|
originalTexel = texel;
|
|
#endif
|
|
#ifdef BLOOM_ENABLED
|
|
vec4 bloomTexel = decodeHDR(texture2D(bloom, v_Texcoord));
|
|
texel.rgb += bloomTexel.rgb * bloomIntensity;
|
|
texel.a += bloomTexel.a * bloomIntensity;
|
|
#endif
|
|
#ifdef LENSFLARE_ENABLED
|
|
texel += decodeHDR(texture2D(lensflare, v_Texcoord)) * texture2D(lensdirt, v_Texcoord) * lensflareIntensity;
|
|
#endif
|
|
texel.a = min(texel.a, 1.0);
|
|
#ifdef LUM_ENABLED
|
|
float fLum = texture2D(lum, vec2(0.5, 0.5)).r;
|
|
float adaptedLumDest = 3.0 / (max(0.1, 1.0 + 10.0*eyeAdaption(fLum)));
|
|
float exposureBias = adaptedLumDest * exposure;
|
|
#else
|
|
float exposureBias = exposure;
|
|
#endif
|
|
texel.rgb *= exposureBias;
|
|
texel.rgb = ACESToneMapping(texel.rgb);
|
|
texel = linearTosRGB(texel);
|
|
#ifdef LUT_ENABLED
|
|
texel.rgb = lutTransform(clamp(texel.rgb,vec3(0.0),vec3(1.0)));
|
|
#endif
|
|
#ifdef COLOR_CORRECTION
|
|
texel.rgb = clamp(texel.rgb + vec3(brightness), 0.0, 1.0);
|
|
texel.rgb = clamp((texel.rgb - vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);
|
|
float lum = dot(texel.rgb, vec3(0.2125, 0.7154, 0.0721));
|
|
texel.rgb = mix(vec3(lum), texel.rgb, saturation);
|
|
#endif
|
|
#ifdef VIGNETTE
|
|
vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(vignetteOffset);
|
|
texel.rgb = mix(texel.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));
|
|
#endif
|
|
gl_FragColor = encodeHDR(texel);
|
|
#ifdef DEBUG
|
|
#if DEBUG == 1
|
|
gl_FragColor = encodeHDR(decodeHDR(texture2D(texture, v_Texcoord)));
|
|
#elif DEBUG == 2
|
|
gl_FragColor = encodeHDR(decodeHDR(texture2D(bloom, v_Texcoord)) * bloomIntensity);
|
|
#elif DEBUG == 3
|
|
gl_FragColor = encodeHDR(decodeHDR(texture2D(lensflare, v_Texcoord) * lensflareIntensity));
|
|
#endif
|
|
#endif
|
|
if (originalTexel.a <= 0.01 && gl_FragColor.a > 1e-5) {
|
|
gl_FragColor.a = dot(gl_FragColor.rgb, vec3(0.2125, 0.7154, 0.0721));
|
|
}
|
|
#ifdef PREMULTIPLY_ALPHA
|
|
gl_FragColor.rgb *= gl_FragColor.a;
|
|
#endif
|
|
}
|
|
@end`},function(re,X,D){"use strict";X.a=`@export clay.compositor.blend
|
|
#define SHADER_NAME blend
|
|
#ifdef TEXTURE1_ENABLED
|
|
uniform sampler2D texture1;
|
|
uniform float weight1 : 1.0;
|
|
#endif
|
|
#ifdef TEXTURE2_ENABLED
|
|
uniform sampler2D texture2;
|
|
uniform float weight2 : 1.0;
|
|
#endif
|
|
#ifdef TEXTURE3_ENABLED
|
|
uniform sampler2D texture3;
|
|
uniform float weight3 : 1.0;
|
|
#endif
|
|
#ifdef TEXTURE4_ENABLED
|
|
uniform sampler2D texture4;
|
|
uniform float weight4 : 1.0;
|
|
#endif
|
|
#ifdef TEXTURE5_ENABLED
|
|
uniform sampler2D texture5;
|
|
uniform float weight5 : 1.0;
|
|
#endif
|
|
#ifdef TEXTURE6_ENABLED
|
|
uniform sampler2D texture6;
|
|
uniform float weight6 : 1.0;
|
|
#endif
|
|
varying vec2 v_Texcoord;
|
|
@import clay.util.rgbm
|
|
void main()
|
|
{
|
|
vec4 tex = vec4(0.0);
|
|
#ifdef TEXTURE1_ENABLED
|
|
tex += decodeHDR(texture2D(texture1, v_Texcoord)) * weight1;
|
|
#endif
|
|
#ifdef TEXTURE2_ENABLED
|
|
tex += decodeHDR(texture2D(texture2, v_Texcoord)) * weight2;
|
|
#endif
|
|
#ifdef TEXTURE3_ENABLED
|
|
tex += decodeHDR(texture2D(texture3, v_Texcoord)) * weight3;
|
|
#endif
|
|
#ifdef TEXTURE4_ENABLED
|
|
tex += decodeHDR(texture2D(texture4, v_Texcoord)) * weight4;
|
|
#endif
|
|
#ifdef TEXTURE5_ENABLED
|
|
tex += decodeHDR(texture2D(texture5, v_Texcoord)) * weight5;
|
|
#endif
|
|
#ifdef TEXTURE6_ENABLED
|
|
tex += decodeHDR(texture2D(texture6, v_Texcoord)) * weight6;
|
|
#endif
|
|
gl_FragColor = encodeHDR(tex);
|
|
}
|
|
@end`},function(re,X,D){"use strict";X.a=`@export clay.compositor.fxaa
|
|
uniform sampler2D texture;
|
|
uniform vec4 viewport : VIEWPORT;
|
|
varying vec2 v_Texcoord;
|
|
#define FXAA_REDUCE_MIN (1.0/128.0)
|
|
#define FXAA_REDUCE_MUL (1.0/8.0)
|
|
#define FXAA_SPAN_MAX 8.0
|
|
@import clay.util.rgbm
|
|
void main()
|
|
{
|
|
vec2 resolution = 1.0 / viewport.zw;
|
|
vec3 rgbNW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ) ).xyz;
|
|
vec3 rgbNE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ) ).xyz;
|
|
vec3 rgbSW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ) ).xyz;
|
|
vec3 rgbSE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ) ).xyz;
|
|
vec4 rgbaM = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution ) );
|
|
vec3 rgbM = rgbaM.xyz;
|
|
float opacity = rgbaM.w;
|
|
vec3 luma = vec3( 0.299, 0.587, 0.114 );
|
|
float lumaNW = dot( rgbNW, luma );
|
|
float lumaNE = dot( rgbNE, luma );
|
|
float lumaSW = dot( rgbSW, luma );
|
|
float lumaSE = dot( rgbSE, luma );
|
|
float lumaM = dot( rgbM, luma );
|
|
float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );
|
|
float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );
|
|
vec2 dir;
|
|
dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
|
|
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
|
|
float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );
|
|
float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );
|
|
dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),
|
|
max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
|
|
dir * rcpDirMin)) * resolution;
|
|
vec3 rgbA = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ) ).xyz;
|
|
rgbA += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ) ).xyz;
|
|
rgbA *= 0.5;
|
|
vec3 rgbB = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * -0.5 ) ).xyz;
|
|
rgbB += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * 0.5 ) ).xyz;
|
|
rgbB *= 0.25;
|
|
rgbB += rgbA * 0.5;
|
|
float lumaB = dot( rgbB, luma );
|
|
if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) )
|
|
{
|
|
gl_FragColor = vec4( rgbA, opacity );
|
|
}
|
|
else {
|
|
gl_FragColor = vec4( rgbB, opacity );
|
|
}
|
|
}
|
|
@end`},function(re,X,D){"use strict";X.a=`@export ecgl.dof.coc
|
|
|
|
uniform sampler2D depth;
|
|
|
|
uniform float zNear: 0.1;
|
|
uniform float zFar: 2000;
|
|
|
|
uniform float focalDistance: 3;
|
|
uniform float focalRange: 1;
|
|
uniform float focalLength: 30;
|
|
uniform float fstop: 2.8;
|
|
|
|
varying vec2 v_Texcoord;
|
|
|
|
@import clay.util.encode_float
|
|
|
|
void main()
|
|
{
|
|
float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;
|
|
|
|
float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));
|
|
|
|
float aperture = focalLength / fstop;
|
|
|
|
float coc;
|
|
|
|
float uppper = focalDistance + focalRange;
|
|
float lower = focalDistance - focalRange;
|
|
if (dist <= uppper && dist >= lower) {
|
|
coc = 0.5;
|
|
}
|
|
else {
|
|
float focalAdjusted = dist > uppper ? uppper : lower;
|
|
|
|
coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));
|
|
coc = clamp(coc, 0.0, 2.0) / 2.00001;
|
|
|
|
if (dist < lower) {
|
|
coc = -coc;
|
|
}
|
|
coc = coc * 0.5 + 0.5;
|
|
}
|
|
|
|
gl_FragColor = encodeFloat(coc);
|
|
}
|
|
@end
|
|
|
|
|
|
@export ecgl.dof.composite
|
|
|
|
#define DEBUG 0
|
|
|
|
uniform sampler2D original;
|
|
uniform sampler2D blurred;
|
|
uniform sampler2D nearfield;
|
|
uniform sampler2D coc;
|
|
uniform sampler2D nearcoc;
|
|
varying vec2 v_Texcoord;
|
|
|
|
@import clay.util.rgbm
|
|
@import clay.util.float
|
|
|
|
void main()
|
|
{
|
|
vec4 blurredColor = decodeHDR(texture2D(blurred, v_Texcoord));
|
|
vec4 originalColor = decodeHDR(texture2D(original, v_Texcoord));
|
|
|
|
float fCoc = decodeFloat(texture2D(coc, v_Texcoord));
|
|
|
|
fCoc = abs(fCoc * 2.0 - 1.0);
|
|
|
|
float weight = smoothstep(0.0, 1.0, fCoc);
|
|
|
|
#ifdef NEARFIELD_ENABLED
|
|
vec4 nearfieldColor = decodeHDR(texture2D(nearfield, v_Texcoord));
|
|
float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));
|
|
fNearCoc = abs(fNearCoc * 2.0 - 1.0);
|
|
|
|
gl_FragColor = encodeHDR(
|
|
mix(
|
|
nearfieldColor, mix(originalColor, blurredColor, weight),
|
|
pow(1.0 - fNearCoc, 4.0)
|
|
)
|
|
);
|
|
#else
|
|
gl_FragColor = encodeHDR(mix(originalColor, blurredColor, weight));
|
|
#endif
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@export ecgl.dof.diskBlur
|
|
|
|
#define POISSON_KERNEL_SIZE 16;
|
|
|
|
uniform sampler2D texture;
|
|
uniform sampler2D coc;
|
|
varying vec2 v_Texcoord;
|
|
|
|
uniform float blurRadius : 10.0;
|
|
uniform vec2 textureSize : [512.0, 512.0];
|
|
|
|
uniform vec2 poissonKernel[POISSON_KERNEL_SIZE];
|
|
|
|
uniform float percent;
|
|
|
|
float nrand(const in vec2 n) {
|
|
return fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);
|
|
}
|
|
|
|
@import clay.util.rgbm
|
|
@import clay.util.float
|
|
|
|
|
|
void main()
|
|
{
|
|
vec2 offset = blurRadius / textureSize;
|
|
|
|
float rnd = 6.28318 * nrand(v_Texcoord + 0.07 * percent );
|
|
float cosa = cos(rnd);
|
|
float sina = sin(rnd);
|
|
vec4 basis = vec4(cosa, -sina, sina, cosa);
|
|
|
|
#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)
|
|
offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);
|
|
#endif
|
|
|
|
#ifdef BLUR_COC
|
|
float cocSum = 0.0;
|
|
#else
|
|
vec4 color = vec4(0.0);
|
|
#endif
|
|
|
|
|
|
float weightSum = 0.0;
|
|
|
|
for (int i = 0; i < POISSON_KERNEL_SIZE; i++) {
|
|
vec2 ofs = poissonKernel[i];
|
|
|
|
ofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));
|
|
|
|
vec2 uv = v_Texcoord + ofs * offset;
|
|
vec4 texel = texture2D(texture, uv);
|
|
|
|
float w = 1.0;
|
|
#ifdef BLUR_COC
|
|
float fCoc = decodeFloat(texel) * 2.0 - 1.0;
|
|
cocSum += clamp(fCoc, -1.0, 0.0) * w;
|
|
#else
|
|
texel = decodeHDR(texel);
|
|
#if !defined(BLUR_NEARFIELD)
|
|
float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;
|
|
w *= abs(fCoc);
|
|
#endif
|
|
color += texel * w;
|
|
#endif
|
|
|
|
weightSum += w;
|
|
}
|
|
|
|
#ifdef BLUR_COC
|
|
gl_FragColor = encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);
|
|
#else
|
|
color /= weightSum;
|
|
gl_FragColor = encodeHDR(color);
|
|
#endif
|
|
}
|
|
|
|
@end`},function(re,X,D){"use strict";X.a=`@export ecgl.edge
|
|
|
|
uniform sampler2D texture;
|
|
|
|
uniform sampler2D normalTexture;
|
|
uniform sampler2D depthTexture;
|
|
|
|
uniform mat4 projectionInv;
|
|
|
|
uniform vec2 textureSize;
|
|
|
|
uniform vec4 edgeColor: [0,0,0,0.8];
|
|
|
|
varying vec2 v_Texcoord;
|
|
|
|
vec3 packColor(vec2 coord) {
|
|
float z = texture2D(depthTexture, coord).r * 2.0 - 1.0;
|
|
vec4 p = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);
|
|
vec4 p4 = projectionInv * p;
|
|
|
|
return vec3(
|
|
texture2D(normalTexture, coord).rg,
|
|
-p4.z / p4.w / 5.0
|
|
);
|
|
}
|
|
|
|
void main() {
|
|
vec2 cc = v_Texcoord;
|
|
vec3 center = packColor(cc);
|
|
|
|
float size = clamp(1.0 - (center.z - 10.0) / 100.0, 0.0, 1.0) * 0.5;
|
|
float dx = size / textureSize.x;
|
|
float dy = size / textureSize.y;
|
|
|
|
vec2 coord;
|
|
vec3 topLeft = packColor(cc+vec2(-dx, -dy));
|
|
vec3 top = packColor(cc+vec2(0.0, -dy));
|
|
vec3 topRight = packColor(cc+vec2(dx, -dy));
|
|
vec3 left = packColor(cc+vec2(-dx, 0.0));
|
|
vec3 right = packColor(cc+vec2(dx, 0.0));
|
|
vec3 bottomLeft = packColor(cc+vec2(-dx, dy));
|
|
vec3 bottom = packColor(cc+vec2(0.0, dy));
|
|
vec3 bottomRight = packColor(cc+vec2(dx, dy));
|
|
|
|
vec3 v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;
|
|
vec3 h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;
|
|
|
|
float edge = sqrt(dot(h, h) + dot(v, v));
|
|
|
|
edge = smoothstep(0.8, 1.0, edge);
|
|
|
|
gl_FragColor = mix(texture2D(texture, v_Texcoord), vec4(edgeColor.rgb, 1.0), edgeColor.a * edge);
|
|
}
|
|
@end`},function(re,X,D){"use strict";var W=D(43),y=D(14),L=D(10),A=D(5),s=D(7),x=D(9);function c(u){for(var f=[],i=0;i<30;i++)f.push([Object(W.a)(i,2),Object(W.a)(i,3)]);this._haltonSequence=f,this._frame=0,this._sourceTex=new A.a,this._sourceFb=new L.a,this._sourceFb.attach(this._sourceTex),this._prevFrameTex=new A.a,this._outputTex=new A.a;var o=this._blendPass=new y.a({fragment:s.a.source("clay.compositor.blend")});o.material.disableTexturesAll(),o.material.enableTexture(["texture1","texture2"]),this._blendFb=new L.a({depthBuffer:!1}),this._outputPass=new y.a({fragment:s.a.source("clay.compositor.output"),blendWithPrevious:!0}),this._outputPass.material.define("fragment","OUTPUT_ALPHA"),this._outputPass.material.blend=function(d){d.blendEquationSeparate(d.FUNC_ADD,d.FUNC_ADD),d.blendFuncSeparate(d.ONE,d.ONE_MINUS_SRC_ALPHA,d.ONE,d.ONE_MINUS_SRC_ALPHA)}}c.prototype={constructor:c,jitterProjection:function(u,f){var i=u.viewport,o=i.devicePixelRatio||u.getDevicePixelRatio(),d=i.width*o,m=i.height*o,_=this._haltonSequence[this._frame%this._haltonSequence.length],h=new x.a;h.array[12]=(_[0]*2-1)/d,h.array[13]=(_[1]*2-1)/m,x.a.mul(f.projectionMatrix,h,f.projectionMatrix),x.a.invert(f.invProjectionMatrix,f.projectionMatrix)},resetFrame:function(){this._frame=0},getFrame:function(){return this._frame},getSourceFrameBuffer:function(){return this._sourceFb},getOutputTexture:function(){return this._outputTex},resize:function(u,f){this._prevFrameTex.width=u,this._prevFrameTex.height=f,this._outputTex.width=u,this._outputTex.height=f,this._sourceTex.width=u,this._sourceTex.height=f,this._prevFrameTex.dirty(),this._outputTex.dirty(),this._sourceTex.dirty()},isFinished:function(){return this._frame>=this._haltonSequence.length},render:function(u,f,i){var o=this._blendPass;this._frame===0?(o.setUniform("weight1",0),o.setUniform("weight2",1)):(o.setUniform("weight1",.9),o.setUniform("weight2",.1)),o.setUniform("texture1",this._prevFrameTex),o.setUniform("texture2",f||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(u),o.render(u),this._blendFb.unbind(u),i||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(u));var d=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=d,this._frame++},dispose:function(u){this._sourceFb.dispose(u),this._blendFb.dispose(u),this._prevFrameTex.dispose(u),this._outputTex.dispose(u),this._sourceTex.dispose(u),this._outputPass.dispose(u),this._blendPass.dispose(u)}},X.a=c},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(184),A=D(185),s=D(82);y.a.registerAction({type:"geo3DChangeCamera",event:"geo3dcamerachanged",update:"series:updateCamera"},function(x,c){c.eachComponent({mainType:"geo3D",query:x},function(u){u.setView(x)})})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(38),A=D(31),s=D(32),x=D(26),c=D(80),u=y.a.extendComponentModel({type:"geo3D",layoutMode:"box",coordinateSystem:null,optionUpdated:function(){var i=this.option;i.regions=this.getFilledRegions(i.regions,i.map);var o=y.a.helper.completeDimensions(["value"],i.data,{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),d=new y.a.List(o,this);d.initData(i.regions);var m={};d.each(function(_){var h=d.getName(_),v=d.getItemModel(_);m[h]=v}),this._regionModelMap=m,this._data=d},getData:function(){return this._data},getRegionModel:function(i){var o=this.getData().getName(i);return this._regionModelMap[o]||new y.a.Model(null,this)},getRegionPolygonCoords:function(i){var o=this.getData().getName(i),d=this.coordinateSystem.getRegion(o);return d?d.geometries:[]},getFormattedLabel:function(i,o){var d=this._data.getName(i),m=this.getRegionModel(d),_=m.get(o==="normal"?["label","formatter"]:["emphasis","label","formatter"]);_==null&&(_=m.get(["label","formatter"]));var h={name:d};if(typeof _=="function")return h.status=o,_(h);if(typeof _=="string"){var v=h.seriesName;return _.replace("{a}",v!=null?v:"")}else return d},defaultOption:{regions:[]}});y.a.util.merge(u.prototype,c.a),y.a.util.merge(u.prototype,L.a),y.a.util.merge(u.prototype,A.a),y.a.util.merge(u.prototype,s.a),y.a.util.merge(u.prototype,x.a);var f=u},function(re,X,D){"use strict";var W=D(59),y=D(0),L=D.n(y),A=D(2),s=D(39),x=D(34),c=L.a.extendComponentView({type:"geo3D",__ecgl__:!0,init:function(u,f){this._geo3DBuilder=new W.a(f),this.groupGL=new A.a.Node,this._lightRoot=new A.a.Node,this._sceneHelper=new x.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot),this._control=new s.a({zr:f.getZr()}),this._control.init()},render:function(u,f,i){this.groupGL.add(this._geo3DBuilder.rootNode);var o=u.coordinateSystem;if(!(!o||!o.viewGL)){o.viewGL.add(this._lightRoot),u.get("show")?o.viewGL.add(this.groupGL):o.viewGL.remove(this.groupGL);var d=this._control;d.setViewGL(o.viewGL);var m=u.getModel("viewControl");d.setFromViewControlModel(m,0),this._sceneHelper.setScene(o.viewGL.scene),this._sceneHelper.updateLight(u),o.viewGL.setPostEffect(u.getModel("postEffect"),i),o.viewGL.setTemporalSuperSampling(u.getModel("temporalSuperSampling")),this._geo3DBuilder.update(u,f,i,0,u.getData().count());var _=o.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse(function(h){h.material&&h.material[_]("fragment","SRGB_DECODE")}),d.off("update"),d.on("update",function(){i.dispatchAction({type:"geo3DChangeCamera",alpha:d.getAlpha(),beta:d.getBeta(),distance:d.getDistance(),center:d.getCenter(),from:this.uid,geo3DId:u.id})})}},afterRender:function(u,f,i,o){var d=o.renderer;this._sceneHelper.updateAmbientCubemap(d,u,i),this._sceneHelper.updateSkybox(d,u,i)},dispose:function(){this._control.dispose()}})},function(re,X,D){"use strict";X.a=W;function W(B,V,C){C=C||2;var M=V&&V.length,H=M?V[0]*C:B.length,$=y(B,0,H,C,!0),q=[];if(!$)return q;var se,ue,pe,xe,De,Ue,Ge;if(M&&($=f(B,V,$,C)),B.length>80*C){se=pe=B[0],ue=xe=B[1];for(var Ae=C;Ae<H;Ae+=C)De=B[Ae],Ue=B[Ae+1],De<se&&(se=De),Ue<ue&&(ue=Ue),De>pe&&(pe=De),Ue>xe&&(xe=Ue);Ge=Math.max(pe-se,xe-ue)}return A($,q,C,se,ue,Ge),q}function y(B,V,C,M,H){var $,q;if(H===K(B,V,C,M)>0)for($=V;$<C;$+=M)q=N($,B[$],B[$+1],q);else for($=C-M;$>=V;$-=M)q=N($,B[$],B[$+1],q);return q&&E(q,q.next)&&(P(q),q=q.next),q}function L(B,V){if(!B)return B;V||(V=B);var C=B,M;do if(M=!1,!C.steiner&&(E(C,C.next)||p(C.prev,C,C.next)===0)){if(P(C),C=V=C.prev,C===C.next)return null;M=!0}else C=C.next;while(M||C!==V);return V}function A(B,V,C,M,H,$,q){if(B){!q&&$&&m(B,M,H,$);for(var se=B,ue,pe;B.prev!==B.next;){if(ue=B.prev,pe=B.next,$?x(B,M,H,$):s(B)){V.push(ue.i/C),V.push(B.i/C),V.push(pe.i/C),P(B),B=pe.next,se=pe.next;continue}if(B=pe,B===se){q?q===1?(B=c(B,V,C),A(B,V,C,M,H,$,2)):q===2&&u(B,V,C,M,H,$):A(L(B),V,C,M,H,$,1);break}}}}function s(B){var V=B.prev,C=B,M=B.next;if(p(V,C,M)>=0)return!1;for(var H=B.next.next;H!==B.prev;){if(r(V.x,V.y,C.x,C.y,M.x,M.y,H.x,H.y)&&p(H.prev,H,H.next)>=0)return!1;H=H.next}return!0}function x(B,V,C,M){var H=B.prev,$=B,q=B.next;if(p(H,$,q)>=0)return!1;for(var se=H.x<$.x?H.x<q.x?H.x:q.x:$.x<q.x?$.x:q.x,ue=H.y<$.y?H.y<q.y?H.y:q.y:$.y<q.y?$.y:q.y,pe=H.x>$.x?H.x>q.x?H.x:q.x:$.x>q.x?$.x:q.x,xe=H.y>$.y?H.y>q.y?H.y:q.y:$.y>q.y?$.y:q.y,De=h(se,ue,V,C,M),Ue=h(pe,xe,V,C,M),Ge=B.nextZ;Ge&&Ge.z<=Ue;){if(Ge!==B.prev&&Ge!==B.next&&r(H.x,H.y,$.x,$.y,q.x,q.y,Ge.x,Ge.y)&&p(Ge.prev,Ge,Ge.next)>=0)return!1;Ge=Ge.nextZ}for(Ge=B.prevZ;Ge&&Ge.z>=De;){if(Ge!==B.prev&&Ge!==B.next&&r(H.x,H.y,$.x,$.y,q.x,q.y,Ge.x,Ge.y)&&p(Ge.prev,Ge,Ge.next)>=0)return!1;Ge=Ge.prevZ}return!0}function c(B,V,C){var M=B;do{var H=M.prev,$=M.next.next;!E(H,$)&&S(H,M,M.next,$)&&R(H,$)&&R($,H)&&(V.push(H.i/C),V.push(M.i/C),V.push($.i/C),P(M),P(M.next),M=B=$),M=M.next}while(M!==B);return M}function u(B,V,C,M,H,$){var q=B;do{for(var se=q.next.next;se!==q.prev;){if(q.i!==se.i&&a(q,se)){var ue=z(q,se);q=L(q,q.next),ue=L(ue,ue.next),A(q,V,C,M,H,$),A(ue,V,C,M,H,$);return}se=se.next}q=q.next}while(q!==B)}function f(B,V,C,M){var H=[],$,q,se,ue,pe;for($=0,q=V.length;$<q;$++)se=V[$]*M,ue=$<q-1?V[$+1]*M:B.length,pe=y(B,se,ue,M,!1),pe===pe.next&&(pe.steiner=!0),H.push(v(pe));for(H.sort(i),$=0;$<H.length;$++)o(H[$],C),C=L(C,C.next);return C}function i(B,V){return B.x-V.x}function o(B,V){if(V=d(B,V),V){var C=z(V,B);L(C,C.next)}}function d(B,V){var C=V,M=B.x,H=B.y,$=-1/0,q;do{if(H<=C.y&&H>=C.next.y&&C.next.y!==C.y){var se=C.x+(H-C.y)*(C.next.x-C.x)/(C.next.y-C.y);if(se<=M&&se>$){if($=se,se===M){if(H===C.y)return C;if(H===C.next.y)return C.next}q=C.x<C.next.x?C:C.next}}C=C.next}while(C!==V);if(!q)return null;if(M===$)return q.prev;var ue=q,pe=q.x,xe=q.y,De=1/0,Ue;for(C=q.next;C!==ue;)M>=C.x&&C.x>=pe&&M!==C.x&&r(H<xe?M:$,H,pe,xe,H<xe?$:M,H,C.x,C.y)&&(Ue=Math.abs(H-C.y)/(M-C.x),(Ue<De||Ue===De&&C.x>q.x)&&R(C,B)&&(q=C,De=Ue)),C=C.next;return q}function m(B,V,C,M){var H=B;do H.z===null&&(H.z=h(H.x,H.y,V,C,M)),H.prevZ=H.prev,H.nextZ=H.next,H=H.next;while(H!==B);H.prevZ.nextZ=null,H.prevZ=null,_(H)}function _(B){var V,C,M,H,$,q,se,ue,pe=1;do{for(C=B,B=null,$=null,q=0;C;){for(q++,M=C,se=0,V=0;V<pe&&(se++,M=M.nextZ,!!M);V++);for(ue=pe;se>0||ue>0&&M;)se!==0&&(ue===0||!M||C.z<=M.z)?(H=C,C=C.nextZ,se--):(H=M,M=M.nextZ,ue--),$?$.nextZ=H:B=H,H.prevZ=$,$=H;C=M}$.nextZ=null,pe*=2}while(q>1);return B}function h(B,V,C,M,H){return B=32767*(B-C)/H,V=32767*(V-M)/H,B=(B|B<<8)&16711935,B=(B|B<<4)&252645135,B=(B|B<<2)&858993459,B=(B|B<<1)&1431655765,V=(V|V<<8)&16711935,V=(V|V<<4)&252645135,V=(V|V<<2)&858993459,V=(V|V<<1)&1431655765,B|V<<1}function v(B){var V=B,C=B;do V.x<C.x&&(C=V),V=V.next;while(V!==B);return C}function r(B,V,C,M,H,$,q,se){return(H-q)*(V-se)-(B-q)*($-se)>=0&&(B-q)*(M-se)-(C-q)*(V-se)>=0&&(C-q)*($-se)-(H-q)*(M-se)>=0}function a(B,V){return B.next.i!==V.i&&B.prev.i!==V.i&&!w(B,V)&&R(B,V)&&R(V,B)&&O(B,V)}function p(B,V,C){return(V.y-B.y)*(C.x-V.x)-(V.x-B.x)*(C.y-V.y)}function E(B,V){return B.x===V.x&&B.y===V.y}function S(B,V,C,M){return E(B,V)&&E(C,M)||E(B,M)&&E(C,V)?!0:p(B,V,C)>0!=p(B,V,M)>0&&p(C,M,B)>0!=p(C,M,V)>0}function w(B,V){var C=B;do{if(C.i!==B.i&&C.next.i!==B.i&&C.i!==V.i&&C.next.i!==V.i&&S(C,C.next,B,V))return!0;C=C.next}while(C!==B);return!1}function R(B,V){return p(B.prev,B,B.next)<0?p(B,V,B.next)>=0&&p(B,B.prev,V)>=0:p(B,V,B.prev)<0||p(B,B.next,V)<0}function O(B,V){var C=B,M=!1,H=(B.x+V.x)/2,$=(B.y+V.y)/2;do C.y>$!=C.next.y>$&&C.next.y!==C.y&&H<(C.next.x-C.x)*($-C.y)/(C.next.y-C.y)+C.x&&(M=!M),C=C.next;while(C!==B);return M}function z(B,V){var C=new F(B.i,B.x,B.y),M=new F(V.i,V.x,V.y),H=B.next,$=V.prev;return B.next=V,V.prev=B,C.next=H,H.prev=C,M.next=C,C.prev=M,$.next=M,M.prev=$,M}function N(B,V,C,M){var H=new F(B,V,C);return M?(H.next=M.next,H.prev=M,M.next.prev=H,M.next=H):(H.prev=H,H.next=H),H}function P(B){B.next.prev=B.prev,B.prev.next=B.next,B.prevZ&&(B.prevZ.nextZ=B.nextZ),B.nextZ&&(B.nextZ.prevZ=B.prevZ)}function F(B,V,C){this.i=B,this.x=V,this.y=C,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}W.deviation=function(B,V,C,M){var H=V&&V.length,$=H?V[0]*C:B.length,q=Math.abs(K(B,0,$,C));if(H)for(var se=0,ue=V.length;se<ue;se++){var pe=V[se]*C,xe=se<ue-1?V[se+1]*C:B.length;q-=Math.abs(K(B,pe,xe,C))}var De=0;for(se=0;se<M.length;se+=3){var Ue=M[se]*C,Ge=M[se+1]*C,Ae=M[se+2]*C;De+=Math.abs((B[Ue]-B[Ae])*(B[Ge+1]-B[Ue+1])-(B[Ue]-B[Ge])*(B[Ae+1]-B[Ue+1]))}return q===0&&De===0?0:Math.abs((De-q)/q)};function K(B,V,C,M){for(var H=0,$=V,q=C-M;$<C;$+=M)H+=(B[q]-B[$])*(B[$+1]+B[q+1]),q=$;return H}},function(re,X,D){var W=D(12),y={\u5357\u6D77\u8BF8\u5C9B:[32,80],\u5E7F\u4E1C:[0,-10],\u9999\u6E2F:[10,5],\u6FB3\u95E8:[-10,10],\u5929\u6D25:[5,5]};function L(A){W.each(A.regions,function(s){var x=y[s.name];if(x){var c=s.center;c[0]+=x[0]/10.5,c[1]+=-x[1]/(10.5/.75)}})}re.exports=L},function(re,X,D){var W=D(12),y={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};function L(A){W.each(A.regions,function(s){var x=y[s.name];if(x){var c=s.center;c[0]=x[0],c[1]=x[1]}})}re.exports=L},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(190),A=D(191),s=D(193);y.a.registerAction({type:"globeChangeCamera",event:"globecamerachanged",update:"series:updateCamera"},function(x,c){c.eachComponent({mainType:"globe",query:x},function(u){u.setView(x)})}),y.a.registerAction({type:"globeUpdateDisplacment",event:"globedisplacementupdated",update:"update"},function(x,c){})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(38),A=D(31),s=D(32),x=D(26);function c(i,o){i.id=i.id||i.name||o+""}var u=y.a.extendComponentModel({type:"globe",layoutMode:"box",coordinateSystem:null,init:function(){u.superApply(this,"init",arguments),y.a.util.each(this.option.layers,function(i,o){y.a.util.merge(i,this.defaultLayerOption),c(i,o)},this)},mergeOption:function(i){var o=this.option.layers;this.option.layers=null,u.superApply(this,"mergeOption",arguments);function d(v){return y.a.util.reduce(v,function(r,a,p){return c(a,p),r[a.id]=a,r},{})}if(o&&o.length){var m=d(i.layers),_=d(o);for(var h in m)_[h]?y.a.util.merge(_[h],m[h],!0):o.push(i.layers[h]);this.option.layers=o}y.a.util.each(this.option.layers,function(v){y.a.util.merge(v,this.defaultLayerOption)},this)},optionUpdated:function(){this.updateDisplacementHash()},defaultLayerOption:{show:!0,type:"overlay"},defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",baseColor:"#fff",baseTexture:"",heightTexture:"",displacementTexture:"",displacementScale:0,displacementQuality:"medium",globeRadius:100,globeOuterRadius:150,shading:"lambert",light:{main:{time:""}},viewControl:{autoRotate:!0,panSensitivity:0,targetCoord:null},layers:[]},setDisplacementData:function(i,o,d){this.displacementData=i,this.displacementWidth=o,this.displacementHeight=d},getDisplacementTexture:function(){return this.get("displacementTexture")||this.get("heightTexture")},getDisplacemenScale:function(){var i=this.getDisplacementTexture(),o=this.get("displacementScale");return(!i||i==="none")&&(o=0),o},hasDisplacement:function(){return this.getDisplacemenScale()>0},_displacementChanged:!0,_displacementScale:0,updateDisplacementHash:function(){var i=this.getDisplacementTexture(),o=this.getDisplacemenScale();this._displacementChanged=this._displacementTexture!==i||this._displacementScale!==o,this._displacementTexture=i,this._displacementScale=o},isDisplacementChanged:function(){return this._displacementChanged}});y.a.util.merge(u.prototype,L.a),y.a.util.merge(u.prototype,A.a),y.a.util.merge(u.prototype,s.a),y.a.util.merge(u.prototype,x.a);var f=u},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(39),s=D(34),x=D(192),c=D(3),u=y.a.extendComponentView({type:"globe",__ecgl__:!0,_displacementScale:0,init:function(f,i){this.groupGL=new L.a.Node,this._sphereGeometry=new L.a.SphereGeometry({widthSegments:200,heightSegments:100,dynamic:!0}),this._overlayGeometry=new L.a.SphereGeometry({widthSegments:80,heightSegments:40}),this._planeGeometry=new L.a.PlaneGeometry,this._earthMesh=new L.a.Mesh({renderNormal:!0}),this._lightRoot=new L.a.Node,this._sceneHelper=new s.a,this._sceneHelper.initLight(this._lightRoot),this.groupGL.add(this._earthMesh),this._control=new A.a({zr:i.getZr()}),this._control.init(),this._layerMeshes={}},render:function(f,i,o){var d=f.coordinateSystem,m=f.get("shading");d.viewGL.add(this._lightRoot),f.get("show")?d.viewGL.add(this.groupGL):d.viewGL.remove(this.groupGL),this._sceneHelper.setScene(d.viewGL.scene),d.viewGL.setPostEffect(f.getModel("postEffect"),o),d.viewGL.setTemporalSuperSampling(f.getModel("temporalSuperSampling"));var _=this._earthMesh;_.geometry=this._sphereGeometry;var h="ecgl."+m;(!_.material||_.material.shader.name!==h)&&(_.material=L.a.createMaterial(h)),L.a.setMaterialFromModel(m,_.material,f,o),["roughnessMap","metalnessMap","detailMap","normalMap"].forEach(function(p){var E=_.material.get(p);E&&(E.flipY=!1)}),_.material.set("color",L.a.parseColor(f.get("baseColor")));var v=d.radius*.99;_.scale.set(v,v,v);var r=_.material.setTextureImage("diffuseMap",f.get("baseTexture"),o,{flipY:!1,anisotropic:8});r&&r.surface&&r.surface.attachToMesh(_);var a=_.material.setTextureImage("bumpMap",f.get("heightTexture"),o,{flipY:!1,anisotropic:8});a&&a.surface&&a.surface.attachToMesh(_),_.material[f.get("postEffect.enable")?"define":"undefine"]("fragment","SRGB_DECODE"),this._updateLight(f,o),this._displaceVertices(f,o),this._updateViewControl(f,o),this._updateLayers(f,o)},afterRender:function(f,i,o,d){var m=d.renderer;this._sceneHelper.updateAmbientCubemap(m,f,o),this._sceneHelper.updateSkybox(m,f,o)},_updateLayers:function(f,i){var o=f.coordinateSystem,d=f.get("layers"),m=o.radius,_=[],h=[],v=[],r=[];y.a.util.each(d,function(w){var R=new y.a.Model(w),O=R.get("type"),z=L.a.loadTexture(R.get("texture"),i,{flipY:!1,anisotropic:8});if(z.surface&&z.surface.attachToMesh(this._earthMesh),O==="blend"){var N=R.get("blendTo"),P=c.a.firstNotNull(R.get("intensity"),1);N==="emission"?(v.push(z),r.push(P)):(_.push(z),h.push(P))}else{var F=R.get("id"),K=this._layerMeshes[F];K||(K=this._layerMeshes[F]=new L.a.Mesh({geometry:this._overlayGeometry,castShadow:!1,ignorePicking:!0}));var B=R.get("shading");B==="lambert"?(K.material=K.__lambertMaterial||new L.a.Material({autoUpdateTextureStatus:!1,shader:L.a.createShader("ecgl.lambert"),transparent:!0,depthMask:!1}),K.__lambertMaterial=K.material):(K.material=K.__colorMaterial||new L.a.Material({autoUpdateTextureStatus:!1,shader:L.a.createShader("ecgl.color"),transparent:!0,depthMask:!1}),K.__colorMaterial=K.material),K.material.enableTexture("diffuseMap");var V=R.get("distance"),C=m+(V==null?o.radius/100:V);K.scale.set(C,C,C),m=C;var M=this._blankTexture||(this._blankTexture=L.a.createBlankTexture("rgba(255, 255, 255, 0)"));K.material.set("diffuseMap",M),L.a.loadTexture(R.get("texture"),i,{flipY:!1,anisotropic:8},function(H){H.surface&&H.surface.attachToMesh(K),K.material.set("diffuseMap",H),i.getZr().refresh()}),R.get("show")?this.groupGL.add(K):this.groupGL.remove(K)}},this);var a=this._earthMesh.material;a.define("fragment","LAYER_DIFFUSEMAP_COUNT",_.length),a.define("fragment","LAYER_EMISSIVEMAP_COUNT",v.length),a.set("layerDiffuseMap",_),a.set("layerDiffuseIntensity",h),a.set("layerEmissiveMap",v),a.set("layerEmissionIntensity",r);var p=f.getModel("debug.wireframe");if(p.get("show")){a.define("both","WIREFRAME_TRIANGLE");var E=L.a.parseColor(p.get("lineStyle.color")||"rgba(0,0,0,0.5)"),S=c.a.firstNotNull(p.get("lineStyle.width"),1);a.set("wireframeLineWidth",S),a.set("wireframeLineColor",E)}else a.undefine("both","WIREFRAME_TRIANGLE")},_updateViewControl:function(f,i){var o=f.coordinateSystem,d=f.getModel("viewControl"),m=o.viewGL.camera,_=this;function h(){return{type:"globeChangeCamera",alpha:v.getAlpha(),beta:v.getBeta(),distance:v.getDistance()-o.radius,center:v.getCenter(),from:_.uid,globeId:f.id}}var v=this._control;v.setViewGL(o.viewGL);var r=d.get("targetCoord"),a,p;r!=null&&(p=r[0]+90,a=r[1]),v.setFromViewControlModel(d,{baseDistance:o.radius,alpha:a,beta:p}),v.off("update"),v.on("update",function(){i.dispatchAction(h())})},_displaceVertices:function(f,i){var o=f.get("displacementQuality"),d=f.get("debug.wireframe.show"),m=f.coordinateSystem;if(!(!f.isDisplacementChanged()&&o===this._displacementQuality&&d===this._showDebugWireframe)){this._displacementQuality=o,this._showDebugWireframe=d;var _=this._sphereGeometry,h={low:100,medium:200,high:400,ultra:800}[o]||200,v=h/2;(_.widthSegments!==h||d)&&(_.widthSegments=h,_.heightSegments=v,_.build()),this._doDisplaceVertices(_,m),d&&_.generateBarycentric()}},_doDisplaceVertices:function(f,i){var o=f.attributes.position.value,d=f.attributes.texcoord0.value,m=f.__originalPosition;(!m||m.length!==o.length)&&(m=new Float32Array(o.length),m.set(o),f.__originalPosition=m);for(var _=i.displacementWidth,h=i.displacementHeight,v=i.displacementData,r=0;r<f.vertexCount;r++){var a=r*3,p=r*2,E=m[a+1],S=m[a+2],w=m[a+3],R=d[p++],O=d[p++],z=Math.round(R*(_-1)),N=Math.round(O*(h-1)),P=N*_+z,F=v?v[P]:0;o[a+1]=E+E*F,o[a+2]=S+S*F,o[a+3]=w+w*F}f.generateVertexNormals(),f.dirty(),f.updateBoundingBox()},_updateLight:function(f,i){var o=this._earthMesh;this._sceneHelper.updateLight(f);var d=this._sceneHelper.mainLight,m=f.get("light.main.time")||new Date,_=x.a.getPosition(y.a.number.parseDate(m),0,0),h=Math.cos(_.altitude);d.position.y=-h*Math.cos(_.azimuth),d.position.x=Math.sin(_.altitude),d.position.z=h*Math.sin(_.azimuth),d.lookAt(o.getWorldPosition())},dispose:function(f,i){this.groupGL.removeAll(),this._control.dispose()}})},function(re,X,D){"use strict";var W=Math.PI,y=Math.sin,L=Math.cos,A=Math.tan,s=Math.asin,x=Math.atan2,c=W/180,u=1e3*60*60*24,f=2440588,i=2451545;function o(R){return R.valueOf()/u-.5+f}function d(R){return o(R)-i}var m=c*23.4397;function _(R,O){return x(y(R)*L(m)-A(O)*y(m),L(R))}function h(R,O){return s(y(O)*L(m)+L(O)*y(m)*y(R))}function v(R,O,z){return x(y(R),L(R)*y(O)-A(z)*L(O))}function r(R,O,z){return s(y(O)*y(z)+L(O)*L(z)*L(R))}function a(R,O){return c*(280.16+360.9856235*R)-O}function p(R){return c*(357.5291+.98560028*R)}function E(R){var O=c*(1.9148*y(R)+.02*y(2*R)+3e-4*y(3*R)),z=c*102.9372;return R+O+z+W}function S(R){var O=p(R),z=E(O);return{dec:h(z,0),ra:_(z,0)}}var w={};w.getPosition=function(R,O,z){var N=c*-z,P=c*O,F=d(R),K=S(F),B=a(F,N)-K.ra;return{azimuth:v(B,P,K.dec),altitude:r(B,P,K.dec)}},X.a=w},function(re,X,D){"use strict";var W=D(194),y=D(0),L=D.n(y),A=D(41),s=D.n(A),x=D(20),c=D(3),u=D(2);function f(_,h){var v=document.createElement("canvas"),r=v.getContext("2d"),a=_.width,p=_.height;v.width=a,v.height=p,r.drawImage(_,0,0,a,p);for(var E=r.getImageData(0,0,a,p).data,S=new Float32Array(E.length/4),w=0;w<E.length/4;w++){var R=E[w*4];S[w]=R/255*h}return{data:S,width:a,height:p}}function i(_,h){var v=_.getBoxLayoutParams(),r=s.a.getLayoutRect(v,{width:h.getWidth(),height:h.getHeight()});r.y=h.getHeight()-r.y-r.height,this.viewGL.setViewport(r.x,r.y,r.width,r.height,h.getDevicePixelRatio()),this.radius=_.get("globeRadius");var a=_.get("globeOuterRadius");this.altitudeAxis&&this.altitudeAxis.setExtent(0,a-this.radius)}function o(_,h){var v=[1/0,-1/0];if(_.eachSeries(function(a){if(a.coordinateSystem===this){var p=a.getData(),E=a.coordDimToDataDim("alt")[0];if(E){var S=p.getDataExtent(E,!0);v[0]=Math.min(v[0],S[0]),v[1]=Math.max(v[1],S[1])}}},this),v&&isFinite(v[1]-v[0])){var r=L.a.helper.createScale(v,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new L.a.Axis("altitude",r),this.resize(this.model,h)}}var d={dimensions:W.a.prototype.dimensions,create:function(_,h){var v=[];return _.eachComponent("globe",function(r){r.__viewGL=r.__viewGL||new x.a;var a=new W.a;a.viewGL=r.__viewGL,r.coordinateSystem=a,a.model=r,v.push(a),a.resize=i,a.resize(r,h),a.update=o}),_.eachSeries(function(r){if(r.get("coordinateSystem")==="globe"){var a=r.getReferringComponents("globe")[0];if(a||(a=_.getComponent("globe")),!a)throw new Error('globe "'+c.a.firstNotNull(r.get("globe3DIndex"),r.get("globe3DId"),0)+'" not found');var p=a.coordinateSystem;r.coordinateSystem=p}}),_.eachComponent("globe",function(r,a){var p=r.coordinateSystem,E=r.getDisplacementTexture(),S=r.getDisplacemenScale();if(r.isDisplacementChanged()){if(r.hasDisplacement()){var w=!0;u.a.loadTexture(E,h,function(R){var O=R.image,z=f(O,S);r.setDisplacementData(z.data,z.width,z.height),w||h.dispatchAction({type:"globeUpdateDisplacment"})}),w=!1}else p.setDisplacementData(null,0,0);p.setDisplacementData(r.displacementData,r.displacementWidth,r.displacementHeight)}}),v}};L.a.registerCoordinateSystem("globe",d);var m=d},function(re,X,D){"use strict";var W=D(1),y=D.n(W),L=y.a.vec3;function A(s){this.radius=s,this.viewGL=null,this.altitudeAxis,this.displacementData=null,this.displacementWidth,this.displacementHeight}A.prototype={constructor:A,dimensions:["lng","lat","alt"],type:"globe",containPoint:function(){},setDisplacementData:function(s,x,c){this.displacementData=s,this.displacementWidth=x,this.displacementHeight=c},_getDisplacementScale:function(s,x){var c=(s+180)/360*(this.displacementWidth-1),u=(90-x)/180*(this.displacementHeight-1),f=Math.round(c)+Math.round(u)*this.displacementWidth;return this.displacementData[f]},dataToPoint:function(s,x){var c=s[0],u=s[1],f=s[2]||0,i=this.radius;this.displacementData&&(i*=1+this._getDisplacementScale(c,u)),this.altitudeAxis&&(i+=this.altitudeAxis.dataToCoord(f)),c=c*Math.PI/180,u=u*Math.PI/180;var o=Math.cos(u)*i;return x=x||[],x[0]=-o*Math.cos(c+Math.PI),x[1]=Math.sin(u)*i,x[2]=o*Math.sin(c+Math.PI),x},pointToData:function(s,x){var c=s[0],u=s[1],f=s[2],i=L.len(s);c/=i,u/=i,f/=i;var o=Math.asin(u),d=Math.atan2(f,-c);d<0&&(d=Math.PI*2+d);var m=o*180/Math.PI,_=d*180/Math.PI-180;return x=x||[],x[0]=_,x[1]=m,x[2]=i-this.radius,this.altitudeAxis&&(x[2]=this.altitudeAxis.coordToData(x[2])),x}},X.a=A},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(196),A=D(198),s=D(199);y.a.registerAction({type:"mapbox3DChangeCamera",event:"mapbox3dcamerachanged",update:"mapbox3D:updateCamera"},function(x,c){c.eachComponent({mainType:"mapbox3D",query:x},function(u){u.setMapboxCameraOption(x)})})},function(re,X,D){"use strict";var W=D(197),y=D(0),L=D.n(y),A=D(3),s=D(2),x=D(20);function c(o,d){var m=d.getWidth(),_=d.getHeight(),h=d.getDevicePixelRatio();this.viewGL.setViewport(0,0,m,_,h),this.width=m,this.height=_,this.altitudeScale=o.get("altitudeScale"),this.boxHeight=o.get("boxHeight")}function u(o,d){if(this.model.get("boxHeight")!=="auto"){var m=[1/0,-1/0];o.eachSeries(function(_){if(_.coordinateSystem===this){var h=_.getData(),v=_.coordDimToDataDim("alt")[0];if(v){var r=h.getDataExtent(v,!0);m[0]=Math.min(m[0],r[0]),m[1]=Math.max(m[1],r[1])}}},this),m&&isFinite(m[1]-m[0])&&(this.altitudeExtent=m)}}var f={dimensions:W.a.prototype.dimensions,create:function(o,d){var m=[];return o.eachComponent("mapbox3D",function(_){var h=_.__viewGL;h||(h=_.__viewGL=new x.a,h.setRootNode(new s.a.Node));var v=new W.a;v.viewGL=_.__viewGL,v.resize=c,v.resize(_,d),m.push(v),_.coordinateSystem=v,v.model=_,v.setCameraOption(_.getMapboxCameraOption()),v.update=u}),o.eachSeries(function(_){if(_.get("coordinateSystem")==="mapbox3D"){var h=_.getReferringComponents("mapbox3D")[0];if(h||(h=o.getComponent("mapbox3D")),!h)throw new Error('mapbox3D "'+A.a.firstNotNull(_.get("mapbox3DIndex"),_.get("mapbox3DId"),0)+'" not found');_.coordinateSystem=h.coordinateSystem}}),m}};L.a.registerCoordinateSystem("mapbox3D",f);var i=f},function(re,X,D){"use strict";var W=D(1),y=D.n(W),L=y.a.mat4,A=512,s=.6435011087932844,x=Math.PI,c=1/10;function u(){this.width=0,this.height=0,this.altitudeScale=1,this.boxHeight="auto",this.altitudeExtent,this.bearing=0,this.pitch=0,this.center=[0,0],this._origin,this.zoom=0,this._initialZoom}u.prototype={constructor:u,type:"mapbox3D",dimensions:["lng","lat","alt"],containPoint:function(){},setCameraOption:function(f){this.bearing=f.bearing,this.pitch=f.pitch,this.center=f.center,this.zoom=f.zoom,this._origin||(this._origin=this.projectOnTileWithScale(this.center,A)),this._initialZoom==null&&(this._initialZoom=this.zoom),this.updateTransform()},updateTransform:function(){if(this.height){var f=.5/Math.tan(s/2)*this.height*c,i=Math.max(Math.min(this.pitch,60),0)/180*Math.PI,o=s/2,d=Math.PI/2+i,m=Math.sin(o)*f/Math.sin(Math.PI-d-o),_=Math.cos(Math.PI/2-i)*m+f,h=_*1.1,v=new Float64Array(16);L.perspective(v,s,this.width/this.height,1,h),this.viewGL.camera.projectionMatrix.setArray(v),this.viewGL.camera.decomposeProjectionMatrix();var v=L.identity(new Float64Array(16)),r=this.dataToPoint(this.center);L.scale(v,v,[1,-1,1]),L.translate(v,v,[0,0,-f]),L.rotateX(v,v,i),L.rotateZ(v,v,-this.bearing/180*Math.PI),L.translate(v,v,[-r[0]*this.getScale()*c,-r[1]*this.getScale()*c,0]),this.viewGL.camera.viewMatrix.array=v;var a=new Float64Array(16);L.invert(a,v),this.viewGL.camera.worldTransform.array=a,this.viewGL.camera.decomposeWorldTransform();var p=A*this.getScale(),E;if(this.altitudeExtent&&!isNaN(this.boxHeight)){var S=this.altitudeExtent[1]-this.altitudeExtent[0];E=this.boxHeight/S*this.getScale()/Math.pow(2,this._initialZoom)}else E=p/(2*Math.PI*6378e3*Math.abs(Math.cos(this.center[1]*(Math.PI/180))))*this.altitudeScale*c;this.viewGL.rootNode.scale.set(this.getScale()*c,this.getScale()*c,E)}},getScale:function(){return Math.pow(2,this.zoom)},projectOnTile:function(f,i){return this.projectOnTileWithScale(f,this.getScale()*A,i)},projectOnTileWithScale:function(f,i,o){var d=f[0],m=f[1],_=d*x/180,h=m*x/180,v=i*(_+x)/(2*x),r=i*(x-Math.log(Math.tan(x/4+h*.5)))/(2*x);return o=o||[],o[0]=v,o[1]=r,o},unprojectFromTile:function(f,i){return this.unprojectOnTileWithScale(f,this.getScale()*A,i)},unprojectOnTileWithScale:function(f,i,o){var d=f[0],m=f[1],_=d/i*(2*x)-x,h=2*(Math.atan(Math.exp(x-m/i*(2*x)))-x/4);return o=o||[],o[0]=_*180/x,o[1]=h*180/x,o},dataToPoint:function(f,i){return i=this.projectOnTileWithScale(f,A,i),i[0]-=this._origin[0],i[1]-=this._origin[1],i[2]=isNaN(f[2])?0:f[2],isNaN(f[2])||(i[2]=f[2],this.altitudeExtent&&(i[2]-=this.altitudeExtent[0])),i}},X.a=u},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(31),A=D(32),s=["zoom","center","pitch","bearing"],x=y.a.extendComponentModel({type:"mapbox3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,style:"mapbox://styles/mapbox/light-v9",center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMapboxCameraOption:function(){var u=this;return s.reduce(function(f,i){return f[i]=u.get(i),f},{})},setMapboxCameraOption:function(u){u!=null&&s.forEach(function(f){u[f]!=null&&(this.option[f]=u[f])},this)},getMapbox:function(){return this._mapbox},setMapbox:function(u){this._mapbox=u}});y.a.util.merge(x.prototype,L.a),y.a.util.merge(x.prototype,A.a);var c=x},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(200),A=D(34),s=D(2),x=D(201);s.a.Shader.import(x.a);var c=512,u=y.a.extendComponentView({type:"mapbox3D",__ecgl__:!0,init:function(f,i){var o=i.getZr();this._zrLayer=new L.a("mapbox3D",o),o.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new s.a.Node,this._sceneHelper=new A.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var d=this._zrLayer.getMapbox(),m=this._dispatchInteractAction.bind(this,i,d);["zoom","rotate","drag","pitch","rotate","move"].forEach(function(_){d.on(_,m)}),this._groundMesh=new s.a.Mesh({geometry:new s.a.PlaneGeometry,material:new s.a.Material({shader:new s.a.Shader({vertex:s.a.Shader.source("ecgl.displayShadow.vertex"),fragment:s.a.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},render:function(f,i,o){var d=this._zrLayer.getMapbox(),m=f.get("style"),_=JSON.stringify(m);_!==this._oldStyleStr&&m&&d.setStyle(m),this._oldStyleStr=_,d.setCenter(f.get("center")),d.setZoom(f.get("zoom")),d.setPitch(f.get("pitch")),d.setBearing(f.get("bearing")),f.setMapbox(d);var h=f.coordinateSystem;h.viewGL.scene.add(this._lightRoot),h.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(h.viewGL.scene),this._sceneHelper.updateLight(f),h.viewGL.setPostEffect(f.getModel("postEffect"),o),h.viewGL.setTemporalSuperSampling(f.getModel("temporalSuperSampling")),this._mapbox3DModel=f},afterRender:function(f,i,o,d){var m=d.renderer;this._sceneHelper.updateAmbientCubemap(m,f,o),this._sceneHelper.updateSkybox(m,f,o),f.coordinateSystem.viewGL.scene.traverse(function(_){_.material&&(_.material.define("fragment","NORMAL_UP_AXIS",2),_.material.define("fragment","NORMAL_FRONT_AXIS",1))})},updateCamera:function(f,i,o,d){f.coordinateSystem.setCameraOption(d),this._updateGroundMesh(),o.getZr().refresh()},_dispatchInteractAction:function(f,i,o){f.dispatchAction({type:"mapbox3DChangeCamera",pitch:i.getPitch(),zoom:i.getZoom(),center:i.getCenter().toArray(),bearing:i.getBearing(),mapbox3DId:this._mapbox3DModel&&this._mapbox3DModel.id})},_updateGroundMesh:function(){if(this._mapbox3DModel){var f=this._mapbox3DModel.coordinateSystem,i=f.dataToPoint(f.center);this._groundMesh.position.set(i[0],i[1],-.001);var o=new s.a.Plane(new s.a.Vector3(0,0,1),0),d=f.viewGL.camera.castRay(new s.a.Vector2(-1,-1)),m=f.viewGL.camera.castRay(new s.a.Vector2(1,1)),_=d.intersectPlane(o),h=m.intersectPlane(o),v=_.dist(h)/f.viewGL.rootNode.scale.x;this._groundMesh.scale.set(v,v,1)}},dispose:function(f,i){i.getZr().delLayer(-1e3)}})},function(re,X,D){"use strict";function W(L,A){if(this.id=L,this.zr=A,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute;left:0;right:0;top:0;bottom:0;",!mapboxgl)throw new Error("Mapbox GL library must be included. See https://www.mapbox.com/mapbox-gl-js/api/");this._mapbox=new mapboxgl.Map({container:this.dom}),this._initEvents()}W.prototype.resize=function(){this._mapbox.resize()},W.prototype.getMapbox=function(){return this._mapbox},W.prototype.clear=function(){},W.prototype.refresh=function(){this._mapbox.resize()};var y=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel"];W.prototype._initEvents=function(){var L=this._mapbox.getCanvasContainer();this._handlers=this._handlers||{contextmenu:function(A){return A.preventDefault(),!1}},y.forEach(function(A){this._handlers[A]=function(s){var x={};for(var c in s)x[c]=s[c];x.bubbles=!1;var u=new s.constructor(s.type,x);L.dispatchEvent(u)},this.zr.dom.addEventListener(A,this._handlers[A])},this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},W.prototype.dispose=function(){y.forEach(function(L){this.zr.dom.removeEventListener(L,this._handlers[L])},this)},X.a=W},function(re,X,D){"use strict";X.a=`
|
|
@export ecgl.displayShadow.vertex
|
|
|
|
@import ecgl.common.transformUniforms
|
|
|
|
@import ecgl.common.uv.header
|
|
|
|
@import ecgl.common.attributes
|
|
|
|
varying vec3 v_WorldPosition;
|
|
|
|
varying vec3 v_Normal;
|
|
|
|
void main()
|
|
{
|
|
@import ecgl.common.uv.main
|
|
v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);
|
|
|
|
v_WorldPosition = (world * vec4(position, 1.0)).xyz;
|
|
gl_Position = worldViewProjection * vec4(position, 1.0);
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
@export ecgl.displayShadow.fragment
|
|
|
|
@import ecgl.common.uv.fragmentHeader
|
|
|
|
varying vec3 v_Normal;
|
|
varying vec3 v_WorldPosition;
|
|
|
|
uniform float roughness: 0.2;
|
|
|
|
#ifdef DIRECTIONAL_LIGHT_COUNT
|
|
@import clay.header.directional_light
|
|
#endif
|
|
|
|
@import ecgl.common.ssaoMap.header
|
|
|
|
@import clay.plugin.compute_shadow_map
|
|
|
|
void main()
|
|
{
|
|
float shadow = 1.0;
|
|
|
|
@import ecgl.common.ssaoMap.main
|
|
|
|
#if defined(DIRECTIONAL_LIGHT_COUNT) && defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
|
|
float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];
|
|
if(shadowEnabled)
|
|
{
|
|
computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);
|
|
}
|
|
for (int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++) {
|
|
shadow = min(shadow, shadowContribsDir[i] * 0.5 + 0.5);
|
|
}
|
|
#endif
|
|
|
|
shadow *= 0.5 + ao * 0.5;
|
|
shadow = clamp(shadow, 0.0, 1.0);
|
|
|
|
gl_FragColor = vec4(vec3(0.0), 1.0 - shadow);
|
|
}
|
|
|
|
@end`},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(203),A=D(206),s=D(208),x=D(16);y.a.registerVisual(Object(x.a)("bar3D")),y.a.registerProcessor(function(c,u){c.eachSeriesByType("bar3d",function(f){var i=f.getData();i.filterSelf(function(o){return i.hasValue(o)})})})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(4),A=D(1),s=D.n(A),x=D(204),c=D(205),u=s.a.vec3;function f(d,m){var _=d.getData(),h=d.get("minHeight")||0,v=d.get("barSize"),r=["lng","lat","alt"].map(function(E){return d.coordDimToDataDim(E)[0]});if(v==null){var a=m.radius*Math.PI,p=Object(c.a)(_,r[0],r[1]);v=[a/Math.sqrt(_.count()/p),a/Math.sqrt(_.count()/p)]}else y.a.util.isArray(v)||(v=[v,v]);_.each(r,function(E,S,w,R){var O=_.get(r[2],R,!0),z=_.stackedOn?O-w:m.altitudeAxis.scale.getExtent()[0],N=Math.max(m.altitudeAxis.dataToCoord(w),h),P=m.dataToPoint([E,S,z]),F=m.dataToPoint([E,S,O]),K=u.sub([],F,P);u.normalize(K,K);var B=[v[0],N,v[1]];_.setItemLayout(R,[P,K,B])}),_.setLayout("orient",L.a.UP.array)}function i(d,m){var _=d.getData(),h=d.get("barSize"),v=d.get("minHeight")||0,r=["lng","lat","alt"].map(function(S){return d.coordDimToDataDim(S)[0]});if(h==null){var a=Math.min(m.size[0],m.size[2]),p=Object(c.a)(_,r[0],r[1]);h=[a/Math.sqrt(_.count()/p),a/Math.sqrt(_.count()/p)]}else y.a.util.isArray(h)||(h=[h,h]);var E=[0,1,0];_.each(r,function(S,w,R,O){var z=_.get(r[2],O,!0),N=_.stackedOn?z-R:m.altitudeAxis.scale.getExtent()[0],P=Math.max(m.altitudeAxis.dataToCoord(R),v),F=m.dataToPoint([S,w,N]),K=[h[0],P,h[1]];_.setItemLayout(O,[F,E,K])}),_.setLayout("orient",[1,0,0])}function o(d,m){var _=d.getData(),h=d.coordDimToDataDim("lng")[0],v=d.coordDimToDataDim("lat")[0],r=d.coordDimToDataDim("alt")[0],a=d.get("barSize"),p=d.get("minHeight")||0;if(a==null){var E=_.getDataExtent(h),S=_.getDataExtent(v),w=m.dataToPoint([E[0],S[0]]),R=m.dataToPoint([E[1],S[1]]),O=Math.min(Math.abs(w[0]-R[0]),Math.abs(w[1]-R[1]))||1,z=Object(c.a)(_,h,v);a=[O/Math.sqrt(_.count()/z),O/Math.sqrt(_.count()/z)]}else y.a.util.isArray(a)||(a=[a,a]),a[0]/=m.getScale()/16,a[1]/=m.getScale()/16;var N=[0,0,1];_.each([h,v,r],function(P,F,K,B){var V=_.get(r,B,!0),C=_.stackedOn?V-K:0,M=m.dataToPoint([P,F,C]),H=m.dataToPoint([P,F,V]),$=Math.max(H[2]-M[2],p),q=[a[0],$,a[1]];_.setItemLayout(B,[M,N,q])}),_.setLayout("orient",[1,0,0])}y.a.registerLayout(function(d,m){d.eachSeriesByType("bar3D",function(_){var h=_.coordinateSystem,v=h&&h.type;if(v==="globe")f(_,h);else if(v==="cartesian3D")Object(x.a)(_,h);else if(v==="geo3D")i(_,h);else if(v==="mapbox3D")o(_,h);else throw h?new Error("bar3D doesn't support coordinate system "+h.type):new Error("bar3D doesn't have coordinate system.")})})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(1),A=D.n(L),s=A.a.vec3;function x(u){var f=u[0],i=u[1];return!(f>0&&i>0||f<0&&i<0)}function c(u,f){var i=u.getData(),o=u.get("barSize");if(o==null){var d=f.size,m,_,h=f.getAxis("x"),v=f.getAxis("y");h.type==="category"?m=h.getBandWidth()*.7:m=Math.round(d[0]/Math.sqrt(i.count()))*.6,v.type==="category"?_=v.getBandWidth()*.7:_=Math.round(d[1]/Math.sqrt(i.count()))*.6,o=[m,_]}else y.a.util.isArray(o)||(o=[o,o]);var r=f.getAxis("z").scale.getExtent(),a=x(r),p=["x","y","z"].map(function(E){return u.coordDimToDataDim(E)[0]});i.each(p,function(E,S,w,R){var O=i.get(p[2],R,!0),z=i.stackedOn?O-w:a?0:r[0],N=f.dataToPoint([E,S,z]),P=f.dataToPoint([E,S,O]),F=s.dist(N,P),K=[0,P[1]<N[1]?-1:1,0];Math.abs(F)===0&&(F=.1);var B=[o[0],F,o[1]];i.setItemLayout(R,[N,K,B])}),i.setLayout("orient",[1,0,0])}X.a=c},function(re,X,D){"use strict";X.a=function(W,y,L){for(var A=W.getDataExtent(y),s=W.getDataExtent(L),x=A[1]-A[0]||A[0],c=s[1]-s[0]||s[0],u=50,f=new Uint8Array(u*u),i=0;i<W.count();i++){var o=W.get(y,i),d=W.get(L,i),m=Math.floor((o-A[0])/x*(u-1)),_=Math.floor((d-s[0])/c*(u-1)),h=_*u+m;f[h]=f[h]||1}for(var v=0,i=0;i<f.length;i++)f[i]&&v++;return v/f.length}},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(3),s=D(27),x=D(207),c=D(61),u=D(1),f=D.n(u),i=f.a.vec3,o=y.a.extendChartView({type:"bar3D",__ecgl__:!0,init:function(d,m){this.groupGL=new L.a.Node,this._api=m,this._labelsBuilder=new c.a(256,256,m);var _=this;this._labelsBuilder.getLabelPosition=function(h,v,r){if(_._data){var a=_._data.getItemLayout(h),p=a[0],E=a[1],S=a[2][1];return i.scaleAndAdd([],p,E,r+S)}else return[0,0]},this._labelsBuilder.getMesh().renderOrder=100},render:function(d,m,_){var h=this._prevBarMesh;this._prevBarMesh=this._barMesh,this._barMesh=h,this._barMesh||(this._barMesh=new L.a.Mesh({geometry:new x.a,shadowDepthMaterial:new L.a.Material({shader:new L.a.Shader(L.a.Shader.source("ecgl.sm.depth.vertex"),L.a.Shader.source("ecgl.sm.depth.fragment"))}),culling:d.coordinateSystem.type==="cartesian3D",renderOrder:10,renderNormal:!0})),this.groupGL.remove(this._prevBarMesh),this.groupGL.add(this._barMesh),this.groupGL.add(this._labelsBuilder.getMesh());var v=d.coordinateSystem;if(this._doRender(d,_),v&&v.viewGL){v.viewGL.add(this.groupGL);var r=v.viewGL.isLinearSpace()?"define":"undefine";this._barMesh.material[r]("fragment","SRGB_DECODE")}this._data=d.getData(),this._labelsBuilder.updateData(this._data),this._labelsBuilder.updateLabels(),this._updateAnimation(d)},_updateAnimation:function(d){L.a.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevBarMesh,this._barMesh,d)},_doRender:function(d,m){var _=d.getData(),h=d.get("shading"),v=h!=="color",r=this,a=this._barMesh,p="ecgl."+h;(!a.material||a.material.shader.name!==p)&&(a.material=L.a.createMaterial(p,["VERTEX_COLOR"])),L.a.setMaterialFromModel(h,a.material,d,m),a.geometry.enableNormal=v,a.geometry.resetOffset();var E=d.get("bevelSize"),S=d.get("bevelSmoothness");a.geometry.bevelSegments=S,a.geometry.bevelSize=E;var w=[],R=new Float32Array(_.count()*4),O=0,F=0,z=!1;_.each(function(B){if(_.hasValue(B)){var V=_.getItemVisual(B,"color"),C=_.getItemVisual(B,"opacity");C==null&&(C=1),L.a.parseColor(V,w),w[3]*=C,R[O++]=w[0],R[O++]=w[1],R[O++]=w[2],R[O++]=w[3],w[3]>0&&(F++,w[3]<.99&&(z=!0))}}),a.geometry.setBarCount(F);var N=_.getLayout("orient"),P=this._barIndexOfData=new Int32Array(_.count()),F=0;_.each(function(B){if(!_.hasValue(B)){P[B]=-1;return}var V=_.getItemLayout(B),C=V[0],M=V[1],H=V[2],$=B*4;w[0]=R[$++],w[1]=R[$++],w[2]=R[$++],w[3]=R[$++],w[3]>0&&(r._barMesh.geometry.addBar(C,M,N,H,w,B),P[B]=F++)}),a.geometry.dirty(),a.geometry.updateBoundingBox();var K=a.material;K.transparent=z,K.depthMask=!z,a.geometry.sortTriangles=z,this._initHandler(d,m)},_initHandler:function(d,m){var _=d.getData(),h=this._barMesh,v=d.coordinateSystem.type==="cartesian3D";h.seriesIndex=d.seriesIndex;var r=-1;h.off("mousemove"),h.off("mouseout"),h.on("mousemove",function(a){var p=h.geometry.getDataIndexOfVertex(a.triangle[0]);p!==r&&(this._downplay(r),this._highlight(p),this._labelsBuilder.updateLabels([p]),v&&m.dispatchAction({type:"grid3DShowAxisPointer",value:[_.get("x",p),_.get("y",p),_.get("z",p,!0)]})),r=p,h.dataIndex=p},this),h.on("mouseout",function(a){this._downplay(r),this._labelsBuilder.updateLabels(),r=-1,h.dataIndex=-1,v&&m.dispatchAction({type:"grid3DHideAxisPointer"})},this)},_highlight:function(d){var m=this._data;if(m){var _=this._barIndexOfData[d];if(!(_<0)){var h=m.getItemModel(d),v=h.getModel("emphasis.itemStyle"),r=v.get("color"),a=v.get("opacity");if(r==null){var p=m.getItemVisual(d,"color");r=y.a.color.lift(p,-.4)}a==null&&(a=m.getItemVisual(d,"opacity"));var E=L.a.parseColor(r);E[3]*=a,this._barMesh.geometry.setColor(_,E),this._api.getZr().refresh()}}},_downplay:function(d){var m=this._data;if(m){var _=this._barIndexOfData[d];if(!(_<0)){var h=m.getItemVisual(d,"color"),v=m.getItemVisual(d,"opacity"),r=L.a.parseColor(h);r[3]*=v,this._barMesh.geometry.setColor(_,r),this._api.getZr().refresh()}}},highlight:function(d,m,_,h){this._toggleStatus("highlight",d,m,_,h)},downplay:function(d,m,_,h){this._toggleStatus("downplay",d,m,_,h)},_toggleStatus:function(d,m,_,h,v){var r=m.getData(),a=A.a.queryDataIndex(r,v),p=this;a!=null?y.a.util.each(s.a.normalizeToArray(a),function(E){d==="highlight"?this._highlight(E):this._downplay(E)},this):r.each(function(E){d==="highlight"?p._highlight(E):p._downplay(E)})},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(33),A=D(60),s=D(13),x=D(1),c=D.n(x),u=c.a.vec3,f=c.a.mat3,i=s.a.extend(function(){return{attributes:{position:new s.a.Attribute("position","float",3,"POSITION"),normal:new s.a.Attribute("normal","float",3,"NORMAL"),color:new s.a.Attribute("color","float",4,"COLOR"),prevPosition:new s.a.Attribute("prevPosition","float",3),prevNormal:new s.a.Attribute("prevNormal","float",3)},dynamic:!0,enableNormal:!1,bevelSize:1,bevelSegments:0,_dataIndices:null,_vertexOffset:0,_triangleOffset:0}},{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0},setBarCount:function(o){var d=this.enableNormal,m=this.getBarVertexCount()*o,_=this.getBarTriangleCount()*o;this.vertexCount!==m&&(this.attributes.position.init(m),d?this.attributes.normal.init(m):this.attributes.normal.value=null,this.attributes.color.init(m)),this.triangleCount!==_&&(this.indices=m>65535?new Uint32Array(_*3):new Uint16Array(_*3),this._dataIndices=new Uint32Array(m))},getBarVertexCount:function(){var o=this.bevelSize>0?this.bevelSegments:0;return o>0?this._getBevelBarVertexCount(o):this.enableNormal?24:8},getBarTriangleCount:function(){var o=this.bevelSize>0?this.bevelSegments:0;return o>0?this._getBevelBarTriangleCount(o):12},_getBevelBarVertexCount:function(o){return(o+1)*4*(o+1)*2},_getBevelBarTriangleCount:function(o){var d=o*4+3,m=o*2+1;return(d+1)*m*2+4},setColor:function(o,d){for(var m=this.getBarVertexCount(),_=m*o,h=m*(o+1),v=_;v<h;v++)this.attributes.color.set(v,d);this.dirtyAttribute("color")},getDataIndexOfVertex:function(o){return this._dataIndices?this._dataIndices[o]:null},addBar:function(){for(var o=u.create,d=u.scaleAndAdd,m=o(),_=o(),h=o(),v=o(),r=o(),a=o(),p=o(),E=[],S=[],w=0;w<8;w++)E[w]=o();for(var R=[[0,1,5,4],[2,3,7,6],[4,5,6,7],[3,2,1,0],[0,4,7,3],[1,2,6,5]],O=[0,1,2,0,2,3],z=[],w=0;w<R.length;w++)for(var N=R[w],P=0;P<2;P++){for(var F=[],K=0;K<3;K++)F.push(N[O[P*3+K]]);z.push(F)}return function(B,V,C,M,H,$){var q=this._vertexOffset;if(this.bevelSize>0&&this.bevelSegments>0)this._addBevelBar(B,V,C,M,this.bevelSize,this.bevelSegments,H);else{u.copy(h,V),u.normalize(h,h),u.cross(v,C,h),u.normalize(v,v),u.cross(_,h,v),u.normalize(v,v),u.negate(r,_),u.negate(a,h),u.negate(p,v),d(E[0],B,_,M[0]/2),d(E[0],E[0],v,M[2]/2),d(E[1],B,_,M[0]/2),d(E[1],E[1],p,M[2]/2),d(E[2],B,r,M[0]/2),d(E[2],E[2],p,M[2]/2),d(E[3],B,r,M[0]/2),d(E[3],E[3],v,M[2]/2),d(m,B,h,M[1]),d(E[4],m,_,M[0]/2),d(E[4],E[4],v,M[2]/2),d(E[5],m,_,M[0]/2),d(E[5],E[5],p,M[2]/2),d(E[6],m,r,M[0]/2),d(E[6],E[6],p,M[2]/2),d(E[7],m,r,M[0]/2),d(E[7],E[7],v,M[2]/2);var se=this.attributes;if(this.enableNormal){S[0]=_,S[1]=r,S[2]=h,S[3]=a,S[4]=v,S[5]=p;for(var ue=this._vertexOffset,pe=0;pe<R.length;pe++){for(var xe=this._triangleOffset*3,De=0;De<6;De++)this.indices[xe++]=ue+O[De];ue+=4,this._triangleOffset+=2}for(var pe=0;pe<R.length;pe++)for(var Ue=S[pe],De=0;De<4;De++){var Ge=R[pe][De];se.position.set(this._vertexOffset,E[Ge]),se.normal.set(this._vertexOffset,Ue),se.color.set(this._vertexOffset++,H)}}else{for(var pe=0;pe<z.length;pe++){for(var xe=this._triangleOffset*3,De=0;De<3;De++)this.indices[xe+De]=z[pe][De]+this._vertexOffset;this._triangleOffset++}for(var pe=0;pe<E.length;pe++)se.position.set(this._vertexOffset,E[pe]),se.color.set(this._vertexOffset++,H)}}for(var Ae=this._vertexOffset,pe=q;pe<Ae;pe++)this._dataIndices[pe]=$}}(),_addBevelBar:function(){var o=u.create(),d=u.create(),m=u.create(),_=f.create(),h=[],v=[1,-1,-1,1],r=[1,1,-1,-1],a=[2,0];return function(p,E,S,w,R,O,z){u.copy(d,E),u.normalize(d,d),u.cross(m,S,d),u.normalize(m,m),u.cross(o,d,m),u.normalize(m,m),_[0]=o[0],_[1]=o[1],_[2]=o[2],_[3]=d[0],_[4]=d[1],_[5]=d[2],_[6]=m[0],_[7]=m[1],_[8]=m[2],R=Math.min(w[0],w[2])/2*R;for(var N=0;N<3;N++)h[N]=Math.max(w[N]-R*2,0);for(var P=(w[0]-h[0])/2,F=(w[1]-h[1])/2,K=(w[2]-h[2])/2,B=[],V=[],C=this._vertexOffset,M=[],N=0;N<2;N++){M[N]=M[N]=[];for(var H=0;H<=O;H++)for(var $=0;$<4;$++){(H===0&&N===0||N===1&&H===O)&&M[N].push(C);for(var q=0;q<=O;q++){var se=q/O*Math.PI/2+Math.PI/2*$,ue=H/O*Math.PI/2+Math.PI/2*N;V[0]=P*Math.cos(se)*Math.sin(ue),V[1]=F*Math.cos(ue),V[2]=K*Math.sin(se)*Math.sin(ue),B[0]=V[0]+v[$]*h[0]/2,B[1]=V[1]+F+a[N]*h[1]/2,B[2]=V[2]+r[$]*h[2]/2,Math.abs(P-F)<1e-6&&Math.abs(F-K)<1e-6||(V[0]/=P*P,V[1]/=F*F,V[2]/=K*K),u.normalize(V,V),u.transformMat3(B,B,_),u.transformMat3(V,V,_),u.add(B,B,p),this.attributes.position.set(C,B),this.enableNormal&&this.attributes.normal.set(C,V),this.attributes.color.set(C,z),C++}}}for(var pe=O*4+3,xe=O*2+1,De=pe+1,$=0;$<xe;$++)for(var N=0;N<=pe;N++){var Ue=$*De+N+this._vertexOffset,Ge=$*De+(N+1)%De+this._vertexOffset,Ae=($+1)*De+(N+1)%De+this._vertexOffset,We=($+1)*De+N+this._vertexOffset;this.setTriangleIndices(this._triangleOffset++,[Ae,Ue,Ge]),this.setTriangleIndices(this._triangleOffset++,[Ae,We,Ue])}this.setTriangleIndices(this._triangleOffset++,[M[0][0],M[0][2],M[0][1]]),this.setTriangleIndices(this._triangleOffset++,[M[0][0],M[0][3],M[0][2]]),this.setTriangleIndices(this._triangleOffset++,[M[1][0],M[1][1],M[1][2]]),this.setTriangleIndices(this._triangleOffset++,[M[1][0],M[1][2],M[1][3]]),this._vertexOffset=C}}()});y.a.util.defaults(i.prototype,L.a),y.a.util.defaults(i.prototype,A.a),X.a=i},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(26),A=D(27),s=D(35),x=D(44),c=y.a.extendSeriesModel({type:"series.bar3D",dependencies:["globe"],visualColorAccessPath:"itemStyle.color",getInitialData:function(f,i){return Object(x.a)(this)},getFormattedLabel:function(f,i,o,d){var m=A.a.getFormattedLabel(this,f,i,o,d);return m==null&&(m=this.getData().get("z",f)),m},formatTooltip:function(f){return Object(s.a)(this,f)},defaultOption:{coordinateSystem:"cartesian3D",globeIndex:0,grid3DIndex:0,zlevel:-10,bevelSize:0,bevelSmoothness:2,onGridPlane:"xy",shading:"color",minHeight:0,itemStyle:{opacity:1},label:{show:!1,distance:2,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},emphasis:{label:{show:!0}},animationDurationUpdate:500}});y.a.util.merge(c.prototype,L.a);var u=c},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(210),A=D(211),s=D(45),x=D.n(s),c=D(16);y.a.registerVisual(x()("line3D","circle",null)),y.a.registerVisual(Object(c.a)("line3D")),y.a.registerLayout(function(u,f){u.eachSeriesByType("line3D",function(i){var o=i.getData(),d=i.coordinateSystem;if(d){if(d.type!=="cartesian3D"){console.error("line3D needs cartesian3D coordinateSystem");return}var m=new Float32Array(o.count()*3),_=[],h=[],v=d.dimensions,r=v.map(function(a){return i.coordDimToDataDim(a)[0]});d&&o.each(r,function(a,p,E,S){_[0]=a,_[1]=p,_[2]=E,d.dataToPoint(_,h),m[S*3]=h[0],m[S*3+1]=h[1],m[S*3+2]=h[2]}),o.setLayout("points",m)}})})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(35),A=D(44),s=y.a.extendSeriesModel({type:"series.line3D",dependencies:["grid3D"],visualColorAccessPath:"lineStyle.color",getInitialData:function(c,u){return Object(A.a)(this)},formatTooltip:function(c){return Object(L.a)(this,c)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,lineStyle:{width:2},animationDurationUpdate:500}}),x=s},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(3),s=D(22),x=D(9),c=D(4),u=D(212),f=D.n(u),i=D(1),o=D.n(i),d=D(40),m=o.a.vec3;L.a.Shader.import(d.a);var _=y.a.extendChartView({type:"line3D",__ecgl__:!0,init:function(h,v){this.groupGL=new L.a.Node,this._api=v},render:function(h,v,r){var a=this._prevLine3DMesh;this._prevLine3DMesh=this._line3DMesh,this._line3DMesh=a,this._line3DMesh||(this._line3DMesh=new L.a.Mesh({geometry:new s.a({useNativeLine:!1,sortTriangles:!0}),material:new L.a.Material({shader:L.a.createShader("ecgl.meshLines3D")}),renderOrder:10}),this._line3DMesh.geometry.pick=this._pick.bind(this)),this.groupGL.remove(this._prevLine3DMesh),this.groupGL.add(this._line3DMesh);var p=h.coordinateSystem;if(p&&p.viewGL){p.viewGL.add(this.groupGL);var E=p.viewGL.isLinearSpace()?"define":"undefine";this._line3DMesh.material[E]("fragment","SRGB_DECODE")}this._doRender(h,r),this._data=h.getData(),this._camera=p.viewGL.camera,this.updateCamera(),this._updateAnimation(h)},updateCamera:function(){this._updateNDCPosition()},_doRender:function(h,v){var r=h.getData(),a=this._line3DMesh;a.geometry.resetOffset();var p=r.getLayout("points"),E=[],S=new Float32Array(p.length/3*4),w=0,R=!1;r.each(function(N){var P=r.getItemVisual(N,"color"),F=r.getItemVisual(N,"opacity");F==null&&(F=1),L.a.parseColor(P,E),E[3]*=F,S[w++]=E[0],S[w++]=E[1],S[w++]=E[2],S[w++]=E[3],E[3]<.99&&(R=!0)}),a.geometry.setVertexCount(a.geometry.getPolylineVertexCount(p)),a.geometry.setTriangleCount(a.geometry.getPolylineTriangleCount(p)),a.geometry.addPolyline(p,S,A.a.firstNotNull(h.get("lineStyle.width"),1)),a.geometry.dirty(),a.geometry.updateBoundingBox();var O=a.material;O.transparent=R,O.depthMask=!R;var z=h.getModel("debug.wireframe");z.get("show")?(a.geometry.createAttribute("barycentric","float",3),a.geometry.generateBarycentric(),a.material.set("both","WIREFRAME_TRIANGLE"),a.material.set("wireframeLineColor",L.a.parseColor(z.get("lineStyle.color")||"rgba(0,0,0,0.5)")),a.material.set("wireframeLineWidth",A.a.firstNotNull(z.get("lineStyle.width"),1))):a.material.set("both","WIREFRAME_TRIANGLE"),this._points=p,this._initHandler(h,v)},_updateAnimation:function(h){L.a.updateVertexAnimation([["prevPosition","position"],["prevPositionPrev","positionPrev"],["prevPositionNext","positionNext"]],this._prevLine3DMesh,this._line3DMesh,h)},_initHandler:function(h,v){var r=h.getData(),a=h.coordinateSystem,p=this._line3DMesh,E=-1;p.seriesIndex=h.seriesIndex,p.off("mousemove"),p.off("mouseout"),p.on("mousemove",function(S){var w=a.pointToData(S.point.array),R=r.indicesOfNearest("x",w[0])[0];R!==E&&(v.dispatchAction({type:"grid3DShowAxisPointer",value:[r.get("x",R),r.get("y",R),r.get("z",R)]}),p.dataIndex=R),E=R},this),p.on("mouseout",function(S){E=-1,p.dataIndex=-1,v.dispatchAction({type:"grid3DHideAxisPointer"})},this)},_updateNDCPosition:function(){var h=new x.a,v=this._camera;x.a.multiply(h,v.projectionMatrix,v.viewMatrix);var r=this._positionNDC,a=this._points,p=a.length/3;(!r||r.length/2!==p)&&(r=this._positionNDC=new Float32Array(p*2));for(var E=[],S=0;S<p;S++){var w=S*3,R=S*2;E[0]=a[w],E[1]=a[w+1],E[2]=a[w+2],E[3]=1,m.transformMat4(E,E,h.array),r[R]=E[0]/E[3],r[R+1]=E[1]/E[3]}},_pick:function(h,v,r,a,p,E){var S=this._positionNDC,w=this._data.hostModel,R=w.get("lineStyle.width"),O=-1,z=r.viewport.width,N=r.viewport.height,P=z*.5,F=N*.5;h=(h+1)*P,v=(v+1)*F;for(var K=1;K<S.length/2;K++){var B=(S[(K-1)*2]+1)*P,V=(S[(K-1)*2+1]+1)*F,C=(S[K*2]+1)*P,M=(S[K*2+1]+1)*F;if(f.a.containStroke(B,V,C,M,R,h,v)){var H=(B-h)*(B-h)+(V-v)*(V-v),$=(C-h)*(C-h)+(M-v)*(M-v);O=H<$?K-1:K}}if(O>=0){var q=O*3,se=new c.a(this._points[q],this._points[q+1],this._points[q+2]);E.push({dataIndex:O,point:se,pointWorld:se.clone(),target:this._line3DMesh,distance:this._camera.getWorldPosition().dist(se)})}},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(re,X){function D(W,y,L,A,s,x,c){if(s===0)return!1;var u=s,f=0,i=W;if(c>y+u&&c>A+u||c<y-u&&c<A-u||x>W+u&&x>L+u||x<W-u&&x<L-u)return!1;if(W!==L)f=(y-A)/(W-L),i=(W*A-L*y)/(W-L);else return Math.abs(x-W)<=u/2;var o=f*x-c+i,d=o*o/(f*f+1);return d<=u/2*u/2}X.containStroke=D},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(214),A=D(215),s=D(45),x=D.n(s),c=D(16);y.a.registerVisual(x()("scatter3D","circle",null)),y.a.registerVisual(Object(c.a)("scatter3D")),y.a.registerLayout({seriesType:"scatter3D",reset:function(u){var f=u.coordinateSystem;if(f){var i=f.dimensions;if(i.length<3){console.error("scatter3D needs 3D coordinateSystem");return}var o=i.map(function(_){return u.coordDimToDataDim(_)[0]}),d=[],m=[];return{progress:function(_,h){for(var v=new Float32Array((_.end-_.start)*3),r=_.start;r<_.end;r++){var a=(r-_.start)*3;d[0]=h.get(o[0],r),d[1]=h.get(o[1],r),d[2]=h.get(o[2],r),f.dataToPoint(d,m),v[a]=m[0],v[a+1]=m[1],v[a+2]=m[2]}h.setLayout("points",v)}}}}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(27),A=D(35),s=D(44);y.a.extendSeriesModel({type:"series.scatter3D",dependencies:["globe","grid3D","geo3D"],visualColorAccessPath:"itemStyle.color",getInitialData:function(x,c){return Object(s.a)(this)},getFormattedLabel:function(x,c,u,f){var i=L.a.getFormattedLabel(this,x,c,u,f);if(i==null){var o=this.getData(),d=o.dimensions[o.dimensions.length-1];i=o.get(d,x)}return i},formatTooltip:function(x){return Object(A.a)(this,x)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,progressive:1e5,progressiveThreshold:1e5,grid3DIndex:0,globeIndex:0,symbol:"circle",symbolSize:10,blendMode:"source-over",label:{show:!1,position:"right",distance:5,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},itemStyle:{opacity:.8},emphasis:{label:{show:!0}},animationDurationUpdate:500}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(3),s=D(27),x=D(62);y.a.extendChartView({type:"scatter3D",__ecgl__:!0,init:function(c,u){this.groupGL=new L.a.Node,this._pointsBuilderList=[],this._currentStep=0},render:function(c,u,f){if(this.groupGL.removeAll(),!!c.getData().count()){var i=c.coordinateSystem;if(i&&i.viewGL){i.viewGL.add(this.groupGL),this._camera=i.viewGL.camera;var o=this._pointsBuilderList[0];o||(o=this._pointsBuilderList[0]=new x.a(!1,f)),this._pointsBuilderList.length=1,this.groupGL.add(o.rootNode),o.update(c,u,f),o.updateView(i.viewGL.camera)}else throw new Error("Invalid coordinate system")}},incrementalPrepareRender:function(c,u,f){var i=c.coordinateSystem;if(i&&i.viewGL)i.viewGL.add(this.groupGL),this._camera=i.viewGL.camera;else throw new Error("Invalid coordinate system");this.groupGL.removeAll(),this._currentStep=0},incrementalRender:function(c,u,f,i){if(!(c.end<=c.start)){var o=this._pointsBuilderList[this._currentStep];o||(o=new x.a(!1,i),this._pointsBuilderList[this._currentStep]=o),this.groupGL.add(o.rootNode),o.update(u,f,i,c.start,c.end),o.updateView(u.coordinateSystem.viewGL.camera),this._currentStep++}},updateCamera:function(){this._pointsBuilderList.forEach(function(c){c.updateView(this._camera)},this)},highlight:function(c,u,f,i){this._toggleStatus("highlight",c,u,f,i)},downplay:function(c,u,f,i){this._toggleStatus("downplay",c,u,f,i)},_toggleStatus:function(c,u,f,i,o){var d=u.getData(),m=A.a.queryDataIndex(d,o),_=c==="highlight";m!=null?y.a.util.each(s.a.normalizeToArray(m),function(h){for(var v=0;v<this._pointsBuilderList.length;v++){var r=this._pointsBuilderList[v];_?r.highlight(d,h):r.downplay(d,h)}},this):d.each(function(h){for(var v=0;v<this._pointsBuilderList.length;v++){var r=this._pointsBuilderList[v];_?r.highlight(d,h):r.downplay(d,h)}})},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W);function L(c,i,f){var i=i||document.createElement("canvas");i.width=c,i.height=c;var o=i.getContext("2d");return f&&f(o),i}function A(c,u,f,i){y.a.util.isArray(u)||(u=[u,u]);var o=x.getMarginByStyle(f,i),d=u[0]+o.left+o.right,m=u[1]+o.top+o.bottom,_=y.a.helper.createSymbol(c,0,0,u[0],u[1]),h=Math.max(d,m);_.position=[o.left,o.top],d>m?_.position[1]+=(h-m)/2:_.position[0]+=(h-d)/2;var v=_.getBoundingRect();return _.position[0]-=v.x,_.position[1]-=v.y,_.setStyle(f),_.update(),_.__size=h,_}function s(c,u,f){var i=u.width,o=u.height,d=c.canvas.width,m=c.canvas.height,_=i/d,h=o/m;function v(O){return O<128?1:-1}function r(O,z){var N=1/0;O=Math.floor(O*_),z=Math.floor(z*h);for(var P=z*i+O,F=u.data[P*4],K=v(F),B=Math.max(z-f,0);B<Math.min(z+f,o);B++)for(var V=Math.max(O-f,0);V<Math.min(O+f,i);V++){var P=B*i+V,C=u.data[P*4],M=v(C),H=V-O,$=B-z;if(K!==M){var q=H*H+$*$;q<N&&(N=q)}}return K*Math.sqrt(N)}for(var a=c.createImageData(d,m),p=0;p<m;p++)for(var E=0;E<d;E++){var S=r(E,p),w=S/f*.5+.5,R=(p*d+E)*4;a.data[R++]=(1-w)*255,a.data[R++]=(1-w)*255,a.data[R++]=(1-w)*255,a.data[R++]=255}return a}var x={getMarginByStyle:function(c){var u=c.minMargin||0,f=0;c.stroke&&c.stroke!=="none"&&(f=c.lineWidth==null?1:c.lineWidth);var i=c.shadowBlur||0,o=c.shadowOffsetX||0,d=c.shadowOffsetY||0,m={};return m.left=Math.max(f/2,-o+i,u),m.right=Math.max(f/2,o+i,u),m.top=Math.max(f/2,-d+i,u),m.bottom=Math.max(f/2,d+i,u),m},createSymbolSprite:function(c,u,f,i){var o=A(c,u,f),d=x.getMarginByStyle(f);return{image:L(o.__size,i,function(m){o.brush(m)}),margin:d}},createSDFFromCanvas:function(c,u,f,i){return L(u,i,function(o){var d=c.getContext("2d"),m=d.getImageData(0,0,c.width,c.height);o.putImageData(s(o,m,f),0,0)})},createSimpleSprite:function(c,u){return L(c,u,function(f){var i=c/2;f.beginPath(),f.arc(i,i,60,0,Math.PI*2,!1),f.closePath();var o=f.createRadialGradient(i,i,0,i,i,i);o.addColorStop(0,"rgba(255, 255, 255, 1)"),o.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),o.addColorStop(1,"rgba(255, 255, 255, 0)"),f.fillStyle=o,f.fill()})}};X.a=x},function(re,X,D){"use strict";var W=D(2),y=D(218),L=D(0),A=D.n(L),s=D(1),x=D.n(s),c=D(219),u=x.a.vec4;W.a.Shader.import(c.a);var f=W.a.Mesh.extend(function(){var i=new W.a.Geometry({dynamic:!0,attributes:{color:new W.a.Geometry.Attribute("color","float",4,"COLOR"),position:new W.a.Geometry.Attribute("position","float",3,"POSITION"),size:new W.a.Geometry.Attribute("size","float",1),prevPosition:new W.a.Geometry.Attribute("prevPosition","float",3),prevSize:new W.a.Geometry.Attribute("prevSize","float",1)}});A.a.util.extend(i,y.a);var o=new W.a.Material({shader:W.a.createShader("ecgl.sdfSprite"),transparent:!0,depthMask:!1});o.enableTexture("sprite"),o.define("both","VERTEX_COLOR"),o.define("both","VERTEX_SIZE");var d=new W.a.Texture2D({image:document.createElement("canvas"),flipY:!1});return o.set("sprite",d),i.pick=this._pick.bind(this),{geometry:i,material:o,mode:W.a.Mesh.POINTS,sizeScale:1}},{_pick:function(i,o,d,m,_,h){var v=this._positionNDC;if(v)for(var r=d.viewport,a=2/r.width,p=2/r.height,E=this.geometry.vertexCount-1;E>=0;E--){var S;this.geometry.indices?S=this.geometry.indices[E]:S=E;var w=v[S*2],R=v[S*2+1],O=this.geometry.attributes.size.get(S)/this.sizeScale,z=O/2;if(i>w-z*a&&i<w+z*a&&o>R-z*p&&o<R+z*p){var N=new W.a.Vector3,P=new W.a.Vector3;this.geometry.attributes.position.get(S,N.array),W.a.Vector3.transformMat4(P,N,this.worldTransform),h.push({vertexIndex:S,point:N,pointWorld:P,target:this,distance:P.distance(m.getWorldPosition())})}}},updateNDCPosition:function(i,o,d){var m=this._positionNDC,_=this.geometry;(!m||m.length/2!==_.vertexCount)&&(m=this._positionNDC=new Float32Array(_.vertexCount*2));for(var h=u.create(),v=0;v<_.vertexCount;v++)_.attributes.position.get(v,h),h[3]=1,u.transformMat4(h,h,i.array),u.scale(h,h,1/h[3]),m[v*2]=h[0],m[v*2+1]=h[1]}});X.a=f},function(re,X,D){"use strict";var W=D(81),y=D(1),L=D.n(y),A=L.a.vec3;X.a={needsSortVertices:function(){return this.sortVertices},needsSortVerticesProgressively:function(){return this.needsSortVertices()&&this.vertexCount>=2e4},doSortVertices:function(s,x){var c=this.indices,u=A.create();if(!c){c=this.indices=this.vertexCount>65535?new Uint32Array(this.vertexCount):new Uint16Array(this.vertexCount);for(var f=0;f<c.length;f++)c[f]=f}if(x===0){var i=this.attributes.position,s=s.array,o=0;(!this._zList||this._zList.length!==this.vertexCount)&&(this._zList=new Float32Array(this.vertexCount));for(var d,f=0;f<this.vertexCount;f++){i.get(f,u);var m=A.sqrDist(u,s);isNaN(m)&&(m=1e7,o++),f===0?(d=m,m=0):m=m-d,this._zList[f]=m}this._noneCount=o}if(this.vertexCount<2e4)x===0&&this._simpleSort(this._noneCount/this.vertexCount>.05);else for(var f=0;f<3;f++)this._progressiveQuickSort(x*3+f);this.dirtyIndices()},_simpleSort:function(s){var x=this._zList,c=this.indices;function u(f,i){return x[i]-x[f]}s?Array.prototype.sort.call(c,u):W.a.sort(c,u,0,c.length-1)},_progressiveQuickSort:function(s){var x=this._zList,c=this.indices;this._quickSort=this._quickSort||new W.a,this._quickSort.step(c,function(u,f){return x[f]-x[u]},s)}}},function(re,X,D){"use strict";X.a=`@export ecgl.sdfSprite.vertex
|
|
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
uniform float elapsedTime : 0;
|
|
|
|
attribute vec3 position : POSITION;
|
|
|
|
#ifdef VERTEX_SIZE
|
|
attribute float size;
|
|
#else
|
|
uniform float u_Size;
|
|
#endif
|
|
|
|
#ifdef VERTEX_COLOR
|
|
attribute vec4 a_FillColor: COLOR;
|
|
varying vec4 v_Color;
|
|
#endif
|
|
|
|
#ifdef VERTEX_ANIMATION
|
|
attribute vec3 prevPosition;
|
|
attribute float prevSize;
|
|
uniform float percent : 1.0;
|
|
#endif
|
|
|
|
|
|
#ifdef POSITIONTEXTURE_ENABLED
|
|
uniform sampler2D positionTexture;
|
|
#endif
|
|
|
|
varying float v_Size;
|
|
|
|
void main()
|
|
{
|
|
|
|
#ifdef POSITIONTEXTURE_ENABLED
|
|
gl_Position = worldViewProjection * vec4(texture2D(positionTexture, position.xy).xy, -10.0, 1.0);
|
|
#else
|
|
|
|
#ifdef VERTEX_ANIMATION
|
|
vec3 pos = mix(prevPosition, position, percent);
|
|
#else
|
|
vec3 pos = position;
|
|
#endif
|
|
gl_Position = worldViewProjection * vec4(pos, 1.0);
|
|
#endif
|
|
|
|
#ifdef VERTEX_SIZE
|
|
#ifdef VERTEX_ANIMATION
|
|
v_Size = mix(prevSize, size, percent);
|
|
#else
|
|
v_Size = size;
|
|
#endif
|
|
#else
|
|
v_Size = u_Size;
|
|
#endif
|
|
|
|
#ifdef VERTEX_COLOR
|
|
v_Color = a_FillColor;
|
|
#endif
|
|
|
|
gl_PointSize = v_Size;
|
|
}
|
|
|
|
@end
|
|
|
|
@export ecgl.sdfSprite.fragment
|
|
|
|
uniform vec4 color: [1, 1, 1, 1];
|
|
uniform vec4 strokeColor: [1, 1, 1, 1];
|
|
uniform float smoothing: 0.07;
|
|
|
|
uniform float lineWidth: 0.0;
|
|
|
|
#ifdef VERTEX_COLOR
|
|
varying vec4 v_Color;
|
|
#endif
|
|
|
|
varying float v_Size;
|
|
|
|
uniform sampler2D sprite;
|
|
|
|
@import clay.util.srgb
|
|
|
|
void main()
|
|
{
|
|
gl_FragColor = color;
|
|
|
|
vec4 _strokeColor = strokeColor;
|
|
|
|
#ifdef VERTEX_COLOR
|
|
gl_FragColor *= v_Color;
|
|
#endif
|
|
|
|
#ifdef SPRITE_ENABLED
|
|
float d = texture2D(sprite, gl_PointCoord).r;
|
|
gl_FragColor.a *= smoothstep(0.5 - smoothing, 0.5 + smoothing, d);
|
|
|
|
if (lineWidth > 0.0) {
|
|
float sLineWidth = lineWidth / 2.0;
|
|
|
|
float outlineMaxValue0 = 0.5 + sLineWidth;
|
|
float outlineMaxValue1 = 0.5 + sLineWidth + smoothing;
|
|
float outlineMinValue0 = 0.5 - sLineWidth - smoothing;
|
|
float outlineMinValue1 = 0.5 - sLineWidth;
|
|
|
|
if (d <= outlineMaxValue1 && d >= outlineMinValue0) {
|
|
float a = _strokeColor.a;
|
|
if (d <= outlineMinValue1) {
|
|
a = a * smoothstep(outlineMinValue0, outlineMinValue1, d);
|
|
}
|
|
else {
|
|
a = a * smoothstep(outlineMaxValue1, outlineMaxValue0, d);
|
|
}
|
|
gl_FragColor.rgb = mix(gl_FragColor.rgb * gl_FragColor.a, _strokeColor.rgb, a);
|
|
gl_FragColor.a = gl_FragColor.a * (1.0 - a) + a;
|
|
}
|
|
}
|
|
#endif
|
|
|
|
#ifdef SRGB_DECODE
|
|
gl_FragColor = sRGBToLinear(gl_FragColor);
|
|
#endif
|
|
}
|
|
@end`},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(221),A=D(222),s=D(225),x=D(16);y.a.registerVisual(Object(x.a)("lines3D")),y.a.registerAction({type:"lines3DPauseEffect",event:"lines3deffectpaused",update:"series.lines3D:pauseEffect"},function(){}),y.a.registerAction({type:"lines3DResumeEffect",event:"lines3deffectresumed",update:"series.lines3D:resumeEffect"},function(){}),y.a.registerAction({type:"lines3DToggleEffect",event:"lines3deffectchanged",update:"series.lines3D:toggleEffect"},function(){})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(1),A=D.n(L),s=A.a.vec3,x=A.a.vec2,c=s.normalize,u=s.cross,f=s.sub,i=s.add,o=s.create,d=o(),m=o(),_=o(),h=o(),v=[],r=[];function a(O,z){x.copy(v,O[0]),x.copy(r,O[1]);var N=[],P=N[0]=o(),F=N[1]=o(),K=N[2]=o(),B=N[3]=o();z.dataToPoint(v,P),z.dataToPoint(r,B),c(d,P),f(m,B,P),c(m,m),u(_,m,d),c(_,_),u(m,d,_),i(F,d,m),c(F,F),c(d,B),f(m,P,B),c(m,m),u(_,m,d),c(_,_),u(m,d,_),i(K,d,m),c(K,K),i(h,P,B),c(h,h);var V=s.dot(P,h),C=s.dot(h,F),M=(Math.max(s.len(P),s.len(B))-V)/C*2;return s.scaleAndAdd(F,P,F,M),s.scaleAndAdd(K,B,K,M),N}function p(O,z,N){var P=[],F=P[0]=s.create(),K=P[1]=s.create(),B=P[2]=s.create(),V=P[3]=s.create();z.dataToPoint(O[0],F),z.dataToPoint(O[1],V);var C=s.dist(F,V);return s.lerp(K,F,V,.3),s.lerp(B,F,V,.3),s.scaleAndAdd(K,K,N,Math.min(C*.1,10)),s.scaleAndAdd(B,B,N,Math.min(C*.1,10)),P}function E(O,z){for(var N=new Float32Array(O.length*3),P=0,F=[],K=0;K<O.length;K++)z.dataToPoint(O[K],F),N[P++]=F[0],N[P++]=F[1],N[P++]=F[2];return N}function S(O){var z=[];return O.each(function(N){var P=O.getItemModel(N),F=P.option instanceof Array?P.option:P.getShallow("coords",!0);if(!(F instanceof Array&&F.length>0&&F[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(F)+". Lines must have 2d coords array in data item.");z.push(F)}),{coordsList:z}}function w(O,z){var N=O.getData(),P=O.get("polyline");N.setLayout("lineType",P?"polyline":"cubicBezier");var F=S(N);N.each(function(K){var B=F.coordsList[K],V=P?E:a;N.setItemLayout(K,V(B,z))})}function R(O,z,N){var P=O.getData(),F=O.get("polyline"),K=S(P);P.setLayout("lineType",F?"polyline":"cubicBezier"),P.each(function(B){var V=K.coordsList[B],C=F?E(V,z):p(V,z,N);P.setItemLayout(B,C)})}y.a.registerLayout(function(O,z){O.eachSeriesByType("lines3D",function(N){var P=N.coordinateSystem;P.type==="globe"?w(N,P):P.type==="geo3D"?R(N,P,[0,1,0]):P.type==="mapbox3D"&&R(N,P,[0,0,1])})})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(22),s=D(223),x=D(40);L.a.Shader.import(x.a);function c(f){return f.radius!=null?f.radius:f.size!=null?Math.max(f.size[0],f.size[1],f.size[2]):100}var u=y.a.extendChartView({type:"lines3D",__ecgl__:!0,init:function(f,i){this.groupGL=new L.a.Node,this._meshLinesMaterial=new L.a.Material({shader:L.a.createShader("ecgl.meshLines3D"),transparent:!0,depthMask:!1}),this._linesMesh=new L.a.Mesh({geometry:new A.a,material:this._meshLinesMaterial,$ignorePicking:!0}),this._trailMesh=new s.a},render:function(f,i,o){this.groupGL.add(this._linesMesh);var d=f.coordinateSystem,m=f.getData();if(d&&d.viewGL){var _=d.viewGL;_.add(this.groupGL),this._updateLines(f,i,o);var h=d.viewGL.isLinearSpace()?"define":"undefine";this._linesMesh.material[h]("fragment","SRGB_DECODE"),this._trailMesh.material[h]("fragment","SRGB_DECODE")}var v=this._trailMesh;if(v.stopAnimation(),f.get("effect.show")){this.groupGL.add(v),v.updateData(m,o,this._linesMesh.geometry),v.__time=v.__time||0;var r=3600*1e3;this._curveEffectsAnimator=v.animate("",{loop:!0}).when(r,{__time:r}).during(function(){v.setAnimationTime(v.__time)}).start()}else this.groupGL.remove(v),this._curveEffectsAnimator=null;this._linesMesh.material.blend=this._trailMesh.material.blend=f.get("blendMode")==="lighter"?L.a.additiveBlend:null},pauseEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.pause()},resumeEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.resume()},toggleEffect:function(){var f=this._curveEffectsAnimator;f&&(f.isPaused()?f.resume():f.pause())},_updateLines:function(f,i,o){var d=f.getData(),m=f.coordinateSystem,_=this._linesMesh.geometry,h=f.get("polyline");_.expandLine=!0;var v=c(m);_.segmentScale=v/20;var r="lineStyle.width".split("."),a=o.getDevicePixelRatio(),p=0;d.each(function(R){var O=d.getItemModel(R),z=O.get(r);z==null&&(z=1),d.setItemVisual(R,"lineWidth",z),p=Math.max(z,p)}),_.useNativeLine=!1;var E=0,S=0;d.each(function(R){var O=d.getItemLayout(R);h?(E+=_.getPolylineVertexCount(O),S+=_.getPolylineTriangleCount(O)):(E+=_.getCubicCurveVertexCount(O[0],O[1],O[2],O[3]),S+=_.getCubicCurveTriangleCount(O[0],O[1],O[2],O[3]))}),_.setVertexCount(E),_.setTriangleCount(S),_.resetOffset();var w=[];d.each(function(R){var O=d.getItemLayout(R),z=d.getItemVisual(R,"color"),N=d.getItemVisual(R,"opacity"),P=d.getItemVisual(R,"lineWidth")*a;N==null&&(N=1),w=L.a.parseColor(z,w),w[3]*=N,h?_.addPolyline(O,w,P):_.addCubicCurve(O[0],O[1],O[2],O[3],w,P)}),_.dirty()},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(1),s=D.n(A),x=D(22),c=D(224),u=s.a.vec3;function f(i){return i>0?1:-1}L.a.Shader.import(c.a),X.a=L.a.Mesh.extend(function(){var i=new L.a.Material({shader:new L.a.Shader(L.a.Shader.source("ecgl.trail2.vertex"),L.a.Shader.source("ecgl.trail2.fragment")),transparent:!0,depthMask:!1}),o=new x.a({dynamic:!0});return o.createAttribute("dist","float",1),o.createAttribute("distAll","float",1),o.createAttribute("start","float",1),{geometry:o,material:i,culling:!1,$ignorePicking:!0}},{updateData:function(i,o,d){var m=i.hostModel,_=this.geometry,h=m.getModel("effect"),v=h.get("trailWidth")*o.getDevicePixelRatio(),r=h.get("trailLength"),a=m.get("effect.constantSpeed"),p=m.get("effect.period")*1e3,E=a!=null;this.getScene()||console.error("TrailMesh must been add to scene before updateData"),E?this.material.set("speed",a/1e3):this.material.set("period",p),this.material[E?"define":"undefine"]("vertex","CONSTANT_SPEED");var S=m.get("polyline");_.trailLength=r,this.material.set("trailLength",r),_.resetOffset(),["position","positionPrev","positionNext"].forEach(function(M){_.attributes[M].value=d.attributes[M].value});var w=["dist","distAll","start","offset","color"];w.forEach(function(M){_.attributes[M].init(_.vertexCount)}),_.indices=d.indices;var R=[],O=h.get("trailColor"),z=h.get("trailOpacity"),N=O!=null,P=z!=null;this.updateWorldTransform();var F=this.worldTransform.x.len(),K=this.worldTransform.y.len(),B=this.worldTransform.z.len(),V=0,C=0;i.each(function(M){var H=i.getItemLayout(M),$=P?z:i.getItemVisual(M,"opacity"),q=i.getItemVisual(M,"color");$==null&&($=1),R=L.a.parseColor(N?O:q,R),R[3]*=$;for(var se=S?d.getPolylineVertexCount(H):d.getCubicCurveVertexCount(H[0],H[1],H[2],H[3]),ue=0,pe=[],xe=[],De=V;De<V+se;De++)_.attributes.position.get(De,pe),pe[0]*=F,pe[1]*=K,pe[2]*=B,De>V&&(ue+=u.dist(pe,xe)),_.attributes.dist.set(De,ue),u.copy(xe,pe);C=Math.max(C,ue);for(var Ue=Math.random()*(E?ue:p),De=V;De<V+se;De++)_.attributes.distAll.set(De,ue),_.attributes.start.set(De,Ue),_.attributes.offset.set(De,f(d.attributes.offset.get(De))*v/2),_.attributes.color.set(De,R);V+=se}),this.material.set("spotSize",C*.1*r),this.material.set("spotIntensity",h.get("spotIntensity")),_.dirty()},setAnimationTime:function(i){this.material.set("time",i)}})},function(re,X,D){"use strict";X.a=`@export ecgl.trail2.vertex
|
|
attribute vec3 position: POSITION;
|
|
attribute vec3 positionPrev;
|
|
attribute vec3 positionNext;
|
|
attribute float offset;
|
|
attribute float dist;
|
|
attribute float distAll;
|
|
attribute float start;
|
|
|
|
attribute vec4 a_Color : COLOR;
|
|
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
uniform vec4 viewport : VIEWPORT;
|
|
uniform float near : NEAR;
|
|
|
|
uniform float speed : 0;
|
|
uniform float trailLength: 0.3;
|
|
uniform float time;
|
|
uniform float period: 1000;
|
|
|
|
uniform float spotSize: 1;
|
|
|
|
varying vec4 v_Color;
|
|
varying float v_Percent;
|
|
varying float v_SpotPercent;
|
|
|
|
@import ecgl.common.wireframe.vertexHeader
|
|
|
|
@import ecgl.lines3D.clipNear
|
|
|
|
void main()
|
|
{
|
|
@import ecgl.lines3D.expandLine
|
|
|
|
gl_Position = currProj;
|
|
|
|
v_Color = a_Color;
|
|
|
|
@import ecgl.common.wireframe.vertexMain
|
|
|
|
#ifdef CONSTANT_SPEED
|
|
float t = mod((speed * time + start) / distAll, 1. + trailLength) - trailLength;
|
|
#else
|
|
float t = mod((time + start) / period, 1. + trailLength) - trailLength;
|
|
#endif
|
|
|
|
float trailLen = distAll * trailLength;
|
|
|
|
v_Percent = (dist - t * distAll) / trailLen;
|
|
|
|
v_SpotPercent = spotSize / distAll;
|
|
|
|
}
|
|
@end
|
|
|
|
|
|
@export ecgl.trail2.fragment
|
|
|
|
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
|
|
uniform float spotIntensity: 5;
|
|
|
|
varying vec4 v_Color;
|
|
varying float v_Percent;
|
|
varying float v_SpotPercent;
|
|
|
|
@import ecgl.common.wireframe.fragmentHeader
|
|
|
|
@import clay.util.srgb
|
|
|
|
void main()
|
|
{
|
|
if (v_Percent > 1.0 || v_Percent < 0.0) {
|
|
discard;
|
|
}
|
|
|
|
float fade = v_Percent;
|
|
|
|
#ifdef SRGB_DECODE
|
|
gl_FragColor = sRGBToLinear(color * v_Color);
|
|
#else
|
|
gl_FragColor = color * v_Color;
|
|
#endif
|
|
|
|
@import ecgl.common.wireframe.fragmentMain
|
|
|
|
if (v_Percent > (1.0 - v_SpotPercent)) {
|
|
gl_FragColor.rgb *= spotIntensity;
|
|
}
|
|
|
|
gl_FragColor.a *= fade;
|
|
}
|
|
|
|
@end`},function(re,X,D){"use strict";var W=D(0),y=D.n(W);y.a.extendSeriesModel({type:"series.lines3D",dependencies:["globe"],visualColorAccessPath:"lineStyle.color",getInitialData:function(L,A){var s=new y.a.List(["value"],this);return s.hasItemOption=!1,s.initData(L.data,[],function(x,c,u,f){if(x instanceof Array)return NaN;s.hasItemOption=!0;var i=x.value;if(i!=null)return i instanceof Array?i[f]:i}),s},defaultOption:{coordinateSystem:"globe",globeIndex:0,geo3DIndex:0,zlevel:-10,polyline:!1,effect:{show:!1,period:4,trailWidth:4,trailLength:.2,spotIntensity:6},silent:!0,blendMode:"source-over",lineStyle:{width:1,opacity:.5}}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(227),A=D(228),s=D(16);y.a.registerVisual(Object(s.a)("polygons3D"))},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(26);function A(c,u){for(var f=[],i=0;i<u.length;i++)f.push(c.dataToPoint(u[i]));return f}var s=y.a.extendSeriesModel({type:"series.polygons3D",getRegionModel:function(c){return this.getData().getItemModel(c)},getRegionPolygonCoords:function(c){var u=this.coordinateSystem,f=this.getData().getItemModel(c),i=f.option instanceof Array?f.option:f.getShallow("coords");f.get("multiPolygon")||(i=[i]);for(var o=[],d=0;d<i.length;d++){for(var m=[],_=1;_<i[d].length;_++)m.push(A(u,i[d][_]));o.push({exterior:A(u,i[d][0]),interiors:m})}return o},getInitialData:function(c){var u=new y.a.List(["value"],this);return u.hasItemOption=!1,u.initData(c.data,[],function(f,i,o,d){if(f instanceof Array)return NaN;u.hasItemOption=!0;var m=f.value;if(m!=null)return m instanceof Array?m[d]:m}),u},defaultOption:{show:!0,data:null,multiPolygon:!1,progressiveThreshold:1e3,progressive:1e3,zlevel:-10,label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}});y.a.util.merge(s.prototype,L.a);var x=s},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(59),A=D(2);y.a.extendChartView({type:"polygons3D",__ecgl__:!0,init:function(s,x){this.groupGL=new A.a.Node,this._geo3DBuilderList=[],this._currentStep=0},render:function(s,x,c){this.groupGL.removeAll();var u=s.coordinateSystem;u&&u.viewGL&&u.viewGL.add(this.groupGL);var f=this._geo3DBuilderList[0];f||(f=new L.a(c),f.extrudeY=u.type!=="mapbox3D",this._geo3DBuilderList[0]=f),this._updateShaderDefines(u,f),f.update(s,x,c),this._geo3DBuilderList.length=1,this.groupGL.add(f.rootNode)},incrementalPrepareRender:function(s,x,c){this.groupGL.removeAll();var u=s.coordinateSystem;u&&u.viewGL&&u.viewGL.add(this.groupGL),this._currentStep=0},incrementalRender:function(s,x,c,u){var f=this._geo3DBuilderList[this._currentStep],i=x.coordinateSystem;f||(f=new L.a(u),f.extrudeY=i.type!=="mapbox3D",this._geo3DBuilderList[this._currentStep]=f),f.update(x,c,u,s.start,s.end),this.groupGL.add(f.rootNode),this._updateShaderDefines(i,f),this._currentStep++},_updateShaderDefines:function(s,x){var c=s.viewGL.isLinearSpace()?"define":"undefine";x.rootNode.traverse(function(u){u.material&&(u.material[c]("fragment","SRGB_DECODE"),s.type==="mapbox3D"&&(u.material.define("fragment","NORMAL_UP_AXIS",2),u.material.define("fragment","NORMAL_FRONT_AXIS",1)))})},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(230),A=D(231),s=D(232),x=D(16);y.a.registerVisual(Object(x.a)("surface"))},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(26),A=D(35),s=D(44),x=y.a.extendSeriesModel({type:"series.surface",dependencies:["globe","grid3D","geo3D"],visualColorAccessPath:"itemStyle.color",formatTooltip:function(u){return Object(A.a)(this,u)},getInitialData:function(u,f){var i=u.data;function o(H){return!(isNaN(H.min)||isNaN(H.max)||isNaN(H.step))}function d(H){var $=y.a.number.getPrecisionSafe;return Math.max($(H.min),$(H.max),$(H.step))+1}if(!i)if(i=[],u.parametric){var R=u.parametricEquation||{},O=R.u||{},z=R.v||{};["u","v"].forEach(function(H){if(!o(R[H])){console.error("Invalid parametricEquation.%s",H);return}}),["x","y","z"].forEach(function(H){if(typeof R[H]!="function"){console.error("parametricEquation.%s needs to be function",H);return}});for(var N=d(O),P=d(z),F=z.min;F<z.max+z.step*.999;F+=z.step)for(var K=O.min;K<O.max+O.step*.999;K+=O.step){var B=y.a.number.round(Math.min(K,O.max),N),V=y.a.number.round(Math.min(F,z.max),P),p=R.x(B,V),a=R.y(B,V),w=R.z(B,V);i.push([p,a,w,B,V])}}else{var m=u.equation||{},_=m.x||{},h=m.y||{};if(["x","y"].forEach(function(H){if(!o(m[H])){console.error("Invalid equation.%s",H);return}}),typeof m.z!="function"){console.error("equation.z needs to be function");return}for(var v=d(_),r=d(h),a=h.min;a<h.max+h.step*.999;a+=h.step)for(var p=_.min;p<_.max+_.step*.999;p+=_.step){var E=y.a.number.round(Math.min(p,_.max),v),S=y.a.number.round(Math.min(a,h.max),r),w=m.z(E,S);i.push([E,S,w])}}var C=["x","y","z"];u.parametric&&C.push("u","v");var M=Object(s.a)(this,C,u.data||i);return M},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,shading:"lambert",parametric:!1,wireframe:{show:!0,lineStyle:{color:"rgba(0,0,0,0.5)",width:1}},equation:{x:{min:-1,max:1,step:.1},y:{min:-1,max:1,step:.1},z:null},parametricEquation:{u:{min:-1,max:1,step:.1},v:{min:-1,max:1,step:.1},x:null,y:null,z:null},itemStyle:{},animationDurationUpdate:500}});y.a.util.merge(x.prototype,L.a);var c=x},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(3),s=D(1),x=D.n(s),c=D(60),u=x.a.vec3;function f(i){return isNaN(i[0])||isNaN(i[1])||isNaN(i[2])}y.a.extendChartView({type:"surface",__ecgl__:!0,init:function(i,o){this.groupGL=new L.a.Node},render:function(i,o,d){var m=this._prevSurfaceMesh;this._prevSurfaceMesh=this._surfaceMesh,this._surfaceMesh=m,this._surfaceMesh||(this._surfaceMesh=this._createSurfaceMesh()),this.groupGL.remove(this._prevSurfaceMesh),this.groupGL.add(this._surfaceMesh);var _=i.coordinateSystem,h=i.get("shading"),v=i.getData(),r="ecgl."+h;if((!this._surfaceMesh.material||this._surfaceMesh.material.shader.name!==r)&&(this._surfaceMesh.material=L.a.createMaterial(r,["VERTEX_COLOR","DOUBLE_SIDED"])),L.a.setMaterialFromModel(h,this._surfaceMesh.material,i,d),_&&_.viewGL){_.viewGL.add(this.groupGL);var a=_.viewGL.isLinearSpace()?"define":"undefine";this._surfaceMesh.material[a]("fragment","SRGB_DECODE")}var p=i.get("parametric"),E=this._getDataShape(v,p),S=i.getModel("wireframe"),w=S.get("lineStyle.width"),R=S.get("show")&&w>0;this._updateSurfaceMesh(this._surfaceMesh,i,E,R);var O=this._surfaceMesh.material;R?(O.define("WIREFRAME_QUAD"),O.set("wireframeLineWidth",w),O.set("wireframeLineColor",L.a.parseColor(S.get("lineStyle.color")))):O.undefine("WIREFRAME_QUAD"),this._initHandler(i,d),this._updateAnimation(i)},_updateAnimation:function(i){L.a.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,i)},_createSurfaceMesh:function(){var i=new L.a.Mesh({geometry:new L.a.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new L.a.Material({shader:new L.a.Shader(L.a.Shader.source("ecgl.sm.depth.vertex"),L.a.Shader.source("ecgl.sm.depth.fragment"))}),culling:!1,renderOrder:10,renderNormal:!0});return i.geometry.createAttribute("barycentric","float",4),i.geometry.createAttribute("prevPosition","float",3),i.geometry.createAttribute("prevNormal","float",3),y.a.util.extend(i.geometry,c.a),i},_initHandler:function(i,o){var d=i.getData(),m=this._surfaceMesh,_=i.coordinateSystem;function h(r,a){for(var p=1/0,E=-1,S=[],w=0;w<r.length;w++){m.geometry.attributes.position.get(r[w],S);var R=u.dist(a.array,S);R<p&&(p=R,E=r[w])}return E}m.seriesIndex=i.seriesIndex;var v=-1;m.off("mousemove"),m.off("mouseout"),m.on("mousemove",function(r){var a=h(r.triangle,r.point);if(a>=0){var p=[];m.geometry.attributes.position.get(a,p);for(var E=_.pointToData(p),S=1/0,w=-1,R=[],O=0;O<d.count();O++){R[0]=d.get("x",O),R[1]=d.get("y",O),R[2]=d.get("z",O);var z=u.squaredDistance(R,E);z<S&&(w=O,S=z)}w!==v&&o.dispatchAction({type:"grid3DShowAxisPointer",value:E}),v=w,m.dataIndex=w}else m.dataIndex=-1},this),m.on("mouseout",function(r){v=-1,m.dataIndex=-1,o.dispatchAction({type:"grid3DHideAxisPointer"})},this)},_updateSurfaceMesh:function(i,o,d,m){var _=i.geometry,h=o.getData(),v=h.getLayout("points"),r=0;h.each(function(Te){h.hasValue(Te)||r++});var a=r||m,p=_.attributes.position,E=_.attributes.normal,S=_.attributes.texcoord0,w=_.attributes.barycentric,R=_.attributes.color,O=d.row,z=d.column,N=o.get("shading"),P=N!=="color";if(a){var F=(O-1)*(z-1)*4;p.init(F),m&&w.init(F)}else p.value=new Float32Array(v);R.init(_.vertexCount),S.init(_.vertexCount);var K=[0,3,1,1,3,2],B=[[1,1,0,0],[0,1,0,1],[1,0,0,1],[1,0,1,0]],V=_.indices=new(_.vertexCount>65535?Uint32Array:Uint16Array)((O-1)*(z-1)*6),C=function(Te,Oe,Be){Be[1]=Te*z+Oe,Be[0]=Te*z+Oe+1,Be[3]=(Te+1)*z+Oe+1,Be[2]=(Te+1)*z+Oe},M=!1;if(a){var H=[],$=[],q=0;P?E.init(_.vertexCount):E.value=null;for(var se=[[],[],[]],ue=[],pe=[],xe=u.create(),De=function(Te,Oe,Be){var Ze=Oe*3;return Be[0]=Te[Ze],Be[1]=Te[Ze+1],Be[2]=Te[Ze+2],Be},Ue=new Float32Array(v.length),Ge=new Float32Array(v.length/3*4),Ae=0;Ae<h.count();Ae++)if(h.hasValue(Ae)){var fe=L.a.parseColor(h.getItemVisual(Ae,"color")),We=h.getItemVisual(Ae,"opacity");fe[3]*=We,fe[3]<.99&&(M=!0);for(var we=0;we<4;we++)Ge[Ae*4+we]=fe[we]}for(var Se=[1e7,1e7,1e7],Ae=0;Ae<O-1;Ae++)for(var ge=0;ge<z-1;ge++){var Re=Ae*(z-1)+ge,ve=Re*4;C(Ae,ge,H);for(var Le=!1,we=0;we<4;we++)De(v,H[we],$),f($)&&(Le=!0);for(var we=0;we<4;we++)Le?p.set(ve+we,Se):(De(v,H[we],$),p.set(ve+we,$)),m&&w.set(ve+we,B[we]);for(var we=0;we<6;we++)V[q++]=K[we]+ve;if(P&&!Le)for(var we=0;we<2;we++){for(var Fe=we*3,me=0;me<3;me++){var oe=H[K[Fe]+me];De(v,oe,se[me])}u.sub(ue,se[0],se[1]),u.sub(pe,se[1],se[2]),u.cross(xe,ue,pe);for(var me=0;me<3;me++){var ie=H[K[Fe]+me]*3;Ue[ie]=Ue[ie]+xe[0],Ue[ie+1]=Ue[ie+1]+xe[1],Ue[ie+2]=Ue[ie+2]+xe[2]}}}if(P)for(var Ae=0;Ae<Ue.length/3;Ae++)De(Ue,Ae,xe),u.normalize(xe,xe),Ue[Ae*3]=xe[0],Ue[Ae*3+1]=xe[1],Ue[Ae*3+2]=xe[2];for(var fe=[],ye=[],Ae=0;Ae<O-1;Ae++)for(var ge=0;ge<z-1;ge++){var Re=Ae*(z-1)+ge,ve=Re*4;C(Ae,ge,H);for(var we=0;we<4;we++){for(var me=0;me<4;me++)fe[me]=Ge[H[we]*4+me];R.set(ve+we,fe),P&&(De(Ue,H[we],xe),E.set(ve+we,xe));var oe=H[we];ye[0]=oe%z/(z-1),ye[1]=Math.floor(oe/z)/(O-1),S.set(ve+we,ye)}Re++}}else{for(var ye=[],Ae=0;Ae<h.count();Ae++){ye[0]=Ae%z/(z-1),ye[1]=Math.floor(Ae/z)/(O-1);var fe=L.a.parseColor(h.getItemVisual(Ae,"color")),We=h.getItemVisual(Ae,"opacity");fe[3]*=We,fe[3]<.99&&(M=!0),R.set(Ae,fe),S.set(Ae,ye)}for(var H=[],he=0,Ae=0;Ae<O-1;Ae++)for(var ge=0;ge<z-1;ge++){C(Ae,ge,H);for(var we=0;we<6;we++)V[he++]=H[K[we]]}P?_.generateVertexNormals():E.value=null}i.material.get("normalMap")&&_.generateTangents(),_.updateBoundingBox(),_.dirty(),i.material.transparent=M,i.material.depthMask=!M},_getDataShape:function(i,o){for(var d=-1/0,m=0,_=0,h=0,v=o?"u":"x",r=0;r<i.count();r++){var a=i.get(v,r);if(a<d){if(h&&h!==_)throw new Error("Invalid data. data should be a row major 2d array.");h=_,_=0,m++}d=a,_++}return{row:m+1,column:_}},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W);y.a.registerLayout(function(L,A){L.eachSeriesByType("surface",function(s){var x=s.coordinateSystem;(!x||x.type!=="cartesian3D")&&console.error("Surface chart only support cartesian3D coordinateSystem");var c=s.getData(),u=new Float32Array(3*c.count()),f=[NaN,NaN,NaN];if(x&&x.type==="cartesian3D"){var i=x.dimensions,o=i.map(function(d){return s.coordDimToDataDim(d)[0]});c.each(o,function(d,m,_,h){var v;c.hasValue(h)?v=x.dataToPoint([d,m,_]):v=f,u[h*3]=v[0],u[h*3+1]=v[1],u[h*3+2]=v[2]})}c.setLayout("points",u)})})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(83),A=D(234),s=D(235),x=D(16);y.a.registerVisual(Object(x.a)("map3D")),y.a.registerAction({type:"map3DChangeCamera",event:"map3dcamerachanged",update:"series:updateCamera"},function(c,u){u.eachComponent({mainType:"series",subType:"map3D",query:c},function(f){f.setView(c)})})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(38),A=D(31),s=D(32),x=D(26),c=D(80),u=D(27),f=D(35),i=D(82);function o(_,h){for(var v=[],r=0;r<h.length;r++)v.push(_.dataToPoint(h[r]));return v}var d=y.a.extendSeriesModel({type:"series.map3D",layoutMode:"box",coordinateSystem:null,visualColorAccessPath:"itemStyle.color",optionUpdated:function(_){_=_||{};var h=this.get("coordinateSystem");if(!(h==null||h==="geo3D")){var v=["left","top","width","height","boxWidth","boxDepth","boxHeight","light","viewControl","postEffect","temporalSuperSampling","environment","groundPlane"],r=[];v.forEach(function(a){_[a]!=null&&r.push(a)}),r.length&&console.warn("Property %s in map3D series will be ignored if coordinate system is %s",r.join(", "),h),this.get("groundPlane.show")&&(this.option.groundPlane.show=!1),this._geo=null}},getInitialData:function(_){_.data=this.getFilledRegions(_.data,_.map);var h=y.a.helper.completeDimensions(["value"],_.data),v=new y.a.List(h,this);v.initData(_.data);var r={};return v.each(function(a){var p=v.getName(a),E=v.getItemModel(a);r[p]=E}),this._regionModelMap=r,v},formatTooltip:function(_){return Object(f.a)(this,_)},getRegionModel:function(_){var h=this.getData().getName(_);return this._regionModelMap[h]||new y.a.Model(null,this)},getRegionPolygonCoords:function(_){var h=this.coordinateSystem,v=this.getData().getName(_);if(h.transform){var r=h.getRegion(v);return r?r.geometries:[]}else{this._geo||(this._geo=i.a.createGeo3D(this));for(var r=this._geo.getRegion(v),a=[],p=0;p<r.geometries.length;p++){var E=r.geometries[p],S=[],w=o(h,E.exterior);if(S&&S.length)for(var R=0;R<E.interiors.length;R++)S.push(o(h,S[R]));a.push({interiors:S,exterior:w})}return a}},getFormattedLabel:function(_,h){var v=u.a.getFormattedLabel(this,_,h);return v==null&&(v=this.getData().getName(_)),v},defaultOption:{coordinateSystem:"geo3D",data:null}});y.a.util.merge(d.prototype,c.a),y.a.util.merge(d.prototype,L.a),y.a.util.merge(d.prototype,A.a),y.a.util.merge(d.prototype,s.a),y.a.util.merge(d.prototype,x.a);var m=d},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(39),s=D(34),x=D(59),c=y.a.extendChartView({type:"map3D",__ecgl__:!0,init:function(u,f){this._geo3DBuilder=new x.a(f),this.groupGL=new L.a.Node},render:function(u,f,i){var o=u.coordinateSystem;if(!(!o||!o.viewGL)){this.groupGL.add(this._geo3DBuilder.rootNode),o.viewGL.add(this.groupGL);var d;if(o.type==="geo3D"){d=o,this._sceneHelper||(this._sceneHelper=new s.a,this._sceneHelper.initLight(this.groupGL)),this._sceneHelper.setScene(o.viewGL.scene),this._sceneHelper.updateLight(u),o.viewGL.setPostEffect(u.getModel("postEffect"),i),o.viewGL.setTemporalSuperSampling(u.getModel("temporalSuperSampling"));var m=this._control;m||(m=this._control=new A.a({zr:i.getZr()}),this._control.init());var _=u.getModel("viewControl");m.setViewGL(o.viewGL),m.setFromViewControlModel(_,0),m.off("update"),m.on("update",function(){i.dispatchAction({type:"map3DChangeCamera",alpha:m.getAlpha(),beta:m.getBeta(),distance:m.getDistance(),from:this.uid,map3DId:u.id})}),this._geo3DBuilder.extrudeY=!0}else this._control&&(this._control.dispose(),this._control=null),this._sceneHelper&&(this._sceneHelper.dispose(),this._sceneHelper=null),d=u.getData().getLayout("geo3D"),this._geo3DBuilder.extrudeY=!1;this._geo3DBuilder.update(u,f,i,0,u.getData().count());var h=o.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse(function(v){v.material&&v.material[h]("fragment","SRGB_DECODE")})}},afterRender:function(u,f,i,o){var d=o.renderer,m=u.coordinateSystem;m&&m.type==="geo3D"&&(this._sceneHelper.updateAmbientCubemap(d,u,i),this._sceneHelper.updateSkybox(d,u,i))},dispose:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(237),A=D(238),s=D(45),x=D.n(s),c=D(16);y.a.registerVisual(x()("scatterGL","circle",null)),y.a.registerVisual(Object(c.a)("scatterGL")),y.a.registerLayout({seriesType:"scatterGL",reset:function(u){var f=u.coordinateSystem,i;if(f){var o=f.dimensions,d=[];o.length===1?i=function(m,_){for(var h=new Float32Array((m.end-m.start)*2),v=m.start;v<m.end;v++){var r=(v-m.start)*2,a=_.get(o[0],v),p=f.dataToPoint(a);h[r]=p[0],h[r+1]=p[1]}_.setLayout("points",h)}:o.length===2&&(i=function(m,_){for(var h=new Float32Array((m.end-m.start)*2),v=m.start;v<m.end;v++){var r=(v-m.start)*2,a=_.get(o[0],v),p=_.get(o[1],v);d[0]=a,d[1]=p,d=f.dataToPoint(d),h[r]=d[0],h[r+1]=d[1]}_.setLayout("points",h)})}return{progress:i}}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W);y.a.extendSeriesModel({type:"series.scatterGL",dependencies:["grid","polar","geo","singleAxis"],visualColorAccessPath:"itemStyle.color",getInitialData:function(){return y.a.helper.createList(this)},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,progressive:1e5,progressiveThreshold:1e5,large:!1,symbol:"circle",symbolSize:10,zoomScale:0,blendMode:"source-over",itemStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(20),s=D(62),x=D(84),c=D(3);y.a.extendChartView({type:"scatterGL",__ecgl__:!0,init:function(u,f){this.groupGL=new L.a.Node,this.viewGL=new A.a("orthographic"),this.viewGL.add(this.groupGL),this._pointsBuilderList=[],this._currentStep=0,this._sizeScale=1,this._glViewHelper=new x.a(this.viewGL)},render:function(u,f,i){if(this.groupGL.removeAll(),this._glViewHelper.reset(u,i),!!u.getData().count()){var o=this._pointsBuilderList[0];o||(o=this._pointsBuilderList[0]=new s.a(!0,i)),this._pointsBuilderList.length=1,this.groupGL.add(o.rootNode),this._removeTransformInPoints(u.getData().getLayout("points")),o.update(u,f,i),this.viewGL.setPostEffect(u.getModel("postEffect"),i)}},incrementalPrepareRender:function(u,f,i){this.groupGL.removeAll(),this._glViewHelper.reset(u,i),this._currentStep=0,this.viewGL.setPostEffect(u.getModel("postEffect"),i)},incrementalRender:function(u,f,i,o){if(!(u.end<=u.start)){var d=this._pointsBuilderList[this._currentStep];d||(d=new s.a(!0,o),this._pointsBuilderList[this._currentStep]=d),this.groupGL.add(d.rootNode),this._removeTransformInPoints(f.getData().getLayout("points")),d.setSizeScale(this._sizeScale),d.update(f,i,o,u.start,u.end),o.getZr().refresh(),this._currentStep++}},updateTransform:function(u,f,i){if(u.coordinateSystem.getRoamTransform){this._glViewHelper.updateTransform(u,i);var o=this._glViewHelper.getZoom(),d=Math.max((u.get("zoomScale")||0)*(o-1)+1,0);this._sizeScale=d,this._pointsBuilderList.forEach(function(m){m.setSizeScale(d)})}},_removeTransformInPoints:function(u){if(u)for(var f=[],i=0;i<u.length;i+=2)f[0]=u[i],f[1]=u[i+1],this._glViewHelper.removeTransformInPoint(f),u[i]=f[0],u[i+1]=f[1]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(240),A=D(246),s=D(45),x=D.n(s),c=D(16);y.a.registerVisual(x()("graphGL","circle",null)),y.a.registerVisual(Object(c.a)("graphGL")),y.a.registerVisual(function(f){var i={};f.eachSeriesByType("graphGL",function(o){var d=o.getCategoriesData(),m=o.getData(),_={};d.each(function(h){var v=d.getName(h);_[v]=h;var r=d.getItemModel(h),a=r.get("itemStyle.color")||o.getColorFromPalette(v,i);d.setItemVisual(h,"color",a)}),d.count()&&m.each(function(h){var v=m.getItemModel(h),r=v.getShallow("category");r!=null&&(typeof r=="string"&&(r=_[r]),m.getItemVisual(h,"color",!0)||m.setItemVisual(h,"color",d.getItemVisual(r,"color")))})})}),y.a.registerVisual(function(f){f.eachSeriesByType("graphGL",function(i){var o=i.getGraph(),d=i.getEdgeData(),m="lineStyle.color".split("."),_="lineStyle.opacity".split(".");d.setVisual("color",i.get(m)),d.setVisual("opacity",i.get(_)),d.each(function(h){var v=d.getItemModel(h),r=o.getEdgeByIndex(h),a=v.get(m),p=v.get(_);switch(a){case"source":a=r.node1.getVisual("color");break;case"target":a=r.node2.getVisual("color");break}r.setVisual("color",a),r.setVisual("opacity",p)})})}),y.a.registerAction({type:"graphGLRoam",event:"graphglroam",update:"series.graphGL:roam"},function(f,i){i.eachComponent({mainType:"series",query:f},function(o){o.setView(f)})});function u(){}y.a.registerAction({type:"graphGLStartLayout",event:"graphgllayoutstarted",update:"series.graphGL:startLayout"},u),y.a.registerAction({type:"graphGLStopLayout",event:"graphgllayoutstopped",update:"series.graphGL:stopLayout"},u),y.a.registerAction({type:"graphGLFocusNodeAdjacency",event:"graphGLFocusNodeAdjacency",update:"series.graphGL:focusNodeAdjacency"},u),y.a.registerAction({type:"graphGLUnfocusNodeAdjacency",event:"graphGLUnfocusNodeAdjacency",update:"series.graphGL:unfocusNodeAdjacency"},u)},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(241),A=D(27),s=y.a.extendSeriesModel({type:"series.graphGL",visualColorAccessPath:"itemStyle.color",init:function(c){s.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this._updateCategoriesData()},mergeOption:function(c){s.superApply(this,"mergeOption",arguments),this._updateCategoriesData()},getFormattedLabel:function(c,u,f,i){var o=A.a.getFormattedLabel(this,c,u,f,i);if(o==null){var d=this.getData(),m=d.dimensions[d.dimensions.length-1];o=d.get(m,c)}return o},getInitialData:function(c,u){var f=c.edges||c.links||[],i=c.data||c.nodes||[],o=this;if(i&&f)return Object(L.a)(i,f,this,!0,d).data;function d(m,_){m.wrapMethod("getItemModel",function(a){var p=o._categoriesModels,E=a.getShallow("category"),S=p[E];return S&&(S.parentModel=a.parentModel,a.parentModel=S),a});var h=o.getModel("edgeLabel"),v=new y.a.Model({label:h.option},h.parentModel,u);_.wrapMethod("getItemModel",function(a){return a.customizeGetParent(r),a});function r(a){return a=this.parsePath(a),a&&a[0]==="label"?v:this.parentModel}}},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(c,u,f){if(f==="edge"){var i=this.getData(),o=this.getDataParams(c,f),d=i.graph.getEdgeByIndex(c),m=i.getName(d.node1.dataIndex),_=i.getName(d.node2.dataIndex),h=[];return m!=null&&h.push(m),_!=null&&h.push(_),h=y.a.format.encodeHTML(h.join(" > ")),o.value&&(h+=" : "+y.a.format.encodeHTML(o.value)),h}else return s.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var c=(this.option.categories||[]).map(function(f){return f.value!=null?f:y.a.util.extend({value:0},f)}),u=new y.a.List(["value"],this);u.initData(c),this._categoriesData=u,this._categoriesModels=u.mapArray(function(f){return u.getItemModel(f,!0)})},setView:function(c){c.zoom!=null&&(this.option.zoom=c.zoom),c.offset!=null&&(this.option.offset=c.offset)},setNodePosition:function(c){for(var u=0;u<c.length/2;u++){var f=c[u*2],i=c[u*2+1],o=this.getData().getRawDataItem(u);o.x=f,o.y=i}},isAnimationEnabled:function(){return s.superCall(this,"isAnimationEnabled")&&!(this.get("layout")==="force"&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:10,z:2,legendHoverLink:!0,layout:"forceAtlas2",forceAtlas2:{initLayout:null,GPU:!0,steps:1,maxSteps:1e3,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,edgeWeightInfluence:1,edgeWeight:[1,4],nodeWeight:[1,4],preventOverlap:!1,gravityCenter:null},focusNodeAdjacency:!0,focusNodeAdjacencyOn:"mouseover",left:"center",top:"center",symbol:"circle",symbolSize:5,roam:!1,center:null,zoom:1,label:{show:!1,formatter:"{b}",position:"right",distance:5,textStyle:{fontSize:14}},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{label:{show:!0}},animation:!1}}),x=s},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(242),A=D.n(L),s=D(245),x=D.n(s),c=D(3);X.a=function(u,f,i,o,d){for(var m=new A.a(o),_=0;_<u.length;_++)m.addNode(c.a.firstNotNull(u[_].id,u[_].name,_),_);for(var h=[],v=[],r=0,_=0;_<f.length;_++){var a=f[_],p=a.source,E=a.target;m.addEdge(p,E,r)&&(v.push(a),h.push(c.a.firstNotNull(a.id,p+" > "+E)),r++)}var S,w=y.a.helper.completeDimensions(["value"],u);S=new y.a.List(w,i),S.initData(u);var R=new y.a.List(["value"],i);return R.initData(v,h),d&&d(S,R),x()({mainData:S,struct:m,structAttr:"graph",datas:{node:S,edge:R},datasAttr:{node:"data",edge:"edgeData"}}),m.update(),m}},function(re,X,D){var W=D(85),y=W.__DEV__,L=D(12),A=D(244),s=A.enableClassCheck;function x(m){return"_EC_"+m}var c=function(m){this._directed=m||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData},u=c.prototype;u.type="graph",u.isDirected=function(){return this._directed},u.addNode=function(m,_){m=m||""+_;var h=this._nodesMap;if(!h[x(m)]){var v=new f(m,_);return v.hostGraph=this,this.nodes.push(v),h[x(m)]=v,v}},u.getNodeByIndex=function(m){var _=this.data.getRawIndex(m);return this.nodes[_]},u.getNodeById=function(m){return this._nodesMap[x(m)]},u.addEdge=function(m,_,h){var v=this._nodesMap,r=this._edgesMap;if(typeof m=="number"&&(m=this.nodes[m]),typeof _=="number"&&(_=this.nodes[_]),f.isInstance(m)||(m=v[x(m)]),f.isInstance(_)||(_=v[x(_)]),!(!m||!_)){var a=m.id+"-"+_.id;if(!r[a]){var p=new i(m,_,h);return p.hostGraph=this,this._directed&&(m.outEdges.push(p),_.inEdges.push(p)),m.edges.push(p),m!==_&&_.edges.push(p),this.edges.push(p),r[a]=p,p}}},u.getEdgeByIndex=function(m){var _=this.edgeData.getRawIndex(m);return this.edges[_]},u.getEdge=function(m,_){f.isInstance(m)&&(m=m.id),f.isInstance(_)&&(_=_.id);var h=this._edgesMap;return this._directed?h[m+"-"+_]:h[m+"-"+_]||h[_+"-"+m]},u.eachNode=function(m,_){for(var h=this.nodes,v=h.length,r=0;r<v;r++)h[r].dataIndex>=0&&m.call(_,h[r],r)},u.eachEdge=function(m,_){for(var h=this.edges,v=h.length,r=0;r<v;r++)h[r].dataIndex>=0&&h[r].node1.dataIndex>=0&&h[r].node2.dataIndex>=0&&m.call(_,h[r],r)},u.breadthFirstTraverse=function(m,_,h,v){if(f.isInstance(_)||(_=this._nodesMap[x(_)]),!!_){for(var r=h==="out"?"outEdges":h==="in"?"inEdges":"edges",a=0;a<this.nodes.length;a++)this.nodes[a].__visited=!1;if(!m.call(v,_,null))for(var p=[_];p.length;)for(var E=p.shift(),S=E[r],a=0;a<S.length;a++){var w=S[a],R=w.node1===E?w.node2:w.node1;if(!R.__visited){if(m.call(v,R,E))return;p.push(R),R.__visited=!0}}}},u.update=function(){for(var m=this.data,_=this.edgeData,h=this.nodes,v=this.edges,r=0,a=h.length;r<a;r++)h[r].dataIndex=-1;for(var r=0,a=m.count();r<a;r++)h[m.getRawIndex(r)].dataIndex=r;_.filterSelf(function(p){var E=v[_.getRawIndex(p)];return E.node1.dataIndex>=0&&E.node2.dataIndex>=0});for(var r=0,a=v.length;r<a;r++)v[r].dataIndex=-1;for(var r=0,a=_.count();r<a;r++)v[_.getRawIndex(r)].dataIndex=r},u.clone=function(){for(var m=new c(this._directed),_=this.nodes,h=this.edges,v=0;v<_.length;v++)m.addNode(_[v].id,_[v].dataIndex);for(var v=0;v<h.length;v++){var r=h[v];m.addEdge(r.node1.id,r.node2.id,r.dataIndex)}return m};function f(m,_){this.id=m==null?"":m,this.inEdges=[],this.outEdges=[],this.edges=[],this.hostGraph,this.dataIndex=_==null?-1:_}f.prototype={constructor:f,degree:function(){return this.edges.length},inDegree:function(){return this.inEdges.length},outDegree:function(){return this.outEdges.length},getModel:function(m){if(!(this.dataIndex<0)){var _=this.hostGraph,h=_.data.getItemModel(this.dataIndex);return h.getModel(m)}}};function i(m,_,h){this.node1=m,this.node2=_,this.dataIndex=h==null?-1:h}i.prototype.getModel=function(m){if(!(this.dataIndex<0)){var _=this.hostGraph,h=_.edgeData.getItemModel(this.dataIndex);return h.getModel(m)}};var o=function(m,_){return{getValue:function(h){var v=this[m][_];return v.get(v.getDimension(h||"value"),this.dataIndex)},setVisual:function(h,v){this.dataIndex>=0&&this[m][_].setItemVisual(this.dataIndex,h,v)},getVisual:function(h,v){return this[m][_].getItemVisual(this.dataIndex,h,v)},setLayout:function(h,v){this.dataIndex>=0&&this[m][_].setItemLayout(this.dataIndex,h,v)},getLayout:function(){return this[m][_].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[m][_].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[m][_].getRawIndex(this.dataIndex)}}};L.mixin(f,o("hostGraph","data")),L.mixin(i,o("hostGraph","edgeData")),c.Node=f,c.Edge=i,s(f),s(i);var d=c;re.exports=d},function(re,X){var D;D=function(){return this}();try{D=D||Function("return this")()||(0,eval)("this")}catch(W){typeof window=="object"&&(D=window)}re.exports=D},function(re,X,D){var W=D(85),y=W.__DEV__,L=D(12),A=".",s="___EC__COMPONENT__CONTAINER___";function x(h){var v={main:"",sub:""};return h&&(h=h.split(A),v.main=h[0]||"",v.sub=h[1]||""),v}function c(h){L.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(h),'componentType "'+h+'" illegal')}function u(h,v){h.$constructor=h,h.extend=function(r){var a=this,p=function(){r.$constructor?r.$constructor.apply(this,arguments):a.apply(this,arguments)};return L.extend(p.prototype,r),p.extend=this.extend,p.superCall=o,p.superApply=d,L.inherits(p,this),p.superClass=a,p}}var f=0;function i(h){var v=["__\0is_clz",f++,Math.random().toFixed(3)].join("_");h.prototype[v]=!0,h.isInstance=function(r){return!!(r&&r[v])}}function o(h,v){var r=L.slice(arguments,2);return this.superClass.prototype[v].apply(h,r)}function d(h,v,r){return this.superClass.prototype[v].apply(h,r)}function m(h,v){v=v||{};var r={};h.registerClass=function(E,S){if(S){if(c(S),S=x(S),!S.sub)r[S.main]=E;else if(S.sub!==s){var w=a(S);w[S.sub]=E}}return E},h.getClass=function(E,S,w){var R=r[E];if(R&&R[s]&&(R=S?R[S]:null),w&&!R)throw new Error(S?"Component "+E+"."+(S||"")+" not exists. Load it first.":E+".type should be specified.");return R},h.getClassesByMainType=function(E){E=x(E);var S=[],w=r[E.main];return w&&w[s]?L.each(w,function(R,O){O!==s&&S.push(R)}):S.push(w),S},h.hasClass=function(E){return E=x(E),!!r[E.main]},h.getAllClassMainTypes=function(){var E=[];return L.each(r,function(S,w){E.push(w)}),E},h.hasSubTypes=function(E){E=x(E);var S=r[E.main];return S&&S[s]},h.parseClassType=x;function a(E){var S=r[E.main];return(!S||!S[s])&&(S=r[E.main]={},S[s]=!0),S}if(v.registerWhenExtend){var p=h.extend;p&&(h.extend=function(E){var S=p.call(this,E);return h.registerClass(S,E.type)})}return h}function _(h,v){}X.parseClassType=x,X.enableClassExtend=u,X.enableClassCheck=i,X.enableClassManagement=m,X.setReadOnly=_},function(re,X,D){var W=D(12),y=W.each,L="\0__link_datas",A="\0__link_mainData";function s(_){var h=_.mainData,v=_.datas;v||(v={main:h},_.datasAttr={main:"data"}),_.datas=_.mainData=null,o(h,v,_),y(v,function(r){y(h.TRANSFERABLE_METHODS,function(a){r.wrapMethod(a,W.curry(x,_))})}),h.wrapMethod("cloneShallow",W.curry(u,_)),y(h.CHANGABLE_METHODS,function(r){h.wrapMethod(r,W.curry(c,_))}),W.assert(v[h.dataType]===h)}function x(_,h){if(i(this)){var v=W.extend({},this[L]);v[this.dataType]=h,o(h,v,_)}else d(h,this.dataType,this[A],_);return h}function c(_,h){return _.struct&&_.struct.update(this),h}function u(_,h){return y(h[L],function(v,r){v!==h&&d(v.cloneShallow(),r,h,_)}),h}function f(_){var h=this[A];return _==null||h==null?h:h[L][_]}function i(_){return _[A]===_}function o(_,h,v){_[L]={},y(h,function(r,a){d(r,a,_,v)})}function d(_,h,v,r){v[L][h]=_,_[A]=v,_.dataType=h,r.struct&&(_[r.structAttr]=r.struct,r.struct[r.datasAttr[h]]=_),_.getLinkedData=f}var m=s;re.exports=m},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(41),A=D.n(L),s=D(2),x=D(20),c=D(86),u=D(3),f=D(247),i=D(249),o=D(65),d=D.n(o),m=D(1),_=D.n(m),h=D(251),v=D(62),r=D(252),a=_.a.vec2;s.a.Shader.import(r.a);var p=1;y.a.extendChartView({type:"graphGL",__ecgl__:!0,init:function(E,S){this.groupGL=new s.a.Node,this.viewGL=new x.a("orthographic"),this.viewGL.camera.left=this.viewGL.camera.right=0,this.viewGL.add(this.groupGL),this._pointsBuilder=new v.a(!0,S),this._forceEdgesMesh=new s.a.Mesh({material:new s.a.Material({shader:s.a.createShader("ecgl.forceAtlas2.edges"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new s.a.Geometry({attributes:{node:new s.a.Geometry.Attribute("node","float",2),color:new s.a.Geometry.Attribute("color","float",4,"COLOR")},dynamic:!0,mainAttribute:"node"}),renderOrder:-1,mode:s.a.Mesh.LINES}),this._edgesMesh=new s.a.Mesh({material:new s.a.Material({shader:s.a.createShader("ecgl.meshLines2D"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new c.a({useNativeLine:!1,dynamic:!0}),renderOrder:-1,culling:!1}),this._layoutId=0,this._control=new h.a({zr:S.getZr(),viewGL:this.viewGL}),this._control.setTarget(this.groupGL),this._control.init(),this._clickHandler=this._clickHandler.bind(this)},render:function(E,S,w){this.groupGL.add(this._pointsBuilder.rootNode),this._model=E,this._api=w,this._initLayout(E,S,w),this._pointsBuilder.update(E,S,w),this._forceLayoutInstance instanceof f.a||this.groupGL.remove(this._forceEdgesMesh),this._updateCamera(E,w),this._control.off("update"),this._control.on("update",function(){w.dispatchAction({type:"graphGLRoam",seriesId:E.id,zoom:this._control.getZoom(),offset:this._control.getOffset()}),this._pointsBuilder.updateView(this.viewGL.camera)},this),this._control.setZoom(u.a.firstNotNull(E.get("zoom"),1)),this._control.setOffset(E.get("offset")||[0,0]);var R=this._pointsBuilder.getPointsMesh();if(R.off("mousemove",this._mousemoveHandler),R.off("mouseout",this._mouseOutHandler,this),w.getZr().off("click",this._clickHandler),this._pointsBuilder.highlightOnMouseover=!0,E.get("focusNodeAdjacency")){var O=E.get("focusNodeAdjacencyOn");O==="click"?w.getZr().on("click",this._clickHandler):O==="mouseover"?(R.on("mousemove",this._mousemoveHandler,this),R.on("mouseout",this._mouseOutHandler,this),this._pointsBuilder.highlightOnMouseover=!1):console.warn("Unkown focusNodeAdjacencyOn value s"+O)}this._lastMouseOverDataIndex=-1},_clickHandler:function(E){if(!this._layouting){var S=this._pointsBuilder.getPointsMesh().dataIndex;S>=0?this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:S}):this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id})}},_mousemoveHandler:function(E){if(!this._layouting){var S=this._pointsBuilder.getPointsMesh().dataIndex;S>=0?S!==this._lastMouseOverDataIndex&&this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:S}):this._mouseOutHandler(E),this._lastMouseOverDataIndex=S}},_mouseOutHandler:function(E){this._layouting||(this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id}),this._lastMouseOverDataIndex=-1)},_updateForceEdgesGeometry:function(E,S){var w=this._forceEdgesMesh.geometry,R=S.getEdgeData(),O=0,z=this._forceLayoutInstance,N=R.count()*2;w.attributes.node.init(N),w.attributes.color.init(N),R.each(function(P){var F=E[P];w.attributes.node.set(O,z.getNodeUV(F.node1)),w.attributes.node.set(O+1,z.getNodeUV(F.node2));var K=R.getItemVisual(F.dataIndex,"color"),B=s.a.parseColor(K);B[3]*=u.a.firstNotNull(R.getItemVisual(F.dataIndex,"opacity"),1),w.attributes.color.set(O,B),w.attributes.color.set(O+1,B),O+=2}),w.dirty()},_updateMeshLinesGeometry:function(){var S=this._model.getEdgeData(),E=this._edgesMesh.geometry,S=this._model.getEdgeData(),w=this._model.getData().getLayout("points");E.resetOffset(),E.setVertexCount(S.count()*E.getLineVertexCount()),E.setTriangleCount(S.count()*E.getLineTriangleCount());var R=[],O=[],z=["lineStyle","width"];this._originalEdgeColors=new Float32Array(S.count()*4),this._edgeIndicesMap=new Float32Array(S.count()),S.each(function(N){var P=S.graph.getEdgeByIndex(N),F=P.node1.dataIndex*2,K=P.node2.dataIndex*2;R[0]=w[F],R[1]=w[F+1],O[0]=w[K],O[1]=w[K+1];var B=S.getItemVisual(P.dataIndex,"color"),V=s.a.parseColor(B);V[3]*=u.a.firstNotNull(S.getItemVisual(P.dataIndex,"opacity"),1);var C=S.getItemModel(P.dataIndex),M=u.a.firstNotNull(C.get(z),1)*this._api.getDevicePixelRatio();E.addLine(R,O,V,M);for(var H=0;H<4;H++)this._originalEdgeColors[P.dataIndex*4+H]=V[H];this._edgeIndicesMap[P.dataIndex]=N},!1,this),E.dirty()},_updateForceNodesGeometry:function(E){for(var S=this._pointsBuilder.getPointsMesh(),w=[],R=0;R<E.count();R++)this._forceLayoutInstance.getNodeUV(R,w),S.geometry.attributes.position.set(R,w);S.geometry.dirty("position")},_initLayout:function(E,S,w){var R=E.get("layout"),O=E.getGraph(),z=E.getBoxLayoutParams(),N=A.a.getLayoutRect(z,{width:w.getWidth(),height:w.getHeight()});R==="force"&&(console.warn("Currently only forceAtlas2 layout supported."),R="forceAtlas2"),this.stopLayout(E,S,w,{beforeLayout:!0});var P=E.getData(),F=E.getData();if(R==="forceAtlas2"){var K=E.getModel("forceAtlas2"),B=this._forceLayoutInstance,V=[],C=[],M=P.getDataExtent("value"),H=F.getDataExtent("value"),$=u.a.firstNotNull(K.get("edgeWeight"),1),q=u.a.firstNotNull(K.get("nodeWeight"),1);typeof $=="number"&&($=[$,$]),typeof q=="number"&&(q=[q,q]);var se=0,ue={},pe=new Float32Array(P.count()*2);if(O.eachNode(function(De){var Ue=De.dataIndex,Ge=P.get("value",Ue),Ae,We;if(P.hasItemOption){var we=P.getItemModel(Ue);Ae=we.get("x"),We=we.get("y")}Ae==null&&(Ae=N.x+Math.random()*N.width,We=N.y+Math.random()*N.height),pe[se*2]=Ae,pe[se*2+1]=We,ue[De.id]=se++;var Se=y.a.number.linearMap(Ge,M,q);isNaN(Se)&&(isNaN(q[0])?Se=1:Se=q[0]),V.push({x:Ae,y:We,mass:Se,size:P.getItemVisual(Ue,"symbolSize")})}),P.setLayout("points",pe),O.eachEdge(function(De){var Ue=De.dataIndex,Ge=P.get("value",Ue),Ae=y.a.number.linearMap(Ge,H,$);isNaN(Ae)&&(isNaN($[0])?Ae=1:Ae=$[0]),C.push({node1:ue[De.node1.id],node2:ue[De.node2.id],weight:Ae,dataIndex:Ue})}),!B){var xe=K.get("GPU");this._forceLayoutInstance&&(xe&&!(this._forceLayoutInstance instanceof f.a)||!xe&&!(this._forceLayoutInstance instanceof i.a))&&(this._forceLayoutInstanceToDispose=this._forceLayoutInstance),B=this._forceLayoutInstance=xe?new f.a:new i.a}B.initData(V,C),B.updateOption(K.option),this._updateForceEdgesGeometry(B.getEdges(),E),this._updatePositionTexture(),w.dispatchAction({type:"graphGLStartLayout",from:this.uid})}else{var pe=new Float32Array(P.count()*2),se=0;O.eachNode(function(Ge){var Ae=Ge.dataIndex,We,we;if(P.hasItemOption){var Se=P.getItemModel(Ae);We=Se.get("x"),we=Se.get("y")}pe[se++]=We,pe[se++]=we}),P.setLayout("points",pe),this._updateAfterLayout(E,S,w)}},_updatePositionTexture:function(){var E=this._forceLayoutInstance.getNodePositionTexture();this._pointsBuilder.setPositionTexture(E),this._forceEdgesMesh.material.set("positionTex",E)},startLayout:function(E,S,z,R){if(!(R&&R.from!=null&&R.from!==this.uid)){var O=this.viewGL,z=this._api,N=this._forceLayoutInstance,P=this._model.getData(),F=this._model.getModel("forceAtlas2");if(!N){console.error("None layout don't have startLayout action");return}if(this.groupGL.remove(this._edgesMesh),this.groupGL.add(this._forceEdgesMesh),!!this._forceLayoutInstance){this._updateForceNodesGeometry(E.getData()),this._pointsBuilder.hideLabels();var K=this,B=this._layoutId=p++,V=F.getShallow("maxSteps"),C=F.getShallow("steps"),M=0,H=Math.max(C*2,20),$=function(q){if(q===K._layoutId){if(N.isFinished(V)){z.dispatchAction({type:"graphGLStopLayout",from:K.uid}),z.dispatchAction({type:"graphGLFinishLayout",points:P.getLayout("points"),from:K.uid});return}N.update(O.layer.renderer,C,function(){K._updatePositionTexture(),M+=C,M>=H&&(K._syncNodePosition(E),M=0),z.getZr().refresh(),d()(function(){$(q)})})}};d()(function(){K._forceLayoutInstanceToDispose&&(K._forceLayoutInstanceToDispose.dispose(O.layer.renderer),K._forceLayoutInstanceToDispose=null),$(B)}),this._layouting=!0}}},stopLayout:function(E,S,w,R){R&&R.from!=null&&R.from!==this.uid||(this._layoutId=0,this.groupGL.remove(this._forceEdgesMesh),this.groupGL.add(this._edgesMesh),this._forceLayoutInstance&&this.viewGL.layer&&(R&&R.beforeLayout||(this._syncNodePosition(E),this._updateAfterLayout(E,S,w)),this._api.getZr().refresh(),this._layouting=!1))},_syncNodePosition:function(E){var S=this._forceLayoutInstance.getNodePosition(this.viewGL.layer.renderer);E.getData().setLayout("points",S),E.setNodePosition(S)},_updateAfterLayout:function(E,S,w){this._updateMeshLinesGeometry(),this._pointsBuilder.removePositionTexture(),this._pointsBuilder.updateLayout(E,S,w),this._pointsBuilder.updateView(this.viewGL.camera),this._pointsBuilder.updateLabels(),this._pointsBuilder.showLabels()},focusNodeAdjacency:function(E,S,w,R){var O=this._model.getData();this._downplayAll();var z=R.dataIndex,N=O.graph,P=[],F=N.getNodeByIndex(z);P.push(F),F.edges.forEach(function(B){B.dataIndex<0||(B.node1!==F&&P.push(B.node1),B.node2!==F&&P.push(B.node2))},this),this._pointsBuilder.fadeOutAll(.05),this._fadeOutEdgesAll(.05),P.forEach(function(B){this._pointsBuilder.highlight(O,B.dataIndex)},this),this._pointsBuilder.updateLabels(P.map(function(B){return B.dataIndex}));var K=[];F.edges.forEach(function(B){B.dataIndex>=0&&(this._highlightEdge(B.dataIndex),K.push(B))},this),this._focusNodes=P,this._focusEdges=K},unfocusNodeAdjacency:function(E,S,w,R){this._downplayAll(),this._pointsBuilder.fadeInAll(),this._fadeInEdgesAll(),this._pointsBuilder.updateLabels()},_highlightEdge:function(E){var S=this._model.getEdgeData().getItemModel(E),w=s.a.parseColor(S.get("emphasis.lineStyle.color")||S.get("lineStyle.color")),R=u.a.firstNotNull(S.get("emphasis.lineStyle.opacity"),S.get("lineStyle.opacity"),1);w[3]*=R,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[E],w)},_downplayAll:function(){this._focusNodes&&this._focusNodes.forEach(function(E){this._pointsBuilder.downplay(this._model.getData(),E.dataIndex)},this),this._focusEdges&&this._focusEdges.forEach(function(E){this._downplayEdge(E.dataIndex)},this)},_downplayEdge:function(E){var S=this._getColor(E,[]);this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[E],S)},_setEdgeFade:function(){var E=[];return function(S,w){this._getColor(S,E),E[3]*=w,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[S],E)}}(),_getColor:function(E,S){for(var w=0;w<4;w++)S[w]=this._originalEdgeColors[E*4+w];return S},_fadeOutEdgesAll:function(E){var S=this._model.getData().graph;S.eachEdge(function(w){this._setEdgeFade(w.dataIndex,E)},this)},_fadeInEdgesAll:function(){this._fadeOutEdgesAll(1)},_updateCamera:function(E,S){this.viewGL.setViewport(0,0,S.getWidth(),S.getHeight(),S.getDevicePixelRatio());for(var w=this.viewGL.camera,R=E.getData(),O=R.getLayout("points"),z=a.create(1/0,1/0),N=a.create(-1/0,-1/0),P=[],F=0;F<O.length;)P[0]=O[F++],P[1]=O[F++],a.min(z,z,P),a.max(N,N,P);var K=(N[1]+z[1])/2,B=(N[0]+z[0])/2;if(!(B>w.left&&B<w.right&&K<w.bottom&&K>w.top)){var V=Math.max(N[0]-z[0],10),C=V/S.getWidth()*S.getHeight();V*=1.4,C*=1.4,z[0]-=V*.2,w.left=z[0],w.top=K-C/2,w.bottom=K+C/2,w.right=V+z[0],w.near=0,w.far=100}},dispose:function(){var E=this.viewGL.layer.renderer;this._forceLayoutInstance&&this._forceLayoutInstance.dispose(E),this.groupGL.removeAll(),this._layoutId=-1},remove:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(14),s=D(10),x=D(248);L.a.Shader.import(x.a);var c={repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null};function u(f){var i={type:L.a.Texture.FLOAT,minFilter:L.a.Texture.NEAREST,magFilter:L.a.Texture.NEAREST};this._positionSourceTex=new L.a.Texture2D(i),this._positionSourceTex.flipY=!1,this._positionTex=new L.a.Texture2D(i),this._positionPrevTex=new L.a.Texture2D(i),this._forceTex=new L.a.Texture2D(i),this._forcePrevTex=new L.a.Texture2D(i),this._weightedSumTex=new L.a.Texture2D(i),this._weightedSumTex.width=this._weightedSumTex.height=1,this._globalSpeedTex=new L.a.Texture2D(i),this._globalSpeedPrevTex=new L.a.Texture2D(i),this._globalSpeedTex.width=this._globalSpeedTex.height=1,this._globalSpeedPrevTex.width=this._globalSpeedPrevTex.height=1,this._nodeRepulsionPass=new A.a({fragment:L.a.Shader.source("ecgl.forceAtlas2.updateNodeRepulsion")}),this._positionPass=new A.a({fragment:L.a.Shader.source("ecgl.forceAtlas2.updatePosition")}),this._globalSpeedPass=new A.a({fragment:L.a.Shader.source("ecgl.forceAtlas2.calcGlobalSpeed")}),this._copyPass=new A.a({fragment:L.a.Shader.source("clay.compositor.output")});var o=function(d){d.blendEquation(d.FUNC_ADD),d.blendFunc(d.ONE,d.ONE)};this._edgeForceMesh=new L.a.Mesh({geometry:new L.a.Geometry({attributes:{node1:new L.a.Geometry.Attribute("node1","float",2),node2:new L.a.Geometry.Attribute("node2","float",2),weight:new L.a.Geometry.Attribute("weight","float",1)},dynamic:!0,mainAttribute:"node1"}),material:new L.a.Material({transparent:!0,shader:L.a.createShader("ecgl.forceAtlas2.updateEdgeAttraction"),blend:o,depthMask:!1,depthText:!1}),mode:L.a.Mesh.POINTS}),this._weightedSumMesh=new L.a.Mesh({geometry:new L.a.Geometry({attributes:{node:new L.a.Geometry.Attribute("node","float",2)},dynamic:!0,mainAttribute:"node"}),material:new L.a.Material({transparent:!0,shader:L.a.createShader("ecgl.forceAtlas2.calcWeightedSum"),blend:o,depthMask:!1,depthText:!1}),mode:L.a.Mesh.POINTS}),this._framebuffer=new s.a({depthBuffer:!1}),this._dummyCamera=new L.a.OrthographicCamera({left:-1,right:1,top:1,bottom:-1,near:0,far:100}),this._globalSpeed=0}u.prototype.updateOption=function(f){for(var i in c)this[i]=c[i];var o=this._nodes.length;if(o>5e4?this.jitterTolerence=10:o>5e3?this.jitterTolerence=1:this.jitterTolerence=.1,o>100?this.scaling=2:this.scaling=10,f)for(var i in c)f[i]!=null&&(this[i]=f[i]);if(this.repulsionByDegree)for(var d=this._positionSourceTex.pixels,m=0;m<this._nodes.length;m++)d[m*4+2]=(this._nodes[m].degree||0)+1},u.prototype._updateGravityCenter=function(f){var i=this._nodes,o=this._edges;if(this.gravityCenter)this._gravityCenter=this.gravityCenter;else{for(var d=[1/0,1/0],m=[-1/0,-1/0],_=0;_<i.length;_++)d[0]=Math.min(i[_].x,d[0]),d[1]=Math.min(i[_].y,d[1]),m[0]=Math.max(i[_].x,m[0]),m[1]=Math.max(i[_].y,m[1]);this._gravityCenter=[(d[0]+m[0])*.5,(d[1]+m[1])*.5]}for(var _=0;_<o.length;_++){var h=o[_].node1,v=o[_].node2;i[h].degree=(i[h].degree||0)+1,i[v].degree=(i[v].degree||0)+1}},u.prototype.initData=function(f,i){this._nodes=f,this._edges=i,this._updateGravityCenter();var o=Math.ceil(Math.sqrt(f.length)),d=o,m=new Float32Array(o*d*4);this._resize(o,d);for(var _=0,h=0;h<f.length;h++){var v=f[h];m[_++]=v.x||0,m[_++]=v.y||0,m[_++]=v.mass||1,m[_++]=v.size||1}this._positionSourceTex.pixels=m;var r=this._edgeForceMesh.geometry,a=i.length;r.attributes.node1.init(a*2),r.attributes.node2.init(a*2),r.attributes.weight.init(a*2);for(var p=[],h=0;h<i.length;h++){var E=r.attributes,S=i[h].weight;S==null&&(S=1),E.node1.set(h,this.getNodeUV(i[h].node1,p)),E.node2.set(h,this.getNodeUV(i[h].node2,p)),E.weight.set(h,S),E.node1.set(h+a,this.getNodeUV(i[h].node2,p)),E.node2.set(h+a,this.getNodeUV(i[h].node1,p)),E.weight.set(h+a,S)}var w=this._weightedSumMesh.geometry;w.attributes.node.init(f.length);for(var h=0;h<f.length;h++)w.attributes.node.set(h,this.getNodeUV(h,p));r.dirty(),w.dirty(),this._nodeRepulsionPass.material.define("fragment","NODE_COUNT",f.length),this._nodeRepulsionPass.material.setUniform("textureSize",[o,d]),this._inited=!1,this._frame=0},u.prototype.getNodes=function(){return this._nodes},u.prototype.getEdges=function(){return this._edges},u.prototype.step=function(f){this._inited||(this._initFromSource(f),this._inited=!0),this._frame++,this._framebuffer.attach(this._forceTex),this._framebuffer.bind(f);var i=this._nodeRepulsionPass;i.setUniform("strongGravityMode",this.strongGravityMode),i.setUniform("gravity",this.gravity),i.setUniform("gravityCenter",this._gravityCenter),i.setUniform("scaling",this.scaling),i.setUniform("preventOverlap",this.preventOverlap),i.setUniform("positionTex",this._positionPrevTex),i.render(f);var o=this._edgeForceMesh;o.material.set("linLogMode",this.linLogMode),o.material.set("edgeWeightInfluence",this.edgeWeightInfluence),o.material.set("preventOverlap",this.preventOverlap),o.material.set("positionTex",this._positionPrevTex),f.gl.enable(f.gl.BLEND),f.renderPass([o],this._dummyCamera),this._framebuffer.attach(this._weightedSumTex),f.gl.clearColor(0,0,0,0),f.gl.clear(f.gl.COLOR_BUFFER_BIT),f.gl.enable(f.gl.BLEND);var d=this._weightedSumMesh;d.material.set("positionTex",this._positionPrevTex),d.material.set("forceTex",this._forceTex),d.material.set("forcePrevTex",this._forcePrevTex),f.renderPass([d],this._dummyCamera),this._framebuffer.attach(this._globalSpeedTex);var m=this._globalSpeedPass;m.setUniform("globalSpeedPrevTex",this._globalSpeedPrevTex),m.setUniform("weightedSumTex",this._weightedSumTex),m.setUniform("jitterTolerence",this.jitterTolerence),f.gl.disable(f.gl.BLEND),m.render(f);var _=this._positionPass;this._framebuffer.attach(this._positionTex),_.setUniform("globalSpeedTex",this._globalSpeedTex),_.setUniform("positionTex",this._positionPrevTex),_.setUniform("forceTex",this._forceTex),_.setUniform("forcePrevTex",this._forcePrevTex),_.render(f),this._framebuffer.unbind(f),this._swapTexture()},u.prototype.update=function(f,i,o){i==null&&(i=1),i=Math.max(i,1);for(var d=0;d<i;d++)this.step(f);o&&o()},u.prototype.getNodePositionTexture=function(){return this._inited?this._positionPrevTex:this._positionSourceTex},u.prototype.getNodeUV=function(f,i){i=i||[];var o=this._positionTex.width,d=this._positionTex.height;return i[0]=f%o/(o-1),i[1]=Math.floor(f/o)/(d-1)||0,i},u.prototype.getNodePosition=function(f,i){var o=this._positionArr,d=this._positionTex.width,m=this._positionTex.height,_=d*m;(!o||o.length!==_*4)&&(o=this._positionArr=new Float32Array(_*4)),this._framebuffer.bind(f),this._framebuffer.attach(this._positionPrevTex),f.gl.readPixels(0,0,d,m,f.gl.RGBA,f.gl.FLOAT,o),this._framebuffer.unbind(f),i||(i=new Float32Array(this._nodes.length*2));for(var h=0;h<this._nodes.length;h++)i[h*2]=o[h*4],i[h*2+1]=o[h*4+1];return i},u.prototype.getTextureData=function(f,i){var o=this["_"+i+"Tex"],d=o.width,m=o.height;this._framebuffer.bind(f),this._framebuffer.attach(o);var _=new Float32Array(d*m*4);return f.gl.readPixels(0,0,d,m,f.gl.RGBA,f.gl.FLOAT,_),this._framebuffer.unbind(f),_},u.prototype.getTextureSize=function(){return{width:this._positionTex.width,height:this._positionTex.height}},u.prototype.isFinished=function(f){return this._frame>f},u.prototype._swapTexture=function(){var f=this._positionPrevTex;this._positionPrevTex=this._positionTex,this._positionTex=f;var f=this._forcePrevTex;this._forcePrevTex=this._forceTex,this._forceTex=f;var f=this._globalSpeedPrevTex;this._globalSpeedPrevTex=this._globalSpeedTex,this._globalSpeedTex=f},u.prototype._initFromSource=function(f){this._framebuffer.attach(this._positionPrevTex),this._framebuffer.bind(f),this._copyPass.setUniform("texture",this._positionSourceTex),this._copyPass.render(f),f.gl.clearColor(0,0,0,0),this._framebuffer.attach(this._forcePrevTex),f.gl.clear(f.gl.COLOR_BUFFER_BIT),this._framebuffer.attach(this._globalSpeedPrevTex),f.gl.clear(f.gl.COLOR_BUFFER_BIT),this._framebuffer.unbind(f)},u.prototype._resize=function(f,i){["_positionSourceTex","_positionTex","_positionPrevTex","_forceTex","_forcePrevTex"].forEach(function(o){this[o].width=f,this[o].height=i,this[o].dirty()},this)},u.prototype.dispose=function(f){this._framebuffer.dispose(f),this._copyPass.dispose(f),this._nodeRepulsionPass.dispose(f),this._positionPass.dispose(f),this._globalSpeedPass.dispose(f),this._edgeForceMesh.geometry.dispose(f),this._weightedSumMesh.geometry.dispose(f),this._positionSourceTex.dispose(f),this._positionTex.dispose(f),this._positionPrevTex.dispose(f),this._forceTex.dispose(f),this._forcePrevTex.dispose(f),this._weightedSumTex.dispose(f),this._globalSpeedTex.dispose(f),this._globalSpeedPrevTex.dispose(f)},y.a.ForceAtlas2GPU=u,X.a=u},function(re,X,D){"use strict";X.a=`@export ecgl.forceAtlas2.updateNodeRepulsion
|
|
|
|
#define NODE_COUNT 0
|
|
|
|
uniform sampler2D positionTex;
|
|
|
|
uniform vec2 textureSize;
|
|
uniform float gravity;
|
|
uniform float scaling;
|
|
uniform vec2 gravityCenter;
|
|
|
|
uniform bool strongGravityMode;
|
|
uniform bool preventOverlap;
|
|
|
|
varying vec2 v_Texcoord;
|
|
|
|
void main() {
|
|
|
|
vec4 n0 = texture2D(positionTex, v_Texcoord);
|
|
|
|
vec2 force = vec2(0.0);
|
|
for (int i = 0; i < NODE_COUNT; i++) {
|
|
vec2 uv = vec2(
|
|
mod(float(i), textureSize.x) / (textureSize.x - 1.0),
|
|
floor(float(i) / textureSize.x) / (textureSize.y - 1.0)
|
|
);
|
|
vec4 n1 = texture2D(positionTex, uv);
|
|
|
|
vec2 dir = n0.xy - n1.xy;
|
|
float d2 = dot(dir, dir);
|
|
|
|
if (d2 > 0.0) {
|
|
float factor = 0.0;
|
|
if (preventOverlap) {
|
|
float d = sqrt(d2);
|
|
d = d - n0.w - n1.w;
|
|
if (d > 0.0) {
|
|
factor = scaling * n0.z * n1.z / (d * d);
|
|
}
|
|
else if (d < 0.0) {
|
|
factor = scaling * 100.0 * n0.z * n1.z;
|
|
}
|
|
}
|
|
else {
|
|
factor = scaling * n0.z * n1.z / d2;
|
|
}
|
|
force += dir * factor;
|
|
}
|
|
}
|
|
|
|
vec2 dir = gravityCenter - n0.xy;
|
|
float d = 1.0;
|
|
if (!strongGravityMode) {
|
|
d = length(dir);
|
|
}
|
|
|
|
force += dir * n0.z * gravity / (d + 1.0);
|
|
|
|
gl_FragColor = vec4(force, 0.0, 1.0);
|
|
}
|
|
@end
|
|
|
|
@export ecgl.forceAtlas2.updateEdgeAttraction.vertex
|
|
|
|
attribute vec2 node1;
|
|
attribute vec2 node2;
|
|
attribute float weight;
|
|
|
|
uniform sampler2D positionTex;
|
|
uniform float edgeWeightInfluence;
|
|
uniform bool preventOverlap;
|
|
uniform bool linLogMode;
|
|
|
|
uniform vec2 windowSize: WINDOW_SIZE;
|
|
|
|
varying vec2 v_Force;
|
|
|
|
void main() {
|
|
|
|
vec4 n0 = texture2D(positionTex, node1);
|
|
vec4 n1 = texture2D(positionTex, node2);
|
|
|
|
vec2 dir = n1.xy - n0.xy;
|
|
float d = length(dir);
|
|
float w;
|
|
if (edgeWeightInfluence == 0.0) {
|
|
w = 1.0;
|
|
}
|
|
else if (edgeWeightInfluence == 1.0) {
|
|
w = weight;
|
|
}
|
|
else {
|
|
w = pow(weight, edgeWeightInfluence);
|
|
}
|
|
vec2 offset = vec2(1.0 / windowSize.x, 1.0 / windowSize.y);
|
|
vec2 scale = vec2((windowSize.x - 1.0) / windowSize.x, (windowSize.y - 1.0) / windowSize.y);
|
|
vec2 pos = node1 * scale * 2.0 - 1.0;
|
|
gl_Position = vec4(pos + offset, 0.0, 1.0);
|
|
gl_PointSize = 1.0;
|
|
|
|
float factor;
|
|
if (preventOverlap) {
|
|
d = d - n1.w - n0.w;
|
|
}
|
|
if (d <= 0.0) {
|
|
v_Force = vec2(0.0);
|
|
return;
|
|
}
|
|
|
|
if (linLogMode) {
|
|
factor = w * log(d) / d;
|
|
}
|
|
else {
|
|
factor = w;
|
|
}
|
|
v_Force = dir * factor;
|
|
}
|
|
@end
|
|
|
|
@export ecgl.forceAtlas2.updateEdgeAttraction.fragment
|
|
|
|
varying vec2 v_Force;
|
|
|
|
void main() {
|
|
gl_FragColor = vec4(v_Force, 0.0, 0.0);
|
|
}
|
|
@end
|
|
|
|
@export ecgl.forceAtlas2.calcWeightedSum.vertex
|
|
|
|
attribute vec2 node;
|
|
|
|
varying vec2 v_NodeUv;
|
|
|
|
void main() {
|
|
|
|
v_NodeUv = node;
|
|
gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
|
|
gl_PointSize = 1.0;
|
|
}
|
|
@end
|
|
|
|
@export ecgl.forceAtlas2.calcWeightedSum.fragment
|
|
|
|
varying vec2 v_NodeUv;
|
|
|
|
uniform sampler2D positionTex;
|
|
uniform sampler2D forceTex;
|
|
uniform sampler2D forcePrevTex;
|
|
|
|
void main() {
|
|
vec2 force = texture2D(forceTex, v_NodeUv).rg;
|
|
vec2 forcePrev = texture2D(forcePrevTex, v_NodeUv).rg;
|
|
|
|
float mass = texture2D(positionTex, v_NodeUv).z;
|
|
float swing = length(force - forcePrev) * mass;
|
|
float traction = length(force + forcePrev) * 0.5 * mass;
|
|
|
|
gl_FragColor = vec4(swing, traction, 0.0, 0.0);
|
|
}
|
|
@end
|
|
|
|
@export ecgl.forceAtlas2.calcGlobalSpeed
|
|
|
|
uniform sampler2D globalSpeedPrevTex;
|
|
uniform sampler2D weightedSumTex;
|
|
uniform float jitterTolerence;
|
|
|
|
void main() {
|
|
vec2 weightedSum = texture2D(weightedSumTex, vec2(0.5)).xy;
|
|
float prevGlobalSpeed = texture2D(globalSpeedPrevTex, vec2(0.5)).x;
|
|
float globalSpeed = jitterTolerence * jitterTolerence
|
|
* weightedSum.y / weightedSum.x;
|
|
if (prevGlobalSpeed > 0.0) {
|
|
globalSpeed = min(globalSpeed / prevGlobalSpeed, 1.5) * prevGlobalSpeed;
|
|
}
|
|
gl_FragColor = vec4(globalSpeed, 0.0, 0.0, 1.0);
|
|
}
|
|
@end
|
|
|
|
@export ecgl.forceAtlas2.updatePosition
|
|
|
|
uniform sampler2D forceTex;
|
|
uniform sampler2D forcePrevTex;
|
|
uniform sampler2D positionTex;
|
|
uniform sampler2D globalSpeedTex;
|
|
|
|
varying vec2 v_Texcoord;
|
|
|
|
void main() {
|
|
vec2 force = texture2D(forceTex, v_Texcoord).xy;
|
|
vec2 forcePrev = texture2D(forcePrevTex, v_Texcoord).xy;
|
|
vec4 node = texture2D(positionTex, v_Texcoord);
|
|
|
|
float globalSpeed = texture2D(globalSpeedTex, vec2(0.5)).r;
|
|
float swing = length(force - forcePrev);
|
|
float speed = 0.1 * globalSpeed / (0.1 + globalSpeed * sqrt(swing));
|
|
|
|
float df = length(force);
|
|
if (df > 0.0) {
|
|
speed = min(df * speed, 10.0) / df;
|
|
|
|
gl_FragColor = vec4(node.xy + speed * force, node.zw);
|
|
}
|
|
else {
|
|
gl_FragColor = node;
|
|
}
|
|
}
|
|
@end
|
|
|
|
@export ecgl.forceAtlas2.edges.vertex
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
|
|
attribute vec2 node;
|
|
attribute vec4 a_Color : COLOR;
|
|
varying vec4 v_Color;
|
|
|
|
uniform sampler2D positionTex;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = worldViewProjection * vec4(
|
|
texture2D(positionTex, node).xy, -10.0, 1.0
|
|
);
|
|
v_Color = a_Color;
|
|
}
|
|
@end
|
|
|
|
@export ecgl.forceAtlas2.edges.fragment
|
|
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
|
|
varying vec4 v_Color;
|
|
void main() {
|
|
gl_FragColor = color * v_Color;
|
|
}
|
|
@end`},function(re,X,D){"use strict";var W=D(5),y=D(6),L=D(250),A=L.a.toString();A=A.slice(A.indexOf("{")+1,A.lastIndexOf("}"));var s={barnesHutOptimize:!0,barnesHutTheta:1.5,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null},x=function(c){for(var u in s)this[u]=s[u];if(c)for(var u in c)this[u]=c[u];this._nodes=[],this._edges=[],this._disposed=!1,this._positionTex=new W.a({type:y.a.FLOAT,flipY:!1,minFilter:y.a.NEAREST,magFilter:y.a.NEAREST})};x.prototype.initData=function(c,u){var f=new Blob([A]),i=window.URL.createObjectURL(f);this._worker=new Worker(i),this._worker.onmessage=this._$onupdate.bind(this),this._nodes=c,this._edges=u,this._frame=0;for(var o=c.length,d=u.length,m=new Float32Array(o*2),_=new Float32Array(o),h=new Float32Array(o),v=new Float32Array(d*2),r=new Float32Array(d),a=0;a<c.length;a++){var p=c[a];m[a*2]=p.x,m[a*2+1]=p.y,_[a]=p.mass==null?1:p.mass,h[a]=p.size==null?1:p.size}for(var a=0;a<u.length;a++){var E=u[a],S=E.node1,w=E.node2;v[a*2]=S,v[a*2+1]=w,r[a]=E.weight==null?1:E.weight}var R=Math.ceil(Math.sqrt(c.length)),O=R,z=new Float32Array(R*O*4),N=this._positionTex;N.width=R,N.height=O,N.pixels=z,this._worker.postMessage({cmd:"init",nodesPosition:m,nodesMass:_,nodesSize:h,edges:v,edgesWeight:r}),this._globalSpeed=1/0},x.prototype.updateOption=function(c){var u={};for(var f in s)u[f]=s[f];var i=this._nodes,o=this._edges,d=i.length;if(d>5e4?u.jitterTolerence=10:d>5e3?u.jitterTolerence=1:u.jitterTolerence=.1,d>100?u.scaling=2:u.scaling=10,d>1e3?u.barnesHutOptimize=!0:u.barnesHutOptimize=!1,c)for(var f in s)c[f]!=null&&(u[f]=c[f]);if(!u.gravityCenter){for(var m=[1/0,1/0],_=[-1/0,-1/0],h=0;h<i.length;h++)m[0]=Math.min(i[h].x,m[0]),m[1]=Math.min(i[h].y,m[1]),_[0]=Math.max(i[h].x,_[0]),_[1]=Math.max(i[h].y,_[1]);u.gravityCenter=[(m[0]+_[0])*.5,(m[1]+_[1])*.5]}for(var h=0;h<o.length;h++){var v=o[h].node1,r=o[h].node2;i[v].degree=(i[v].degree||0)+1,i[r].degree=(i[r].degree||0)+1}this._worker&&this._worker.postMessage({cmd:"updateConfig",config:u})},x.prototype.update=function(c,u,f){u==null&&(u=1),u=Math.max(u,1),this._frame+=u,this._onupdate=f,this._worker&&this._worker.postMessage({cmd:"update",steps:Math.round(u)})},x.prototype._$onupdate=function(c){if(!this._disposed){var u=new Float32Array(c.data.buffer);this._globalSpeed=c.data.globalSpeed,this._positionArr=u,this._updateTexture(u),this._onupdate&&this._onupdate()}},x.prototype.getNodePositionTexture=function(){return this._positionTex},x.prototype.getNodeUV=function(c,u){u=u||[];var f=this._positionTex.width,i=this._positionTex.height;return u[0]=c%f/(f-1),u[1]=Math.floor(c/f)/(i-1),u},x.prototype.getNodes=function(){return this._nodes},x.prototype.getEdges=function(){return this._edges},x.prototype.isFinished=function(c){return this._frame>c},x.prototype.getNodePosition=function(c,u){if(u||(u=new Float32Array(this._nodes.length*2)),this._positionArr)for(var f=0;f<this._positionArr.length;f++)u[f]=this._positionArr[f];return u},x.prototype._updateTexture=function(c){for(var u=this._positionTex.pixels,f=0,i=0;i<c.length;)u[f++]=c[i++],u[f++]=c[i++],u[f++]=1,u[f++]=1;this._positionTex.dirty()},x.prototype.dispose=function(c){this._disposed=!0,this._worker=null},X.a=x},function(re,X,D){"use strict";function W(){var y={create:function(){return new Float32Array(2)},dist:function(i,o){var d=o[0]-i[0],m=o[1]-i[1];return Math.sqrt(d*d+m*m)},len:function(i){var o=i[0],d=i[1];return Math.sqrt(o*o+d*d)},scaleAndAdd:function(i,o,d,m){return i[0]=o[0]+d[0]*m,i[1]=o[1]+d[1]*m,i},scale:function(i,o,d){return i[0]=o[0]*d,i[1]=o[1]*d,i},add:function(i,o,d){return i[0]=o[0]+d[0],i[1]=o[1]+d[1],i},sub:function(i,o,d){return i[0]=o[0]-d[0],i[1]=o[1]-d[1],i},normalize:function(i,o){var d=o[0],m=o[1],_=d*d+m*m;return _>0&&(_=1/Math.sqrt(_),i[0]=o[0]*_,i[1]=o[1]*_),i},negate:function(i,o){return i[0]=-o[0],i[1]=-o[1],i},copy:function(i,o){return i[0]=o[0],i[1]=o[1],i},set:function(i,o,d){return i[0]=o,i[1]=d,i}};function L(){this.subRegions=[],this.nSubRegions=0,this.node=null,this.mass=0,this.centerOfMass=null,this.bbox=new Float32Array(4),this.size=0}var A=L.prototype;A.beforeUpdate=function(){for(var i=0;i<this.nSubRegions;i++)this.subRegions[i].beforeUpdate();this.mass=0,this.centerOfMass&&(this.centerOfMass[0]=0,this.centerOfMass[1]=0),this.nSubRegions=0,this.node=null},A.afterUpdate=function(){this.subRegions.length=this.nSubRegions;for(var i=0;i<this.nSubRegions;i++)this.subRegions[i].afterUpdate()},A.addNode=function(i){if(this.nSubRegions===0)if(this.node==null){this.node=i;return}else this._addNodeToSubRegion(this.node),this.node=null;this._addNodeToSubRegion(i),this._updateCenterOfMass(i)},A.findSubRegion=function(i,o){for(var d=0;d<this.nSubRegions;d++){var m=this.subRegions[d];if(m.contain(i,o))return m}},A.contain=function(i,o){return this.bbox[0]<=i&&this.bbox[2]>=i&&this.bbox[1]<=o&&this.bbox[3]>=o},A.setBBox=function(i,o,d,m){this.bbox[0]=i,this.bbox[1]=o,this.bbox[2]=d,this.bbox[3]=m,this.size=(d-i+m-o)/2},A._newSubRegion=function(){var i=this.subRegions[this.nSubRegions];return i||(i=new L,this.subRegions[this.nSubRegions]=i),this.nSubRegions++,i},A._addNodeToSubRegion=function(i){var o=this.findSubRegion(i.position[0],i.position[1]),d=this.bbox;if(!o){var m=(d[0]+d[2])/2,_=(d[1]+d[3])/2,h=(d[2]-d[0])/2,v=(d[3]-d[1])/2,r=i.position[0]>=m?1:0,a=i.position[1]>=_?1:0,o=this._newSubRegion();o.setBBox(r*h+d[0],a*v+d[1],(r+1)*h+d[0],(a+1)*v+d[1])}o.addNode(i)},A._updateCenterOfMass=function(i){this.centerOfMass==null&&(this.centerOfMass=new Float32Array(2));var o=this.centerOfMass[0]*this.mass,d=this.centerOfMass[1]*this.mass;o+=i.position[0]*i.mass,d+=i.position[1]*i.mass,this.mass+=i.mass,this.centerOfMass[0]=o/this.mass,this.centerOfMass[1]=d/this.mass};function s(){this.position=new Float32Array(2),this.force=y.create(),this.forcePrev=y.create(),this.mass=1,this.inDegree=0,this.outDegree=0}function x(i,o){this.source=i,this.target=o,this.weight=1}function c(){this.autoSettings=!0,this.barnesHutOptimize=!0,this.barnesHutTheta=1.5,this.repulsionByDegree=!0,this.linLogMode=!1,this.strongGravityMode=!1,this.gravity=1,this.scaling=1,this.edgeWeightInfluence=1,this.jitterTolerence=.1,this.preventOverlap=!1,this.dissuadeHubs=!1,this.rootRegion=new L,this.rootRegion.centerOfMass=y.create(),this.nodes=[],this.edges=[],this.bbox=new Float32Array(4),this.gravityCenter=null,this._massArr=null,this._swingingArr=null,this._sizeArr=null,this._globalSpeed=0}var u=c.prototype;u.initNodes=function(i,o,d){var m=o.length;this.nodes.length=0;for(var _=typeof d!="undefined",h=0;h<m;h++){var v=new s;v.position[0]=i[h*2],v.position[1]=i[h*2+1],v.mass=o[h],_&&(v.size=d[h]),this.nodes.push(v)}this._massArr=o,this._swingingArr=new Float32Array(m),_&&(this._sizeArr=d)},u.initEdges=function(i,o){var d=i.length/2;this.edges.length=0;for(var m=0;m<d;m++){var _=i[m*2],h=i[m*2+1],v=this.nodes[_],r=this.nodes[h];if(!v||!r){console.error("Node not exists, try initNodes before initEdges");return}v.outDegree++,r.inDegree++;var a=new x(v,r);o&&(a.weight=o[m]),this.edges.push(a)}},u.updateSettings=function(){if(this.repulsionByDegree)for(var i=0;i<this.nodes.length;i++){var o=this.nodes[i];o.mass=o.inDegree+o.outDegree+1}else for(var i=0;i<this.nodes.length;i++){var o=this.nodes[i];o.mass=this._massArr[i]}},u.update=function(){var i=this.nodes.length;if(this.updateSettings(),this.updateBBox(),this.barnesHutOptimize){this.rootRegion.setBBox(this.bbox[0],this.bbox[1],this.bbox[2],this.bbox[3]),this.rootRegion.beforeUpdate();for(var o=0;o<i;o++)this.rootRegion.addNode(this.nodes[o]);this.rootRegion.afterUpdate()}for(var o=0;o<i;o++){var d=this.nodes[o];y.copy(d.forcePrev,d.force),y.set(d.force,0,0)}for(var o=0;o<i;o++){var m=this.nodes[o];if(this.barnesHutOptimize)this.applyRegionToNodeRepulsion(this.rootRegion,m);else for(var _=o+1;_<i;_++){var h=this.nodes[_];this.applyNodeToNodeRepulsion(m,h,!1)}this.gravity>0&&(this.strongGravityMode?this.applyNodeStrongGravity(m):this.applyNodeGravity(m))}for(var o=0;o<this.edges.length;o++)this.applyEdgeAttraction(this.edges[o]);for(var v=0,r=0,a=y.create(),o=0;o<i;o++){var d=this.nodes[o],p=y.dist(d.force,d.forcePrev);v+=p*d.mass,y.add(a,d.force,d.forcePrev);var E=y.len(a)*.5;r+=E*d.mass,this._swingingArr[o]=p}var S=this.jitterTolerence*this.jitterTolerence*r/v;this._globalSpeed>0&&(S=Math.min(S/this._globalSpeed,1.5)*this._globalSpeed),this._globalSpeed=S;for(var o=0;o<i;o++){var d=this.nodes[o],p=this._swingingArr[o],w=.1*S/(1+S*Math.sqrt(p)),R=y.len(d.force);R>0&&(w=Math.min(R*w,10)/R,y.scaleAndAdd(d.position,d.position,d.force,w))}},u.applyRegionToNodeRepulsion=function(){var i=y.create();return function(d,m){if(d.node)this.applyNodeToNodeRepulsion(d.node,m,!0);else{y.sub(i,m.position,d.centerOfMass);var _=i[0]*i[0]+i[1]*i[1];if(_>this.barnesHutTheta*d.size*d.size){var h=this.scaling*m.mass*d.mass/_;y.scaleAndAdd(m.force,m.force,i,h)}else for(var v=0;v<d.nSubRegions;v++)this.applyRegionToNodeRepulsion(d.subRegions[v],m)}}}(),u.applyNodeToNodeRepulsion=function(){var i=y.create();return function(d,m,_){if(d!=m){y.sub(i,d.position,m.position);var h=i[0]*i[0]+i[1]*i[1];if(h!==0){var v;if(this.preventOverlap){var r=Math.sqrt(h);if(r=r-d.size-m.size,r>0)v=this.scaling*d.mass*m.mass/(r*r);else if(r<0)v=this.scaling*100*d.mass*m.mass;else return}else v=this.scaling*d.mass*m.mass/h;y.scaleAndAdd(d.force,d.force,i,v),y.scaleAndAdd(m.force,m.force,i,-v)}}}}(),u.applyEdgeAttraction=function(){var i=y.create();return function(d){var m=d.source,_=d.target;y.sub(i,m.position,_.position);var h=y.len(i),v;this.edgeWeightInfluence===0?v=1:this.edgeWeightInfluence===1?v=d.weight:v=Math.pow(d.weight,this.edgeWeightInfluence);var r;this.preventOverlap&&(h=h-m.size-_.size,h<=0)||(this.linLogMode?r=-v*Math.log(h+1)/(h+1):r=-v,y.scaleAndAdd(m.force,m.force,i,r),y.scaleAndAdd(_.force,_.force,i,-r))}}(),u.applyNodeGravity=function(){var i=y.create();return function(o){y.sub(i,this.gravityCenter,o.position);var d=y.len(i);y.scaleAndAdd(o.force,o.force,i,this.gravity*o.mass/(d+1))}}(),u.applyNodeStrongGravity=function(){var i=y.create();return function(o){y.sub(i,this.gravityCenter,o.position),y.scaleAndAdd(o.force,o.force,i,this.gravity*o.mass)}}(),u.updateBBox=function(){for(var i=1/0,o=1/0,d=-1/0,m=-1/0,_=0;_<this.nodes.length;_++){var h=this.nodes[_].position;i=Math.min(i,h[0]),o=Math.min(o,h[1]),d=Math.max(d,h[0]),m=Math.max(m,h[1])}this.bbox[0]=i,this.bbox[1]=o,this.bbox[2]=d,this.bbox[3]=m},u.getGlobalSpeed=function(){return this._globalSpeed};var f=null;self.onmessage=function(i){switch(i.data.cmd){case"init":f=new c,f.initNodes(i.data.nodesPosition,i.data.nodesMass,i.data.nodesSize),f.initEdges(i.data.edges,i.data.edgesWeight);break;case"updateConfig":if(f)for(var o in i.data.config)f[o]=i.data.config[o];break;case"update":var d=i.data.steps;if(f){for(var m=0;m<d;m++)f.update();for(var _=f.nodes.length,h=new Float32Array(_*2),m=0;m<_;m++){var v=f.nodes[m];h[m*2]=v.position[0],h[m*2+1]=v.position[1]}self.postMessage({buffer:h.buffer,globalSpeed:f.getGlobalSpeed()},[h.buffer])}else{var r=new Float32Array;self.postMessage({buffer:r.buffer,globalSpeed:f.getGlobalSpeed()},[r.buffer])}break}}}X.a=W},function(re,X,D){"use strict";var W=D(8),y=D(3),L=W.a.extend(function(){return{zr:null,viewGL:null,minZoom:.2,maxZoom:5,_needsUpdate:!1,_dx:0,_dy:0,_zoom:1}},function(){this._mouseDownHandler=this._mouseDownHandler.bind(this),this._mouseWheelHandler=this._mouseWheelHandler.bind(this),this._mouseMoveHandler=this._mouseMoveHandler.bind(this),this._mouseUpHandler=this._mouseUpHandler.bind(this),this._update=this._update.bind(this)},{init:function(){var A=this.zr;A.on("mousedown",this._mouseDownHandler),A.on("mousewheel",this._mouseWheelHandler),A.on("globalout",this._mouseUpHandler),A.animation.on("frame",this._update)},setTarget:function(A){this._target=A},setZoom:function(A){this._zoom=Math.max(Math.min(A,this.maxZoom),this.minZoom),this._needsUpdate=!0},setOffset:function(A){this._dx=A[0],this._dy=A[1],this._needsUpdate=!0},getZoom:function(){return this._zoom},getOffset:function(){return[this._dx,this._dy]},_update:function(){if(this._target&&this._needsUpdate){var A=this._target,s=this._zoom;A.position.x=this._dx,A.position.y=this._dy,A.scale.set(s,s,s),this.zr.refresh(),this._needsUpdate=!1,this.trigger("update")}},_mouseDownHandler:function(A){if(!A.target){var s=A.offsetX,x=A.offsetY;if(!(this.viewGL&&!this.viewGL.containPoint(s,x))){this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler);var c=this._convertPos(s,x);this._x=c.x,this._y=c.y}}},_convertPos:function(A,s){var x=this.viewGL.camera,c=this.viewGL.viewport;return{x:(A-c.x)/c.width*(x.right-x.left)+x.left,y:(s-c.y)/c.height*(x.bottom-x.top)+x.top}},_mouseMoveHandler:function(A){var s=this._convertPos(A.offsetX,A.offsetY);this._dx+=s.x-this._x,this._dy+=s.y-this._y,this._x=s.x,this._y=s.y,this._needsUpdate=!0},_mouseUpHandler:function(A){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_mouseWheelHandler:function(A){A=A.event;var s=A.wheelDelta||-A.detail;if(s!==0){var x=A.offsetX,c=A.offsetY;if(!(this.viewGL&&!this.viewGL.containPoint(x,c))){var u=s>0?1.1:.9,f=Math.max(Math.min(this._zoom*u,this.maxZoom),this.minZoom);u=f/this._zoom;var i=this._convertPos(x,c),o=(i.x-this._dx)*(u-1),d=(i.y-this._dy)*(u-1);this._dx-=o,this._dy-=d,this._zoom=f,this._needsUpdate=!0}}},dispose:function(){var A=this.zr;A.off("mousedown",this._mouseDownHandler),A.off("mousemove",this._mouseMoveHandler),A.off("mouseup",this._mouseUpHandler),A.off("mousewheel",this._mouseWheelHandler),A.off("globalout",this._mouseUpHandler),A.animation.off("frame",this._update)}});X.a=L},function(re,X,D){"use strict";X.a=`@export ecgl.lines2D.vertex
|
|
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
|
|
attribute vec2 position: POSITION;
|
|
attribute vec4 a_Color : COLOR;
|
|
varying vec4 v_Color;
|
|
|
|
#ifdef POSITIONTEXTURE_ENABLED
|
|
uniform sampler2D positionTexture;
|
|
#endif
|
|
|
|
void main()
|
|
{
|
|
gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);
|
|
|
|
v_Color = a_Color;
|
|
}
|
|
|
|
@end
|
|
|
|
@export ecgl.lines2D.fragment
|
|
|
|
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
|
|
|
|
varying vec4 v_Color;
|
|
|
|
void main()
|
|
{
|
|
gl_FragColor = color * v_Color;
|
|
}
|
|
@end
|
|
|
|
|
|
@export ecgl.meshLines2D.vertex
|
|
|
|
attribute vec2 position: POSITION;
|
|
attribute vec2 normal;
|
|
attribute float offset;
|
|
attribute vec4 a_Color : COLOR;
|
|
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
uniform vec4 viewport : VIEWPORT;
|
|
|
|
varying vec4 v_Color;
|
|
varying float v_Miter;
|
|
|
|
void main()
|
|
{
|
|
vec4 p2 = worldViewProjection * vec4(position + normal, -10.0, 1.0);
|
|
gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);
|
|
|
|
p2.xy /= p2.w;
|
|
gl_Position.xy /= gl_Position.w;
|
|
|
|
vec2 N = normalize(p2.xy - gl_Position.xy);
|
|
gl_Position.xy += N * offset / viewport.zw * 2.0;
|
|
|
|
gl_Position.xy *= gl_Position.w;
|
|
|
|
v_Color = a_Color;
|
|
}
|
|
@end
|
|
|
|
|
|
@export ecgl.meshLines2D.fragment
|
|
|
|
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
|
|
|
|
varying vec4 v_Color;
|
|
varying float v_Miter;
|
|
|
|
void main()
|
|
{
|
|
gl_FragColor = color * v_Color;
|
|
}
|
|
|
|
@end`},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(254),A=D(258)},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(3),s=D(20),x=D(255);y.a.extendChartView({type:"flowGL",__ecgl__:!0,init:function(c,u){this.viewGL=new s.a("orthographic"),this.groupGL=new L.a.Node,this.viewGL.add(this.groupGL),this._particleSurface=new x.a;var f=new L.a.Mesh({geometry:new L.a.PlaneGeometry,material:new L.a.Material({shader:new L.a.Shader({vertex:L.a.Shader.source("ecgl.color.vertex"),fragment:L.a.Shader.source("ecgl.color.fragment")}),transparent:!0})});f.material.enableTexture("diffuseMap"),this.groupGL.add(f),this._planeMesh=f},render:function(c,u,f){var i=this._particleSurface;i.setParticleType(c.get("particleType")),i.setSupersampling(c.get("supersampling")),this._updateData(c,f),this._updateCamera(f.getWidth(),f.getHeight(),f.getDevicePixelRatio());var o=A.a.firstNotNull(c.get("particleDensity"),128);i.setParticleDensity(o,o);var d=this._planeMesh,m=+new Date,_=this,h=!0;d.__percent=0,d.stopAnimation(),d.animate("",{loop:!0}).when(1e5,{__percent:1}).during(function(){var a=+new Date,p=Math.min(a-m,20);m=m+p,_._renderer&&(i.update(_._renderer,f,p/1e3,h),d.material.set("diffuseMap",i.getSurfaceTexture())),h=!1}).start();var v=c.getModel("itemStyle"),r=L.a.parseColor(v.get("color"));r[3]*=A.a.firstNotNull(v.get("opacity"),1),d.material.set("color",r),i.setColorTextureImage(c.get("colorTexture"),f),i.setParticleSize(c.get("particleSize")),i.particleSpeedScaling=c.get("particleSpeed"),i.motionBlurFactor=1-Math.pow(.1,c.get("particleTrail"))},updateTransform:function(c,u,f){this._updateData(c,f)},afterRender:function(c,u,f,i){var o=i.renderer;this._renderer=o},_updateData:function(c,u){var f=c.coordinateSystem,i=f.dimensions.map(function(z){return c.coordDimToDataDim(z)[0]}),o=c.getData(),d=o.getDataExtent(i[0]),m=o.getDataExtent(i[1]),_=c.get("gridWidth"),h=c.get("gridHeight");if(_==null||_==="auto"){var v=(d[1]-d[0])/(m[1]-m[0]);_=Math.round(Math.sqrt(v*o.count()))}(h==null||h==="auto")&&(h=Math.ceil(o.count()/_));var r=this._particleSurface.vectorFieldTexture,a=r.pixels;if(!a||a.length!==h*_*4)a=r.pixels=new Float32Array(_*h*4);else for(var p=0;p<a.length;p++)a[p]=0;var E=0,S=1/0,w=new Float32Array(o.count()*2),R=0,O=[[1/0,1/0],[-1/0,-1/0]];o.each([i[0],i[1],"vx","vy"],function(z,N,P,F){var K=f.dataToPoint([z,N]);w[R++]=K[0],w[R++]=K[1],O[0][0]=Math.min(K[0],O[0][0]),O[0][1]=Math.min(K[1],O[0][1]),O[1][0]=Math.max(K[0],O[1][0]),O[1][1]=Math.max(K[1],O[1][1]);var B=Math.sqrt(P*P+F*F);E=Math.max(E,B),S=Math.min(S,B)}),o.each(["vx","vy"],function(z,N,P){var F=Math.round((w[P*2]-O[0][0])/(O[1][0]-O[0][0])*(_-1)),K=h-1-Math.round((w[P*2+1]-O[0][1])/(O[1][1]-O[0][1])*(h-1)),B=(K*_+F)*4;a[B]=z/E*.5+.5,a[B+1]=N/E*.5+.5,a[B+3]=1}),r.width=_,r.height=h,c.get("coordinateSystem")==="bmap"&&this._fillEmptyPixels(r),r.dirty(),this._updatePlanePosition(O[0],O[1],c,u),this._updateGradientTexture(o.getVisual("visualMeta"),[S,E])},_fillEmptyPixels:function(c){var u=c.pixels,f=c.width,i=c.height;function o(w,R,O){w=Math.max(Math.min(w,f-1),0),R=Math.max(Math.min(R,i-1),0);var z=(R*(f-1)+w)*4;return u[z+3]===0?!1:(O[0]=u[z],O[1]=u[z+1],!0)}function d(w,R,O){O[0]=w[0]+R[0],O[1]=w[1]+R[1]}for(var m=[],_=[],h=[],v=[],r=[],a=0,p=0;p<i;p++)for(var E=0;E<f;E++){var S=(p*(f-1)+E)*4;u[S+3]===0&&(a=m[0]=m[1]=0,o(E-1,p,_)&&(a++,d(_,m,m)),o(E+1,p,h)&&(a++,d(h,m,m)),o(E,p-1,v)&&(a++,d(v,m,m)),o(E,p+1,r)&&(a++,d(r,m,m)),m[0]/=a,m[1]/=a,u[S]=m[0],u[S+1]=m[1]),u[S+3]=1}},_updateGradientTexture:function(c,u){if(!c||!c.length){this._particleSurface.setGradientTexture(null);return}this._gradientTexture=this._gradientTexture||new L.a.Texture2D({image:document.createElement("canvas")});var f=this._gradientTexture,i=f.image;i.width=200,i.height=1;var o=i.getContext("2d"),d=o.createLinearGradient(0,.5,i.width,.5);c[0].stops.forEach(function(m){var _;u[1]===u[0]?_=0:(_=m.value/u[1],_=Math.min(Math.max(_,0),1)),d.addColorStop(_,m.color)}),o.fillStyle=d,o.fillRect(0,0,i.width,i.height),f.dirty(),this._particleSurface.setGradientTexture(this._gradientTexture)},_updatePlanePosition:function(c,u,f,i){var o=this._limitInViewportAndFullFill(c,u,f,i);c=o.leftTop,u=o.rightBottom,this._particleSurface.setRegion(o.region),this._planeMesh.position.set((c[0]+u[0])/2,i.getHeight()-(c[1]+u[1])/2,0);var d=u[0]-c[0],m=u[1]-c[1];this._planeMesh.scale.set(d/2,m/2,1),this._particleSurface.resize(Math.max(Math.min(d,2048),1),Math.max(Math.min(m,2048),1)),this._renderer&&this._particleSurface.clearFrame(this._renderer)},_limitInViewportAndFullFill:function(c,u,f,i){var o=[Math.max(c[0],0),Math.max(c[1],0)],d=[Math.min(u[0],i.getWidth()),Math.min(u[1],i.getHeight())];if(f.get("coordinateSystem")==="bmap"){var m=f.getData().getDataExtent(f.coordDimToDataDim("lng")[0]),_=Math.floor(m[1]-m[0])>=359;_&&(o[0]>0&&(o[0]=0),d[0]<i.getWidth()&&(d[0]=i.getWidth()))}var h=u[0]-c[0],v=u[1]-c[1],r=d[0]-o[0],a=d[1]-o[1],p=[(o[0]-c[0])/h,1-a/v-(o[1]-c[1])/v,r/h,a/v];return{leftTop:o,rightBottom:d,region:p}},_updateCamera:function(c,u,f){this.viewGL.setViewport(0,0,c,u,f);var i=this.viewGL.camera;i.left=i.bottom=0,i.top=u,i.right=c,i.near=0,i.far=100,i.position.z=10},remove:function(){this._planeMesh.stopAnimation(),this.groupGL.removeAll()},dispose:function(){this._renderer&&this._particleSurface.dispose(this._renderer),this.groupGL.removeAll()}})},function(re,X,D){"use strict";var W=D(14),y=D(13),L=D(24),A=D(17),s=D(7),x=D(5),c=D(6),u=D(30),f=D(37),i=D(10),o=D(256),d=D(257);s.a.import(d.a);function m(h){var v=document.createElement("canvas");v.width=v.height=h;var r=v.getContext("2d");return r.fillStyle="#fff",r.arc(h/2,h/2,h/2,0,Math.PI*2),r.fill(),v}var _=function(){this.motionBlurFactor=.99,this.vectorFieldTexture=new x.a({type:c.a.FLOAT,flipY:!1}),this.particleLife=[5,20],this._particleType="point",this._particleSize=1,this.particleColor=[1,1,1,1],this.particleSpeedScaling=1,this._thisFrameTexture=null,this._particlePass=null,this._spawnTexture=null,this._particleTexture0=null,this._particleTexture1=null,this._particlePointsMesh=null,this._surfaceFrameBuffer=null,this._elapsedTime=0,this._scene=null,this._camera=null,this._lastFrameTexture=null,this._supersampling=1,this._downsampleTextures=[],this._width=512,this._height=512,this.init()};_.prototype={constructor:_,init:function(){var h={type:c.a.FLOAT,minFilter:c.a.NEAREST,magFilter:c.a.NEAREST,useMipmap:!1};this._spawnTexture=new x.a(h),this._particleTexture0=new x.a(h),this._particleTexture1=new x.a(h),this._frameBuffer=new i.a({depthBuffer:!1}),this._particlePass=new W.a({fragment:s.a.source("ecgl.vfParticle.particle.fragment")}),this._particlePass.setUniform("velocityTexture",this.vectorFieldTexture),this._particlePass.setUniform("spawnTexture",this._spawnTexture),this._downsamplePass=new W.a({fragment:s.a.source("clay.compositor.downsample")});var v=new L.a({renderOrder:10,material:new A.a({shader:new s.a(s.a.source("ecgl.vfParticle.renderPoints.vertex"),s.a.source("ecgl.vfParticle.renderPoints.fragment"))}),mode:L.a.POINTS,geometry:new y.a({dynamic:!0,mainAttribute:"texcoord0"})}),r=new L.a({renderOrder:10,material:new A.a({shader:new s.a(s.a.source("ecgl.vfParticle.renderLines.vertex"),s.a.source("ecgl.vfParticle.renderLines.fragment"))}),geometry:new o.a,culling:!1}),a=new L.a({material:new A.a({shader:new s.a(s.a.source("ecgl.color.vertex"),s.a.source("ecgl.color.fragment"))}),geometry:new f.a});a.material.enableTexture("diffuseMap"),this._particlePointsMesh=v,this._particleLinesMesh=r,this._lastFrameFullQuadMesh=a,this._camera=new u.a,this._thisFrameTexture=new x.a,this._lastFrameTexture=new x.a},setParticleDensity:function(h,v){for(var r=h*v,a=new Float32Array(r*4),p=0,E=this.particleLife,S=0;S<h;S++)for(var w=0;w<v;w++,p++){a[p*4]=Math.random(),a[p*4+1]=Math.random(),a[p*4+2]=Math.random();var R=(E[1]-E[0])*Math.random()+E[0];a[p*4+3]=R}this._particleType==="line"?this._setLineGeometry(h,v):this._setPointsGeometry(h,v),this._spawnTexture.width=h,this._spawnTexture.height=v,this._spawnTexture.pixels=a,this._particleTexture0.width=this._particleTexture1.width=h,this._particleTexture0.height=this._particleTexture1.height=v,this._particlePass.setUniform("textureSize",[h,v])},_setPointsGeometry:function(h,v){var r=h*v,a=this._particlePointsMesh.geometry,p=a.attributes;p.texcoord0.init(r);for(var E=0,S=0;S<h;S++)for(var w=0;w<v;w++,E++)p.texcoord0.value[E*2]=S/h,p.texcoord0.value[E*2+1]=w/v;a.dirty()},_setLineGeometry:function(h,v){var r=h*v,a=this._getParticleMesh().geometry;a.setLineCount(r),a.resetOffset();for(var p=0;p<h;p++)for(var E=0;E<v;E++)a.addLine([p/h,E/v]);a.dirty()},_getParticleMesh:function(){return this._particleType==="line"?this._particleLinesMesh:this._particlePointsMesh},update:function(h,v,r,a){var p=this._getParticleMesh(),E=this._frameBuffer,S=this._particlePass;a&&this._updateDownsampleTextures(h,v),p.material.set("size",this._particleSize*this._supersampling),p.material.set("color",this.particleColor),S.setUniform("speedScaling",this.particleSpeedScaling),E.attach(this._particleTexture1),S.setUniform("firstFrameTime",a?(this.particleLife[1]+this.particleLife[0])/2:0),S.setUniform("particleTexture",this._particleTexture0),S.setUniform("deltaTime",r),S.setUniform("elapsedTime",this._elapsedTime),S.render(h,E),p.material.set("particleTexture",this._particleTexture1),p.material.set("prevParticleTexture",this._particleTexture0),E.attach(this._thisFrameTexture),E.bind(h),h.gl.clear(h.gl.DEPTH_BUFFER_BIT|h.gl.COLOR_BUFFER_BIT);var w=this._lastFrameFullQuadMesh;w.material.set("diffuseMap",this._lastFrameTexture),w.material.set("color",[1,1,1,this.motionBlurFactor]),this._camera.update(!0),h.renderPass([w,p],this._camera),E.unbind(h),this._downsample(h),this._swapTexture(),this._elapsedTime+=r},_downsample:function(h){var v=this._downsampleTextures;if(v.length!==0)for(var r=0,a=this._thisFrameTexture,p=v[r];p;)this._frameBuffer.attach(p),this._downsamplePass.setUniform("texture",a),this._downsamplePass.setUniform("textureSize",[a.width,a.height]),this._downsamplePass.render(h,this._frameBuffer),a=p,p=v[++r]},getSurfaceTexture:function(){var h=this._downsampleTextures;return h.length>0?h[h.length-1]:this._lastFrameTexture},setRegion:function(h){this._particlePass.setUniform("region",h)},resize:function(h,v){this._lastFrameTexture.width=h*this._supersampling,this._lastFrameTexture.height=v*this._supersampling,this._thisFrameTexture.width=h*this._supersampling,this._thisFrameTexture.height=v*this._supersampling,this._width=h,this._height=v},setParticleSize:function(h){var v=this._getParticleMesh();if(h<=2){v.material.disableTexture("spriteTexture"),v.material.transparent=!1;return}this._spriteTexture||(this._spriteTexture=new x.a),(!this._spriteTexture.image||this._spriteTexture.image.width!==h)&&(this._spriteTexture.image=m(h),this._spriteTexture.dirty()),v.material.transparent=!0,v.material.enableTexture("spriteTexture"),v.material.set("spriteTexture",this._spriteTexture),this._particleSize=h},setGradientTexture:function(h){var v=this._getParticleMesh().material;v[h?"enableTexture":"disableTexture"]("gradientTexture"),v.setUniform("gradientTexture",h)},setColorTextureImage:function(h,v){var r=this._getParticleMesh().material;r.setTextureImage("colorTexture",h,v,{flipY:!0})},setParticleType:function(h){this._particleType=h},clearFrame:function(h){var v=this._frameBuffer;v.attach(this._lastFrameTexture),v.bind(h),h.gl.clear(h.gl.DEPTH_BUFFER_BIT|h.gl.COLOR_BUFFER_BIT),v.unbind(h)},setSupersampling:function(h){this._supersampling=h,this.resize(this._width,this._height)},_updateDownsampleTextures:function(h,v){for(var r=this._downsampleTextures,a=Math.max(Math.floor(Math.log(this._supersampling/v.getDevicePixelRatio())/Math.log(2)),0),p=2,E=this._width*this._supersampling,S=this._height*this._supersampling,w=0;w<a;w++)r[w]=r[w]||new x.a,r[w].width=E/p,r[w].height=S/p,p*=2;for(;w<r.length;w++)r[w].dispose(h);r.length=a},_swapTexture:function(){var h=this._particleTexture0;this._particleTexture0=this._particleTexture1,this._particleTexture1=h;var h=this._thisFrameTexture;this._thisFrameTexture=this._lastFrameTexture,this._lastFrameTexture=h},dispose:function(h){h.disposeFrameBuffer(this._frameBuffer),h.disposeTexture(this.vectorFieldTexture),h.disposeTexture(this._spawnTexture),h.disposeTexture(this._particleTexture0),h.disposeTexture(this._particleTexture1),h.disposeTexture(this._thisFrameTexture),h.disposeTexture(this._lastFrameTexture),h.disposeGeometry(this._particleLinesMesh.geometry),h.disposeGeometry(this._particlePointsMesh.geometry),h.disposeGeometry(this._lastFrameFullQuadMesh.geometry),this._spriteTexture&&h.disposeTexture(this._spriteTexture),this._particlePass.dispose(h),this._downsamplePass.dispose(h),this._downsampleTextures.forEach(function(v){v.dispose(h)})}},X.a=_},function(re,X,D){"use strict";var W=D(13),y=D(0),L=D.n(y),A=W.a.extend(function(){return{dynamic:!0,attributes:{position:new W.a.Attribute("position","float",3,"POSITION")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setLineCount:function(s){var x=this.attributes,c=4*s,u=2*s;this.vertexCount!==c&&x.position.init(c),this.triangleCount!==u&&(u===0?this.indices=null:this.indices=this.vertexCount>65535?new Uint32Array(u*3):new Uint16Array(u*3))},addLine:function(s){var x=this._vertexOffset;this.attributes.position.set(x,[s[0],s[1],1]),this.attributes.position.set(x+1,[s[0],s[1],-1]),this.attributes.position.set(x+2,[s[0],s[1],2]),this.attributes.position.set(x+3,[s[0],s[1],-2]),this.setTriangleIndices(this._faceOffset++,[x,x+1,x+2]),this.setTriangleIndices(this._faceOffset++,[x+1,x+2,x+3]),this._vertexOffset+=4}});X.a=A},function(re,X,D){"use strict";X.a=`@export ecgl.vfParticle.particle.fragment
|
|
|
|
uniform sampler2D particleTexture;
|
|
uniform sampler2D spawnTexture;
|
|
uniform sampler2D velocityTexture;
|
|
|
|
uniform float deltaTime;
|
|
uniform float elapsedTime;
|
|
|
|
uniform float speedScaling : 1.0;
|
|
|
|
uniform vec2 textureSize;
|
|
uniform vec4 region : [0, 0, 1, 1];
|
|
uniform float firstFrameTime;
|
|
|
|
varying vec2 v_Texcoord;
|
|
|
|
|
|
void main()
|
|
{
|
|
vec4 p = texture2D(particleTexture, v_Texcoord);
|
|
bool spawn = false;
|
|
if (p.w <= 0.0) {
|
|
p = texture2D(spawnTexture, fract(v_Texcoord + elapsedTime / 10.0));
|
|
p.w -= firstFrameTime;
|
|
spawn = true;
|
|
}
|
|
vec2 v = texture2D(velocityTexture, fract(p.xy * region.zw + region.xy)).xy;
|
|
v = (v - 0.5) * 2.0;
|
|
p.z = length(v);
|
|
p.xy += v * deltaTime / 10.0 * speedScaling;
|
|
p.w -= deltaTime;
|
|
|
|
if (spawn || p.xy != fract(p.xy)) {
|
|
p.z = 0.0;
|
|
}
|
|
p.xy = fract(p.xy);
|
|
|
|
gl_FragColor = p;
|
|
}
|
|
@end
|
|
|
|
@export ecgl.vfParticle.renderPoints.vertex
|
|
|
|
#define PI 3.1415926
|
|
|
|
attribute vec2 texcoord : TEXCOORD_0;
|
|
|
|
uniform sampler2D particleTexture;
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
|
|
uniform float size : 1.0;
|
|
|
|
varying float v_Mag;
|
|
varying vec2 v_Uv;
|
|
|
|
void main()
|
|
{
|
|
vec4 p = texture2D(particleTexture, texcoord);
|
|
|
|
if (p.w > 0.0 && p.z > 1e-5) {
|
|
gl_Position = worldViewProjection * vec4(p.xy * 2.0 - 1.0, 0.0, 1.0);
|
|
}
|
|
else {
|
|
gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);
|
|
}
|
|
|
|
v_Mag = p.z;
|
|
v_Uv = p.xy;
|
|
|
|
gl_PointSize = size;
|
|
}
|
|
|
|
@end
|
|
|
|
@export ecgl.vfParticle.renderPoints.fragment
|
|
|
|
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
|
|
uniform sampler2D gradientTexture;
|
|
uniform sampler2D colorTexture;
|
|
uniform sampler2D spriteTexture;
|
|
|
|
varying float v_Mag;
|
|
varying vec2 v_Uv;
|
|
|
|
void main()
|
|
{
|
|
gl_FragColor = color;
|
|
#ifdef SPRITETEXTURE_ENABLED
|
|
gl_FragColor *= texture2D(spriteTexture, gl_PointCoord);
|
|
if (color.a == 0.0) {
|
|
discard;
|
|
}
|
|
#endif
|
|
#ifdef GRADIENTTEXTURE_ENABLED
|
|
gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));
|
|
#endif
|
|
#ifdef COLORTEXTURE_ENABLED
|
|
gl_FragColor *= texture2D(colorTexture, v_Uv);
|
|
#endif
|
|
}
|
|
|
|
@end
|
|
|
|
@export ecgl.vfParticle.renderLines.vertex
|
|
|
|
#define PI 3.1415926
|
|
|
|
attribute vec3 position : POSITION;
|
|
|
|
uniform sampler2D particleTexture;
|
|
uniform sampler2D prevParticleTexture;
|
|
|
|
uniform float size : 1.0;
|
|
uniform vec4 vp: VIEWPORT;
|
|
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
|
|
|
|
varying float v_Mag;
|
|
varying vec2 v_Uv;
|
|
|
|
@import clay.util.rand
|
|
|
|
void main()
|
|
{
|
|
vec4 p = texture2D(particleTexture, position.xy);
|
|
vec4 p2 = texture2D(prevParticleTexture, position.xy);
|
|
|
|
p.xy = p.xy * 2.0 - 1.0;
|
|
p2.xy = p2.xy * 2.0 - 1.0;
|
|
|
|
if (p.w > 0.0 && p.z > 1e-5) {
|
|
vec2 dir = normalize(p.xy - p2.xy);
|
|
vec2 norm = vec2(dir.y / vp.z, -dir.x / vp.w) * sign(position.z) * size;
|
|
if (abs(position.z) == 2.0) {
|
|
gl_Position = vec4(p.xy + norm, 0.0, 1.0);
|
|
v_Uv = p.xy;
|
|
v_Mag = p.z;
|
|
}
|
|
else {
|
|
gl_Position = vec4(p2.xy + norm, 0.0, 1.0);
|
|
v_Mag = p2.z;
|
|
v_Uv = p2.xy;
|
|
}
|
|
gl_Position = worldViewProjection * gl_Position;
|
|
}
|
|
else {
|
|
gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);
|
|
}
|
|
}
|
|
|
|
@end
|
|
|
|
@export ecgl.vfParticle.renderLines.fragment
|
|
|
|
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
|
|
uniform sampler2D gradientTexture;
|
|
uniform sampler2D colorTexture;
|
|
|
|
varying float v_Mag;
|
|
varying vec2 v_Uv;
|
|
|
|
void main()
|
|
{
|
|
gl_FragColor = color;
|
|
#ifdef GRADIENTTEXTURE_ENABLED
|
|
gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));
|
|
#endif
|
|
#ifdef COLORTEXTURE_ENABLED
|
|
gl_FragColor *= texture2D(colorTexture, v_Uv);
|
|
#endif
|
|
}
|
|
|
|
@end
|
|
`},function(re,X,D){"use strict";var W=D(0),y=D.n(W);y.a.extendSeriesModel({type:"series.flowGL",dependencies:["geo","grid","bmap"],visualColorAccessPath:"itemStyle.color",getInitialData:function(L,A){var s=y.a.getCoordinateSystemDimensions(this.get("coordinateSystem"))||["x","y"];if(s.length>2)throw new Error("flowGL can only be used on 2d coordinate systems.");s.push("vx","vy");var x=y.a.helper.completeDimensions(s,this.getSource(),{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),c=new y.a.List(x,this);return c.initData(this.getSource()),c},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,supersampling:1,particleType:"point",particleDensity:128,particleSize:1,particleSpeed:1,particleTrail:2,colorTexture:null,gridWidth:"auto",gridHeight:"auto",itemStyle:{color:"#fff",opacity:.8}}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(260),A=D(261),s=D(16);y.a.registerVisual(Object(s.a)("linesGL"))},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(12),A=D.n(L),s=y.a.extendSeriesModel({type:"series.linesGL",dependencies:["grid","geo"],visualColorAccessPath:"lineStyle.color",streamEnabled:!0,init:function(x){var c=this._processFlatCoordsArray(x.data);this._flatCoords=c.flatCoords,this._flatCoordsOffset=c.flatCoordsOffset,c.flatCoords&&(x.data=new Float32Array(c.count)),s.superApply(this,"init",arguments)},mergeOption:function(x){var c=this._processFlatCoordsArray(x.data);this._flatCoords=c.flatCoords,this._flatCoordsOffset=c.flatCoordsOffset,c.flatCoords&&(x.data=new Float32Array(c.count)),s.superApply(this,"mergeOption",arguments)},appendData:function(x){var c=this._processFlatCoordsArray(x.data);c.flatCoords&&(this._flatCoords?(this._flatCoords=Object(L.concatArray)(this._flatCoords,c.flatCoords),this._flatCoordsOffset=Object(L.concatArray)(this._flatCoordsOffset,c.flatCoordsOffset)):(this._flatCoords=c.flatCoords,this._flatCoordsOffset=c.flatCoordsOffset),x.data=new Float32Array(c.count)),this.getRawData().appendData(x.data)},_getCoordsFromItemModel:function(x){var c=this.getData().getItemModel(x),u=c.option instanceof Array?c.option:c.getShallow("coords");if(!(u instanceof Array&&u.length>0&&u[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(u)+". Lines must have 2d coords array in data item.");return u},getLineCoordsCount:function(x){return this._flatCoordsOffset?this._flatCoordsOffset[x*2+1]:this._getCoordsFromItemModel(x).length},getLineCoords:function(x,c){if(this._flatCoordsOffset){for(var u=this._flatCoordsOffset[x*2],f=this._flatCoordsOffset[x*2+1],i=0;i<f;i++)c[i]=c[i]||[],c[i][0]=this._flatCoords[u+i*2],c[i][1]=this._flatCoords[u+i*2+1];return f}else{for(var o=this._getCoordsFromItemModel(x),i=0;i<o.length;i++)c[i]=c[i]||[],c[i][0]=o[i][0],c[i][1]=o[i][1];return o.length}},_processFlatCoordsArray:function(x){var c=0;if(this._flatCoords&&(c=this._flatCoords.length),typeof x[0]=="number"){for(var u=x.length,f=new Uint32Array(u),i=new Float64Array(u),o=0,d=0,m=0,_=0;_<u;){m++;var h=x[_++];f[d++]=o+c,f[d++]=h;for(var v=0;v<h;v++){var r=x[_++],a=x[_++];if(i[o++]=r,i[o++]=a,_>u)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(f.buffer,0,d),flatCoords:i,count:m}}return{flatCoordsOffset:null,flatCoords:null,count:x.length}},getInitialData:function(x,c){var u=new y.a.List(["value"],this);return u.hasItemOption=!1,u.initData(x.data,[],function(f,i,o,d){if(f instanceof Array)return NaN;u.hasItemOption=!0;var m=f.value;if(m!=null)return m instanceof Array?m[d]:m}),u},defaultOption:{coordinateSystem:"geo",zlevel:10,progressive:1e4,progressiveThreshold:5e4,blendMode:"source-over",lineStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}})},function(re,X,D){"use strict";var W=D(0),y=D.n(W),L=D(2),A=D(20),s=D(86),x=D(84),c=D(3);y.a.extendChartView({type:"linesGL",__ecgl__:!0,init:function(u,f){this.groupGL=new L.a.Node,this.viewGL=new A.a("orthographic"),this.viewGL.add(this.groupGL),this._glViewHelper=new x.a(this.viewGL),this._nativeLinesShader=L.a.createShader("ecgl.lines3D"),this._meshLinesShader=L.a.createShader("ecgl.meshLines3D"),this._linesMeshes=[],this._currentStep=0},render:function(u,f,i){this.groupGL.removeAll(),this._glViewHelper.reset(u,i);var o=this._linesMeshes[0];o||(o=this._linesMeshes[0]=this._createLinesMesh(u)),this._linesMeshes.length=1,this.groupGL.add(o),this._updateLinesMesh(u,o,0,u.getData().count()),this.viewGL.setPostEffect(u.getModel("postEffect"),i)},incrementalPrepareRender:function(u,f,i){this.groupGL.removeAll(),this._glViewHelper.reset(u,i),this._currentStep=0,this.viewGL.setPostEffect(u.getModel("postEffect"),i)},incrementalRender:function(u,f,i,o){var d=this._linesMeshes[this._currentStep];d||(d=this._createLinesMesh(f),this._linesMeshes[this._currentStep]=d),this._updateLinesMesh(f,d,u.start,u.end),this.groupGL.add(d),o.getZr().refresh(),this._currentStep++},updateTransform:function(u,f,i){u.coordinateSystem.getRoamTransform&&this._glViewHelper.updateTransform(u,i)},_createLinesMesh:function(u){var f=new L.a.Mesh({$ignorePicking:!0,material:new L.a.Material({shader:L.a.createShader("ecgl.lines3D"),transparent:!0,depthMask:!1,depthTest:!1}),geometry:new s.a({segmentScale:10,useNativeLine:!0,dynamic:!1}),mode:L.a.Mesh.LINES,culling:!1});return f},_updateLinesMesh:function(u,f,i,o){var d=u.getData();f.material.blend=u.get("blendMode")==="lighter"?L.a.additiveBlend:null;var m=u.get("lineStyle.curveness")||0,_=u.get("polyline"),h=f.geometry,v=u.coordinateSystem,r=c.a.firstNotNull(u.get("lineStyle.width"),1);r>1?(f.material.shader!==this._meshLinesShader&&f.material.attachShader(this._meshLinesShader),f.mode=L.a.Mesh.TRIANGLES):(f.material.shader!==this._nativeLinesShader&&f.material.attachShader(this._nativeLinesShader),f.mode=L.a.Mesh.LINES),i=i||0,o=o||d.count(),h.resetOffset();var a=0,p=0,E=[],S=[],w=[],R=[],O=[],z=.3,N=.7;function P(){S[0]=E[0]*N+R[0]*z-(E[1]-R[1])*m,S[1]=E[1]*N+R[1]*z-(R[0]-E[0])*m,w[0]=E[0]*z+R[0]*N-(E[1]-R[1])*m,w[1]=E[1]*z+R[1]*N-(R[0]-E[0])*m}if(_||m!==0)for(var F=i;F<o;F++)if(_){var K=u.getLineCoordsCount(F);a+=h.getPolylineVertexCount(K),p+=h.getPolylineTriangleCount(K)}else u.getLineCoords(F,O),this._glViewHelper.dataToPoint(v,O[0],E),this._glViewHelper.dataToPoint(v,O[1],R),P(),a+=h.getCubicCurveVertexCount(E,S,w,R),p+=h.getCubicCurveTriangleCount(E,S,w,R);else{var B=o-i;a+=B*h.getLineVertexCount(),p+=B*h.getLineVertexCount()}h.setVertexCount(a),h.setTriangleCount(p);for(var V=i,C=[],F=i;F<o;F++){L.a.parseColor(d.getItemVisual(V,"color"),C);var M=c.a.firstNotNull(d.getItemVisual(V,"opacity"),1);C[3]*=M;for(var K=u.getLineCoords(F,O),H=0;H<K;H++)this._glViewHelper.dataToPoint(v,O[H],O[H]);_?h.addPolyline(O,C,r,0,K):m!==0?(E=O[0],R=O[1],P(),h.addCubicCurve(E,S,w,R,C,r)):h.addPolyline(O,C,r,0,2),V++}},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})}])})},3867:function(qt,$e,ae){var te=ae(97671);(function(re,X){qt.exports=X()})(this,function(){"use strict";function re(ie){var fe=typeof ie;return ie!==null&&(fe==="object"||fe==="function")}function X(ie){return typeof ie=="function"}var D=void 0;Array.isArray?D=Array.isArray:D=function(ie){return Object.prototype.toString.call(ie)==="[object Array]"};var W=D,y=0,L=void 0,A=void 0,s=function(fe,ye){a[y]=fe,a[y+1]=ye,y+=2,y===2&&(A?A(p):S())};function x(ie){A=ie}function c(ie){s=ie}var u=typeof window!="undefined"?window:void 0,f=u||{},i=f.MutationObserver||f.WebKitMutationObserver,o=typeof self=="undefined"&&typeof te!="undefined"&&{}.toString.call(te)==="[object process]",d=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function m(){return function(){return te.nextTick(p)}}function _(){return typeof L!="undefined"?function(){L(p)}:r()}function h(){var ie=0,fe=new i(p),ye=document.createTextNode("");return fe.observe(ye,{characterData:!0}),function(){ye.data=ie=++ie%2}}function v(){var ie=new MessageChannel;return ie.port1.onmessage=p,function(){return ie.port2.postMessage(0)}}function r(){var ie=setTimeout;return function(){return ie(p,1)}}var a=new Array(1e3);function p(){for(var ie=0;ie<y;ie+=2){var fe=a[ie],ye=a[ie+1];fe(ye),a[ie]=void 0,a[ie+1]=void 0}y=0}function E(){try{var ie=Function("return this")().require("vertx");return L=ie.runOnLoop||ie.runOnContext,_()}catch(fe){return r()}}var S=void 0;o?S=m():i?S=h():d?S=v():u===void 0?S=E():S=r();function w(ie,fe){var ye=this,he=new this.constructor(z);he[O]===void 0&&We(he);var Te=ye._state;if(Te){var Oe=arguments[Te-1];s(function(){return De(Te,he,Oe,ye._result)})}else pe(ye,he,ie,fe);return he}function R(ie){var fe=this;if(ie&&typeof ie=="object"&&ie.constructor===fe)return ie;var ye=new fe(z);return $(ye,ie),ye}var O=Math.random().toString(36).substring(2);function z(){}var N=void 0,P=1,F=2;function K(){return new TypeError("You cannot resolve a promise with itself")}function B(){return new TypeError("A promises callback cannot return that same promise.")}function V(ie,fe,ye,he){try{ie.call(fe,ye,he)}catch(Te){return Te}}function C(ie,fe,ye){s(function(he){var Te=!1,Oe=V(ye,fe,function(Be){Te||(Te=!0,fe!==Be?$(he,Be):se(he,Be))},function(Be){Te||(Te=!0,ue(he,Be))},"Settle: "+(he._label||" unknown promise"));!Te&&Oe&&(Te=!0,ue(he,Oe))},ie)}function M(ie,fe){fe._state===P?se(ie,fe._result):fe._state===F?ue(ie,fe._result):pe(fe,void 0,function(ye){return $(ie,ye)},function(ye){return ue(ie,ye)})}function H(ie,fe,ye){fe.constructor===ie.constructor&&ye===w&&fe.constructor.resolve===R?M(ie,fe):ye===void 0?se(ie,fe):X(ye)?C(ie,fe,ye):se(ie,fe)}function $(ie,fe){if(ie===fe)ue(ie,K());else if(re(fe)){var ye=void 0;try{ye=fe.then}catch(he){ue(ie,he);return}H(ie,fe,ye)}else se(ie,fe)}function q(ie){ie._onerror&&ie._onerror(ie._result),xe(ie)}function se(ie,fe){ie._state===N&&(ie._result=fe,ie._state=P,ie._subscribers.length!==0&&s(xe,ie))}function ue(ie,fe){ie._state===N&&(ie._state=F,ie._result=fe,s(q,ie))}function pe(ie,fe,ye,he){var Te=ie._subscribers,Oe=Te.length;ie._onerror=null,Te[Oe]=fe,Te[Oe+P]=ye,Te[Oe+F]=he,Oe===0&&ie._state&&s(xe,ie)}function xe(ie){var fe=ie._subscribers,ye=ie._state;if(fe.length!==0){for(var he=void 0,Te=void 0,Oe=ie._result,Be=0;Be<fe.length;Be+=3)he=fe[Be],Te=fe[Be+ye],he?De(ye,he,Te,Oe):Te(Oe);ie._subscribers.length=0}}function De(ie,fe,ye,he){var Te=X(ye),Oe=void 0,Be=void 0,Ze=!0;if(Te){try{Oe=ye(he)}catch(tt){Ze=!1,Be=tt}if(fe===Oe){ue(fe,B());return}}else Oe=he;fe._state!==N||(Te&&Ze?$(fe,Oe):Ze===!1?ue(fe,Be):ie===P?se(fe,Oe):ie===F&&ue(fe,Oe))}function Ue(ie,fe){try{fe(function(he){$(ie,he)},function(he){ue(ie,he)})}catch(ye){ue(ie,ye)}}var Ge=0;function Ae(){return Ge++}function We(ie){ie[O]=Ge++,ie._state=void 0,ie._result=void 0,ie._subscribers=[]}function we(){return new Error("Array Methods must be provided an Array")}var Se=function(){function ie(fe,ye){this._instanceConstructor=fe,this.promise=new fe(z),this.promise[O]||We(this.promise),W(ye)?(this.length=ye.length,this._remaining=ye.length,this._result=new Array(this.length),this.length===0?se(this.promise,this._result):(this.length=this.length||0,this._enumerate(ye),this._remaining===0&&se(this.promise,this._result))):ue(this.promise,we())}return ie.prototype._enumerate=function(ye){for(var he=0;this._state===N&&he<ye.length;he++)this._eachEntry(ye[he],he)},ie.prototype._eachEntry=function(ye,he){var Te=this._instanceConstructor,Oe=Te.resolve;if(Oe===R){var Be=void 0,Ze=void 0,tt=!1;try{Be=ye.then}catch(nt){tt=!0,Ze=nt}if(Be===w&&ye._state!==N)this._settledAt(ye._state,he,ye._result);else if(typeof Be!="function")this._remaining--,this._result[he]=ye;else if(Te===me){var dt=new Te(z);tt?ue(dt,Ze):H(dt,ye,Be),this._willSettleAt(dt,he)}else this._willSettleAt(new Te(function(nt){return nt(ye)}),he)}else this._willSettleAt(Oe(ye),he)},ie.prototype._settledAt=function(ye,he,Te){var Oe=this.promise;Oe._state===N&&(this._remaining--,ye===F?ue(Oe,Te):this._result[he]=Te),this._remaining===0&&se(Oe,this._result)},ie.prototype._willSettleAt=function(ye,he){var Te=this;pe(ye,void 0,function(Oe){return Te._settledAt(P,he,Oe)},function(Oe){return Te._settledAt(F,he,Oe)})},ie}();function ge(ie){return new Se(this,ie).promise}function Re(ie){var fe=this;return W(ie)?new fe(function(ye,he){for(var Te=ie.length,Oe=0;Oe<Te;Oe++)fe.resolve(ie[Oe]).then(ye,he)}):new fe(function(ye,he){return he(new TypeError("You must pass an array to race."))})}function ve(ie){var fe=this,ye=new fe(z);return ue(ye,ie),ye}function Le(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Fe(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var me=function(){function ie(fe){this[O]=Ae(),this._result=this._state=void 0,this._subscribers=[],z!==fe&&(typeof fe!="function"&&Le(),this instanceof ie?Ue(this,fe):Fe())}return ie.prototype.catch=function(ye){return this.then(null,ye)},ie.prototype.finally=function(ye){var he=this,Te=he.constructor;return X(ye)?he.then(function(Oe){return Te.resolve(ye()).then(function(){return Oe})},function(Oe){return Te.resolve(ye()).then(function(){throw Oe})}):he.then(ye,ye)},ie}();me.prototype.then=w,me.all=ge,me.race=Re,me.resolve=R,me.reject=ve,me._setScheduler=x,me._setAsap=c,me._asap=s;function oe(){var ie=void 0;if(typeof ae.g!="undefined")ie=ae.g;else if(typeof self!="undefined")ie=self;else try{ie=Function("return this")()}catch(he){throw new Error("polyfill failed because global object is unavailable in this environment")}var fe=ie.Promise;if(fe){var ye=null;try{ye=Object.prototype.toString.call(fe.resolve())}catch(he){}if(ye==="[object Promise]"&&!fe.cast)return}ie.Promise=me}return me.polyfill=oe,me.Promise=me,me})},86204:function(qt){"use strict";var $e=typeof Reflect=="object"?Reflect:null,ae=$e&&typeof $e.apply=="function"?$e.apply:function(v,r,a){return Function.prototype.apply.call(v,r,a)},te;$e&&typeof $e.ownKeys=="function"?te=$e.ownKeys:Object.getOwnPropertySymbols?te=function(v){return Object.getOwnPropertyNames(v).concat(Object.getOwnPropertySymbols(v))}:te=function(v){return Object.getOwnPropertyNames(v)};function re(h){console&&console.warn&&console.warn(h)}var X=Number.isNaN||function(v){return v!==v};function D(){D.init.call(this)}qt.exports=D,qt.exports.once=d,D.EventEmitter=D,D.prototype._events=void 0,D.prototype._eventsCount=0,D.prototype._maxListeners=void 0;var W=10;function y(h){if(typeof h!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof h)}Object.defineProperty(D,"defaultMaxListeners",{enumerable:!0,get:function(){return W},set:function(h){if(typeof h!="number"||h<0||X(h))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+h+".");W=h}}),D.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},D.prototype.setMaxListeners=function(v){if(typeof v!="number"||v<0||X(v))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+v+".");return this._maxListeners=v,this};function L(h){return h._maxListeners===void 0?D.defaultMaxListeners:h._maxListeners}D.prototype.getMaxListeners=function(){return L(this)},D.prototype.emit=function(v){for(var r=[],a=1;a<arguments.length;a++)r.push(arguments[a]);var p=v==="error",E=this._events;if(E!==void 0)p=p&&E.error===void 0;else if(!p)return!1;if(p){var S;if(r.length>0&&(S=r[0]),S instanceof Error)throw S;var w=new Error("Unhandled error."+(S?" ("+S.message+")":""));throw w.context=S,w}var R=E[v];if(R===void 0)return!1;if(typeof R=="function")ae(R,this,r);else for(var O=R.length,z=f(R,O),a=0;a<O;++a)ae(z[a],this,r);return!0};function A(h,v,r,a){var p,E,S;if(y(r),E=h._events,E===void 0?(E=h._events=Object.create(null),h._eventsCount=0):(E.newListener!==void 0&&(h.emit("newListener",v,r.listener?r.listener:r),E=h._events),S=E[v]),S===void 0)S=E[v]=r,++h._eventsCount;else if(typeof S=="function"?S=E[v]=a?[r,S]:[S,r]:a?S.unshift(r):S.push(r),p=L(h),p>0&&S.length>p&&!S.warned){S.warned=!0;var w=new Error("Possible EventEmitter memory leak detected. "+S.length+" "+String(v)+" listeners added. Use emitter.setMaxListeners() to increase limit");w.name="MaxListenersExceededWarning",w.emitter=h,w.type=v,w.count=S.length,re(w)}return h}D.prototype.addListener=function(v,r){return A(this,v,r,!1)},D.prototype.on=D.prototype.addListener,D.prototype.prependListener=function(v,r){return A(this,v,r,!0)};function s(){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 x(h,v,r){var a={fired:!1,wrapFn:void 0,target:h,type:v,listener:r},p=s.bind(a);return p.listener=r,a.wrapFn=p,p}D.prototype.once=function(v,r){return y(r),this.on(v,x(this,v,r)),this},D.prototype.prependOnceListener=function(v,r){return y(r),this.prependListener(v,x(this,v,r)),this},D.prototype.removeListener=function(v,r){var a,p,E,S,w;if(y(r),p=this._events,p===void 0)return this;if(a=p[v],a===void 0)return this;if(a===r||a.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete p[v],p.removeListener&&this.emit("removeListener",v,a.listener||r));else if(typeof a!="function"){for(E=-1,S=a.length-1;S>=0;S--)if(a[S]===r||a[S].listener===r){w=a[S].listener,E=S;break}if(E<0)return this;E===0?a.shift():i(a,E),a.length===1&&(p[v]=a[0]),p.removeListener!==void 0&&this.emit("removeListener",v,w||r)}return this},D.prototype.off=D.prototype.removeListener,D.prototype.removeAllListeners=function(v){var r,a,p;if(a=this._events,a===void 0)return this;if(a.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):a[v]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete a[v]),this;if(arguments.length===0){var E=Object.keys(a),S;for(p=0;p<E.length;++p)S=E[p],S!=="removeListener"&&this.removeAllListeners(S);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=a[v],typeof r=="function")this.removeListener(v,r);else if(r!==void 0)for(p=r.length-1;p>=0;p--)this.removeListener(v,r[p]);return this};function c(h,v,r){var a=h._events;if(a===void 0)return[];var p=a[v];return p===void 0?[]:typeof p=="function"?r?[p.listener||p]:[p]:r?o(p):f(p,p.length)}D.prototype.listeners=function(v){return c(this,v,!0)},D.prototype.rawListeners=function(v){return c(this,v,!1)},D.listenerCount=function(h,v){return typeof h.listenerCount=="function"?h.listenerCount(v):u.call(h,v)},D.prototype.listenerCount=u;function u(h){var v=this._events;if(v!==void 0){var r=v[h];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}D.prototype.eventNames=function(){return this._eventsCount>0?te(this._events):[]};function f(h,v){for(var r=new Array(v),a=0;a<v;++a)r[a]=h[a];return r}function i(h,v){for(;v+1<h.length;v++)h[v]=h[v+1];h.pop()}function o(h){for(var v=new Array(h.length),r=0;r<v.length;++r)v[r]=h[r].listener||h[r];return v}function d(h,v){return new Promise(function(r,a){function p(S){h.removeListener(v,E),a(S)}function E(){typeof h.removeListener=="function"&&h.removeListener("error",p),r([].slice.call(arguments))}_(h,v,E,{once:!0}),v!=="error"&&m(h,p,{once:!0})})}function m(h,v,r){typeof h.on=="function"&&_(h,"error",v,r)}function _(h,v,r,a){if(typeof h.on=="function")a.once?h.once(v,r):h.on(v,r);else if(typeof h.addEventListener=="function")h.addEventListener(v,function p(E){a.once&&h.removeEventListener(v,p),r(E)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof h)}},53291:function(qt){"use strict";var $e=Array.isArray,ae=Object.keys,te=Object.prototype.hasOwnProperty;qt.exports=function re(X,D){if(X===D)return!0;if(X&&D&&typeof X=="object"&&typeof D=="object"){var W=$e(X),y=$e(D),L,A,s;if(W&&y){if(A=X.length,A!=D.length)return!1;for(L=A;L--!==0;)if(!re(X[L],D[L]))return!1;return!0}if(W!=y)return!1;var x=X instanceof Date,c=D instanceof Date;if(x!=c)return!1;if(x&&c)return X.getTime()==D.getTime();var u=X instanceof RegExp,f=D instanceof RegExp;if(u!=f)return!1;if(u&&f)return X.toString()==D.toString();var i=ae(X);if(A=i.length,A!==ae(D).length)return!1;for(L=A;L--!==0;)if(!te.call(D,i[L]))return!1;for(L=A;L--!==0;)if(s=i[L],!re(X[s],D[s]))return!1;return!0}return X!==X&&D!==D}},53184:function(qt,$e,ae){"use strict";var te,re;function X(D,W,y){var L=function(A,s){return D.js_beautify(A,s)};return L.js=D.js_beautify,L.css=W.css_beautify,L.html=y.html_beautify,L.js_beautify=D.js_beautify,L.css_beautify=W.css_beautify,L.html_beautify=y.html_beautify,L}te=[ae(58553),ae(87804),ae(40998)],re=function(D,W,y){return X(D,W,y)}.apply($e,te),re!==void 0&&(qt.exports=re)},87804:function(qt,$e){var ae,te;(function(){var re;(function(){"use strict";var D=[,,function(A){function s(u){this.__parent=u,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}s.prototype.clone_empty=function(){var u=new s(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},s.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},s.prototype.has_match=function(u){for(var f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(u))return!0;return!1},s.prototype.set_indent=function(u,f){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=f||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},s.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},s.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},s.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},s.prototype.is_empty=function(){return this.__items.length===0},s.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},s.prototype.push=function(u){this.__items.push(u);var f=u.lastIndexOf(`
|
|
`);f!==-1?this.__character_count=u.length-f:this.__character_count+=u.length},s.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},s.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},s.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},s.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},s.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function x(u,f){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),f=f||"",u.indent_level>0&&(f=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}x.prototype.get_indent_size=function(u,f){var i=this.__base_string_length;return f=f||0,u<0&&(i=0),i+=u*this.__indent_size,i+=f,i},x.prototype.get_indent_string=function(u,f){var i=this.__base_string;return f=f||0,u<0&&(u=0,i=""),f+=u*this.__indent_size,this.__ensure_cache(f),i+=this.__cache[f],i},x.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},x.prototype.__add_column=function(){var u=this.__cache.length,f=0,i="";this.__indent_size&&u>=this.__indent_size&&(f=Math.floor(u/this.__indent_size),u-=f*this.__indent_size,i=new Array(f+1).join(this.__indent_string)),u&&(i+=new Array(u+1).join(" ")),this.__cache.push(i)};function c(u,f){this.__indent_cache=new x(u,f),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new s(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(u,f){return this.__indent_cache.get_indent_string(u,f)},c.prototype.get_indent_size=function(u,f){return this.__indent_cache.get_indent_size(u,f)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(u){this.trim(!0);var f=this.current_line.pop();f&&(f[f.length-1]===`
|
|
`&&(f=f.replace(/\n+$/g,"")),this.current_line.push(f)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
|
|
`);return u!==`
|
|
`&&(i=i.replace(/[\n]/g,u)),i},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(u,f){return u=u||0,f=f||0,this.next_line.set_indent(u,f),this.__lines.length>1?(this.current_line.set_indent(u,f),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(u){for(var f=0;f<u.newlines;f++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},c.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},c.prototype.remove_indent=function(u){for(var f=this.__lines.length;u<f;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(u,f){for(var i=this.__lines.length-2;i>=0;){var o=this.__lines[i];if(o.is_empty())break;if(o.item(0).indexOf(u)!==0&&o.item(-1)!==f){this.__lines.splice(i+1,0,new s(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},A.exports.Output=c},,,,function(A){function s(u,f){this.raw_options=x(u,f),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}s.prototype._get_array=function(u,f){var i=this.raw_options[u],o=f||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(o=i.concat()):typeof i=="string"&&(o=i.split(/[^a-zA-Z0-9_\/\-]+/)),o},s.prototype._get_boolean=function(u,f){var i=this.raw_options[u],o=i===void 0?!!f:!!i;return o},s.prototype._get_characters=function(u,f){var i=this.raw_options[u],o=f||"";return typeof i=="string"&&(o=i.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),o},s.prototype._get_number=function(u,f){var i=this.raw_options[u];f=parseInt(f,10),isNaN(f)&&(f=0);var o=parseInt(i,10);return isNaN(o)&&(o=f),o},s.prototype._get_selection=function(u,f,i){var o=this._get_selection_list(u,f,i);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[u]+"'");return o[0]},s.prototype._get_selection_list=function(u,f,i){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[f[0]],!this._is_valid_selection(i,f))throw new Error("Invalid Default Value!");var o=this._get_array(u,i);if(!this._is_valid_selection(o,f))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[u]+"'");return o},s.prototype._is_valid_selection=function(u,f){return u.length&&f.length&&!u.some(function(i){return f.indexOf(i)===-1})};function x(u,f){var i={};u=c(u);var o;for(o in u)o!==f&&(i[o]=u[o]);if(f&&u[f])for(o in u[f])i[o]=u[f][o];return i}function c(u){var f={},i;for(i in u){var o=i.replace(/-/g,"_");f[o]=u[i]}return f}A.exports.Options=s,A.exports.normalizeOpts=c,A.exports.mergeOpts=x},,function(A){var s=RegExp.prototype.hasOwnProperty("sticky");function x(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}x.prototype.restart=function(){this.__position=0},x.prototype.back=function(){this.__position>0&&(this.__position-=1)},x.prototype.hasNext=function(){return this.__position<this.__input_length},x.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},x.prototype.peek=function(c){var u=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(u=this.__input.charAt(c)),u},x.prototype.__match=function(c,u){c.lastIndex=u;var f=c.exec(this.__input);return f&&!(s&&c.sticky)&&f.index!==u&&(f=null),f},x.prototype.test=function(c,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(c,u):!1},x.prototype.testChar=function(c,u){var f=this.peek(u);return c.lastIndex=0,f!==null&&c.test(f)},x.prototype.match=function(c){var u=this.__match(c,this.__position);return u?this.__position+=u[0].length:u=null,u},x.prototype.read=function(c,u,f){var i="",o;return c&&(o=this.match(c),o&&(i+=o[0])),u&&(o||!c)&&(i+=this.readUntil(u,f)),i},x.prototype.readUntil=function(c,u){var f="",i=this.__position;c.lastIndex=this.__position;var o=c.exec(this.__input);return o?(i=o.index,u&&(i+=o[0].length)):i=this.__input_length,f=this.__input.substring(this.__position,i),this.__position=i,f},x.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},x.prototype.get_regexp=function(c,u){var f=null,i="g";return u&&s&&(i="y"),typeof c=="string"&&c!==""?f=new RegExp(c,i):c&&(f=new RegExp(c.source,i)),f},x.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},x.prototype.peekUntilAfter=function(c){var u=this.__position,f=this.readUntilAfter(c);return this.__position=u,f},x.prototype.lookBack=function(c){var u=this.__position-1;return u>=c.length&&this.__input.substring(u-c.length,u).toLowerCase()===c},A.exports.InputScanner=x},,,,,function(A){function s(x,c){x=typeof x=="string"?x:x.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(x+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(x+/\sbeautify\signore:end\s/.source+c,"g")}s.prototype.get_directives=function(x){if(!x.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(x);u;)c[u[1]]=u[2],u=this.__directive_pattern.exec(x);return c},s.prototype.readIgnored=function(x){return x.readUntilAfter(this.__directives_end_ignore_pattern)},A.exports.Directives=s},,function(A,s,x){var c=x(16).Beautifier,u=x(17).Options;function f(i,o){var d=new c(i,o);return d.beautify()}A.exports=f,A.exports.defaultOptions=function(){return new u}},function(A,s,x){var c=x(17).Options,u=x(2).Output,f=x(8).InputScanner,i=x(13).Directives,o=new i(/\/\*/,/\*\//),d=/\r\n|[\r\n]/,m=/\r\n|[\r\n]/g,_=/\s/,h=/(?:\s|\n)+/g,v=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,r=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function a(p,E){this._source_text=p||"",this._options=new c(E),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}a.prototype.eatString=function(p){var E="";for(this._ch=this._input.next();this._ch;){if(E+=this._ch,this._ch==="\\")E+=this._input.next();else if(p.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return E},a.prototype.eatWhitespace=function(p){for(var E=_.test(this._input.peek()),S=0;_.test(this._input.peek());)this._ch=this._input.next(),p&&this._ch===`
|
|
`&&(S===0||S<this._options.max_preserve_newlines)&&(S++,this._output.add_new_line(!0));return E},a.prototype.foundNestedPseudoClass=function(){for(var p=0,E=1,S=this._input.peek(E);S;){if(S==="{")return!0;if(S==="(")p+=1;else if(S===")"){if(p===0)return!1;p-=1}else if(S===";"||S==="}")return!1;E++,S=this._input.peek(E)}return!1},a.prototype.print_string=function(p){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(p)},a.prototype.preserveSingleSpace=function(p){p&&(this._output.space_before_token=!0)},a.prototype.indent=function(){this._indentLevel++},a.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},a.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var p=this._source_text,E=this._options.eol;E==="auto"&&(E=`
|
|
`,p&&d.test(p||"")&&(E=p.match(d)[0])),p=p.replace(m,`
|
|
`);var S=p.match(/^[\t ]*/)[0];this._output=new u(this._options,S),this._input=new f(p),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var w=0,R=!1,O=!1,z=!1,N=!1,P=!1,F=this._ch,K=!1,B,V,C;B=this._input.read(h),V=B!=="",C=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var M=this._input.read(v),H=o.get_directives(M);H&&H.ignore==="start"&&(M+=o.readIgnored(this._input)),this.print_string(M),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(r)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(V),this.print_string(this._ch);var $=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);$.match(/[ :]$/)&&($=this.eatString(": ").replace(/\s+$/,""),this.print_string($),this._output.space_before_token=!0),w===0&&$.indexOf(":")!==-1&&(O=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(V),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var q=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);q.match(/[ :]$/)&&(q=this.eatString(": ").replace(/\s+$/,""),this.print_string(q),this._output.space_before_token=!0),w===0&&q.indexOf(":")!==-1?(O=!0,this.indent()):q in this.NESTED_AT_RULE?(this._nestedLevel+=1,q in this.CONDITIONAL_GROUP_RULE&&(z=!0)):w===0&&!O&&(N=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(V),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")O&&(O=!1,this.outdent()),N=!1,z?(z=!1,R=this._indentLevel>=this._nestedLevel):R=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&R&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(C==="("?this._output.space_before_token=!1:C!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),C==="{"&&this._output.trim(!0),O&&(this.outdent(),O=!1),this.print_string(this._ch),R=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var se=0;se<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;se++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[se])){K=!0;break}(R||z)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!N&&w===0?(this.print_string(":"),O||(O=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var ue=C==='"'||C==="'";this.preserveSingleSpace(ue||V),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")K=!1,w===0?(O&&(this.outdent(),O=!1),N=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),w++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),w&&(w--,this.outdent()));else{var pe=!1;this._input.lookBack("with")&&(pe=!0),this.preserveSingleSpace(V||pe),this.print_string(this._ch),O&&C==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),P=!0):(this.eatWhitespace(),w++,this.indent())}else if(this._ch===")")w&&(w--,this.outdent()),P&&this._input.peek()===";"&&this._options.selector_separator_newline&&(P=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!O||P)&&w===0&&!N?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!O&&w===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&_.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(V),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),_.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var xe=C==='"'||C==="'";this.preserveSingleSpace(xe||V),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&K&&this._output.add_new_line()}var De=this._output.get_code(E);return De},A.exports.Beautifier=a},function(A,s,x){var c=x(6).Options;function u(f){c.call(this,f,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var i=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||i;var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var d=0;d<o.length;d++)o[d]!=="expand"?this.brace_style="collapse":this.brace_style=o[d]}u.prototype=new c,A.exports.Options=u}],W={};function y(A){var s=W[A];if(s!==void 0)return s.exports;var x=W[A]={exports:{}};return D[A](x,x.exports,y),x.exports}var L=y(15);re=L})();var X=re;ae=[],te=function(){return{css_beautify:X}}.apply($e,ae),te!==void 0&&(qt.exports=te)})()},40998:function(qt,$e,ae){var te,re;(function(){var X;(function(){"use strict";var L=[,,function(c){function u(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}u.prototype.clone_empty=function(){var o=new u(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},u.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},u.prototype.has_match=function(o){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(o))return!0;return!1},u.prototype.set_indent=function(o,d){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},u.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},u.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},u.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},u.prototype.is_empty=function(){return this.__items.length===0},u.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},u.prototype.push=function(o){this.__items.push(o);var d=o.lastIndexOf(`
|
|
`);d!==-1?this.__character_count=o.length-d:this.__character_count+=o.length},u.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},u.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},u.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},u.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},u.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function f(o,d){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),d=d||"",o.indent_level>0&&(d=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}f.prototype.get_indent_size=function(o,d){var m=this.__base_string_length;return d=d||0,o<0&&(m=0),m+=o*this.__indent_size,m+=d,m},f.prototype.get_indent_string=function(o,d){var m=this.__base_string;return d=d||0,o<0&&(o=0,m=""),d+=o*this.__indent_size,this.__ensure_cache(d),m+=this.__cache[d],m},f.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},f.prototype.__add_column=function(){var o=this.__cache.length,d=0,m="";this.__indent_size&&o>=this.__indent_size&&(d=Math.floor(o/this.__indent_size),o-=d*this.__indent_size,m=new Array(d+1).join(this.__indent_string)),o&&(m+=new Array(o+1).join(" ")),this.__cache.push(m)};function i(o,d){this.__indent_cache=new f(o,d),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new u(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}i.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},i.prototype.get_line_number=function(){return this.__lines.length},i.prototype.get_indent_string=function(o,d){return this.__indent_cache.get_indent_string(o,d)},i.prototype.get_indent_size=function(o,d){return this.__indent_cache.get_indent_size(o,d)},i.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},i.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},i.prototype.get_code=function(o){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
|
|
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var m=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(m=m.replace(/[\n]/g,o)),m},i.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},i.prototype.set_indent=function(o,d){return o=o||0,d=d||0,this.next_line.set_indent(o,d),this.__lines.length>1?(this.current_line.set_indent(o,d),!0):(this.current_line.set_indent(),!1)},i.prototype.add_raw_token=function(o){for(var d=0;d<o.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},i.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},i.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},i.prototype.remove_indent=function(o){for(var d=this.__lines.length;o<d;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},i.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},i.prototype.just_added_newline=function(){return this.current_line.is_empty()},i.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},i.prototype.ensure_empty_line_above=function(o,d){for(var m=this.__lines.length-2;m>=0;){var _=this.__lines[m];if(_.is_empty())break;if(_.item(0).indexOf(o)!==0&&_.item(-1)!==d){this.__lines.splice(m+1,0,new u(this)),this.previous_line=this.__lines[this.__lines.length-2];break}m--}},c.exports.Output=i},function(c){function u(f,i,o,d){this.type=f,this.text=i,this.comments_before=null,this.newlines=o||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}c.exports.Token=u},,,function(c){function u(o,d){this.raw_options=f(o,d),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}u.prototype._get_array=function(o,d){var m=this.raw_options[o],_=d||[];return typeof m=="object"?m!==null&&typeof m.concat=="function"&&(_=m.concat()):typeof m=="string"&&(_=m.split(/[^a-zA-Z0-9_\/\-]+/)),_},u.prototype._get_boolean=function(o,d){var m=this.raw_options[o],_=m===void 0?!!d:!!m;return _},u.prototype._get_characters=function(o,d){var m=this.raw_options[o],_=d||"";return typeof m=="string"&&(_=m.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),_},u.prototype._get_number=function(o,d){var m=this.raw_options[o];d=parseInt(d,10),isNaN(d)&&(d=0);var _=parseInt(m,10);return isNaN(_)&&(_=d),_},u.prototype._get_selection=function(o,d,m){var _=this._get_selection_list(o,d,m);if(_.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[o]+"'");return _[0]},u.prototype._get_selection_list=function(o,d,m){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(m=m||[d[0]],!this._is_valid_selection(m,d))throw new Error("Invalid Default Value!");var _=this._get_array(o,m);if(!this._is_valid_selection(_,d))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[o]+"'");return _},u.prototype._is_valid_selection=function(o,d){return o.length&&d.length&&!o.some(function(m){return d.indexOf(m)===-1})};function f(o,d){var m={};o=i(o);var _;for(_ in o)_!==d&&(m[_]=o[_]);if(d&&o[d])for(_ in o[d])m[_]=o[d][_];return m}function i(o){var d={},m;for(m in o){var _=m.replace(/-/g,"_");d[_]=o[m]}return d}c.exports.Options=u,c.exports.normalizeOpts=i,c.exports.mergeOpts=f},,function(c){var u=RegExp.prototype.hasOwnProperty("sticky");function f(i){this.__input=i||"",this.__input_length=this.__input.length,this.__position=0}f.prototype.restart=function(){this.__position=0},f.prototype.back=function(){this.__position>0&&(this.__position-=1)},f.prototype.hasNext=function(){return this.__position<this.__input_length},f.prototype.next=function(){var i=null;return this.hasNext()&&(i=this.__input.charAt(this.__position),this.__position+=1),i},f.prototype.peek=function(i){var o=null;return i=i||0,i+=this.__position,i>=0&&i<this.__input_length&&(o=this.__input.charAt(i)),o},f.prototype.__match=function(i,o){i.lastIndex=o;var d=i.exec(this.__input);return d&&!(u&&i.sticky)&&d.index!==o&&(d=null),d},f.prototype.test=function(i,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(i,o):!1},f.prototype.testChar=function(i,o){var d=this.peek(o);return i.lastIndex=0,d!==null&&i.test(d)},f.prototype.match=function(i){var o=this.__match(i,this.__position);return o?this.__position+=o[0].length:o=null,o},f.prototype.read=function(i,o,d){var m="",_;return i&&(_=this.match(i),_&&(m+=_[0])),o&&(_||!i)&&(m+=this.readUntil(o,d)),m},f.prototype.readUntil=function(i,o){var d="",m=this.__position;i.lastIndex=this.__position;var _=i.exec(this.__input);return _?(m=_.index,o&&(m+=_[0].length)):m=this.__input_length,d=this.__input.substring(this.__position,m),this.__position=m,d},f.prototype.readUntilAfter=function(i){return this.readUntil(i,!0)},f.prototype.get_regexp=function(i,o){var d=null,m="g";return o&&u&&(m="y"),typeof i=="string"&&i!==""?d=new RegExp(i,m):i&&(d=new RegExp(i.source,m)),d},f.prototype.get_literal_regexp=function(i){return RegExp(i.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},f.prototype.peekUntilAfter=function(i){var o=this.__position,d=this.readUntilAfter(i);return this.__position=o,d},f.prototype.lookBack=function(i){var o=this.__position-1;return o>=i.length&&this.__input.substring(o-i.length,o).toLowerCase()===i},c.exports.InputScanner=f},function(c,u,f){var i=f(8).InputScanner,o=f(3).Token,d=f(10).TokenStream,m=f(11).WhitespacePattern,_={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},h=function(v,r){this._input=new i(v),this._options=r||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new m(this._input)};h.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var v,r=new o(_.START,""),a=null,p=[],E=new d;r.type!==_.EOF;){for(v=this._get_next_token(r,a);this._is_comment(v);)E.add(v),v=this._get_next_token(r,a);E.isEmpty()||(v.comments_before=E,E=new d),v.parent=a,this._is_opening(v)?(p.push(a),a=v):a&&this._is_closing(v,a)&&(v.opened=a,a.closed=v,a=p.pop(),v.parent=a),v.previous=r,r.next=v,this.__tokens.add(v),r=v}return this.__tokens},h.prototype._is_first_token=function(){return this.__tokens.isEmpty()},h.prototype._reset=function(){},h.prototype._get_next_token=function(v,r){this._readWhitespace();var a=this._input.read(/.+/g);return a?this._create_token(_.RAW,a):this._create_token(_.EOF,"")},h.prototype._is_comment=function(v){return!1},h.prototype._is_opening=function(v){return!1},h.prototype._is_closing=function(v,r){return!1},h.prototype._create_token=function(v,r){var a=new o(v,r,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return a},h.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},c.exports.Tokenizer=h,c.exports.TOKEN=_},function(c){function u(f){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=f}u.prototype.restart=function(){this.__position=0},u.prototype.isEmpty=function(){return this.__tokens_length===0},u.prototype.hasNext=function(){return this.__position<this.__tokens_length},u.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__tokens[this.__position],this.__position+=1),f},u.prototype.peek=function(f){var i=null;return f=f||0,f+=this.__position,f>=0&&f<this.__tokens_length&&(i=this.__tokens[f]),i},u.prototype.add=function(f){this.__parent_token&&(f.parent=this.__parent_token),this.__tokens.push(f),this.__tokens_length+=1},c.exports.TokenStream=u},function(c,u,f){var i=f(12).Pattern;function o(d,m){i.call(this,d,m),m?this._line_regexp=this._input.get_regexp(m._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new i,o.prototype.__set_whitespace_patterns=function(d,m){d+="\\t ",m+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+m+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+m+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var d=this._input.read(this._match_pattern);if(d===" ")this.whitespace_before_token=" ";else if(d){var m=this.__split(this._newline_regexp,d);this.newline_count=m.length-1,this.whitespace_before_token=m[this.newline_count]}return d},o.prototype.matching=function(d,m){var _=this._create();return _.__set_whitespace_patterns(d,m),_._update(),_},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(d,m){d.lastIndex=0;for(var _=0,h=[],v=d.exec(m);v;)h.push(m.substring(_,v.index)),_=v.index+v[0].length,v=d.exec(m);return _<m.length?h.push(m.substring(_,m.length)):h.push(""),h},c.exports.WhitespacePattern=o},function(c){function u(f,i){this._input=f,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,i&&(this._starting_pattern=this._input.get_regexp(i._starting_pattern,!0),this._match_pattern=this._input.get_regexp(i._match_pattern,!0),this._until_pattern=this._input.get_regexp(i._until_pattern),this._until_after=i._until_after)}u.prototype.read=function(){var f=this._input.read(this._starting_pattern);return(!this._starting_pattern||f)&&(f+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),f},u.prototype.read_match=function(){return this._input.match(this._match_pattern)},u.prototype.until_after=function(f){var i=this._create();return i._until_after=!0,i._until_pattern=this._input.get_regexp(f),i._update(),i},u.prototype.until=function(f){var i=this._create();return i._until_after=!1,i._until_pattern=this._input.get_regexp(f),i._update(),i},u.prototype.starting_with=function(f){var i=this._create();return i._starting_pattern=this._input.get_regexp(f,!0),i._update(),i},u.prototype.matching=function(f){var i=this._create();return i._match_pattern=this._input.get_regexp(f,!0),i._update(),i},u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){},c.exports.Pattern=u},function(c){function u(f,i){f=typeof f=="string"?f:f.source,i=typeof i=="string"?i:i.source,this.__directives_block_pattern=new RegExp(f+/ beautify( \w+[:]\w+)+ /.source+i,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(f+/\sbeautify\signore:end\s/.source+i,"g")}u.prototype.get_directives=function(f){if(!f.match(this.__directives_block_pattern))return null;var i={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(f);o;)i[o[1]]=o[2],o=this.__directive_pattern.exec(f);return i},u.prototype.readIgnored=function(f){return f.readUntilAfter(this.__directives_end_ignore_pattern)},c.exports.Directives=u},function(c,u,f){var i=f(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function d(m,_){i.call(this,m,_),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),_&&(this.__template_pattern=this._input.get_regexp(_.__template_pattern),this._excluded=Object.assign(this._excluded,_._excluded),this._disabled=Object.assign(this._disabled,_._disabled));var h=new i(m);this.__patterns={handlebars_comment:h.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:h.starting_with(/{{{/).until_after(/}}}/),handlebars:h.starting_with(/{{/).until_after(/}}/),php:h.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:h.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:h.starting_with(/{%/).until_after(/%}/),django_value:h.starting_with(/{{/).until_after(/}}/),django_comment:h.starting_with(/{#/).until_after(/#}/),smarty:h.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:h.starting_with(/{\*/).until_after(/\*}/),smarty_literal:h.starting_with(/{literal}/).until_after(/{\/literal}/)}}d.prototype=new i,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(m){var _=this._create();return _._disabled[m]=!0,_._update(),_},d.prototype.read_options=function(m){var _=this._create();for(var h in o)_._disabled[h]=m.templating.indexOf(h)===-1;return _._update(),_},d.prototype.exclude=function(m){var _=this._create();return _._excluded[m]=!0,_._update(),_},d.prototype.read=function(){var m="";this._match_pattern?m=this._input.read(this._starting_pattern):m=this._input.read(this._starting_pattern,this.__template_pattern);for(var _=this._read_template();_;)this._match_pattern?_+=this._input.read(this._match_pattern):_+=this._input.readUntil(this.__template_pattern),m+=_,_=this._read_template();return this._until_after&&(m+=this._input.readUntilAfter(this._until_pattern)),m},d.prototype.__set_templated_pattern=function(){var m=[];this._disabled.php||m.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||m.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||m.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||m.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(m.push(this.__patterns.django._starting_pattern.source),m.push(this.__patterns.django_value._starting_pattern.source),m.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||m.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&m.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+m.join("|")+")")},d.prototype._read_template=function(){var m="",_=this._input.peek();if(_==="<"){var h=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&h==="?"&&(m=m||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&h==="%"&&(m=m||this.__patterns.erb.read())}else _==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(m=m||this.__patterns.handlebars_comment.read(),m=m||this.__patterns.handlebars_unescaped.read(),m=m||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(m=m||this.__patterns.django_value.read()),this._excluded.django||(m=m||this.__patterns.django_comment.read(),m=m||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(m=m||this.__patterns.smarty_comment.read(),m=m||this.__patterns.smarty_literal.read(),m=m||this.__patterns.smarty.read()));return m},c.exports.TemplatablePattern=d},,,,function(c,u,f){var i=f(19).Beautifier,o=f(20).Options;function d(m,_,h,v){var r=new i(m,_,h,v);return r.beautify()}c.exports=d,c.exports.defaultOptions=function(){return new o}},function(c,u,f){var i=f(20).Options,o=f(2).Output,d=f(21).Tokenizer,m=f(21).TOKEN,_=/\r\n|[\r\n]/,h=/\r\n|[\r\n]/g,v=function(N,P){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=N.max_preserve_newlines,this.preserve_newlines=N.preserve_newlines,this._output=new o(N,P)};v.prototype.current_line_has_match=function(N){return this._output.current_line.has_match(N)},v.prototype.set_space_before_token=function(N,P){this._output.space_before_token=N,this._output.non_breaking_space=P},v.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},v.prototype.add_raw_token=function(N){this._output.add_raw_token(N)},v.prototype.print_preserved_newlines=function(N){var P=0;N.type!==m.TEXT&&N.previous.type!==m.TEXT&&(P=N.newlines?1:0),this.preserve_newlines&&(P=N.newlines<this.max_preserve_newlines+1?N.newlines:this.max_preserve_newlines+1);for(var F=0;F<P;F++)this.print_newline(F>0);return P!==0},v.prototype.traverse_whitespace=function(N){return N.whitespace_before||N.newlines?(this.print_preserved_newlines(N)||(this._output.space_before_token=!0),!0):!1},v.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},v.prototype.print_newline=function(N){this._output.add_new_line(N)},v.prototype.print_token=function(N){N.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(N.text))},v.prototype.indent=function(){this.indent_level++},v.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},v.prototype.get_full_indent=function(N){return N=this.indent_level+(N||0),N<1?"":this._output.get_indent_string(N)};var r=function(N){for(var P=null,F=N.next;F.type!==m.EOF&&N.closed!==F;){if(F.type===m.ATTRIBUTE&&F.text==="type"){F.next&&F.next.type===m.EQUALS&&F.next.next&&F.next.next.type===m.VALUE&&(P=F.next.next.text);break}F=F.next}return P},a=function(N,P){var F=null,K=null;return P.closed?(N==="script"?F="text/javascript":N==="style"&&(F="text/css"),F=r(P)||F,F.search("text/css")>-1?K="css":F.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?K="javascript":F.search(/(text|application|dojo)\/(x-)?(html)/)>-1?K="html":F.search(/test\/null/)>-1&&(K="null"),K):null};function p(N,P){return P.indexOf(N)!==-1}function E(N,P,F){this.parent=N||null,this.tag=P?P.tag_name:"",this.indent_level=F||0,this.parser_token=P||null}function S(N){this._printer=N,this._current_frame=null}S.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},S.prototype.record_tag=function(N){var P=new E(this._current_frame,N,this._printer.indent_level);this._current_frame=P},S.prototype._try_pop_frame=function(N){var P=null;return N&&(P=N.parser_token,this._printer.indent_level=N.indent_level,this._current_frame=N.parent),P},S.prototype._get_frame=function(N,P){for(var F=this._current_frame;F&&N.indexOf(F.tag)===-1;){if(P&&P.indexOf(F.tag)!==-1){F=null;break}F=F.parent}return F},S.prototype.try_pop=function(N,P){var F=this._get_frame([N],P);return this._try_pop_frame(F)},S.prototype.indent_to_tag=function(N){var P=this._get_frame(N);P&&(this._printer.indent_level=P.indent_level)};function w(N,P,F,K){this._source_text=N||"",P=P||{},this._js_beautify=F,this._css_beautify=K,this._tag_stack=null;var B=new i(P,"html");this._options=B,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,5)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,8)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}w.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var N=this._source_text,P=this._options.eol;this._options.eol==="auto"&&(P=`
|
|
`,N&&_.test(N)&&(P=N.match(_)[0])),N=N.replace(h,`
|
|
`);var F=N.match(/^[\t ]*/)[0],K={text:"",type:""},B=new R(this._options),V=new v(this._options,F),C=new d(N,this._options).tokenize();this._tag_stack=new S(V);for(var M=null,H=C.next();H.type!==m.EOF;)H.type===m.TAG_OPEN||H.type===m.COMMENT?(M=this._handle_tag_open(V,H,B,K,C),B=M):H.type===m.ATTRIBUTE||H.type===m.EQUALS||H.type===m.VALUE||H.type===m.TEXT&&!B.tag_complete?M=this._handle_inside_tag(V,H,B,K):H.type===m.TAG_CLOSE?M=this._handle_tag_close(V,H,B):H.type===m.TEXT?M=this._handle_text(V,H,B):H.type===m.CONTROL_FLOW_OPEN?M=this._handle_control_flow_open(V,H):H.type===m.CONTROL_FLOW_CLOSE?M=this._handle_control_flow_close(V,H):V.add_raw_token(H),K=M,H=C.next();var $=V._output.get_code(P);return $},w.prototype._handle_control_flow_open=function(N,P){var F={text:P.text,type:P.type};return N.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),P.newlines?N.print_preserved_newlines(P):N.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),N.print_token(P),N.indent(),F},w.prototype._handle_control_flow_close=function(N,P){var F={text:P.text,type:P.type};return N.deindent(),P.newlines?N.print_preserved_newlines(P):N.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),N.print_token(P),F},w.prototype._handle_tag_close=function(N,P,F){var K={text:P.text,type:P.type};return N.alignment_size=0,F.tag_complete=!0,N.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),F.is_unformatted?N.add_raw_token(P):(F.tag_start_char==="<"&&(N.set_space_before_token(P.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&F.has_wrapped_attrs&&N.print_newline(!1)),N.print_token(P)),F.indent_content&&!(F.is_unformatted||F.is_content_unformatted)&&(N.indent(),F.indent_content=!1),!F.is_inline_element&&!(F.is_unformatted||F.is_content_unformatted)&&N.set_wrap_point(),K},w.prototype._handle_inside_tag=function(N,P,F,K){var B=F.has_wrapped_attrs,V={text:P.text,type:P.type};return N.set_space_before_token(P.newlines||P.whitespace_before!=="",!0),F.is_unformatted?N.add_raw_token(P):F.tag_start_char==="{"&&P.type===m.TEXT?N.print_preserved_newlines(P)?(P.newlines=0,N.add_raw_token(P)):N.print_token(P):(P.type===m.ATTRIBUTE?N.set_space_before_token(!0):(P.type===m.EQUALS||P.type===m.VALUE&&P.previous.type===m.EQUALS)&&N.set_space_before_token(!1),P.type===m.ATTRIBUTE&&F.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(N.traverse_whitespace(P),B=B||P.newlines!==0),this._is_wrap_attributes_force&&F.attr_count>=this._options.wrap_attributes_min_attrs&&(K.type!==m.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(N.print_newline(!1),B=!0)),N.print_token(P),B=B||N.previous_token_wrapped(),F.has_wrapped_attrs=B),V},w.prototype._handle_text=function(N,P,F){var K={text:P.text,type:"TK_CONTENT"};return F.custom_beautifier_name?this._print_custom_beatifier_text(N,P,F):F.is_unformatted||F.is_content_unformatted?N.add_raw_token(P):(N.traverse_whitespace(P),N.print_token(P)),K},w.prototype._print_custom_beatifier_text=function(N,P,F){var K=this;if(P.text!==""){var B=P.text,V,C=1,M="",H="";F.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?V=this._js_beautify:F.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?V=this._css_beautify:F.custom_beautifier_name==="html"&&(V=function(xe,De){var Ue=new w(xe,De,K._js_beautify,K._css_beautify);return Ue.beautify()}),this._options.indent_scripts==="keep"?C=0:this._options.indent_scripts==="separate"&&(C=-N.indent_level);var $=N.get_full_indent(C);if(B=B.replace(/\n[ \t]*$/,""),F.custom_beautifier_name!=="html"&&B[0]==="<"&&B.match(/^(<!--|<!\[CDATA\[)/)){var q=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(B);if(!q){N.add_raw_token(P);return}M=$+q[1]+`
|
|
`,B=q[4],q[5]&&(H=$+q[5]),B=B.replace(/\n[ \t]*$/,""),(q[2]||q[3].indexOf(`
|
|
`)!==-1)&&(q=q[3].match(/[ \t]+$/),q&&(P.whitespace_before=q[0]))}if(B)if(V){var se=function(){this.eol=`
|
|
`};se.prototype=this._options.raw_options;var ue=new se;B=V($+B,ue)}else{var pe=P.whitespace_before;pe&&(B=B.replace(new RegExp(`
|
|
(`+pe+")?","g"),`
|
|
`)),B=$+B.replace(/\n/g,`
|
|
`+$)}M&&(B?B=M+B+`
|
|
`+H:B=M+H),N.print_newline(!1),B&&(P.text=B,P.whitespace_before="",P.newlines=0,N.add_raw_token(P),N.print_newline(!0))}},w.prototype._handle_tag_open=function(N,P,F,K,B){var V=this._get_tag_open_token(P);if((F.is_unformatted||F.is_content_unformatted)&&!F.is_empty_element&&P.type===m.TAG_OPEN&&!V.is_start_tag?(N.add_raw_token(P),V.start_tag_token=this._tag_stack.try_pop(V.tag_name)):(N.traverse_whitespace(P),this._set_tag_position(N,P,V,F,K),V.is_inline_element||N.set_wrap_point(),N.print_token(P)),V.is_start_tag&&this._is_wrap_attributes_force){var C=0,M;do M=B.peek(C),M.type===m.ATTRIBUTE&&(V.attr_count+=1),C+=1;while(M.type!==m.EOF&&M.type!==m.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(V.alignment_size=P.text.length+1),!V.tag_complete&&!V.is_unformatted&&(N.alignment_size=V.alignment_size),V};var R=function(N,P,F){if(this.parent=P||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!F)this.tag_complete=!0;else{var K;this.tag_start_char=F.text[0],this.text=F.text,this.tag_start_char==="<"?(K=F.text.match(/^<([^\s>]*)/),this.tag_check=K?K[1]:""):(K=F.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=K?K[1]:"",(F.text.startsWith("{{#>")||F.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&F.next!==null?this.tag_check=F.next.text.split(" ")[0]:this.tag_check=F.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),F.type===m.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||F.closed&&F.closed.text==="/>";var B=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(B=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(!N.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(B)))}};w.prototype._get_tag_open_token=function(N){var P=new R(this._options,this._tag_stack.get_parser_token(),N);return P.alignment_size=this._options.wrap_attributes_indent_size,P.is_end_tag=P.is_end_tag||p(P.tag_check,this._options.void_elements),P.is_empty_element=P.tag_complete||P.is_start_tag&&P.is_end_tag,P.is_unformatted=!P.tag_complete&&p(P.tag_check,this._options.unformatted),P.is_content_unformatted=!P.is_empty_element&&p(P.tag_check,this._options.content_unformatted),P.is_inline_element=p(P.tag_name,this._options.inline)||this._options.inline_custom_elements&&P.tag_name.includes("-")||P.tag_start_char==="{",P},w.prototype._set_tag_position=function(N,P,F,K,B){if(F.is_empty_element||(F.is_end_tag?F.start_tag_token=this._tag_stack.try_pop(F.tag_name):(this._do_optional_end_element(F)&&(F.is_inline_element||N.print_newline(!1)),this._tag_stack.record_tag(F),(F.tag_name==="script"||F.tag_name==="style")&&!(F.is_unformatted||F.is_content_unformatted)&&(F.custom_beautifier_name=a(F.tag_check,P)))),p(F.tag_check,this._options.extra_liners)&&(N.print_newline(!1),N._output.just_added_blankline()||N.print_newline(!0)),F.is_empty_element){if(F.tag_start_char==="{"&&F.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),F.indent_content=!0;var V=N.current_line_has_match(/{{#if/);V||N.print_newline(!1)}F.tag_name==="!--"&&B.type===m.TAG_CLOSE&&K.is_end_tag&&F.text.indexOf(`
|
|
`)===-1||(F.is_inline_element||F.is_unformatted||N.print_newline(!1),this._calcluate_parent_multiline(N,F))}else if(F.is_end_tag){var C=!1;C=F.start_tag_token&&F.start_tag_token.multiline_content,C=C||!F.is_inline_element&&!(K.is_inline_element||K.is_unformatted)&&!(B.type===m.TAG_CLOSE&&F.start_tag_token===K)&&B.type!=="TK_CONTENT",(F.is_content_unformatted||F.is_unformatted)&&(C=!1),C&&N.print_newline(!1)}else F.indent_content=!F.custom_beautifier_name,F.tag_start_char==="<"&&(F.tag_name==="html"?F.indent_content=this._options.indent_inner_html:F.tag_name==="head"?F.indent_content=this._options.indent_head_inner_html:F.tag_name==="body"&&(F.indent_content=this._options.indent_body_inner_html)),!(F.is_inline_element||F.is_unformatted)&&(B.type!=="TK_CONTENT"||F.is_content_unformatted)&&N.print_newline(!1),this._calcluate_parent_multiline(N,F)},w.prototype._calcluate_parent_multiline=function(N,P){P.parent&&N._output.just_added_newline()&&!((P.is_inline_element||P.is_unformatted)&&P.parent.is_inline_element)&&(P.parent.multiline_content=!0)};var O=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],z=["a","audio","del","ins","map","noscript","video"];w.prototype._do_optional_end_element=function(N){var P=null;if(!(N.is_empty_element||!N.is_start_tag||!N.parent)){if(N.tag_name==="body")P=P||this._tag_stack.try_pop("head");else if(N.tag_name==="li")P=P||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if(N.tag_name==="dd"||N.tag_name==="dt")P=P||this._tag_stack.try_pop("dt",["dl"]),P=P||this._tag_stack.try_pop("dd",["dl"]);else if(N.parent.tag_name==="p"&&O.indexOf(N.tag_name)!==-1){var F=N.parent.parent;(!F||z.indexOf(F.tag_name)===-1)&&(P=P||this._tag_stack.try_pop("p"))}else N.tag_name==="rp"||N.tag_name==="rt"?(P=P||this._tag_stack.try_pop("rt",["ruby","rtc"]),P=P||this._tag_stack.try_pop("rp",["ruby","rtc"])):N.tag_name==="optgroup"?P=P||this._tag_stack.try_pop("optgroup",["select"]):N.tag_name==="option"?P=P||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):N.tag_name==="colgroup"?P=P||this._tag_stack.try_pop("caption",["table"]):N.tag_name==="thead"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"])):N.tag_name==="tbody"||N.tag_name==="tfoot"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"]),P=P||this._tag_stack.try_pop("thead",["table"]),P=P||this._tag_stack.try_pop("tbody",["table"])):N.tag_name==="tr"?(P=P||this._tag_stack.try_pop("caption",["table"]),P=P||this._tag_stack.try_pop("colgroup",["table"]),P=P||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(N.tag_name==="th"||N.tag_name==="td")&&(P=P||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),P=P||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return N.parent=this._tag_stack.get_parser_token(),P}},c.exports.Beautifier=w},function(c,u,f){var i=f(6).Options;function o(d){i.call(this,d,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}o.prototype=new i,c.exports.Options=o},function(c,u,f){var i=f(9).Tokenizer,o=f(9).TOKEN,d=f(13).Directives,m=f(14).TemplatablePattern,_=f(12).Pattern,h={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:o.START,RAW:o.RAW,EOF:o.EOF},v=new d(/<\!--/,/-->/),r=function(a,p){i.call(this,a,p),this._current_tag_name="";var E=new m(this._input).read_options(this._options),S=new _(this._input);if(this.__patterns={word:E.until(/[\n\r\t <]/),word_control_flow_close_excluded:E.until(/[\n\r\t <}]/),single_quote:E.until_after(/'/),double_quote:E.until_after(/"/),attribute:E.until(/[\n\r\t =>]|\/>/),element_name:E.until(/[\n\r\t >\/]/),angular_control_flow_start:S.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:S.starting_with(/{{!--/).until_after(/--}}/),handlebars:S.starting_with(/{{/).until_after(/}}/),handlebars_open:S.until(/[\n\r\t }]/),handlebars_raw_close:S.until(/}}/),comment:S.starting_with(/<!--/).until_after(/-->/),cdata:S.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:S.starting_with(/<!\[/).until_after(/]>/),processing:S.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var w=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=S.matching(w).until_after(w)}};r.prototype=new i,r.prototype._is_comment=function(a){return!1},r.prototype._is_opening=function(a){return a.type===h.TAG_OPEN||a.type===h.CONTROL_FLOW_OPEN},r.prototype._is_closing=function(a,p){return a.type===h.TAG_CLOSE&&p&&((a.text===">"||a.text==="/>")&&p.text[0]==="<"||a.text==="}}"&&p.text[0]==="{"&&p.text[1]==="{")||a.type===h.CONTROL_FLOW_CLOSE&&a.text==="}"&&p.text.endsWith("{")},r.prototype._reset=function(){this._current_tag_name=""},r.prototype._get_next_token=function(a,p){var E=null;this._readWhitespace();var S=this._input.peek();return S===null?this._create_token(h.EOF,""):(E=E||this._read_open_handlebars(S,p),E=E||this._read_attribute(S,a,p),E=E||this._read_close(S,p),E=E||this._read_script_and_style(S,a),E=E||this._read_control_flows(S,p),E=E||this._read_raw_content(S,a,p),E=E||this._read_content_word(S,p),E=E||this._read_comment_or_cdata(S),E=E||this._read_processing(S),E=E||this._read_open(S,p),E=E||this._create_token(h.UNKNOWN,this._input.next()),E)},r.prototype._read_comment_or_cdata=function(a){var p=null,E=null,S=null;if(a==="<"){var w=this._input.peek(1);w==="!"&&(E=this.__patterns.comment.read(),E?(S=v.get_directives(E),S&&S.ignore==="start"&&(E+=v.readIgnored(this._input))):E=this.__patterns.cdata.read()),E&&(p=this._create_token(h.COMMENT,E),p.directives=S)}return p},r.prototype._read_processing=function(a){var p=null,E=null,S=null;if(a==="<"){var w=this._input.peek(1);(w==="!"||w==="?")&&(E=this.__patterns.conditional_comment.read(),E=E||this.__patterns.processing.read()),E&&(p=this._create_token(h.COMMENT,E),p.directives=S)}return p},r.prototype._read_open=function(a,p){var E=null,S=null;return(!p||p.type===h.CONTROL_FLOW_OPEN)&&a==="<"&&(E=this._input.next(),this._input.peek()==="/"&&(E+=this._input.next()),E+=this.__patterns.element_name.read(),S=this._create_token(h.TAG_OPEN,E)),S},r.prototype._read_open_handlebars=function(a,p){var E=null,S=null;return(!p||p.type===h.CONTROL_FLOW_OPEN)&&(this._options.templating.includes("angular")||this._options.indent_handlebars)&&a==="{"&&this._input.peek(1)==="{"&&(this._options.indent_handlebars&&this._input.peek(2)==="!"?(E=this.__patterns.handlebars_comment.read(),E=E||this.__patterns.handlebars.read(),S=this._create_token(h.COMMENT,E)):(E=this.__patterns.handlebars_open.read(),S=this._create_token(h.TAG_OPEN,E))),S},r.prototype._read_control_flows=function(a,p){var E="",S=null;if(!this._options.templating.includes("angular"))return S;if(a==="@"){if(E=this.__patterns.angular_control_flow_start.read(),E==="")return S;for(var w=E.endsWith("(")?1:0,R=0;!(E.endsWith("{")&&w===R);){var O=this._input.next();if(O===null)break;O==="("?w++:O===")"&&R++,E+=O}S=this._create_token(h.CONTROL_FLOW_OPEN,E)}else a==="}"&&p&&p.type===h.CONTROL_FLOW_OPEN&&(E=this._input.next(),S=this._create_token(h.CONTROL_FLOW_CLOSE,E));return S},r.prototype._read_close=function(a,p){var E=null,S=null;return p&&p.type===h.TAG_OPEN&&(p.text[0]==="<"&&(a===">"||a==="/"&&this._input.peek(1)===">")?(E=this._input.next(),a==="/"&&(E+=this._input.next()),S=this._create_token(h.TAG_CLOSE,E)):p.text[0]==="{"&&a==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),S=this._create_token(h.TAG_CLOSE,"}}"))),S},r.prototype._read_attribute=function(a,p,E){var S=null,w="";if(E&&E.text[0]==="<")if(a==="=")S=this._create_token(h.EQUALS,this._input.next());else if(a==='"'||a==="'"){var R=this._input.next();a==='"'?R+=this.__patterns.double_quote.read():R+=this.__patterns.single_quote.read(),S=this._create_token(h.VALUE,R)}else w=this.__patterns.attribute.read(),w&&(p.type===h.EQUALS?S=this._create_token(h.VALUE,w):S=this._create_token(h.ATTRIBUTE,w));return S},r.prototype._is_content_unformatted=function(a){return this._options.void_elements.indexOf(a)===-1&&(this._options.content_unformatted.indexOf(a)!==-1||this._options.unformatted.indexOf(a)!==-1)},r.prototype._read_raw_content=function(a,p,E){var S="";if(E&&E.text[0]==="{")S=this.__patterns.handlebars_raw_close.read();else if(p.type===h.TAG_CLOSE&&p.opened.text[0]==="<"&&p.text[0]!=="/"){var w=p.opened.text.substr(1).toLowerCase();this._is_content_unformatted(w)&&(S=this._input.readUntil(new RegExp("</"+w+"[\\n\\r\\t ]*?>","ig")))}return S?this._create_token(h.TEXT,S):null},r.prototype._read_script_and_style=function(a,p){if(p.type===h.TAG_CLOSE&&p.opened.text[0]==="<"&&p.text[0]!=="/"){var E=p.opened.text.substr(1).toLowerCase();if(E==="script"||E==="style"){var S=this._read_comment_or_cdata(a);if(S)return S.type=h.TEXT,S;var w=this._input.readUntil(new RegExp("</"+E+"[\\n\\r\\t ]*?>","ig"));if(w)return this._create_token(h.TEXT,w)}}return null},r.prototype._read_content_word=function(a,p){var E="";return this._options.unformatted_content_delimiter&&a===this._options.unformatted_content_delimiter[0]&&(E=this.__patterns.unformatted_content_delimiter.read()),E||(E=p&&p.type===h.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),E?this._create_token(h.TEXT,E):null},c.exports.Tokenizer=r,c.exports.TOKEN=h}],A={};function s(c){var u=A[c];if(u!==void 0)return u.exports;var f=A[c]={exports:{}};return L[c](f,f.exports,s),f.exports}var x=s(18);X=x})();var D=X;if(1)te=[ae,ae(58553),ae(87804)],re=function(L){var A=ae(58553),s=ae(87804);return{html_beautify:function(x,c){return D(x,c,A.js_beautify,s.css_beautify)}}}.apply($e,te),re!==void 0&&(qt.exports=re);else var W,y})()},58553:function(qt,$e){var ae,te;(function(){var re;(function(){"use strict";var D=[function(A,s,x){var c=x(1).Beautifier,u=x(5).Options;function f(i,o){var d=new c(i,o);return d.beautify()}A.exports=f,A.exports.defaultOptions=function(){return new u}},function(A,s,x){var c=x(2).Output,u=x(3).Token,f=x(4),i=x(5).Options,o=x(7).Tokenizer,d=x(7).line_starters,m=x(7).positionable_operators,_=x(7).TOKEN;function h(M,H){return H.indexOf(M)!==-1}function v(M){return M.replace(/^\s+/g,"")}function r(M){for(var H={},$=0;$<M.length;$++)H[M[$].replace(/-/g,"_")]=M[$];return H}function a(M,H){return M&&M.type===_.RESERVED&&M.text===H}function p(M,H){return M&&M.type===_.RESERVED&&h(M.text,H)}var E=["case","return","do","if","throw","else","await","break","continue","async"],S=["before-newline","after-newline","preserve-newline"],w=r(S),R=[w.before_newline,w.preserve_newline],O={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function z(M,H){H.multiline_frame||H.mode===O.ForInitializer||H.mode===O.Conditional||M.remove_indent(H.start_line_index)}function N(M){M=M.replace(f.allLineBreaks,`
|
|
`);for(var H=[],$=M.indexOf(`
|
|
`);$!==-1;)H.push(M.substring(0,$)),M=M.substring($+1),$=M.indexOf(`
|
|
`);return M.length&&H.push(M),H}function P(M){return M===O.ArrayLiteral}function F(M){return h(M,[O.Expression,O.ForInitializer,O.Conditional])}function K(M,H){for(var $=0;$<M.length;$++){var q=M[$].trim();if(q.charAt(0)!==H)return!1}return!0}function B(M,H){for(var $=0,q=M.length,se;$<q;$++)if(se=M[$],se&&se.indexOf(H)!==0)return!1;return!0}function V(M,H){H=H||{},this._source_text=M||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new i(H)}V.prototype.create_flags=function(M,H){var $=0;M&&($=M.indentation_level,!this._output.just_added_newline()&&M.line_indent_level>$&&($=M.line_indent_level));var q={mode:H,parent:M,last_token:M?M.last_token:new u(_.START_BLOCK,""),last_word:M?M.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:$,alignment:0,line_indent_level:M?M.line_indent_level:$,start_line_index:this._output.get_line_number(),ternary_depth:0};return q},V.prototype._reset=function(M){var H=M.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new c(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(O.BlockStatement);var $=new o(M,this._options);return this._tokens=$.tokenize(),M},V.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var M,H=this._reset(this._source_text),$=this._options.eol;this._options.eol==="auto"&&($=`
|
|
`,H&&f.lineBreak.test(H||"")&&($=H.match(f.lineBreak)[0]));for(var q=this._tokens.next();q;)this.handle_token(q),this._last_last_text=this._flags.last_token.text,this._flags.last_token=q,q=this._tokens.next();return M=this._output.get_code($),M},V.prototype.handle_token=function(M,H){M.type===_.START_EXPR?this.handle_start_expr(M):M.type===_.END_EXPR?this.handle_end_expr(M):M.type===_.START_BLOCK?this.handle_start_block(M):M.type===_.END_BLOCK?this.handle_end_block(M):M.type===_.WORD?this.handle_word(M):M.type===_.RESERVED?this.handle_word(M):M.type===_.SEMICOLON?this.handle_semicolon(M):M.type===_.STRING?this.handle_string(M):M.type===_.EQUALS?this.handle_equals(M):M.type===_.OPERATOR?this.handle_operator(M):M.type===_.COMMA?this.handle_comma(M):M.type===_.BLOCK_COMMENT?this.handle_block_comment(M,H):M.type===_.COMMENT?this.handle_comment(M,H):M.type===_.DOT?this.handle_dot(M):M.type===_.EOF?this.handle_eof(M):M.type===_.UNKNOWN?this.handle_unknown(M,H):this.handle_unknown(M,H)},V.prototype.handle_whitespace_and_comments=function(M,H){var $=M.newlines,q=this._options.keep_array_indentation&&P(this._flags.mode);if(M.comments_before)for(var se=M.comments_before.next();se;)this.handle_whitespace_and_comments(se,H),this.handle_token(se,H),se=M.comments_before.next();if(q)for(var ue=0;ue<$;ue+=1)this.print_newline(ue>0,H);else if(this._options.max_preserve_newlines&&$>this._options.max_preserve_newlines&&($=this._options.max_preserve_newlines),this._options.preserve_newlines&&$>1){this.print_newline(!1,H);for(var pe=1;pe<$;pe+=1)this.print_newline(!0,H)}};var C=["async","break","continue","return","throw","yield"];V.prototype.allow_wrap_or_preserved_newline=function(M,H){if(H=H===void 0?!1:H,!this._output.just_added_newline()){var $=this._options.preserve_newlines&&M.newlines||H,q=h(this._flags.last_token.text,m)||h(M.text,m);if(q){var se=h(this._flags.last_token.text,m)&&h(this._options.operator_position,R)||h(M.text,m);$=$&&se}if($)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(p(this._flags.last_token,C))return;this._output.set_wrap_point()}}},V.prototype.print_newline=function(M,H){if(!H&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==_.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var $=this._tokens.peek();this._flags.mode===O.Statement&&!(this._flags.if_block&&a($,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(M)&&(this._flags.multiline_frame=!0)},V.prototype.print_token_line_indentation=function(M){this._output.just_added_newline()&&(this._options.keep_array_indentation&&M.newlines&&(M.text==="["||P(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(M.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},V.prototype.print_token=function(M){if(this._output.raw){this._output.add_raw_token(M);return}if(this._options.comma_first&&M.previous&&M.previous.type===_.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var H=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(H),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(M),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(M),this._output.non_breaking_space=!0,this._output.add_token(M.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},V.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},V.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},V.prototype.set_mode=function(M){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,M),this._flags=this.create_flags(this._previous_flags,M),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},V.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===O.Statement&&z(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},V.prototype.start_of_object_property=function(){return this._flags.parent.mode===O.ObjectLiteral&&this._flags.mode===O.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||p(this._flags.last_token,["get","set"]))},V.prototype.start_of_statement=function(M){var H=!1;return H=H||p(this._flags.last_token,["var","let","const"])&&M.type===_.WORD,H=H||a(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===O.ObjectLiteral&&this._flags.mode===O.Statement)&&p(this._flags.last_token,C)&&!M.newlines,H=H||a(this._flags.last_token,"else")&&!(a(M,"if")&&!M.comments_before),H=H||this._flags.last_token.type===_.END_EXPR&&(this._previous_flags.mode===O.ForInitializer||this._previous_flags.mode===O.Conditional),H=H||this._flags.last_token.type===_.WORD&&this._flags.mode===O.BlockStatement&&!this._flags.in_case&&!(M.text==="--"||M.text==="++")&&this._last_last_text!=="function"&&M.type!==_.WORD&&M.type!==_.RESERVED,H=H||this._flags.mode===O.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||p(this._flags.last_token,["get","set"])),H?(this.set_mode(O.Statement),this.indent(),this.handle_whitespace_and_comments(M,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(M,p(M,["do","for","if","while"])),!0):!1},V.prototype.handle_start_expr=function(M){this.start_of_statement(M)||this.handle_whitespace_and_comments(M);var H=O.Expression;if(M.text==="["){if(this._flags.last_token.type===_.WORD||this._flags.last_token.text===")"){p(this._flags.last_token,d)&&(this._output.space_before_token=!0),this.print_token(M),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=O.ArrayLiteral,P(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),h(this._flags.last_token.type,[_.START_EXPR,_.END_EXPR,_.WORD,_.OPERATOR,_.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===_.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,H=O.ForInitializer):h(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=O.Conditional):h(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&M.whitespace_before===""?this._output.space_before_token=!1:(h(this._flags.last_token.text,d)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===_.EQUALS||this._flags.last_token.type===_.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(M);else if(this._flags.last_token.type===_.WORD){this._output.space_before_token=!1;var $=this._tokens.peek(-3);if(this._options.space_after_named_function&&$){var q=this._tokens.peek(-4);p($,["async","function"])||$.text==="*"&&p(q,["async","function"])?this._output.space_before_token=!0:this._flags.mode===O.ObjectLiteral?($.text==="{"||$.text===","||$.text==="*"&&(q.text==="{"||q.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(M);(this._flags.last_token.type===_.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(h(this._last_last_text,["function","yield"])||this._flags.mode===O.ObjectLiteral&&h(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===_.START_BLOCK?this.print_newline():(this._flags.last_token.type===_.END_EXPR||this._flags.last_token.type===_.START_EXPR||this._flags.last_token.type===_.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===_.COMMA)&&this.allow_wrap_or_preserved_newline(M,M.newlines),this.print_token(M),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},V.prototype.handle_end_expr=function(M){for(;this._flags.mode===O.Statement;)this.restore_mode();this.handle_whitespace_and_comments(M),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(M,M.text==="]"&&P(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===_.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(M),this.restore_mode(),z(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===O.Conditional&&(this._previous_flags.mode=O.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},V.prototype.handle_start_block=function(M){this.handle_whitespace_and_comments(M);var H=this._tokens.peek(),$=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===_.END_EXPR?(this.set_mode(O.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(O.BlockStatement):$&&(h($.text,[":",","])&&h(H.type,[_.STRING,_.WORD,_.RESERVED])||h(H.text,["get","set","..."])&&h($.type,[_.WORD,_.RESERVED]))?h(this._last_last_text,["class","interface"])&&!h($.text,[":",","])?this.set_mode(O.BlockStatement):this.set_mode(O.ObjectLiteral):this._flags.last_token.type===_.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(O.BlockStatement):h(this._flags.last_token.type,[_.EQUALS,_.START_EXPR,_.COMMA,_.OPERATOR])||p(this._flags.last_token,["return","throw","import","default"])?this.set_mode(O.ObjectLiteral):this.set_mode(O.BlockStatement),this._flags.last_token&&p(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var q=!H.comments_before&&H.text==="}",se=q&&this._flags.last_word==="function"&&this._flags.last_token.type===_.END_EXPR;if(this._options.brace_preserve_inline){var ue=0,pe=null;this._flags.inline_frame=!0;do if(ue+=1,pe=this._tokens.peek(ue-1),pe.newlines){this._flags.inline_frame=!1;break}while(pe.type!==_.EOF&&!(pe.type===_.END_BLOCK&&pe.opened===M))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&M.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==_.OPERATOR&&(se||this._flags.last_token.type===_.EQUALS||p(this._flags.last_token,E)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(P(this._previous_flags.mode)&&(this._flags.last_token.type===_.START_EXPR||this._flags.last_token.type===_.COMMA)&&((this._flags.last_token.type===_.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===_.COMMA||this._flags.last_token.type===_.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(M),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==_.OPERATOR&&this._flags.last_token.type!==_.START_EXPR&&(h(this._flags.last_token.type,[_.START_BLOCK,_.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(M),this.indent(),!q&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},V.prototype.handle_end_block=function(M){for(this.handle_whitespace_and_comments(M);this._flags.mode===O.Statement;)this.restore_mode();var H=this._flags.last_token.type===_.START_BLOCK;this._flags.inline_frame&&!H?this._output.space_before_token=!0:this._options.brace_style==="expand"?H||this.print_newline():H||(P(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(M)},V.prototype.handle_word=function(M){if(M.type===_.RESERVED){if(h(M.text,["set","get"])&&this._flags.mode!==O.ObjectLiteral)M.type=_.WORD;else if(M.text==="import"&&h(this._tokens.peek().text,["(","."]))M.type=_.WORD;else if(h(M.text,["as","from"])&&!this._flags.import_block)M.type=_.WORD;else if(this._flags.mode===O.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(M.type=_.WORD)}}if(this.start_of_statement(M)?p(this._flags.last_token,["var","let","const"])&&M.type===_.WORD&&(this._flags.declaration_statement=!0):M.newlines&&!F(this._flags.mode)&&(this._flags.last_token.type!==_.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==_.EQUALS&&(this._options.preserve_newlines||!p(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(M),this.print_newline()):this.handle_whitespace_and_comments(M),this._flags.do_block&&!this._flags.do_while)if(a(M,"while")){this._output.space_before_token=!0,this.print_token(M),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&a(M,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===O.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&p(M,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(M),this._flags.in_case=!0;return}if((this._flags.last_token.type===_.COMMA||this._flags.last_token.type===_.START_EXPR||this._flags.last_token.type===_.EQUALS||this._flags.last_token.type===_.OPERATOR)&&!this.start_of_object_property()&&!(h(this._flags.last_token.text,["+","-"])&&this._last_last_text===":"&&this._flags.parent.mode===O.ObjectLiteral)&&this.allow_wrap_or_preserved_newline(M),a(M,"function")){(h(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(h(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===_.OPERATOR))&&!this._output.just_added_blankline()&&!M.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===_.RESERVED||this._flags.last_token.type===_.WORD?p(this._flags.last_token,["get","set","new","export"])||p(this._flags.last_token,C)?this._output.space_before_token=!0:a(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===_.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(F(this._flags.mode)||P(this._flags.mode))||this.print_newline(),this.print_token(M),this._flags.last_word=M.text;return}var $="NONE";if(this._flags.last_token.type===_.END_BLOCK?this._previous_flags.inline_frame?$="SPACE":p(M,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&M.newlines?$="NEWLINE":($="SPACE",this._output.space_before_token=!0):$="NEWLINE":this._flags.last_token.type===_.SEMICOLON&&this._flags.mode===O.BlockStatement?$="NEWLINE":this._flags.last_token.type===_.SEMICOLON&&F(this._flags.mode)?$="SPACE":this._flags.last_token.type===_.STRING?$="NEWLINE":this._flags.last_token.type===_.RESERVED||this._flags.last_token.type===_.WORD||this._flags.last_token.text==="*"&&(h(this._last_last_text,["function","yield"])||this._flags.mode===O.ObjectLiteral&&h(this._last_last_text,["{",","]))?$="SPACE":this._flags.last_token.type===_.START_BLOCK?this._flags.inline_frame?$="SPACE":$="NEWLINE":this._flags.last_token.type===_.END_EXPR&&(this._output.space_before_token=!0,$="NEWLINE"),p(M,d)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?$="SPACE":$="NEWLINE"),p(M,["else","catch","finally"]))if((!(this._flags.last_token.type===_.END_BLOCK&&this._previous_flags.mode===O.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&M.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var q=this._output.current_line;q.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else $==="NEWLINE"?p(this._flags.last_token,E)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&p(M,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==_.END_EXPR?(this._flags.last_token.type!==_.START_EXPR||!p(M,["var","let","const"]))&&this._flags.last_token.text!==":"&&(a(M,"if")&&a(M.previous,"else")?this._output.space_before_token=!0:this.print_newline()):p(M,d)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&P(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():$==="SPACE"&&(this._output.space_before_token=!0);M.previous&&(M.previous.type===_.WORD||M.previous.type===_.RESERVED)&&(this._output.space_before_token=!0),this.print_token(M),this._flags.last_word=M.text,M.type===_.RESERVED&&(M.text==="do"?this._flags.do_block=!0:M.text==="if"?this._flags.if_block=!0:M.text==="import"?this._flags.import_block=!0:this._flags.import_block&&a(M,"from")&&(this._flags.import_block=!1))},V.prototype.handle_semicolon=function(M){this.start_of_statement(M)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(M);for(var H=this._tokens.peek();this._flags.mode===O.Statement&&!(this._flags.if_block&&a(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(M)},V.prototype.handle_string=function(M){M.text.startsWith("`")&&M.newlines===0&&M.whitespace_before===""&&(M.previous.text===")"||this._flags.last_token.type===_.WORD)||(this.start_of_statement(M)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(M),this._flags.last_token.type===_.RESERVED||this._flags.last_token.type===_.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===_.COMMA||this._flags.last_token.type===_.START_EXPR||this._flags.last_token.type===_.EQUALS||this._flags.last_token.type===_.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(M):M.text.startsWith("`")&&this._flags.last_token.type===_.END_EXPR&&(M.previous.text==="]"||M.previous.text===")")&&M.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(M)},V.prototype.handle_equals=function(M){this.start_of_statement(M)||this.handle_whitespace_and_comments(M),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(M),this._output.space_before_token=!0},V.prototype.handle_comma=function(M){this.handle_whitespace_and_comments(M,!0),this.print_token(M),this._output.space_before_token=!0,this._flags.declaration_statement?(F(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(M)):this._flags.mode===O.ObjectLiteral||this._flags.mode===O.Statement&&this._flags.parent.mode===O.ObjectLiteral?(this._flags.mode===O.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(M)},V.prototype.handle_operator=function(M){var H=M.text==="*"&&(p(this._flags.last_token,["function","yield"])||h(this._flags.last_token.type,[_.START_BLOCK,_.COMMA,_.END_BLOCK,_.SEMICOLON])),$=h(M.text,["-","+"])&&(h(this._flags.last_token.type,[_.START_BLOCK,_.START_EXPR,_.EQUALS,_.OPERATOR])||h(this._flags.last_token.text,d)||this._flags.last_token.text===",");if(!this.start_of_statement(M)){var q=!H;this.handle_whitespace_and_comments(M,q)}if(M.text==="*"&&this._flags.last_token.type===_.DOT){this.print_token(M);return}if(M.text==="::"){this.print_token(M);return}if(h(M.text,["-","+"])&&this.start_of_object_property()){this.print_token(M);return}if(this._flags.last_token.type===_.OPERATOR&&h(this._options.operator_position,R)&&this.allow_wrap_or_preserved_newline(M),M.text===":"&&this._flags.in_case){this.print_token(M),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==_.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var se=!0,ue=!0,pe=!1;if(M.text===":"?this._flags.ternary_depth===0?se=!1:(this._flags.ternary_depth-=1,pe=!0):M.text==="?"&&(this._flags.ternary_depth+=1),!$&&!H&&this._options.preserve_newlines&&h(M.text,m)){var xe=M.text===":",De=xe&&pe,Ue=xe&&!pe;switch(this._options.operator_position){case w.before_newline:this._output.space_before_token=!Ue,this.print_token(M),(!xe||De)&&this.allow_wrap_or_preserved_newline(M),this._output.space_before_token=!0;return;case w.after_newline:this._output.space_before_token=!0,!xe||De?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(M):this._output.space_before_token=!1,this.print_token(M),this._output.space_before_token=!0;return;case w.preserve_newline:Ue||this.allow_wrap_or_preserved_newline(M),se=!(this._output.just_added_newline()||Ue),this._output.space_before_token=se,this.print_token(M),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(M),se=!1;var Ge=this._tokens.peek();ue=Ge&&h(Ge.type,[_.WORD,_.RESERVED])}else if(M.text==="...")this.allow_wrap_or_preserved_newline(M),se=this._flags.last_token.type===_.START_BLOCK,ue=!1;else if(h(M.text,["--","++","!","~"])||$){if((this._flags.last_token.type===_.COMMA||this._flags.last_token.type===_.START_EXPR)&&this.allow_wrap_or_preserved_newline(M),se=!1,ue=!1,M.newlines&&(M.text==="--"||M.text==="++"||M.text==="~")){var Ae=p(this._flags.last_token,E)&&M.newlines;Ae&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(Ae,!0)}this._flags.last_token.text===";"&&F(this._flags.mode)&&(se=!0),this._flags.last_token.type===_.RESERVED?se=!0:this._flags.last_token.type===_.END_EXPR?se=!(this._flags.last_token.text==="]"&&(M.text==="--"||M.text==="++")):this._flags.last_token.type===_.OPERATOR&&(se=h(M.text,["--","-","++","+"])&&h(this._flags.last_token.text,["--","-","++","+"]),h(M.text,["+","-"])&&h(this._flags.last_token.text,["--","++"])&&(ue=!0)),(this._flags.mode===O.BlockStatement&&!this._flags.inline_frame||this._flags.mode===O.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||se,this.print_token(M),this._output.space_before_token=ue},V.prototype.handle_block_comment=function(M,H){if(this._output.raw){this._output.add_raw_token(M),M.directives&&M.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(M.directives){this.print_newline(!1,H),this.print_token(M),M.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!f.newline.test(M.text)&&!M.newlines){this._output.space_before_token=!0,this.print_token(M),this._output.space_before_token=!0;return}else this.print_block_commment(M,H)},V.prototype.print_block_commment=function(M,H){var $=N(M.text),q,se=!1,ue=!1,pe=M.whitespace_before,xe=pe.length;if(this.print_newline(!1,H),this.print_token_line_indentation(M),this._output.add_token($[0]),this.print_newline(!1,H),$.length>1){for($=$.slice(1),se=K($,"*"),ue=B($,pe),se&&(this._flags.alignment=1),q=0;q<$.length;q++)se?(this.print_token_line_indentation(M),this._output.add_token(v($[q]))):ue&&$[q]?(this.print_token_line_indentation(M),this._output.add_token($[q].substring(xe))):(this._output.current_line.set_indent(-1),this._output.add_token($[q])),this.print_newline(!1,H);this._flags.alignment=0}},V.prototype.handle_comment=function(M,H){M.newlines?this.print_newline(!1,H):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(M),this.print_newline(!1,H)},V.prototype.handle_dot=function(M){this.start_of_statement(M)||this.handle_whitespace_and_comments(M,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),p(this._flags.last_token,E)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(M,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(M)},V.prototype.handle_unknown=function(M,H){this.print_token(M),M.text[M.text.length-1]===`
|
|
`&&this.print_newline(!1,H)},V.prototype.handle_eof=function(M){for(;this._flags.mode===O.Statement;)this.restore_mode();this.handle_whitespace_and_comments(M)},A.exports.Beautifier=V},function(A){function s(u){this.__parent=u,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}s.prototype.clone_empty=function(){var u=new s(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},s.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},s.prototype.has_match=function(u){for(var f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(u))return!0;return!1},s.prototype.set_indent=function(u,f){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=f||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},s.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},s.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},s.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},s.prototype.is_empty=function(){return this.__items.length===0},s.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},s.prototype.push=function(u){this.__items.push(u);var f=u.lastIndexOf(`
|
|
`);f!==-1?this.__character_count=u.length-f:this.__character_count+=u.length},s.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},s.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},s.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},s.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},s.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function x(u,f){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),f=f||"",u.indent_level>0&&(f=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}x.prototype.get_indent_size=function(u,f){var i=this.__base_string_length;return f=f||0,u<0&&(i=0),i+=u*this.__indent_size,i+=f,i},x.prototype.get_indent_string=function(u,f){var i=this.__base_string;return f=f||0,u<0&&(u=0,i=""),f+=u*this.__indent_size,this.__ensure_cache(f),i+=this.__cache[f],i},x.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},x.prototype.__add_column=function(){var u=this.__cache.length,f=0,i="";this.__indent_size&&u>=this.__indent_size&&(f=Math.floor(u/this.__indent_size),u-=f*this.__indent_size,i=new Array(f+1).join(this.__indent_string)),u&&(i+=new Array(u+1).join(" ")),this.__cache.push(i)};function c(u,f){this.__indent_cache=new x(u,f),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new s(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(u,f){return this.__indent_cache.get_indent_string(u,f)},c.prototype.get_indent_size=function(u,f){return this.__indent_cache.get_indent_size(u,f)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(u){this.trim(!0);var f=this.current_line.pop();f&&(f[f.length-1]===`
|
|
`&&(f=f.replace(/\n+$/g,"")),this.current_line.push(f)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
|
|
`);return u!==`
|
|
`&&(i=i.replace(/[\n]/g,u)),i},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(u,f){return u=u||0,f=f||0,this.next_line.set_indent(u,f),this.__lines.length>1?(this.current_line.set_indent(u,f),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(u){for(var f=0;f<u.newlines;f++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},c.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},c.prototype.remove_indent=function(u){for(var f=this.__lines.length;u<f;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(u,f){for(var i=this.__lines.length-2;i>=0;){var o=this.__lines[i];if(o.is_empty())break;if(o.item(0).indexOf(u)!==0&&o.item(-1)!==f){this.__lines.splice(i+1,0,new s(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},A.exports.Output=c},function(A){function s(x,c,u,f){this.type=x,this.text=c,this.comments_before=null,this.newlines=u||0,this.whitespace_before=f||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}A.exports.Token=s},function(A,s){var x="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",c="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",u="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",f="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",i="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",o="(?:"+i+"|["+x+u+"])",d="(?:"+i+"|["+c+u+f+"])*";s.identifier=new RegExp(o+d,"g"),s.identifierStart=new RegExp(o),s.identifierMatch=new RegExp("(?:"+i+"|["+c+u+f+"])+");var m=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;s.newline=/[\n\r\u2028\u2029]/,s.lineBreak=new RegExp(`\r
|
|
|`+s.newline.source),s.allLineBreaks=new RegExp(s.lineBreak.source,"g")},function(A,s,x){var c=x(6).Options,u=["before-newline","after-newline","preserve-newline"];function f(i){c.call(this,i,"js");var o=this.raw_options.brace_style||null;o==="expand-strict"?this.raw_options.brace_style="expand":o==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var d=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var m=0;m<d.length;m++)d[m]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=d[m];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",u),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}f.prototype=new c,A.exports.Options=f},function(A){function s(u,f){this.raw_options=x(u,f),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}s.prototype._get_array=function(u,f){var i=this.raw_options[u],o=f||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(o=i.concat()):typeof i=="string"&&(o=i.split(/[^a-zA-Z0-9_\/\-]+/)),o},s.prototype._get_boolean=function(u,f){var i=this.raw_options[u],o=i===void 0?!!f:!!i;return o},s.prototype._get_characters=function(u,f){var i=this.raw_options[u],o=f||"";return typeof i=="string"&&(o=i.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),o},s.prototype._get_number=function(u,f){var i=this.raw_options[u];f=parseInt(f,10),isNaN(f)&&(f=0);var o=parseInt(i,10);return isNaN(o)&&(o=f),o},s.prototype._get_selection=function(u,f,i){var o=this._get_selection_list(u,f,i);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[u]+"'");return o[0]},s.prototype._get_selection_list=function(u,f,i){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[f[0]],!this._is_valid_selection(i,f))throw new Error("Invalid Default Value!");var o=this._get_array(u,i);if(!this._is_valid_selection(o,f))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[u]+"'");return o},s.prototype._is_valid_selection=function(u,f){return u.length&&f.length&&!u.some(function(i){return f.indexOf(i)===-1})};function x(u,f){var i={};u=c(u);var o;for(o in u)o!==f&&(i[o]=u[o]);if(f&&u[f])for(o in u[f])i[o]=u[f][o];return i}function c(u){var f={},i;for(i in u){var o=i.replace(/-/g,"_");f[o]=u[i]}return f}A.exports.Options=s,A.exports.normalizeOpts=c,A.exports.mergeOpts=x},function(A,s,x){var c=x(8).InputScanner,u=x(9).Tokenizer,f=x(9).TOKEN,i=x(13).Directives,o=x(4),d=x(12).Pattern,m=x(14).TemplatablePattern;function _(K,B){return B.indexOf(K)!==-1}var h={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:f.START,RAW:f.RAW,EOF:f.EOF},v=new i(/\/\*/,/\*\//),r=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,a=/[0-9]/,p=/[^\d\.]/,E=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),S=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";S=S.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),S="\\?\\.(?!\\d) "+S,S=S.replace(/ /g,"|");var w=new RegExp(S),R="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),O=R.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),z=new RegExp("^(?:"+O.join("|")+")$"),N,P=function(K,B){u.call(this,K,B),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var V=new d(this._input),C=new m(this._input).read_options(this._options);this.__patterns={template:C,identifier:C.starting_with(o.identifier).matching(o.identifierMatch),number:V.matching(r),punct:V.matching(w),comment:V.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:V.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:V.matching(/<!--/),html_comment_end:V.matching(/-->/),include:V.starting_with(/#include/).until_after(o.lineBreak),shebang:V.starting_with(/#!/).until_after(o.lineBreak),xml:V.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:C.until(/['\\\n\r\u2028\u2029]/),double_quote:C.until(/["\\\n\r\u2028\u2029]/),template_text:C.until(/[`\\$]/),template_expression:C.until(/[`}\\]/)}};P.prototype=new u,P.prototype._is_comment=function(K){return K.type===h.COMMENT||K.type===h.BLOCK_COMMENT||K.type===h.UNKNOWN},P.prototype._is_opening=function(K){return K.type===h.START_BLOCK||K.type===h.START_EXPR},P.prototype._is_closing=function(K,B){return(K.type===h.END_BLOCK||K.type===h.END_EXPR)&&B&&(K.text==="]"&&B.text==="["||K.text===")"&&B.text==="("||K.text==="}"&&B.text==="{")},P.prototype._reset=function(){N=!1},P.prototype._get_next_token=function(K,B){var V=null;this._readWhitespace();var C=this._input.peek();return C===null?this._create_token(h.EOF,""):(V=V||this._read_non_javascript(C),V=V||this._read_string(C),V=V||this._read_pair(C,this._input.peek(1)),V=V||this._read_word(K),V=V||this._read_singles(C),V=V||this._read_comment(C),V=V||this._read_regexp(C,K),V=V||this._read_xml(C,K),V=V||this._read_punctuation(),V=V||this._create_token(h.UNKNOWN,this._input.next()),V)},P.prototype._read_word=function(K){var B;if(B=this.__patterns.identifier.read(),B!=="")return B=B.replace(o.allLineBreaks,`
|
|
`),!(K.type===h.DOT||K.type===h.RESERVED&&(K.text==="set"||K.text==="get"))&&z.test(B)?(B==="in"||B==="of")&&(K.type===h.WORD||K.type===h.STRING)?this._create_token(h.OPERATOR,B):this._create_token(h.RESERVED,B):this._create_token(h.WORD,B);if(B=this.__patterns.number.read(),B!=="")return this._create_token(h.WORD,B)},P.prototype._read_singles=function(K){var B=null;return K==="("||K==="["?B=this._create_token(h.START_EXPR,K):K===")"||K==="]"?B=this._create_token(h.END_EXPR,K):K==="{"?B=this._create_token(h.START_BLOCK,K):K==="}"?B=this._create_token(h.END_BLOCK,K):K===";"?B=this._create_token(h.SEMICOLON,K):K==="."&&p.test(this._input.peek(1))?B=this._create_token(h.DOT,K):K===","&&(B=this._create_token(h.COMMA,K)),B&&this._input.next(),B},P.prototype._read_pair=function(K,B){var V=null;return K==="#"&&B==="{"&&(V=this._create_token(h.START_BLOCK,K+B)),V&&(this._input.next(),this._input.next()),V},P.prototype._read_punctuation=function(){var K=this.__patterns.punct.read();if(K!=="")return K==="="?this._create_token(h.EQUALS,K):K==="?."?this._create_token(h.DOT,K):this._create_token(h.OPERATOR,K)},P.prototype._read_non_javascript=function(K){var B="";if(K==="#"){if(this._is_first_token()&&(B=this.__patterns.shebang.read(),B))return this._create_token(h.UNKNOWN,B.trim()+`
|
|
`);if(B=this.__patterns.include.read(),B)return this._create_token(h.UNKNOWN,B.trim()+`
|
|
`);K=this._input.next();var V="#";if(this._input.hasNext()&&this._input.testChar(a)){do K=this._input.next(),V+=K;while(this._input.hasNext()&&K!=="#"&&K!=="=");return K==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(V+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(V+="{}",this._input.next(),this._input.next())),this._create_token(h.WORD,V)}this._input.back()}else if(K==="<"&&this._is_first_token()){if(B=this.__patterns.html_comment_start.read(),B){for(;this._input.hasNext()&&!this._input.testChar(o.newline);)B+=this._input.next();return N=!0,this._create_token(h.COMMENT,B)}}else if(N&&K==="-"&&(B=this.__patterns.html_comment_end.read(),B))return N=!1,this._create_token(h.COMMENT,B);return null},P.prototype._read_comment=function(K){var B=null;if(K==="/"){var V="";if(this._input.peek(1)==="*"){V=this.__patterns.block_comment.read();var C=v.get_directives(V);C&&C.ignore==="start"&&(V+=v.readIgnored(this._input)),V=V.replace(o.allLineBreaks,`
|
|
`),B=this._create_token(h.BLOCK_COMMENT,V),B.directives=C}else this._input.peek(1)==="/"&&(V=this.__patterns.comment.read(),B=this._create_token(h.COMMENT,V))}return B},P.prototype._read_string=function(K){if(K==="`"||K==="'"||K==='"'){var B=this._input.next();return this.has_char_escapes=!1,K==="`"?B+=this._read_string_recursive("`",!0,"${"):B+=this._read_string_recursive(K),this.has_char_escapes&&this._options.unescape_strings&&(B=F(B)),this._input.peek()===K&&(B+=this._input.next()),B=B.replace(o.allLineBreaks,`
|
|
`),this._create_token(h.STRING,B)}return null},P.prototype._allow_regexp_or_xml=function(K){return K.type===h.RESERVED&&_(K.text,["return","case","throw","else","do","typeof","yield"])||K.type===h.END_EXPR&&K.text===")"&&K.opened.previous.type===h.RESERVED&&_(K.opened.previous.text,["if","while","for"])||_(K.type,[h.COMMENT,h.START_EXPR,h.START_BLOCK,h.START,h.END_BLOCK,h.OPERATOR,h.EQUALS,h.EOF,h.SEMICOLON,h.COMMA])},P.prototype._read_regexp=function(K,B){if(K==="/"&&this._allow_regexp_or_xml(B)){for(var V=this._input.next(),C=!1,M=!1;this._input.hasNext()&&(C||M||this._input.peek()!==K)&&!this._input.testChar(o.newline);)V+=this._input.peek(),C?C=!1:(C=this._input.peek()==="\\",this._input.peek()==="["?M=!0:this._input.peek()==="]"&&(M=!1)),this._input.next();return this._input.peek()===K&&(V+=this._input.next(),V+=this._input.read(o.identifier)),this._create_token(h.STRING,V)}return null},P.prototype._read_xml=function(K,B){if(this._options.e4x&&K==="<"&&this._allow_regexp_or_xml(B)){var V="",C=this.__patterns.xml.read_match();if(C){for(var M=C[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=M.indexOf("{")===0,$=0;C;){var q=!!C[1],se=C[2],ue=!!C[C.length-1]||se.slice(0,8)==="![CDATA[";if(!ue&&(se===M||H&&se.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(q?--$:++$),V+=C[0],$<=0)break;C=this.__patterns.xml.read_match()}return C||(V+=this._input.match(/[\s\S]*/g)[0]),V=V.replace(o.allLineBreaks,`
|
|
`),this._create_token(h.STRING,V)}}return null};function F(K){for(var B="",V=0,C=new c(K),M=null;C.hasNext();)if(M=C.match(/([\s]|[^\\]|\\\\)+/g),M&&(B+=M[0]),C.peek()==="\\"){if(C.next(),C.peek()==="x")M=C.match(/x([0-9A-Fa-f]{2})/g);else if(C.peek()==="u")M=C.match(/u([0-9A-Fa-f]{4})/g),M||(M=C.match(/u\{([0-9A-Fa-f]+)\}/g));else{B+="\\",C.hasNext()&&(B+=C.next());continue}if(!M||(V=parseInt(M[1],16),V>126&&V<=255&&M[0].indexOf("x")===0))return K;V>=0&&V<32||V>1114111?B+="\\"+M[0]:V===34||V===39||V===92?B+="\\"+String.fromCharCode(V):B+=String.fromCharCode(V)}return B}P.prototype._read_string_recursive=function(K,B,V){var C,M;K==="'"?M=this.__patterns.single_quote:K==='"'?M=this.__patterns.double_quote:K==="`"?M=this.__patterns.template_text:K==="}"&&(M=this.__patterns.template_expression);for(var H=M.read(),$="";this._input.hasNext();){if($=this._input.next(),$===K||!B&&o.newline.test($)){this._input.back();break}else $==="\\"&&this._input.hasNext()?(C=this._input.peek(),C==="x"||C==="u"?this.has_char_escapes=!0:C==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),$+=this._input.next()):V&&(V==="${"&&$==="$"&&this._input.peek()==="{"&&($+=this._input.next()),V===$&&(K==="`"?$+=this._read_string_recursive("}",B,"`"):$+=this._read_string_recursive("`",B,"${"),this._input.hasNext()&&($+=this._input.next())));$+=M.read(),H+=$}return H},A.exports.Tokenizer=P,A.exports.TOKEN=h,A.exports.positionable_operators=E.slice(),A.exports.line_starters=R.slice()},function(A){var s=RegExp.prototype.hasOwnProperty("sticky");function x(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}x.prototype.restart=function(){this.__position=0},x.prototype.back=function(){this.__position>0&&(this.__position-=1)},x.prototype.hasNext=function(){return this.__position<this.__input_length},x.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},x.prototype.peek=function(c){var u=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(u=this.__input.charAt(c)),u},x.prototype.__match=function(c,u){c.lastIndex=u;var f=c.exec(this.__input);return f&&!(s&&c.sticky)&&f.index!==u&&(f=null),f},x.prototype.test=function(c,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(c,u):!1},x.prototype.testChar=function(c,u){var f=this.peek(u);return c.lastIndex=0,f!==null&&c.test(f)},x.prototype.match=function(c){var u=this.__match(c,this.__position);return u?this.__position+=u[0].length:u=null,u},x.prototype.read=function(c,u,f){var i="",o;return c&&(o=this.match(c),o&&(i+=o[0])),u&&(o||!c)&&(i+=this.readUntil(u,f)),i},x.prototype.readUntil=function(c,u){var f="",i=this.__position;c.lastIndex=this.__position;var o=c.exec(this.__input);return o?(i=o.index,u&&(i+=o[0].length)):i=this.__input_length,f=this.__input.substring(this.__position,i),this.__position=i,f},x.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},x.prototype.get_regexp=function(c,u){var f=null,i="g";return u&&s&&(i="y"),typeof c=="string"&&c!==""?f=new RegExp(c,i):c&&(f=new RegExp(c.source,i)),f},x.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},x.prototype.peekUntilAfter=function(c){var u=this.__position,f=this.readUntilAfter(c);return this.__position=u,f},x.prototype.lookBack=function(c){var u=this.__position-1;return u>=c.length&&this.__input.substring(u-c.length,u).toLowerCase()===c},A.exports.InputScanner=x},function(A,s,x){var c=x(8).InputScanner,u=x(3).Token,f=x(10).TokenStream,i=x(11).WhitespacePattern,o={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},d=function(m,_){this._input=new c(m),this._options=_||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};d.prototype.tokenize=function(){this._input.restart(),this.__tokens=new f,this._reset();for(var m,_=new u(o.START,""),h=null,v=[],r=new f;_.type!==o.EOF;){for(m=this._get_next_token(_,h);this._is_comment(m);)r.add(m),m=this._get_next_token(_,h);r.isEmpty()||(m.comments_before=r,r=new f),m.parent=h,this._is_opening(m)?(v.push(h),h=m):h&&this._is_closing(m,h)&&(m.opened=h,h.closed=m,h=v.pop(),m.parent=h),m.previous=_,_.next=m,this.__tokens.add(m),_=m}return this.__tokens},d.prototype._is_first_token=function(){return this.__tokens.isEmpty()},d.prototype._reset=function(){},d.prototype._get_next_token=function(m,_){this._readWhitespace();var h=this._input.read(/.+/g);return h?this._create_token(o.RAW,h):this._create_token(o.EOF,"")},d.prototype._is_comment=function(m){return!1},d.prototype._is_opening=function(m){return!1},d.prototype._is_closing=function(m,_){return!1},d.prototype._create_token=function(m,_){var h=new u(m,_,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return h},d.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},A.exports.Tokenizer=d,A.exports.TOKEN=o},function(A){function s(x){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=x}s.prototype.restart=function(){this.__position=0},s.prototype.isEmpty=function(){return this.__tokens_length===0},s.prototype.hasNext=function(){return this.__position<this.__tokens_length},s.prototype.next=function(){var x=null;return this.hasNext()&&(x=this.__tokens[this.__position],this.__position+=1),x},s.prototype.peek=function(x){var c=null;return x=x||0,x+=this.__position,x>=0&&x<this.__tokens_length&&(c=this.__tokens[x]),c},s.prototype.add=function(x){this.__parent_token&&(x.parent=this.__parent_token),this.__tokens.push(x),this.__tokens_length+=1},A.exports.TokenStream=s},function(A,s,x){var c=x(12).Pattern;function u(f,i){c.call(this,f,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}u.prototype=new c,u.prototype.__set_whitespace_patterns=function(f,i){f+="\\t ",i+="\\n\\r",this._match_pattern=this._input.get_regexp("["+f+i+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+i+"]")},u.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var f=this._input.read(this._match_pattern);if(f===" ")this.whitespace_before_token=" ";else if(f){var i=this.__split(this._newline_regexp,f);this.newline_count=i.length-1,this.whitespace_before_token=i[this.newline_count]}return f},u.prototype.matching=function(f,i){var o=this._create();return o.__set_whitespace_patterns(f,i),o._update(),o},u.prototype._create=function(){return new u(this._input,this)},u.prototype.__split=function(f,i){f.lastIndex=0;for(var o=0,d=[],m=f.exec(i);m;)d.push(i.substring(o,m.index)),o=m.index+m[0].length,m=f.exec(i);return o<i.length?d.push(i.substring(o,i.length)):d.push(""),d},A.exports.WhitespacePattern=u},function(A){function s(x,c){this._input=x,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,c&&(this._starting_pattern=this._input.get_regexp(c._starting_pattern,!0),this._match_pattern=this._input.get_regexp(c._match_pattern,!0),this._until_pattern=this._input.get_regexp(c._until_pattern),this._until_after=c._until_after)}s.prototype.read=function(){var x=this._input.read(this._starting_pattern);return(!this._starting_pattern||x)&&(x+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),x},s.prototype.read_match=function(){return this._input.match(this._match_pattern)},s.prototype.until_after=function(x){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(x),c._update(),c},s.prototype.until=function(x){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(x),c._update(),c},s.prototype.starting_with=function(x){var c=this._create();return c._starting_pattern=this._input.get_regexp(x,!0),c._update(),c},s.prototype.matching=function(x){var c=this._create();return c._match_pattern=this._input.get_regexp(x,!0),c._update(),c},s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){},A.exports.Pattern=s},function(A){function s(x,c){x=typeof x=="string"?x:x.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(x+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(x+/\sbeautify\signore:end\s/.source+c,"g")}s.prototype.get_directives=function(x){if(!x.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(x);u;)c[u[1]]=u[2],u=this.__directive_pattern.exec(x);return c},s.prototype.readIgnored=function(x){return x.readUntilAfter(this.__directives_end_ignore_pattern)},A.exports.Directives=s},function(A,s,x){var c=x(12).Pattern,u={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function f(i,o){c.call(this,i,o),this.__template_pattern=null,this._disabled=Object.assign({},u),this._excluded=Object.assign({},u),o&&(this.__template_pattern=this._input.get_regexp(o.__template_pattern),this._excluded=Object.assign(this._excluded,o._excluded),this._disabled=Object.assign(this._disabled,o._disabled));var d=new c(i);this.__patterns={handlebars_comment:d.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:d.starting_with(/{{{/).until_after(/}}}/),handlebars:d.starting_with(/{{/).until_after(/}}/),php:d.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:d.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:d.starting_with(/{%/).until_after(/%}/),django_value:d.starting_with(/{{/).until_after(/}}/),django_comment:d.starting_with(/{#/).until_after(/#}/),smarty:d.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:d.starting_with(/{\*/).until_after(/\*}/),smarty_literal:d.starting_with(/{literal}/).until_after(/{\/literal}/)}}f.prototype=new c,f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){this.__set_templated_pattern()},f.prototype.disable=function(i){var o=this._create();return o._disabled[i]=!0,o._update(),o},f.prototype.read_options=function(i){var o=this._create();for(var d in u)o._disabled[d]=i.templating.indexOf(d)===-1;return o._update(),o},f.prototype.exclude=function(i){var o=this._create();return o._excluded[i]=!0,o._update(),o},f.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=this._input.read(this._starting_pattern,this.__template_pattern);for(var o=this._read_template();o;)this._match_pattern?o+=this._input.read(this._match_pattern):o+=this._input.readUntil(this.__template_pattern),i+=o,o=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},f.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},f.prototype._read_template=function(){var i="",o=this._input.peek();if(o==="<"){var d=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&d==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&d==="%"&&(i=i||this.__patterns.erb.read())}else o==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},A.exports.TemplatablePattern=f}],W={};function y(A){var s=W[A];if(s!==void 0)return s.exports;var x=W[A]={exports:{}};return D[A](x,x.exports,y),x.exports}var L=y(0);re=L})();var X=re;ae=[],te=function(){return{js_beautify:X}}.apply($e,ae),te!==void 0&&(qt.exports=te)})()},75918:function(qt,$e,ae){"use strict";ae.d($e,{Wi:function(){return y},Z0:function(){return L},aU:function(){return W},eZ:function(){return s},wY:function(){return A}});var te=ae(4348),re=ae(69323),X=ae(13268),D=function(x,c,u,f){function i(o){return o instanceof u?o:new u(function(d){d(o)})}return new(u||(u=Promise))(function(o,d){function m(v){try{h(f.next(v))}catch(r){d(r)}}function _(v){try{h(f.throw(v))}catch(r){d(r)}}function h(v){v.done?o(v.value):i(v.value).then(m,_)}h((f=f.apply(x,c||[])).next())})};class W extends re.JT{constructor(c,u="",f="",i=!0,o){super(),this._onDidChange=this._register(new te.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=c,this._label=u,this._cssClass=f,this._enabled=i,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(c){this._setLabel(c)}_setLabel(c){this._label!==c&&(this._label=c,this._onDidChange.fire({label:c}))}get tooltip(){return this._tooltip||""}set tooltip(c){this._setTooltip(c)}_setTooltip(c){this._tooltip!==c&&(this._tooltip=c,this._onDidChange.fire({tooltip:c}))}get class(){return this._cssClass}set class(c){this._setClass(c)}_setClass(c){this._cssClass!==c&&(this._cssClass=c,this._onDidChange.fire({class:c}))}get enabled(){return this._enabled}set enabled(c){this._setEnabled(c)}_setEnabled(c){this._enabled!==c&&(this._enabled=c,this._onDidChange.fire({enabled:c}))}get checked(){return this._checked}set checked(c){this._setChecked(c)}_setChecked(c){this._checked!==c&&(this._checked=c,this._onDidChange.fire({checked:c}))}run(c,u){return D(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(c))})}}class y extends re.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new te.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new te.Q5),this.onDidRun=this._onDidRun.event}run(c,u){return D(this,void 0,void 0,function*(){if(!c.enabled)return;this._onBeforeRun.fire({action:c});let f;try{yield this.runAction(c,u)}catch(i){f=i}this._onDidRun.fire({action:c,error:f})})}runAction(c,u){return D(this,void 0,void 0,function*(){yield c.run(u)})}}class L extends W{constructor(c){super(L.ID,c,c?"separator text":"separator"),this.checked=!1,this.enabled=!1}}L.ID="vs.actions.separator";class A{constructor(c,u,f,i){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=c,this.label=u,this.class=i,this._actions=f}get actions(){return this._actions}dispose(){}run(){return D(this,void 0,void 0,function*(){})}}class s extends W{constructor(){super(s.ID,X.N("submenu.empty","(empty)"),void 0,!1)}}s.ID="vs.actions.empty"},76068:function(qt,$e,ae){"use strict";ae.d($e,{ok:function(){return te}});function te(re,X){if(!re)throw new Error(X?`Assertion failed (${X})`:"Assertion Failed")}},52615:function(qt,$e,ae){"use strict";ae.d($e,{CM:function(){return W},JL:function(){return y},dT:function(){return A},fK:function(){return D},lA:function(){return L}});var te=ae(4348);class re{constructor(){this._icons=new Map,this._onDidRegister=new te.Q5}add(x){const c=this._icons.get(x.id);c?x.description?c.description=x.description:console.error(`Duplicate registration of codicon ${x.id}`):(this._icons.set(x.id,x),this._onDidRegister.fire(x))}get(x){return this._icons.get(x)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const X=new re,D=X;function W(s,x){return new L(s,x)}function y(s){return s?s.replace(/\$\((.*?)\)/g,(x,c)=>` ${c} `).trim():""}class L{constructor(x,c,u){this.id=x,this.definition=c,this.description=u,X.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var A;(function(s){s.iconNameSegment="[A-Za-z0-9]+",s.iconNameExpression="[A-Za-z0-9\\-]+",s.iconModifierExpression="~[A-Za-z]+";const x=new RegExp(`^(${s.iconNameExpression})(${s.iconModifierExpression})?$`);function c(i){if(i instanceof L)return["codicon","codicon-"+i.id];const o=x.exec(i.id);if(!o)return c(L.error);let[,d,m]=o;const _=["codicon","codicon-"+d];return m&&_.push("codicon-modifier-"+m.substr(1)),_}s.asClassNameArray=c;function u(i){return c(i).join(" ")}s.asClassName=u;function f(i){return"."+c(i).join(".")}s.asCSSSelector=f})(A||(A={})),function(s){s.add=new s("add",{fontCharacter:"\\ea60"}),s.plus=new s("plus",s.add.definition),s.gistNew=new s("gist-new",s.add.definition),s.repoCreate=new s("repo-create",s.add.definition),s.lightbulb=new s("lightbulb",{fontCharacter:"\\ea61"}),s.lightBulb=new s("light-bulb",{fontCharacter:"\\ea61"}),s.repo=new s("repo",{fontCharacter:"\\ea62"}),s.repoDelete=new s("repo-delete",{fontCharacter:"\\ea62"}),s.gistFork=new s("gist-fork",{fontCharacter:"\\ea63"}),s.repoForked=new s("repo-forked",{fontCharacter:"\\ea63"}),s.gitPullRequest=new s("git-pull-request",{fontCharacter:"\\ea64"}),s.gitPullRequestAbandoned=new s("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),s.recordKeys=new s("record-keys",{fontCharacter:"\\ea65"}),s.keyboard=new s("keyboard",{fontCharacter:"\\ea65"}),s.tag=new s("tag",{fontCharacter:"\\ea66"}),s.tagAdd=new s("tag-add",{fontCharacter:"\\ea66"}),s.tagRemove=new s("tag-remove",{fontCharacter:"\\ea66"}),s.person=new s("person",{fontCharacter:"\\ea67"}),s.personFollow=new s("person-follow",{fontCharacter:"\\ea67"}),s.personOutline=new s("person-outline",{fontCharacter:"\\ea67"}),s.personFilled=new s("person-filled",{fontCharacter:"\\ea67"}),s.gitBranch=new s("git-branch",{fontCharacter:"\\ea68"}),s.gitBranchCreate=new s("git-branch-create",{fontCharacter:"\\ea68"}),s.gitBranchDelete=new s("git-branch-delete",{fontCharacter:"\\ea68"}),s.sourceControl=new s("source-control",{fontCharacter:"\\ea68"}),s.mirror=new s("mirror",{fontCharacter:"\\ea69"}),s.mirrorPublic=new s("mirror-public",{fontCharacter:"\\ea69"}),s.star=new s("star",{fontCharacter:"\\ea6a"}),s.starAdd=new s("star-add",{fontCharacter:"\\ea6a"}),s.starDelete=new s("star-delete",{fontCharacter:"\\ea6a"}),s.starEmpty=new s("star-empty",{fontCharacter:"\\ea6a"}),s.comment=new s("comment",{fontCharacter:"\\ea6b"}),s.commentAdd=new s("comment-add",{fontCharacter:"\\ea6b"}),s.alert=new s("alert",{fontCharacter:"\\ea6c"}),s.warning=new s("warning",{fontCharacter:"\\ea6c"}),s.search=new s("search",{fontCharacter:"\\ea6d"}),s.searchSave=new s("search-save",{fontCharacter:"\\ea6d"}),s.logOut=new s("log-out",{fontCharacter:"\\ea6e"}),s.signOut=new s("sign-out",{fontCharacter:"\\ea6e"}),s.logIn=new s("log-in",{fontCharacter:"\\ea6f"}),s.signIn=new s("sign-in",{fontCharacter:"\\ea6f"}),s.eye=new s("eye",{fontCharacter:"\\ea70"}),s.eyeUnwatch=new s("eye-unwatch",{fontCharacter:"\\ea70"}),s.eyeWatch=new s("eye-watch",{fontCharacter:"\\ea70"}),s.circleFilled=new s("circle-filled",{fontCharacter:"\\ea71"}),s.primitiveDot=new s("primitive-dot",{fontCharacter:"\\ea71"}),s.closeDirty=new s("close-dirty",{fontCharacter:"\\ea71"}),s.debugBreakpoint=new s("debug-breakpoint",{fontCharacter:"\\ea71"}),s.debugBreakpointDisabled=new s("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),s.debugHint=new s("debug-hint",{fontCharacter:"\\ea71"}),s.primitiveSquare=new s("primitive-square",{fontCharacter:"\\ea72"}),s.edit=new s("edit",{fontCharacter:"\\ea73"}),s.pencil=new s("pencil",{fontCharacter:"\\ea73"}),s.info=new s("info",{fontCharacter:"\\ea74"}),s.issueOpened=new s("issue-opened",{fontCharacter:"\\ea74"}),s.gistPrivate=new s("gist-private",{fontCharacter:"\\ea75"}),s.gitForkPrivate=new s("git-fork-private",{fontCharacter:"\\ea75"}),s.lock=new s("lock",{fontCharacter:"\\ea75"}),s.mirrorPrivate=new s("mirror-private",{fontCharacter:"\\ea75"}),s.close=new s("close",{fontCharacter:"\\ea76"}),s.removeClose=new s("remove-close",{fontCharacter:"\\ea76"}),s.x=new s("x",{fontCharacter:"\\ea76"}),s.repoSync=new s("repo-sync",{fontCharacter:"\\ea77"}),s.sync=new s("sync",{fontCharacter:"\\ea77"}),s.clone=new s("clone",{fontCharacter:"\\ea78"}),s.desktopDownload=new s("desktop-download",{fontCharacter:"\\ea78"}),s.beaker=new s("beaker",{fontCharacter:"\\ea79"}),s.microscope=new s("microscope",{fontCharacter:"\\ea79"}),s.vm=new s("vm",{fontCharacter:"\\ea7a"}),s.deviceDesktop=new s("device-desktop",{fontCharacter:"\\ea7a"}),s.file=new s("file",{fontCharacter:"\\ea7b"}),s.fileText=new s("file-text",{fontCharacter:"\\ea7b"}),s.more=new s("more",{fontCharacter:"\\ea7c"}),s.ellipsis=new s("ellipsis",{fontCharacter:"\\ea7c"}),s.kebabHorizontal=new s("kebab-horizontal",{fontCharacter:"\\ea7c"}),s.mailReply=new s("mail-reply",{fontCharacter:"\\ea7d"}),s.reply=new s("reply",{fontCharacter:"\\ea7d"}),s.organization=new s("organization",{fontCharacter:"\\ea7e"}),s.organizationFilled=new s("organization-filled",{fontCharacter:"\\ea7e"}),s.organizationOutline=new s("organization-outline",{fontCharacter:"\\ea7e"}),s.newFile=new s("new-file",{fontCharacter:"\\ea7f"}),s.fileAdd=new s("file-add",{fontCharacter:"\\ea7f"}),s.newFolder=new s("new-folder",{fontCharacter:"\\ea80"}),s.fileDirectoryCreate=new s("file-directory-create",{fontCharacter:"\\ea80"}),s.trash=new s("trash",{fontCharacter:"\\ea81"}),s.trashcan=new s("trashcan",{fontCharacter:"\\ea81"}),s.history=new s("history",{fontCharacter:"\\ea82"}),s.clock=new s("clock",{fontCharacter:"\\ea82"}),s.folder=new s("folder",{fontCharacter:"\\ea83"}),s.fileDirectory=new s("file-directory",{fontCharacter:"\\ea83"}),s.symbolFolder=new s("symbol-folder",{fontCharacter:"\\ea83"}),s.logoGithub=new s("logo-github",{fontCharacter:"\\ea84"}),s.markGithub=new s("mark-github",{fontCharacter:"\\ea84"}),s.github=new s("github",{fontCharacter:"\\ea84"}),s.terminal=new s("terminal",{fontCharacter:"\\ea85"}),s.console=new s("console",{fontCharacter:"\\ea85"}),s.repl=new s("repl",{fontCharacter:"\\ea85"}),s.zap=new s("zap",{fontCharacter:"\\ea86"}),s.symbolEvent=new s("symbol-event",{fontCharacter:"\\ea86"}),s.error=new s("error",{fontCharacter:"\\ea87"}),s.stop=new s("stop",{fontCharacter:"\\ea87"}),s.variable=new s("variable",{fontCharacter:"\\ea88"}),s.symbolVariable=new s("symbol-variable",{fontCharacter:"\\ea88"}),s.array=new s("array",{fontCharacter:"\\ea8a"}),s.symbolArray=new s("symbol-array",{fontCharacter:"\\ea8a"}),s.symbolModule=new s("symbol-module",{fontCharacter:"\\ea8b"}),s.symbolPackage=new s("symbol-package",{fontCharacter:"\\ea8b"}),s.symbolNamespace=new s("symbol-namespace",{fontCharacter:"\\ea8b"}),s.symbolObject=new s("symbol-object",{fontCharacter:"\\ea8b"}),s.symbolMethod=new s("symbol-method",{fontCharacter:"\\ea8c"}),s.symbolFunction=new s("symbol-function",{fontCharacter:"\\ea8c"}),s.symbolConstructor=new s("symbol-constructor",{fontCharacter:"\\ea8c"}),s.symbolBoolean=new s("symbol-boolean",{fontCharacter:"\\ea8f"}),s.symbolNull=new s("symbol-null",{fontCharacter:"\\ea8f"}),s.symbolNumeric=new s("symbol-numeric",{fontCharacter:"\\ea90"}),s.symbolNumber=new s("symbol-number",{fontCharacter:"\\ea90"}),s.symbolStructure=new s("symbol-structure",{fontCharacter:"\\ea91"}),s.symbolStruct=new s("symbol-struct",{fontCharacter:"\\ea91"}),s.symbolParameter=new s("symbol-parameter",{fontCharacter:"\\ea92"}),s.symbolTypeParameter=new s("symbol-type-parameter",{fontCharacter:"\\ea92"}),s.symbolKey=new s("symbol-key",{fontCharacter:"\\ea93"}),s.symbolText=new s("symbol-text",{fontCharacter:"\\ea93"}),s.symbolReference=new s("symbol-reference",{fontCharacter:"\\ea94"}),s.goToFile=new s("go-to-file",{fontCharacter:"\\ea94"}),s.symbolEnum=new s("symbol-enum",{fontCharacter:"\\ea95"}),s.symbolValue=new s("symbol-value",{fontCharacter:"\\ea95"}),s.symbolRuler=new s("symbol-ruler",{fontCharacter:"\\ea96"}),s.symbolUnit=new s("symbol-unit",{fontCharacter:"\\ea96"}),s.activateBreakpoints=new s("activate-breakpoints",{fontCharacter:"\\ea97"}),s.archive=new s("archive",{fontCharacter:"\\ea98"}),s.arrowBoth=new s("arrow-both",{fontCharacter:"\\ea99"}),s.arrowDown=new s("arrow-down",{fontCharacter:"\\ea9a"}),s.arrowLeft=new s("arrow-left",{fontCharacter:"\\ea9b"}),s.arrowRight=new s("arrow-right",{fontCharacter:"\\ea9c"}),s.arrowSmallDown=new s("arrow-small-down",{fontCharacter:"\\ea9d"}),s.arrowSmallLeft=new s("arrow-small-left",{fontCharacter:"\\ea9e"}),s.arrowSmallRight=new s("arrow-small-right",{fontCharacter:"\\ea9f"}),s.arrowSmallUp=new s("arrow-small-up",{fontCharacter:"\\eaa0"}),s.arrowUp=new s("arrow-up",{fontCharacter:"\\eaa1"}),s.bell=new s("bell",{fontCharacter:"\\eaa2"}),s.bold=new s("bold",{fontCharacter:"\\eaa3"}),s.book=new s("book",{fontCharacter:"\\eaa4"}),s.bookmark=new s("bookmark",{fontCharacter:"\\eaa5"}),s.debugBreakpointConditionalUnverified=new s("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),s.debugBreakpointConditional=new s("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),s.debugBreakpointConditionalDisabled=new s("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),s.debugBreakpointDataUnverified=new s("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),s.debugBreakpointData=new s("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),s.debugBreakpointDataDisabled=new s("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),s.debugBreakpointLogUnverified=new s("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),s.debugBreakpointLog=new s("debug-breakpoint-log",{fontCharacter:"\\eaab"}),s.debugBreakpointLogDisabled=new s("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),s.briefcase=new s("briefcase",{fontCharacter:"\\eaac"}),s.broadcast=new s("broadcast",{fontCharacter:"\\eaad"}),s.browser=new s("browser",{fontCharacter:"\\eaae"}),s.bug=new s("bug",{fontCharacter:"\\eaaf"}),s.calendar=new s("calendar",{fontCharacter:"\\eab0"}),s.caseSensitive=new s("case-sensitive",{fontCharacter:"\\eab1"}),s.check=new s("check",{fontCharacter:"\\eab2"}),s.checklist=new s("checklist",{fontCharacter:"\\eab3"}),s.chevronDown=new s("chevron-down",{fontCharacter:"\\eab4"}),s.dropDownButton=new s("drop-down-button",s.chevronDown.definition),s.chevronLeft=new s("chevron-left",{fontCharacter:"\\eab5"}),s.chevronRight=new s("chevron-right",{fontCharacter:"\\eab6"}),s.chevronUp=new s("chevron-up",{fontCharacter:"\\eab7"}),s.chromeClose=new s("chrome-close",{fontCharacter:"\\eab8"}),s.chromeMaximize=new s("chrome-maximize",{fontCharacter:"\\eab9"}),s.chromeMinimize=new s("chrome-minimize",{fontCharacter:"\\eaba"}),s.chromeRestore=new s("chrome-restore",{fontCharacter:"\\eabb"}),s.circleOutline=new s("circle-outline",{fontCharacter:"\\eabc"}),s.debugBreakpointUnverified=new s("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),s.circleSlash=new s("circle-slash",{fontCharacter:"\\eabd"}),s.circuitBoard=new s("circuit-board",{fontCharacter:"\\eabe"}),s.clearAll=new s("clear-all",{fontCharacter:"\\eabf"}),s.clippy=new s("clippy",{fontCharacter:"\\eac0"}),s.closeAll=new s("close-all",{fontCharacter:"\\eac1"}),s.cloudDownload=new s("cloud-download",{fontCharacter:"\\eac2"}),s.cloudUpload=new s("cloud-upload",{fontCharacter:"\\eac3"}),s.code=new s("code",{fontCharacter:"\\eac4"}),s.collapseAll=new s("collapse-all",{fontCharacter:"\\eac5"}),s.colorMode=new s("color-mode",{fontCharacter:"\\eac6"}),s.commentDiscussion=new s("comment-discussion",{fontCharacter:"\\eac7"}),s.compareChanges=new s("compare-changes",{fontCharacter:"\\eafd"}),s.creditCard=new s("credit-card",{fontCharacter:"\\eac9"}),s.dash=new s("dash",{fontCharacter:"\\eacc"}),s.dashboard=new s("dashboard",{fontCharacter:"\\eacd"}),s.database=new s("database",{fontCharacter:"\\eace"}),s.debugContinue=new s("debug-continue",{fontCharacter:"\\eacf"}),s.debugDisconnect=new s("debug-disconnect",{fontCharacter:"\\ead0"}),s.debugPause=new s("debug-pause",{fontCharacter:"\\ead1"}),s.debugRestart=new s("debug-restart",{fontCharacter:"\\ead2"}),s.debugStart=new s("debug-start",{fontCharacter:"\\ead3"}),s.debugStepInto=new s("debug-step-into",{fontCharacter:"\\ead4"}),s.debugStepOut=new s("debug-step-out",{fontCharacter:"\\ead5"}),s.debugStepOver=new s("debug-step-over",{fontCharacter:"\\ead6"}),s.debugStop=new s("debug-stop",{fontCharacter:"\\ead7"}),s.debug=new s("debug",{fontCharacter:"\\ead8"}),s.deviceCameraVideo=new s("device-camera-video",{fontCharacter:"\\ead9"}),s.deviceCamera=new s("device-camera",{fontCharacter:"\\eada"}),s.deviceMobile=new s("device-mobile",{fontCharacter:"\\eadb"}),s.diffAdded=new s("diff-added",{fontCharacter:"\\eadc"}),s.diffIgnored=new s("diff-ignored",{fontCharacter:"\\eadd"}),s.diffModified=new s("diff-modified",{fontCharacter:"\\eade"}),s.diffRemoved=new s("diff-removed",{fontCharacter:"\\eadf"}),s.diffRenamed=new s("diff-renamed",{fontCharacter:"\\eae0"}),s.diff=new s("diff",{fontCharacter:"\\eae1"}),s.discard=new s("discard",{fontCharacter:"\\eae2"}),s.editorLayout=new s("editor-layout",{fontCharacter:"\\eae3"}),s.emptyWindow=new s("empty-window",{fontCharacter:"\\eae4"}),s.exclude=new s("exclude",{fontCharacter:"\\eae5"}),s.extensions=new s("extensions",{fontCharacter:"\\eae6"}),s.eyeClosed=new s("eye-closed",{fontCharacter:"\\eae7"}),s.fileBinary=new s("file-binary",{fontCharacter:"\\eae8"}),s.fileCode=new s("file-code",{fontCharacter:"\\eae9"}),s.fileMedia=new s("file-media",{fontCharacter:"\\eaea"}),s.filePdf=new s("file-pdf",{fontCharacter:"\\eaeb"}),s.fileSubmodule=new s("file-submodule",{fontCharacter:"\\eaec"}),s.fileSymlinkDirectory=new s("file-symlink-directory",{fontCharacter:"\\eaed"}),s.fileSymlinkFile=new s("file-symlink-file",{fontCharacter:"\\eaee"}),s.fileZip=new s("file-zip",{fontCharacter:"\\eaef"}),s.files=new s("files",{fontCharacter:"\\eaf0"}),s.filter=new s("filter",{fontCharacter:"\\eaf1"}),s.flame=new s("flame",{fontCharacter:"\\eaf2"}),s.foldDown=new s("fold-down",{fontCharacter:"\\eaf3"}),s.foldUp=new s("fold-up",{fontCharacter:"\\eaf4"}),s.fold=new s("fold",{fontCharacter:"\\eaf5"}),s.folderActive=new s("folder-active",{fontCharacter:"\\eaf6"}),s.folderOpened=new s("folder-opened",{fontCharacter:"\\eaf7"}),s.gear=new s("gear",{fontCharacter:"\\eaf8"}),s.gift=new s("gift",{fontCharacter:"\\eaf9"}),s.gistSecret=new s("gist-secret",{fontCharacter:"\\eafa"}),s.gist=new s("gist",{fontCharacter:"\\eafb"}),s.gitCommit=new s("git-commit",{fontCharacter:"\\eafc"}),s.gitCompare=new s("git-compare",{fontCharacter:"\\eafd"}),s.gitMerge=new s("git-merge",{fontCharacter:"\\eafe"}),s.githubAction=new s("github-action",{fontCharacter:"\\eaff"}),s.githubAlt=new s("github-alt",{fontCharacter:"\\eb00"}),s.globe=new s("globe",{fontCharacter:"\\eb01"}),s.grabber=new s("grabber",{fontCharacter:"\\eb02"}),s.graph=new s("graph",{fontCharacter:"\\eb03"}),s.gripper=new s("gripper",{fontCharacter:"\\eb04"}),s.heart=new s("heart",{fontCharacter:"\\eb05"}),s.home=new s("home",{fontCharacter:"\\eb06"}),s.horizontalRule=new s("horizontal-rule",{fontCharacter:"\\eb07"}),s.hubot=new s("hubot",{fontCharacter:"\\eb08"}),s.inbox=new s("inbox",{fontCharacter:"\\eb09"}),s.issueClosed=new s("issue-closed",{fontCharacter:"\\eba4"}),s.issueReopened=new s("issue-reopened",{fontCharacter:"\\eb0b"}),s.issues=new s("issues",{fontCharacter:"\\eb0c"}),s.italic=new s("italic",{fontCharacter:"\\eb0d"}),s.jersey=new s("jersey",{fontCharacter:"\\eb0e"}),s.json=new s("json",{fontCharacter:"\\eb0f"}),s.kebabVertical=new s("kebab-vertical",{fontCharacter:"\\eb10"}),s.key=new s("key",{fontCharacter:"\\eb11"}),s.law=new s("law",{fontCharacter:"\\eb12"}),s.lightbulbAutofix=new s("lightbulb-autofix",{fontCharacter:"\\eb13"}),s.linkExternal=new s("link-external",{fontCharacter:"\\eb14"}),s.link=new s("link",{fontCharacter:"\\eb15"}),s.listOrdered=new s("list-ordered",{fontCharacter:"\\eb16"}),s.listUnordered=new s("list-unordered",{fontCharacter:"\\eb17"}),s.liveShare=new s("live-share",{fontCharacter:"\\eb18"}),s.loading=new s("loading",{fontCharacter:"\\eb19"}),s.location=new s("location",{fontCharacter:"\\eb1a"}),s.mailRead=new s("mail-read",{fontCharacter:"\\eb1b"}),s.mail=new s("mail",{fontCharacter:"\\eb1c"}),s.markdown=new s("markdown",{fontCharacter:"\\eb1d"}),s.megaphone=new s("megaphone",{fontCharacter:"\\eb1e"}),s.mention=new s("mention",{fontCharacter:"\\eb1f"}),s.milestone=new s("milestone",{fontCharacter:"\\eb20"}),s.mortarBoard=new s("mortar-board",{fontCharacter:"\\eb21"}),s.move=new s("move",{fontCharacter:"\\eb22"}),s.multipleWindows=new s("multiple-windows",{fontCharacter:"\\eb23"}),s.mute=new s("mute",{fontCharacter:"\\eb24"}),s.noNewline=new s("no-newline",{fontCharacter:"\\eb25"}),s.note=new s("note",{fontCharacter:"\\eb26"}),s.octoface=new s("octoface",{fontCharacter:"\\eb27"}),s.openPreview=new s("open-preview",{fontCharacter:"\\eb28"}),s.package_=new s("package",{fontCharacter:"\\eb29"}),s.paintcan=new s("paintcan",{fontCharacter:"\\eb2a"}),s.pin=new s("pin",{fontCharacter:"\\eb2b"}),s.play=new s("play",{fontCharacter:"\\eb2c"}),s.run=new s("run",{fontCharacter:"\\eb2c"}),s.plug=new s("plug",{fontCharacter:"\\eb2d"}),s.preserveCase=new s("preserve-case",{fontCharacter:"\\eb2e"}),s.preview=new s("preview",{fontCharacter:"\\eb2f"}),s.project=new s("project",{fontCharacter:"\\eb30"}),s.pulse=new s("pulse",{fontCharacter:"\\eb31"}),s.question=new s("question",{fontCharacter:"\\eb32"}),s.quote=new s("quote",{fontCharacter:"\\eb33"}),s.radioTower=new s("radio-tower",{fontCharacter:"\\eb34"}),s.reactions=new s("reactions",{fontCharacter:"\\eb35"}),s.references=new s("references",{fontCharacter:"\\eb36"}),s.refresh=new s("refresh",{fontCharacter:"\\eb37"}),s.regex=new s("regex",{fontCharacter:"\\eb38"}),s.remoteExplorer=new s("remote-explorer",{fontCharacter:"\\eb39"}),s.remote=new s("remote",{fontCharacter:"\\eb3a"}),s.remove=new s("remove",{fontCharacter:"\\eb3b"}),s.replaceAll=new s("replace-all",{fontCharacter:"\\eb3c"}),s.replace=new s("replace",{fontCharacter:"\\eb3d"}),s.repoClone=new s("repo-clone",{fontCharacter:"\\eb3e"}),s.repoForcePush=new s("repo-force-push",{fontCharacter:"\\eb3f"}),s.repoPull=new s("repo-pull",{fontCharacter:"\\eb40"}),s.repoPush=new s("repo-push",{fontCharacter:"\\eb41"}),s.report=new s("report",{fontCharacter:"\\eb42"}),s.requestChanges=new s("request-changes",{fontCharacter:"\\eb43"}),s.rocket=new s("rocket",{fontCharacter:"\\eb44"}),s.rootFolderOpened=new s("root-folder-opened",{fontCharacter:"\\eb45"}),s.rootFolder=new s("root-folder",{fontCharacter:"\\eb46"}),s.rss=new s("rss",{fontCharacter:"\\eb47"}),s.ruby=new s("ruby",{fontCharacter:"\\eb48"}),s.saveAll=new s("save-all",{fontCharacter:"\\eb49"}),s.saveAs=new s("save-as",{fontCharacter:"\\eb4a"}),s.save=new s("save",{fontCharacter:"\\eb4b"}),s.screenFull=new s("screen-full",{fontCharacter:"\\eb4c"}),s.screenNormal=new s("screen-normal",{fontCharacter:"\\eb4d"}),s.searchStop=new s("search-stop",{fontCharacter:"\\eb4e"}),s.server=new s("server",{fontCharacter:"\\eb50"}),s.settingsGear=new s("settings-gear",{fontCharacter:"\\eb51"}),s.settings=new s("settings",{fontCharacter:"\\eb52"}),s.shield=new s("shield",{fontCharacter:"\\eb53"}),s.smiley=new s("smiley",{fontCharacter:"\\eb54"}),s.sortPrecedence=new s("sort-precedence",{fontCharacter:"\\eb55"}),s.splitHorizontal=new s("split-horizontal",{fontCharacter:"\\eb56"}),s.splitVertical=new s("split-vertical",{fontCharacter:"\\eb57"}),s.squirrel=new s("squirrel",{fontCharacter:"\\eb58"}),s.starFull=new s("star-full",{fontCharacter:"\\eb59"}),s.starHalf=new s("star-half",{fontCharacter:"\\eb5a"}),s.symbolClass=new s("symbol-class",{fontCharacter:"\\eb5b"}),s.symbolColor=new s("symbol-color",{fontCharacter:"\\eb5c"}),s.symbolConstant=new s("symbol-constant",{fontCharacter:"\\eb5d"}),s.symbolEnumMember=new s("symbol-enum-member",{fontCharacter:"\\eb5e"}),s.symbolField=new s("symbol-field",{fontCharacter:"\\eb5f"}),s.symbolFile=new s("symbol-file",{fontCharacter:"\\eb60"}),s.symbolInterface=new s("symbol-interface",{fontCharacter:"\\eb61"}),s.symbolKeyword=new s("symbol-keyword",{fontCharacter:"\\eb62"}),s.symbolMisc=new s("symbol-misc",{fontCharacter:"\\eb63"}),s.symbolOperator=new s("symbol-operator",{fontCharacter:"\\eb64"}),s.symbolProperty=new s("symbol-property",{fontCharacter:"\\eb65"}),s.wrench=new s("wrench",{fontCharacter:"\\eb65"}),s.wrenchSubaction=new s("wrench-subaction",{fontCharacter:"\\eb65"}),s.symbolSnippet=new s("symbol-snippet",{fontCharacter:"\\eb66"}),s.tasklist=new s("tasklist",{fontCharacter:"\\eb67"}),s.telescope=new s("telescope",{fontCharacter:"\\eb68"}),s.textSize=new s("text-size",{fontCharacter:"\\eb69"}),s.threeBars=new s("three-bars",{fontCharacter:"\\eb6a"}),s.thumbsdown=new s("thumbsdown",{fontCharacter:"\\eb6b"}),s.thumbsup=new s("thumbsup",{fontCharacter:"\\eb6c"}),s.tools=new s("tools",{fontCharacter:"\\eb6d"}),s.triangleDown=new s("triangle-down",{fontCharacter:"\\eb6e"}),s.triangleLeft=new s("triangle-left",{fontCharacter:"\\eb6f"}),s.triangleRight=new s("triangle-right",{fontCharacter:"\\eb70"}),s.triangleUp=new s("triangle-up",{fontCharacter:"\\eb71"}),s.twitter=new s("twitter",{fontCharacter:"\\eb72"}),s.unfold=new s("unfold",{fontCharacter:"\\eb73"}),s.unlock=new s("unlock",{fontCharacter:"\\eb74"}),s.unmute=new s("unmute",{fontCharacter:"\\eb75"}),s.unverified=new s("unverified",{fontCharacter:"\\eb76"}),s.verified=new s("verified",{fontCharacter:"\\eb77"}),s.versions=new s("versions",{fontCharacter:"\\eb78"}),s.vmActive=new s("vm-active",{fontCharacter:"\\eb79"}),s.vmOutline=new s("vm-outline",{fontCharacter:"\\eb7a"}),s.vmRunning=new s("vm-running",{fontCharacter:"\\eb7b"}),s.watch=new s("watch",{fontCharacter:"\\eb7c"}),s.whitespace=new s("whitespace",{fontCharacter:"\\eb7d"}),s.wholeWord=new s("whole-word",{fontCharacter:"\\eb7e"}),s.window=new s("window",{fontCharacter:"\\eb7f"}),s.wordWrap=new s("word-wrap",{fontCharacter:"\\eb80"}),s.zoomIn=new s("zoom-in",{fontCharacter:"\\eb81"}),s.zoomOut=new s("zoom-out",{fontCharacter:"\\eb82"}),s.listFilter=new s("list-filter",{fontCharacter:"\\eb83"}),s.listFlat=new s("list-flat",{fontCharacter:"\\eb84"}),s.listSelection=new s("list-selection",{fontCharacter:"\\eb85"}),s.selection=new s("selection",{fontCharacter:"\\eb85"}),s.listTree=new s("list-tree",{fontCharacter:"\\eb86"}),s.debugBreakpointFunctionUnverified=new s("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),s.debugBreakpointFunction=new s("debug-breakpoint-function",{fontCharacter:"\\eb88"}),s.debugBreakpointFunctionDisabled=new s("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),s.debugStackframeActive=new s("debug-stackframe-active",{fontCharacter:"\\eb89"}),s.debugStackframeDot=new s("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),s.debugStackframe=new s("debug-stackframe",{fontCharacter:"\\eb8b"}),s.debugStackframeFocused=new s("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),s.debugBreakpointUnsupported=new s("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),s.symbolString=new s("symbol-string",{fontCharacter:"\\eb8d"}),s.debugReverseContinue=new s("debug-reverse-continue",{fontCharacter:"\\eb8e"}),s.debugStepBack=new s("debug-step-back",{fontCharacter:"\\eb8f"}),s.debugRestartFrame=new s("debug-restart-frame",{fontCharacter:"\\eb90"}),s.callIncoming=new s("call-incoming",{fontCharacter:"\\eb92"}),s.callOutgoing=new s("call-outgoing",{fontCharacter:"\\eb93"}),s.menu=new s("menu",{fontCharacter:"\\eb94"}),s.expandAll=new s("expand-all",{fontCharacter:"\\eb95"}),s.feedback=new s("feedback",{fontCharacter:"\\eb96"}),s.groupByRefType=new s("group-by-ref-type",{fontCharacter:"\\eb97"}),s.ungroupByRefType=new s("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),s.account=new s("account",{fontCharacter:"\\eb99"}),s.bellDot=new s("bell-dot",{fontCharacter:"\\eb9a"}),s.debugConsole=new s("debug-console",{fontCharacter:"\\eb9b"}),s.library=new s("library",{fontCharacter:"\\eb9c"}),s.output=new s("output",{fontCharacter:"\\eb9d"}),s.runAll=new s("run-all",{fontCharacter:"\\eb9e"}),s.syncIgnored=new s("sync-ignored",{fontCharacter:"\\eb9f"}),s.pinned=new s("pinned",{fontCharacter:"\\eba0"}),s.githubInverted=new s("github-inverted",{fontCharacter:"\\eba1"}),s.debugAlt=new s("debug-alt",{fontCharacter:"\\eb91"}),s.serverProcess=new s("server-process",{fontCharacter:"\\eba2"}),s.serverEnvironment=new s("server-environment",{fontCharacter:"\\eba3"}),s.pass=new s("pass",{fontCharacter:"\\eba4"}),s.stopCircle=new s("stop-circle",{fontCharacter:"\\eba5"}),s.playCircle=new s("play-circle",{fontCharacter:"\\eba6"}),s.record=new s("record",{fontCharacter:"\\eba7"}),s.debugAltSmall=new s("debug-alt-small",{fontCharacter:"\\eba8"}),s.vmConnect=new s("vm-connect",{fontCharacter:"\\eba9"}),s.cloud=new s("cloud",{fontCharacter:"\\ebaa"}),s.merge=new s("merge",{fontCharacter:"\\ebab"}),s.exportIcon=new s("export",{fontCharacter:"\\ebac"}),s.graphLeft=new s("graph-left",{fontCharacter:"\\ebad"}),s.magnet=new s("magnet",{fontCharacter:"\\ebae"}),s.notebook=new s("notebook",{fontCharacter:"\\ebaf"}),s.redo=new s("redo",{fontCharacter:"\\ebb0"}),s.checkAll=new s("check-all",{fontCharacter:"\\ebb1"}),s.pinnedDirty=new s("pinned-dirty",{fontCharacter:"\\ebb2"}),s.passFilled=new s("pass-filled",{fontCharacter:"\\ebb3"}),s.circleLargeFilled=new s("circle-large-filled",{fontCharacter:"\\ebb4"}),s.circleLargeOutline=new s("circle-large-outline",{fontCharacter:"\\ebb5"}),s.combine=new s("combine",{fontCharacter:"\\ebb6"}),s.gather=new s("gather",{fontCharacter:"\\ebb6"}),s.table=new s("table",{fontCharacter:"\\ebb7"}),s.variableGroup=new s("variable-group",{fontCharacter:"\\ebb8"}),s.typeHierarchy=new s("type-hierarchy",{fontCharacter:"\\ebb9"}),s.typeHierarchySub=new s("type-hierarchy-sub",{fontCharacter:"\\ebba"}),s.typeHierarchySuper=new s("type-hierarchy-super",{fontCharacter:"\\ebbb"}),s.gitPullRequestCreate=new s("git-pull-request-create",{fontCharacter:"\\ebbc"}),s.runAbove=new s("run-above",{fontCharacter:"\\ebbd"}),s.runBelow=new s("run-below",{fontCharacter:"\\ebbe"}),s.notebookTemplate=new s("notebook-template",{fontCharacter:"\\ebbf"}),s.debugRerun=new s("debug-rerun",{fontCharacter:"\\ebc0"}),s.workspaceTrusted=new s("workspace-trusted",{fontCharacter:"\\ebc1"}),s.workspaceUntrusted=new s("workspace-untrusted",{fontCharacter:"\\ebc2"}),s.workspaceUnspecified=new s("workspace-unspecified",{fontCharacter:"\\ebc3"}),s.terminalCmd=new s("terminal-cmd",{fontCharacter:"\\ebc4"}),s.terminalDebian=new s("terminal-debian",{fontCharacter:"\\ebc5"}),s.terminalLinux=new s("terminal-linux",{fontCharacter:"\\ebc6"}),s.terminalPowershell=new s("terminal-powershell",{fontCharacter:"\\ebc7"}),s.terminalTmux=new s("terminal-tmux",{fontCharacter:"\\ebc8"}),s.terminalUbuntu=new s("terminal-ubuntu",{fontCharacter:"\\ebc9"}),s.terminalBash=new s("terminal-bash",{fontCharacter:"\\ebca"}),s.arrowSwap=new s("arrow-swap",{fontCharacter:"\\ebcb"}),s.copy=new s("copy",{fontCharacter:"\\ebcc"}),s.personAdd=new s("person-add",{fontCharacter:"\\ebcd"}),s.filterFilled=new s("filter-filled",{fontCharacter:"\\ebce"}),s.wand=new s("wand",{fontCharacter:"\\ebcf"}),s.debugLineByLine=new s("debug-line-by-line",{fontCharacter:"\\ebd0"}),s.inspect=new s("inspect",{fontCharacter:"\\ebd1"}),s.layers=new s("layers",{fontCharacter:"\\ebd2"}),s.layersDot=new s("layers-dot",{fontCharacter:"\\ebd3"}),s.layersActive=new s("layers-active",{fontCharacter:"\\ebd4"}),s.compass=new s("compass",{fontCharacter:"\\ebd5"}),s.compassDot=new s("compass-dot",{fontCharacter:"\\ebd6"}),s.compassActive=new s("compass-active",{fontCharacter:"\\ebd7"}),s.azure=new s("azure",{fontCharacter:"\\ebd8"}),s.issueDraft=new s("issue-draft",{fontCharacter:"\\ebd9"}),s.gitPullRequestClosed=new s("git-pull-request-closed",{fontCharacter:"\\ebda"}),s.gitPullRequestDraft=new s("git-pull-request-draft",{fontCharacter:"\\ebdb"}),s.debugAll=new s("debug-all",{fontCharacter:"\\ebdc"}),s.debugCoverage=new s("debug-coverage",{fontCharacter:"\\ebdd"}),s.runErrors=new s("run-errors",{fontCharacter:"\\ebde"}),s.folderLibrary=new s("folder-library",{fontCharacter:"\\ebdf"}),s.debugContinueSmall=new s("debug-continue-small",{fontCharacter:"\\ebe0"}),s.beakerStop=new s("beaker-stop",{fontCharacter:"\\ebe1"}),s.graphLine=new s("graph-line",{fontCharacter:"\\ebe2"}),s.graphScatter=new s("graph-scatter",{fontCharacter:"\\ebe3"}),s.pieChart=new s("pie-chart",{fontCharacter:"\\ebe4"}),s.bracket=new s("bracket",s.json.definition),s.bracketDot=new s("bracket-dot",{fontCharacter:"\\ebe5"}),s.bracketError=new s("bracket-error",{fontCharacter:"\\ebe6"}),s.lockSmall=new s("lock-small",{fontCharacter:"\\ebe7"}),s.azureDevops=new s("azure-devops",{fontCharacter:"\\ebe8"}),s.verifiedFilled=new s("verified-filled",{fontCharacter:"\\ebe9"})}(L||(L={}))},79881:function(qt,$e,ae){"use strict";ae.d($e,{B8:function(){return c},Cp:function(){return D},F0:function(){return A},L6:function(){return x},VV:function(){return L},b1:function(){return s},dL:function(){return X},ri:function(){return W}});class te{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(f){setTimeout(()=>{throw f.stack?new Error(f.message+`
|
|
|
|
`+f.stack):f},0)}}emit(f){this.listeners.forEach(i=>{i(f)})}onUnexpectedError(f){this.unexpectedErrorHandler(f),this.emit(f)}onUnexpectedExternalError(f){this.unexpectedErrorHandler(f)}}const re=new te;function X(u){L(u)||re.onUnexpectedError(u)}function D(u){L(u)||re.onUnexpectedExternalError(u)}function W(u){if(u instanceof Error){let{name:f,message:i}=u;const o=u.stacktrace||u.stack;return{$isError:!0,name:f,message:i,stack:o}}return u}const y="Canceled";function L(u){return u instanceof Error&&u.name===y&&u.message===y}function A(){const u=new Error(y);return u.name=u.message,u}function s(u){return u?new Error(`Illegal argument: ${u}`):new Error("Illegal argument")}function x(u){return u?new Error(`Illegal state: ${u}`):new Error("Illegal state")}class c extends Error{constructor(f){super("NotSupported"),f&&(this.message=f)}}},4348:function(qt,$e,ae){"use strict";ae.d($e,{D0:function(){return c},E7:function(){return u},K3:function(){return x},Q5:function(){return s},ZD:function(){return f},ju:function(){return W}});var te=ae(79881),re=ae(69323),X=ae(34502),D=ae(95830),W;(function(i){i.None=()=>re.JT.None;function o(F){return(K,B=null,V)=>{let C=!1,M;return M=F(H=>{if(!C)return M?M.dispose():C=!0,K.call(B,H)},null,V),C&&M.dispose(),M}}i.once=o;function d(F,K){return a((B,V=null,C)=>F(M=>B.call(V,K(M)),null,C))}i.map=d;function m(F,K){return a((B,V=null,C)=>F(M=>{K(M),B.call(V,M)},null,C))}i.forEach=m;function _(F,K){return a((B,V=null,C)=>F(M=>K(M)&&B.call(V,M),null,C))}i.filter=_;function h(F){return F}i.signal=h;function v(...F){return(K,B=null,V)=>(0,re.F8)(...F.map(C=>C(M=>K.call(B,M),null,V)))}i.any=v;function r(F,K,B){let V=B;return d(F,C=>(V=K(V,C),V))}i.reduce=r;function a(F){let K;const B=new s({onFirstListenerAdd(){K=F(B.fire,B)},onLastListenerRemove(){K.dispose()}});return B.event}function p(F,K,B=100,V=!1,C){let M,H,$,q=0;const se=new s({leakWarningThreshold:C,onFirstListenerAdd(){M=F(ue=>{q++,H=K(H,ue),V&&!$&&(se.fire(H),H=void 0),clearTimeout($),$=setTimeout(()=>{const pe=H;H=void 0,$=void 0,(!V||q>1)&&se.fire(pe),q=0},B)})},onLastListenerRemove(){M.dispose()}});return se.event}i.debounce=p;function E(F,K=(B,V)=>B===V){let B=!0,V;return _(F,C=>{const M=B||!K(C,V);return B=!1,V=C,M})}i.latch=E;function S(F,K){return[i.filter(F,K),i.filter(F,B=>!K(B))]}i.split=S;function w(F,K=!1,B=[]){let V=B.slice(),C=F($=>{V?V.push($):H.fire($)});const M=()=>{V&&V.forEach($=>H.fire($)),V=null},H=new s({onFirstListenerAdd(){C||(C=F($=>H.fire($)))},onFirstListenerDidAdd(){V&&(K?setTimeout(M):M())},onLastListenerRemove(){C&&C.dispose(),C=null}});return H.event}i.buffer=w;class R{constructor(K){this.event=K}map(K){return new R(d(this.event,K))}forEach(K){return new R(m(this.event,K))}filter(K){return new R(_(this.event,K))}reduce(K,B){return new R(r(this.event,K,B))}latch(){return new R(E(this.event))}debounce(K,B=100,V=!1,C){return new R(p(this.event,K,B,V,C))}on(K,B,V){return this.event(K,B,V)}once(K,B,V){return o(this.event)(K,B,V)}}function O(F){return new R(F)}i.chain=O;function z(F,K,B=V=>V){const V=(...$)=>H.fire(B(...$)),C=()=>F.on(K,V),M=()=>F.removeListener(K,V),H=new s({onFirstListenerAdd:C,onLastListenerRemove:M});return H.event}i.fromNodeEventEmitter=z;function N(F,K,B=V=>V){const V=(...$)=>H.fire(B(...$)),C=()=>F.addEventListener(K,V),M=()=>F.removeEventListener(K,V),H=new s({onFirstListenerAdd:C,onLastListenerRemove:M});return H.event}i.fromDOMEventEmitter=N;function P(F){return new Promise(K=>o(F)(K))}i.toPromise=P})(W||(W={}));class y{constructor(o){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${o}_${y._idPool++}`}start(o){this._stopWatch=new D.G(!0),this._listenerCount=o}stop(){if(this._stopWatch){const o=this._stopWatch.elapsed();this._elapsedOverall+=o,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${o.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}y._idPool=0;let L=-1;class A{constructor(o,d=Math.random().toString(18).slice(2,5)){this.customThreshold=o,this.name=d,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(o){let d=L;if(typeof this.customThreshold=="number"&&(d=this.customThreshold),d<=0||o<d)return;this._stacks||(this._stacks=new Map);const m=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),_=this._stacks.get(m)||0;if(this._stacks.set(m,_+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=d*.5;let h,v=0;for(const[r,a]of this._stacks)(!h||v<a)&&(h=r,v=a);console.warn(`[${this.name}] potential listener LEAK detected, having ${o} listeners already. MOST frequent listener (${v}):`),console.warn(h)}return()=>{const h=this._stacks.get(m)||0;this._stacks.set(m,h-1)}}}class s{constructor(o){var d;this._disposed=!1,this._options=o,this._leakageMon=L>0?new A(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((d=this._options)===null||d===void 0)&&d._profName?new y(this._options._profName):void 0}get event(){return this._event||(this._event=(o,d,m)=>{var _;this._listeners||(this._listeners=new X.S);const h=this._listeners.isEmpty();h&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const v=this._listeners.push(d?[o,d]:o);h&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,o,d);const r=(_=this._leakageMon)===null||_===void 0?void 0:_.check(this._listeners.size),a=(0,re.OF)(()=>{r&&r(),this._disposed||(v(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return m instanceof re.SL?m.add(a):Array.isArray(m)&&m.push(a),a}),this._event}fire(o){var d,m;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new X.S);for(let _ of this._listeners)this._deliveryQueue.push([_,o]);for((d=this._perfMon)===null||d===void 0||d.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[_,h]=this._deliveryQueue.shift();try{typeof _=="function"?_.call(void 0,h):_[0].call(_[1],h)}catch(v){(0,te.dL)(v)}}(m=this._perfMon)===null||m===void 0||m.stop()}}dispose(){var o,d,m,_,h;this._disposed||(this._disposed=!0,(o=this._listeners)===null||o===void 0||o.clear(),(d=this._deliveryQueue)===null||d===void 0||d.clear(),(_=(m=this._options)===null||m===void 0?void 0:m.onLastListenerRemove)===null||_===void 0||_.call(m),(h=this._leakageMon)===null||h===void 0||h.dispose())}}class x extends s{constructor(o){super(o),this._isPaused=0,this._eventQueue=new X.S,this._mergeFn=o==null?void 0:o.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const o=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(o))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(o){this._listeners&&(this._isPaused!==0?this._eventQueue.push(o):super.fire(o))}}class c extends x{constructor(o){var d;super(o),this._delay=(d=o.delay)!==null&&d!==void 0?d:100}fire(o){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(o)}}class u{constructor(){this.buffers=[]}wrapEvent(o){return(d,m,_)=>o(h=>{const v=this.buffers[this.buffers.length-1];v?v.push(()=>d.call(m,h)):d.call(m,h)},void 0,_)}bufferEvents(o){const d=[];this.buffers.push(d);const m=o();return this.buffers.pop(),d.forEach(_=>_()),m}}class f{constructor(){this.listening=!1,this.inputEvent=W.None,this.inputEventListener=re.JT.None,this.emitter=new s({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(o){this.inputEvent=o,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=o(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(qt,$e,ae){"use strict";ae.d($e,{I:function(){return te}});function te(re){const X=this;let D=!1,W;return function(){return D||(D=!0,W=re.apply(X,arguments)),W}}},88226:function(qt,$e,ae){"use strict";ae.d($e,{$:function(){return te}});var te;(function(re){function X(v){return v&&typeof v=="object"&&typeof v[Symbol.iterator]=="function"}re.is=X;const D=Object.freeze([]);function W(){return D}re.empty=W;function*y(v){yield v}re.single=y;function L(v){return v||D}re.from=L;function A(v){return!v||v[Symbol.iterator]().next().done===!0}re.isEmpty=A;function s(v){return v[Symbol.iterator]().next().value}re.first=s;function x(v,r){for(const a of v)if(r(a))return!0;return!1}re.some=x;function c(v,r){for(const a of v)if(r(a))return a}re.find=c;function*u(v,r){for(const a of v)r(a)&&(yield a)}re.filter=u;function*f(v,r){let a=0;for(const p of v)yield r(p,a++)}re.map=f;function*i(...v){for(const r of v)for(const a of r)yield a}re.concat=i;function*o(v){for(const r of v)for(const a of r)yield a}re.concatNested=o;function d(v,r,a){let p=a;for(const E of v)p=r(p,E);return p}re.reduce=d;function*m(v,r,a=v.length){for(r<0&&(r+=v.length),a<0?a+=v.length:a>v.length&&(a=v.length);r<a;r++)yield v[r]}re.slice=m;function _(v,r=Number.POSITIVE_INFINITY){const a=[];if(r===0)return[a,v];const p=v[Symbol.iterator]();for(let E=0;E<r;E++){const S=p.next();if(S.done)return[a,re.empty()];a.push(S.value)}return[a,{[Symbol.iterator](){return p}}]}re.consume=_;function h(v,r,a=(p,E)=>p===E){const p=v[Symbol.iterator](),E=r[Symbol.iterator]();for(;;){const S=p.next(),w=E.next();if(S.done!==w.done)return!1;if(S.done)return!0;if(!a(S.value,w.value))return!1}}re.equals=h})(te||(te={}))},69323:function(qt,$e,ae){"use strict";ae.d($e,{B9:function(){return f},F8:function(){return i},JT:function(){return m},Jz:function(){return h},OF:function(){return o},SL:function(){return d},Wf:function(){return u},XK:function(){return _},dk:function(){return x}});var te=ae(17845),re=ae(88226);const X=!1;let D=null;function W(v){D=v}if(X){const v="__is_disposable_tracked__";W(new class{trackDisposable(r){const a=new Error("Potentially leaked disposable").stack;setTimeout(()=>{r[v]||console.log(a)},3e3)}setParent(r,a){if(r&&r!==m.None)try{r[v]=!0}catch(p){}}markAsDisposed(r){if(r&&r!==m.None)try{r[v]=!0}catch(a){}}markAsSingleton(r){}})}function y(v){return D==null||D.trackDisposable(v),v}function L(v){D==null||D.markAsDisposed(v)}function A(v,r){D==null||D.setParent(v,r)}function s(v,r){if(D)for(const a of v)D.setParent(a,r)}function x(v){return D==null||D.markAsSingleton(v),v}class c extends Error{constructor(r){super(`Encountered errors while disposing of store. Errors: [${r.join(", ")}]`),this.errors=r}}function u(v){return typeof v.dispose=="function"&&v.dispose.length===0}function f(v){if(re.$.is(v)){let r=[];for(const a of v)if(a)try{a.dispose()}catch(p){r.push(p)}if(r.length===1)throw r[0];if(r.length>1)throw new c(r);return Array.isArray(v)?[]:v}else if(v)return v.dispose(),v}function i(...v){const r=o(()=>f(v));return s(v,r),r}function o(v){const r=y({dispose:(0,te.I)(()=>{L(r),v()})});return r}class d{constructor(){this._toDispose=new Set,this._isDisposed=!1,y(this)}dispose(){this._isDisposed||(L(this),this._isDisposed=!0,this.clear())}clear(){try{f(this._toDispose.values())}finally{this._toDispose.clear()}}add(r){if(!r)return r;if(r===this)throw new Error("Cannot register a disposable on itself!");return A(r,this),this._isDisposed?d.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(r),r}}d.DISABLE_DISPOSED_WARNING=!1;class m{constructor(){this._store=new d,y(this),A(this._store,this)}dispose(){L(this),this._store.dispose()}_register(r){if(r===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(r)}}m.None=Object.freeze({dispose(){}});class _{constructor(){this._isDisposed=!1,y(this)}get value(){return this._isDisposed?void 0:this._value}set value(r){var a;this._isDisposed||r===this._value||((a=this._value)===null||a===void 0||a.dispose(),r&&A(r,this),this._value=r)}clear(){this.value=void 0}dispose(){var r;this._isDisposed=!0,L(this),(r=this._value)===null||r===void 0||r.dispose(),this._value=void 0}clearAndLeak(){const r=this._value;return this._value=void 0,r&&A(r,null),r}}class h{constructor(r){this.object=r}dispose(){}}},34502:function(qt,$e,ae){"use strict";ae.d($e,{S:function(){return re}});class te{constructor(D){this.element=D,this.next=te.Undefined,this.prev=te.Undefined}}te.Undefined=new te(void 0);class re{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let D=this._first;for(;D!==te.Undefined;){const W=D.next;D.prev=te.Undefined,D.next=te.Undefined,D=W}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(D){return this._insert(D,!1)}push(D){return this._insert(D,!0)}_insert(D,W){const y=new te(D);if(this._first===te.Undefined)this._first=y,this._last=y;else if(W){const A=this._last;this._last=y,y.prev=A,A.next=y}else{const A=this._first;this._first=y,y.next=A,A.prev=y}this._size+=1;let L=!1;return()=>{L||(L=!0,this._remove(y))}}shift(){if(this._first!==te.Undefined){const D=this._first.element;return this._remove(this._first),D}}pop(){if(this._last!==te.Undefined){const D=this._last.element;return this._remove(this._last),D}}_remove(D){if(D.prev!==te.Undefined&&D.next!==te.Undefined){const W=D.prev;W.next=D.next,D.next.prev=W}else D.prev===te.Undefined&&D.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):D.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):D.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let D=this._first;for(;D!==te.Undefined;)yield D.element,D=D.next}}},23345:function(qt,$e,ae){"use strict";ae.d($e,{$L:function(){return p},ED:function(){return h},IJ:function(){return r},OS:function(){return R},WE:function(){return S},dz:function(){return v},gn:function(){return E},li:function(){return o},r:function(){return N},tY:function(){return a},xS:function(){return w}});var te=ae(97671),re;const X="en";let D=!1,W=!1,y=!1,L=!1,A=!1,s=!1,x=!1,c,u=null,f=null,i;const o=typeof self=="object"?self:typeof ae.g=="object"?ae.g:{};let d;typeof o.vscode!="undefined"&&typeof o.vscode.process!="undefined"?d=o.vscode.process:typeof te!="undefined"&&(d=te);const m=typeof((re=d==null?void 0:d.versions)===null||re===void 0?void 0:re.electron)=="string"&&d.type==="renderer";if(typeof navigator=="object"&&!m)i=navigator.userAgent,D=i.indexOf("Windows")>=0,W=i.indexOf("Macintosh")>=0,x=(i.indexOf("Macintosh")>=0||i.indexOf("iPad")>=0||i.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,y=i.indexOf("Linux")>=0,s=!0,c=navigator.language,u=c;else if(typeof d=="object"){D=d.platform==="win32",W=d.platform==="darwin",y=d.platform==="linux",L=y&&!!d.env.SNAP&&!!d.env.SNAP_REVISION,c=X,u=X;const P=d.env.VSCODE_NLS_CONFIG;if(P)try{const F=JSON.parse(P),K=F.availableLanguages["*"];c=F.locale,u=K||X,f=F._translationsConfigFile}catch(F){}A=!0}else console.error("Unable to resolve platform.");let _=0;W?_=1:D?_=3:y&&(_=2);const h=D,v=W,r=y,a=A,p=s,E=x,S=i,w=function(){if(o.setImmediate)return o.setImmediate.bind(o);if(typeof o.postMessage=="function"&&!o.importScripts){let K=[];o.addEventListener("message",V=>{if(V.data&&V.data.vscodeSetImmediateId)for(let C=0,M=K.length;C<M;C++){const H=K[C];if(H.id===V.data.vscodeSetImmediateId){K.splice(C,1),H.callback();return}}});let B=0;return V=>{const C=++B;K.push({id:C,callback:V}),o.postMessage({vscodeSetImmediateId:C},"*")}}if(typeof(d==null?void 0:d.nextTick)=="function")return d.nextTick.bind(d);const F=Promise.resolve();return K=>F.then(K)}(),R=W||x?2:D?1:3;let O=!0,z=!1;function N(){if(!z){z=!0;const P=new Uint8Array(2);P[0]=1,P[1]=2,O=new Uint16Array(P.buffer)[0]===513}return O}},95830:function(qt,$e,ae){"use strict";ae.d($e,{G:function(){return X}});var te=ae(23345);const re=te.li.performance&&typeof te.li.performance.now=="function";class X{constructor(W){this._highResolution=re&&W,this._startTime=this._now(),this._stopTime=-1}static create(W=!0){return new X(W)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?te.li.performance.now():Date.now()}}},82983:function(qt,$e,ae){"use strict";ae.d($e,{$i:function(){return q},C8:function(){return De},GF:function(){return c},HO:function(){return B},IO:function(){return u},K7:function(){return xe},Kw:function(){return Ae},LC:function(){return o},Mh:function(){return w},P1:function(){return R},PJ:function(){return We},Qe:function(){return se},R1:function(){return x},RP:function(){return H},S6:function(){return we},TT:function(){return h},Ut:function(){return C},V8:function(){return d},WU:function(){return X},YK:function(){return z},YU:function(){return D},ZG:function(){return O},ZH:function(){return P},ab:function(){return ue},c1:function(){return Ue},df:function(){return p},ec:function(){return W},fi:function(){return Se},fy:function(){return y},j3:function(){return L},j_:function(){return r},m5:function(){return te},mK:function(){return a},mr:function(){return f},oH:function(){return ve},oL:function(){return A},ok:function(){return S},ow:function(){return m},qq:function(){return E},qu:function(){return _},rL:function(){return N},uS:function(){return Ge},un:function(){return s},uq:function(){return i},vH:function(){return K},xe:function(){return pe},zY:function(){return v}});function te(oe){return!oe||typeof oe!="string"?!0:oe.trim().length===0}const re=/{(\d+)}/g;function X(oe,...ie){return ie.length===0?oe:oe.replace(re,function(fe,ye){const he=parseInt(ye,10);return isNaN(he)||he<0||he>=ie.length?fe:ie[he]})}function D(oe){return oe.replace(/[<>&]/g,function(ie){switch(ie){case"<":return"<";case">":return">";case"&":return"&";default:return ie}})}function W(oe){return oe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function y(oe,ie=" "){const fe=L(oe,ie);return A(fe,ie)}function L(oe,ie){if(!oe||!ie)return oe;const fe=ie.length;if(fe===0||oe.length===0)return oe;let ye=0;for(;oe.indexOf(ie,ye)===ye;)ye=ye+fe;return oe.substring(ye)}function A(oe,ie){if(!oe||!ie)return oe;const fe=ie.length,ye=oe.length;if(fe===0||ye===0)return oe;let he=ye,Te=-1;for(;Te=oe.lastIndexOf(ie,he-1),!(Te===-1||Te+fe!==he);){if(Te===0)return"";he=Te}return oe.substring(0,he)}function s(oe){return oe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function x(oe){return oe.replace(/\*/g,"")}function c(oe,ie,fe={}){if(!oe)throw new Error("Cannot create regex from empty string");ie||(oe=W(oe)),fe.wholeWord&&(/\B/.test(oe.charAt(0))||(oe="\\b"+oe),/\B/.test(oe.charAt(oe.length-1))||(oe=oe+"\\b"));let ye="";return fe.global&&(ye+="g"),fe.matchCase||(ye+="i"),fe.multiline&&(ye+="m"),fe.unicode&&(ye+="u"),new RegExp(oe,ye)}function u(oe){return oe.source==="^"||oe.source==="^$"||oe.source==="$"||oe.source==="^\\s*$"?!1:!!(oe.exec("")&&oe.lastIndex===0)}function f(oe){return(oe.global?"g":"")+(oe.ignoreCase?"i":"")+(oe.multiline?"m":"")+(oe.unicode?"u":"")}function i(oe){return oe.split(/\r\n|\r|\n/)}function o(oe){for(let ie=0,fe=oe.length;ie<fe;ie++){const ye=oe.charCodeAt(ie);if(ye!==32&&ye!==9)return ie}return-1}function d(oe,ie=0,fe=oe.length){for(let ye=ie;ye<fe;ye++){const he=oe.charCodeAt(ye);if(he!==32&&he!==9)return oe.substring(ie,ye)}return oe.substring(ie,fe)}function m(oe,ie=oe.length-1){for(let fe=ie;fe>=0;fe--){const ye=oe.charCodeAt(fe);if(ye!==32&&ye!==9)return fe}return-1}function _(oe,ie){return oe<ie?-1:oe>ie?1:0}function h(oe,ie,fe=0,ye=oe.length,he=0,Te=ie.length){for(;fe<ye&&he<Te;fe++,he++){let Ze=oe.charCodeAt(fe),tt=ie.charCodeAt(he);if(Ze<tt)return-1;if(Ze>tt)return 1}const Oe=ye-fe,Be=Te-he;return Oe<Be?-1:Oe>Be?1:0}function v(oe,ie){return r(oe,ie,0,oe.length,0,ie.length)}function r(oe,ie,fe=0,ye=oe.length,he=0,Te=ie.length){for(;fe<ye&&he<Te;fe++,he++){let Ze=oe.charCodeAt(fe),tt=ie.charCodeAt(he);if(Ze===tt)continue;if(Ze>=128||tt>=128)return h(oe.toLowerCase(),ie.toLowerCase(),fe,ye,he,Te);a(Ze)&&(Ze-=32),a(tt)&&(tt-=32);const dt=Ze-tt;if(dt!==0)return dt}const Oe=ye-fe,Be=Te-he;return Oe<Be?-1:Oe>Be?1:0}function a(oe){return oe>=97&&oe<=122}function p(oe){return oe>=65&&oe<=90}function E(oe,ie){return oe.length===ie.length&&r(oe,ie)===0}function S(oe,ie){const fe=ie.length;return ie.length>oe.length?!1:r(oe,ie,0,fe)===0}function w(oe,ie){let fe,ye=Math.min(oe.length,ie.length);for(fe=0;fe<ye;fe++)if(oe.charCodeAt(fe)!==ie.charCodeAt(fe))return fe;return ye}function R(oe,ie){let fe,ye=Math.min(oe.length,ie.length);const he=oe.length-1,Te=ie.length-1;for(fe=0;fe<ye;fe++)if(oe.charCodeAt(he-fe)!==ie.charCodeAt(Te-fe))return fe;return ye}function O(oe){return 55296<=oe&&oe<=56319}function z(oe){return 56320<=oe&&oe<=57343}function N(oe,ie){return(oe-55296<<10)+(ie-56320)+65536}function P(oe,ie,fe){const ye=oe.charCodeAt(fe);if(O(ye)&&fe+1<ie){const he=oe.charCodeAt(fe+1);if(z(he))return N(ye,he)}return ye}function F(oe,ie){const fe=oe.charCodeAt(ie-1);if(z(fe)&&ie>1){const ye=oe.charCodeAt(ie-2);if(O(ye))return N(ye,fe)}return fe}function K(oe,ie){const fe=ge.getInstance(),ye=ie,he=oe.length,Te=P(oe,he,ie);ie+=Te>=65536?2:1;let Oe=fe.getGraphemeBreakType(Te);for(;ie<he;){const Be=P(oe,he,ie),Ze=fe.getGraphemeBreakType(Be);if(Se(Oe,Ze))break;ie+=Be>=65536?2:1,Oe=Ze}return ie-ye}function B(oe,ie){const fe=ge.getInstance(),ye=ie,he=F(oe,ie);ie-=he>=65536?2:1;let Te=fe.getGraphemeBreakType(he);for(;ie>0;){const Oe=F(oe,ie),Be=fe.getGraphemeBreakType(Oe);if(Se(Be,Te))break;ie-=Oe>=65536?2:1,Te=Be}return ye-ie}const V=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function C(oe){return V.test(oe)}const M=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function H(oe){return M.test(oe)}const $=/^[\t\n\r\x20-\x7E]*$/;function q(oe){return $.test(oe)}const se=/[\u2028\u2029]/;function ue(oe){return se.test(oe)}function pe(oe){for(let ie=0,fe=oe.length;ie<fe;ie++)if(xe(oe.charCodeAt(ie)))return!0;return!1}function xe(oe){return oe=+oe,oe>=11904&&oe<=55215||oe>=63744&&oe<=64255||oe>=65281&&oe<=65374}function De(oe){return oe>=127462&&oe<=127487||oe===8986||oe===8987||oe===9200||oe===9203||oe>=9728&&oe<=10175||oe===11088||oe===11093||oe>=127744&&oe<=128591||oe>=128640&&oe<=128764||oe>=128992&&oe<=129003||oe>=129280&&oe<=129535||oe>=129648&&oe<=129750}const Ue="\uFEFF";function Ge(oe){return!!(oe&&oe.length>0&&oe.charCodeAt(0)===65279)}function Ae(oe,ie=!1){return oe?(ie&&(oe=oe.replace(/\\./g,"")),oe.toLowerCase()!==oe):!1}function We(oe){return oe=oe%(2*26),oe<26?String.fromCharCode(97+oe):String.fromCharCode(65+oe-26)}function we(oe){return ge.getInstance().getGraphemeBreakType(oe)}function Se(oe,ie){return oe===0?ie!==5&&ie!==7:oe===2&&ie===3?!1:oe===4||oe===2||oe===3||ie===4||ie===2||ie===3?!0:!(oe===8&&(ie===8||ie===9||ie===11||ie===12)||(oe===11||oe===9)&&(ie===9||ie===10)||(oe===12||oe===10)&&ie===10||ie===5||ie===13||ie===7||oe===1||oe===13&&ie===14||oe===6&&ie===6)}class ge{constructor(){this._data=Re()}static getInstance(){return ge._INSTANCE||(ge._INSTANCE=new ge),ge._INSTANCE}getGraphemeBreakType(ie){if(ie<32)return ie===10?3:ie===13?2:4;if(ie<127)return 0;const fe=this._data,ye=fe.length/3;let he=1;for(;he<=ye;)if(ie<fe[3*he])he=2*he;else if(ie>fe[3*he+1])he=2*he+1;else return fe[3*he+2];return 0}}ge._INSTANCE=null;function Re(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function ve(oe,ie){if(oe===0)return 0;const fe=Le(oe,ie);if(fe!==void 0)return fe;const ye=F(ie,oe);return oe-=Fe(ye),oe}function Le(oe,ie){let fe=F(ie,oe);for(oe-=Fe(fe);me(fe)||fe===65039||fe===8419;){if(oe===0)return;fe=F(ie,oe),oe-=Fe(fe)}if(De(fe)){if(oe>=0){const ye=F(ie,oe);ye===8205&&(oe-=Fe(ye))}return oe}}function Fe(oe){return oe>=65536?2:1}function me(oe){return 127995<=oe&&oe<=127999}},72999:function(qt,$e,ae){"use strict";ae.d($e,{$E:function(){return o},$K:function(){return L},D8:function(){return u},HD:function(){return re},IU:function(){return d},Jp:function(){return A},Kn:function(){return X},cW:function(){return x},f6:function(){return m},hj:function(){return D},jn:function(){return W},kJ:function(){return te},mf:function(){return c},o8:function(){return y},p_:function(){return s},vE:function(){return _}});function te(h){return Array.isArray(h)}function re(h){return typeof h=="string"}function X(h){return typeof h=="object"&&h!==null&&!Array.isArray(h)&&!(h instanceof RegExp)&&!(h instanceof Date)}function D(h){return typeof h=="number"&&!isNaN(h)}function W(h){return h===!0||h===!1}function y(h){return typeof h=="undefined"}function L(h){return!A(h)}function A(h){return y(h)||h===null}function s(h,v){if(!h)throw new Error(v?`Unexpected type, expected '${v}'`:"Unexpected type")}function x(h){if(A(h))throw new Error("Assertion Failed: argument is undefined or null");return h}function c(h){return typeof h=="function"}function u(h,v){const r=Math.min(h.length,v.length);for(let a=0;a<r;a++)f(h[a],v[a])}function f(h,v){if(re(v)){if(typeof h!==v)throw new Error(`argument does not match constraint: typeof ${v}`)}else if(c(v)){try{if(h instanceof v)return}catch(r){}if(!A(h)&&h.constructor===v||v.length===1&&v.call(void 0,h)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function i(h){let v=[],r=Object.getPrototypeOf(h);for(;Object.prototype!==r;)v=v.concat(Object.getOwnPropertyNames(r)),r=Object.getPrototypeOf(r);return v}function o(h){const v=[];for(const r of i(h))typeof h[r]=="function"&&v.push(r);return v}function d(h,v){const r=p=>function(){const E=Array.prototype.slice.call(arguments,0);return v(p,E)};let a={};for(const p of h)a[p]=r(p);return a}function m(h){return h===null?void 0:h}function _(h,v="Unreachable"){throw new Error(v)}},13268:function(qt,$e,ae){"use strict";ae.d($e,{N:function(){return re}});function te(X,D){let W;return D.length===0?W=X:W=X.replace(/\{(\d+)\}/g,function(y,L){const A=L[0];return typeof D[A]!="undefined"?D[A]:y}),W}function re(X,D,...W){return te(D,W)}},96236:function(qt,$e,ae){"use strict";ae.d($e,{BH:function(){return d},NZ:function(){return m},U8:function(){return _},co:function(){return o},eH:function(){return i},vr:function(){return f}});var te=ae(75918),re=ae(52615),X=ae(4348),D=ae(88226),W=ae(69323),y=ae(34502),L=ae(35884),A=ae(90689),s=ae(16925),x=ae(49055),c=function(h,v,r,a){var p=arguments.length,E=p<3?v:a===null?a=Object.getOwnPropertyDescriptor(v,r):a,S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(h,v,r,a);else for(var w=h.length-1;w>=0;w--)(S=h[w])&&(E=(p<3?S(E):p>3?S(v,r,E):S(v,r))||E);return p>3&&E&&Object.defineProperty(v,r,E),E},u=function(h,v){return function(r,a){v(r,a,h)}};function f(h){return h.command!==void 0}class i{constructor(v){this.id=i._idPool++,this._debugName=v}}i._idPool=0,i.CommandPalette=new i("CommandPalette"),i.EditorContext=new i("EditorContext"),i.SimpleEditorContext=new i("SimpleEditorContext"),i.EditorContextCopy=new i("EditorContextCopy"),i.EditorContextPeek=new i("EditorContextPeek"),i.MenubarEditMenu=new i("MenubarEditMenu"),i.MenubarCopy=new i("MenubarCopy"),i.MenubarGoMenu=new i("MenubarGoMenu"),i.MenubarSelectionMenu=new i("MenubarSelectionMenu"),i.InlineCompletionsActions=new i("InlineCompletionsActions");const o=(0,s.yh)("menuService"),d=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new X.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:h=>h===i.CommandPalette}}addCommand(h){return this.addCommands(D.$.single(h))}addCommands(h){for(const v of h)this._commands.set(v.id,v);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,W.OF)(()=>{let v=!1;for(const r of h)v=this._commands.delete(r.id)||v;v&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(h){return this._commands.get(h)}getCommands(){const h=new Map;return this._commands.forEach((v,r)=>h.set(r,v)),h}appendMenuItem(h,v){return this.appendMenuItems(D.$.single({id:h,item:v}))}appendMenuItems(h){const v=new Set,r=new y.S;for(const{id:a,item:p}of h){let E=this._menuItems.get(a);E||(E=new y.S,this._menuItems.set(a,E)),r.push(E.push(p)),v.add(a)}return this._onDidChangeMenu.fire(v),(0,W.OF)(()=>{if(r.size>0){for(let a of r)a();this._onDidChangeMenu.fire(v),r.clear()}})}getMenuItems(h){let v;return this._menuItems.has(h)?v=[...this._menuItems.get(h)]:v=[],h===i.CommandPalette&&this._appendImplicitItems(v),v}_appendImplicitItems(h){const v=new Set;for(const r of h)f(r)&&(v.add(r.command.id),r.alt&&v.add(r.alt.id));this._commands.forEach((r,a)=>{v.has(a)||h.push({command:r})})}};class m extends te.wY{constructor(v,r,a,p){super(`submenuitem.${v.submenu.id}`,typeof v.title=="string"?v.title:v.title.value,[],"submenu"),this.item=v,this._menuService=r,this._contextKeyService=a,this._options=p}get actions(){const v=[],r=this._menuService.createMenu(this.item.submenu,this._contextKeyService),a=r.getActions(this._options);r.dispose();for(const[,p]of a)p.length>0&&(v.push(...p),v.push(new te.Z0));return v.length&&v.pop(),v}}let _=class ml{constructor(v,r,a,p,E){var S,w;if(this._commandService=E,this.id=v.id,this.label=a!=null&&a.renderShortTitle&&v.shortTitle?typeof v.shortTitle=="string"?v.shortTitle:v.shortTitle.value:typeof v.title=="string"?v.title:v.title.value,this.tooltip=(w=typeof v.tooltip=="string"?v.tooltip:(S=v.tooltip)===null||S===void 0?void 0:S.value)!==null&&w!==void 0?w:"",this.enabled=!v.precondition||p.contextMatchesRules(v.precondition),this.checked=void 0,v.toggled){const R=v.toggled.condition?v.toggled:{condition:v.toggled};this.checked=p.contextMatchesRules(R.condition),this.checked&&R.tooltip&&(this.tooltip=typeof R.tooltip=="string"?R.tooltip:R.tooltip.value),R.title&&(this.label=typeof R.title=="string"?R.title:R.title.value)}this.item=v,this.alt=r?new ml(r,void 0,a,p,E):void 0,this._options=a,x.kS.isThemeIcon(v.icon)&&(this.class=re.dT.asClassName(v.icon))}dispose(){}run(...v){var r,a;let p=[];return!((r=this._options)===null||r===void 0)&&r.arg&&(p=[...p,this._options.arg]),!((a=this._options)===null||a===void 0)&&a.shouldForwardArgs&&(p=[...p,...v]),this._commandService.executeCommand(this.id,...p)}};_=c([u(3,A.i6),u(4,L.H)],_)},35884:function(qt,$e,ae){"use strict";ae.d($e,{H:function(){return L},P:function(){return A}});var te=ae(4348),re=ae(88226),X=ae(69323),D=ae(34502),W=ae(72999),y=ae(16925);const L=(0,y.yh)("commandService"),A=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new te.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(s,x){if(!s)throw new Error("invalid command");if(typeof s=="string"){if(!x)throw new Error("invalid command");return this.registerCommand({id:s,handler:x})}if(s.description){const o=[];for(let m of s.description.args)o.push(m.constraint);const d=s.handler;s.handler=function(m,..._){return(0,W.D8)(_,o),d(m,..._)}}const{id:c}=s;let u=this._commands.get(c);u||(u=new D.S,this._commands.set(c,u));let f=u.unshift(s),i=(0,X.OF)(()=>{f();const o=this._commands.get(c);o!=null&&o.isEmpty()&&this._commands.delete(c)});return this._onDidRegisterCommand.fire(c),i}registerCommandAlias(s,x){return A.registerCommand(s,(c,...u)=>c.get(L).executeCommand(x,...u))}getCommand(s){const x=this._commands.get(s);if(!(!x||x.isEmpty()))return re.$.first(x)}getCommands(){const s=new Map;for(const x of this._commands.keys()){const c=this.getCommand(x);c&&s.set(x,c)}return s}};A.registerCommand("noop",()=>{})},90689:function(qt,$e,ae){"use strict";ae.d($e,{Ao:function(){return L},Eq:function(){return N},Fb:function(){return A},K8:function(){return K},i6:function(){return z},uy:function(){return O}});var te=ae(23345),re=ae(82983),X=ae(16925);let D=te.WE||"";const W=new Map;W.set("false",!1),W.set("true",!0),W.set("isMac",te.dz),W.set("isLinux",te.IJ),W.set("isWindows",te.ED),W.set("isWeb",te.$L),W.set("isMacNative",te.dz&&!te.$L),W.set("isEdge",D.indexOf("Edg/")>=0),W.set("isFirefox",D.indexOf("Firefox")>=0),W.set("isChrome",D.indexOf("Chrome")>=0),W.set("isSafari",D.indexOf("Safari")>=0);const y=Object.prototype.hasOwnProperty;class L{static has(C){return u.create(C)}static equals(C,M){return f.create(C,M)}static regex(C,M){return p.create(C,M)}static not(C){return m.create(C)}static and(...C){return w.create(C,null)}static or(...C){return R.create(C,null,!0)}static deserialize(C,M=!1){if(C)return this._deserializeOrExpression(C,M)}static _deserializeOrExpression(C,M){let H=C.split("||");return R.create(H.map($=>this._deserializeAndExpression($,M)),null,!0)}static _deserializeAndExpression(C,M){let H=C.split("&&");return w.create(H.map($=>this._deserializeOne($,M)),null)}static _deserializeOne(C,M){if(C=C.trim(),C.indexOf("!=")>=0){let H=C.split("!=");return d.create(H[0].trim(),this._deserializeValue(H[1],M))}if(C.indexOf("==")>=0){let H=C.split("==");return f.create(H[0].trim(),this._deserializeValue(H[1],M))}if(C.indexOf("=~")>=0){let H=C.split("=~");return p.create(H[0].trim(),this._deserializeRegexValue(H[1],M))}if(C.indexOf(" in ")>=0){let H=C.split(" in ");return i.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(C)){const H=C.split(">=");return v.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(C)){const H=C.split(">");return h.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(C)){const H=C.split("<=");return a.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(C)){const H=C.split("<");return r.create(H[0].trim(),H[1].trim())}return/^\!\s*/.test(C)?m.create(C.substr(1).trim()):u.create(C)}static _deserializeValue(C,M){if(C=C.trim(),C==="true")return!0;if(C==="false")return!1;let H=/^'([^']*)'$/.exec(C);return H?H[1].trim():C}static _deserializeRegexValue(C,M){if((0,re.m5)(C)){if(M)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let H=C.indexOf("/"),$=C.lastIndexOf("/");if(H===$||H<0){if(M)throw new Error(`bad regexp-value '${C}', missing /-enclosure`);return console.warn(`bad regexp-value '${C}', missing /-enclosure`),null}let q=C.slice(H+1,$),se=C[$+1]==="i"?"i":"";try{return new RegExp(q,se)}catch(ue){if(M)throw new Error(`bad regexp-value '${C}', parse error: ${ue}`);return console.warn(`bad regexp-value '${C}', parse error: ${ue}`),null}}}function A(V,C){const M=V?V.substituteConstants():void 0,H=C?C.substituteConstants():void 0;return!M&&!H?!0:!M||!H?!1:M.equals(H)}function s(V,C){return V.cmp(C)}class x{constructor(){this.type=0}cmp(C){return this.type-C.type}equals(C){return C.type===this.type}substituteConstants(){return this}evaluate(C){return!1}serialize(){return"false"}keys(){return[]}negate(){return c.INSTANCE}}x.INSTANCE=new x;class c{constructor(){this.type=1}cmp(C){return this.type-C.type}equals(C){return C.type===this.type}substituteConstants(){return this}evaluate(C){return!0}serialize(){return"true"}keys(){return[]}negate(){return x.INSTANCE}}c.INSTANCE=new c;class u{constructor(C,M){this.key=C,this.negated=M,this.type=2}static create(C,M=null){const H=W.get(C);return typeof H=="boolean"?H?c.INSTANCE:x.INSTANCE:new u(C,M)}cmp(C){return C.type!==this.type?this.type-C.type:P(this.key,C.key)}equals(C){return C.type===this.type?this.key===C.key:!1}substituteConstants(){const C=W.get(this.key);return typeof C=="boolean"?C?c.INSTANCE:x.INSTANCE:this}evaluate(C){return!!C.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this)),this.negated}}class f{constructor(C,M,H){this.key=C,this.value=M,this.negated=H,this.type=4}static create(C,M,H=null){if(typeof M=="boolean")return M?u.create(C,H):m.create(C,H);const $=W.get(C);return typeof $=="boolean"?M===($?"true":"false")?c.INSTANCE:x.INSTANCE:new f(C,M,H)}cmp(C){return C.type!==this.type?this.type-C.type:F(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){const C=W.get(this.key);if(typeof C=="boolean"){const M=C?"true":"false";return this.value===M?c.INSTANCE:x.INSTANCE}return this}evaluate(C){return C.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this.value,this)),this.negated}}class i{constructor(C,M){this.key=C,this.valueKey=M,this.type=10,this.negated=null}static create(C,M){return new i(C,M)}cmp(C){return C.type!==this.type?this.type-C.type:F(this.key,this.valueKey,C.key,C.valueKey)}equals(C){return C.type===this.type?this.key===C.key&&this.valueKey===C.valueKey:!1}substituteConstants(){return this}evaluate(C){const M=C.getValue(this.valueKey),H=C.getValue(this.key);return Array.isArray(M)?M.indexOf(H)>=0:typeof H=="string"&&typeof M=="object"&&M!==null?y.call(M,H):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=o.create(this)),this.negated}}class o{constructor(C){this._actual=C,this.type=11}static create(C){return new o(C)}cmp(C){return C.type!==this.type?this.type-C.type:this._actual.cmp(C._actual)}equals(C){return C.type===this.type?this._actual.equals(C._actual):!1}substituteConstants(){return this}evaluate(C){return!this._actual.evaluate(C)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class d{constructor(C,M,H){this.key=C,this.value=M,this.negated=H,this.type=5}static create(C,M,H=null){if(typeof M=="boolean")return M?m.create(C,H):u.create(C,H);const $=W.get(C);return typeof $=="boolean"?M===($?"true":"false")?x.INSTANCE:c.INSTANCE:new d(C,M,H)}cmp(C){return C.type!==this.type?this.type-C.type:F(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){const C=W.get(this.key);if(typeof C=="boolean"){const M=C?"true":"false";return this.value===M?x.INSTANCE:c.INSTANCE}return this}evaluate(C){return C.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this.value,this)),this.negated}}class m{constructor(C,M){this.key=C,this.negated=M,this.type=3}static create(C,M=null){const H=W.get(C);return typeof H=="boolean"?H?x.INSTANCE:c.INSTANCE:new m(C,M)}cmp(C){return C.type!==this.type?this.type-C.type:P(this.key,C.key)}equals(C){return C.type===this.type?this.key===C.key:!1}substituteConstants(){const C=W.get(this.key);return typeof C=="boolean"?C?x.INSTANCE:c.INSTANCE:this}evaluate(C){return!C.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this)),this.negated}}function _(V,C){if(typeof V=="string"){const M=parseFloat(V);isNaN(M)||(V=M)}return typeof V=="string"||typeof V=="number"?C(V):x.INSTANCE}class h{constructor(C,M,H){this.key=C,this.value=M,this.negated=H,this.type=12}static create(C,M,H=null){return _(M,$=>new h(C,$,H))}cmp(C){return C.type!==this.type?this.type-C.type:F(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=a.create(this.key,this.value,this)),this.negated}}class v{constructor(C,M,H){this.key=C,this.value=M,this.negated=H,this.type=13}static create(C,M,H=null){return _(M,$=>new v(C,$,H))}cmp(C){return C.type!==this.type?this.type-C.type:F(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=r.create(this.key,this.value,this)),this.negated}}class r{constructor(C,M,H){this.key=C,this.value=M,this.negated=H,this.type=14}static create(C,M,H=null){return _(M,$=>new r(C,$,H))}cmp(C){return C.type!==this.type?this.type-C.type:F(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=v.create(this.key,this.value,this)),this.negated}}class a{constructor(C,M,H){this.key=C,this.value=M,this.negated=H,this.type=15}static create(C,M,H=null){return _(M,$=>new a(C,$,H))}cmp(C){return C.type!==this.type?this.type-C.type:F(this.key,this.value,C.key,C.value)}equals(C){return C.type===this.type?this.key===C.key&&this.value===C.value:!1}substituteConstants(){return this}evaluate(C){return typeof this.value=="string"?!1:parseFloat(C.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.create(this.key,this.value,this)),this.negated}}class p{constructor(C,M){this.key=C,this.regexp=M,this.type=7,this.negated=null}static create(C,M){return new p(C,M)}cmp(C){if(C.type!==this.type)return this.type-C.type;if(this.key<C.key)return-1;if(this.key>C.key)return 1;const M=this.regexp?this.regexp.source:"",H=C.regexp?C.regexp.source:"";return M<H?-1:M>H?1:0}equals(C){if(C.type===this.type){const M=this.regexp?this.regexp.source:"",H=C.regexp?C.regexp.source:"";return this.key===C.key&&M===H}return!1}substituteConstants(){return this}evaluate(C){let M=C.getValue(this.key);return this.regexp?this.regexp.test(M):!1}serialize(){const C=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${C}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this)),this.negated}}class E{constructor(C){this._actual=C,this.type=8}static create(C){return new E(C)}cmp(C){return C.type!==this.type?this.type-C.type:this._actual.cmp(C._actual)}equals(C){return C.type===this.type?this._actual.equals(C._actual):!1}substituteConstants(){return this}evaluate(C){return!this._actual.evaluate(C)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function S(V){let C=null;for(let M=0,H=V.length;M<H;M++){const $=V[M].substituteConstants();if(V[M]!==$&&C===null){C=[];for(let q=0;q<M;q++)C[q]=V[q]}C!==null&&(C[M]=$)}return C===null?V:C}class w{constructor(C,M){this.expr=C,this.negated=M,this.type=6}static create(C,M){return w._normalizeArr(C,M)}cmp(C){if(C.type!==this.type)return this.type-C.type;if(this.expr.length<C.expr.length)return-1;if(this.expr.length>C.expr.length)return 1;for(let M=0,H=this.expr.length;M<H;M++){const $=s(this.expr[M],C.expr[M]);if($!==0)return $}return 0}equals(C){if(C.type===this.type){if(this.expr.length!==C.expr.length)return!1;for(let M=0,H=this.expr.length;M<H;M++)if(!this.expr[M].equals(C.expr[M]))return!1;return!0}return!1}substituteConstants(){const C=S(this.expr);return C===this.expr?this:w.create(C,this.negated)}evaluate(C){for(let M=0,H=this.expr.length;M<H;M++)if(!this.expr[M].evaluate(C))return!1;return!0}static _normalizeArr(C,M){const H=[];let $=!1;for(const q of C)if(q){if(q.type===1){$=!0;continue}if(q.type===0)return x.INSTANCE;if(q.type===6){H.push(...q.expr);continue}H.push(q)}if(H.length===0&&$)return c.INSTANCE;if(H.length!==0){if(H.length===1)return H[0];H.sort(s);for(let q=1;q<H.length;q++)H[q-1].equals(H[q])&&(H.splice(q,1),q--);if(H.length===1)return H[0];for(;H.length>1;){const q=H[H.length-1];if(q.type!==9)break;H.pop();const se=H.pop(),ue=H.length===0,pe=R.create(q.expr.map(xe=>w.create([xe,se],null)),null,ue);pe&&(H.push(pe),H.sort(s))}return H.length===1?H[0]:new w(H,M)}}serialize(){return this.expr.map(C=>C.serialize()).join(" && ")}keys(){const C=[];for(let M of this.expr)C.push(...M.keys());return C}negate(){if(!this.negated){const C=[];for(let M of this.expr)C.push(M.negate());this.negated=R.create(C,this,!0)}return this.negated}}class R{constructor(C,M){this.expr=C,this.negated=M,this.type=9}static create(C,M,H){return R._normalizeArr(C,M,H)}cmp(C){if(C.type!==this.type)return this.type-C.type;if(this.expr.length<C.expr.length)return-1;if(this.expr.length>C.expr.length)return 1;for(let M=0,H=this.expr.length;M<H;M++){const $=s(this.expr[M],C.expr[M]);if($!==0)return $}return 0}equals(C){if(C.type===this.type){if(this.expr.length!==C.expr.length)return!1;for(let M=0,H=this.expr.length;M<H;M++)if(!this.expr[M].equals(C.expr[M]))return!1;return!0}return!1}substituteConstants(){const C=S(this.expr);return C===this.expr?this:R.create(C,this.negated,!1)}evaluate(C){for(let M=0,H=this.expr.length;M<H;M++)if(this.expr[M].evaluate(C))return!0;return!1}static _normalizeArr(C,M,H){let $=[],q=!1;if(C){for(let se=0,ue=C.length;se<ue;se++){const pe=C[se];if(pe){if(pe.type===0){q=!0;continue}if(pe.type===1)return c.INSTANCE;if(pe.type===9){$=$.concat(pe.expr);continue}$.push(pe)}}if($.length===0&&q)return x.INSTANCE;$.sort(s)}if($.length!==0){if($.length===1)return $[0];for(let se=1;se<$.length;se++)$[se-1].equals($[se])&&($.splice(se,1),se--);if($.length===1)return $[0];if(H){for(let se=0;se<$.length;se++)for(let ue=se+1;ue<$.length;ue++)K($[se],$[ue])&&($.splice(ue,1),ue--);if($.length===1)return $[0]}return new R($,M)}}serialize(){return this.expr.map(C=>C.serialize()).join(" || ")}keys(){const C=[];for(let M of this.expr)C.push(...M.keys());return C}negate(){if(!this.negated){let C=[];for(let M of this.expr)C.push(M.negate());for(;C.length>1;){const M=C.shift(),H=C.shift(),$=[];for(const se of B(M))for(const ue of B(H))$.push(w.create([se,ue],null));const q=C.length===0;C.unshift(R.create($,null,q))}this.negated=C[0]}return this.negated}}class O extends u{constructor(C,M,H){super(C,null),this._defaultValue=M,typeof H=="object"?O._info.push(Object.assign(Object.assign({},H),{key:C})):H!==!0&&O._info.push({key:C,description:H,type:M!=null?typeof M:void 0})}static all(){return O._info.values()}bindTo(C){return C.createKey(this.key,this._defaultValue)}getValue(C){return C.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(C){return f.create(this.key,C)}}O._info=[];const z=(0,X.yh)("contextKeyService"),N="setContext";function P(V,C){return V<C?-1:V>C?1:0}function F(V,C,M,H){return V<M?-1:V>M?1:C<H?-1:C>H?1:0}function K(V,C){if(C.type===6&&V.type!==9&&V.type!==6){for(const $ of C.expr)if(V.equals($))return!0}const M=V.negate(),H=B(M).concat(B(C));H.sort(s);for(let $=0;$<H.length;$++){const se=H[$].negate();for(let ue=$+1;ue<H.length;ue++){const pe=H[ue];if(se.equals(pe))return!0}}return!1}function B(V){return V.type===9?V.expr:[V]}},16925:function(qt,$e,ae){"use strict";ae.d($e,{I8:function(){return te},TG:function(){return re},jt:function(){return W},yh:function(){return D}});var te;(function(y){y.serviceIds=new Map,y.DI_TARGET="$di$target",y.DI_DEPENDENCIES="$di$dependencies";function L(A){return A[y.DI_DEPENDENCIES]||[]}y.getServiceDependencies=L})(te||(te={}));const re=D("instantiationService");function X(y,L,A,s){L[te.DI_TARGET]===L?L[te.DI_DEPENDENCIES].push({id:y,index:A,optional:s}):(L[te.DI_DEPENDENCIES]=[{id:y,index:A,optional:s}],L[te.DI_TARGET]=L)}function D(y){if(te.serviceIds.has(y))return te.serviceIds.get(y);const L=function(A,s,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");X(L,A,x,!1)};return L.toString=()=>y,te.serviceIds.set(y,L),L}function W(y){return function(L,A,s){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");X(y,L,s,!0)}}},44650:function(qt,$e,ae){"use strict";ae.d($e,{B:function(){return D}});var te=ae(76068),re=ae(72999);class X{constructor(){this.data=new Map}add(y,L){te.ok(re.HD(y)),te.ok(re.Kn(L)),te.ok(!this.data.has(y),"There is already an extension with this id"),this.data.set(y,L)}as(y){return this.data.get(y)||null}}const D=new X},66213:function(qt,$e,ae){"use strict";ae.d($e,{e:function(){return te}});var te;(function(re){re.DARK="dark",re.LIGHT="light",re.HIGH_CONTRAST="hc"})(te||(te={}))},49055:function(qt,$e,ae){"use strict";ae.d($e,{EN:function(){return s},IP:function(){return u},Ic:function(){return o},XE:function(){return L},bB:function(){return d},kS:function(){return x},m6:function(){return c}});var te=ae(52615),re=ae(4348),X=ae(69323),D=ae(16925),W=ae(44650),y=ae(66213);const L=(0,D.yh)("themeService");var A;(function(m){function _(h){return h&&typeof h=="object"&&typeof h.id=="string"}m.isThemeColor=_})(A||(A={}));function s(m){return{id:m}}var x;(function(m){function _(E){return E&&typeof E=="object"&&typeof E.id=="string"&&(typeof E.color=="undefined"||A.isThemeColor(E.color))}m.isThemeIcon=_;const h=new RegExp(`^\\$\\((${te.dT.iconNameExpression}(?:${te.dT.iconModifierExpression})?)\\)$`);function v(E){const S=h.exec(E);if(!S)return;let[,w]=S;return{id:w}}m.fromString=v;function r(E,S){let w=E.id;const R=w.lastIndexOf("~");return R!==-1&&(w=w.substring(0,R)),S&&(w=`${w}~${S}`),{id:w}}m.modify=r;function a(E,S){var w,R;return E.id===S.id&&((w=E.color)===null||w===void 0?void 0:w.id)===((R=S.color)===null||R===void 0?void 0:R.id)}m.isEqual=a;function p(E,S){return{id:E.id,color:S?s(S):void 0}}m.asThemeIcon=p,m.asClassNameArray=te.dT.asClassNameArray,m.asClassName=te.dT.asClassName,m.asCSSSelector=te.dT.asCSSSelector})(x||(x={}));function c(m){switch(m){case y.e.DARK:return"vs-dark";case y.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const u={ThemingContribution:"base.contributions.theming"};class f{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new re.Q5}onColorThemeChange(_){return this.themingParticipants.push(_),this.onThemingParticipantAddedEmitter.fire(_),(0,X.OF)(()=>{const h=this.themingParticipants.indexOf(_);this.themingParticipants.splice(h,1)})}getThemingParticipants(){return this.themingParticipants}}let i=new f;W.B.add(u.ThemingContribution,i);function o(m){return i.onColorThemeChange(m)}class d extends X.JT{constructor(_){super(),this.themeService=_,this.theme=_.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(h=>this.onThemeChange(h)))}onThemeChange(_){this.theme=_,this.updateStyles()}updateStyles(){}}},96478:function(qt,$e,ae){"use strict";ae.d($e,{Z:function(){return E}});var te=ae(32855),re=ae(74430),X=ae(11913),D=ae(43079),W=ae(65030),y=ae(92310),L=ae.n(y),A=ae(8654),s=ae(59301),x=ae(10228),c=ae(16089),u=x.Z.ESC,f=x.Z.TAB;function i(S){var w=S.visible,R=S.triggerRef,O=S.onVisibleChange,z=S.autoFocus,N=S.overlayRef,P=s.useRef(!1),F=function(){if(w){var C,M;(C=R.current)===null||C===void 0||(M=C.focus)===null||M===void 0||M.call(C),O==null||O(!1)}},K=function(){var C;return(C=N.current)!==null&&C!==void 0&&C.focus?(N.current.focus(),P.current=!0,!0):!1},B=function(C){switch(C.keyCode){case u:F();break;case f:{var M=!1;P.current||(M=K()),M?C.preventDefault():F();break}}};s.useEffect(function(){return w?(window.addEventListener("keydown",B),z&&(0,c.Z)(K,3),function(){window.removeEventListener("keydown",B),P.current=!1}):function(){P.current=!1}},[w])}var o=(0,s.forwardRef)(function(S,w){var R=S.overlay,O=S.arrow,z=S.prefixCls,N=(0,s.useMemo)(function(){var F;return typeof R=="function"?F=R():F=R,F},[R]),P=(0,A.sQ)(w,(0,A.C4)(N));return s.createElement(s.Fragment,null,O&&s.createElement("div",{className:"".concat(z,"-arrow")}),s.cloneElement(N,{ref:(0,A.Yr)(N)?P:void 0}))}),d=o,m={adjustX:1,adjustY:1},_=[0,0],h={topLeft:{points:["bl","tl"],overflow:m,offset:[0,-4],targetOffset:_},top:{points:["bc","tc"],overflow:m,offset:[0,-4],targetOffset:_},topRight:{points:["br","tr"],overflow:m,offset:[0,-4],targetOffset:_},bottomLeft:{points:["tl","bl"],overflow:m,offset:[0,4],targetOffset:_},bottom:{points:["tc","bc"],overflow:m,offset:[0,4],targetOffset:_},bottomRight:{points:["tr","br"],overflow:m,offset:[0,4],targetOffset:_}},v=h,r=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function a(S,w){var R,O=S.arrow,z=O===void 0?!1:O,N=S.prefixCls,P=N===void 0?"rc-dropdown":N,F=S.transitionName,K=S.animation,B=S.align,V=S.placement,C=V===void 0?"bottomLeft":V,M=S.placements,H=M===void 0?v:M,$=S.getPopupContainer,q=S.showAction,se=S.hideAction,ue=S.overlayClassName,pe=S.overlayStyle,xe=S.visible,De=S.trigger,Ue=De===void 0?["hover"]:De,Ge=S.autoFocus,Ae=S.overlay,We=S.children,we=S.onVisibleChange,Se=(0,D.Z)(S,r),ge=s.useState(),Re=(0,X.Z)(ge,2),ve=Re[0],Le=Re[1],Fe="visible"in S?xe:ve,me=s.useRef(null),oe=s.useRef(null),ie=s.useRef(null);s.useImperativeHandle(w,function(){return me.current});var fe=function(nt){Le(nt),we==null||we(nt)};i({visible:Fe,triggerRef:ie,onVisibleChange:fe,autoFocus:Ge,overlayRef:oe});var ye=function(nt){var At=S.onOverlayClick;Le(!1),At&&At(nt)},he=function(){return s.createElement(d,{ref:oe,overlay:Ae,prefixCls:P,arrow:z})},Te=function(){return typeof Ae=="function"?he:he()},Oe=function(){var nt=S.minOverlayWidthMatchTrigger,At=S.alignPoint;return"minOverlayWidthMatchTrigger"in S?nt:!At},Be=function(){var nt=S.openClassName;return nt!==void 0?nt:"".concat(P,"-open")},Ze=s.cloneElement(We,{className:L()((R=We.props)===null||R===void 0?void 0:R.className,Fe&&Be()),ref:(0,A.Yr)(We)?(0,A.sQ)(ie,(0,A.C4)(We)):void 0}),tt=se;return!tt&&Ue.indexOf("contextMenu")!==-1&&(tt=["click"]),s.createElement(W.Z,(0,te.Z)({builtinPlacements:H},Se,{prefixCls:P,ref:me,popupClassName:L()(ue,(0,re.Z)({},"".concat(P,"-show-arrow"),z)),popupStyle:pe,action:Ue,showAction:q,hideAction:tt,popupPlacement:C,popupAlign:B,popupTransitionName:F,popupAnimation:K,popupVisible:Fe,stretch:Oe()?"minWidth":"",popup:Te(),onPopupVisibleChange:fe,onPopupClick:ye,getPopupContainer:$}),Ze)}var p=s.forwardRef(a),E=p},66003:function(qt,$e,ae){"use strict";ae.d($e,{Z:function(){return L}});var te=ae(43079),re=ae(27247),X=ae(34666),D=ae(59301),W=["show"];function y(A,s){if(!s.max)return!0;var x=s.strategy(A);return x<=s.max}function L(A,s){return D.useMemo(function(){var x={};s&&(x.show=(0,X.Z)(s)==="object"&&s.formatter?s.formatter:!!s),x=(0,re.Z)((0,re.Z)({},x),A);var c=x,u=c.show,f=(0,te.Z)(c,W);return(0,re.Z)((0,re.Z)({},f),{},{show:!!u,showFormatter:typeof u=="function"?u:void 0,strategy:f.strategy||function(i){return i.length}})},[A,s])}},36901:function(qt,$e,ae){"use strict";ae.r($e),ae.d($e,{BaseInput:function(){return x},default:function(){return v}});var te=ae(27247),re=ae(32855),X=ae(74430),D=ae(34666),W=ae(92310),y=ae.n(W),L=ae(59301),A=ae(30292),s=L.forwardRef(function(r,a){var p,E,S,w=r.inputElement,R=r.children,O=r.prefixCls,z=r.prefix,N=r.suffix,P=r.addonBefore,F=r.addonAfter,K=r.className,B=r.style,V=r.disabled,C=r.readOnly,M=r.focused,H=r.triggerFocus,$=r.allowClear,q=r.value,se=r.handleReset,ue=r.hidden,pe=r.classes,xe=r.classNames,De=r.dataAttrs,Ue=r.styles,Ge=r.components,Ae=r.onClear,We=R!=null?R:w,we=(Ge==null?void 0:Ge.affixWrapper)||"span",Se=(Ge==null?void 0:Ge.groupWrapper)||"span",ge=(Ge==null?void 0:Ge.wrapper)||"span",Re=(Ge==null?void 0:Ge.groupAddon)||"span",ve=(0,L.useRef)(null),Le=function(Bt){var st;(st=ve.current)!==null&&st!==void 0&&st.contains(Bt.target)&&(H==null||H())},Fe=(0,A.X3)(r),me=(0,L.cloneElement)(We,{value:q,className:y()((p=We.props)===null||p===void 0?void 0:p.className,!Fe&&(xe==null?void 0:xe.variant))||null}),oe=(0,L.useRef)(null);if(L.useImperativeHandle(a,function(){return{nativeElement:oe.current||ve.current}}),Fe){var ie=null;if($){var fe=!V&&!C&&q,ye="".concat(O,"-clear-icon"),he=(0,D.Z)($)==="object"&&$!==null&&$!==void 0&&$.clearIcon?$.clearIcon:"\u2716";ie=L.createElement("button",{type:"button",tabIndex:-1,onClick:function(Bt){se==null||se(Bt),Ae==null||Ae()},onMouseDown:function(Bt){return Bt.preventDefault()},className:y()(ye,(0,X.Z)((0,X.Z)({},"".concat(ye,"-hidden"),!fe),"".concat(ye,"-has-suffix"),!!N))},he)}var Te="".concat(O,"-affix-wrapper"),Oe=y()(Te,(0,X.Z)((0,X.Z)((0,X.Z)((0,X.Z)((0,X.Z)({},"".concat(O,"-disabled"),V),"".concat(Te,"-disabled"),V),"".concat(Te,"-focused"),M),"".concat(Te,"-readonly"),C),"".concat(Te,"-input-with-clear-btn"),N&&$&&q),pe==null?void 0:pe.affixWrapper,xe==null?void 0:xe.affixWrapper,xe==null?void 0:xe.variant),Be=(N||$)&&L.createElement("span",{className:y()("".concat(O,"-suffix"),xe==null?void 0:xe.suffix),style:Ue==null?void 0:Ue.suffix},ie,N);me=L.createElement(we,(0,re.Z)({className:Oe,style:Ue==null?void 0:Ue.affixWrapper,onClick:Le},De==null?void 0:De.affixWrapper,{ref:ve}),z&&L.createElement("span",{className:y()("".concat(O,"-prefix"),xe==null?void 0:xe.prefix),style:Ue==null?void 0:Ue.prefix},z),me,Be)}if((0,A.He)(r)){var Ze="".concat(O,"-group"),tt="".concat(Ze,"-addon"),dt="".concat(Ze,"-wrapper"),nt=y()("".concat(O,"-wrapper"),Ze,pe==null?void 0:pe.wrapper,xe==null?void 0:xe.wrapper),At=y()(dt,(0,X.Z)({},"".concat(dt,"-disabled"),V),pe==null?void 0:pe.group,xe==null?void 0:xe.groupWrapper);me=L.createElement(Se,{className:At,ref:oe},L.createElement(ge,{className:nt},P&&L.createElement(Re,{className:tt},P),me,F&&L.createElement(Re,{className:tt},F)))}return L.cloneElement(me,{className:y()((E=me.props)===null||E===void 0?void 0:E.className,K)||null,style:(0,te.Z)((0,te.Z)({},(S=me.props)===null||S===void 0?void 0:S.style),B),hidden:ue})}),x=s,c=ae(3300),u=ae(11913),f=ae(43079),i=ae(18929),o=ae(2738),d=ae(66003),m=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],_=(0,L.forwardRef)(function(r,a){var p=r.autoComplete,E=r.onChange,S=r.onFocus,w=r.onBlur,R=r.onPressEnter,O=r.onKeyDown,z=r.onKeyUp,N=r.prefixCls,P=N===void 0?"rc-input":N,F=r.disabled,K=r.htmlSize,B=r.className,V=r.maxLength,C=r.suffix,M=r.showCount,H=r.count,$=r.type,q=$===void 0?"text":$,se=r.classes,ue=r.classNames,pe=r.styles,xe=r.onCompositionStart,De=r.onCompositionEnd,Ue=(0,f.Z)(r,m),Ge=(0,L.useState)(!1),Ae=(0,u.Z)(Ge,2),We=Ae[0],we=Ae[1],Se=(0,L.useRef)(!1),ge=(0,L.useRef)(!1),Re=(0,L.useRef)(null),ve=(0,L.useRef)(null),Le=function(yt){Re.current&&(0,A.nH)(Re.current,yt)},Fe=(0,i.Z)(r.defaultValue,{value:r.value}),me=(0,u.Z)(Fe,2),oe=me[0],ie=me[1],fe=oe==null?"":String(oe),ye=(0,L.useState)(null),he=(0,u.Z)(ye,2),Te=he[0],Oe=he[1],Be=(0,d.Z)(H,M),Ze=Be.max||V,tt=Be.strategy(fe),dt=!!Ze&&tt>Ze;(0,L.useImperativeHandle)(a,function(){var gt;return{focus:Le,blur:function(){var ir;(ir=Re.current)===null||ir===void 0||ir.blur()},setSelectionRange:function(ir,Jt,St){var it;(it=Re.current)===null||it===void 0||it.setSelectionRange(ir,Jt,St)},select:function(){var ir;(ir=Re.current)===null||ir===void 0||ir.select()},input:Re.current,nativeElement:((gt=ve.current)===null||gt===void 0?void 0:gt.nativeElement)||Re.current}}),(0,L.useEffect)(function(){ge.current&&(ge.current=!1),we(function(gt){return gt&&F?!1:gt})},[F]);var nt=function(yt,ir,Jt){var St=ir;if(!Se.current&&Be.exceedFormatter&&Be.max&&Be.strategy(ir)>Be.max){if(St=Be.exceedFormatter(ir,{max:Be.max}),ir!==St){var it,Rt;Oe([((it=Re.current)===null||it===void 0?void 0:it.selectionStart)||0,((Rt=Re.current)===null||Rt===void 0?void 0:Rt.selectionEnd)||0])}}else if(Jt.source==="compositionEnd")return;ie(St),Re.current&&(0,A.rJ)(Re.current,yt,E,St)};(0,L.useEffect)(function(){if(Te){var gt;(gt=Re.current)===null||gt===void 0||gt.setSelectionRange.apply(gt,(0,c.Z)(Te))}},[Te]);var At=function(yt){nt(yt,yt.target.value,{source:"change"})},Nt=function(yt){Se.current=!1,nt(yt,yt.currentTarget.value,{source:"compositionEnd"}),De==null||De(yt)},Bt=function(yt){R&&yt.key==="Enter"&&!ge.current&&(ge.current=!0,R(yt)),O==null||O(yt)},st=function(yt){yt.key==="Enter"&&(ge.current=!1),z==null||z(yt)},Ot=function(yt){we(!0),S==null||S(yt)},ur=function(yt){ge.current&&(ge.current=!1),we(!1),w==null||w(yt)},br=function(yt){ie(""),Le(),Re.current&&(0,A.rJ)(Re.current,yt,E)},Qt=dt&&"".concat(P,"-out-of-range"),Fr=function(){var yt=(0,o.Z)(r,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return L.createElement("input",(0,re.Z)({autoComplete:p},yt,{onChange:At,onFocus:Ot,onBlur:ur,onKeyDown:Bt,onKeyUp:st,className:y()(P,(0,X.Z)({},"".concat(P,"-disabled"),F),ue==null?void 0:ue.input),style:pe==null?void 0:pe.input,ref:Re,size:K,type:q,onCompositionStart:function(Jt){Se.current=!0,xe==null||xe(Jt)},onCompositionEnd:Nt}))},Lt=function(){var yt=Number(Ze)>0;if(C||Be.show){var ir=Be.showFormatter?Be.showFormatter({value:fe,count:tt,maxLength:Ze}):"".concat(tt).concat(yt?" / ".concat(Ze):"");return L.createElement(L.Fragment,null,Be.show&&L.createElement("span",{className:y()("".concat(P,"-show-count-suffix"),(0,X.Z)({},"".concat(P,"-show-count-has-suffix"),!!C),ue==null?void 0:ue.count),style:(0,te.Z)({},pe==null?void 0:pe.count)},ir),C)}return null};return L.createElement(x,(0,re.Z)({},Ue,{prefixCls:P,className:y()(B,Qt),handleReset:br,value:fe,focused:We,triggerFocus:Le,suffix:Lt(),disabled:F,classes:se,classNames:ue,styles:pe}),Fr())}),h=_,v=h},30292:function(qt,$e,ae){"use strict";ae.d($e,{He:function(){return te},X3:function(){return re},nH:function(){return W},rJ:function(){return D}});function te(y){return!!(y.addonBefore||y.addonAfter)}function re(y){return!!(y.prefix||y.suffix||y.allowClear)}function X(y,L,A){var s=L.cloneNode(!0),x=Object.create(y,{target:{value:s},currentTarget:{value:s}});return s.value=A,typeof L.selectionStart=="number"&&typeof L.selectionEnd=="number"&&(s.selectionStart=L.selectionStart,s.selectionEnd=L.selectionEnd),s.setSelectionRange=function(){L.setSelectionRange.apply(L,arguments)},x}function D(y,L,A,s){if(A){var x=L;if(L.type==="click"){x=X(L,y,""),A(x);return}if(y.type!=="file"&&s!==void 0){x=X(L,y,s),A(x);return}A(x)}}function W(y,L){if(y){y.focus(L);var A=L||{},s=A.cursor;if(s){var x=y.value.length;switch(s){case"start":y.setSelectionRange(0,0);break;case"end":y.setSelectionRange(x,x);break;default:y.setSelectionRange(0,x)}}}}},28321:function(qt,$e,ae){"use strict";ae.d($e,{iz:function(){return Pe},ck:function(){return St},BW:function(){return He},sN:function(){return St},Wd:function(){return bt},ZP:function(){return ft},Xl:function(){return R}});var te=ae(32855),re=ae(74430),X=ae(27247),D=ae(3300),W=ae(11913),y=ae(43079),L=ae(92310),A=ae.n(L),s=ae(11780),x=ae(18929),c=ae(13697),u=ae(48736),f=ae(59301),i=ae(4676),o=f.createContext(null);function d(Ne,je){return Ne===void 0?null:"".concat(Ne,"-").concat(je)}function m(Ne){var je=f.useContext(o);return d(je,Ne)}var _=ae(80547),h=["children","locked"],v=f.createContext(null);function r(Ne,je){var et=(0,X.Z)({},Ne);return Object.keys(je).forEach(function(Ke){var Et=je[Ke];Et!==void 0&&(et[Ke]=Et)}),et}function a(Ne){var je=Ne.children,et=Ne.locked,Ke=(0,y.Z)(Ne,h),Et=f.useContext(v),wt=(0,_.Z)(function(){return r(Et,Ke)},[Et,Ke],function(Pt,zt){return!et&&(Pt[0]!==zt[0]||!(0,c.Z)(Pt[1],zt[1],!0))});return f.createElement(v.Provider,{value:wt},je)}var p=[],E=f.createContext(null);function S(){return f.useContext(E)}var w=f.createContext(p);function R(Ne){var je=f.useContext(w);return f.useMemo(function(){return Ne!==void 0?[].concat((0,D.Z)(je),[Ne]):je},[je,Ne])}var O=f.createContext(null),z=f.createContext({}),N=z,P=ae(29194);function F(Ne){var je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,P.Z)(Ne)){var et=Ne.nodeName.toLowerCase(),Ke=["input","select","textarea","button"].includes(et)||Ne.isContentEditable||et==="a"&&!!Ne.getAttribute("href"),Et=Ne.getAttribute("tabindex"),wt=Number(Et),Pt=null;return Et&&!Number.isNaN(wt)?Pt=wt:Ke&&Pt===null&&(Pt=0),Ke&&Ne.disabled&&(Pt=null),Pt!==null&&(Pt>=0||je&&Pt<0)}return!1}function K(Ne){var je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,et=(0,D.Z)(Ne.querySelectorAll("*")).filter(function(Ke){return F(Ke,je)});return F(Ne,je)&&et.unshift(Ne),et}var B=null;function V(){B=document.activeElement}function C(){B=null}function M(){if(B)try{B.focus()}catch(Ne){}}function H(Ne,je){if(je.keyCode===9){var et=K(Ne),Ke=et[je.shiftKey?0:et.length-1],Et=Ke===document.activeElement||Ne===document.activeElement;if(Et){var wt=et[je.shiftKey?et.length-1:0];wt.focus(),je.preventDefault()}}}var $=ae(10228),q=ae(16089),se=$.Z.LEFT,ue=$.Z.RIGHT,pe=$.Z.UP,xe=$.Z.DOWN,De=$.Z.ENTER,Ue=$.Z.ESC,Ge=$.Z.HOME,Ae=$.Z.END,We=[pe,xe,se,ue];function we(Ne,je,et,Ke){var Et,wt="prev",Pt="next",zt="children",er="parent";if(Ne==="inline"&&Ke===De)return{inlineTrigger:!0};var $t=(0,re.Z)((0,re.Z)({},pe,wt),xe,Pt),_r=(0,re.Z)((0,re.Z)((0,re.Z)((0,re.Z)({},se,et?Pt:wt),ue,et?wt:Pt),xe,zt),De,zt),Ve=(0,re.Z)((0,re.Z)((0,re.Z)((0,re.Z)((0,re.Z)((0,re.Z)({},pe,wt),xe,Pt),De,zt),Ue,er),se,et?zt:er),ue,et?er:zt),Xt={inline:$t,horizontal:_r,vertical:Ve,inlineSub:$t,horizontalSub:Ve,verticalSub:Ve},ar=(Et=Xt["".concat(Ne).concat(je?"":"Sub")])===null||Et===void 0?void 0:Et[Ke];switch(ar){case wt:return{offset:-1,sibling:!0};case Pt:return{offset:1,sibling:!0};case er:return{offset:-1,sibling:!1};case zt:return{offset:1,sibling:!1};default:return null}}function Se(Ne){for(var je=Ne;je;){if(je.getAttribute("data-menu-list"))return je;je=je.parentElement}return null}function ge(Ne,je){for(var et=Ne||document.activeElement;et;){if(je.has(et))return et;et=et.parentElement}return null}function Re(Ne,je){var et=K(Ne,!0);return et.filter(function(Ke){return je.has(Ke)})}function ve(Ne,je,et){var Ke=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Ne)return null;var Et=Re(Ne,je),wt=Et.length,Pt=Et.findIndex(function(zt){return et===zt});return Ke<0?Pt===-1?Pt=wt-1:Pt-=1:Ke>0&&(Pt+=1),Pt=(Pt+wt)%wt,Et[Pt]}var Le=function(je,et){var Ke=new Set,Et=new Map,wt=new Map;return je.forEach(function(Pt){var zt=document.querySelector("[data-menu-id='".concat(d(et,Pt),"']"));zt&&(Ke.add(zt),wt.set(zt,Pt),Et.set(Pt,zt))}),{elements:Ke,key2element:Et,element2key:wt}};function Fe(Ne,je,et,Ke,Et,wt,Pt,zt,er,$t){var _r=f.useRef(),Ve=f.useRef();Ve.current=je;var Xt=function(){q.Z.cancel(_r.current)};return f.useEffect(function(){return function(){Xt()}},[]),function(ar){var mr=ar.which;if([].concat(We,[De,Ue,Ge,Ae]).includes(mr)){var sr=wt(),nr=Le(sr,Ke),cr=nr,Mr=cr.elements,Sr=cr.key2element,Er=cr.element2key,Cr=Sr.get(je),vr=ge(Cr,Mr),pr=Er.get(vr),Qr=we(Ne,Pt(pr,!0).length===1,et,mr);if(!Qr&&mr!==Ge&&mr!==Ae)return;(We.includes(mr)||[Ge,Ae].includes(mr))&&ar.preventDefault();var zr=function(gr){if(gr){var Wt=gr,Mt=gr.querySelector("a");Mt!=null&&Mt.getAttribute("href")&&(Wt=Mt);var rr=Er.get(gr);zt(rr),Xt(),_r.current=(0,q.Z)(function(){Ve.current===rr&&Wt.focus()})}};if([Ge,Ae].includes(mr)||Qr.sibling||!vr){var Wr;!vr||Ne==="inline"?Wr=Et.current:Wr=Se(vr);var wr,on=Re(Wr,Mr);mr===Ge?wr=on[0]:mr===Ae?wr=on[on.length-1]:wr=ve(Wr,Mr,vr,Qr.offset),zr(wr)}else if(Qr.inlineTrigger)er(pr);else if(Qr.offset>0)er(pr,!0),Xt(),_r.current=(0,q.Z)(function(){nr=Le(sr,Ke);var Jr=vr.getAttribute("aria-controls"),gr=document.getElementById(Jr),Wt=ve(gr,nr.elements);zr(Wt)},5);else if(Qr.offset<0){var Xr=Pt(pr,!0),Gr=Xr[Xr.length-2],un=Sr.get(Gr);er(Gr,!1),zr(un)}}$t==null||$t(ar)}}function me(Ne){Promise.resolve().then(Ne)}var oe="__RC_UTIL_PATH_SPLIT__",ie=function(je){return je.join(oe)},fe=function(je){return je.split(oe)},ye="rc-menu-more";function he(){var Ne=f.useState({}),je=(0,W.Z)(Ne,2),et=je[1],Ke=(0,f.useRef)(new Map),Et=(0,f.useRef)(new Map),wt=f.useState([]),Pt=(0,W.Z)(wt,2),zt=Pt[0],er=Pt[1],$t=(0,f.useRef)(0),_r=(0,f.useRef)(!1),Ve=function(){_r.current||et({})},Xt=(0,f.useCallback)(function(Sr,Er){var Cr=ie(Er);Et.current.set(Cr,Sr),Ke.current.set(Sr,Cr),$t.current+=1;var vr=$t.current;me(function(){vr===$t.current&&Ve()})},[]),ar=(0,f.useCallback)(function(Sr,Er){var Cr=ie(Er);Et.current.delete(Cr),Ke.current.delete(Sr)},[]),mr=(0,f.useCallback)(function(Sr){er(Sr)},[]),sr=(0,f.useCallback)(function(Sr,Er){var Cr=Ke.current.get(Sr)||"",vr=fe(Cr);return Er&&zt.includes(vr[0])&&vr.unshift(ye),vr},[zt]),nr=(0,f.useCallback)(function(Sr,Er){return Sr.filter(function(Cr){return Cr!==void 0}).some(function(Cr){var vr=sr(Cr,!0);return vr.includes(Er)})},[sr]),cr=function(){var Er=(0,D.Z)(Ke.current.keys());return zt.length&&Er.push(ye),Er},Mr=(0,f.useCallback)(function(Sr){var Er="".concat(Ke.current.get(Sr)).concat(oe),Cr=new Set;return(0,D.Z)(Et.current.keys()).forEach(function(vr){vr.startsWith(Er)&&Cr.add(Et.current.get(vr))}),Cr},[]);return f.useEffect(function(){return function(){_r.current=!0}},[]),{registerPath:Xt,unregisterPath:ar,refreshOverflowKeys:mr,isSubPathKey:nr,getKeyPath:sr,getKeys:cr,getSubPathKeys:Mr}}function Te(Ne){var je=f.useRef(Ne);je.current=Ne;var et=f.useCallback(function(){for(var Ke,Et=arguments.length,wt=new Array(Et),Pt=0;Pt<Et;Pt++)wt[Pt]=arguments[Pt];return(Ke=je.current)===null||Ke===void 0?void 0:Ke.call.apply(Ke,[je].concat(wt))},[]);return Ne?et:void 0}var Oe=Math.random().toFixed(5).toString().slice(2),Be=0;function Ze(Ne){var je=(0,x.Z)(Ne,{value:Ne}),et=(0,W.Z)(je,2),Ke=et[0],Et=et[1];return f.useEffect(function(){Be+=1;var wt="".concat(Oe,"-").concat(Be);Et("rc-menu-uuid-".concat(wt))},[]),Ke}var tt=ae(33377),dt=ae(93912),nt=ae(18881),At=ae(85461),Nt=ae(2738),Bt=ae(8654);function st(Ne,je,et,Ke){var Et=f.useContext(v),wt=Et.activeKey,Pt=Et.onActive,zt=Et.onInactive,er={active:wt===Ne};return je||(er.onMouseEnter=function($t){et==null||et({key:Ne,domEvent:$t}),Pt(Ne)},er.onMouseLeave=function($t){Ke==null||Ke({key:Ne,domEvent:$t}),zt(Ne)}),er}function Ot(Ne){var je=f.useContext(v),et=je.mode,Ke=je.rtl,Et=je.inlineIndent;if(et!=="inline")return null;var wt=Ne;return Ke?{paddingRight:wt*Et}:{paddingLeft:wt*Et}}function ur(Ne){var je=Ne.icon,et=Ne.props,Ke=Ne.children,Et;return je===null||je===!1?null:(typeof je=="function"?Et=f.createElement(je,(0,X.Z)({},et)):typeof je!="boolean"&&(Et=je),Et||Ke||null)}var br=["item"];function Qt(Ne){var je=Ne.item,et=(0,y.Z)(Ne,br);return Object.defineProperty(et,"item",{get:function(){return(0,u.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),je}}),et}var Fr=["title","attribute","elementRef"],Lt=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],gt=["active"],yt=function(Ne){(0,nt.Z)(et,Ne);var je=(0,At.Z)(et);function et(){return(0,tt.Z)(this,et),je.apply(this,arguments)}return(0,dt.Z)(et,[{key:"render",value:function(){var Et=this.props,wt=Et.title,Pt=Et.attribute,zt=Et.elementRef,er=(0,y.Z)(Et,Fr),$t=(0,Nt.Z)(er,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,u.ZP)(!Pt,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),f.createElement(s.Z.Item,(0,te.Z)({},Pt,{title:typeof wt=="string"?wt:void 0},$t,{ref:zt}))}}]),et}(f.Component),ir=f.forwardRef(function(Ne,je){var et=Ne.style,Ke=Ne.className,Et=Ne.eventKey,wt=Ne.warnKey,Pt=Ne.disabled,zt=Ne.itemIcon,er=Ne.children,$t=Ne.role,_r=Ne.onMouseEnter,Ve=Ne.onMouseLeave,Xt=Ne.onClick,ar=Ne.onKeyDown,mr=Ne.onFocus,sr=(0,y.Z)(Ne,Lt),nr=m(Et),cr=f.useContext(v),Mr=cr.prefixCls,Sr=cr.onItemClick,Er=cr.disabled,Cr=cr.overflowDisabled,vr=cr.itemIcon,pr=cr.selectedKeys,Qr=cr.onActive,zr=f.useContext(N),Wr=zr._internalRenderMenuItem,wr="".concat(Mr,"-item"),on=f.useRef(),Xr=f.useRef(),Gr=Er||Pt,un=(0,Bt.x1)(je,Xr),Jr=R(Et),gr=function($r){return{key:Et,keyPath:(0,D.Z)(Jr).reverse(),item:on.current,domEvent:$r}},Wt=zt||vr,Mt=st(Et,Gr,_r,Ve),rr=Mt.active,tr=(0,y.Z)(Mt,gt),Tr=pr.includes(Et),Hr=Ot(Jr.length),qr=function($r){if(!Gr){var Sn=gr($r);Xt==null||Xt(Qt(Sn)),Sr(Sn)}},Kr=function($r){if(ar==null||ar($r),$r.which===$.Z.ENTER){var Sn=gr($r);Xt==null||Xt(Qt(Sn)),Sr(Sn)}},rn=function($r){Qr(Et),mr==null||mr($r)},En={};Ne.role==="option"&&(En["aria-selected"]=Tr);var gn=f.createElement(yt,(0,te.Z)({ref:on,elementRef:un,role:$t===null?"none":$t||"menuitem",tabIndex:Pt?null:-1,"data-menu-id":Cr&&nr?null:nr},(0,Nt.Z)(sr,["extra"]),tr,En,{component:"li","aria-disabled":Pt,style:(0,X.Z)((0,X.Z)({},Hr),et),className:A()(wr,(0,re.Z)((0,re.Z)((0,re.Z)({},"".concat(wr,"-active"),rr),"".concat(wr,"-selected"),Tr),"".concat(wr,"-disabled"),Gr),Ke),onClick:qr,onKeyDown:Kr,onFocus:rn}),er,f.createElement(ur,{props:(0,X.Z)((0,X.Z)({},Ne),{},{isSelected:Tr}),icon:Wt}));return Wr&&(gn=Wr(gn,Ne,{selected:Tr})),gn});function Jt(Ne,je){var et=Ne.eventKey,Ke=S(),Et=R(et);return f.useEffect(function(){if(Ke)return Ke.registerPath(et,Et),function(){Ke.unregisterPath(et,Et)}},[Et]),Ke?null:f.createElement(ir,(0,te.Z)({},Ne,{ref:je}))}var St=f.forwardRef(Jt),it=["className","children"],Rt=function(je,et){var Ke=je.className,Et=je.children,wt=(0,y.Z)(je,it),Pt=f.useContext(v),zt=Pt.prefixCls,er=Pt.mode,$t=Pt.rtl;return f.createElement("ul",(0,te.Z)({className:A()(zt,$t&&"".concat(zt,"-rtl"),"".concat(zt,"-sub"),"".concat(zt,"-").concat(er==="inline"?"inline":"vertical"),Ke),role:"menu"},wt,{"data-menu-list":!0,ref:et}),Et)},Vt=f.forwardRef(Rt);Vt.displayName="SubMenuList";var jt=Vt,Yt=ae(11592);function qe(Ne,je){return(0,Yt.Z)(Ne).map(function(et,Ke){if(f.isValidElement(et)){var Et,wt,Pt=et.key,zt=(Et=(wt=et.props)===null||wt===void 0?void 0:wt.eventKey)!==null&&Et!==void 0?Et:Pt,er=zt==null;er&&(zt="tmp_key-".concat([].concat((0,D.Z)(je),[Ke]).join("-")));var $t={key:zt,eventKey:zt};return f.cloneElement(et,$t)}return et})}var mt=ae(65030),Dt={adjustX:1,adjustY:1},Ft={topLeft:{points:["bl","tl"],overflow:Dt},topRight:{points:["br","tr"],overflow:Dt},bottomLeft:{points:["tl","bl"],overflow:Dt},bottomRight:{points:["tr","br"],overflow:Dt},leftTop:{points:["tr","tl"],overflow:Dt},leftBottom:{points:["br","bl"],overflow:Dt},rightTop:{points:["tl","tr"],overflow:Dt},rightBottom:{points:["bl","br"],overflow:Dt}},Zt={topLeft:{points:["bl","tl"],overflow:Dt},topRight:{points:["br","tr"],overflow:Dt},bottomLeft:{points:["tl","bl"],overflow:Dt},bottomRight:{points:["tr","br"],overflow:Dt},rightTop:{points:["tr","tl"],overflow:Dt},rightBottom:{points:["br","bl"],overflow:Dt},leftTop:{points:["tl","tr"],overflow:Dt},leftBottom:{points:["bl","br"],overflow:Dt}},_t=null;function G(Ne,je,et){if(je)return je;if(et)return et[Ne]||et.other}var Y={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function J(Ne){var je=Ne.prefixCls,et=Ne.visible,Ke=Ne.children,Et=Ne.popup,wt=Ne.popupStyle,Pt=Ne.popupClassName,zt=Ne.popupOffset,er=Ne.disabled,$t=Ne.mode,_r=Ne.onVisibleChange,Ve=f.useContext(v),Xt=Ve.getPopupContainer,ar=Ve.rtl,mr=Ve.subMenuOpenDelay,sr=Ve.subMenuCloseDelay,nr=Ve.builtinPlacements,cr=Ve.triggerSubMenuAction,Mr=Ve.forceSubMenuRender,Sr=Ve.rootClassName,Er=Ve.motion,Cr=Ve.defaultMotions,vr=f.useState(!1),pr=(0,W.Z)(vr,2),Qr=pr[0],zr=pr[1],Wr=ar?(0,X.Z)((0,X.Z)({},Zt),nr):(0,X.Z)((0,X.Z)({},Ft),nr),wr=Y[$t],on=G($t,Er,Cr),Xr=f.useRef(on);$t!=="inline"&&(Xr.current=on);var Gr=(0,X.Z)((0,X.Z)({},Xr.current),{},{leavedClassName:"".concat(je,"-hidden"),removeOnLeave:!1,motionAppear:!0}),un=f.useRef();return f.useEffect(function(){return un.current=(0,q.Z)(function(){zr(et)}),function(){q.Z.cancel(un.current)}},[et]),f.createElement(mt.Z,{prefixCls:je,popupClassName:A()("".concat(je,"-popup"),(0,re.Z)({},"".concat(je,"-rtl"),ar),Pt,Sr),stretch:$t==="horizontal"?"minWidth":null,getPopupContainer:Xt,builtinPlacements:Wr,popupPlacement:wr,popupVisible:Qr,popup:Et,popupStyle:wt,popupAlign:zt&&{offset:zt},action:er?[]:[cr],mouseEnterDelay:mr,mouseLeaveDelay:sr,onPopupVisibleChange:_r,forceRender:Mr,popupMotion:Gr,fresh:!0},Ke)}var le=ae(77900);function _e(Ne){var je=Ne.id,et=Ne.open,Ke=Ne.keyPath,Et=Ne.children,wt="inline",Pt=f.useContext(v),zt=Pt.prefixCls,er=Pt.forceSubMenuRender,$t=Pt.motion,_r=Pt.defaultMotions,Ve=Pt.mode,Xt=f.useRef(!1);Xt.current=Ve===wt;var ar=f.useState(!Xt.current),mr=(0,W.Z)(ar,2),sr=mr[0],nr=mr[1],cr=Xt.current?et:!1;f.useEffect(function(){Xt.current&&nr(!1)},[Ve]);var Mr=(0,X.Z)({},G(wt,$t,_r));Ke.length>1&&(Mr.motionAppear=!1);var Sr=Mr.onVisibleChanged;return Mr.onVisibleChanged=function(Er){return!Xt.current&&!Er&&nr(!0),Sr==null?void 0:Sr(Er)},sr?null:f.createElement(a,{mode:wt,locked:!Xt.current},f.createElement(le.default,(0,te.Z)({visible:cr},Mr,{forceRender:er,removeOnLeave:!1,leavedClassName:"".concat(zt,"-hidden")}),function(Er){var Cr=Er.className,vr=Er.style;return f.createElement(jt,{id:je,className:Cr,style:vr},Et)}))}var Ie=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Ce=["active"],Xe=f.forwardRef(function(Ne,je){var et=Ne.style,Ke=Ne.className,Et=Ne.title,wt=Ne.eventKey,Pt=Ne.warnKey,zt=Ne.disabled,er=Ne.internalPopupClose,$t=Ne.children,_r=Ne.itemIcon,Ve=Ne.expandIcon,Xt=Ne.popupClassName,ar=Ne.popupOffset,mr=Ne.popupStyle,sr=Ne.onClick,nr=Ne.onMouseEnter,cr=Ne.onMouseLeave,Mr=Ne.onTitleClick,Sr=Ne.onTitleMouseEnter,Er=Ne.onTitleMouseLeave,Cr=(0,y.Z)(Ne,Ie),vr=m(wt),pr=f.useContext(v),Qr=pr.prefixCls,zr=pr.mode,Wr=pr.openKeys,wr=pr.disabled,on=pr.overflowDisabled,Xr=pr.activeKey,Gr=pr.selectedKeys,un=pr.itemIcon,Jr=pr.expandIcon,gr=pr.onItemClick,Wt=pr.onOpenChange,Mt=pr.onActive,rr=f.useContext(N),tr=rr._internalRenderSubMenuItem,Tr=f.useContext(O),Hr=Tr.isSubPathKey,qr=R(),Kr="".concat(Qr,"-submenu"),rn=wr||zt,En=f.useRef(),gn=f.useRef(),bn=_r!=null?_r:un,$r=Ve!=null?Ve:Jr,Sn=Wr.includes(wt),_n=!on&&Sn,Ln=Hr(Gr,wt),ln=st(wt,rn,Sr,Er),cn=ln.active,fn=(0,y.Z)(ln,Ce),Dr=f.useState(!1),kn=(0,W.Z)(Dr,2),Bn=kn[0],wn=kn[1],Rn=function(An){rn||wn(An)},Yn=function(An){Rn(!0),nr==null||nr({key:wt,domEvent:An})},Un=function(An){Rn(!1),cr==null||cr({key:wt,domEvent:An})},zn=f.useMemo(function(){return cn||(zr!=="inline"?Bn||Hr([Xr],wt):!1)},[zr,cn,Xr,Bn,wt,Hr]),Vr=Ot(qr.length),ci=function(An){rn||(Mr==null||Mr({key:wt,domEvent:An}),zr==="inline"&&Wt(wt,!Sn))},oi=Te(function(mn){sr==null||sr(Qt(mn)),gr(mn)}),$n=function(An){zr!=="inline"&&Wt(wt,An)},ri=function(){Mt(wt)},Qn=vr&&"".concat(vr,"-popup"),jn=f.useMemo(function(){return f.createElement(ur,{icon:zr!=="horizontal"?$r:void 0,props:(0,X.Z)((0,X.Z)({},Ne),{},{isOpen:_n,isSubMenu:!0})},f.createElement("i",{className:"".concat(Kr,"-arrow")}))},[zr,$r,Ne,_n,Kr]),Tn=f.createElement("div",(0,te.Z)({role:"menuitem",style:Vr,className:"".concat(Kr,"-title"),tabIndex:rn?null:-1,ref:En,title:typeof Et=="string"?Et:null,"data-menu-id":on&&vr?null:vr,"aria-expanded":_n,"aria-haspopup":!0,"aria-controls":Qn,"aria-disabled":rn,onClick:ci,onFocus:ri},fn),Et,jn),Mn=f.useRef(zr);if(zr!=="inline"&&qr.length>1?Mn.current="vertical":Mn.current=zr,!on){var On=Mn.current;Tn=f.createElement(J,{mode:On,prefixCls:Kr,visible:!er&&_n&&zr!=="inline",popupClassName:Xt,popupOffset:ar,popupStyle:mr,popup:f.createElement(a,{mode:On==="horizontal"?"vertical":On},f.createElement(jt,{id:Qn,ref:gn},$t)),disabled:rn,onVisibleChange:$n},Tn)}var tn=f.createElement(s.Z.Item,(0,te.Z)({ref:je,role:"none"},Cr,{component:"li",style:et,className:A()(Kr,"".concat(Kr,"-").concat(zr),Ke,(0,re.Z)((0,re.Z)((0,re.Z)((0,re.Z)({},"".concat(Kr,"-open"),_n),"".concat(Kr,"-active"),zn),"".concat(Kr,"-selected"),Ln),"".concat(Kr,"-disabled"),rn)),onMouseEnter:Yn,onMouseLeave:Un}),Tn,!on&&f.createElement(_e,{id:Qn,open:_n,keyPath:qr},$t));return tr&&(tn=tr(tn,Ne,{selected:Ln,active:zn,open:_n,disabled:rn})),f.createElement(a,{onItemClick:oi,mode:zr==="horizontal"?"vertical":zr,itemIcon:bn,expandIcon:$r},tn)}),Je=f.forwardRef(function(Ne,je){var et=Ne.eventKey,Ke=Ne.children,Et=R(et),wt=qe(Ke,Et),Pt=S();f.useEffect(function(){if(Pt)return Pt.registerPath(et,Et),function(){Pt.unregisterPath(et,Et)}},[Et]);var zt;return Pt?zt=wt:zt=f.createElement(Xe,(0,te.Z)({ref:je},Ne),wt),f.createElement(w.Provider,{value:Et},zt)}),bt=Je,Ht=ae(34666);function Pe(Ne){var je=Ne.className,et=Ne.style,Ke=f.useContext(v),Et=Ke.prefixCls,wt=S();return wt?null:f.createElement("li",{role:"separator",className:A()("".concat(Et,"-item-divider"),je),style:et})}var be=["className","title","eventKey","children"],ut=f.forwardRef(function(Ne,je){var et=Ne.className,Ke=Ne.title,Et=Ne.eventKey,wt=Ne.children,Pt=(0,y.Z)(Ne,be),zt=f.useContext(v),er=zt.prefixCls,$t="".concat(er,"-item-group");return f.createElement("li",(0,te.Z)({ref:je,role:"presentation"},Pt,{onClick:function(Ve){return Ve.stopPropagation()},className:A()($t,et)}),f.createElement("div",{role:"presentation",className:"".concat($t,"-title"),title:typeof Ke=="string"?Ke:void 0},Ke),f.createElement("ul",{role:"group",className:"".concat($t,"-list")},wt))}),ze=f.forwardRef(function(Ne,je){var et=Ne.eventKey,Ke=Ne.children,Et=R(et),wt=qe(Ke,Et),Pt=S();return Pt?wt:f.createElement(ut,(0,te.Z)({ref:je},(0,Nt.Z)(Ne,["warnKey"])),wt)}),He=ze,Qe=["label","children","key","type","extra"];function ht(Ne,je,et){var Ke=je.item,Et=je.group,wt=je.submenu,Pt=je.divider;return(Ne||[]).map(function(zt,er){if(zt&&(0,Ht.Z)(zt)==="object"){var $t=zt,_r=$t.label,Ve=$t.children,Xt=$t.key,ar=$t.type,mr=$t.extra,sr=(0,y.Z)($t,Qe),nr=Xt!=null?Xt:"tmp-".concat(er);return Ve||ar==="group"?ar==="group"?f.createElement(Et,(0,te.Z)({key:nr},sr,{title:_r}),ht(Ve,je,et)):f.createElement(wt,(0,te.Z)({key:nr},sr,{title:_r}),ht(Ve,je,et)):ar==="divider"?f.createElement(Pt,(0,te.Z)({key:nr},sr)):f.createElement(Ke,(0,te.Z)({key:nr},sr,{extra:mr}),_r,(!!mr||mr===0)&&f.createElement("span",{className:"".concat(et,"-item-extra")},mr))}return null}).filter(function(zt){return zt})}function pt(Ne,je,et,Ke,Et){var wt=Ne,Pt=(0,X.Z)({divider:Pe,item:St,group:He,submenu:bt},Ke);return je&&(wt=ht(je,Pt,Et)),qe(wt,et)}var kt=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],Tt=[],Ut=f.forwardRef(function(Ne,je){var et,Ke=Ne,Et=Ke.prefixCls,wt=Et===void 0?"rc-menu":Et,Pt=Ke.rootClassName,zt=Ke.style,er=Ke.className,$t=Ke.tabIndex,_r=$t===void 0?0:$t,Ve=Ke.items,Xt=Ke.children,ar=Ke.direction,mr=Ke.id,sr=Ke.mode,nr=sr===void 0?"vertical":sr,cr=Ke.inlineCollapsed,Mr=Ke.disabled,Sr=Ke.disabledOverflow,Er=Ke.subMenuOpenDelay,Cr=Er===void 0?.1:Er,vr=Ke.subMenuCloseDelay,pr=vr===void 0?.1:vr,Qr=Ke.forceSubMenuRender,zr=Ke.defaultOpenKeys,Wr=Ke.openKeys,wr=Ke.activeKey,on=Ke.defaultActiveFirst,Xr=Ke.selectable,Gr=Xr===void 0?!0:Xr,un=Ke.multiple,Jr=un===void 0?!1:un,gr=Ke.defaultSelectedKeys,Wt=Ke.selectedKeys,Mt=Ke.onSelect,rr=Ke.onDeselect,tr=Ke.inlineIndent,Tr=tr===void 0?24:tr,Hr=Ke.motion,qr=Ke.defaultMotions,Kr=Ke.triggerSubMenuAction,rn=Kr===void 0?"hover":Kr,En=Ke.builtinPlacements,gn=Ke.itemIcon,bn=Ke.expandIcon,$r=Ke.overflowedIndicator,Sn=$r===void 0?"...":$r,_n=Ke.overflowedIndicatorPopupClassName,Ln=Ke.getPopupContainer,ln=Ke.onClick,cn=Ke.onOpenChange,fn=Ke.onKeyDown,Dr=Ke.openAnimation,kn=Ke.openTransitionName,Bn=Ke._internalRenderMenuItem,wn=Ke._internalRenderSubMenuItem,Rn=Ke._internalComponents,Yn=(0,y.Z)(Ke,kt),Un=f.useMemo(function(){return[pt(Xt,Ve,Tt,Rn,wt),pt(Xt,Ve,Tt,{},wt)]},[Xt,Ve,Rn]),zn=(0,W.Z)(Un,2),Vr=zn[0],ci=zn[1],oi=f.useState(!1),$n=(0,W.Z)(oi,2),ri=$n[0],Qn=$n[1],jn=f.useRef(),Tn=Ze(mr),Mn=ar==="rtl",On=(0,x.Z)(zr,{value:Wr,postState:function(yn){return yn||Tt}}),tn=(0,W.Z)(On,2),mn=tn[0],An=tn[1],xr=function(yn){var Dn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function si(){An(yn),cn==null||cn(yn)}Dn?(0,i.flushSync)(si):si()},kr=f.useState(mn),Or=(0,W.Z)(kr,2),Nr=Or[0],Br=Or[1],Yr=f.useRef(!1),Wn=f.useMemo(function(){return(nr==="inline"||nr==="vertical")&&cr?["vertical",cr]:[nr,!1]},[nr,cr]),or=(0,W.Z)(Wn,2),Ar=or[0],jr=or[1],pn=Ar==="inline",dn=f.useState(Ar),hi=(0,W.Z)(dn,2),Zn=hi[0],ni=hi[1],Fn=f.useState(jr),ki=(0,W.Z)(Fn,2),ia=ki[0],aa=ki[1];f.useEffect(function(){ni(Ar),aa(jr),Yr.current&&(pn?An(Nr):xr(Tt))},[Ar,jr]);var Di=f.useState(0),Wi=(0,W.Z)(Di,2),Ki=Wi[0],li=Wi[1],Gi=Ki>=Vr.length-1||Zn!=="horizontal"||Sr;f.useEffect(function(){pn&&Br(mn)},[mn]),f.useEffect(function(){return Yr.current=!0,function(){Yr.current=!1}},[]);var xi=he(),Vi=xi.registerPath,$i=xi.unregisterPath,Qi=xi.refreshOverflowKeys,Hi=xi.isSubPathKey,va=xi.getKeyPath,Pi=xi.getKeys,sa=xi.getSubPathKeys,oa=f.useMemo(function(){return{registerPath:Vi,unregisterPath:$i}},[Vi,$i]),fi=f.useMemo(function(){return{isSubPathKey:Hi}},[Hi]);f.useEffect(function(){Qi(Gi?Tt:Vr.slice(Ki+1).map(function(Pn){return Pn.key}))},[Ki,Gi]);var la=(0,x.Z)(wr||on&&((et=Vr[0])===null||et===void 0?void 0:et.key),{value:wr}),Mi=(0,W.Z)(la,2),_i=Mi[0],nn=Mi[1],en=Te(function(Pn){nn(Pn)}),Gn=Te(function(){nn(void 0)});(0,f.useImperativeHandle)(je,function(){return{list:jn.current,focus:function(yn){var Dn,si=Pi(),Jn=Le(si,Tn),Ni=Jn.elements,Kn=Jn.key2element,qn=Jn.element2key,wa=Re(jn.current,Ni),Kt=_i!=null?_i:wa[0]?qn.get(wa[0]):(Dn=Vr.find(function(Ca){return!Ca.props.disabled}))===null||Dn===void 0?void 0:Dn.key,Bi=Kn.get(Kt);if(Kt&&Bi){var ua;Bi==null||(ua=Bi.focus)===null||ua===void 0||ua.call(Bi,yn)}}}});var Vn=(0,x.Z)(gr||[],{value:Wt,postState:function(yn){return Array.isArray(yn)?yn:yn==null?Tt:[yn]}}),Cn=(0,W.Z)(Vn,2),In=Cn[0],ii=Cn[1],ai=function(yn){if(Gr){var Dn=yn.key,si=In.includes(Dn),Jn;Jr?si?Jn=In.filter(function(Kn){return Kn!==Dn}):Jn=[].concat((0,D.Z)(In),[Dn]):Jn=[Dn],ii(Jn);var Ni=(0,X.Z)((0,X.Z)({},yn),{},{selectedKeys:Jn});si?rr==null||rr(Ni):Mt==null||Mt(Ni)}!Jr&&mn.length&&Zn!=="inline"&&xr(Tt)},mi=Te(function(Pn){ln==null||ln(Qt(Pn)),ai(Pn)}),pi=Te(function(Pn,yn){var Dn=mn.filter(function(Jn){return Jn!==Pn});if(yn)Dn.push(Pn);else if(Zn!=="inline"){var si=sa(Pn);Dn=Dn.filter(function(Jn){return!si.has(Jn)})}(0,c.Z)(mn,Dn,!0)||xr(Dn,!0)}),gi=function(yn,Dn){var si=Dn!=null?Dn:!mn.includes(yn);pi(yn,si)},Oi=Fe(Zn,_i,Mn,Tn,jn,Pi,va,nn,gi,fn);f.useEffect(function(){Qn(!0)},[]);var zi=f.useMemo(function(){return{_internalRenderMenuItem:Bn,_internalRenderSubMenuItem:wn}},[Bn,wn]),Ra=Zn!=="horizontal"||Sr?Vr:Vr.map(function(Pn,yn){return f.createElement(a,{key:Pn.key,overflowDisabled:yn>Ki},Pn)}),Ji=f.createElement(s.Z,(0,te.Z)({id:mr,ref:jn,prefixCls:"".concat(wt,"-overflow"),component:"ul",itemComponent:St,className:A()(wt,"".concat(wt,"-root"),"".concat(wt,"-").concat(Zn),er,(0,re.Z)((0,re.Z)({},"".concat(wt,"-inline-collapsed"),ia),"".concat(wt,"-rtl"),Mn),Pt),dir:ar,style:zt,role:"menu",tabIndex:_r,data:Ra,renderRawItem:function(yn){return yn},renderRawRest:function(yn){var Dn=yn.length,si=Dn?Vr.slice(-Dn):null;return f.createElement(bt,{eventKey:ye,title:Sn,disabled:Gi,internalPopupClose:Dn===0,popupClassName:_n},si)},maxCount:Zn!=="horizontal"||Sr?s.Z.INVALIDATE:s.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(yn){li(yn)},onKeyDown:Oi},Yn));return f.createElement(N.Provider,{value:zi},f.createElement(o.Provider,{value:Tn},f.createElement(a,{prefixCls:wt,rootClassName:Pt,mode:Zn,openKeys:mn,rtl:Mn,disabled:Mr,motion:ri?Hr:null,defaultMotions:ri?qr:null,activeKey:_i,onActive:en,onInactive:Gn,selectedKeys:In,inlineIndent:Tr,subMenuOpenDelay:Cr,subMenuCloseDelay:pr,forceSubMenuRender:Qr,builtinPlacements:En,triggerSubMenuAction:rn,getPopupContainer:Ln,itemIcon:gn,expandIcon:bn,onItemClick:mi,onOpenChange:pi},f.createElement(O.Provider,{value:fi},Ji),f.createElement("div",{style:{display:"none"},"aria-hidden":!0},f.createElement(E.Provider,{value:oa},ci)))))}),ot=Ut,It=ot;It.Item=St,It.SubMenu=bt,It.ItemGroup=He,It.Divider=Pe;var ft=It},11780:function(qt,$e,ae){"use strict";ae.d($e,{Z:function(){return V}});var te=ae(32855),re=ae(27247),X=ae(11913),D=ae(43079),W=ae(59301),y=ae(92310),L=ae.n(y),A=ae(29301),s=ae(34280),x=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],c=void 0;function u(C,M){var H=C.prefixCls,$=C.invalidate,q=C.item,se=C.renderItem,ue=C.responsive,pe=C.responsiveDisabled,xe=C.registerSize,De=C.itemKey,Ue=C.className,Ge=C.style,Ae=C.children,We=C.display,we=C.order,Se=C.component,ge=Se===void 0?"div":Se,Re=(0,D.Z)(C,x),ve=ue&&!We;function Le(fe){xe(De,fe)}W.useEffect(function(){return function(){Le(null)}},[]);var Fe=se&&q!==c?se(q,{index:we}):Ae,me;$||(me={opacity:ve?0:1,height:ve?0:c,overflowY:ve?"hidden":c,order:ue?we:c,pointerEvents:ve?"none":c,position:ve?"absolute":c});var oe={};ve&&(oe["aria-hidden"]=!0);var ie=W.createElement(ge,(0,te.Z)({className:L()(!$&&H,Ue),style:(0,re.Z)((0,re.Z)({},me),Ge)},oe,Re,{ref:M}),Fe);return ue&&(ie=W.createElement(A.Z,{onResize:function(ye){var he=ye.offsetWidth;Le(he)},disabled:pe},ie)),ie}var f=W.forwardRef(u);f.displayName="Item";var i=f,o=ae(6089),d=ae(4676),m=ae(16089);function _(C){if(typeof MessageChannel=="undefined")(0,m.Z)(C);else{var M=new MessageChannel;M.port1.onmessage=function(){return C()},M.port2.postMessage(void 0)}}function h(){var C=W.useRef(null),M=function($){C.current||(C.current=[],_(function(){(0,d.unstable_batchedUpdates)(function(){C.current.forEach(function(q){q()}),C.current=null})})),C.current.push($)};return M}function v(C,M){var H=W.useState(M),$=(0,X.Z)(H,2),q=$[0],se=$[1],ue=(0,o.Z)(function(pe){C(function(){se(pe)})});return[q,ue]}var r=W.createContext(null),a=["component"],p=["className"],E=["className"],S=function(M,H){var $=W.useContext(r);if(!$){var q=M.component,se=q===void 0?"div":q,ue=(0,D.Z)(M,a);return W.createElement(se,(0,te.Z)({},ue,{ref:H}))}var pe=$.className,xe=(0,D.Z)($,p),De=M.className,Ue=(0,D.Z)(M,E);return W.createElement(r.Provider,{value:null},W.createElement(i,(0,te.Z)({ref:H,className:L()(pe,De)},xe,Ue)))},w=W.forwardRef(S);w.displayName="RawItem";var R=w,O=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],z="responsive",N="invalidate";function P(C){return"+ ".concat(C.length," ...")}function F(C,M){var H=C.prefixCls,$=H===void 0?"rc-overflow":H,q=C.data,se=q===void 0?[]:q,ue=C.renderItem,pe=C.renderRawItem,xe=C.itemKey,De=C.itemWidth,Ue=De===void 0?10:De,Ge=C.ssr,Ae=C.style,We=C.className,we=C.maxCount,Se=C.renderRest,ge=C.renderRawRest,Re=C.suffix,ve=C.component,Le=ve===void 0?"div":ve,Fe=C.itemComponent,me=C.onVisibleChange,oe=(0,D.Z)(C,O),ie=Ge==="full",fe=h(),ye=v(fe,null),he=(0,X.Z)(ye,2),Te=he[0],Oe=he[1],Be=Te||0,Ze=v(fe,new Map),tt=(0,X.Z)(Ze,2),dt=tt[0],nt=tt[1],At=v(fe,0),Nt=(0,X.Z)(At,2),Bt=Nt[0],st=Nt[1],Ot=v(fe,0),ur=(0,X.Z)(Ot,2),br=ur[0],Qt=ur[1],Fr=v(fe,0),Lt=(0,X.Z)(Fr,2),gt=Lt[0],yt=Lt[1],ir=(0,W.useState)(null),Jt=(0,X.Z)(ir,2),St=Jt[0],it=Jt[1],Rt=(0,W.useState)(null),Vt=(0,X.Z)(Rt,2),jt=Vt[0],Yt=Vt[1],qe=W.useMemo(function(){return jt===null&&ie?Number.MAX_SAFE_INTEGER:jt||0},[jt,Te]),mt=(0,W.useState)(!1),Dt=(0,X.Z)(mt,2),Ft=Dt[0],Zt=Dt[1],_t="".concat($,"-item"),G=Math.max(Bt,br),Y=we===z,J=se.length&&Y,le=we===N,_e=J||typeof we=="number"&&se.length>we,Ie=(0,W.useMemo)(function(){var It=se;return J?Te===null&&ie?It=se:It=se.slice(0,Math.min(se.length,Be/Ue)):typeof we=="number"&&(It=se.slice(0,we)),It},[se,Ue,Te,we,J]),Ce=(0,W.useMemo)(function(){return J?se.slice(qe+1):se.slice(Ie.length)},[se,Ie,J,qe]),Xe=(0,W.useCallback)(function(It,ft){var Ne;return typeof xe=="function"?xe(It):(Ne=xe&&(It==null?void 0:It[xe]))!==null&&Ne!==void 0?Ne:ft},[xe]),Je=(0,W.useCallback)(ue||function(It){return It},[ue]);function bt(It,ft,Ne){jt===It&&(ft===void 0||ft===St)||(Yt(It),Ne||(Zt(It<se.length-1),me==null||me(It)),ft!==void 0&&it(ft))}function Ht(It,ft){Oe(ft.clientWidth)}function Pe(It,ft){nt(function(Ne){var je=new Map(Ne);return ft===null?je.delete(It):je.set(It,ft),je})}function be(It,ft){Qt(ft),st(br)}function ut(It,ft){yt(ft)}function ze(It){return dt.get(Xe(Ie[It],It))}(0,s.Z)(function(){if(Be&&typeof G=="number"&&Ie){var It=gt,ft=Ie.length,Ne=ft-1;if(!ft){bt(0,null);return}for(var je=0;je<ft;je+=1){var et=ze(je);if(ie&&(et=et||0),et===void 0){bt(je-1,void 0,!0);break}if(It+=et,Ne===0&&It<=Be||je===Ne-1&&It+ze(Ne)<=Be){bt(Ne,null);break}else if(It+G>Be){bt(je-1,It-et-gt+br);break}}Re&&ze(0)+gt>Be&&it(null)}},[Be,dt,br,gt,Xe,Ie]);var He=Ft&&!!Ce.length,Qe={};St!==null&&J&&(Qe={position:"absolute",left:St,top:0});var ht={prefixCls:_t,responsive:J,component:Fe,invalidate:le},pt=pe?function(It,ft){var Ne=Xe(It,ft);return W.createElement(r.Provider,{key:Ne,value:(0,re.Z)((0,re.Z)({},ht),{},{order:ft,item:It,itemKey:Ne,registerSize:Pe,display:ft<=qe})},pe(It,ft))}:function(It,ft){var Ne=Xe(It,ft);return W.createElement(i,(0,te.Z)({},ht,{order:ft,key:Ne,item:It,renderItem:Je,itemKey:Ne,registerSize:Pe,display:ft<=qe}))},kt={order:He?qe:Number.MAX_SAFE_INTEGER,className:"".concat(_t,"-rest"),registerSize:be,display:He},Tt=Se||P,Ut=ge?W.createElement(r.Provider,{value:(0,re.Z)((0,re.Z)({},ht),kt)},ge(Ce)):W.createElement(i,(0,te.Z)({},ht,kt),typeof Tt=="function"?Tt(Ce):Tt),ot=W.createElement(Le,(0,te.Z)({className:L()(!le&&$,We),style:Ae,ref:M},oe),Ie.map(pt),_e?Ut:null,Re&&W.createElement(i,(0,te.Z)({},ht,{responsive:Y,responsiveDisabled:!J,order:qe,className:"".concat(_t,"-suffix"),registerSize:ut,display:!0,style:Qe}),Re));return Y?W.createElement(A.Z,{onResize:Ht,disabled:!J},ot):ot}var K=W.forwardRef(F);K.displayName="Overflow",K.Item=R,K.RESPONSIVE=z,K.INVALIDATE=N;var B=K,V=B},25930:function(qt,$e,ae){"use strict";ae.d($e,{Cd:function(){return O}});var te=ae(32855),re=ae(27247),X=ae(43079),D=ae(59301),W=ae(92310),y=ae.n(W),L={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},A=function(){var P=(0,D.useRef)([]),F=(0,D.useRef)(null);return(0,D.useEffect)(function(){var K=Date.now(),B=!1;P.current.forEach(function(V){if(V){B=!0;var C=V.style;C.transitionDuration=".3s, .3s, .3s, .06s",F.current&&K-F.current<100&&(C.transitionDuration="0s, 0s")}}),B&&(F.current=Date.now())}),P.current},s=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"],x=function(P){var F=(0,re.Z)((0,re.Z)({},L),P),K=F.className,B=F.percent,V=F.prefixCls,C=F.strokeColor,M=F.strokeLinecap,H=F.strokeWidth,$=F.style,q=F.trailColor,se=F.trailWidth,ue=F.transition,pe=(0,X.Z)(F,s);delete pe.gapPosition;var xe=Array.isArray(B)?B:[B],De=Array.isArray(C)?C:[C],Ue=A(),Ge=H/2,Ae=100-H/2,We="M ".concat(M==="round"?Ge:0,",").concat(Ge,`
|
|
L `).concat(M==="round"?Ae:100,",").concat(Ge),we="0 0 100 ".concat(H),Se=0;return D.createElement("svg",(0,te.Z)({className:y()("".concat(V,"-line"),K),viewBox:we,preserveAspectRatio:"none",style:$},pe),D.createElement("path",{className:"".concat(V,"-line-trail"),d:We,strokeLinecap:M,stroke:q,strokeWidth:se||H,fillOpacity:"0"}),xe.map(function(ge,Re){var ve=1;switch(M){case"round":ve=1-H/100;break;case"square":ve=1-H/2/100;break;default:ve=1;break}var Le={strokeDasharray:"".concat(ge*ve,"px, 100px"),strokeDashoffset:"-".concat(Se,"px"),transition:ue||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Fe=De[Re]||De[De.length-1];return Se+=ge,D.createElement("path",{key:Re,className:"".concat(V,"-line-path"),d:We,strokeLinecap:M,stroke:Fe,strokeWidth:H,fillOpacity:"0",ref:function(oe){Ue[Re]=oe},style:Le})}))},c=x,u=ae(34666),f=ae(11913),i=ae(47273),o=0,d=(0,i.Z)();function m(){var N;return d?(N=o,o+=1):N="TEST_OR_SSR",N}var _=function(N){var P=D.useState(),F=(0,f.Z)(P,2),K=F[0],B=F[1];return D.useEffect(function(){B("rc_progress_".concat(m()))},[]),N||K},h=function(P){var F=P.bg,K=P.children;return D.createElement("div",{style:{width:"100%",height:"100%",background:F}},K)};function v(N,P){return Object.keys(N).map(function(F){var K=parseFloat(F),B="".concat(Math.floor(K*P),"%");return"".concat(N[F]," ").concat(B)})}var r=D.forwardRef(function(N,P){var F=N.prefixCls,K=N.color,B=N.gradientId,V=N.radius,C=N.style,M=N.ptg,H=N.strokeLinecap,$=N.strokeWidth,q=N.size,se=N.gapDegree,ue=K&&(0,u.Z)(K)==="object",pe=ue?"#FFF":void 0,xe=q/2,De=D.createElement("circle",{className:"".concat(F,"-circle-path"),r:V,cx:xe,cy:xe,stroke:pe,strokeLinecap:H,strokeWidth:$,opacity:M===0?0:1,style:C,ref:P});if(!ue)return De;var Ue="".concat(B,"-conic"),Ge=se?"".concat(180+se/2,"deg"):"0deg",Ae=v(K,(360-se)/360),We=v(K,1),we="conic-gradient(from ".concat(Ge,", ").concat(Ae.join(", "),")"),Se="linear-gradient(to ".concat(se?"bottom":"top",", ").concat(We.join(", "),")");return D.createElement(D.Fragment,null,D.createElement("mask",{id:Ue},De),D.createElement("foreignObject",{x:0,y:0,width:q,height:q,mask:"url(#".concat(Ue,")")},D.createElement(h,{bg:Se},D.createElement(h,{bg:we}))))}),a=r,p=100,E=function(P,F,K,B,V,C,M,H,$,q){var se=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,ue=K/100*360*((360-C)/360),pe=C===0?0:{bottom:0,top:180,left:90,right:-90}[M],xe=(100-B)/100*F;$==="round"&&B!==100&&(xe+=q/2,xe>=F&&(xe=F-.01));var De=p/2;return{stroke:typeof H=="string"?H:void 0,strokeDasharray:"".concat(F,"px ").concat(P),strokeDashoffset:xe+se,transform:"rotate(".concat(V+ue+pe,"deg)"),transformOrigin:"".concat(De,"px ").concat(De,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},S=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function w(N){var P=N!=null?N:[];return Array.isArray(P)?P:[P]}var R=function(P){var F=(0,re.Z)((0,re.Z)({},L),P),K=F.id,B=F.prefixCls,V=F.steps,C=F.strokeWidth,M=F.trailWidth,H=F.gapDegree,$=H===void 0?0:H,q=F.gapPosition,se=F.trailColor,ue=F.strokeLinecap,pe=F.style,xe=F.className,De=F.strokeColor,Ue=F.percent,Ge=(0,X.Z)(F,S),Ae=p/2,We=_(K),we="".concat(We,"-gradient"),Se=Ae-C/2,ge=Math.PI*2*Se,Re=$>0?90+$/2:-90,ve=ge*((360-$)/360),Le=(0,u.Z)(V)==="object"?V:{count:V,gap:2},Fe=Le.count,me=Le.gap,oe=w(Ue),ie=w(De),fe=ie.find(function(tt){return tt&&(0,u.Z)(tt)==="object"}),ye=fe&&(0,u.Z)(fe)==="object",he=ye?"butt":ue,Te=E(ge,ve,0,100,Re,$,q,se,he,C),Oe=A(),Be=function(){var dt=0;return oe.map(function(nt,At){var Nt=ie[At]||ie[ie.length-1],Bt=E(ge,ve,dt,nt,Re,$,q,Nt,he,C);return dt+=nt,D.createElement(a,{key:At,color:Nt,ptg:nt,radius:Se,prefixCls:B,gradientId:we,style:Bt,strokeLinecap:he,strokeWidth:C,gapDegree:$,ref:function(Ot){Oe[At]=Ot},size:p})}).reverse()},Ze=function(){var dt=Math.round(Fe*(oe[0]/100)),nt=100/Fe,At=0;return new Array(Fe).fill(null).map(function(Nt,Bt){var st=Bt<=dt-1?ie[0]:se,Ot=st&&(0,u.Z)(st)==="object"?"url(#".concat(we,")"):void 0,ur=E(ge,ve,At,nt,Re,$,q,st,"butt",C,me);return At+=(ve-ur.strokeDashoffset+me)*100/ve,D.createElement("circle",{key:Bt,className:"".concat(B,"-circle-path"),r:Se,cx:Ae,cy:Ae,stroke:Ot,strokeWidth:C,opacity:1,style:ur,ref:function(Qt){Oe[Bt]=Qt}})})};return D.createElement("svg",(0,te.Z)({className:y()("".concat(B,"-circle"),xe),viewBox:"0 0 ".concat(p," ").concat(p),style:pe,id:K,role:"presentation"},Ge),!Fe&&D.createElement("circle",{className:"".concat(B,"-circle-trail"),r:Se,cx:Ae,cy:Ae,stroke:se,strokeLinecap:he,strokeWidth:M||C,style:Te}),Fe?Ze():Be())},O=R,z={Line:c,Circle:O}},738:function(qt,$e,ae){"use strict";ae.d($e,{Z:function(){return v}});var te=ae(32855),re=ae(74430),X=ae(11913),D=ae(43079),W=ae(92310),y=ae.n(W),L=ae(18929),A=ae(10228),s=ae(26112),x=ae(59301);function c(r,a){var p=r.disabled,E=r.prefixCls,S=r.character,w=r.characterRender,R=r.index,O=r.count,z=r.value,N=r.allowHalf,P=r.focused,F=r.onHover,K=r.onClick,B=function(ue){F(ue,R)},V=function(ue){K(ue,R)},C=function(ue){ue.keyCode===A.Z.ENTER&&K(ue,R)},M=R+1,H=new Set([E]);z===0&&R===0&&P?H.add("".concat(E,"-focused")):N&&z+.5>=M&&z<M?(H.add("".concat(E,"-half")),H.add("".concat(E,"-active")),P&&H.add("".concat(E,"-focused"))):(M<=z?H.add("".concat(E,"-full")):H.add("".concat(E,"-zero")),M===z&&P&&H.add("".concat(E,"-focused")));var $=typeof S=="function"?S(r):S,q=x.createElement("li",{className:y()(Array.from(H)),ref:a},x.createElement("div",{onClick:p?null:V,onKeyDown:p?null:C,onMouseMove:p?null:B,role:"radio","aria-checked":z>R?"true":"false","aria-posinset":R+1,"aria-setsize":O,tabIndex:p?-1:0},x.createElement("div",{className:"".concat(E,"-first")},$),x.createElement("div",{className:"".concat(E,"-second")},$)));return w&&(q=w(q,r)),q}var u=x.forwardRef(c);function f(){var r=x.useRef({});function a(E){return r.current[E]}function p(E){return function(S){r.current[E]=S}}return[a,p]}function i(r){var a=r.pageXOffset,p="scrollLeft";if(typeof a!="number"){var E=r.document;a=E.documentElement[p],typeof a!="number"&&(a=E.body[p])}return a}function o(r){var a,p,E=r.ownerDocument,S=E.body,w=E&&E.documentElement,R=r.getBoundingClientRect();return a=R.left,p=R.top,a-=w.clientLeft||S.clientLeft||0,p-=w.clientTop||S.clientTop||0,{left:a,top:p}}function d(r){var a=o(r),p=r.ownerDocument,E=p.defaultView||p.parentWindow;return a.left+=i(E),a.left}var m=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","keyboard","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function _(r,a){var p=r.prefixCls,E=p===void 0?"rc-rate":p,S=r.className,w=r.defaultValue,R=r.value,O=r.count,z=O===void 0?5:O,N=r.allowHalf,P=N===void 0?!1:N,F=r.allowClear,K=F===void 0?!0:F,B=r.keyboard,V=B===void 0?!0:B,C=r.character,M=C===void 0?"\u2605":C,H=r.characterRender,$=r.disabled,q=r.direction,se=q===void 0?"ltr":q,ue=r.tabIndex,pe=ue===void 0?0:ue,xe=r.autoFocus,De=r.onHoverChange,Ue=r.onChange,Ge=r.onFocus,Ae=r.onBlur,We=r.onKeyDown,we=r.onMouseLeave,Se=(0,D.Z)(r,m),ge=f(),Re=(0,X.Z)(ge,2),ve=Re[0],Le=Re[1],Fe=x.useRef(null),me=function(){if(!$){var it;(it=Fe.current)===null||it===void 0||it.focus()}};x.useImperativeHandle(a,function(){return{focus:me,blur:function(){if(!$){var it;(it=Fe.current)===null||it===void 0||it.blur()}}}});var oe=(0,L.Z)(w||0,{value:R}),ie=(0,X.Z)(oe,2),fe=ie[0],ye=ie[1],he=(0,L.Z)(null),Te=(0,X.Z)(he,2),Oe=Te[0],Be=Te[1],Ze=function(it,Rt){var Vt=se==="rtl",jt=it+1;if(P){var Yt=ve(it),qe=d(Yt),mt=Yt.clientWidth;(Vt&&Rt-qe>mt/2||!Vt&&Rt-qe<mt/2)&&(jt-=.5)}return jt},tt=function(it){ye(it),Ue==null||Ue(it)},dt=x.useState(!1),nt=(0,X.Z)(dt,2),At=nt[0],Nt=nt[1],Bt=function(){Nt(!0),Ge==null||Ge()},st=function(){Nt(!1),Ae==null||Ae()},Ot=x.useState(null),ur=(0,X.Z)(Ot,2),br=ur[0],Qt=ur[1],Fr=function(it,Rt){var Vt=Ze(Rt,it.pageX);Vt!==Oe&&(Qt(Vt),Be(null)),De==null||De(Vt)},Lt=function(it){$||(Qt(null),Be(null),De==null||De(void 0)),it&&(we==null||we(it))},gt=function(it,Rt){var Vt=Ze(Rt,it.pageX),jt=!1;K&&(jt=Vt===fe),Lt(),tt(jt?0:Vt),Be(jt?Vt:null)},yt=function(it){var Rt=it.keyCode,Vt=se==="rtl",jt=P?.5:1;V&&(Rt===A.Z.RIGHT&&fe<z&&!Vt?(tt(fe+jt),it.preventDefault()):Rt===A.Z.LEFT&&fe>0&&!Vt||Rt===A.Z.RIGHT&&fe>0&&Vt?(tt(fe-jt),it.preventDefault()):Rt===A.Z.LEFT&&fe<z&&Vt&&(tt(fe+jt),it.preventDefault())),We==null||We(it)};x.useEffect(function(){xe&&!$&&me()},[]);var ir=new Array(z).fill(0).map(function(St,it){return x.createElement(u,{ref:Le(it),index:it,count:z,disabled:$,prefixCls:"".concat(E,"-star"),allowHalf:P,value:br===null?fe:br,onClick:gt,onHover:Fr,key:St||it,character:M,characterRender:H,focused:At})}),Jt=y()(E,S,(0,re.Z)((0,re.Z)({},"".concat(E,"-disabled"),$),"".concat(E,"-rtl"),se==="rtl"));return x.createElement("ul",(0,te.Z)({className:Jt,onMouseLeave:Lt,tabIndex:$?-1:pe,onFocus:$?null:Bt,onBlur:$?null:st,onKeyDown:$?null:yt,ref:Fe},(0,s.Z)(Se,{aria:!0,data:!0,attr:!0})),ir)}var h=x.forwardRef(_),v=h},29301:function(qt,$e,ae){"use strict";ae.d($e,{Z:function(){return N}});var te=ae(32855),re=ae(59301),X=ae(11592),D=ae(48736),W=ae(27247),y=ae(34666),L=ae(76846),A=ae(8654),s=re.createContext(null);function x(P){var F=P.children,K=P.onBatchResize,B=re.useRef(0),V=re.useRef([]),C=re.useContext(s),M=re.useCallback(function(H,$,q){B.current+=1;var se=B.current;V.current.push({size:H,element:$,data:q}),Promise.resolve().then(function(){se===B.current&&(K==null||K(V.current),V.current=[])}),C==null||C(H,$,q)},[K,C]);return re.createElement(s.Provider,{value:M},F)}var c=ae(76374),u=new Map;function f(P){P.forEach(function(F){var K,B=F.target;(K=u.get(B))===null||K===void 0||K.forEach(function(V){return V(B)})})}var i=new c.Z(f),o=null,d=null;function m(P,F){u.has(P)||(u.set(P,new Set),i.observe(P)),u.get(P).add(F)}function _(P,F){u.has(P)&&(u.get(P).delete(F),u.get(P).size||(i.unobserve(P),u.delete(P)))}var h=ae(33377),v=ae(93912),r=ae(18881),a=ae(85461),p=function(P){(0,r.Z)(K,P);var F=(0,a.Z)(K);function K(){return(0,h.Z)(this,K),F.apply(this,arguments)}return(0,v.Z)(K,[{key:"render",value:function(){return this.props.children}}]),K}(re.Component);function E(P,F){var K=P.children,B=P.disabled,V=re.useRef(null),C=re.useRef(null),M=re.useContext(s),H=typeof K=="function",$=H?K(V):K,q=re.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),se=!H&&re.isValidElement($)&&(0,A.Yr)($),ue=se?(0,A.C4)($):null,pe=(0,A.x1)(ue,V),xe=function(){var Ae;return(0,L.ZP)(V.current)||(V.current&&(0,y.Z)(V.current)==="object"?(0,L.ZP)((Ae=V.current)===null||Ae===void 0?void 0:Ae.nativeElement):null)||(0,L.ZP)(C.current)};re.useImperativeHandle(F,function(){return xe()});var De=re.useRef(P);De.current=P;var Ue=re.useCallback(function(Ge){var Ae=De.current,We=Ae.onResize,we=Ae.data,Se=Ge.getBoundingClientRect(),ge=Se.width,Re=Se.height,ve=Ge.offsetWidth,Le=Ge.offsetHeight,Fe=Math.floor(ge),me=Math.floor(Re);if(q.current.width!==Fe||q.current.height!==me||q.current.offsetWidth!==ve||q.current.offsetHeight!==Le){var oe={width:Fe,height:me,offsetWidth:ve,offsetHeight:Le};q.current=oe;var ie=ve===Math.round(ge)?ge:ve,fe=Le===Math.round(Re)?Re:Le,ye=(0,W.Z)((0,W.Z)({},oe),{},{offsetWidth:ie,offsetHeight:fe});M==null||M(ye,Ge,we),We&&Promise.resolve().then(function(){We(ye,Ge)})}},[]);return re.useEffect(function(){var Ge=xe();return Ge&&!B&&m(Ge,Ue),function(){return _(Ge,Ue)}},[V.current,B]),re.createElement(p,{ref:C},se?re.cloneElement($,{ref:pe}):$)}var S=re.forwardRef(E),w=S,R="rc-observer-key";function O(P,F){var K=P.children,B=typeof K=="function"?[K]:(0,X.Z)(K);return B.map(function(V,C){var M=(V==null?void 0:V.key)||"".concat(R,"-").concat(C);return re.createElement(w,(0,te.Z)({},P,{key:M,ref:C===0?F:void 0}),V)})}var z=re.forwardRef(O);z.Collection=x;var N=z},6551:function(qt,$e,ae){"use strict";ae.d($e,{ZP:function(){return L}});var te=ae(11913),re=ae(59301),X=ae(47273),D=0,W=(0,X.Z)();function y(){var A;return W?(A=D,D+=1):A="TEST_OR_SSR",A}function L(A){var s=re.useState(),x=(0,te.Z)(s,2),c=x[0],u=x[1];return re.useEffect(function(){u("rc_select_".concat(y()))},[]),A||c}},37463:function(qt,$e,ae){"use strict";ae.d($e,{Ac:function(){return Nt},Xo:function(){return st},Wx:function(){return ur},ZP:function(){return Ht},lk:function(){return v}});var te=ae(32855),re=ae(3300),X=ae(74430),D=ae(27247),W=ae(11913),y=ae(43079),L=ae(34666),A=ae(18929),s=ae(48736),x=ae(59301),c=ae(92310),u=ae.n(c),f=ae(34280),i=ae(49658),o=ae(8654),d=function(be){var ut=be.className,ze=be.customizeIcon,He=be.customizeIconProps,Qe=be.children,ht=be.onMouseDown,pt=be.onClick,kt=typeof ze=="function"?ze(He):ze;return x.createElement("span",{className:ut,onMouseDown:function(Ut){Ut.preventDefault(),ht==null||ht(Ut)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:pt,"aria-hidden":!0},kt!==void 0?kt:x.createElement("span",{className:u()(ut.split(/\s+/).map(function(Tt){return"".concat(Tt,"-icon")}))},Qe))},m=d,_=function(be,ut,ze,He,Qe){var ht=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,pt=arguments.length>6?arguments[6]:void 0,kt=arguments.length>7?arguments[7]:void 0,Tt=x.useMemo(function(){if((0,L.Z)(He)==="object")return He.clearIcon;if(Qe)return Qe},[He,Qe]),Ut=x.useMemo(function(){return!!(!ht&&He&&(ze.length||pt)&&!(kt==="combobox"&&pt===""))},[He,ht,ze.length,pt,kt]);return{allowClear:Ut,clearIcon:x.createElement(m,{className:"".concat(be,"-clear"),onMouseDown:ut,customizeIcon:Tt},"\xD7")}},h=x.createContext(null);function v(){return x.useContext(h)}function r(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,be=x.useState(!1),ut=(0,W.Z)(be,2),ze=ut[0],He=ut[1],Qe=x.useRef(null),ht=function(){window.clearTimeout(Qe.current)};x.useEffect(function(){return ht},[]);var pt=function(Tt,Ut){ht(),Qe.current=window.setTimeout(function(){He(Tt),Ut&&Ut()},Pe)};return[ze,pt,ht]}function a(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,be=x.useRef(null),ut=x.useRef(null);x.useEffect(function(){return function(){window.clearTimeout(ut.current)}},[]);function ze(He){(He||be.current===null)&&(be.current=He),window.clearTimeout(ut.current),ut.current=window.setTimeout(function(){be.current=null},Pe)}return[function(){return be.current},ze]}function p(Pe,be,ut,ze){var He=x.useRef(null);He.current={open:be,triggerOpen:ut,customizedTrigger:ze},x.useEffect(function(){function Qe(ht){var pt;if(!((pt=He.current)!==null&&pt!==void 0&&pt.customizedTrigger)){var kt=ht.target;kt.shadowRoot&&ht.composed&&(kt=ht.composedPath()[0]||kt),He.current.open&&Pe().filter(function(Tt){return Tt}).every(function(Tt){return!Tt.contains(kt)&&Tt!==kt})&&He.current.triggerOpen(!1)}}return window.addEventListener("mousedown",Qe),function(){return window.removeEventListener("mousedown",Qe)}},[])}var E=ae(10228);function S(Pe){return Pe&&![E.Z.ESC,E.Z.SHIFT,E.Z.BACKSPACE,E.Z.TAB,E.Z.WIN_KEY,E.Z.ALT,E.Z.META,E.Z.WIN_KEY_RIGHT,E.Z.CTRL,E.Z.SEMICOLON,E.Z.EQUALS,E.Z.CAPS_LOCK,E.Z.CONTEXT_MENU,E.Z.F1,E.Z.F2,E.Z.F3,E.Z.F4,E.Z.F5,E.Z.F6,E.Z.F7,E.Z.F8,E.Z.F9,E.Z.F10,E.Z.F11,E.Z.F12].includes(Pe)}var w=ae(26112),R=ae(11780);function O(Pe,be,ut){var ze=(0,D.Z)((0,D.Z)({},Pe),ut?be:{});return Object.keys(be).forEach(function(He){var Qe=be[He];typeof Qe=="function"&&(ze[He]=function(){for(var ht,pt=arguments.length,kt=new Array(pt),Tt=0;Tt<pt;Tt++)kt[Tt]=arguments[Tt];return Qe.apply(void 0,kt),(ht=Pe[He])===null||ht===void 0?void 0:ht.call.apply(ht,[Pe].concat(kt))})}),ze}var z=O,N=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],P=function(be,ut){var ze=be.prefixCls,He=be.id,Qe=be.inputElement,ht=be.autoFocus,pt=be.autoComplete,kt=be.editable,Tt=be.activeDescendantId,Ut=be.value,ot=be.open,It=be.attrs,ft=(0,y.Z)(be,N),Ne=Qe||x.createElement("input",null),je=Ne,et=je.ref,Ke=je.props;return(0,s.Kp)(!("maxLength"in Ne.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),Ne=x.cloneElement(Ne,(0,D.Z)((0,D.Z)((0,D.Z)({type:"search"},z(ft,Ke,!0)),{},{id:He,ref:(0,o.sQ)(ut,et),autoComplete:pt||"off",autoFocus:ht,className:u()("".concat(ze,"-selection-search-input"),Ke==null?void 0:Ke.className),role:"combobox","aria-expanded":ot||!1,"aria-haspopup":"listbox","aria-owns":"".concat(He,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(He,"_list"),"aria-activedescendant":ot?Tt:void 0},It),{},{value:kt?Ut:"",readOnly:!kt,unselectable:kt?null:"on",style:(0,D.Z)((0,D.Z)({},Ke.style),{},{opacity:kt?null:0})})),Ne},F=x.forwardRef(P),K=F;function B(Pe){return Array.isArray(Pe)?Pe:Pe!==void 0?[Pe]:[]}var V=typeof window!="undefined"&&window.document&&window.document.documentElement,C=V;function M(Pe){return Pe!=null}function H(Pe){return!Pe&&Pe!==0}function $(Pe){return["string","number"].includes((0,L.Z)(Pe))}function q(Pe){var be=void 0;return Pe&&($(Pe.title)?be=Pe.title.toString():$(Pe.label)&&(be=Pe.label.toString())),be}function se(Pe,be){C?x.useLayoutEffect(Pe,be):x.useEffect(Pe,be)}function ue(Pe){var be;return(be=Pe.key)!==null&&be!==void 0?be:Pe.value}var pe=function(be){be.preventDefault(),be.stopPropagation()},xe=function(be){var ut=be.id,ze=be.prefixCls,He=be.values,Qe=be.open,ht=be.searchValue,pt=be.autoClearSearchValue,kt=be.inputRef,Tt=be.placeholder,Ut=be.disabled,ot=be.mode,It=be.showSearch,ft=be.autoFocus,Ne=be.autoComplete,je=be.activeDescendantId,et=be.tabIndex,Ke=be.removeIcon,Et=be.maxTagCount,wt=be.maxTagTextLength,Pt=be.maxTagPlaceholder,zt=Pt===void 0?function(rr){return"+ ".concat(rr.length," ...")}:Pt,er=be.tagRender,$t=be.onToggleOpen,_r=be.onRemove,Ve=be.onInputChange,Xt=be.onInputPaste,ar=be.onInputKeyDown,mr=be.onInputMouseDown,sr=be.onInputCompositionStart,nr=be.onInputCompositionEnd,cr=be.onInputBlur,Mr=x.useRef(null),Sr=(0,x.useState)(0),Er=(0,W.Z)(Sr,2),Cr=Er[0],vr=Er[1],pr=(0,x.useState)(!1),Qr=(0,W.Z)(pr,2),zr=Qr[0],Wr=Qr[1],wr="".concat(ze,"-selection"),on=Qe||ot==="multiple"&&pt===!1||ot==="tags"?ht:"",Xr=ot==="tags"||ot==="multiple"&&pt===!1||It&&(Qe||zr);se(function(){vr(Mr.current.scrollWidth)},[on]);var Gr=function(tr,Tr,Hr,qr,Kr){return x.createElement("span",{title:q(tr),className:u()("".concat(wr,"-item"),(0,X.Z)({},"".concat(wr,"-item-disabled"),Hr))},x.createElement("span",{className:"".concat(wr,"-item-content")},Tr),qr&&x.createElement(m,{className:"".concat(wr,"-item-remove"),onMouseDown:pe,onClick:Kr,customizeIcon:Ke},"\xD7"))},un=function(tr,Tr,Hr,qr,Kr,rn){var En=function(bn){pe(bn),$t(!Qe)};return x.createElement("span",{onMouseDown:En},er({label:Tr,value:tr,disabled:Hr,closable:qr,onClose:Kr,isMaxTag:!!rn}))},Jr=function(tr){var Tr=tr.disabled,Hr=tr.label,qr=tr.value,Kr=!Ut&&!Tr,rn=Hr;if(typeof wt=="number"&&(typeof Hr=="string"||typeof Hr=="number")){var En=String(rn);En.length>wt&&(rn="".concat(En.slice(0,wt),"..."))}var gn=function($r){$r&&$r.stopPropagation(),_r(tr)};return typeof er=="function"?un(qr,rn,Tr,Kr,gn):Gr(tr,rn,Tr,Kr,gn)},gr=function(tr){if(!He.length)return null;var Tr=typeof zt=="function"?zt(tr):zt;return typeof er=="function"?un(void 0,Tr,!1,!1,void 0,!0):Gr({title:Tr},Tr,!1)},Wt=x.createElement("div",{className:"".concat(wr,"-search"),style:{width:Cr},onFocus:function(){Wr(!0)},onBlur:function(){Wr(!1)}},x.createElement(K,{ref:kt,open:Qe,prefixCls:ze,id:ut,inputElement:null,disabled:Ut,autoFocus:ft,autoComplete:Ne,editable:Xr,activeDescendantId:je,value:on,onKeyDown:ar,onMouseDown:mr,onChange:Ve,onPaste:Xt,onCompositionStart:sr,onCompositionEnd:nr,onBlur:cr,tabIndex:et,attrs:(0,w.Z)(be,!0)}),x.createElement("span",{ref:Mr,className:"".concat(wr,"-search-mirror"),"aria-hidden":!0},on,"\xA0")),Mt=x.createElement(R.Z,{prefixCls:"".concat(wr,"-overflow"),data:He,renderItem:Jr,renderRest:gr,suffix:Wt,itemKey:ue,maxCount:Et});return x.createElement("span",{className:"".concat(wr,"-wrap")},Mt,!He.length&&!on&&x.createElement("span",{className:"".concat(wr,"-placeholder")},Tt))},De=xe,Ue=function(be){var ut=be.inputElement,ze=be.prefixCls,He=be.id,Qe=be.inputRef,ht=be.disabled,pt=be.autoFocus,kt=be.autoComplete,Tt=be.activeDescendantId,Ut=be.mode,ot=be.open,It=be.values,ft=be.placeholder,Ne=be.tabIndex,je=be.showSearch,et=be.searchValue,Ke=be.activeValue,Et=be.maxLength,wt=be.onInputKeyDown,Pt=be.onInputMouseDown,zt=be.onInputChange,er=be.onInputPaste,$t=be.onInputCompositionStart,_r=be.onInputCompositionEnd,Ve=be.onInputBlur,Xt=be.title,ar=x.useState(!1),mr=(0,W.Z)(ar,2),sr=mr[0],nr=mr[1],cr=Ut==="combobox",Mr=cr||je,Sr=It[0],Er=et||"";cr&&Ke&&!sr&&(Er=Ke),x.useEffect(function(){cr&&nr(!1)},[cr,Ke]);var Cr=Ut!=="combobox"&&!ot&&!je?!1:!!Er,vr=Xt===void 0?q(Sr):Xt,pr=x.useMemo(function(){return Sr?null:x.createElement("span",{className:"".concat(ze,"-selection-placeholder"),style:Cr?{visibility:"hidden"}:void 0},ft)},[Sr,Cr,ft,ze]);return x.createElement("span",{className:"".concat(ze,"-selection-wrap")},x.createElement("span",{className:"".concat(ze,"-selection-search")},x.createElement(K,{ref:Qe,prefixCls:ze,id:He,open:ot,inputElement:ut,disabled:ht,autoFocus:pt,autoComplete:kt,editable:Mr,activeDescendantId:Tt,value:Er,onKeyDown:wt,onMouseDown:Pt,onChange:function(zr){nr(!0),zt(zr)},onPaste:er,onCompositionStart:$t,onCompositionEnd:_r,onBlur:Ve,tabIndex:Ne,attrs:(0,w.Z)(be,!0),maxLength:cr?Et:void 0})),!cr&&Sr?x.createElement("span",{className:"".concat(ze,"-selection-item"),title:vr,style:Cr?{visibility:"hidden"}:void 0},Sr.label):null,pr)},Ge=Ue,Ae=function(be,ut){var ze=(0,x.useRef)(null),He=(0,x.useRef)(!1),Qe=be.prefixCls,ht=be.open,pt=be.mode,kt=be.showSearch,Tt=be.tokenWithEnter,Ut=be.disabled,ot=be.prefix,It=be.autoClearSearchValue,ft=be.onSearch,Ne=be.onSearchSubmit,je=be.onToggleOpen,et=be.onInputKeyDown,Ke=be.onInputBlur,Et=be.domRef;x.useImperativeHandle(ut,function(){return{focus:function(vr){ze.current.focus(vr)},blur:function(){ze.current.blur()}}});var wt=a(0),Pt=(0,W.Z)(wt,2),zt=Pt[0],er=Pt[1],$t=function(vr){var pr=vr.which,Qr=ze.current instanceof HTMLTextAreaElement;!Qr&&ht&&(pr===E.Z.UP||pr===E.Z.DOWN)&&vr.preventDefault(),et&&et(vr),pr===E.Z.ENTER&&pt==="tags"&&!He.current&&!ht&&(Ne==null||Ne(vr.target.value)),!(Qr&&!ht&&~[E.Z.UP,E.Z.DOWN,E.Z.LEFT,E.Z.RIGHT].indexOf(pr))&&S(pr)&&je(!0)},_r=function(){er(!0)},Ve=(0,x.useRef)(null),Xt=function(vr){ft(vr,!0,He.current)!==!1&&je(!0)},ar=function(){He.current=!0},mr=function(vr){He.current=!1,pt!=="combobox"&&Xt(vr.target.value)},sr=function(vr){var pr=vr.target.value;if(Tt&&Ve.current&&/[\r\n]/.test(Ve.current)){var Qr=Ve.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");pr=pr.replace(Qr,Ve.current)}Ve.current=null,Xt(pr)},nr=function(vr){var pr=vr.clipboardData,Qr=pr==null?void 0:pr.getData("text");Ve.current=Qr||""},cr=function(vr){var pr=vr.target;if(pr!==ze.current){var Qr=document.body.style.msTouchAction!==void 0;Qr?setTimeout(function(){ze.current.focus()}):ze.current.focus()}},Mr=function(vr){var pr=zt();vr.target!==ze.current&&!pr&&!(pt==="combobox"&&Ut)&&vr.preventDefault(),(pt!=="combobox"&&(!kt||!pr)||!ht)&&(ht&&It!==!1&&ft("",!0,!1),je())},Sr={inputRef:ze,onInputKeyDown:$t,onInputMouseDown:_r,onInputChange:sr,onInputPaste:nr,onInputCompositionStart:ar,onInputCompositionEnd:mr,onInputBlur:Ke},Er=pt==="multiple"||pt==="tags"?x.createElement(De,(0,te.Z)({},be,Sr)):x.createElement(Ge,(0,te.Z)({},be,Sr));return x.createElement("div",{ref:Et,className:"".concat(Qe,"-selector"),onClick:cr,onMouseDown:Mr},ot&&x.createElement("div",{className:"".concat(Qe,"-prefix")},ot),Er)},We=x.forwardRef(Ae),we=We,Se=ae(65030),ge=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Re=function(be){var ut=be===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:ut,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:ut,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:ut,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:ut,adjustY:1},htmlRegion:"scroll"}}},ve=function(be,ut){var ze=be.prefixCls,He=be.disabled,Qe=be.visible,ht=be.children,pt=be.popupElement,kt=be.animation,Tt=be.transitionName,Ut=be.dropdownStyle,ot=be.dropdownClassName,It=be.direction,ft=It===void 0?"ltr":It,Ne=be.placement,je=be.builtinPlacements,et=be.dropdownMatchSelectWidth,Ke=be.dropdownRender,Et=be.dropdownAlign,wt=be.getPopupContainer,Pt=be.empty,zt=be.getTriggerDOMNode,er=be.onPopupVisibleChange,$t=be.onPopupMouseEnter,_r=(0,y.Z)(be,ge),Ve="".concat(ze,"-dropdown"),Xt=pt;Ke&&(Xt=Ke(pt));var ar=x.useMemo(function(){return je||Re(et)},[je,et]),mr=kt?"".concat(Ve,"-").concat(kt):Tt,sr=typeof et=="number",nr=x.useMemo(function(){return sr?null:et===!1?"minWidth":"width"},[et,sr]),cr=Ut;sr&&(cr=(0,D.Z)((0,D.Z)({},cr),{},{width:et}));var Mr=x.useRef(null);return x.useImperativeHandle(ut,function(){return{getPopupElement:function(){var Er;return(Er=Mr.current)===null||Er===void 0?void 0:Er.popupElement}}}),x.createElement(Se.Z,(0,te.Z)({},_r,{showAction:er?["click"]:[],hideAction:er?["click"]:[],popupPlacement:Ne||(ft==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:ar,prefixCls:Ve,popupTransitionName:mr,popup:x.createElement("div",{onMouseEnter:$t},Xt),ref:Mr,stretch:nr,popupAlign:Et,popupVisible:Qe,getPopupContainer:wt,popupClassName:u()(ot,(0,X.Z)({},"".concat(Ve,"-empty"),Pt)),popupStyle:cr,getTriggerDOMNode:zt,onPopupVisibleChange:er}),ht)},Le=x.forwardRef(ve),Fe=Le,me=ae(40954);function oe(Pe,be){var ut=Pe.key,ze;return"value"in Pe&&(ze=Pe.value),ut!=null?ut:ze!==void 0?ze:"rc-index-key-".concat(be)}function ie(Pe){return typeof Pe!="undefined"&&!Number.isNaN(Pe)}function fe(Pe,be){var ut=Pe||{},ze=ut.label,He=ut.value,Qe=ut.options,ht=ut.groupLabel,pt=ze||(be?"children":"label");return{label:pt,value:He||"value",options:Qe||"options",groupLabel:ht||pt}}function ye(Pe){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ut=be.fieldNames,ze=be.childrenAsData,He=[],Qe=fe(ut,!1),ht=Qe.label,pt=Qe.value,kt=Qe.options,Tt=Qe.groupLabel;function Ut(ot,It){Array.isArray(ot)&&ot.forEach(function(ft){if(It||!(kt in ft)){var Ne=ft[pt];He.push({key:oe(ft,He.length),groupOption:It,data:ft,label:ft[ht],value:Ne})}else{var je=ft[Tt];je===void 0&&ze&&(je=ft.label),He.push({key:oe(ft,He.length),group:!0,data:ft,label:je}),Ut(ft[kt],!0)}})}return Ut(Pe,!1),He}function he(Pe){var be=(0,D.Z)({},Pe);return"props"in be||Object.defineProperty(be,"props",{get:function(){return(0,s.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),be}}),be}var Te=function(be,ut,ze){if(!ut||!ut.length)return null;var He=!1,Qe=function pt(kt,Tt){var Ut=(0,me.Z)(Tt),ot=Ut[0],It=Ut.slice(1);if(!ot)return[kt];var ft=kt.split(ot);return He=He||ft.length>1,ft.reduce(function(Ne,je){return[].concat((0,re.Z)(Ne),(0,re.Z)(pt(je,It)))},[]).filter(Boolean)},ht=Qe(be,ut);return He?typeof ze!="undefined"?ht.slice(0,ze):ht:null},Oe=x.createContext(null),Be=Oe;function Ze(Pe){var be=Pe.visible,ut=Pe.values;if(!be)return null;var ze=50;return x.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(ut.slice(0,ze).map(function(He){var Qe=He.label,ht=He.value;return["number","string"].includes((0,L.Z)(Qe))?Qe:ht}).join(", ")),ut.length>ze?", ...":null)}var tt=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],dt=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],nt=function(be){return be==="tags"||be==="multiple"},At=x.forwardRef(function(Pe,be){var ut,ze=Pe.id,He=Pe.prefixCls,Qe=Pe.className,ht=Pe.showSearch,pt=Pe.tagRender,kt=Pe.direction,Tt=Pe.omitDomProps,Ut=Pe.displayValues,ot=Pe.onDisplayValuesChange,It=Pe.emptyOptions,ft=Pe.notFoundContent,Ne=ft===void 0?"Not Found":ft,je=Pe.onClear,et=Pe.mode,Ke=Pe.disabled,Et=Pe.loading,wt=Pe.getInputElement,Pt=Pe.getRawInputElement,zt=Pe.open,er=Pe.defaultOpen,$t=Pe.onDropdownVisibleChange,_r=Pe.activeValue,Ve=Pe.onActiveValueChange,Xt=Pe.activeDescendantId,ar=Pe.searchValue,mr=Pe.autoClearSearchValue,sr=Pe.onSearch,nr=Pe.onSearchSplit,cr=Pe.tokenSeparators,Mr=Pe.allowClear,Sr=Pe.prefix,Er=Pe.suffixIcon,Cr=Pe.clearIcon,vr=Pe.OptionList,pr=Pe.animation,Qr=Pe.transitionName,zr=Pe.dropdownStyle,Wr=Pe.dropdownClassName,wr=Pe.dropdownMatchSelectWidth,on=Pe.dropdownRender,Xr=Pe.dropdownAlign,Gr=Pe.placement,un=Pe.builtinPlacements,Jr=Pe.getPopupContainer,gr=Pe.showAction,Wt=gr===void 0?[]:gr,Mt=Pe.onFocus,rr=Pe.onBlur,tr=Pe.onKeyUp,Tr=Pe.onKeyDown,Hr=Pe.onMouseDown,qr=(0,y.Z)(Pe,tt),Kr=nt(et),rn=(ht!==void 0?ht:Kr)||et==="combobox",En=(0,D.Z)({},qr);dt.forEach(function(nn){delete En[nn]}),Tt==null||Tt.forEach(function(nn){delete En[nn]});var gn=x.useState(!1),bn=(0,W.Z)(gn,2),$r=bn[0],Sn=bn[1];x.useEffect(function(){Sn((0,i.Z)())},[]);var _n=x.useRef(null),Ln=x.useRef(null),ln=x.useRef(null),cn=x.useRef(null),fn=x.useRef(null),Dr=x.useRef(!1),kn=r(),Bn=(0,W.Z)(kn,3),wn=Bn[0],Rn=Bn[1],Yn=Bn[2];x.useImperativeHandle(be,function(){var nn,en;return{focus:(nn=cn.current)===null||nn===void 0?void 0:nn.focus,blur:(en=cn.current)===null||en===void 0?void 0:en.blur,scrollTo:function(Vn){var Cn;return(Cn=fn.current)===null||Cn===void 0?void 0:Cn.scrollTo(Vn)},nativeElement:_n.current||Ln.current}});var Un=x.useMemo(function(){var nn;if(et!=="combobox")return ar;var en=(nn=Ut[0])===null||nn===void 0?void 0:nn.value;return typeof en=="string"||typeof en=="number"?String(en):""},[ar,et,Ut]),zn=et==="combobox"&&typeof wt=="function"&&wt()||null,Vr=typeof Pt=="function"&&Pt(),ci=(0,o.x1)(Ln,Vr==null||(ut=Vr.props)===null||ut===void 0?void 0:ut.ref),oi=x.useState(!1),$n=(0,W.Z)(oi,2),ri=$n[0],Qn=$n[1];(0,f.Z)(function(){Qn(!0)},[]);var jn=(0,A.Z)(!1,{defaultValue:er,value:zt}),Tn=(0,W.Z)(jn,2),Mn=Tn[0],On=Tn[1],tn=ri?Mn:!1,mn=!Ne&&It;(Ke||mn&&tn&&et==="combobox")&&(tn=!1);var An=mn?!1:tn,xr=x.useCallback(function(nn){var en=nn!==void 0?nn:!tn;Ke||(On(en),tn!==en&&($t==null||$t(en)))},[Ke,tn,On,$t]),kr=x.useMemo(function(){return(cr||[]).some(function(nn){return[`
|
|
`,`\r
|
|
`].includes(nn)})},[cr]),Or=x.useContext(Be)||{},Nr=Or.maxCount,Br=Or.rawValues,Yr=function(en,Gn,Vn){if(!(Kr&&ie(Nr)&&(Br==null?void 0:Br.size)>=Nr)){var Cn=!0,In=en;Ve==null||Ve(null);var ii=Te(en,cr,ie(Nr)?Nr-Br.size:void 0),ai=Vn?null:ii;return et!=="combobox"&&ai&&(In="",nr==null||nr(ai),xr(!1),Cn=!1),sr&&Un!==In&&sr(In,{source:Gn?"typing":"effect"}),Cn}},Wn=function(en){!en||!en.trim()||sr(en,{source:"submit"})};x.useEffect(function(){!tn&&!Kr&&et!=="combobox"&&Yr("",!1,!1)},[tn]),x.useEffect(function(){Mn&&Ke&&On(!1),Ke&&!Dr.current&&Rn(!1)},[Ke]);var or=a(),Ar=(0,W.Z)(or,2),jr=Ar[0],pn=Ar[1],dn=x.useRef(!1),hi=function(en){var Gn=jr(),Vn=en.key,Cn=Vn==="Enter";if(Cn&&(et!=="combobox"&&en.preventDefault(),tn||xr(!0)),pn(!!Un),Vn==="Backspace"&&!Gn&&Kr&&!Un&&Ut.length){for(var In=(0,re.Z)(Ut),ii=null,ai=In.length-1;ai>=0;ai-=1){var mi=In[ai];if(!mi.disabled){In.splice(ai,1),ii=mi;break}}ii&&ot(In,{type:"remove",values:[ii]})}for(var pi=arguments.length,gi=new Array(pi>1?pi-1:0),Oi=1;Oi<pi;Oi++)gi[Oi-1]=arguments[Oi];if(tn&&(!Cn||!dn.current)){var zi;Cn&&(dn.current=!0),(zi=fn.current)===null||zi===void 0||zi.onKeyDown.apply(zi,[en].concat(gi))}Tr==null||Tr.apply(void 0,[en].concat(gi))},Zn=function(en){for(var Gn=arguments.length,Vn=new Array(Gn>1?Gn-1:0),Cn=1;Cn<Gn;Cn++)Vn[Cn-1]=arguments[Cn];if(tn){var In;(In=fn.current)===null||In===void 0||In.onKeyUp.apply(In,[en].concat(Vn))}en.key==="Enter"&&(dn.current=!1),tr==null||tr.apply(void 0,[en].concat(Vn))},ni=function(en){var Gn=Ut.filter(function(Vn){return Vn!==en});ot(Gn,{type:"remove",values:[en]})},Fn=function(){dn.current=!1},ki=x.useRef(!1),ia=function(){Rn(!0),Ke||(Mt&&!ki.current&&Mt.apply(void 0,arguments),Wt.includes("focus")&&xr(!0)),ki.current=!0},aa=function(){Dr.current=!0,Rn(!1,function(){ki.current=!1,Dr.current=!1,xr(!1)}),!Ke&&(Un&&(et==="tags"?sr(Un,{source:"submit"}):et==="multiple"&&sr("",{source:"blur"})),rr&&rr.apply(void 0,arguments))},Di=[];x.useEffect(function(){return function(){Di.forEach(function(nn){return clearTimeout(nn)}),Di.splice(0,Di.length)}},[]);var Wi=function(en){var Gn,Vn=en.target,Cn=(Gn=ln.current)===null||Gn===void 0?void 0:Gn.getPopupElement();if(Cn&&Cn.contains(Vn)){var In=setTimeout(function(){var pi=Di.indexOf(In);if(pi!==-1&&Di.splice(pi,1),Yn(),!$r&&!Cn.contains(document.activeElement)){var gi;(gi=cn.current)===null||gi===void 0||gi.focus()}});Di.push(In)}for(var ii=arguments.length,ai=new Array(ii>1?ii-1:0),mi=1;mi<ii;mi++)ai[mi-1]=arguments[mi];Hr==null||Hr.apply(void 0,[en].concat(ai))},Ki=x.useState({}),li=(0,W.Z)(Ki,2),Gi=li[1];function xi(){Gi({})}var Vi;Vr&&(Vi=function(en){xr(en)}),p(function(){var nn;return[_n.current,(nn=ln.current)===null||nn===void 0?void 0:nn.getPopupElement()]},An,xr,!!Vr);var $i=x.useMemo(function(){return(0,D.Z)((0,D.Z)({},Pe),{},{notFoundContent:Ne,open:tn,triggerOpen:An,id:ze,showSearch:rn,multiple:Kr,toggleOpen:xr})},[Pe,Ne,An,tn,ze,rn,Kr,xr]),Qi=!!Er||Et,Hi;Qi&&(Hi=x.createElement(m,{className:u()("".concat(He,"-arrow"),(0,X.Z)({},"".concat(He,"-arrow-loading"),Et)),customizeIcon:Er,customizeIconProps:{loading:Et,searchValue:Un,open:tn,focused:wn,showSearch:rn}}));var va=function(){var en;je==null||je(),(en=cn.current)===null||en===void 0||en.focus(),ot([],{type:"clear",values:Ut}),Yr("",!1,!1)},Pi=_(He,va,Ut,Mr,Cr,Ke,Un,et),sa=Pi.allowClear,oa=Pi.clearIcon,fi=x.createElement(vr,{ref:fn}),la=u()(He,Qe,(0,X.Z)((0,X.Z)((0,X.Z)((0,X.Z)((0,X.Z)((0,X.Z)((0,X.Z)((0,X.Z)((0,X.Z)((0,X.Z)({},"".concat(He,"-focused"),wn),"".concat(He,"-multiple"),Kr),"".concat(He,"-single"),!Kr),"".concat(He,"-allow-clear"),Mr),"".concat(He,"-show-arrow"),Qi),"".concat(He,"-disabled"),Ke),"".concat(He,"-loading"),Et),"".concat(He,"-open"),tn),"".concat(He,"-customize-input"),zn),"".concat(He,"-show-search"),rn)),Mi=x.createElement(Fe,{ref:ln,disabled:Ke,prefixCls:He,visible:An,popupElement:fi,animation:pr,transitionName:Qr,dropdownStyle:zr,dropdownClassName:Wr,direction:kt,dropdownMatchSelectWidth:wr,dropdownRender:on,dropdownAlign:Xr,placement:Gr,builtinPlacements:un,getPopupContainer:Jr,empty:It,getTriggerDOMNode:function(en){return Ln.current||en},onPopupVisibleChange:Vi,onPopupMouseEnter:xi},Vr?x.cloneElement(Vr,{ref:ci}):x.createElement(we,(0,te.Z)({},Pe,{domRef:Ln,prefixCls:He,inputElement:zn,ref:cn,id:ze,prefix:Sr,showSearch:rn,autoClearSearchValue:mr,mode:et,activeDescendantId:Xt,tagRender:pt,values:Ut,open:tn,onToggleOpen:xr,activeValue:_r,searchValue:Un,onSearch:Yr,onSearchSubmit:Wn,onRemove:ni,tokenWithEnter:kr,onInputBlur:Fn}))),_i;return Vr?_i=Mi:_i=x.createElement("div",(0,te.Z)({className:la},En,{ref:_n,onMouseDown:Wi,onKeyDown:hi,onKeyUp:Zn,onFocus:ia,onBlur:aa}),x.createElement(Ze,{visible:wn&&!tn,values:Ut}),Mi,Hi,sa&&oa),x.createElement(h.Provider,{value:$i},_i)}),Nt=At,Bt=function(){return null};Bt.isSelectOptGroup=!0;var st=Bt,Ot=function(){return null};Ot.isSelectOption=!0;var ur=Ot,br=ae(80547),Qt=ae(2738),Fr=ae(6790);function Lt(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var gt=["disabled","title","children","style","className"];function yt(Pe){return typeof Pe=="string"||typeof Pe=="number"}var ir=function(be,ut){var ze=v(),He=ze.prefixCls,Qe=ze.id,ht=ze.open,pt=ze.multiple,kt=ze.mode,Tt=ze.searchValue,Ut=ze.toggleOpen,ot=ze.notFoundContent,It=ze.onPopupScroll,ft=x.useContext(Be),Ne=ft.maxCount,je=ft.flattenOptions,et=ft.onActiveValue,Ke=ft.defaultActiveFirstOption,Et=ft.onSelect,wt=ft.menuItemSelectedIcon,Pt=ft.rawValues,zt=ft.fieldNames,er=ft.virtual,$t=ft.direction,_r=ft.listHeight,Ve=ft.listItemHeight,Xt=ft.optionRender,ar="".concat(He,"-item"),mr=(0,br.Z)(function(){return je},[ht,je],function(gr,Wt){return Wt[0]&&gr[1]!==Wt[1]}),sr=x.useRef(null),nr=x.useMemo(function(){return pt&&ie(Ne)&&(Pt==null?void 0:Pt.size)>=Ne},[pt,Ne,Pt==null?void 0:Pt.size]),cr=function(Wt){Wt.preventDefault()},Mr=function(Wt){var Mt;(Mt=sr.current)===null||Mt===void 0||Mt.scrollTo(typeof Wt=="number"?{index:Wt}:Wt)},Sr=x.useCallback(function(gr){return kt==="combobox"?!1:Pt.has(gr)},[kt,(0,re.Z)(Pt).toString(),Pt.size]),Er=function(Wt){for(var Mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,rr=mr.length,tr=0;tr<rr;tr+=1){var Tr=(Wt+tr*Mt+rr)%rr,Hr=mr[Tr]||{},qr=Hr.group,Kr=Hr.data;if(!qr&&!(Kr!=null&&Kr.disabled)&&(Sr(Kr.value)||!nr))return Tr}return-1},Cr=x.useState(function(){return Er(0)}),vr=(0,W.Z)(Cr,2),pr=vr[0],Qr=vr[1],zr=function(Wt){var Mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Qr(Wt);var rr={source:Mt?"keyboard":"mouse"},tr=mr[Wt];if(!tr){et(null,-1,rr);return}et(tr.value,Wt,rr)};(0,x.useEffect)(function(){zr(Ke!==!1?Er(0):-1)},[mr.length,Tt]);var Wr=x.useCallback(function(gr){return kt==="combobox"?String(gr).toLowerCase()===Tt.toLowerCase():Pt.has(gr)},[kt,Tt,(0,re.Z)(Pt).toString(),Pt.size]);(0,x.useEffect)(function(){var gr=setTimeout(function(){if(!pt&&ht&&Pt.size===1){var Mt=Array.from(Pt)[0],rr=mr.findIndex(function(tr){var Tr=tr.data;return Tt?String(Tr.value).startsWith(Tt):Tr.value===Mt});rr!==-1&&(zr(rr),Mr(rr))}});if(ht){var Wt;(Wt=sr.current)===null||Wt===void 0||Wt.scrollTo(void 0)}return function(){return clearTimeout(gr)}},[ht,Tt]);var wr=function(Wt){Wt!==void 0&&Et(Wt,{selected:!Pt.has(Wt)}),pt||Ut(!1)};if(x.useImperativeHandle(ut,function(){return{onKeyDown:function(Wt){var Mt=Wt.which,rr=Wt.ctrlKey;switch(Mt){case E.Z.N:case E.Z.P:case E.Z.UP:case E.Z.DOWN:{var tr=0;if(Mt===E.Z.UP?tr=-1:Mt===E.Z.DOWN?tr=1:Lt()&&rr&&(Mt===E.Z.N?tr=1:Mt===E.Z.P&&(tr=-1)),tr!==0){var Tr=Er(pr+tr,tr);Mr(Tr),zr(Tr,!0)}break}case E.Z.TAB:case E.Z.ENTER:{var Hr,qr=mr[pr];qr&&!(qr!=null&&(Hr=qr.data)!==null&&Hr!==void 0&&Hr.disabled)&&!nr?wr(qr.value):wr(void 0),ht&&Wt.preventDefault();break}case E.Z.ESC:Ut(!1),ht&&Wt.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Wt){Mr(Wt)}}}),mr.length===0)return x.createElement("div",{role:"listbox",id:"".concat(Qe,"_list"),className:"".concat(ar,"-empty"),onMouseDown:cr},ot);var on=Object.keys(zt).map(function(gr){return zt[gr]}),Xr=function(Wt){return Wt.label};function Gr(gr,Wt){var Mt=gr.group;return{role:Mt?"presentation":"option",id:"".concat(Qe,"_list_").concat(Wt)}}var un=function(Wt){var Mt=mr[Wt];if(!Mt)return null;var rr=Mt.data||{},tr=rr.value,Tr=Mt.group,Hr=(0,w.Z)(rr,!0),qr=Xr(Mt);return Mt?x.createElement("div",(0,te.Z)({"aria-label":typeof qr=="string"&&!Tr?qr:null},Hr,{key:Wt},Gr(Mt,Wt),{"aria-selected":Wr(tr)}),tr):null},Jr={role:"listbox",id:"".concat(Qe,"_list")};return x.createElement(x.Fragment,null,er&&x.createElement("div",(0,te.Z)({},Jr,{style:{height:0,width:0,overflow:"hidden"}}),un(pr-1),un(pr),un(pr+1)),x.createElement(Fr.Z,{itemKey:"key",ref:sr,data:mr,height:_r,itemHeight:Ve,fullHeight:!1,onMouseDown:cr,onScroll:It,virtual:er,direction:$t,innerProps:er?null:Jr},function(gr,Wt){var Mt=gr.group,rr=gr.groupOption,tr=gr.data,Tr=gr.label,Hr=gr.value,qr=tr.key;if(Mt){var Kr,rn=(Kr=tr.title)!==null&&Kr!==void 0?Kr:yt(Tr)?Tr.toString():void 0;return x.createElement("div",{className:u()(ar,"".concat(ar,"-group"),tr.className),title:rn},Tr!==void 0?Tr:qr)}var En=tr.disabled,gn=tr.title,bn=tr.children,$r=tr.style,Sn=tr.className,_n=(0,y.Z)(tr,gt),Ln=(0,Qt.Z)(_n,on),ln=Sr(Hr),cn=En||!ln&&nr,fn="".concat(ar,"-option"),Dr=u()(ar,fn,Sn,(0,X.Z)((0,X.Z)((0,X.Z)((0,X.Z)({},"".concat(fn,"-grouped"),rr),"".concat(fn,"-active"),pr===Wt&&!cn),"".concat(fn,"-disabled"),cn),"".concat(fn,"-selected"),ln)),kn=Xr(gr),Bn=!wt||typeof wt=="function"||ln,wn=typeof kn=="number"?kn:kn||Hr,Rn=yt(wn)?wn.toString():void 0;return gn!==void 0&&(Rn=gn),x.createElement("div",(0,te.Z)({},(0,w.Z)(Ln),er?{}:Gr(gr,Wt),{"aria-selected":Wr(Hr),className:Dr,title:Rn,onMouseMove:function(){pr===Wt||cn||zr(Wt)},onClick:function(){cn||wr(Hr)},style:$r}),x.createElement("div",{className:"".concat(fn,"-content")},typeof Xt=="function"?Xt(gr,{index:Wt}):wn),x.isValidElement(wt)||ln,Bn&&x.createElement(m,{className:"".concat(ar,"-option-state"),customizeIcon:wt,customizeIconProps:{value:Hr,disabled:cn,isSelected:ln}},ln?"\u2713":null))}))},Jt=x.forwardRef(ir),St=Jt,it=function(Pe,be){var ut=x.useRef({values:new Map,options:new Map}),ze=x.useMemo(function(){var Qe=ut.current,ht=Qe.values,pt=Qe.options,kt=Pe.map(function(ot){if(ot.label===void 0){var It;return(0,D.Z)((0,D.Z)({},ot),{},{label:(It=ht.get(ot.value))===null||It===void 0?void 0:It.label})}return ot}),Tt=new Map,Ut=new Map;return kt.forEach(function(ot){Tt.set(ot.value,ot),Ut.set(ot.value,be.get(ot.value)||pt.get(ot.value))}),ut.current.values=Tt,ut.current.options=Ut,kt},[Pe,be]),He=x.useCallback(function(Qe){return be.get(Qe)||ut.current.options.get(Qe)},[be]);return[ze,He]};function Rt(Pe,be){return B(Pe).join("").toUpperCase().includes(be)}var Vt=function(Pe,be,ut,ze,He){return x.useMemo(function(){if(!ut||ze===!1)return Pe;var Qe=be.options,ht=be.label,pt=be.value,kt=[],Tt=typeof ze=="function",Ut=ut.toUpperCase(),ot=Tt?ze:function(ft,Ne){return He?Rt(Ne[He],Ut):Ne[Qe]?Rt(Ne[ht!=="children"?ht:"label"],Ut):Rt(Ne[pt],Ut)},It=Tt?function(ft){return he(ft)}:function(ft){return ft};return Pe.forEach(function(ft){if(ft[Qe]){var Ne=ot(ut,It(ft));if(Ne)kt.push(ft);else{var je=ft[Qe].filter(function(et){return ot(ut,It(et))});je.length&&kt.push((0,D.Z)((0,D.Z)({},ft),{},(0,X.Z)({},Qe,je)))}return}ot(ut,It(ft))&&kt.push(ft)}),kt},[Pe,ze,He,ut,be])},jt=ae(6551),Yt=ae(11592),qe=["children","value"],mt=["children"];function Dt(Pe){var be=Pe,ut=be.key,ze=be.props,He=ze.children,Qe=ze.value,ht=(0,y.Z)(ze,qe);return(0,D.Z)({key:ut,value:Qe!==void 0?Qe:ut,children:He},ht)}function Ft(Pe){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,Yt.Z)(Pe).map(function(ut,ze){if(!x.isValidElement(ut)||!ut.type)return null;var He=ut,Qe=He.type.isSelectOptGroup,ht=He.key,pt=He.props,kt=pt.children,Tt=(0,y.Z)(pt,mt);return be||!Qe?Dt(ut):(0,D.Z)((0,D.Z)({key:"__RC_SELECT_GRP__".concat(ht===null?ze:ht,"__"),label:ht},Tt),{},{options:Ft(kt)})}).filter(function(ut){return ut})}var Zt=function(be,ut,ze,He,Qe){return x.useMemo(function(){var ht=be,pt=!be;pt&&(ht=Ft(ut));var kt=new Map,Tt=new Map,Ut=function(ft,Ne,je){je&&typeof je=="string"&&ft.set(Ne[je],Ne)},ot=function It(ft){for(var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,je=0;je<ft.length;je+=1){var et=ft[je];!et[ze.options]||Ne?(kt.set(et[ze.value],et),Ut(Tt,et,ze.label),Ut(Tt,et,He),Ut(Tt,et,Qe)):It(et[ze.options],!0)}};return ot(ht),{options:ht,valueOptions:kt,labelOptions:Tt}},[be,ut,ze,He,Qe])},_t=Zt;function G(Pe){var be=x.useRef();be.current=Pe;var ut=x.useCallback(function(){return be.current.apply(be,arguments)},[]);return ut}function Y(Pe){var be=Pe.mode,ut=Pe.options,ze=Pe.children,He=Pe.backfill,Qe=Pe.allowClear,ht=Pe.placeholder,pt=Pe.getInputElement,kt=Pe.showSearch,Tt=Pe.onSearch,Ut=Pe.defaultOpen,ot=Pe.autoFocus,It=Pe.labelInValue,ft=Pe.value,Ne=Pe.inputValue,je=Pe.optionLabelProp,et=isMultiple(be),Ke=kt!==void 0?kt:et||be==="combobox",Et=ut||convertChildrenToData(ze);if(warning(be!=="tags"||Et.every(function(er){return!er.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),be==="tags"||be==="combobox"){var wt=Et.some(function(er){return er.options?er.options.some(function($t){return typeof("value"in $t?$t.value:$t.key)=="number"}):typeof("value"in er?er.value:er.key)=="number"});warning(!wt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(be!=="combobox"||!je,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(be==="combobox"||!He,"`backfill` only works with `combobox` mode."),warning(be==="combobox"||!pt,"`getInputElement` only work with `combobox` mode."),noteOnce(be!=="combobox"||!pt||!Qe||!ht,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Tt&&!Ke&&be!=="combobox"&&be!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Ut||ot,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ft!=null){var Pt=toArray(ft);warning(!It||Pt.every(function(er){return _typeof(er)==="object"&&("key"in er||"value"in er)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!et||Array.isArray(ft),"`value` should be array when `mode` is `multiple` or `tags`")}if(ze){var zt=null;toNodeArray(ze).some(function(er){if(!React.isValidElement(er)||!er.type)return!1;var $t=er,_r=$t.type;if(_r.isSelectOption)return!1;if(_r.isSelectOptGroup){var Ve=toNodeArray(er.props.children).every(function(Xt){return!React.isValidElement(Xt)||!er.type||Xt.type.isSelectOption?!0:(zt=Xt.type,!1)});return!Ve}return zt=_r,!0}),zt&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(zt.displayName||zt.name||zt,"`.")),warning(Ne===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function J(Pe,be){if(Pe){var ut=function ze(He){for(var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ht=0;ht<He.length;ht++){var pt=He[ht];if(pt[be==null?void 0:be.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!Qe&&Array.isArray(pt[be==null?void 0:be.options])&&ze(pt[be==null?void 0:be.options],!0))break}};ut(Pe)}}var le=null,_e=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],Ie=["inputValue"];function Ce(Pe){return!Pe||(0,L.Z)(Pe)!=="object"}var Xe=x.forwardRef(function(Pe,be){var ut=Pe.id,ze=Pe.mode,He=Pe.prefixCls,Qe=He===void 0?"rc-select":He,ht=Pe.backfill,pt=Pe.fieldNames,kt=Pe.inputValue,Tt=Pe.searchValue,Ut=Pe.onSearch,ot=Pe.autoClearSearchValue,It=ot===void 0?!0:ot,ft=Pe.onSelect,Ne=Pe.onDeselect,je=Pe.dropdownMatchSelectWidth,et=je===void 0?!0:je,Ke=Pe.filterOption,Et=Pe.filterSort,wt=Pe.optionFilterProp,Pt=Pe.optionLabelProp,zt=Pe.options,er=Pe.optionRender,$t=Pe.children,_r=Pe.defaultActiveFirstOption,Ve=Pe.menuItemSelectedIcon,Xt=Pe.virtual,ar=Pe.direction,mr=Pe.listHeight,sr=mr===void 0?200:mr,nr=Pe.listItemHeight,cr=nr===void 0?20:nr,Mr=Pe.labelRender,Sr=Pe.value,Er=Pe.defaultValue,Cr=Pe.labelInValue,vr=Pe.onChange,pr=Pe.maxCount,Qr=(0,y.Z)(Pe,_e),zr=(0,jt.ZP)(ut),Wr=nt(ze),wr=!!(!zt&&$t),on=x.useMemo(function(){return Ke===void 0&&ze==="combobox"?!1:Ke},[Ke,ze]),Xr=x.useMemo(function(){return fe(pt,wr)},[JSON.stringify(pt),wr]),Gr=(0,A.Z)("",{value:Tt!==void 0?Tt:kt,postState:function(kr){return kr||""}}),un=(0,W.Z)(Gr,2),Jr=un[0],gr=un[1],Wt=_t(zt,$t,Xr,wt,Pt),Mt=Wt.valueOptions,rr=Wt.labelOptions,tr=Wt.options,Tr=x.useCallback(function(xr){var kr=B(xr);return kr.map(function(Or){var Nr,Br,Yr,Wn,or;if(Ce(Or))Nr=Or;else{var Ar;Yr=Or.key,Br=Or.label,Nr=(Ar=Or.value)!==null&&Ar!==void 0?Ar:Yr}var jr=Mt.get(Nr);if(jr){var pn;if(Br===void 0&&(Br=jr==null?void 0:jr[Pt||Xr.label]),Yr===void 0&&(Yr=(pn=jr==null?void 0:jr.key)!==null&&pn!==void 0?pn:Nr),Wn=jr==null?void 0:jr.disabled,or=jr==null?void 0:jr.title,0)var dn}return{label:Br,value:Nr,key:Yr,disabled:Wn,title:or}})},[Xr,Pt,Mt]),Hr=(0,A.Z)(Er,{value:Sr}),qr=(0,W.Z)(Hr,2),Kr=qr[0],rn=qr[1],En=x.useMemo(function(){var xr,kr=Wr&&Kr===null?[]:Kr,Or=Tr(kr);return ze==="combobox"&&H((xr=Or[0])===null||xr===void 0?void 0:xr.value)?[]:Or},[Kr,Tr,ze,Wr]),gn=it(En,Mt),bn=(0,W.Z)(gn,2),$r=bn[0],Sn=bn[1],_n=x.useMemo(function(){if(!ze&&$r.length===1){var xr=$r[0];if(xr.value===null&&(xr.label===null||xr.label===void 0))return[]}return $r.map(function(kr){var Or;return(0,D.Z)((0,D.Z)({},kr),{},{label:(Or=typeof Mr=="function"?Mr(kr):kr.label)!==null&&Or!==void 0?Or:kr.value})})},[ze,$r,Mr]),Ln=x.useMemo(function(){return new Set($r.map(function(xr){return xr.value}))},[$r]);x.useEffect(function(){if(ze==="combobox"){var xr,kr=(xr=$r[0])===null||xr===void 0?void 0:xr.value;gr(M(kr)?String(kr):"")}},[$r]);var ln=G(function(xr,kr){var Or=kr!=null?kr:xr;return(0,X.Z)((0,X.Z)({},Xr.value,xr),Xr.label,Or)}),cn=x.useMemo(function(){if(ze!=="tags")return tr;var xr=(0,re.Z)(tr),kr=function(Nr){return Mt.has(Nr)};return(0,re.Z)($r).sort(function(Or,Nr){return Or.value<Nr.value?-1:1}).forEach(function(Or){var Nr=Or.value;kr(Nr)||xr.push(ln(Nr,Or.label))}),xr},[ln,tr,Mt,$r,ze]),fn=Vt(cn,Xr,Jr,on,wt),Dr=x.useMemo(function(){return ze!=="tags"||!Jr||fn.some(function(xr){return xr[wt||"value"]===Jr})||fn.some(function(xr){return xr[Xr.value]===Jr})?fn:[ln(Jr)].concat((0,re.Z)(fn))},[ln,wt,ze,fn,Jr,Xr]),kn=function xr(kr){var Or=(0,re.Z)(kr).sort(function(Nr,Br){return Et(Nr,Br,{searchValue:Jr})});return Or.map(function(Nr){return Array.isArray(Nr.options)?(0,D.Z)((0,D.Z)({},Nr),{},{options:Nr.options.length>0?xr(Nr.options):Nr.options}):Nr})},Bn=x.useMemo(function(){return Et?kn(Dr):Dr},[Dr,Et,Jr]),wn=x.useMemo(function(){return ye(Bn,{fieldNames:Xr,childrenAsData:wr})},[Bn,Xr,wr]),Rn=function(kr){var Or=Tr(kr);if(rn(Or),vr&&(Or.length!==$r.length||Or.some(function(Yr,Wn){var or;return((or=$r[Wn])===null||or===void 0?void 0:or.value)!==(Yr==null?void 0:Yr.value)}))){var Nr=Cr?Or:Or.map(function(Yr){return Yr.value}),Br=Or.map(function(Yr){return he(Sn(Yr.value))});vr(Wr?Nr:Nr[0],Wr?Br:Br[0])}},Yn=x.useState(null),Un=(0,W.Z)(Yn,2),zn=Un[0],Vr=Un[1],ci=x.useState(0),oi=(0,W.Z)(ci,2),$n=oi[0],ri=oi[1],Qn=_r!==void 0?_r:ze!=="combobox",jn=x.useCallback(function(xr,kr){var Or=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Nr=Or.source,Br=Nr===void 0?"keyboard":Nr;ri(kr),ht&&ze==="combobox"&&xr!==null&&Br==="keyboard"&&Vr(String(xr))},[ht,ze]),Tn=function(kr,Or,Nr){var Br=function(){var ni,Fn=Sn(kr);return[Cr?{label:Fn==null?void 0:Fn[Xr.label],value:kr,key:(ni=Fn==null?void 0:Fn.key)!==null&&ni!==void 0?ni:kr}:kr,he(Fn)]};if(Or&&ft){var Yr=Br(),Wn=(0,W.Z)(Yr,2),or=Wn[0],Ar=Wn[1];ft(or,Ar)}else if(!Or&&Ne&&Nr!=="clear"){var jr=Br(),pn=(0,W.Z)(jr,2),dn=pn[0],hi=pn[1];Ne(dn,hi)}},Mn=G(function(xr,kr){var Or,Nr=Wr?kr.selected:!0;Nr?Or=Wr?[].concat((0,re.Z)($r),[xr]):[xr]:Or=$r.filter(function(Br){return Br.value!==xr}),Rn(Or),Tn(xr,Nr),ze==="combobox"?Vr(""):(!nt||It)&&(gr(""),Vr(""))}),On=function(kr,Or){Rn(kr);var Nr=Or.type,Br=Or.values;(Nr==="remove"||Nr==="clear")&&Br.forEach(function(Yr){Tn(Yr.value,!1,Nr)})},tn=function(kr,Or){if(gr(kr),Vr(null),Or.source==="submit"){var Nr=(kr||"").trim();if(Nr){var Br=Array.from(new Set([].concat((0,re.Z)(Ln),[Nr])));Rn(Br),Tn(Nr,!0),gr("")}return}Or.source!=="blur"&&(ze==="combobox"&&Rn(kr),Ut==null||Ut(kr))},mn=function(kr){var Or=kr;ze!=="tags"&&(Or=kr.map(function(Br){var Yr=rr.get(Br);return Yr==null?void 0:Yr.value}).filter(function(Br){return Br!==void 0}));var Nr=Array.from(new Set([].concat((0,re.Z)(Ln),(0,re.Z)(Or))));Rn(Nr),Nr.forEach(function(Br){Tn(Br,!0)})},An=x.useMemo(function(){var xr=Xt!==!1&&et!==!1;return(0,D.Z)((0,D.Z)({},Wt),{},{flattenOptions:wn,onActiveValue:jn,defaultActiveFirstOption:Qn,onSelect:Mn,menuItemSelectedIcon:Ve,rawValues:Ln,fieldNames:Xr,virtual:xr,direction:ar,listHeight:sr,listItemHeight:cr,childrenAsData:wr,maxCount:pr,optionRender:er})},[pr,Wt,wn,jn,Qn,Mn,Ve,Ln,Xr,Xt,et,ar,sr,cr,wr,er]);return x.createElement(Be.Provider,{value:An},x.createElement(Nt,(0,te.Z)({},Qr,{id:zr,prefixCls:Qe,ref:be,omitDomProps:Ie,mode:ze,displayValues:_n,onDisplayValuesChange:On,direction:ar,searchValue:Jr,onSearch:tn,autoClearSearchValue:It,onSearchSplit:mn,dropdownMatchSelectWidth:et,OptionList:St,emptyOptions:!wn.length,activeValue:zn,activeDescendantId:"".concat(zr,"_list_").concat($n)})))}),Je=Xe;Je.Option=ur,Je.OptGroup=st;var bt=Je,Ht=bt},22711:function(qt,$e,ae){"use strict";ae.r($e),ae.d($e,{ResizableTextArea:function(){return z},default:function(){return K}});var te=ae(32855),re=ae(74430),X=ae(27247),D=ae(3300),W=ae(11913),y=ae(43079),L=ae(92310),A=ae.n(L),s=ae(36901),x=ae(66003),c=ae(30292),u=ae(18929),f=ae(59301),i=ae(34666),o=ae(29301),d=ae(34280),m=ae(16089),_=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important;
|
|
pointer-events: none !important;
|
|
`,h=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],v={},r;function a(B){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,C=B.getAttribute("id")||B.getAttribute("data-reactid")||B.getAttribute("name");if(V&&v[C])return v[C];var M=window.getComputedStyle(B),H=M.getPropertyValue("box-sizing")||M.getPropertyValue("-moz-box-sizing")||M.getPropertyValue("-webkit-box-sizing"),$=parseFloat(M.getPropertyValue("padding-bottom"))+parseFloat(M.getPropertyValue("padding-top")),q=parseFloat(M.getPropertyValue("border-bottom-width"))+parseFloat(M.getPropertyValue("border-top-width")),se=h.map(function(pe){return"".concat(pe,":").concat(M.getPropertyValue(pe))}).join(";"),ue={sizingStyle:se,paddingSize:$,borderSize:q,boxSizing:H};return V&&C&&(v[C]=ue),ue}function p(B){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,M=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;r||(r=document.createElement("textarea"),r.setAttribute("tab-index","-1"),r.setAttribute("aria-hidden","true"),r.setAttribute("name","hiddenTextarea"),document.body.appendChild(r)),B.getAttribute("wrap")?r.setAttribute("wrap",B.getAttribute("wrap")):r.removeAttribute("wrap");var H=a(B,V),$=H.paddingSize,q=H.borderSize,se=H.boxSizing,ue=H.sizingStyle;r.setAttribute("style","".concat(ue,";").concat(_)),r.value=B.value||B.placeholder||"";var pe=void 0,xe=void 0,De,Ue=r.scrollHeight;if(se==="border-box"?Ue+=q:se==="content-box"&&(Ue-=$),C!==null||M!==null){r.value=" ";var Ge=r.scrollHeight-$;C!==null&&(pe=Ge*C,se==="border-box"&&(pe=pe+$+q),Ue=Math.max(pe,Ue)),M!==null&&(xe=Ge*M,se==="border-box"&&(xe=xe+$+q),De=Ue>xe?"":"hidden",Ue=Math.min(xe,Ue))}var Ae={height:Ue,overflowY:De,resize:"none"};return pe&&(Ae.minHeight=pe),xe&&(Ae.maxHeight=xe),Ae}var E=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],S=0,w=1,R=2,O=f.forwardRef(function(B,V){var C=B,M=C.prefixCls,H=C.defaultValue,$=C.value,q=C.autoSize,se=C.onResize,ue=C.className,pe=C.style,xe=C.disabled,De=C.onChange,Ue=C.onInternalAutoSize,Ge=(0,y.Z)(C,E),Ae=(0,u.Z)(H,{value:$,postState:function(ur){return ur!=null?ur:""}}),We=(0,W.Z)(Ae,2),we=We[0],Se=We[1],ge=function(ur){Se(ur.target.value),De==null||De(ur)},Re=f.useRef();f.useImperativeHandle(V,function(){return{textArea:Re.current}});var ve=f.useMemo(function(){return q&&(0,i.Z)(q)==="object"?[q.minRows,q.maxRows]:[]},[q]),Le=(0,W.Z)(ve,2),Fe=Le[0],me=Le[1],oe=!!q,ie=function(){try{if(document.activeElement===Re.current){var ur=Re.current,br=ur.selectionStart,Qt=ur.selectionEnd,Fr=ur.scrollTop;Re.current.setSelectionRange(br,Qt),Re.current.scrollTop=Fr}}catch(Lt){}},fe=f.useState(R),ye=(0,W.Z)(fe,2),he=ye[0],Te=ye[1],Oe=f.useState(),Be=(0,W.Z)(Oe,2),Ze=Be[0],tt=Be[1],dt=function(){Te(S)};(0,d.Z)(function(){oe&&dt()},[$,Fe,me,oe]),(0,d.Z)(function(){if(he===S)Te(w);else if(he===w){var Ot=p(Re.current,!1,Fe,me);Te(R),tt(Ot)}else ie()},[he]);var nt=f.useRef(),At=function(){m.Z.cancel(nt.current)},Nt=function(ur){he===R&&(se==null||se(ur),q&&(At(),nt.current=(0,m.Z)(function(){dt()})))};f.useEffect(function(){return At},[]);var Bt=oe?Ze:null,st=(0,X.Z)((0,X.Z)({},pe),Bt);return(he===S||he===w)&&(st.overflowY="hidden",st.overflowX="hidden"),f.createElement(o.Z,{onResize:Nt,disabled:!(q||se)},f.createElement("textarea",(0,te.Z)({},Ge,{ref:Re,style:st,className:A()(M,ue,(0,re.Z)({},"".concat(M,"-disabled"),xe)),disabled:xe,value:we,onChange:ge})))}),z=O,N=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],P=f.forwardRef(function(B,V){var C,M=B.defaultValue,H=B.value,$=B.onFocus,q=B.onBlur,se=B.onChange,ue=B.allowClear,pe=B.maxLength,xe=B.onCompositionStart,De=B.onCompositionEnd,Ue=B.suffix,Ge=B.prefixCls,Ae=Ge===void 0?"rc-textarea":Ge,We=B.showCount,we=B.count,Se=B.className,ge=B.style,Re=B.disabled,ve=B.hidden,Le=B.classNames,Fe=B.styles,me=B.onResize,oe=B.onClear,ie=B.onPressEnter,fe=B.readOnly,ye=B.autoSize,he=B.onKeyDown,Te=(0,y.Z)(B,N),Oe=(0,u.Z)(M,{value:H,defaultValue:M}),Be=(0,W.Z)(Oe,2),Ze=Be[0],tt=Be[1],dt=Ze==null?"":String(Ze),nt=f.useState(!1),At=(0,W.Z)(nt,2),Nt=At[0],Bt=At[1],st=f.useRef(!1),Ot=f.useState(null),ur=(0,W.Z)(Ot,2),br=ur[0],Qt=ur[1],Fr=(0,f.useRef)(null),Lt=(0,f.useRef)(null),gt=function(){var Je;return(Je=Lt.current)===null||Je===void 0?void 0:Je.textArea},yt=function(){gt().focus()};(0,f.useImperativeHandle)(V,function(){var Xe;return{resizableTextArea:Lt.current,focus:yt,blur:function(){gt().blur()},nativeElement:((Xe=Fr.current)===null||Xe===void 0?void 0:Xe.nativeElement)||gt()}}),(0,f.useEffect)(function(){Bt(function(Xe){return!Re&&Xe})},[Re]);var ir=f.useState(null),Jt=(0,W.Z)(ir,2),St=Jt[0],it=Jt[1];f.useEffect(function(){if(St){var Xe;(Xe=gt()).setSelectionRange.apply(Xe,(0,D.Z)(St))}},[St]);var Rt=(0,x.Z)(we,We),Vt=(C=Rt.max)!==null&&C!==void 0?C:pe,jt=Number(Vt)>0,Yt=Rt.strategy(dt),qe=!!Vt&&Yt>Vt,mt=function(Je,bt){var Ht=bt;!st.current&&Rt.exceedFormatter&&Rt.max&&Rt.strategy(bt)>Rt.max&&(Ht=Rt.exceedFormatter(bt,{max:Rt.max}),bt!==Ht&&it([gt().selectionStart||0,gt().selectionEnd||0])),tt(Ht),(0,c.rJ)(Je.currentTarget,Je,se,Ht)},Dt=function(Je){st.current=!0,xe==null||xe(Je)},Ft=function(Je){st.current=!1,mt(Je,Je.currentTarget.value),De==null||De(Je)},Zt=function(Je){mt(Je,Je.target.value)},_t=function(Je){Je.key==="Enter"&&ie&&ie(Je),he==null||he(Je)},G=function(Je){Bt(!0),$==null||$(Je)},Y=function(Je){Bt(!1),q==null||q(Je)},J=function(Je){tt(""),yt(),(0,c.rJ)(gt(),Je,se)},le=Ue,_e;Rt.show&&(Rt.showFormatter?_e=Rt.showFormatter({value:dt,count:Yt,maxLength:Vt}):_e="".concat(Yt).concat(jt?" / ".concat(Vt):""),le=f.createElement(f.Fragment,null,le,f.createElement("span",{className:A()("".concat(Ae,"-data-count"),Le==null?void 0:Le.count),style:Fe==null?void 0:Fe.count},_e)));var Ie=function(Je){var bt;me==null||me(Je),(bt=gt())!==null&&bt!==void 0&&bt.style.height&&Qt(!0)},Ce=!ye&&!We&&!ue;return f.createElement(s.BaseInput,{ref:Fr,value:dt,allowClear:ue,handleReset:J,suffix:le,prefixCls:Ae,classNames:(0,X.Z)((0,X.Z)({},Le),{},{affixWrapper:A()(Le==null?void 0:Le.affixWrapper,(0,re.Z)((0,re.Z)({},"".concat(Ae,"-show-count"),We),"".concat(Ae,"-textarea-allow-clear"),ue))}),disabled:Re,focused:Nt,className:A()(Se,qe&&"".concat(Ae,"-out-of-range")),style:(0,X.Z)((0,X.Z)({},ge),br&&!Ce?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof _e=="string"?_e:void 0}},hidden:ve,readOnly:fe,onClear:oe},f.createElement(z,(0,te.Z)({},Te,{autoSize:ye,maxLength:pe,onKeyDown:_t,onChange:Zt,onFocus:G,onBlur:Y,onCompositionStart:Dt,onCompositionEnd:Ft,className:A()(Le==null?void 0:Le.textarea),style:(0,X.Z)((0,X.Z)({},Fe==null?void 0:Fe.textarea),{},{resize:ge==null?void 0:ge.resize}),disabled:Re,prefixCls:Ae,onResize:Ie,ref:Lt,readOnly:fe})))}),F=P,K=F},29125:function(qt,$e,ae){"use strict";ae.d($e,{G:function(){return D},Z:function(){return _}});var te=ae(92310),re=ae.n(te),X=ae(59301);function D(h){var v=h.children,r=h.prefixCls,a=h.id,p=h.overlayInnerStyle,E=h.bodyClassName,S=h.className,w=h.style;return X.createElement("div",{className:re()("".concat(r,"-content"),S),style:w},X.createElement("div",{className:re()("".concat(r,"-inner"),E),id:a,role:"tooltip",style:p},typeof v=="function"?v():v))}var W=ae(32855),y=ae(27247),L=ae(43079),A=ae(65030),s={shiftX:64,adjustY:1},x={adjustX:1,shiftY:!0},c=[0,0],u={left:{points:["cr","cl"],overflow:x,offset:[-4,0],targetOffset:c},right:{points:["cl","cr"],overflow:x,offset:[4,0],targetOffset:c},top:{points:["bc","tc"],overflow:s,offset:[0,-4],targetOffset:c},bottom:{points:["tc","bc"],overflow:s,offset:[0,4],targetOffset:c},topLeft:{points:["bl","tl"],overflow:s,offset:[0,-4],targetOffset:c},leftTop:{points:["tr","tl"],overflow:x,offset:[-4,0],targetOffset:c},topRight:{points:["br","tr"],overflow:s,offset:[0,-4],targetOffset:c},rightTop:{points:["tl","tr"],overflow:x,offset:[4,0],targetOffset:c},bottomRight:{points:["tr","br"],overflow:s,offset:[0,4],targetOffset:c},rightBottom:{points:["bl","br"],overflow:x,offset:[4,0],targetOffset:c},bottomLeft:{points:["tl","bl"],overflow:s,offset:[0,4],targetOffset:c},leftBottom:{points:["br","bl"],overflow:x,offset:[-4,0],targetOffset:c}},f=null,i=ae(80402),o=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],d=function(v,r){var a=v.overlayClassName,p=v.trigger,E=p===void 0?["hover"]:p,S=v.mouseEnterDelay,w=S===void 0?0:S,R=v.mouseLeaveDelay,O=R===void 0?.1:R,z=v.overlayStyle,N=v.prefixCls,P=N===void 0?"rc-tooltip":N,F=v.children,K=v.onVisibleChange,B=v.afterVisibleChange,V=v.transitionName,C=v.animation,M=v.motion,H=v.placement,$=H===void 0?"right":H,q=v.align,se=q===void 0?{}:q,ue=v.destroyTooltipOnHide,pe=ue===void 0?!1:ue,xe=v.defaultVisible,De=v.getTooltipContainer,Ue=v.overlayInnerStyle,Ge=v.arrowContent,Ae=v.overlay,We=v.id,we=v.showArrow,Se=we===void 0?!0:we,ge=v.classNames,Re=v.styles,ve=(0,L.Z)(v,o),Le=(0,i.Z)(We),Fe=(0,X.useRef)(null);(0,X.useImperativeHandle)(r,function(){return Fe.current});var me=(0,y.Z)({},ve);"visible"in v&&(me.popupVisible=v.visible);var oe=function(){return X.createElement(D,{key:"content",prefixCls:P,id:Le,bodyClassName:ge==null?void 0:ge.body,overlayInnerStyle:(0,y.Z)((0,y.Z)({},Ue),Re==null?void 0:Re.body)},Ae)},ie=function(){var ye=X.Children.only(F),he=(ye==null?void 0:ye.props)||{},Te=(0,y.Z)((0,y.Z)({},he),{},{"aria-describedby":Ae?Le:null});return X.cloneElement(F,Te)};return X.createElement(A.Z,(0,W.Z)({popupClassName:re()(a,ge==null?void 0:ge.root),prefixCls:P,popup:oe,action:E,builtinPlacements:u,popupPlacement:$,ref:Fe,popupAlign:se,getPopupContainer:De,onPopupVisibleChange:K,afterPopupVisibleChange:B,popupTransitionName:V,popupAnimation:C,popupMotion:M,defaultPopupVisible:xe,autoDestroy:pe,mouseLeaveDelay:O,popupStyle:(0,y.Z)((0,y.Z)({},z),Re==null?void 0:Re.root),mouseEnterDelay:w,arrow:Se},me),ie())},m=(0,X.forwardRef)(d),_=m},49658:function(qt,$e){"use strict";$e.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var ae=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(ae)||/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(ae==null?void 0:ae.substr(0,4))}},6790:function(qt,$e,ae){"use strict";ae.d($e,{Z:function(){return we}});var te=ae(32855),re=ae(34666),X=ae(27247),D=ae(74430),W=ae(11913),y=ae(43079),L=ae(92310),A=ae.n(L),s=ae(29301),x=ae(70425),c=ae(34280),u=ae(59301),f=ae(4676),i=u.forwardRef(function(Se,ge){var Re=Se.height,ve=Se.offsetY,Le=Se.offsetX,Fe=Se.children,me=Se.prefixCls,oe=Se.onInnerResize,ie=Se.innerProps,fe=Se.rtl,ye=Se.extra,he={},Te={display:"flex",flexDirection:"column"};return ve!==void 0&&(he={height:Re,position:"relative",overflow:"hidden"},Te=(0,X.Z)((0,X.Z)({},Te),{},(0,D.Z)((0,D.Z)((0,D.Z)((0,D.Z)((0,D.Z)({transform:"translateY(".concat(ve,"px)")},fe?"marginRight":"marginLeft",-Le),"position","absolute"),"left",0),"right",0),"top",0))),u.createElement("div",{style:he},u.createElement(s.Z,{onResize:function(Be){var Ze=Be.offsetHeight;Ze&&oe&&oe()}},u.createElement("div",(0,te.Z)({style:Te,className:A()((0,D.Z)({},"".concat(me,"-holder-inner"),me)),ref:ge},ie),Fe,ye)))});i.displayName="Filler";var o=i;function d(Se){var ge=Se.children,Re=Se.setRef,ve=u.useCallback(function(Le){Re(Le)},[]);return u.cloneElement(ge,{ref:ve})}function m(Se,ge,Re,ve,Le,Fe,me,oe){var ie=oe.getKey;return Se.slice(ge,Re+1).map(function(fe,ye){var he=ge+ye,Te=me(fe,he,{style:{width:ve},offsetX:Le}),Oe=ie(fe);return u.createElement(d,{key:Oe,setRef:function(Ze){return Fe(fe,Ze)}},Te)})}function _(Se,ge,Re,ve){var Le=Re-Se,Fe=ge-Re,me=Math.min(Le,Fe)*2;if(ve<=me){var oe=Math.floor(ve/2);return ve%2?Re+oe+1:Re-oe}return Le>Fe?Re-(ve-Fe):Re+(ve-Le)}function h(Se,ge,Re){var ve=Se.length,Le=ge.length,Fe,me;if(ve===0&&Le===0)return null;ve<Le?(Fe=Se,me=ge):(Fe=ge,me=Se);var oe={__EMPTY_ITEM__:!0};function ie(Be){return Be!==void 0?Re(Be):oe}for(var fe=null,ye=Math.abs(ve-Le)!==1,he=0;he<me.length;he+=1){var Te=ie(Fe[he]),Oe=ie(me[he]);if(Te!==Oe){fe=he,ye=ye||Te!==ie(me[he+1]);break}}return fe===null?null:{index:fe,multiple:ye}}function v(Se,ge,Re){var ve=u.useState(Se),Le=(0,W.Z)(ve,2),Fe=Le[0],me=Le[1],oe=u.useState(null),ie=(0,W.Z)(oe,2),fe=ie[0],ye=ie[1];return u.useEffect(function(){var he=h(Fe||[],Se||[],ge);(he==null?void 0:he.index)!==void 0&&(Re==null||Re(he.index),ye(Se[he.index])),me(Se)},[Se]),[fe]}var r=ae(16089),a=(typeof navigator=="undefined"?"undefined":(0,re.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),p=a,E=function(Se,ge,Re,ve){var Le=(0,u.useRef)(!1),Fe=(0,u.useRef)(null);function me(){clearTimeout(Fe.current),Le.current=!0,Fe.current=setTimeout(function(){Le.current=!1},50)}var oe=(0,u.useRef)({top:Se,bottom:ge,left:Re,right:ve});return oe.current.top=Se,oe.current.bottom=ge,oe.current.left=Re,oe.current.right=ve,function(ie,fe){var ye=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,he=ie?fe<0&&oe.current.left||fe>0&&oe.current.right:fe<0&&oe.current.top||fe>0&&oe.current.bottom;return ye&&he?(clearTimeout(Fe.current),Le.current=!1):(!he||Le.current)&&me(),!Le.current&&he}};function S(Se,ge,Re,ve,Le,Fe,me){var oe=(0,u.useRef)(0),ie=(0,u.useRef)(null),fe=(0,u.useRef)(null),ye=(0,u.useRef)(!1),he=E(ge,Re,ve,Le);function Te(nt,At){if(r.Z.cancel(ie.current),!he(!1,At)){var Nt=nt;if(!Nt._virtualHandled)Nt._virtualHandled=!0;else return;oe.current+=At,fe.current=At,p||Nt.preventDefault(),ie.current=(0,r.Z)(function(){var Bt=ye.current?10:1;me(oe.current*Bt,!1),oe.current=0})}}function Oe(nt,At){me(At,!0),p||nt.preventDefault()}var Be=(0,u.useRef)(null),Ze=(0,u.useRef)(null);function tt(nt){if(Se){r.Z.cancel(Ze.current),Ze.current=(0,r.Z)(function(){Be.current=null},2);var At=nt.deltaX,Nt=nt.deltaY,Bt=nt.shiftKey,st=At,Ot=Nt;(Be.current==="sx"||!Be.current&&Bt&&Nt&&!At)&&(st=Nt,Ot=0,Be.current="sx");var ur=Math.abs(st),br=Math.abs(Ot);Be.current===null&&(Be.current=Fe&&ur>br?"x":"y"),Be.current==="y"?Te(nt,Ot):Oe(nt,st)}}function dt(nt){Se&&(ye.current=nt.detail===fe.current)}return[tt,dt]}function w(Se,ge,Re,ve){var Le=u.useMemo(function(){return[new Map,[]]},[Se,Re.id,ve]),Fe=(0,W.Z)(Le,2),me=Fe[0],oe=Fe[1],ie=function(ye){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ye,Te=me.get(ye),Oe=me.get(he);if(Te===void 0||Oe===void 0)for(var Be=Se.length,Ze=oe.length;Ze<Be;Ze+=1){var tt,dt=Se[Ze],nt=ge(dt);me.set(nt,Ze);var At=(tt=Re.get(nt))!==null&&tt!==void 0?tt:ve;if(oe[Ze]=(oe[Ze-1]||0)+At,nt===ye&&(Te=Ze),nt===he&&(Oe=Ze),Te!==void 0&&Oe!==void 0)break}return{top:oe[Te-1]||0,bottom:oe[Oe]}};return ie}var R=ae(33377),O=ae(93912),z=function(){function Se(){(0,R.Z)(this,Se),(0,D.Z)(this,"maps",void 0),(0,D.Z)(this,"id",0),(0,D.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,O.Z)(Se,[{key:"set",value:function(Re,ve){this.diffRecords.set(Re,this.maps[Re]),this.maps[Re]=ve,this.id+=1}},{key:"get",value:function(Re){return this.maps[Re]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),Se}(),N=z;function P(Se){var ge=parseFloat(Se);return isNaN(ge)?0:ge}function F(Se,ge,Re){var ve=u.useState(0),Le=(0,W.Z)(ve,2),Fe=Le[0],me=Le[1],oe=(0,u.useRef)(new Map),ie=(0,u.useRef)(new N),fe=(0,u.useRef)(0);function ye(){fe.current+=1}function he(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;ye();var Be=function(){var dt=!1;oe.current.forEach(function(nt,At){if(nt&&nt.offsetParent){var Nt=nt.offsetHeight,Bt=getComputedStyle(nt),st=Bt.marginTop,Ot=Bt.marginBottom,ur=P(st),br=P(Ot),Qt=Nt+ur+br;ie.current.get(At)!==Qt&&(ie.current.set(At,Qt),dt=!0)}}),dt&&me(function(nt){return nt+1})};if(Oe)Be();else{fe.current+=1;var Ze=fe.current;Promise.resolve().then(function(){Ze===fe.current&&Be()})}}function Te(Oe,Be){var Ze=Se(Oe),tt=oe.current.get(Ze);Be?(oe.current.set(Ze,Be),he()):oe.current.delete(Ze),!tt!=!Be&&(Be?ge==null||ge(Oe):Re==null||Re(Oe))}return(0,u.useEffect)(function(){return ye},[]),[Te,he,ie.current,Fe]}var K=14/15;function B(Se,ge,Re){var ve=(0,u.useRef)(!1),Le=(0,u.useRef)(0),Fe=(0,u.useRef)(0),me=(0,u.useRef)(null),oe=(0,u.useRef)(null),ie,fe=function(Oe){if(ve.current){var Be=Math.ceil(Oe.touches[0].pageX),Ze=Math.ceil(Oe.touches[0].pageY),tt=Le.current-Be,dt=Fe.current-Ze,nt=Math.abs(tt)>Math.abs(dt);nt?Le.current=Be:Fe.current=Ze;var At=Re(nt,nt?tt:dt,!1,Oe);At&&Oe.preventDefault(),clearInterval(oe.current),At&&(oe.current=setInterval(function(){nt?tt*=K:dt*=K;var Nt=Math.floor(nt?tt:dt);(!Re(nt,Nt,!0)||Math.abs(Nt)<=.1)&&clearInterval(oe.current)},16))}},ye=function(){ve.current=!1,ie()},he=function(Oe){ie(),Oe.touches.length===1&&!ve.current&&(ve.current=!0,Le.current=Math.ceil(Oe.touches[0].pageX),Fe.current=Math.ceil(Oe.touches[0].pageY),me.current=Oe.target,me.current.addEventListener("touchmove",fe,{passive:!1}),me.current.addEventListener("touchend",ye,{passive:!0}))};ie=function(){me.current&&(me.current.removeEventListener("touchmove",fe),me.current.removeEventListener("touchend",ye))},(0,c.Z)(function(){return Se&&ge.current.addEventListener("touchstart",he,{passive:!0}),function(){var Te;(Te=ge.current)===null||Te===void 0||Te.removeEventListener("touchstart",he),ie(),clearInterval(oe.current)}},[Se])}function V(Se){return Math.floor(Math.pow(Se,.5))}function C(Se,ge){var Re="touches"in Se?Se.touches[0]:Se;return Re[ge?"pageX":"pageY"]-window[ge?"scrollX":"scrollY"]}function M(Se,ge,Re){u.useEffect(function(){var ve=ge.current;if(Se&&ve){var Le=!1,Fe,me,oe=function(){r.Z.cancel(Fe)},ie=function Te(){oe(),Fe=(0,r.Z)(function(){Re(me),Te()})},fe=function(Oe){if(!(Oe.target.draggable||Oe.button!==0)){var Be=Oe;Be._virtualHandled||(Be._virtualHandled=!0,Le=!0)}},ye=function(){Le=!1,oe()},he=function(Oe){if(Le){var Be=C(Oe,!1),Ze=ve.getBoundingClientRect(),tt=Ze.top,dt=Ze.bottom;if(Be<=tt){var nt=tt-Be;me=-V(nt),ie()}else if(Be>=dt){var At=Be-dt;me=V(At),ie()}else oe()}};return ve.addEventListener("mousedown",fe),ve.ownerDocument.addEventListener("mouseup",ye),ve.ownerDocument.addEventListener("mousemove",he),function(){ve.removeEventListener("mousedown",fe),ve.ownerDocument.removeEventListener("mouseup",ye),ve.ownerDocument.removeEventListener("mousemove",he),oe()}}},[Se])}var H=10;function $(Se,ge,Re,ve,Le,Fe,me,oe){var ie=u.useRef(),fe=u.useState(null),ye=(0,W.Z)(fe,2),he=ye[0],Te=ye[1];return(0,c.Z)(function(){if(he&&he.times<H){if(!Se.current){Te(function(Rt){return(0,X.Z)({},Rt)});return}Fe();var Oe=he.targetAlign,Be=he.originAlign,Ze=he.index,tt=he.offset,dt=Se.current.clientHeight,nt=!1,At=Oe,Nt=null;if(dt){for(var Bt=Oe||Be,st=0,Ot=0,ur=0,br=Math.min(ge.length-1,Ze),Qt=0;Qt<=br;Qt+=1){var Fr=Le(ge[Qt]);Ot=st;var Lt=Re.get(Fr);ur=Ot+(Lt===void 0?ve:Lt),st=ur}for(var gt=Bt==="top"?tt:dt-tt,yt=br;yt>=0;yt-=1){var ir=Le(ge[yt]),Jt=Re.get(ir);if(Jt===void 0){nt=!0;break}if(gt-=Jt,gt<=0)break}switch(Bt){case"top":Nt=Ot-tt;break;case"bottom":Nt=ur-dt+tt;break;default:{var St=Se.current.scrollTop,it=St+dt;Ot<St?At="top":ur>it&&(At="bottom")}}Nt!==null&&me(Nt),Nt!==he.lastTop&&(nt=!0)}nt&&Te((0,X.Z)((0,X.Z)({},he),{},{times:he.times+1,targetAlign:At,lastTop:Nt}))}},[he,Se.current]),function(Oe){if(Oe==null){oe();return}if(r.Z.cancel(ie.current),typeof Oe=="number")me(Oe);else if(Oe&&(0,re.Z)(Oe)==="object"){var Be,Ze=Oe.align;"index"in Oe?Be=Oe.index:Be=ge.findIndex(function(nt){return Le(nt)===Oe.key});var tt=Oe.offset,dt=tt===void 0?0:tt;Te({times:0,index:Be,offset:dt,originAlign:Ze})}}}var q=u.forwardRef(function(Se,ge){var Re=Se.prefixCls,ve=Se.rtl,Le=Se.scrollOffset,Fe=Se.scrollRange,me=Se.onStartMove,oe=Se.onStopMove,ie=Se.onScroll,fe=Se.horizontal,ye=Se.spinSize,he=Se.containerSize,Te=Se.style,Oe=Se.thumbStyle,Be=Se.showScrollBar,Ze=u.useState(!1),tt=(0,W.Z)(Ze,2),dt=tt[0],nt=tt[1],At=u.useState(null),Nt=(0,W.Z)(At,2),Bt=Nt[0],st=Nt[1],Ot=u.useState(null),ur=(0,W.Z)(Ot,2),br=ur[0],Qt=ur[1],Fr=!ve,Lt=u.useRef(),gt=u.useRef(),yt=u.useState(Be),ir=(0,W.Z)(yt,2),Jt=ir[0],St=ir[1],it=u.useRef(),Rt=function(){Be===!0||Be===!1||(clearTimeout(it.current),St(!0),it.current=setTimeout(function(){St(!1)},3e3))},Vt=Fe-he||0,jt=he-ye||0,Yt=u.useMemo(function(){if(Le===0||Vt===0)return 0;var J=Le/Vt;return J*jt},[Le,Vt,jt]),qe=function(le){le.stopPropagation(),le.preventDefault()},mt=u.useRef({top:Yt,dragging:dt,pageY:Bt,startTop:br});mt.current={top:Yt,dragging:dt,pageY:Bt,startTop:br};var Dt=function(le){nt(!0),st(C(le,fe)),Qt(mt.current.top),me(),le.stopPropagation(),le.preventDefault()};u.useEffect(function(){var J=function(Ce){Ce.preventDefault()},le=Lt.current,_e=gt.current;return le.addEventListener("touchstart",J,{passive:!1}),_e.addEventListener("touchstart",Dt,{passive:!1}),function(){le.removeEventListener("touchstart",J),_e.removeEventListener("touchstart",Dt)}},[]);var Ft=u.useRef();Ft.current=Vt;var Zt=u.useRef();Zt.current=jt,u.useEffect(function(){if(dt){var J,le=function(Ce){var Xe=mt.current,Je=Xe.dragging,bt=Xe.pageY,Ht=Xe.startTop;r.Z.cancel(J);var Pe=Lt.current.getBoundingClientRect(),be=he/(fe?Pe.width:Pe.height);if(Je){var ut=(C(Ce,fe)-bt)*be,ze=Ht;!Fr&&fe?ze-=ut:ze+=ut;var He=Ft.current,Qe=Zt.current,ht=Qe?ze/Qe:0,pt=Math.ceil(ht*He);pt=Math.max(pt,0),pt=Math.min(pt,He),J=(0,r.Z)(function(){ie(pt,fe)})}},_e=function(){nt(!1),oe()};return window.addEventListener("mousemove",le,{passive:!0}),window.addEventListener("touchmove",le,{passive:!0}),window.addEventListener("mouseup",_e,{passive:!0}),window.addEventListener("touchend",_e,{passive:!0}),function(){window.removeEventListener("mousemove",le),window.removeEventListener("touchmove",le),window.removeEventListener("mouseup",_e),window.removeEventListener("touchend",_e),r.Z.cancel(J)}}},[dt]),u.useEffect(function(){return Rt(),function(){clearTimeout(it.current)}},[Le]),u.useImperativeHandle(ge,function(){return{delayHidden:Rt}});var _t="".concat(Re,"-scrollbar"),G={position:"absolute",visibility:Jt?null:"hidden"},Y={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return fe?(Object.assign(G,{height:8,left:0,right:0,bottom:0}),Object.assign(Y,(0,D.Z)({height:"100%",width:ye},Fr?"left":"right",Yt))):(Object.assign(G,(0,D.Z)({width:8,top:0,bottom:0},Fr?"right":"left",0)),Object.assign(Y,{width:"100%",height:ye,top:Yt})),u.createElement("div",{ref:Lt,className:A()(_t,(0,D.Z)((0,D.Z)((0,D.Z)({},"".concat(_t,"-horizontal"),fe),"".concat(_t,"-vertical"),!fe),"".concat(_t,"-visible"),Jt)),style:(0,X.Z)((0,X.Z)({},G),Te),onMouseDown:qe,onMouseMove:Rt},u.createElement("div",{ref:gt,className:A()("".concat(_t,"-thumb"),(0,D.Z)({},"".concat(_t,"-thumb-moving"),dt)),style:(0,X.Z)((0,X.Z)({},Y),Oe),onMouseDown:Dt}))}),se=q,ue=20;function pe(){var Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Re=Se/ge*Se;return isNaN(Re)&&(Re=0),Re=Math.max(Re,ue),Math.floor(Re)}var xe=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],De=[],Ue={overflowY:"auto",overflowAnchor:"none"};function Ge(Se,ge){var Re=Se.prefixCls,ve=Re===void 0?"rc-virtual-list":Re,Le=Se.className,Fe=Se.height,me=Se.itemHeight,oe=Se.fullHeight,ie=oe===void 0?!0:oe,fe=Se.style,ye=Se.data,he=Se.children,Te=Se.itemKey,Oe=Se.virtual,Be=Se.direction,Ze=Se.scrollWidth,tt=Se.component,dt=tt===void 0?"div":tt,nt=Se.onScroll,At=Se.onVirtualScroll,Nt=Se.onVisibleChange,Bt=Se.innerProps,st=Se.extraRender,Ot=Se.styles,ur=Se.showScrollBar,br=ur===void 0?"optional":ur,Qt=(0,y.Z)(Se,xe),Fr=u.useCallback(function(Wt){return typeof Te=="function"?Te(Wt):Wt==null?void 0:Wt[Te]},[Te]),Lt=F(Fr,null,null),gt=(0,W.Z)(Lt,4),yt=gt[0],ir=gt[1],Jt=gt[2],St=gt[3],it=!!(Oe!==!1&&Fe&&me),Rt=u.useMemo(function(){return Object.values(Jt.maps).reduce(function(Wt,Mt){return Wt+Mt},0)},[Jt.id,Jt.maps]),Vt=it&&ye&&(Math.max(me*ye.length,Rt)>Fe||!!Ze),jt=Be==="rtl",Yt=A()(ve,(0,D.Z)({},"".concat(ve,"-rtl"),jt),Le),qe=ye||De,mt=(0,u.useRef)(),Dt=(0,u.useRef)(),Ft=(0,u.useRef)(),Zt=(0,u.useState)(0),_t=(0,W.Z)(Zt,2),G=_t[0],Y=_t[1],J=(0,u.useState)(0),le=(0,W.Z)(J,2),_e=le[0],Ie=le[1],Ce=(0,u.useState)(!1),Xe=(0,W.Z)(Ce,2),Je=Xe[0],bt=Xe[1],Ht=function(){bt(!0)},Pe=function(){bt(!1)},be={getKey:Fr};function ut(Wt){Y(function(Mt){var rr;typeof Wt=="function"?rr=Wt(Mt):rr=Wt;var tr=_r(rr);return mt.current.scrollTop=tr,tr})}var ze=(0,u.useRef)({start:0,end:qe.length}),He=(0,u.useRef)(),Qe=v(qe,Fr),ht=(0,W.Z)(Qe,1),pt=ht[0];He.current=pt;var kt=u.useMemo(function(){if(!it)return{scrollHeight:void 0,start:0,end:qe.length-1,offset:void 0};if(!Vt){var Wt;return{scrollHeight:((Wt=Dt.current)===null||Wt===void 0?void 0:Wt.offsetHeight)||0,start:0,end:qe.length-1,offset:void 0}}for(var Mt=0,rr,tr,Tr,Hr=qe.length,qr=0;qr<Hr;qr+=1){var Kr=qe[qr],rn=Fr(Kr),En=Jt.get(rn),gn=Mt+(En===void 0?me:En);gn>=G&&rr===void 0&&(rr=qr,tr=Mt),gn>G+Fe&&Tr===void 0&&(Tr=qr),Mt=gn}return rr===void 0&&(rr=0,tr=0,Tr=Math.ceil(Fe/me)),Tr===void 0&&(Tr=qe.length-1),Tr=Math.min(Tr+1,qe.length-1),{scrollHeight:Mt,start:rr,end:Tr,offset:tr}},[Vt,it,G,qe,St,Fe]),Tt=kt.scrollHeight,Ut=kt.start,ot=kt.end,It=kt.offset;ze.current.start=Ut,ze.current.end=ot,u.useLayoutEffect(function(){var Wt=Jt.getRecord();if(Wt.size===1){var Mt=Array.from(Wt.keys())[0],rr=Wt.get(Mt),tr=qe[Ut];if(tr&&rr===void 0){var Tr=Fr(tr);if(Tr===Mt){var Hr=Jt.get(Mt),qr=Hr-me;ut(function(Kr){return Kr+qr})}}}Jt.resetRecord()},[Tt]);var ft=u.useState({width:0,height:Fe}),Ne=(0,W.Z)(ft,2),je=Ne[0],et=Ne[1],Ke=function(Mt){et({width:Mt.offsetWidth,height:Mt.offsetHeight})},Et=(0,u.useRef)(),wt=(0,u.useRef)(),Pt=u.useMemo(function(){return pe(je.width,Ze)},[je.width,Ze]),zt=u.useMemo(function(){return pe(je.height,Tt)},[je.height,Tt]),er=Tt-Fe,$t=(0,u.useRef)(er);$t.current=er;function _r(Wt){var Mt=Wt;return Number.isNaN($t.current)||(Mt=Math.min(Mt,$t.current)),Mt=Math.max(Mt,0),Mt}var Ve=G<=0,Xt=G>=er,ar=_e<=0,mr=_e>=Ze,sr=E(Ve,Xt,ar,mr),nr=function(){return{x:jt?-_e:_e,y:G}},cr=(0,u.useRef)(nr()),Mr=(0,x.zX)(function(Wt){if(At){var Mt=(0,X.Z)((0,X.Z)({},nr()),Wt);(cr.current.x!==Mt.x||cr.current.y!==Mt.y)&&(At(Mt),cr.current=Mt)}});function Sr(Wt,Mt){var rr=Wt;Mt?((0,f.flushSync)(function(){Ie(rr)}),Mr()):ut(rr)}function Er(Wt){var Mt=Wt.currentTarget.scrollTop;Mt!==G&&ut(Mt),nt==null||nt(Wt),Mr()}var Cr=function(Mt){var rr=Mt,tr=Ze?Ze-je.width:0;return rr=Math.max(rr,0),rr=Math.min(rr,tr),rr},vr=(0,x.zX)(function(Wt,Mt){Mt?((0,f.flushSync)(function(){Ie(function(rr){var tr=rr+(jt?-Wt:Wt);return Cr(tr)})}),Mr()):ut(function(rr){var tr=rr+Wt;return tr})}),pr=S(it,Ve,Xt,ar,mr,!!Ze,vr),Qr=(0,W.Z)(pr,2),zr=Qr[0],Wr=Qr[1];B(it,mt,function(Wt,Mt,rr,tr){var Tr=tr;return sr(Wt,Mt,rr)?!1:!Tr||!Tr._virtualHandled?(Tr&&(Tr._virtualHandled=!0),zr({preventDefault:function(){},deltaX:Wt?Mt:0,deltaY:Wt?0:Mt}),!0):!1}),M(Vt,mt,function(Wt){ut(function(Mt){return Mt+Wt})}),(0,c.Z)(function(){function Wt(rr){var tr=Ve&&rr.detail<0,Tr=Xt&&rr.detail>0;it&&!tr&&!Tr&&rr.preventDefault()}var Mt=mt.current;return Mt.addEventListener("wheel",zr,{passive:!1}),Mt.addEventListener("DOMMouseScroll",Wr,{passive:!0}),Mt.addEventListener("MozMousePixelScroll",Wt,{passive:!1}),function(){Mt.removeEventListener("wheel",zr),Mt.removeEventListener("DOMMouseScroll",Wr),Mt.removeEventListener("MozMousePixelScroll",Wt)}},[it,Ve,Xt]),(0,c.Z)(function(){if(Ze){var Wt=Cr(_e);Ie(Wt),Mr({x:Wt})}},[je.width,Ze]);var wr=function(){var Mt,rr;(Mt=Et.current)===null||Mt===void 0||Mt.delayHidden(),(rr=wt.current)===null||rr===void 0||rr.delayHidden()},on=$(mt,qe,Jt,me,Fr,function(){return ir(!0)},ut,wr);u.useImperativeHandle(ge,function(){return{nativeElement:Ft.current,getScrollInfo:nr,scrollTo:function(Mt){function rr(tr){return tr&&(0,re.Z)(tr)==="object"&&("left"in tr||"top"in tr)}rr(Mt)?(Mt.left!==void 0&&Ie(Cr(Mt.left)),on(Mt.top)):on(Mt)}}}),(0,c.Z)(function(){if(Nt){var Wt=qe.slice(Ut,ot+1);Nt(Wt,qe)}},[Ut,ot,qe]);var Xr=w(qe,Fr,Jt,me),Gr=st==null?void 0:st({start:Ut,end:ot,virtual:Vt,offsetX:_e,offsetY:It,rtl:jt,getSize:Xr}),un=m(qe,Ut,ot,Ze,_e,yt,he,be),Jr=null;Fe&&(Jr=(0,X.Z)((0,D.Z)({},ie?"height":"maxHeight",Fe),Ue),it&&(Jr.overflowY="hidden",Ze&&(Jr.overflowX="hidden"),Je&&(Jr.pointerEvents="none")));var gr={};return jt&&(gr.dir="rtl"),u.createElement("div",(0,te.Z)({ref:Ft,style:(0,X.Z)((0,X.Z)({},fe),{},{position:"relative"}),className:Yt},gr,Qt),u.createElement(s.Z,{onResize:Ke},u.createElement(dt,{className:"".concat(ve,"-holder"),style:Jr,ref:mt,onScroll:Er,onMouseEnter:wr},u.createElement(o,{prefixCls:ve,height:Tt,offsetX:_e,offsetY:It,scrollWidth:Ze,onInnerResize:ir,ref:Dt,innerProps:Bt,rtl:jt,extra:Gr},un))),Vt&&Tt>Fe&&u.createElement(se,{ref:Et,prefixCls:ve,scrollOffset:G,scrollRange:Tt,rtl:jt,onScroll:Sr,onStartMove:Ht,onStopMove:Pe,spinSize:zt,containerSize:je.height,style:Ot==null?void 0:Ot.verticalScrollBar,thumbStyle:Ot==null?void 0:Ot.verticalScrollBarThumb,showScrollBar:br}),Vt&&Ze>je.width&&u.createElement(se,{ref:wt,prefixCls:ve,scrollOffset:_e,scrollRange:Ze,rtl:jt,onScroll:Sr,onStartMove:Ht,onStopMove:Pe,spinSize:Pt,containerSize:je.width,horizontal:!0,style:Ot==null?void 0:Ot.horizontalScrollBar,thumbStyle:Ot==null?void 0:Ot.horizontalScrollBarThumb,showScrollBar:br}))}var Ae=u.forwardRef(Ge);Ae.displayName="List";var We=Ae,we=We},83145:function(qt,$e,ae){"use strict";Object.defineProperty($e,"__esModule",{value:!0}),$e.CopyToClipboard=void 0;var te=X(ae(59301)),re=X(ae(25769));function X(h){return h&&h.__esModule?h:{default:h}}function D(h){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?D=function(r){return typeof r}:D=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},D(h)}function W(h,v){var r=Object.keys(h);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(h);v&&(a=a.filter(function(p){return Object.getOwnPropertyDescriptor(h,p).enumerable})),r.push.apply(r,a)}return r}function y(h){for(var v=1;v<arguments.length;v++){var r=arguments[v]!=null?arguments[v]:{};v%2?W(r,!0).forEach(function(a){m(h,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(r)):W(r).forEach(function(a){Object.defineProperty(h,a,Object.getOwnPropertyDescriptor(r,a))})}return h}function L(h,v){if(h==null)return{};var r=A(h,v),a,p;if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(h);for(p=0;p<E.length;p++)a=E[p],!(v.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(h,a)&&(r[a]=h[a])}return r}function A(h,v){if(h==null)return{};var r={},a=Object.keys(h),p,E;for(E=0;E<a.length;E++)p=a[E],!(v.indexOf(p)>=0)&&(r[p]=h[p]);return r}function s(h,v){if(!(h instanceof v))throw new TypeError("Cannot call a class as a function")}function x(h,v){for(var r=0;r<v.length;r++){var a=v[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(h,a.key,a)}}function c(h,v,r){return v&&x(h.prototype,v),r&&x(h,r),h}function u(h,v){return v&&(D(v)==="object"||typeof v=="function")?v:i(h)}function f(h){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},f(h)}function i(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}function o(h,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");h.prototype=Object.create(v&&v.prototype,{constructor:{value:h,writable:!0,configurable:!0}}),v&&d(h,v)}function d(h,v){return d=Object.setPrototypeOf||function(a,p){return a.__proto__=p,a},d(h,v)}function m(h,v,r){return v in h?Object.defineProperty(h,v,{value:r,enumerable:!0,configurable:!0,writable:!0}):h[v]=r,h}var _=function(h){o(v,h);function v(){var r,a;s(this,v);for(var p=arguments.length,E=new Array(p),S=0;S<p;S++)E[S]=arguments[S];return a=u(this,(r=f(v)).call.apply(r,[this].concat(E))),m(i(a),"onClick",function(w){var R=a.props,O=R.text,z=R.onCopy,N=R.children,P=R.options,F=te.default.Children.only(N),K=(0,re.default)(O,P);z&&z(O,K),F&&F.props&&typeof F.props.onClick=="function"&&F.props.onClick(w)}),a}return c(v,[{key:"render",value:function(){var a=this.props,p=a.text,E=a.onCopy,S=a.options,w=a.children,R=L(a,["text","onCopy","options","children"]),O=te.default.Children.only(w);return te.default.cloneElement(O,y({},R,{onClick:this.onClick}))}}]),v}(te.default.PureComponent);$e.CopyToClipboard=_,m(_,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(qt,$e,ae){"use strict";var te=ae(83145),re=te.CopyToClipboard;re.CopyToClipboard=re,qt.exports=re},76374:function(qt,$e,ae){"use strict";var te=function(){if(typeof Map!="undefined")return Map;function N(P,F){var K=-1;return P.some(function(B,V){return B[0]===F?(K=V,!0):!1}),K}return function(){function P(){this.__entries__=[]}return Object.defineProperty(P.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),P.prototype.get=function(F){var K=N(this.__entries__,F),B=this.__entries__[K];return B&&B[1]},P.prototype.set=function(F,K){var B=N(this.__entries__,F);~B?this.__entries__[B][1]=K:this.__entries__.push([F,K])},P.prototype.delete=function(F){var K=this.__entries__,B=N(K,F);~B&&K.splice(B,1)},P.prototype.has=function(F){return!!~N(this.__entries__,F)},P.prototype.clear=function(){this.__entries__.splice(0)},P.prototype.forEach=function(F,K){K===void 0&&(K=null);for(var B=0,V=this.__entries__;B<V.length;B++){var C=V[B];F.call(K,C[1],C[0])}},P}()}(),re=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,X=function(){return typeof ae.g!="undefined"&&ae.g.Math===Math?ae.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),D=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(X):function(N){return setTimeout(function(){return N(Date.now())},1e3/60)}}(),W=2;function y(N,P){var F=!1,K=!1,B=0;function V(){F&&(F=!1,N()),K&&M()}function C(){D(V)}function M(){var H=Date.now();if(F){if(H-B<W)return;K=!0}else F=!0,K=!1,setTimeout(C,P);B=H}return M}var L=20,A=["top","right","bottom","left","width","height","size","weight"],s=typeof MutationObserver!="undefined",x=function(){function N(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=y(this.refresh.bind(this),L)}return N.prototype.addObserver=function(P){~this.observers_.indexOf(P)||this.observers_.push(P),this.connected_||this.connect_()},N.prototype.removeObserver=function(P){var F=this.observers_,K=F.indexOf(P);~K&&F.splice(K,1),!F.length&&this.connected_&&this.disconnect_()},N.prototype.refresh=function(){var P=this.updateObservers_();P&&this.refresh()},N.prototype.updateObservers_=function(){var P=this.observers_.filter(function(F){return F.gatherActive(),F.hasActive()});return P.forEach(function(F){return F.broadcastActive()}),P.length>0},N.prototype.connect_=function(){!re||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),s?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},N.prototype.disconnect_=function(){!re||!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)},N.prototype.onTransitionEnd_=function(P){var F=P.propertyName,K=F===void 0?"":F,B=A.some(function(V){return!!~K.indexOf(V)});B&&this.refresh()},N.getInstance=function(){return this.instance_||(this.instance_=new N),this.instance_},N.instance_=null,N}(),c=function(N,P){for(var F=0,K=Object.keys(P);F<K.length;F++){var B=K[F];Object.defineProperty(N,B,{value:P[B],enumerable:!1,writable:!1,configurable:!0})}return N},u=function(N){var P=N&&N.ownerDocument&&N.ownerDocument.defaultView;return P||X},f=p(0,0,0,0);function i(N){return parseFloat(N)||0}function o(N){for(var P=[],F=1;F<arguments.length;F++)P[F-1]=arguments[F];return P.reduce(function(K,B){var V=N["border-"+B+"-width"];return K+i(V)},0)}function d(N){for(var P=["top","right","bottom","left"],F={},K=0,B=P;K<B.length;K++){var V=B[K],C=N["padding-"+V];F[V]=i(C)}return F}function m(N){var P=N.getBBox();return p(0,0,P.width,P.height)}function _(N){var P=N.clientWidth,F=N.clientHeight;if(!P&&!F)return f;var K=u(N).getComputedStyle(N),B=d(K),V=B.left+B.right,C=B.top+B.bottom,M=i(K.width),H=i(K.height);if(K.boxSizing==="border-box"&&(Math.round(M+V)!==P&&(M-=o(K,"left","right")+V),Math.round(H+C)!==F&&(H-=o(K,"top","bottom")+C)),!v(N)){var $=Math.round(M+V)-P,q=Math.round(H+C)-F;Math.abs($)!==1&&(M-=$),Math.abs(q)!==1&&(H-=q)}return p(B.left,B.top,M,H)}var h=function(){return typeof SVGGraphicsElement!="undefined"?function(N){return N instanceof u(N).SVGGraphicsElement}:function(N){return N instanceof u(N).SVGElement&&typeof N.getBBox=="function"}}();function v(N){return N===u(N).document.documentElement}function r(N){return re?h(N)?m(N):_(N):f}function a(N){var P=N.x,F=N.y,K=N.width,B=N.height,V=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,C=Object.create(V.prototype);return c(C,{x:P,y:F,width:K,height:B,top:F,right:P+K,bottom:B+F,left:P}),C}function p(N,P,F,K){return{x:N,y:P,width:F,height:K}}var E=function(){function N(P){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=p(0,0,0,0),this.target=P}return N.prototype.isActive=function(){var P=r(this.target);return this.contentRect_=P,P.width!==this.broadcastWidth||P.height!==this.broadcastHeight},N.prototype.broadcastRect=function(){var P=this.contentRect_;return this.broadcastWidth=P.width,this.broadcastHeight=P.height,P},N}(),S=function(){function N(P,F){var K=a(F);c(this,{target:P,contentRect:K})}return N}(),w=function(){function N(P,F,K){if(this.activeObservations_=[],this.observations_=new te,typeof P!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=P,this.controller_=F,this.callbackCtx_=K}return N.prototype.observe=function(P){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(P instanceof u(P).Element))throw new TypeError('parameter 1 is not of type "Element".');var F=this.observations_;F.has(P)||(F.set(P,new E(P)),this.controller_.addObserver(this),this.controller_.refresh())}},N.prototype.unobserve=function(P){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(P instanceof u(P).Element))throw new TypeError('parameter 1 is not of type "Element".');var F=this.observations_;F.has(P)&&(F.delete(P),F.size||this.controller_.removeObserver(this))}},N.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},N.prototype.gatherActive=function(){var P=this;this.clearActive(),this.observations_.forEach(function(F){F.isActive()&&P.activeObservations_.push(F)})},N.prototype.broadcastActive=function(){if(this.hasActive()){var P=this.callbackCtx_,F=this.activeObservations_.map(function(K){return new S(K.target,K.broadcastRect())});this.callback_.call(P,F,P),this.clearActive()}},N.prototype.clearActive=function(){this.activeObservations_.splice(0)},N.prototype.hasActive=function(){return this.activeObservations_.length>0},N}(),R=typeof WeakMap!="undefined"?new WeakMap:new te,O=function(){function N(P){if(!(this instanceof N))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var F=x.getInstance(),K=new w(P,F,this);R.set(this,K)}return N}();["observe","unobserve","disconnect"].forEach(function(N){O.prototype[N]=function(){var P;return(P=R.get(this))[N].apply(P,arguments)}});var z=function(){return typeof X.ResizeObserver!="undefined"?X.ResizeObserver:O}();$e.Z=z},27774:function(qt,$e){"use strict";Object.defineProperty($e,"__esModule",{value:!0}),$e.SizeSensorId=$e.SensorTabIndex=$e.SensorClassName=void 0;var ae="size-sensor-id";$e.SizeSensorId=ae;var te="size-sensor-object";$e.SensorClassName=te;var re="-1";$e.SensorTabIndex=re},79301:function(qt,$e){"use strict";Object.defineProperty($e,"__esModule",{value:!0}),$e.default=void 0;var ae=function(re){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:60,D=null;return function(){for(var W=this,y=arguments.length,L=new Array(y),A=0;A<y;A++)L[A]=arguments[A];clearTimeout(D),D=setTimeout(function(){re.apply(W,L)},X)}};$e.default=ae},79789:function(qt,$e){"use strict";Object.defineProperty($e,"__esModule",{value:!0}),$e.default=void 0;var ae=1,te=function(){return"".concat(ae++)};$e.default=te},47242:function(qt,$e,ae){"use strict";Object.defineProperty($e,"__esModule",{value:!0}),$e.ver=$e.clear=$e.bind=void 0;var te=ae(16478),re=function(y,L){var A=(0,te.getSensor)(y);return A.bind(L),function(){A.unbind(L)}};$e.bind=re;var X=function(y){var L=(0,te.getSensor)(y);(0,te.removeSensor)(L)};$e.clear=X;var D="1.0.2";$e.ver=D},16478:function(qt,$e,ae){"use strict";Object.defineProperty($e,"__esModule",{value:!0}),$e.removeSensor=$e.getSensor=$e.Sensors=void 0;var te=D(ae(79789)),re=ae(57829),X=ae(27774);function D(s){return s&&s.__esModule?s:{default:s}}var W={};$e.Sensors=W;function y(s){s&&W[s]&&delete W[s]}var L=function(x){var c=x.getAttribute(X.SizeSensorId);if(c&&W[c])return W[c];var u=(0,te.default)();x.setAttribute(X.SizeSensorId,u);var f=(0,re.createSensor)(x,function(){return y(u)});return W[u]=f,f};$e.getSensor=L;var A=function(x){var c=x.element.getAttribute(X.SizeSensorId);x.destroy(),y(c)};$e.removeSensor=A},57829:function(qt,$e,ae){"use strict";Object.defineProperty($e,"__esModule",{value:!0}),$e.createSensor=void 0;var te=ae(20953),re=ae(55202),X=typeof ResizeObserver!="undefined"?re.createSensor:te.createSensor;$e.createSensor=X},20953:function(qt,$e,ae){"use strict";Object.defineProperty($e,"__esModule",{value:!0}),$e.createSensor=void 0;var te=X(ae(79301)),re=ae(27774);function X(W){return W&&W.__esModule?W:{default:W}}var D=function(y,L){var A=void 0,s=[],x=function(){getComputedStyle(y).position==="static"&&(y.style.position="relative");var d=document.createElement("object");return d.onload=function(){d.contentDocument.defaultView.addEventListener("resize",c),c()},d.style.display="block",d.style.position="absolute",d.style.top="0",d.style.left="0",d.style.height="100%",d.style.width="100%",d.style.overflow="hidden",d.style.pointerEvents="none",d.style.zIndex="-1",d.style.opacity="0",d.setAttribute("class",re.SensorClassName),d.setAttribute("tabindex",re.SensorTabIndex),d.type="text/html",y.appendChild(d),d.data="about:blank",d},c=(0,te.default)(function(){s.forEach(function(o){o(y)})}),u=function(d){A||(A=x()),s.indexOf(d)===-1&&s.push(d)},f=function(){A&&A.parentNode&&(A.contentDocument&&A.contentDocument.defaultView.removeEventListener("resize",c),A.parentNode.removeChild(A),y.removeAttribute(re.SizeSensorId),A=void 0,s=[],L&&L())},i=function(d){var m=s.indexOf(d);m!==-1&&s.splice(m,1),s.length===0&&A&&f()};return{element:y,bind:u,destroy:f,unbind:i}};$e.createSensor=D},55202:function(qt,$e,ae){"use strict";Object.defineProperty($e,"__esModule",{value:!0}),$e.createSensor=void 0;var te=ae(27774),re=X(ae(79301));function X(W){return W&&W.__esModule?W:{default:W}}var D=function(y,L){var A=void 0,s=[],x=(0,re.default)(function(){s.forEach(function(o){o(y)})}),c=function(){var d=new ResizeObserver(x);return d.observe(y),x(),d},u=function(d){A||(A=c()),s.indexOf(d)===-1&&s.push(d)},f=function(){A.disconnect(),s=[],A=void 0,y.removeAttribute(te.SizeSensorId),L&&L()},i=function(d){var m=s.indexOf(d);m!==-1&&s.splice(m,1),s.length===0&&A&&f()};return{element:y,bind:u,destroy:f,unbind:i}};$e.createSensor=D},98040:function(qt){qt.exports=function(){var $e=document.getSelection();if(!$e.rangeCount)return function(){};for(var ae=document.activeElement,te=[],re=0;re<$e.rangeCount;re++)te.push($e.getRangeAt(re));switch(ae.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":ae.blur();break;default:ae=null;break}return $e.removeAllRanges(),function(){$e.type==="Caret"&&$e.removeAllRanges(),$e.rangeCount||te.forEach(function(X){$e.addRange(X)}),ae&&ae.focus()}}},82059:function(qt){var $e=arguments[3],ae=arguments[4],te=arguments[5],re=JSON.stringify;qt.exports=function(X,D){for(var W,y=Object.keys(te),L=0,A=y.length;L<A;L++){var s=y[L],x=te[s].exports;if(x===X||x&&x.default===X){W=s;break}}if(!W){W=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var c={},L=0,A=y.length;L<A;L++){var s=y[L];c[s]=s}ae[W]=["function(require,module,exports){"+X+"(self); }",c]}var u=Math.floor(Math.pow(16,8)*Math.random()).toString(16),f={};f[W]=W,ae[u]=["function(require,module,exports){var f = require("+re(W)+");(f.default ? f.default : f)(self);}",f];var i={};o(u);function o(r){i[r]=!0;for(var a in ae[r][1]){var p=ae[r][1][a];i[p]||o(p)}}var d="("+$e+")({"+Object.keys(i).map(function(r){return re(r)+":["+ae[r][0]+","+re(ae[r][1])+"]"}).join(",")+"},{},["+re(u)+"])",m=window.URL||window.webkitURL||window.mozURL||window.msURL,_=new Blob([d],{type:"text/javascript"});if(D&&D.bare)return _;var h=m.createObjectURL(_),v=new Worker(h);return v.objectURL=h,v}},93314:function(qt){"use strict";qt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},96908:function(qt){"use strict";qt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKQAAAA8CAYAAADogBFvAAAAAXNSR0IArs4c6QAADzxJREFUeF7tnQl4VcUVx3/3JSEBARFEFllcQAMJuKDUD7FqtVbFtUqtS6ufS1soxaW1Si0KBaFVWy2ittqqdQ9xpYq4tLgVFWUThYQlJIEkkJXs63u333lzL+/mrfeF9/KSeM/35Xv3zZw5c+bM/83MOTN3ouGQY4EuZAGtC+niqOJYAAeQDgi6lAU0fUayHqCR5gJXEriS/T6TICkZNOMzIN/gFx7/8vvLiFxDtpfP4G2Xb5Ej6SaPKddav6mPtb5g9e/PF9nSvmTVlpD1S36Sr63WOj1ukD/d+PR+b1NpAekmj5Gve8Dd5lc2ivK4G2lzV4K7Eo/8eSrQ3ZW424rw6J/ST1utTb2jtkuhLAplwgDS7BDj09txdgFqgsjCbwVOKMCYAPH+IAzABIDf8qPYz+OygMus0+8HFQDmYDpaypj1mp+m/qKbgMoKQO+zxwIyCzhNPhOIQQFrAas/uK3l5dlt/SEY9bbn0ZsrS1obynfXNJQXFTeUbPugua5utQZrM7PZHgU2EsIaHJAJUcWp1JYFklKgVx/fX0oqpPSBgw6BASOh/xAlxgC+u6WJqh0bqdi2nrb66gI0sjQXL2W8xHpb9XUykwPITjZ43KuTpcnBw2HA4TBwFBw81Dt66+42aoq2U7FjAw0Ve8R52KxpLB6v86KWjTvuetmswAGkTUN1W7aDBsHIieiHjkVDlhpuavbkU7ThE9wtjQLMbTosyFzGc5pGoD/RyQ13ANnJBk9YdSm9YVg6+tB0NC2ZtqZ6dn/1P+rKirwqaRqrknVuSM9mZ8J0FD2CetmJ1MipO74WkPXn0VOg72CvY1ZRuJU9uRvQPW4ZLes0jdszlvG3+CoRWroDyERZPtH1Dk1HH56B5vHQWFvJzrUf42lrUaMlPJ4BMxOxtnQAmWhgJLL+3gPQR5+E1qsPDdXl5G9YjUdipIreGpzGFUOfpb4zVXQA2ZnW7op1paSiH30qWlIqdVWlFGz6Al1ipmqkXH0wnD0ym8bOUt0BZGdZuivXk9IH/ajJaK4Uasr3UJizUQX/Fb2WOZ7LtfniosefHEDG38bdo4bUvuijJqG5XFQU5VOSv22/3hr8NTObWzqjIQ4gO8PK3aWO3v3RR57gHR13blpHQ121FZTTM7N5Od5NcQAZbwt3N/mDjvDu8jQ11rHj6/XoskevqKxXMuOPfZHyeDbJAWQ8rdsdZct2zYjj0VJS2bu7gLLiXdZRMiszmx/Hs1kOIONp3e4qO60/+rBx6O5WdmzeRHOTz8lO0pg2fhkr4tU0B5Dxsmx3lytTd99B1FZVUZC31dqanMzxTNDmsz9gGcumOoCMpTV7kixXEvrwCV4HZ1vuZlqamqytu2VCNn+NR3MdQMbDqj1Epj5wBFqfgVSU7qWkWB3CENKgEhibme39jCklBpCysf/H3aohrY1w64CYNqrLCJOziRJg1hN+qqtjJklJQx88xrudmJuzBY+cVveBcmlmNr/qmODQpRIHyPuKlVYtjXBL/1i3K7HyDh4Gp94IU2+Ee0+A+pgPJJ3WPn3QEWgpvSkpKaaiosJabxsuJk7IYksslXEAGUtrmrIW5sHAkerb7UO6NSBJ6wcDhnvXkFu354HlDK8GKzOzOS+WJnQAGUtrmrIW5atXCHoCIDXwDDwSlyuJvIICGhran7OIdRjIAaQDyIgW0PsNRkvtR2l5OaXlAcuPmIaBuh4gp1wP/QYrI338ODRUBRpM0+Cc36p0OVT6nwd9PIcdAydcqr7nroL8NXDi5TBmKoyepPgL16n0dS+3dzgGjoaTjY0If7n+Wow+GdK/p1Jr9sC+Ihg1SX0X3Xob6+K3F0FLg0r/egUUbWovSRy8SdNh5PEw4jho2Ae71sOuDbDhVaWvP1nbWLIZvvo3TLwQvjtDvdQlaf+eB2Uxeuu1V2/oP4yGhnryCn3etqmWS+PmjGUsiYhsGwxdD5C/WwsjJirV7xkX3KjyPvZSY+poqoXbBvqaetzF8HPjDMAbc2HIWDjlp8FNsfldePIaH+iTU2FxIRxkyHvgu5D3afCyM5dDprF8emuBN4jM6TPDm/zZG+HTf/l4xpwG1z/nXaMFpYIv4fHpUGVEJEwmaxu/eBFyP4Br/t5exMPnwZb3bUDADouGPmiU9+3FnLxC3BZvW0rHMgzUswEpI5O8Q9LaDAVroHgzDE2H0SdB6kGqJyryYdFJ0GicbLnsfjjLOGn1yT/ghRmBPSajmgBXLg+Qwwd3j4WzboXTDV4J95jkPZxghH2e+xl89ozKEVDdlKVu8RAq/lqNikm91Eg++GiVXlsGD52tRr1ggCz+BgaPAXk/20oxBSTo/YagJfdiV8lequuMEd9SnwYxCQP1bECKwerK4ZELQUYbk2RbbNZbMOQYlbJyMSy/Wz3LdDjvG/XcWAN3Hg6t7XYp4IxZ8CNjmSCj7NJp7cEQyamRH8m8zT7H54WZ8MkTPhlyO4ZM+xcvUGkb3oDHLw8OSDP1m3fgw0ehtlSBWUb2ysL2eh3It7T+iMddVV1LUVnQMFZMwkA9H5CPXQqb3gzsChlVBBSyHm2uh7ljFHiFbn4Pjj1DPT/1U5Bp0Uq/XQ1HnKxSnrgC1r8aHSAvnAfn3aXKfPYsPHN9cKiYywIJrC+a5Ft/WqfsSDIOBITWsnJjRr/DaG1pIbewJKjUWISBejYgZTqeOzZ0l9zyPhxzusp/7BLY9JZ6FifjhhfUc85/YckPfDKsI6iMRnNGq3t+rBRphJyzBuQgrNBD34etHwTXcfLVcN3TKu/d++H136lnKyDlx3TXkcGdv1iB0ZTT7zDv0/aiMppaWoNKP9AwUM8G5Fdvwt8MjzuY+ab/Bc40dr+yfw2rDEdRRgMBlXSArAFl9KwyzgVaR7f3HoDX5gRKjgTIh6rV2lZow+uBSwJTojhX489R32QUltHYH5A7P4P7T4s19ILLk2k7JY3SqhpK99WFqvOAwkA9G5Af/R1emhW6s865HS5ZpPJXLYXsW328Fy+EH9yhvi+/B1YafH/YCoceqdLnZUBpu6NZKj0cICVgLvnRkoSCFk8OBOSXy+DJq6OV1jH+5F6Q1p/G5mZ2lAQJxxlSDyQMFHtATpgGR56iVNvyHmz7KLDxstcrXqpQUx3cdoiPJ5ZhnzUvwNPXhjb+tLth2lyV/86f4I3f+3jF8Zmfq+6SLNsB96TDUVPgNx8qHmnXg2cFlx0OkDIyPrhPrV2FJNbqe8MvtK4S3go2Zcv6Vta5nUGicp9B3vuBcooraXMHfxHxQMJAsQfkRQvg3DuVeazeq9Vgo06EOz9XKXu3wvwMX651fbXgeCgxPF5reQlgLzSCvuHikOJpSiwxFF3zBEy5TuU+exN8aqzXTP5fvgkZxvrxz2fC5CvhtJ+p3KevgzXPRw9IKWHd6w41yoYDmH8csrMAKTql9vWGqoqr6qisaw6pZUfDQLEH5Hd+Atc+qRRdmw3/vCpQaStPzn9gybk+nl+8BhMvUN+XXgCb3wksf+1T8J1rVHo4QMoux7xxwcMfElwXUJt7zg+cDnmr29clux+/MDxoGW0zzlVBc9lNmTMy9Nov0hpy1goY/31Vl3/Ix6rB8ZfACT9UKRJe+vw59ZxIQMq0nZJGbUMzBRVhL7XoUBgo9oCUoPMdxu6GBKQXTIByy4VaKWnwm4/VVpnQf5fAy7/2dcP0B+FMY90XbMo9fCLM+UJNpZEAKflfZqndGH8SZ0acGiEJSC82wjhWPokH3pvnA62ZJ/G+rJsDZZop1nWmePni7VvpuIvg56+oFNlynJ8JzX5OgswCd63zbUH+5Xuw/ePEA1KWGvIOt9vNlr21eDyhz3p2JAwUe0CKyWavhHRjfVVXoUAni38x8ik/geHGFC33yMgIZu2wcWfDr972dZ/slnz+PNTuhaNPhUvuVd6vSeFGSPGQBbjrXoH3/gxl22BIOpz0I593LXIevQi+ttRpBc/5c+ECI2hupt8rMcGvQgPSGk6SsFHO+2rPXLxyk2a8DrLeFirdrtaHEryXy0ZlmTD5Kt9uzTcrVXDfpESOkKKD7G3rOruqmqhuCv9qjcvF+RlZhDBuoAnjA0iJ1ckoaR4wCNV1794HrxsBYivPze/CsWcGLyUgWz5XAVMoHCAFiEInXhZcloBkxQKQvehQJFP6wh2+Lb78L+C+KaH5JUeWE7Ks8KdZaeqqZaFDRsCMN3z79qEk7t4IMjo21XQdQLpSvP8QoKaxlcJ9odeRorCmsSVjHBPtvhQWH0CKJtKRVz3mO4BgNXhFgQrHyC8/GMmhUNlTPvWG9rnVJarcphX2DleIByrOxxVL1Mhsxv5EqkyVWbNh4/Lw4JLc2e/4TvbI3raM2pFo6k1wxkwYPNa3z2wFpJSXeOf5v1d751bdJE/WqfJDkeWBf+A90SOkTNtJvdA9bWwpa8ET4RWNaMJA8QOk2WF9DlEHGmS6FhDszVX7rXao76EwdJy6yF2OjJXLieUIFKqzpPMlHCWjdsFadWTMDglQFhVAnwFqi/HOEYHrPTtywvFIBx96FAzPVODbk6PW3XbCQQdad0fLiz11D7urW9nXHP4eqmjCQPEHZEcb3NFysR49JMxz5SNKm9VPgZzYcQjE4ZOzKy1u8qtt3Jmv8fCEZcyOZDoHkJEsNHcjDBuvuO6bCvlG/DRSuW9Dvly74tHZUumOOG3LUWo7L4U5gAwHHHGsxMESkvOKC40DEd8GsEXRxqI6D1VNka+P1ODtzGzOD7t66XGX3sdyypaguATHhbJvg1UPR9FN3x7WxjbYsc/ezSqRwkA9b4QclqE8aiEJeH/5UseQITs5F81X/+tQSPa6g73f0zHpPaqUhMa3VrppDRMkNxscKQzU8wDZo7q6+zSmtFGntN6GcwOECwM5gOw+fd6lNW31QG6lADLytTHhwkAOILt0N3cv5XZWe6gXZNqhEGEgB5B2jOfw2LLAvmad3bX2pu1QYSAHkLZM7TDZsYD4NDn2YpJeccHCQA4g7Vja4bFtgeJ6D5WNNqdtcXD8TgM5gLRtaofRjgWa3LC9yl5M0jtK+p0GcgBpx8oOT1QWyKt209Aa2ds2hbpczM7Iwrvr4AAyKlM7zHYsEKVz0+5uIAeQdizs8Ni2gIyL8icxSbeNnZv9go0wkANI26Z2GKOxwJ56D+VRODdmGMgBZDRWdnhtW6C6WWeX/Zjk/jDQ/wHkSLPJ/mcrgQAAAABJRU5ErkJggg=="},57177:function(qt){"use strict";qt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANQAAAA8CAYAAAAeyZT3AAAAAXNSR0IArs4c6QAAEpJJREFUeF7tXQeYFdUV/mcbS1F6UUEsoLC7IGKNJWpERbEgSoxGo7HEQFDRWCAGgdASNBbEhglqsC1rAxVBNGg0qNgLsJRddmFhe3vby3uT7393ZmfeezOv7M57W3LP9/EtM3Pn3DPn3n/uvf85c58CKdID0gOOeUBxTJNUJD0gPQAJKNkJpAcc9EALoNRpCaqt3rh4QIkDvH/jxV/zuZZjrVy8uRzvSzDdrx3HxWnnEnz1eevhOf/79HpNdrAs6wrQr9VvtiMc+/kc0HSan9Nrq8Uzt9hquuZjv8kPev26r8x16X5VPYDHDYT7Vy/L8vo94d7P8u5mcV+w+1U34GEZ7a+5Tg/vV31tbrmu36ff23JcB9VdBo9a5v2rekq14/1wN30GNXGzctPKKgf7eExVKUGBpJsSEkgWYPMHXEuH0sHlB5iW8jrAtE6sd9AW8GidVD9mR/fvxDrAzJ3Yp/ObAGL3srC1XweJnf0awHUQWgGJ52i3P+D9OyOP/QHSAjYT8Lwd3gRGH3Bp5dza34D7LUDsD04vmPzuN9cZGkSAF3xm4JttNoFWdasNlRVNta4SV21l6YHakvyPGurrNivA12kZ2B1TdLSisvAA1QrF8hbpAUsP8EWVkAwkdgMSugHxiUB8EpDcC+g1AOjeG+BciSBWPXA3NaA8Pxel+7LRXF+bCwXpShxeTX0V33ZED0tAdcRW+X+2iaN3j35Ar/7iX/e+XnCpbg9cZfkozctBrauci/9tioIlKSpeUTLg7iguk4DqKC0h7bD2QPJBQP/hUHsNhsIVv+qBq7QI+7O2w93USGDtUoEFaavxoqJ4x7Z2FQmodnW/rDxsD3Ba2PcwqL0PhaLEobmxAXnZmaiuKPOqUBRsSlBx06gM7AlbZxQKSkBFwalSZRQ9kJAEDD4GSD7Yyz6WFu5HQV4uVI+Ho1W1ouCe1NV4OooWBFUtAdVenpf1ts0DfQ6F2mcoOMurq6nCnp2Z8DAMwNEKWJEKTG+PtZUEVNuaVd7dnh5I6gF1wFFQEpJQW+1CTtYueBgeEPLuwGRcNWQVamJpogRULL0t63LeA/GJUAeNhBKXgOpqF3Kzs6Ey3iVGqs29gQnDMlDnfMXWGiWgYuVpWU/0PBCfBHXQ0VCUeLgqK7B3b67I4BDyZloKrlTmQ6AsyiIBFWUHS/Ux8kBCMtT+w70MYGlJMfILCloqVoDH0jIwMxaWSEDFwsuyjth4IKk71D7DGKzCnj05qK0zZnoKMDUtA69F2xAJqGh7WOqPrQeYvtSjL+rr65C1JxeqMfUrTkpAyrGvoCSaBklARdO7UnfsPaAAat/DocTFo7C4FMWlIvBLUYD0tAz8KppGSUBF07tSd/t4ILE71N5DoHrcyMrJQ0NjY4sd8QompazGumgZJgEVLc9Kve3rgZ79gW49UVVdg9wDhWZbMtNSMEaZDxEFdlgkoBx2qFTXQTygxHnz/gAPdu3NR2Njk9mwmWMy8Fg0LJWAioZXpU7DA/0OB479hTguyQZ2/Sdm3lF79IWS2B2llVXILylvqVcBuLAamZbh/euotA+geg0E/ponHqSpDrizj6MP1WGU8WM671eq7fhVweTFwIQ/Cpe8PRfY8NfYuue4y4BbNbb6y1eA534Tu/rjEqEeNAAejxs7cgvg4VfGmijA8rQM3Oa0Me0HqKUHxLM01gEzD3b6udpXX+9DgNNvBs64GVh0PFDj+Isw/Oe7fAlw3t2i/NoHgPVLwr/XiZLtCShGpHr29zJ++aWVKHX5pPU1Iw5jx6RjuxOP2QLUsPaUcLJG6uII1ZUBtTAb6McAI4B7BktAtdcIRf/zM/vkg9HY3IydeQxBGbMFBVifloELnezecoRy0pu6rsU5QJ/DJKDogXYeoWiCp2c/7mWF7MJy1Nb7kBNwmkaXgJKAioYHDJ0dAFBqt55Q4ruhyFWDooqArzkcpdE7HqBOuxE4aKBokE9WALUGO9PSStxc4Px7xWFzI/DhI0YDDjoGOP5ycbxjE5CzBRh/JTDiDGD4CaL83m/E+W9e8yUM+g0HTtIC6f56/bvd8JOAURp75SoAKvYDh58gStG27tq68L3FQGOtOP/TOmD/j76aOP09YSowbBww9DigtgLY9y2w7zvguzeEvf5ifsb8bcAPbwNjLwF+Pg3oPQTgubfnAcW7ASfXUAOOBH52PTB0nKiHn6UXZwFFu4DPVwEFFssRK0BRz7gpwn/0U+7XQM6XwFfpYrsxpyUhEUjqhdqGJmQXVgRoj1NwR+pqLHOi2o4HqD99DQwdK55t7mjRKfyF++4t1xIf66uAu/oZJcwNuGYOMHgkcKoNs7TtfWDltQZoOd9eshfoqel76OdA9mfWfp6+FkjTpt/vLhA79Jw1PXibrLoZ+OwFo8yIM4EbXwT6MF5iIblfASumAuUaI6oX8e+kOz4Crn3GV8HjFwLbP3AOUJfMBybO9m7eYCnuJmDjQ4L4MIu/rR8+Bty2zvCxuezuT4AVVwHVxU70bR8dao8+XsY1c38F3Ca2j4WcpNG7NqA4MiT1AJoagNwtwIFtwJBRwPATvVF0r5TmAItPBOoqxfEVDwLnapn+n/4DeHlaYONyVCHw4hPErqoPjATOvRM4Syvr3RVWE2/jaQvhF38HfP4vcYEd7ZZ0sWsu5cBPYlTiW58j6cCjxfmqYuDRCWLU0cXcSQ9sBQaOEPvcmcVJQF08F7joz4b2sr3iRcOX2eHjxT9dVl4HfPWqta0cnRmX4r58WZ8CRbsD24Mvj8UnOE7kqN16eT/t2FdWjcrawFHfKRq9awOKzVpdAjxxCcC3vS79jwBmvCs2+6CQStbfrJxOzdsqzte5gFmHAU31vp317BnAL7VpJke55ZN8r4ciJQjyedsM4uLl6cCnzxo6uDcdp42XLRDnvlsDrLjSupPqZ7duAD5+EqgqEmBkh2fHb+uUjy+eJXliI0rK6/f6TrF5ji+TK5aK65wCzh1lbyvb48nJQM4XRpkBRwHT3gIOGS3Obfw78OYsX5+29YgvnLgklNc0YH+FNgX31ekIjd71AfXU5cCP7wQ2B9/q7NScwjTUAHNGCPBR7tgIHHu2+D8DkQxImuXezcARJ4kzz14FfPuG7/VQgLpkHnDh/eIerj3+daN1d9GnlQwM862tr7/MI1QoHW0FFNdLE+8ToQ6uFTlFtpJFe4C+Q8WVmb2NdaO/rS/cCHyxyro95m4Ve9ozNsn24MvBKeHW10nd0dTsxo5C663TnaDRuzagOJ2bM9K+SWZ+ABxzlrj+1GTgx3fF/0kS3PSy+H/mv4FlFxg6zCMYG3z28MCFdChAzd4CDDte6Hz0PGDnR9Y2nvxr4IbnxbX3HwTe+pP4v7mT8mVw/5HW5A3LthVQ4XboO94Hjj1HlF403hr8ZfsEULQ9HwJUz1gHpJwnTj89RZAtTgpHW9WD3cU1qG+y/iK+rTR61wbUD+8AT2uMn1XDTH0YOEfLPsn4I7BJI3q43zZBcdAgsUZiJyjfJzSYRxcuwt+cHag5FKAerRRrO8p3bwVOKXWNJEdSzhdHHAU5GvoDas/nwINn2nc7JwHF2NrxUwCydP2PFEQMiRzulcdjfV1Ke2iXv61b14vpt52Y169v3Ad88LCTcBJ2KvEoqmpAUbUFeypqaxON3rUB9Z9ngFdn2DfK+fcAzHWjbFoOZNxplL1sIXDBfeJ47VxgvVbuLztFh6LMSwWKdgbqDwYodkpej1RIpS85ObCTfrUaWPnr6AKKDNlVy4DxUwURE0rsABWqPZhzOEXLNfz4KSD99lA1RXbd+1NCiahrdCOrzH4jpLbQ6M4Daswk4MhTxYNu32idXcxcN7JklPpq4K6+hmOcpM23vAw8f7290yc9AEyaI65v+BuwxsRkkbiYv0PM6fWF9lGnAXd/LMoza/qRc611BwMUR6ZHKgz6mbE2uymQWTsZNaspX6iE07aOUInJwO0bgKNPM9qL8bHCXUBVoRhdmxuAibOMaawdoL54EXjht/btYR791y0E3pkfGWBClSbjH0c21IPM4no0e6yTlttCozsPqEsXCOdSzOyZ+WFJs87SWJ7CncD8VOOqeX2xYByQrzFu5vsZgF2oxaeCxaHIdDGWZCfXPgucdoO4uuoW4DNtvaKX/8M7QKq2fvr7OcDJVwNn/k5cff4GYMtLkQOKd5hz/exGuWCdI5Lsg7YCimzj5EXCmrzvBYXP4LO/zPrcCGzbASrYS4j6rvuHCBxT7MiLUKAJdZ3Teag44GpCWZ39j3a0lkZ3HlCnXAdcv1I81tcZwD+vCXxEc5nMD4FlE40yv38TGHuxOF5+MbBtQ+D91z8HnKKxTcEAxSyDeaMFfewvDA4TlHrO3UNnAdmbfUsx++D3GoPH0S51oghIskPNHma/9gm1hjIvvv0pc7MF4yaLNQuF9Dzf8JRYAop0NmcdlGeuBL5fE+hL/qbT0gJjOmgHKLbHn48CXD5f0Ap9bA/67eDB4njp6SKbxWnRfjmzqr4ZuZVBszJaRaM7DygGTe/TsgsYUF0wBigx/SACpxB3fyJSbSj/Xga8pn2vw+OpjwDnaOseqynbYWOB2V+KqRglGKB4neksVlQvyQiSEhQGVJdoNLi5ARkPWpRtgE6/xnhP+h32TW1eZ5FlJNtoluMuBW59XZxhytL8NKCh2rcMR+H7vzFSmB7+BcBMAkosAWWegvPlyJekv5hBx2t2gOK1/64EXro1UMeEu4ApfxPnmYa0VJti2nu59Vfi4r27y24vaYYnyLdqraHRnQcUH/P29cAobX1RXSpAw8U7O8mp1wGHalM8bu7OEcTc4UZPAG57z3AWsxW+eEnM148+XUw/yL7pEgxQZOgIvG9eF8HC4l3A4FHAib802D3qefJS4CdTneamumgOcLFfOs0ixoR+sG9QMx1P2j3zA5EzSFZQF3MnZMYA10cMPvOzbU4zT77GyJbwZ8daCyjq58sjHPlhrfDJb1aKNqMU7gBemgZk/VdkeHCtfPliY82s6w0GKJYhkULSgdN5Zq4wTKGzrbzOGQtnLtES9gmPB/uqPKhsCL6hbFwcLkpNh03nCDQwOoBirIajlJ4gaueY95cCb2kBTnMZc0zD/16CZO0cY14fDFAEEmX8FdYWsJOvWwAwF89OOCVcmGWkCIXz9uR0lNNSf5mRLH6rlsIg6LQ1Rt6iXf1ct3B0qncZJVoLqEg6qM5sWrUlM0hIruiM386PBdj09aUdoLZtFOSGTq8HtK1bZKywX0RVvL/cBlejir2u4D9+qCjYnjoaY8Pd1CU6gKIz2BGvecpIIDU7qDRX0Nl881oJf7WOMYnTb/K9Wpkv7vtxXXjJsWTASB6Q8uVbVo/9UCunWqRlv18buunIcumZ5czt46gZSs64BTh7OjBwpJFnZwYU7+cCmTlyzB0028ZrXKcR6Jxe+mdgxxJQtOWIU4CrHzdYPP3Z2Y7fvi5GV+b7MXmWYgcopi0xiM2g+aARvh7kfhP0LUf0GAk5vu2l7qDTPpoSCY0ePUDpTunRVwzrnO6xE/NNFm5KCXcBHTJaLFT5yQWdHkrsOhs7L6co+ucCTKMJR9jRF+cCjMUwK2HW0MD1Tjh6gpVh+hPz2Q5NE+ApyBTrznDo9LbWHe79tHFIigACaXJOH/VUrXB1mMuxTbne1j+nqSltjZY235NX5UFFiGlfJDR69AHV5keOUEEkb+9wVHMac/UTouTm5wBmjEvpMh6oblKRUxnGb14reHzMaoSMNEtAheoac74HDkkRpZae4ZslHepeeb3De4DL6O1load9/JQ1nE1dJKCCNTmTPUmQUPi90kItobXDdxNpYCQe2F/tQXl96J+PUoD30jJwUdDZe7vsehTJ00Za1skpH4O6DO5SMu4CNj0eqTWyfCfwQF0zkFUR3qf3oWj0rjdCHZJqxE0YczF/PRpJ4zJyf+l8b3ayV5jrZ7W/RSQ6ZdkO6QGyfTvL3Giyye0zGx2KRu96gOqQTSaN6ugeKKpTUVQTBjkRgkaXgOroLS3ti4kH+L3hjjICKvS22cFodAmomDSXrKQzeGBPpQc1Nl/yBthvQ6NLQHWGlpY2xsQDFQ0q8qrCm/bZ0egSUDFpKllJZ/AAOYnM8GJS3sexotEloDpDS0sbY+aBAzUelNWFjknpBvnT6BJQMWsqWVFn8EC9G9hdHl5MyjtK+WWjS0B1hlaWNsbUA9mVbtQ2hWb7TKPU7anp8Eb9JaBi2lSyss7ggQjJCZ+90SWgOkMLSxtj5gGOS/zHmJQ7jMyJFsM0Gl0CKmZNJSvqTB4oqPGgJAJyQqfRJaA6UytLW2PmgcoGFfvCj0m10Oj/A9jGm+feuyEMAAAAAElFTkSuQmCC"},81378:function(qt){"use strict";qt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALAAAAA8CAYAAADGxTD9AAAAAXNSR0IArs4c6QAAFoFJREFUeF7tXQl4k1W6fv8sTbqvlJa2tJSy74ugsiMqq4AKIlDUueNwR2dGHR0XdLwixW3uuF6Xq3O9o15nxuUiIIsCsijK1pa20NJ937eke5tmmec7f/40TfInaUNK6+R7nj5Jk7Of93z/t55w8JBnBYbwCnBDeOyeoXtWAB4Ae0AwpFeA+1SWbbA1A07KQSID6JWT0ivAyThIpBwgBSQy4+fCq0T4jANnrEdlWFkpjK/0ndAetd/znpMaTO0LZcz74tsxti0xjqVXfeNYZcZyxvHSuK3GbDYX03iMbbLy5nOz+pzGbGDrwpfj52DQG2DQAwad8Gcwvudf9ToDQN/pDdBrDYBFWfqMry/UAytP9fjPjJ/rYVHf2L7Qph4GaA0tOj1UnBYqvd6gMugMKr0OKoOOq+UMhhQ5DGfHPRNWMaSRaxy8bQBzPGAZAI3AFMAoAIJtnBnA2WaagdlU39iOAKKeje85FKY2TYDkwWh+APi2ebD0AJ8HMn/AzAHFA4x9Jxwss7bN5yXUpbnwB4SvY3Nu9LmwLr36NIKWAEhA1BlMgOUBCAZYBtJe761Byx+A3vV54Av1efDrtUawm4G+N+D5MfUcHH5s7H890KnqNjRWNGkaqlXqhgp1VV1JwxkOSJUAqUB0xk4s0Q4FgIty4KEweM8Yba+ARCmBzBuQeksgVXKQKugVkAdIoRwhhU+EHJycg0GrNz01Whs6UJhegtLsCmi7tI0GYC8H7osYTPhuO2Z3D9a19gB4sO6Mm8flFSKBd4QcyuFS+MbKIfOWMM6v69KjIq8WhVlFaKpvAQeuFsCr/gh45wmsbXHzsPrcvAfAfV6yn18FjgN8YmUInKiAd4TMJObUlNQj42wWutq7SNtXA9zrIVC88nts7Bgsq+AB8GDZiUEyDrm/BAFj5PBLUAASniNnpeSgvLCSjZADl8dBev8ubD41GIbsAfBg2IVBOAaSnUNnK6GM5DlyQ5UKmSlZ6GjvJBiT5epdGRSP7MRGzbUcvgfA13L1h0DfPtFyBE9VMKuMVqNH2rl0NNapBG78vQ98b9+B2xuu1VQ8AL5WKz+E+pV6cQiaqoAyXAp9tx5pyZfQUNdoBDEKAG5VEhJzrsWUPAC+Fqs+RPsMnOgF3xg5dBod0i9eRmM9D2IAFYB03m5sKRnoqXkAPNArPsT7CxingE+UFDqdHpfSMtHYYJIecn2hnL8DG+sGcooeAA/kav9M+gpIkEMZJYdBq0PqxXS0NDcLMvEFKRTzB1Kx8wD4ZwKqgZ6G/2g5vCPlaGttR+rFZMaRiSSQvLILW58YqPF4ADxQK/1z64cDs05IlByqqiqRX5gvKHV6gLspCYknB2LKHgAPxCr/TPuQ+XAImOQFzsDh0pVLUDcJ5jWUSaGcuBMbW9099WsOYDKYU8Qbi5zqshnZ6e41uGrtSxScU3NQhErR1UBhae4hstkaBiiWzDtSykSJri4NLmYmQ6s1dfz6bmx7xD0z7Gn1mgN4bX48CyapP9eBI/NLXZ5v3JYAzHlnOGvnyMJSqNO7TG36xMjYe41KB22r+GGR+nC48aNIVrb4780o2+OYkYTOVWLRnijk/JcKee+qoVHzMqE5zXlvOGLW+0MRIsXBGUVouuweJ9bys7HwjpJBldaJk2vcH/brP9aLRb1V11aisLzAKEpwWimks3Zic4bLm2qngUED4K5GHWpOttuda+U3bSj83ya7ZeLvCcD1f+HBd3hOMVQXeQDL/DhsVI1l71MerUXOm/zjzhYRV1lfmsC+Sn28FtmviZcV6t/wUSRGbQ5g/575RRWKPuE1c3Ma8+sgXPcmf7gynqvH5d3OO7DkARIowigzwDEtPxcLryApmrK7cGqtYwB31evQ3Wx94Bz3xJcgOThwrBd0Wj1Ssi6gW8sfTA44swuJ8zje9ewWGjQAdmZ2OW+rkPIwRfeJ09UAsH+CHGuuxLNOzj9Yjfz37R8axTAp1hWPBnmsOuu02BtXCL3Ges8IhOvLRkPmI0FjSie+ud55u//YB4Iw+w0e/Febkh+qQe47apea9Y2VQeYrQXlNGcpqeubFQfKrJGz9wKXG7VQeNADuqNKi6FNrrmU+9rqfOlDxtf3HudMAfkuFmPV+iN0QgMyXG6BK6xE1gqYpsDI5jnX9071VKHYwrklPhWDa88NY+csvNiDj2XrRJZ/7fgRG3xfIvv8qrgAdFc4Jq4MdwHQoCcQkA6fmXIBOz8v4HNAog2zcc9gsviguoNutAKZHsdRHYnd4y76LgU+UHKr0TvxwFx+y54iIu7WX9Ww8SwGS8/mp8YkBmPNuBHv/7fwSHph6A0jBshQhVqbGIWiKAgUfqnFue42p22HzvHHzyZHs/+83VKB8r/ihoRQjkuMp6IVShvYlFGLyjlCEzVXanIZXiJS5Y4laizSij+78/2lisrRA8kAJCz53RKO2BLL+ic5tr0btaftiGZXrrNGhu6n/IoQwJt+RMrbOJTVFqG4030vJX3dj632Oxt6f790K4CWHohF5s29/xmW3DoH98Oyex9TY3wRh9mvij1f15S4cWVBiBWCBW2vb9fhqZIFpEyNv9sGSQzFsDCdWlqHqqDgIiIsv+DyKlS39/xac3lSJpd9EI+Im1+Z9+YUGZPyHbaYVMlOB0DneNtdo5J3+GL7Ih31HcraYtYPmXPSx/SdeXzeORAifETJ0dnYivTgFBoMgRpEMLF24G5tP97VNR+WHJIBL97TgtBm37i+AJV4c1hbEsywEc8XOHJRHl5Si7rTtBASZLwfi4n7xXmydT60rR8XBNkx/IQwhM3s4cMgsJVOqCDT1Z5xLZij6W7MowMxFFkcbLPZ9R7UWX8XwFoOrSd4jOUilMuRWZkHdZq78cpdliJ5xtZNFBwTAxAW+u7nMap1uOhbDTEo1p9qR8oh95Ywe9YJp68fESpT8oyc9K+x6JUas8GPtB09TIGoV/55Eg45qHTprtSj8qMmmFWLKs6GY8scwNOdqcGBSEas3KjEAN3xotGRcV9xLPjafBJnFEv4tyPTRsZtKUfu9NUBJTApf6NOrD1dAYw7gikOt0Hc7r+SHTFcys6W7AOwVLIFXoBQ16iqU1BdaTvOJ3dj2iitzt6w7IADuqNHiq2jr0357xWgow2UoP9CK8/9eDZ8YOXxjZPAZaXyNkcN7uBRHF5dh7gcRGH1vIHQaA/ZE5ovKjk4rcUYzmt9oOW7L5i0Ox28tQ/Xxdkz+YyimPhvGPvsyPA8albV8GLXaF4u+iu61nqIAPhGD8Pk+aM7R4MBk/pC4QuYA3juqAJo+yK/XvRUOkpPdBWB6qpHuo9F0I73sgsU0uTYZFOShc93gb2x5wAD89YQiDLteyUBKDgVSZGI3+bOUb0e0L6EAEx8PRfQaP6gyOnFytbhts68Apr5vOT0SYXO9Uba3BT9sqMSNn0QiblMAOuu12BNpffDIbLYqLY4dPnMSA/CKlFgET1UyRdVcdnc0b7HvB7MIQWP2jiJlk8OVqgy0a6wU4H27sW1df+d+zTjwiRXlTF60R6TFd1Rq0VbSjbYyLdpLu9FW2s2UoxG3+qK1RIumzC67GnN/AEwmqmlJw5D3ngppO+pBjgCSYet+bGfc35IW7olih4mIQK4M44EsBuC1hfHswDYkd+LECuv2zNunC0wcORXMAaxR060nzsNB6ith9mp3cWAaiVewFBQnUaEqRVVzudXgOEjWJGHrAedHLV5ywDjw/rGFWF86Gu2lWrSV8cCM3xbIjPoElB+3VjHw0gbaIsHlXPyPZvyUWCU6I0sAtxV3Y/QvApH332pRTxx56TgJZwLOBtUYyP0kKPhrE87dX92rL6k3hzvrEtiTgwBZ+HGTybsmBuCN6jHMyO8M0eElU5w9MgfwF2F5fTKBCXZodwKY3MoE4rauVmTX2vQkF4dCOfFqpOcPGIBtycArLsQieLoS3a16ZL/WaFOWkyo4hN3gjejVPMdLe7oOWa+YUlms9tkcwAR2Uuh0HXrsH1folCuZYgjWF4/m+9pRh6w/Wfe1+EAUgiYp8M0NJezJILiubQGYAmvu7hjnDHZZmeY8DQ5MtC8nmwOY5Gq6b81Z8o6UMYuIOwFM3gvv4TLGjDJqkqHVWcd8SICXdmHbU86OW6zcNQWwI/OX5aAJ6IdnFqO1yPZNR8RJJz8dhomPhfSqShz/4NQipwAcscwHSw/zNuDv76hA+X5rJwYFDJFtmQKFzA+MLQCbx1VUHmlD9bE2m3sx/qFg5tBRZ3bh0PRipzlwfwHgVgADkAdL2F1zZc1FqG/v/RQzjrmbg9e0JGy60t85UD23AniZUfsmj9P+sdZchTRWAgxxMb943jtli7Tt5HnrRsnnLWg4T/cS9KaEXwZi5EZ/pulLjB45KkHyYe7bauS8pWIXdDgTzDPrtXCM+00w62BPTD46q+2HPToCcNQqXyzay1srLM1/5rNYkRyL4GlKNKZ24pu59mMkzDnwoZnF0DQ5H5o546VhzH3ubgBLlRLI/Tk0dzQjX51pc185cCeTkLhk0AL4ttxR8BvlxdyZx5bwygu5Q8l1KRDJpxTk0pKnYU4Aoti7/EEu1/Zyba/YB3Kn2nJ5Lvh8BAtTtKRvbyxBwwUe8M5Go60rjudd2xmdODzLcbCNIwBPfT4Mk5/iXbv2QihXpsUxsaTuTAeOLrRvZTIHcOmXLcy06CyRJYgcL+4GMF1XJQ+RsvvWLjcmQ0fXadogCbh7diHxY2fHb1nOrRz4rtYxTNkp+byZhQ7OejUc4Yt9cHBKEVryeDFAUM7MvWurMuIQOEGB6hNtOH4Lr8WS6eq23HhUHm5F+tP1vcSIcb8NwqQdoaDNNHQD437Lc1BnwinZ3b7G8xS+0BvLvuNjILLfaETqY44TbB0BeOmRaEQs8WXOhs8CckUDzVdfHoWAcV6oOtYGstjYo8FuRhPGToyJ4lRKW4rQ2NUTa2I+N7o8UAq/cTuxvl/hcG4DMGUd3FHNx9ReebWRKV7ktiVtPPcdFZIf4j1vzgJ4WlIYJj0RCl0nKWRFzGIhELl0dZ383bt9MaORy3j6i8NwfHk5yFohgI3abS3U4OCMYuja7XM3ewCmw3Fn3RjQfWP15ztwZJ44Z70tLx5+cXKTLdpZAP90TxW0rc4H4ox9MAgRS33dzoFp/BTYQ0p4i6YZha1Z9qb03m5s+3V/uLDbAEw3uaxM4e2+KY/VIucNFWb+aRjGPxzCrA57YwuY2coZAFMg9205o9j9tln/2Yi0p8Q5oxiAzZUpciuTB45kZqLkR2qgvtSFZcd47isQZVc4cnHbA/DIDf6Y/7cRrDlH1hMyMZKFoOj/mnDmvt5KD3FmWk+BYtb5IXYjHzx/9pdVIB3BWRqzPYgF+5B+cP6BHq6ozuhinsKrSSRGyPwl7B7izJZU6ETynDhAL4X0hp3Ycr6v/bsNwObKy+m7K9njnUxUxIVJO039Qy2yX1c5BeDrP4xAfGIgU1b2jym06doVJi4GYOK0ltYJqlN9vA2Xkhow+9VwZtKjCKqa4+0smozeH1taJhrMQ/XtAfjmUyMx7EY+auzriYUmscnWJt1Zn8BiCLLfVCH10d5xIRMeDcaMl8L7urd9Kn/xyVpc+bPjzJM+NUpc2FsCCQeUdRRA1S3OeDjg4lQor9uIjc5rpO60Qlz39nCM+RUf6GKuTC3aH4WoFX4sFpZEgbV5fE6cmAx8OanBJJemP1uHzBfFbcCWgBJkYP8xcqzJ4uMdiAiYFBif+VIjU/JINhfk5rz31YzDr8kZxTxsZJc9NKNYNFlTDMAhsxRYfpZ/AjnjQt7UOZYd7LRn6pD1cu85DmUAc3L6SQgJ2rXNKOiwK0ZQbu9Du7Dtzb4cErdwYDLe316eAJKDyQa7L77HsxS9zg8Lv4hC7Q/tOL25EreejrULYJKdKZWGLBDkzeuLTGquxJFiSMmHJZ+1IOvlBjRl8Y9LYTz0XrAXU8KneQaEvYMjBmDzWGjhCSS2MaSg3lHJ6wskEhR+ZB2nS8qQJUUs8wVF01Ecx8Wn6pD9qu3DPeU53hJCQVXkkcx/X42uut6MTswD2hcwiZUlzxz9NkduZxq6DeJiCgeu2RsY/zTsuFotOnELgEes9MXifbzt0zLFhsBNFgaSOYmckYFJGfIf44XmbMcy2vTdYSzwh+jgtCITUClIvTmvmylrAo1Y7osFX45glhLiyidXlZuC16nPVem8ZYBk9q8nFNq0CdsCsLmVwBnuO/EPIZj+Ap+SRFkkDeesbd3CmAkMI1b4ghwfw+bxMjwRJcSeWF1u/aTggDlvDwc5X8htT0Q28eK/tzD7OMm+7ibBNl+tKUO9zn7WDQd8loRtm5wdk1sALERz0SBI9qOYh/GP8KYtSxKi0djPTxnjWsnBwXEcA5Wt5Ehq48y91UyuJgpf5I15n4xgSiEBjoiSK/dEFYgGukTe4ouFe3rAe+GBGuT/pXfyprkcbysugvqxBDB9tvRIDBMHaPxkEqv+js/oGLbAGzNfCYeuXQ9dFz9fUlDDjNkVFAdB4ZZkUbEkGi/FKUet9mNxGgK1FGhw8ck6u2lPVJZMWgRicvpQZJwJ+KfaWYZ2OeUaOq8LOosvVo7iTCgxuVuvQW53msO6UnC3PI/Eow4LuksGnvnncIz/XTDqz3bgyIJSZqqypUA5M0CxMj9urWTiABFpuhvqE/iFMpKjDGaSUZedGMnuM7jwYA3yP7CdeXzT0RgMX+xjU7myBWAy7y0+EA3/0V649Hw9Lu3qSZ2nQKA7ahLYD6pYEkXiHVtSivqztrmv5RqSKzv/AzX70/fxN4ToYFL0XdBk3rJBThvy/rnzMhT62TNyahTpMtFhsO1OF9aEfsYgHKFTfoeVDh8PbuHANJCJj4ewC0QIGOQgEMvh6i+IKw609hIpxv8+mAWp0O0+ZftanLo0hOKRyUYrBl4aG5mvKOWo6ojtRY+72x+z3+Lz8egOhrofOxhXpUd8+h+tc9oS7g9EAF0EYvwJLNJc6n/qQOW3bb0SVS3XhTyYK5LjUL6vlUXJNSaLixlOrSnHZ55MeSaU5fE1pjrEilPNOiqkMtSiSmc/1oNxbXDPJSFxp6P23AZgRx17vu/HCtAD5mo/5t3Rpp2p6aFHji4VBgdaIwd0SsFN2YlE/tZAEfIAuB848lRxbQUq9Plo0ts3hxp7+HY3ti33ANi19fbUvsor0GFoRZHOvk1Y6FIC7q5dSPzcw4Gv8iZ4mnNtBQp0l9BlcHzFAAeu0h8B48V+JdQjQri2D57a/VyBBkMNanSOw1WNCt0bSUh82FZXHgD3cwM81VxbAT10yNWlQm+6vceupKuTQTJ7J7ZYGZE9AHZtHzy1XViBSn0B1Hpnr5jlziZh642WV7V6AOzCBniqurYCnWhDodZ2upGtliXA9l3Y9r75dx4Au7YHntourkChLhOdDjxzPV1wKl8oxpn/Fp0HwC5ugKe6ayvQbGhAuc75SwY5cB8lIfFeoVcPgF1bf09tl1fAgDxdut0wS+supIt2Y8v3zELxqSz7ajsnXZ6Sp4F/rRVoMFShRmf/yq3eK8JljcSE6dsxu9sD4H8trAzK2eqgQ54uDXohPdyJUXLgnkxC4sseADuxWJ4i7l+Ban0JGvW2U+9t9c4B7QZIJ3oA7P698fTgxAo0GepRobN/qaFlMxy4/f8E90wA8RE2tUgAAAAASUVORK5CYII="},93162:function(qt,$e,ae){"use strict";ae.d($e,{Z:function(){return re}});var te=ae(15417);function re(X,D){var W=typeof Symbol!="undefined"&&X[Symbol.iterator]||X["@@iterator"];if(!W){if(Array.isArray(X)||(W=(0,te.Z)(X))||D&&X&&typeof X.length=="number"){W&&(X=W);var y=0,L=function(){};return{s:L,n:function(){return y>=X.length?{done:!0}:{done:!1,value:X[y++]}},e:function(u){throw u},f:L}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var A,s=!0,x=!1;return{s:function(){W=W.call(X)},n:function(){var u=W.next();return s=u.done,u},e:function(u){x=!0,A=u},f:function(){try{s||W.return==null||W.return()}finally{if(x)throw A}}}}},68535:function(qt,$e,ae){"use strict";ae.d($e,{ZP:function(){return Yi}});const te=Number.isFinite||function(b){return typeof b=="number"&&isFinite(b)},re=Number.isSafeInteger||function(b){return typeof b=="number"&&Math.abs(b)<=X},X=Number.MAX_SAFE_INTEGER||9007199254740991;let D=function(b){return b.NETWORK_ERROR="networkError",b.MEDIA_ERROR="mediaError",b.KEY_SYSTEM_ERROR="keySystemError",b.MUX_ERROR="muxError",b.OTHER_ERROR="otherError",b}({}),W=function(b){return b.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",b.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",b.KEY_SYSTEM_NO_SESSION="keySystemNoSession",b.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",b.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",b.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",b.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",b.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",b.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",b.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",b.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",b.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",b.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",b.MANIFEST_LOAD_ERROR="manifestLoadError",b.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",b.MANIFEST_PARSING_ERROR="manifestParsingError",b.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",b.LEVEL_EMPTY_ERROR="levelEmptyError",b.LEVEL_LOAD_ERROR="levelLoadError",b.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",b.LEVEL_PARSING_ERROR="levelParsingError",b.LEVEL_SWITCH_ERROR="levelSwitchError",b.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",b.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",b.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",b.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",b.FRAG_LOAD_ERROR="fragLoadError",b.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",b.FRAG_DECRYPT_ERROR="fragDecryptError",b.FRAG_PARSING_ERROR="fragParsingError",b.FRAG_GAP="fragGap",b.REMUX_ALLOC_ERROR="remuxAllocError",b.KEY_LOAD_ERROR="keyLoadError",b.KEY_LOAD_TIMEOUT="keyLoadTimeOut",b.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",b.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",b.BUFFER_APPEND_ERROR="bufferAppendError",b.BUFFER_APPENDING_ERROR="bufferAppendingError",b.BUFFER_STALLED_ERROR="bufferStalledError",b.BUFFER_FULL_ERROR="bufferFullError",b.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",b.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",b.ASSET_LIST_LOAD_ERROR="assetListLoadError",b.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",b.ASSET_LIST_PARSING_ERROR="assetListParsingError",b.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",b.INTERNAL_EXCEPTION="internalException",b.INTERNAL_ABORTED="aborted",b.ATTACH_MEDIA_ERROR="attachMediaError",b.UNKNOWN="unknown",b}({}),y=function(b){return b.MEDIA_ATTACHING="hlsMediaAttaching",b.MEDIA_ATTACHED="hlsMediaAttached",b.MEDIA_DETACHING="hlsMediaDetaching",b.MEDIA_DETACHED="hlsMediaDetached",b.MEDIA_ENDED="hlsMediaEnded",b.STALL_RESOLVED="hlsStallResolved",b.BUFFER_RESET="hlsBufferReset",b.BUFFER_CODECS="hlsBufferCodecs",b.BUFFER_CREATED="hlsBufferCreated",b.BUFFER_APPENDING="hlsBufferAppending",b.BUFFER_APPENDED="hlsBufferAppended",b.BUFFER_EOS="hlsBufferEos",b.BUFFERED_TO_END="hlsBufferedToEnd",b.BUFFER_FLUSHING="hlsBufferFlushing",b.BUFFER_FLUSHED="hlsBufferFlushed",b.MANIFEST_LOADING="hlsManifestLoading",b.MANIFEST_LOADED="hlsManifestLoaded",b.MANIFEST_PARSED="hlsManifestParsed",b.LEVEL_SWITCHING="hlsLevelSwitching",b.LEVEL_SWITCHED="hlsLevelSwitched",b.LEVEL_LOADING="hlsLevelLoading",b.LEVEL_LOADED="hlsLevelLoaded",b.LEVEL_UPDATED="hlsLevelUpdated",b.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",b.LEVELS_UPDATED="hlsLevelsUpdated",b.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",b.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",b.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",b.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",b.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",b.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",b.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",b.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",b.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",b.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",b.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",b.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",b.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",b.CUES_PARSED="hlsCuesParsed",b.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",b.INIT_PTS_FOUND="hlsInitPtsFound",b.FRAG_LOADING="hlsFragLoading",b.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",b.FRAG_LOADED="hlsFragLoaded",b.FRAG_DECRYPTED="hlsFragDecrypted",b.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",b.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",b.FRAG_PARSING_METADATA="hlsFragParsingMetadata",b.FRAG_PARSED="hlsFragParsed",b.FRAG_BUFFERED="hlsFragBuffered",b.FRAG_CHANGED="hlsFragChanged",b.FPS_DROP="hlsFpsDrop",b.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",b.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",b.ERROR="hlsError",b.DESTROYING="hlsDestroying",b.KEY_LOADING="hlsKeyLoading",b.KEY_LOADED="hlsKeyLoaded",b.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",b.BACK_BUFFER_REACHED="hlsBackBufferReached",b.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",b.ASSET_LIST_LOADING="hlsAssetListLoading",b.ASSET_LIST_LOADED="hlsAssetListLoaded",b.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",b.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",b.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",b.INTERSTITIAL_STARTED="hlsInterstitialStarted",b.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",b.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",b.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",b.INTERSTITIAL_ENDED="hlsInterstitialEnded",b.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",b.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",b.EVENT_CUE_ENTER="hlsEventCueEnter",b}({});var L={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},A={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class s{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class x{constructor(e,t,n,l=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 s(e),this.fast_=new s(t),this.defaultTTFB_=l,this.ttfb_=new s(e)}update(e,t){const{slow_:n,fast_:l,ttfb_:g}=this;n.halfLife!==e&&(this.slow_=new s(e,n.getEstimate(),n.getTotalWeight())),l.halfLife!==t&&(this.fast_=new s(t,l.getEstimate(),l.getTotalWeight())),g.halfLife!==e&&(this.ttfb_=new s(e,g.getEstimate(),g.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const n=8*t,l=e/1e3,g=n/l;this.fast_.sample(l,g),this.slow_.sample(l,g)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function c(b,e,t){return(e=d(e))in b?Object.defineProperty(b,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):b[e]=t,b}function u(){return u=Object.assign?Object.assign.bind():function(b){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(b[n]=t[n])}return b},u.apply(null,arguments)}function f(b,e){var t=Object.keys(b);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(b);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(b,l).enumerable})),t.push.apply(t,n)}return t}function i(b){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?f(Object(t),!0).forEach(function(n){c(b,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach(function(n){Object.defineProperty(b,n,Object.getOwnPropertyDescriptor(t,n))})}return b}function o(b,e){if(typeof b!="object"||!b)return b;var t=b[Symbol.toPrimitive];if(t!==void 0){var n=t.call(b,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(b)}function d(b){var e=o(b,"string");return typeof e=="symbol"?e:e+""}class m{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const n=`[${e}]:`;this.trace=_,this.debug=t.debug.bind(null,n),this.log=t.log.bind(null,n),this.warn=t.warn.bind(null,n),this.info=t.info.bind(null,n),this.error=t.error.bind(null,n)}}const _=function(){},h={trace:_,debug:_,log:_,warn:_,info:_,error:_};function v(){return u({},h)}function r(b,e){const t=self.console[b];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${b}] >`):_}function a(b,e,t){return e[b]?e[b].bind(e):r(b,t)}const p=v();function E(b,e,t){const n=v();if(typeof console=="object"&&b===!0||typeof b=="object"){const l=["debug","log","info","warn","error"];l.forEach(g=>{n[g]=a(g,b,t)});try{n.log(`Debug logs enabled for "${e}" in hls.js version 1.6.11`)}catch(g){return v()}l.forEach(g=>{p[g]=a(g,b)})}else u(p,n);return n}const S=p;function w(b=!0){return typeof self=="undefined"?void 0:(b||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function R(b){return typeof self!="undefined"&&b===self.ManagedMediaSource}function O(b,e){const t=Object.keys(b),n=Object.keys(e),l=t.length,g=n.length;return!l||!g||l===g&&!t.some(T=>n.indexOf(T)===-1)}function z(b,e=!1){if(typeof TextDecoder!="undefined"){const U=new TextDecoder("utf-8").decode(b);if(e){const j=U.indexOf("\0");return j!==-1?U.substring(0,j):U}return U.replace(/\0/g,"")}const t=b.length;let n,l,g,T="",I=0;for(;I<t;){if(n=b[I++],n===0&&e)return T;if(n===0||n===3)continue;switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:T+=String.fromCharCode(n);break;case 12:case 13:l=b[I++],T+=String.fromCharCode((n&31)<<6|l&63);break;case 14:l=b[I++],g=b[I++],T+=String.fromCharCode((n&15)<<12|(l&63)<<6|(g&63)<<0);break}}return T}function N(b){let e="";for(let t=0;t<b.length;t++){let n=b[t].toString(16);n.length<2&&(n="0"+n),e+=n}return e}function P(b){return Uint8Array.from(b.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function F(b){return b&&b.__esModule&&Object.prototype.hasOwnProperty.call(b,"default")?b.default:b}var K={exports:{}},B;function V(){return B||(B=1,function(b,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,l=/^(?=([^\/?#]*))\1([^]*)$/,g=/(?:\/|^)\.(?=\/)/g,T=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,I={buildAbsoluteURL:function(k,U,j){if(j=j||{},k=k.trim(),U=U.trim(),!U){if(!j.alwaysNormalize)return k;var Z=I.parseURL(k);if(!Z)throw new Error("Error trying to parse base URL.");return Z.path=I.normalizePath(Z.path),I.buildURLFromParts(Z)}var Q=I.parseURL(U);if(!Q)throw new Error("Error trying to parse relative URL.");if(Q.scheme)return j.alwaysNormalize?(Q.path=I.normalizePath(Q.path),I.buildURLFromParts(Q)):U;var ee=I.parseURL(k);if(!ee)throw new Error("Error trying to parse base URL.");if(!ee.netLoc&&ee.path&&ee.path[0]!=="/"){var ne=l.exec(ee.path);ee.netLoc=ne[1],ee.path=ne[2]}ee.netLoc&&!ee.path&&(ee.path="/");var de={scheme:ee.scheme,netLoc:Q.netLoc,path:null,params:Q.params,query:Q.query,fragment:Q.fragment};if(!Q.netLoc&&(de.netLoc=ee.netLoc,Q.path[0]!=="/"))if(!Q.path)de.path=ee.path,Q.params||(de.params=ee.params,Q.query||(de.query=ee.query));else{var ce=ee.path,Ee=ce.substring(0,ce.lastIndexOf("/")+1)+Q.path;de.path=I.normalizePath(Ee)}return de.path===null&&(de.path=j.alwaysNormalize?I.normalizePath(Q.path):Q.path),I.buildURLFromParts(de)},parseURL:function(k){var U=n.exec(k);return U?{scheme:U[1]||"",netLoc:U[2]||"",path:U[3]||"",params:U[4]||"",query:U[5]||"",fragment:U[6]||""}:null},normalizePath:function(k){for(k=k.split("").reverse().join("").replace(g,"");k.length!==(k=k.replace(T,"")).length;);return k.split("").reverse().join("")},buildURLFromParts:function(k){return k.scheme+k.netLoc+k.path+k.params+k.query+k.fragment}};b.exports=I})()}(K)),K.exports}var C=V();class M{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 H={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class ${constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e=="string"&&(e={url:e}),this.base=e,xe(this,"stats")}setByteRange(e,t){const n=e.split("@",2);let l;n.length===1?l=(t==null?void 0:t.byteRangeEndOffset)||0:l=parseInt(n[1]),this._byteRange=[l,parseInt(n[0])+l]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[H.AUDIO]:null,[H.VIDEO]:null,[H.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new M),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=C.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[H.AUDIO]=null,e[H.VIDEO]=null,e[H.AUDIOVIDEO]=null}}function q(b){return b.sn!=="initSegment"}class se extends ${constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange.length){const e=this.byteRange[0],t=this.byteRange[1];if(te(e)&&te(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const n=Object.keys(this.levelkeys);if(n.length===1){const l=this._decryptdata=this.levelkeys[n[0]]||null;if(l)return l.getDecryptData(this.sn)}}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=te(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){var t;const n=Object.keys(this.levelkeys),l=n.length;if(l>1||l===1&&(t=this.levelkeys[n[0]])!=null&&t.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!te(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return q(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,n,l,g,T=!1){const{elementaryStreams:I}=this,k=I[e];if(!k){I[e]={startPTS:t,endPTS:n,startDTS:l,endDTS:g,partial:T};return}k.startPTS=Math.min(k.startPTS,t),k.endPTS=Math.max(k.endPTS,n),k.startDTS=Math.min(k.startDTS,l),k.endDTS=Math.max(k.endDTS,g)}}class ue extends ${constructor(e,t,n,l,g){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=l;const T=e.enumeratedString("BYTERANGE");T&&this.setByteRange(T,g),g&&(this.fragOffset=g.fragOffset+g.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function pe(b,e){const t=Object.getPrototypeOf(b);if(t){const n=Object.getOwnPropertyDescriptor(t,e);return n||pe(t,e)}}function xe(b,e){const t=pe(b,e);t&&(t.enumerable=!0,Object.defineProperty(b,e,t))}const De=Math.pow(2,32)-1,Ue=[].push,Ge={video:1,audio:2,id3:3,text:4};function Ae(b){return String.fromCharCode.apply(null,b)}function We(b,e){const t=b[e]<<8|b[e+1];return t<0?65536+t:t}function we(b,e){const t=ge(b,e);return t<0?4294967296+t:t}function Se(b,e){let t=we(b,e);return t*=Math.pow(2,32),t+=we(b,e+4),t}function ge(b,e){return b[e]<<24|b[e+1]<<16|b[e+2]<<8|b[e+3]}function Re(b){const e=b.byteLength;for(let t=0;t<e;){const n=we(b,t);if(n>8&&b[t+4]===109&&b[t+5]===111&&b[t+6]===111&&b[t+7]===102)return!0;t=n>1?t+n:e}return!1}function ve(b,e){const t=[];if(!e.length)return t;const n=b.byteLength;for(let l=0;l<n;){const g=we(b,l),T=Ae(b.subarray(l+4,l+8)),I=g>1?l+g:n;if(T===e[0])if(e.length===1)t.push(b.subarray(l+8,I));else{const k=ve(b.subarray(l+8,I),e.slice(1));k.length&&Ue.apply(t,k)}l=I}return t}function Le(b){const e=[],t=b[0];let n=8;const l=we(b,n);n+=4;let g=0,T=0;t===0?(g=we(b,n),T=we(b,n+4),n+=8):(g=Se(b,n),T=Se(b,n+8),n+=16),n+=2;let I=b.length+T;const k=We(b,n);n+=2;for(let U=0;U<k;U++){let j=n;const Z=we(b,j);j+=4;const Q=Z&2147483647;if((Z&2147483648)>>>31===1)return S.warn("SIDX has hierarchical references (not supported)"),null;const ne=we(b,j);j+=4,e.push({referenceSize:Q,subsegmentDuration:ne,info:{duration:ne/l,start:I,end:I+Q-1}}),I+=Q,j+=4,n=j}return{earliestPresentationTime:g,timescale:l,version:t,referencesCount:k,references:e}}function Fe(b){const e=[],t=ve(b,["moov","trak"]);for(let l=0;l<t.length;l++){const g=t[l],T=ve(g,["tkhd"])[0];if(T){let I=T[0];const k=we(T,I===0?12:20),U=ve(g,["mdia","mdhd"])[0];if(U){I=U[0];const j=we(U,I===0?12:20),Z=ve(g,["mdia","hdlr"])[0];if(Z){const Q=Ae(Z.subarray(8,12)),ee={soun:H.AUDIO,vide:H.VIDEO}[Q],ne=ve(g,["mdia","minf","stbl","stsd"])[0],de=me(ne);ee?(e[k]={timescale:j,type:ee,stsd:de},e[ee]=i({timescale:j,id:k},de)):e[k]={timescale:j,type:Q,stsd:de}}}}}return ve(b,["moov","mvex","trex"]).forEach(l=>{const g=we(l,4),T=e[g];T&&(T.default={duration:we(l,12),flags:we(l,20)})}),e}function me(b){const e=b.subarray(8),t=e.subarray(86),n=Ae(e.subarray(4,8));let l=n,g;const T=n==="enca"||n==="encv";if(T){const U=ve(e,[n])[0].subarray(n==="enca"?28:78);ve(U,["sinf"]).forEach(Z=>{const Q=ve(Z,["schm"])[0];if(Q){const ee=Ae(Q.subarray(4,8));if(ee==="cbcs"||ee==="cenc"){const ne=ve(Z,["frma"])[0];ne&&(l=Ae(ne))}}})}const I=l;switch(l){case"avc1":case"avc2":case"avc3":case"avc4":{const k=ve(t,["avcC"])[0];k&&k.length>3&&(l+="."+ye(k[1])+ye(k[2])+ye(k[3]),g=oe(I==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const k=ve(e,[n])[0],U=ve(k.subarray(28),["esds"])[0];if(U&&U.length>7){let j=4;if(U[j++]!==3)break;j=fe(U,j),j+=2;const Z=U[j++];if(Z&128&&(j+=2),Z&64&&(j+=U[j++]),U[j++]!==4)break;j=fe(U,j);const Q=U[j++];if(Q===64)l+="."+ye(Q);else break;if(j+=12,U[j++]!==5)break;j=fe(U,j);const ee=U[j++];let ne=(ee&248)>>3;ne===31&&(ne+=1+((ee&7)<<3)+((U[j]&224)>>5)),l+="."+ne}break}case"hvc1":case"hev1":{const k=ve(t,["hvcC"])[0];if(k&&k.length>12){const U=k[1],j=["","A","B","C"][U>>6],Z=U&31,Q=we(k,2),ee=(U&32)>>5?"H":"L",ne=k[12],de=k.subarray(6,12);l+="."+j+Z,l+="."+ie(Q).toString(16).toUpperCase(),l+="."+ee+ne;let ce="";for(let Ee=de.length;Ee--;){const ke=de[Ee];(ke||ce)&&(ce="."+ke.toString(16).toUpperCase()+ce)}l+=ce}g=oe(I=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{l=oe(l,t)||l;break}case"vp09":{const k=ve(t,["vpcC"])[0];if(k&&k.length>6){const U=k[4],j=k[5],Z=k[6]>>4&15;l+="."+he(U)+"."+he(j)+"."+he(Z)}break}case"av01":{const k=ve(t,["av1C"])[0];if(k&&k.length>2){const U=k[1]>>>5,j=k[1]&31,Z=k[2]>>>7?"H":"M",Q=(k[2]&64)>>6,ee=(k[2]&32)>>5,ne=U===2&&Q?ee?12:10:Q?10:8,de=(k[2]&16)>>4,ce=(k[2]&8)>>3,Ee=(k[2]&4)>>2,ke=k[2]&3;l+="."+U+"."+he(j)+Z+"."+he(ne)+"."+de+"."+ce+Ee+ke+"."+he(1)+"."+he(1)+"."+he(1)+"."+0,g=oe("dav1",t)}break}}return{codec:l,encrypted:T,supplemental:g}}function oe(b,e){const t=ve(e,["dvvC"]),n=t.length?t[0]:ve(e,["dvcC"])[0];if(n){const l=n[2]>>1&127,g=n[2]<<5&32|n[3]>>3&31;return b+"."+he(l)+"."+he(g)}}function ie(b){let e=0;for(let t=0;t<32;t++)e|=(b>>t&1)<<31-t;return e>>>0}function fe(b,e){const t=e+5;for(;b[e++]&128&&e<t;);return e}function ye(b){return("0"+b.toString(16).toUpperCase()).slice(-2)}function he(b){return(b<10?"0":"")+b}function Te(b,e){if(!b||!e)return;const t=e.keyId;t&&e.isCommonEncryption&&ve(b,["moov","trak"]).forEach(l=>{const T=ve(l,["mdia","minf","stbl","stsd"])[0].subarray(8);let I=ve(T,["enca"]);const k=I.length>0;k||(I=ve(T,["encv"])),I.forEach(U=>{const j=k?U.subarray(28):U.subarray(78);ve(j,["sinf"]).forEach(Q=>{const ee=Oe(Q);if(ee){const ne=ee.subarray(8,24);ne.some(de=>de!==0)||(S.log(`[eme] Patching keyId in 'enc${k?"a":"v"}>sinf>>tenc' box: ${N(ne)} -> ${N(t)}`),ee.set(t,8))}})})})}function Oe(b){const e=ve(b,["schm"])[0];if(e){const t=Ae(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return ve(b,["schi","tenc"])[0]}return null}function Be(b,e,t){const n={},l=ve(b,["moof","traf"]);for(let g=0;g<l.length;g++){const T=l[g],I=ve(T,["tfhd"])[0],k=we(I,4),U=e[k];if(!U)continue;n[k]||(n[k]={start:NaN,duration:0,sampleCount:0,timescale:U.timescale,type:U.type});const j=n[k],Z=ve(T,["tfdt"])[0];if(Z){const Me=Z[0];let Ye=we(Z,4);Me===1&&(Ye===De?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(Ye*=De+1,Ye+=we(Z,8))),te(Ye)&&(!te(j.start)||Ye<j.start)&&(j.start=Ye)}const Q=U.default,ee=we(I,0)|(Q==null?void 0:Q.flags);let ne=(Q==null?void 0:Q.duration)||0;ee&8&&(ee&2?ne=we(I,12):ne=we(I,8));const de=ve(T,["trun"]);let ce=j.start||0,Ee=0,ke=ne;for(let Me=0;Me<de.length;Me++){const Ye=de[Me],lt=we(Ye,4),Ct=j.sampleCount;j.sampleCount+=lt;const rt=Ye[3]&1,vt=Ye[3]&4,xt=Ye[2]&1,at=Ye[2]&2,Gt=Ye[2]&4,dr=Ye[2]&8;let Lr=8,Ur=lt;for(rt&&(Lr+=4),vt&<&&(!(Ye[Lr+1]&1)&&j.keyFrameIndex===void 0&&(j.keyFrameIndex=Ct),Lr+=4,xt?(ke=we(Ye,Lr),Lr+=4):ke=ne,at&&(Lr+=4),dr&&(Lr+=4),ce+=ke,Ee+=ke,Ur--);Ur--;)xt?(ke=we(Ye,Lr),Lr+=4):ke=ne,at&&(Lr+=4),Gt&&(Ye[Lr+1]&1||j.keyFrameIndex===void 0&&(j.keyFrameIndex=j.sampleCount-(Ur+1),j.keyFrameStart=ce),Lr+=4),dr&&(Lr+=4),ce+=ke,Ee+=ke;!Ee&&ne&&(Ee+=ne*lt)}j.duration+=Ee}if(!Object.keys(n).some(g=>n[g].duration)){let g=1/0,T=0;const I=ve(b,["sidx"]);for(let k=0;k<I.length;k++){const U=Le(I[k]);if(U!=null&&U.references){g=Math.min(g,U.earliestPresentationTime/U.timescale);const j=U.references.reduce((Z,Q)=>Z+Q.info.duration||0,0);T=Math.max(T,j+U.earliestPresentationTime/U.timescale)}}T&&te(T)&&Object.keys(n).forEach(k=>{n[k].duration||(n[k].duration=T*n[k].timescale-n[k].start)})}return n}function Ze(b){const e={valid:null,remainder:null},t=ve(b,["moof"]);if(t.length<2)return e.remainder=b,e;const n=t[t.length-1];return e.valid=b.slice(0,n.byteOffset-8),e.remainder=b.slice(n.byteOffset-8),e}function tt(b,e){const t=new Uint8Array(b.length+e.length);return t.set(b),t.set(e,b.length),t}function dt(b,e){const t=[],n=e.samples,l=e.timescale,g=e.id;let T=!1;return ve(n,["moof"]).map(k=>{const U=k.byteOffset-8;ve(k,["traf"]).map(Z=>{const Q=ve(Z,["tfdt"]).map(ee=>{const ne=ee[0];let de=we(ee,4);return ne===1&&(de*=Math.pow(2,32),de+=we(ee,8)),de/l})[0];return Q!==void 0&&(b=Q),ve(Z,["tfhd"]).map(ee=>{const ne=we(ee,4),de=we(ee,0)&16777215,ce=(de&1)!==0,Ee=(de&2)!==0,ke=(de&8)!==0;let Me=0;const Ye=(de&16)!==0;let lt=0;const Ct=(de&32)!==0;let rt=8;ne===g&&(ce&&(rt+=8),Ee&&(rt+=4),ke&&(Me=we(ee,rt),rt+=4),Ye&&(lt=we(ee,rt),rt+=4),Ct&&(rt+=4),e.type==="video"&&(T=nt(e.codec)),ve(Z,["trun"]).map(vt=>{const xt=vt[0],at=we(vt,0)&16777215,Gt=(at&1)!==0;let dr=0;const Lr=(at&4)!==0,Ur=(at&256)!==0;let Rr=0;const lr=(at&512)!==0;let Ir=0;const yr=(at&1024)!==0,Pr=(at&2048)!==0;let Zr=0;const hr=we(vt,4);let fr=8;Gt&&(dr=we(vt,fr),fr+=4),Lr&&(fr+=4);let an=dr+U;for(let xn=0;xn<hr;xn++){if(Ur?(Rr=we(vt,fr),fr+=4):Rr=Me,lr?(Ir=we(vt,fr),fr+=4):Ir=lt,yr&&(fr+=4),Pr&&(xt===0?Zr=we(vt,fr):Zr=ge(vt,fr),fr+=4),e.type===H.VIDEO){let sn=0;for(;sn<Ir;){const hn=we(n,an);if(an+=4,At(T,n[an])){const ei=n.subarray(an,an+hn);Nt(ei,T?2:1,b+Zr/l,t)}an+=hn,sn+=hn+4}}b+=Rr/l}}))})})}),t}function nt(b){if(!b)return!1;const e=b.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function At(b,e){if(b){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function Nt(b,e,t,n){const l=Bt(b);let g=0;g+=e;let T=0,I=0,k=0;for(;g<l.length;){T=0;do{if(g>=l.length)break;k=l[g++],T+=k}while(k===255);I=0;do{if(g>=l.length)break;k=l[g++],I+=k}while(k===255);const U=l.length-g;let j=g;if(I<U)g+=I;else if(I>U){S.error(`Malformed SEI payload. ${I} is too small, only ${U} bytes left to parse.`);break}if(T===4){if(l[j++]===181){const Q=We(l,j);if(j+=2,Q===49){const ee=we(l,j);if(j+=4,ee===1195456820){const ne=l[j++];if(ne===3){const de=l[j++],ce=31&de,Ee=64&de,ke=Ee?2+ce*3:0,Me=new Uint8Array(ke);if(Ee){Me[0]=de;for(let Ye=1;Ye<ke;Ye++)Me[Ye]=l[j++]}n.push({type:ne,payloadType:T,pts:t,bytes:Me})}}}}}else if(T===5&&I>16){const Z=[];for(let ne=0;ne<16;ne++){const de=l[j++].toString(16);Z.push(de.length==1?"0"+de:de),(ne===3||ne===5||ne===7||ne===9)&&Z.push("-")}const Q=I-16,ee=new Uint8Array(Q);for(let ne=0;ne<Q;ne++)ee[ne]=l[j++];n.push({payloadType:T,pts:t,uuid:Z.join(""),userData:z(ee),userDataBytes:ee})}}}function Bt(b){const e=b.byteLength,t=[];let n=1;for(;n<e-2;)b[n]===0&&b[n+1]===0&&b[n+2]===3?(t.push(n+2),n+=2):n++;if(t.length===0)return b;const l=e-t.length,g=new Uint8Array(l);let T=0;for(n=0;n<l;T++,n++)T===t[0]&&(T++,t.shift()),g[n]=b[T];return g}function st(b){const e=b[0];let t="",n="",l=0,g=0,T=0,I=0,k=0,U=0;if(e===0){for(;Ae(b.subarray(U,U+1))!=="\0";)t+=Ae(b.subarray(U,U+1)),U+=1;for(t+=Ae(b.subarray(U,U+1)),U+=1;Ae(b.subarray(U,U+1))!=="\0";)n+=Ae(b.subarray(U,U+1)),U+=1;n+=Ae(b.subarray(U,U+1)),U+=1,l=we(b,12),g=we(b,16),I=we(b,20),k=we(b,24),U=28}else if(e===1){U+=4,l=we(b,U),U+=4;const Z=we(b,U);U+=4;const Q=we(b,U);for(U+=4,T=dl(2,32)*Z+Q,re(T)||(T=Number.MAX_SAFE_INTEGER,S.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),I=we(b,U),U+=4,k=we(b,U),U+=4;Ae(b.subarray(U,U+1))!=="\0";)t+=Ae(b.subarray(U,U+1)),U+=1;for(t+=Ae(b.subarray(U,U+1)),U+=1;Ae(b.subarray(U,U+1))!=="\0";)n+=Ae(b.subarray(U,U+1)),U+=1;n+=Ae(b.subarray(U,U+1)),U+=1}const j=b.subarray(U,b.byteLength);return{schemeIdUri:t,value:n,timeScale:l,presentationTime:T,presentationTimeDelta:g,eventDuration:I,id:k,payload:j}}function Ot(b,...e){const t=e.length;let n=8,l=t;for(;l--;)n+=e[l].byteLength;const g=new Uint8Array(n);for(g[0]=n>>24&255,g[1]=n>>16&255,g[2]=n>>8&255,g[3]=n&255,g.set(b,4),l=0,n=8;l<t;l++)g.set(e[l],n),n+=e[l].byteLength;return g}function ur(b,e,t){if(b.byteLength!==16)throw new RangeError("Invalid system id");let n,l;n=0,l=new Uint8Array;let g;n>0?(g=new Uint8Array(4),e.length>0&&new DataView(g.buffer).setUint32(0,e.length,!1)):g=new Uint8Array;const T=new Uint8Array(4);return t.byteLength>0&&new DataView(T.buffer).setUint32(0,t.byteLength,!1),Ot([112,115,115,104],new Uint8Array([n,0,0,0]),b,g,l,T,t)}const br=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Qt={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Fr(b,e){const t=Qt[e];return!!t&&!!t[b.slice(0,4)]}function Lt(b,e,t=!0){return!b.split(",").some(n=>!gt(n,e,t))}function gt(b,e,t=!0){var n;const l=w(t);return(n=l==null?void 0:l.isTypeSupported(yt(b,e)))!=null?n:!1}function yt(b,e){return`${e}/mp4;codecs=${b}`}function ir(b){if(b){const e=b.substring(0,4);return Qt.video[e]}return 2}function Jt(b){const e=br();return b.split(",").reduce((t,n)=>{const g=e&&nt(n)?9:Qt.video[n];return g?(g*2+t)/(t?3:2):(Qt.audio[n]+t)/(t?2:1)},0)}const St={};function it(b,e=!0){if(St[b])return St[b];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[b];for(let l=0;l<t.length;l++){var n;if(gt(t[l],"audio",e))return St[b]=t[l],t[l];if(t[l]==="mp3"&&(n=w(e))!=null&&n.isTypeSupported("audio/mpeg"))return""}return b}const Rt=/flac|opus|mp4a\.40\.34/i;function Vt(b,e=!0){return b.replace(Rt,t=>it(t.toLowerCase(),e))}function jt(b,e){const t=[];if(b){const n=b.split(",");for(let l=0;l<n.length;l++)Fr(n[l],"video")||t.push(n[l])}return e&&t.push(e),t.join(",")}function Yt(b,e){if(b&&(b.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(b)!==-1)&&(qe(b,"audio")||qe(b,"video")))return b;if(e){const t=e.split(",");if(t.length>1){if(b){for(let n=t.length;n--;)if(t[n].substring(0,4)===b.substring(0,4))return t[n]}return t[0]}}return e||b}function qe(b,e){return Fr(b,e)&>(b,e)}function mt(b){const e=b.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(".");n.length>2&&n[0]==="avc1"&&(e[t]=`avc1.${parseInt(n[1]).toString(16)}${("000"+parseInt(n[2]).toString(16)).slice(-4)}`)}return e.join(",")}function Dt(b){if(b.startsWith("av01.")){const e=b.split("."),t=["0","111","01","01","01","0"];for(let n=e.length;n>4&&n<10;n++)e[n]=t[n-4];return e.join(".")}return b}function Ft(b){const e=w(b)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function Zt(b){return b.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const _t={supported:!0,powerEfficient:!0,smooth:!0},G={supported:!1,smooth:!1,powerEfficient:!1},Y={supported:!0,configurations:[],decodingInfoResults:[_t]};function J(b,e){return{supported:!1,configurations:e,decodingInfoResults:[G],error:b}}function le(b,e,t,n,l,g){const T=b.videoCodec,I=b.audioCodec?b.audioGroups:null,k=g==null?void 0:g.audioCodec,U=g==null?void 0:g.channels,j=U?parseInt(U):k?1/0:2;let Z=null;if(I!=null&&I.length)try{I.length===1&&I[0]?Z=e.groups[I[0]].channels:Z=I.reduce((Q,ee)=>{if(ee){const ne=e.groups[ee];if(!ne)throw new Error(`Audio track group ${ee} not found`);Object.keys(ne.channels).forEach(de=>{Q[de]=(Q[de]||0)+ne.channels[de]})}return Q},{2:0})}catch(Q){return!0}return T!==void 0&&(T.split(",").some(Q=>nt(Q))||b.width>1920&&b.height>1088||b.height>1920&&b.width>1088||b.frameRate>Math.max(n,30)||b.videoRange!=="SDR"&&b.videoRange!==t||b.bitrate>Math.max(l,8e6))||!!Z&&te(j)&&Object.keys(Z).some(Q=>parseInt(Q)>j)}function _e(b,e,t,n={}){const l=b.videoCodec;if(!l&&!b.audioCodec||!t)return Promise.resolve(Y);const g=[],T=Ie(b),I=T.length,k=Ce(b,e,I>0),U=k.length;for(let j=I||1*U||1;j--;){const Z={type:"media-source"};if(I&&(Z.video=T[j%I]),U){Z.audio=k[j%U];const Q=Z.audio.bitrate;Z.video&&Q&&(Z.video.bitrate-=Q)}g.push(Z)}if(l){const j=navigator.userAgent;if(l.split(",").some(Z=>nt(Z))&&br())return Promise.resolve(J(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${j})`),g))}return Promise.all(g.map(j=>{const Z=bt(j);return n[Z]||(n[Z]=t.decodingInfo(j))})).then(j=>({supported:!j.some(Z=>!Z.supported),configurations:g,decodingInfoResults:j})).catch(j=>({supported:!1,configurations:g,decodingInfoResults:[],error:j}))}function Ie(b){var e;const t=(e=b.videoCodec)==null?void 0:e.split(","),n=Je(b),l=b.width||640,g=b.height||480,T=b.frameRate||30,I=b.videoRange.toLowerCase();return t?t.map(k=>{const U={contentType:yt(Dt(k),"video"),width:l,height:g,bitrate:n,framerate:T};return I!=="sdr"&&(U.transferFunction=I),U}):[]}function Ce(b,e,t){var n;const l=(n=b.audioCodec)==null?void 0:n.split(","),g=Je(b);return l&&b.audioGroups?b.audioGroups.reduce((T,I)=>{var k;const U=I?(k=e.groups[I])==null?void 0:k.tracks:null;return U?U.reduce((j,Z)=>{if(Z.groupId===I){const Q=parseFloat(Z.channels||"");l.forEach(ee=>{const ne={contentType:yt(ee,"audio"),bitrate:t?Xe(ee,g):g};Q&&(ne.channels=""+Q),j.push(ne)})}return j},T):T},[]):[]}function Xe(b,e){if(e<=1)return 1;let t=128e3;return b==="ec-3"?t=768e3:b==="ac-3"&&(t=64e4),Math.min(e/2,t)}function Je(b){return Math.ceil(Math.max(b.bitrate*.9,b.averageBitrate)/1e3)*1e3||1}function bt(b){let e="";const{audio:t,video:n}=b;if(n){const l=Zt(n.contentType);e+=`${l}_r${n.height}x${n.width}f${Math.ceil(n.framerate)}${n.transferFunction||"sd"}_${Math.ceil(n.bitrate/1e5)}`}if(t){const l=Zt(t.contentType);e+=`${n?"_":""}${l}_c${t.channels}`}return e}const Ht=["NONE","TYPE-0","TYPE-1",null];function Pe(b){return Ht.indexOf(b)>-1}const be=["SDR","PQ","HLG"];function ut(b){return!!b&&be.indexOf(b)>-1}var ze={No:"",Yes:"YES",v2:"v2"};function He(b){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=b,l=n<e/2;return e&&l?t?ze.v2:ze.Yes:ze.No}class Qe{constructor(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class ht{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(n=>!!n).map(n=>n.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const n=(t=e.supplemental)==null?void 0:t.videoCodec;n&&n!==e.videoCodec&&(this.codecSet+=`,${n.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return pt(this._audioGroups,e)}hasSubtitleGroup(e){return pt(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 pt(b,e){return!e||!b?!1:b.indexOf(e)!==-1}function kt(){if(typeof matchMedia=="function"){const b=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(b.media!==e.media)return b.matches===!0}return!1}function Tt(b,e){let t=!1,n=[];if(b&&(t=b!=="SDR",n=[b]),e){n=e.allowedVideoRanges||be.slice(0);const l=n.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:l&&kt(),t||(n=["SDR"])}return{preferHDR:t,allowedVideoRanges:n}}const Ut=b=>{const e=new WeakSet;return(t,n)=>{if(b&&(n=b(t,n)),typeof n=="object"&&n!==null){if(e.has(n))return;e.add(n)}return n}},ot=(b,e)=>JSON.stringify(b,Ut(e));function It(b,e,t,n,l){const g=Object.keys(b),T=n==null?void 0:n.channels,I=n==null?void 0:n.audioCodec,k=l==null?void 0:l.videoCodec,U=T&&parseInt(T)===2;let j=!1,Z=!1,Q=1/0,ee=1/0,ne=1/0,de=1/0,ce=0,Ee=[];const{preferHDR:ke,allowedVideoRanges:Me}=Tt(e,l);for(let vt=g.length;vt--;){const xt=b[g[vt]];j||(j=xt.channels[2]>0),Q=Math.min(Q,xt.minHeight),ee=Math.min(ee,xt.minFramerate),ne=Math.min(ne,xt.minBitrate),Me.filter(Gt=>xt.videoRanges[Gt]>0).length>0&&(Z=!0)}Q=te(Q)?Q:0,ee=te(ee)?ee:0;const Ye=Math.max(1080,Q),lt=Math.max(30,ee);ne=te(ne)?ne:t,t=Math.max(ne,t),Z||(e=void 0);const Ct=g.length>1;return{codecSet:g.reduce((vt,xt)=>{const at=b[xt];if(xt===vt)return vt;if(Ee=Z?Me.filter(Gt=>at.videoRanges[Gt]>0):[],Ct){if(at.minBitrate>t)return ft(xt,`min bitrate of ${at.minBitrate} > current estimate of ${t}`),vt;if(!at.hasDefaultAudio)return ft(xt,"no renditions with default or auto-select sound found"),vt;if(I&&xt.indexOf(I.substring(0,4))%5!==0)return ft(xt,`audio codec preference "${I}" not found`),vt;if(T&&!U){if(!at.channels[T])return ft(xt,`no renditions with ${T} channel sound found (channels options: ${Object.keys(at.channels)})`),vt}else if((!I||U)&&j&&at.channels[2]===0)return ft(xt,"no renditions with stereo sound found"),vt;if(at.minHeight>Ye)return ft(xt,`min resolution of ${at.minHeight} > maximum of ${Ye}`),vt;if(at.minFramerate>lt)return ft(xt,`min framerate of ${at.minFramerate} > maximum of ${lt}`),vt;if(!Ee.some(Gt=>at.videoRanges[Gt]>0))return ft(xt,`no variants with VIDEO-RANGE of ${ot(Ee)} found`),vt;if(k&&xt.indexOf(k.substring(0,4))%5!==0)return ft(xt,`video codec preference "${k}" not found`),vt;if(at.maxScore<ce)return ft(xt,`max score of ${at.maxScore} < selected max of ${ce}`),vt}return vt&&(Jt(xt)>=Jt(vt)||at.fragmentError>b[vt].fragmentError)?vt:(de=at.minIndex,ce=at.maxScore,xt)},void 0),videoRanges:Ee,preferHDR:ke,minFramerate:ee,minBitrate:ne,minIndex:de}}function ft(b,e){S.log(`[abr] start candidates with "${b}" ignored because ${e}`)}function Ne(b){return b.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 l=t.channels||"2";return n.channels[l]=(n.channels[l]||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 je(b,e,t,n){return b.slice(t,n+1).reduce((l,g,T)=>{if(!g.codecSet)return l;const I=g.audioGroups;let k=l[g.codecSet];k||(l[g.codecSet]=k={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:T,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!I,fragmentError:0}),k.minBitrate=Math.min(k.minBitrate,g.bitrate);const U=Math.min(g.height,g.width);return k.minHeight=Math.min(k.minHeight,U),k.minFramerate=Math.min(k.minFramerate,g.frameRate),k.minIndex=Math.min(k.minIndex,T),k.maxScore=Math.max(k.maxScore,g.score),k.fragmentError+=g.fragmentError,k.videoRanges[g.videoRange]=(k.videoRanges[g.videoRange]||0)+1,I&&I.forEach(j=>{if(!j)return;const Z=e.groups[j];Z&&(k.hasDefaultAudio=k.hasDefaultAudio||e.hasDefaultAudio?Z.hasDefault:Z.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(Z.channels).forEach(Q=>{k.channels[Q]=(k.channels[Q]||0)+Z.channels[Q]}))}),l},{})}function et(b){if(!b)return b;const{lang:e,assocLang:t,characteristics:n,channels:l,audioCodec:g}=b;return{lang:e,assocLang:t,characteristics:n,channels:l,audioCodec:g}}function Ke(b,e,t){if("attrs"in b){const n=e.indexOf(b);if(n!==-1)return n}for(let n=0;n<e.length;n++){const l=e[n];if(Et(b,l,t))return n}return-1}function Et(b,e,t){const{groupId:n,name:l,lang:g,assocLang:T,default:I}=b,k=b.forced;return(n===void 0||e.groupId===n)&&(l===void 0||e.name===l)&&(g===void 0||wt(g,e.lang))&&(g===void 0||e.assocLang===T)&&(I===void 0||e.default===I)&&(k===void 0||e.forced===k)&&(!("characteristics"in b)||Pt(b.characteristics||"",e.characteristics))&&(t===void 0||t(b,e))}function wt(b,e="--"){return b.length===e.length?b===e:b.startsWith(e)||e.startsWith(b)}function Pt(b,e=""){const t=b.split(","),n=e.split(",");return t.length===n.length&&!t.some(l=>n.indexOf(l)===-1)}function zt(b,e){const{audioCodec:t,channels:n}=b;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(n===void 0||n===(e.channels||"2"))}function er(b,e,t,n,l){const g=e[n],I=e.reduce((Q,ee,ne)=>{const de=ee.uri;return(Q[de]||(Q[de]=[])).push(ne),Q},{})[g.uri];I.length>1&&(n=Math.max.apply(Math,I));const k=g.videoRange,U=g.frameRate,j=g.codecSet.substring(0,4),Z=$t(e,n,Q=>{if(Q.videoRange!==k||Q.frameRate!==U||Q.codecSet.substring(0,4)!==j)return!1;const ee=Q.audioGroups,ne=t.filter(de=>!ee||ee.indexOf(de.groupId)!==-1);return Ke(b,ne,l)>-1});return Z>-1?Z:$t(e,n,Q=>{const ee=Q.audioGroups,ne=t.filter(de=>!ee||ee.indexOf(de.groupId)!==-1);return Ke(b,ne,l)>-1})}function $t(b,e,t){for(let n=e;n>-1;n--)if(t(b[n]))return n;for(let n=e+1;n<b.length;n++)if(t(b[n]))return n;return-1}function _r(b,e){var t;return!!b&&b!==((t=e.loadLevelObj)==null?void 0:t.uri)}class Ve extends m{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var n;const{fragCurrent:l,partCurrent:g,hls:T}=this,{autoLevelEnabled:I,media:k}=T;if(!l||!k)return;const U=performance.now(),j=g?g.stats:l.stats,Z=g?g.duration:l.duration,Q=U-j.loading.start,ee=T.minAutoLevel,ne=l.level,de=this._nextAutoLevel;if(j.aborted||j.loaded&&j.loaded===j.total||ne<=ee){this.clearTimer(),this._nextAutoLevel=-1;return}if(!I)return;const ce=de>-1&&de!==ne,Ee=!!t||ce;if(!Ee&&(k.paused||!k.playbackRate||!k.readyState))return;const ke=T.mainForwardBufferInfo;if(!Ee&&ke===null)return;const Me=this.bwEstimator.getEstimateTTFB(),Ye=Math.abs(k.playbackRate);if(Q<=Math.max(Me,1e3*(Z/(Ye*2))))return;const lt=ke?ke.len/Ye:0,Ct=j.loading.first?j.loading.first-j.loading.start:-1,rt=j.loaded&&Ct>-1,vt=this.getBwEstimate(),xt=T.levels,at=xt[ne],Gt=Math.max(j.loaded,Math.round(Z*(l.bitrate||at.averageBitrate)/8));let dr=rt?Q-Ct:Q;dr<1&&rt&&(dr=Math.min(Q,j.loaded*8/vt));const Lr=rt?j.loaded*1e3/dr:0,Ur=Me/1e3,Rr=Lr?(Gt-j.loaded)/Lr:Gt*8/vt+Ur;if(Rr<=lt)return;const lr=Lr?Lr*8:vt,Ir=((n=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:n.live)===!0,yr=this.hls.config.abrBandWidthUpFactor;let Pr=Number.POSITIVE_INFINITY,Zr;for(Zr=ne-1;Zr>ee;Zr--){const xn=xt[Zr].maxBitrate,sn=!xt[Zr].details||Ir;if(Pr=this.getTimeToLoadFrag(Ur,lr,Z*xn,sn),Pr<Math.min(lt,Z+Ur))break}if(Pr>=Rr||Pr>Z*10)return;rt?this.bwEstimator.sample(Q-Math.min(Me,Ct),j.loaded):this.bwEstimator.sampleTTFB(Q);const hr=xt[Zr].maxBitrate;this.getBwEstimate()*yr>hr&&this.resetEstimator(hr);const fr=this.findBestLevel(hr,ee,Zr,0,lt,1,1);fr>-1&&(Zr=fr),this.warn(`Fragment ${l.sn}${g?" part "+g.index:""} of level ${ne} is loading too slowly;
|
|
Fragment duration: ${l.duration.toFixed(3)}
|
|
Time to underbuffer: ${lt.toFixed(3)} s
|
|
Estimated load time for current fragment: ${Rr.toFixed(3)} s
|
|
Estimated load time for down switch fragment: ${Pr.toFixed(3)} s
|
|
TTFB estimate: ${Ct|0} ms
|
|
Current BW estimate: ${te(vt)?vt|0:"Unknown"} bps
|
|
New BW estimate: ${this.getBwEstimate()|0} bps
|
|
Switching to level ${Zr} @ ${hr|0} bps`),T.nextLoadLevel=T.nextAutoLevel=Zr,this.clearTimer();const an=()=>{if(this.clearTimer(),this.fragCurrent===l&&this.hls.loadLevel===Zr&&Zr>0){const xn=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${Zr>0?"and switching down":""}
|
|
Fragment duration: ${l.duration.toFixed(3)} s
|
|
Time to underbuffer: ${xn.toFixed(3)} s`),l.abortRequests(),this.fragCurrent=this.partCurrent=null,Zr>ee){let sn=this.findBestLevel(this.hls.levels[ee].bitrate,ee,Zr,0,xn,1,1);sn===-1&&(sn=ee),this.hls.nextLoadLevel=this.hls.nextAutoLevel=sn,this.resetEstimator(this.hls.levels[sn].bitrate)}}};ce||Rr>Pr*2?an():this.timer=self.setInterval(an,Pr*1e3),T.trigger(y.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:g,stats:j})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(this.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new x(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(y.MANIFEST_LOADING,this.onManifestLoading,this),e.on(y.FRAG_LOADING,this.onFragLoading,this),e.on(y.FRAG_LOADED,this.onFragLoaded,this),e.on(y.FRAG_BUFFERED,this.onFragBuffered,this),e.on(y.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(y.LEVEL_LOADED,this.onLevelLoaded,this),e.on(y.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(y.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(y.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(y.MANIFEST_LOADING,this.onManifestLoading,this),e.off(y.FRAG_LOADING,this.onFragLoading,this),e.off(y.FRAG_LOADED,this.onFragLoaded,this),e.off(y.FRAG_BUFFERED,this.onFragBuffered,this),e.off(y.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(y.LEVEL_LOADED,this.onLevelLoaded,this),e.off(y.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(y.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(y.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){if(!n.bitrateTest){var l;this.fragCurrent=n,this.partCurrent=(l=t.part)!=null?l: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 W.BUFFER_ADD_CODEC_ERROR:case W.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case W.FRAG_LOAD_TIMEOUT:{const n=t.frag,{fragCurrent:l,partCurrent:g}=this;if(n&&l&&n.sn===l.sn&&n.level===l.level){const T=performance.now(),I=g?g.stats:n.stats,k=T-I.loading.start,U=I.loading.first?I.loading.first-I.loading.start:-1;if(I.loaded&&U>-1){const Z=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(k-Math.min(Z,U),I.loaded)}else this.bwEstimator.sampleTTFB(k)}break}}}getTimeToLoadFrag(e,t,n,l){const g=e+n/t,T=l?e+this.lastLevelLoadSec:0;return g+T}onLevelLoaded(e,t){const n=this.hls.config,{loading:l}=t.stats,g=l.end-l.first;te(g)&&(this.lastLevelLoadSec=g/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:n}){const l=n?n.stats:t.stats;if(t.type===A.MAIN&&this.bwEstimator.sampleTTFB(l.loading.first-l.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const g=n?n.duration:t.duration,T=this.hls.levels[t.level],I=(T.loaded?T.loaded.bytes:0)+l.loaded,k=(T.loaded?T.loaded.duration:0)+g;T.loaded={bytes:I,duration:k},T.realBitrate=Math.round(8*I/k)}if(t.bitrateTest){const g={stats:l,frag:t,part:n,id:t.type};this.onFragBuffered(y.FRAG_BUFFERED,g),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:l}=t,g=l!=null&&l.stats.loaded?l.stats:n.stats;if(g.aborted||this.ignoreFragment(n))return;const T=g.parsing.end-g.loading.start-Math.min(g.loading.first-g.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(T,g.loaded),g.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=T/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==A.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(),l=this.hls.config.maxStarvationDelay,g=this.findBestLevel(n,t,e,0,l,1,1);if(g>-1)return g;const T=this.hls.firstLevel,I=Math.min(Math.max(T,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${T} clamped to ${I}`),I}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),l=this.lastLoadedFragLevel>-1;if(e!==-1&&(!n||!l||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const g=n&&l?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const T=this.hls.levels;if(T.length>Math.max(e,g)&&T[e].loadError<=T[g].loadError)return e}return this._nextAutoLevel=g,this.nextAutoLevelKey=this.getAutoLevelKey(),g}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this;if(n.levels.length<=1)return n.loadLevel;const{maxAutoLevel:l,config:g,minAutoLevel:T}=n,I=t?t.duration:e?e.duration:0,k=this.getBwEstimate(),U=this.getStarvationDelay();let j=g.abrBandWidthFactor,Z=g.abrBandWidthUpFactor;if(U){const ce=this.findBestLevel(k,T,l,U,0,j,Z);if(ce>=0)return this.rebufferNotice=-1,ce}let Q=I?Math.min(I,g.maxStarvationDelay):g.maxStarvationDelay;if(!U){const ce=this.bitrateTestDelay;ce&&(Q=(I?Math.min(I,g.maxLoadingDelay):g.maxLoadingDelay)-ce,this.info(`bitrate test took ${Math.round(1e3*ce)}ms, set first fragment max fetchDuration to ${Math.round(1e3*Q)} ms`),j=Z=1)}const ee=this.findBestLevel(k,T,l,U,Q,j,Z);if(this.rebufferNotice!==ee&&(this.rebufferNotice=ee,this.info(`${U?"rebuffering expected":"buffer is empty"}, optimal quality level ${ee}`)),ee>-1)return ee;const ne=n.levels[T],de=n.loadLevelObj;return de&&(ne==null?void 0:ne.bitrate)<de.bitrate?T: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,l=e.mainForwardBufferInfo;return(l?l.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,l,g,T,I){var k;const U=l+g,j=this.lastLoadedFragLevel,Z=j===-1?this.hls.firstLevel:j,{fragCurrent:Q,partCurrent:ee}=this,{levels:ne,allAudioTracks:de,loadLevel:ce,config:Ee}=this.hls;if(ne.length===1)return 0;const ke=ne[Z],Me=!!((k=this.hls.latestLevelDetails)!=null&&k.live),Ye=ce===-1||j===-1;let lt,Ct="SDR",rt=(ke==null?void 0:ke.frameRate)||0;const{audioPreference:vt,videoPreference:xt}=Ee,at=this.audioTracksByGroup||(this.audioTracksByGroup=Ne(de));let Gt=-1;if(Ye){if(this.firstSelection!==-1)return this.firstSelection;const lr=this.codecTiers||(this.codecTiers=je(ne,at,t,n)),Ir=It(lr,Ct,e,vt,xt),{codecSet:yr,videoRanges:Pr,minFramerate:Zr,minBitrate:hr,minIndex:fr,preferHDR:an}=Ir;Gt=fr,lt=yr,Ct=an?Pr[Pr.length-1]:Pr[0],rt=Zr,e=Math.max(e,hr),this.log(`picked start tier ${ot(Ir)}`)}else lt=ke==null?void 0:ke.codecSet,Ct=ke==null?void 0:ke.videoRange;const dr=ee?ee.duration:Q?Q.duration:0,Lr=this.bwEstimator.getEstimateTTFB()/1e3,Ur=[];for(let lr=n;lr>=t;lr--){var Rr;const Ir=ne[lr],yr=lr>Z;if(!Ir)continue;if(Ee.useMediaCapabilities&&!Ir.supportedResult&&!Ir.supportedPromise){const sn=navigator.mediaCapabilities;typeof(sn==null?void 0:sn.decodingInfo)=="function"&&le(Ir,at,Ct,rt,e,vt)?(Ir.supportedPromise=_e(Ir,at,sn,this.supportedCache),Ir.supportedPromise.then(hn=>{if(!this.hls)return;Ir.supportedResult=hn;const ei=this.hls.levels,Xn=ei.indexOf(Ir);hn.error?this.warn(`MediaCapabilities decodingInfo error: "${hn.error}" for level ${Xn} ${ot(hn)}`):hn.supported?hn.decodingInfoResults.some(yi=>yi.smooth===!1||yi.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${Xn} not smooth or powerEfficient: ${ot(hn)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${Xn} ${ot(hn)}`),Xn>-1&&ei.length>1&&(this.log(`Removing unsupported level ${Xn}`),this.hls.removeLevel(Xn),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))}).catch(hn=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${hn}`)})):Ir.supportedResult=Y}if((lt&&Ir.codecSet!==lt||Ct&&Ir.videoRange!==Ct||yr&&rt>Ir.frameRate||!yr&&rt>0&&rt<Ir.frameRate||(Rr=Ir.supportedResult)!=null&&(Rr=Rr.decodingInfoResults)!=null&&Rr.some(sn=>sn.smooth===!1))&&(!Ye||lr!==Gt)){Ur.push(lr);continue}const Pr=Ir.details,Zr=(ee?Pr==null?void 0:Pr.partTarget:Pr==null?void 0:Pr.averagetargetduration)||dr;let hr;yr?hr=I*e:hr=T*e;const fr=dr&&l>=dr*2&&g===0?Ir.averageBitrate:Ir.maxBitrate,an=this.getTimeToLoadFrag(Lr,hr,fr*Zr,Pr===void 0);if(hr>=fr&&(lr===j||Ir.loadError===0&&Ir.fragmentError===0)&&(an<=Lr||!te(an)||Me&&!this.bitrateTestDelay||an<U)){const sn=this.forcedAutoLevel;return lr!==ce&&(sn===-1||sn!==ce)&&(Ur.length&&this.trace(`Skipped level(s) ${Ur.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${ne[Ur[0]].codecs}" ${ne[Ur[0]].videoRange}; not compatible with "${lt}" ${Ct}`),this.info(`switch candidate:${Z}->${lr} adjustedbw(${Math.round(hr)})-bitrate=${Math.round(hr-fr)} ttfb:${Lr.toFixed(1)} avgDuration:${Zr.toFixed(1)} maxFetchDuration:${U.toFixed(1)} fetchDuration:${an.toFixed(1)} firstSelection:${Ye} codecSet:${Ir.codecSet} videoRange:${Ir.videoRange} hls.loadLevel:${ce}`)),Ye&&(this.firstSelection=lr),lr}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls;return Math.min(Math.max(e,n),t)}}const Xt={search:function(b,e){let t=0,n=b.length-1,l=null,g=null;for(;t<=n;){l=(t+n)/2|0,g=b[l];const T=e(g);if(T>0)t=l+1;else if(T<0)n=l-1;else return g}return null}};function ar(b,e,t){if(e===null||!Array.isArray(b)||!b.length||!te(e))return null;const n=b[0].programDateTime;if(e<(n||0))return null;const l=b[b.length-1].endProgramDateTime;if(e>=(l||0))return null;for(let g=0;g<b.length;++g){const T=b[g];if(cr(e,t,T))return T}return null}function mr(b,e,t=0,n=0,l=.005){let g=null;if(b){g=e[1+b.sn-e[0].sn]||null;const I=b.endDTS-t;I>0&&I<15e-7&&(t+=15e-7),g&&b.level!==g.level&&g.end<=b.end&&(g=e[2+b.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(g=e[0]);if(g&&((!b||b.level===g.level)&&nr(t,n,g)===0||sr(g,b,Math.min(l,n))))return g;const T=Xt.search(e,nr.bind(null,t,n));return T&&(T!==b||!g)?T:g}function sr(b,e,t){if(e&&e.start===0&&e.level<b.level&&(e.endPTS||0)>0){const n=e.tagList.reduce((l,g)=>(g[0]==="INF"&&(l+=parseFloat(g[1])),l),t);return b.start<=n}return!1}function nr(b=0,e=0,t){if(t.start<=b&&t.start+t.duration>b)return 0;const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-n<=b?1:t.start-n>b&&t.start?-1:0}function cr(b,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>b}function Mr(b,e,t){if(b&&b.startCC<=e&&b.endCC>=e){let n=b.fragments;const{fragmentHint:l}=b;l&&(n=n.concat(l));let g;return Xt.search(n,T=>T.cc<e?1:T.cc>e?-1:(g=T,T.end<=t?1:T.start>t?-1:0)),g||null}return null}function Sr(b){switch(b.details){case W.FRAG_LOAD_TIMEOUT:case W.KEY_LOAD_TIMEOUT:case W.LEVEL_LOAD_TIMEOUT:case W.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Er(b,e){const t=Sr(e);return b.default[`${t?"timeout":"error"}Retry`]}function Cr(b,e){const t=b.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*b.retryDelayMs,b.maxRetryDelayMs)}function vr(b){return i(i({},b),{errorRetry:null,timeoutRetry:null})}function pr(b,e,t,n){if(!b)return!1;const l=n==null?void 0:n.code,g=e<b.maxNumRetry&&(Qr(l)||!!t);return b.shouldRetry?b.shouldRetry(b,e,t,n,g):g}function Qr(b){return zr(b)||!!b&&(b<400||b>499)}function zr(b){return b===0&&navigator.onLine===!1}var Wr={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},wr={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,MoveAllAlternatesMatchingKey:4,SwitchToSDR:8};class on extends m{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(y.ERROR,this.onError,this),e.on(y.MANIFEST_LOADING,this.onManifestLoading,this),e.on(y.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(y.ERROR,this.onError,this),e.off(y.ERROR,this.onErrorOut,this),e.off(y.MANIFEST_LOADING,this.onManifestLoading,this),e.off(y.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===A.MAIN?e.level:this.getVariantIndex()}getVariantIndex(){var e;const t=this.hls,n=t.currentLevel;return(e=t.loadLevelObj)!=null&&e.details||n===-1?t.loadLevel:n}variantHasKey(e,t){if(e){var n;if((n=e.details)!=null&&n.hasKey(t))return!0;const l=e.audioGroups;if(l)return this.hls.allAudioTracks.filter(T=>l.indexOf(T.groupId)>=0).some(T=>{var I;return(I=T.details)==null?void 0:I.hasKey(t)})}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(e,t){var n;if(t.fatal)return;const l=this.hls,g=t.context;switch(t.details){case W.FRAG_LOAD_ERROR:case W.FRAG_LOAD_TIMEOUT:case W.KEY_LOAD_ERROR:case W.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case W.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction=Xr();return}case W.FRAG_GAP:case W.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=Wr.SendAlternateToPenaltyBox;return}case W.LEVEL_EMPTY_ERROR:case W.LEVEL_PARSING_ERROR:{var T;const k=t.parent===A.MAIN?t.level:l.loadLevel;t.details===W.LEVEL_EMPTY_ERROR&&((T=t.context)!=null&&(T=T.levelDetails)!=null&&T.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,k):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,k))}return;case W.LEVEL_LOAD_ERROR:case W.LEVEL_LOAD_TIMEOUT:typeof(g==null?void 0:g.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,g.level));return;case W.AUDIO_TRACK_LOAD_ERROR:case W.AUDIO_TRACK_LOAD_TIMEOUT:case W.SUBTITLE_LOAD_ERROR:case W.SUBTITLE_TRACK_LOAD_TIMEOUT:if(g){const k=l.loadLevelObj;if(k&&(g.type===L.AUDIO_TRACK&&k.hasAudioGroup(g.groupId)||g.type===L.SUBTITLE_TRACK&&k.hasSubtitleGroup(g.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,l.loadLevel),t.errorAction.action=Wr.SendAlternateToPenaltyBox,t.errorAction.flags=wr.MoveAllAlternatesMatchingHost;return}}return;case W.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:t.errorAction={action:Wr.SendAlternateToPenaltyBox,flags:wr.MoveAllAlternatesMatchingHDCP};return;case W.KEY_SYSTEM_SESSION_UPDATE_FAILED:case W.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case W.KEY_SYSTEM_NO_SESSION:t.errorAction={action:Wr.SendAlternateToPenaltyBox,flags:wr.MoveAllAlternatesMatchingKey};return;case W.BUFFER_ADD_CODEC_ERROR:case W.REMUX_ALLOC_ERROR:case W.BUFFER_APPEND_ERROR:if(!t.errorAction){var I;t.errorAction=this.getLevelSwitchAction(t,(I=t.level)!=null?I:l.loadLevel)}return;case W.INTERNAL_EXCEPTION:case W.BUFFER_APPENDING_ERROR:case W.BUFFER_FULL_ERROR:case W.LEVEL_SWITCH_ERROR:case W.BUFFER_STALLED_ERROR:case W.BUFFER_SEEK_OVER_HOLE:case W.BUFFER_NUDGE_ON_STALL:t.errorAction=Xr();return}t.type===D.KEY_SYSTEM_ERROR&&(t.levelRetry=!1,t.errorAction=Xr())}getPlaylistRetryOrSwitchAction(e,t){const n=this.hls,l=Er(n.config.playlistLoadPolicy,e),g=this.playlistError++;if(pr(l,g,Sr(e),e.response))return{action:Wr.RetryRequest,flags:wr.None,retryConfig:l,retryCount:g};const I=this.getLevelSwitchAction(e,t);return l&&(I.retryConfig=l,I.retryCount=g),I}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),l=t.levels[n],{fragLoadPolicy:g,keyLoadPolicy:T}=t.config,I=Er(e.details.startsWith("key")?T:g,e),k=t.levels.reduce((j,Z)=>j+Z.fragmentError,0);if(l&&(e.details!==W.FRAG_GAP&&l.fragmentError++,pr(I,k,Sr(e),e.response)))return{action:Wr.RetryRequest,flags:wr.None,retryConfig:I,retryCount:k};const U=this.getLevelSwitchAction(e,n);return I&&(U.retryConfig=I,U.retryCount=k),U}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const l=this.hls.levels[t];if(l){var g,T;const U=e.details;l.loadError++,U===W.BUFFER_APPEND_ERROR&&l.fragmentError++;let j=-1;const{levels:Z,loadLevel:Q,minAutoLevel:ee,maxAutoLevel:ne}=n;!n.autoLevelEnabled&&!n.config.preserveManualLevelOnError&&(n.loadLevel=-1);const de=(g=e.frag)==null?void 0:g.type,Ee=(de===A.AUDIO&&U===W.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(U===W.BUFFER_ADD_CODEC_ERROR||U===W.BUFFER_APPEND_ERROR))&&Z.some(({audioCodec:Ct})=>l.audioCodec!==Ct),Me=e.sourceBufferName==="video"&&(U===W.BUFFER_ADD_CODEC_ERROR||U===W.BUFFER_APPEND_ERROR)&&Z.some(({codecSet:Ct,audioCodec:rt})=>l.codecSet!==Ct&&l.audioCodec===rt),{type:Ye,groupId:lt}=(T=e.context)!=null?T:{};for(let Ct=Z.length;Ct--;){const rt=(Ct+Q)%Z.length;if(rt!==Q&&rt>=ee&&rt<=ne&&Z[rt].loadError===0){var I,k;const vt=Z[rt];if(U===W.FRAG_GAP&&de===A.MAIN&&e.frag){const xt=Z[rt].details;if(xt){const at=mr(e.frag,xt.fragments,e.frag.start);if(at!=null&&at.gap)continue}}else{if(Ye===L.AUDIO_TRACK&&vt.hasAudioGroup(lt)||Ye===L.SUBTITLE_TRACK&&vt.hasSubtitleGroup(lt))continue;if(de===A.AUDIO&&(I=l.audioGroups)!=null&&I.some(xt=>vt.hasAudioGroup(xt))||de===A.SUBTITLE&&(k=l.subtitleGroups)!=null&&k.some(xt=>vt.hasSubtitleGroup(xt))||Ee&&l.audioCodec===vt.audioCodec||Me&&l.codecSet===vt.codecSet||!Ee&&l.codecSet!==vt.codecSet)continue}j=rt;break}}if(j>-1&&n.loadLevel!==j)return e.levelRetry=!0,this.playlistError=0,{action:Wr.SendAlternateToPenaltyBox,flags:wr.None,nextAutoLevel:j}}return{action:Wr.SendAlternateToPenaltyBox,flags:wr.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case Wr.DoNothing:break;case Wr.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==W.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 Wr.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:l}=n,g=n.nextAutoLevel;switch(l){case wr.None:this.switchLevel(e,g);break;case wr.MoveAllAlternatesMatchingHDCP:{const k=this.getVariantLevelIndex(e.frag),U=t.levels[k],j=U==null?void 0:U.attrs["HDCP-LEVEL"];if(n.hdcpLevel=j,j){t.maxHdcpLevel=Ht[Ht.indexOf(j)-1],n.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}}case wr.MoveAllAlternatesMatchingKey:{const k=e.decryptdata;if(k){const U=this.hls.levels;for(let j=U.length;j--;)if(this.variantHasKey(U[j],k)){var T,I;this.log(`Banned key found in level ${j} (${U[j].bitrate}bps) or audio group "${(T=U[j].audioGroups)==null?void 0:T.join(",")}" (${(I=e.frag)==null?void 0:I.type} fragment) ${N(k.keyId||[])}`),U[j].fragmentError++,U[j].loadError++,this.log(`Removing level ${j} with key error (${e.error})`),this.hls.removeLevel(j)}U.length&&(n.resolved=!0)}break}}n.resolved||this.switchLevel(e,g)}switchLevel(e,t){if(t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,e.details===W.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const n=Zt(e.mimeType),l=this.hls.levels;for(let g=l.length;g--;)l[g][`${e.sourceBufferName}Codec`]===n&&(this.log(`Removing level ${g} for ${e.details} ("${n}" not supported)`),this.hls.removeLevel(g))}}}function Xr(b){const e={action:Wr.DoNothing,flags:wr.None};return b&&(e.resolved=!0),e}var Gr={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class un{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e&&(e.on(y.MANIFEST_LOADING,this.onManifestLoading,this),e.on(y.BUFFER_APPENDED,this.onBufferAppended,this),e.on(y.FRAG_BUFFERED,this.onFragBuffered,this),e.on(y.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(y.MANIFEST_LOADING,this.onManifestLoading,this),e.off(y.BUFFER_APPENDED,this.onBufferAppended,this),e.off(y.FRAG_BUFFERED,this.onFragBuffered,this),e.off(y.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let l=n.length;l--;){const g=n[l];if(!g)break;if(g.start<=e&&e<=g.end&&g.loaded)return g}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,n){const{fragments:l}=this,g=Object.keys(l);for(let T=g.length;T--;){const I=l[g[T]];if((I==null?void 0:I.body.type)===t&&(!n||I.buffered)){const k=I.body;if(k.start<=e&&e<=k.end)return k}}return null}detectEvictedFragments(e,t,n,l,g){this.timeRanges&&(this.timeRanges[e]=t);const T=(l==null?void 0:l.fragment.sn)||-1;Object.keys(this.fragments).forEach(I=>{const k=this.fragments[I];if(!k||T>=k.body.sn)return;if(!k.buffered&&(!k.loaded||g)){k.body.type===n&&this.removeFragment(k.body);return}const U=k.range[e];if(U){if(U.time.length===0){this.removeFragment(k.body);return}U.time.some(j=>{const Z=!this.isTimeBuffered(j.startPTS,j.endPTS,t);return Z&&this.removeFragment(k.body),Z})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const n=e.frag,l=gr(n),g=this.fragments[l];if(!g||g.buffered&&n.gap)return;const T=!n.relurl;Object.keys(t).forEach(I=>{const k=n.elementaryStreams[I];if(!k)return;const U=t[I],j=T||k.partial===!0;g.range[I]=this.getBufferedTimes(n,e.part,j,U)}),g.loaded=null,Object.keys(g.range).length?(g.buffered=!0,(g.body.endList=n.endList||g.body.endList)&&(this.endListFragments[g.body.type]=g),Jr(g)||this.removeParts(n.sn-1,n.type)):this.removeFragment(g.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=Wt(n,l=>l.fragment.sn>=e))}fragBuffered(e,t){const n=gr(e);let l=this.fragments[n];!l&&t&&(l=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),l&&(l.loaded=null,l.buffered=!0)}getBufferedTimes(e,t,n,l){const g={time:[],partial:n},T=e.start,I=e.end,k=e.minEndPTS||I,U=e.maxStartPTS||T;for(let j=0;j<l.length;j++){const Z=l.start(j)-this.bufferPadding,Q=l.end(j)+this.bufferPadding;if(U>=Z&&k<=Q){g.time.push({startPTS:Math.max(T,l.start(j)),endPTS:Math.min(I,l.end(j))});break}else if(T<Q&&I>Z){const ee=Math.max(T,l.start(j)),ne=Math.min(I,l.end(j));ne>ee&&(g.partial=!0,g.time.push({startPTS:ee,endPTS:ne}))}else if(I<=Z)break}return g}getPartialFragment(e){let t=null,n,l,g,T=0;const{bufferPadding:I,fragments:k}=this;return Object.keys(k).forEach(U=>{const j=k[U];j&&Jr(j)&&(l=j.body.start-I,g=j.body.end+I,e>=l&&e<=g&&(n=Math.min(e-l,g-e),T<=n&&(t=j.body,T=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||Jr(t))}getState(e){const t=gr(e),n=this.fragments[t];return n?n.buffered?Jr(n)?Gr.PARTIAL:Gr.OK:Gr.APPENDING:Gr.NOT_LOADED}isTimeBuffered(e,t,n){let l,g;for(let T=0;T<n.length;T++){if(l=n.start(T)-this.bufferPadding,g=n.end(T)+this.bufferPadding,e>=l&&t<=g)return!0;if(t<=l)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const n=t.frag,l=t.part?null:t,g=gr(n);this.fragments[g]={body:n,appendedPTS:null,loaded:l,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:l,timeRanges:g,type:T}=t;if(n.sn==="initSegment")return;const I=n.type;if(l){let U=this.activePartLists[I];U||(this.activePartLists[I]=U=[]),U.push(l)}this.timeRanges=g;const k=g[T];this.detectEvictedFragments(T,k,I,l)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=gr(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,n=Object.keys(t);if(!e)return n.length>0;for(let l=n.length;l--;){const g=t[n[l]];if((g==null?void 0:g.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,n,l,g){l&&!this.hasGaps||Object.keys(this.fragments).forEach(T=>{const I=this.fragments[T];if(!I)return;const k=I.body;k.type!==n||l&&!k.gap||k.start<t&&k.end>e&&(I.buffered||g)&&this.removeFragment(k)})}removeFragment(e){const t=gr(e);e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const l=e.sn;this.activePartLists[e.type]=Wt(n,g=>g.fragment.sn!==l)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const t=(e=this.hls)==null||(e=e.latestLevelDetails)==null?void 0:e.partList;t&&t.forEach(n=>n.clearElementaryStreamInfo())}}function Jr(b){var e,t,n;return b.buffered&&!!(b.body.gap||(e=b.range.video)!=null&&e.partial||(t=b.range.audio)!=null&&t.partial||(n=b.range.audiovideo)!=null&&n.partial)}function gr(b){return`${b.type}_${b.level}_${b.sn}`}function Wt(b,e){return b.filter(t=>{const n=e(t);return n||t.clearElementaryStreamInfo(),n})}var Mt={cbc:0,ctr:1};class rr{constructor(e,t,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=n}decrypt(e,t){switch(this.aesMode){case Mt.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case Mt.ctr:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,e);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}function tr(b){const e=b.byteLength,t=e&&new DataView(b.buffer).getUint8(e-1);return t?b.slice(0,e-t):b}class Tr{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 l=0;l<4;l++)n[l]=t.getUint32(l*4);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,l=n[0],g=n[1],T=n[2],I=n[3],k=this.invSubMix,U=k[0],j=k[1],Z=k[2],Q=k[3],ee=new Uint32Array(256);let ne=0,de=0,ce=0;for(ce=0;ce<256;ce++)ce<128?ee[ce]=ce<<1:ee[ce]=ce<<1^283;for(ce=0;ce<256;ce++){let Ee=de^de<<1^de<<2^de<<3^de<<4;Ee=Ee>>>8^Ee&255^99,e[ne]=Ee,t[Ee]=ne;const ke=ee[ne],Me=ee[ke],Ye=ee[Me];let lt=ee[Ee]*257^Ee*16843008;l[ne]=lt<<24|lt>>>8,g[ne]=lt<<16|lt>>>16,T[ne]=lt<<8|lt>>>24,I[ne]=lt,lt=Ye*16843009^Me*65537^ke*257^ne*16843008,U[Ee]=lt<<24|lt>>>8,j[Ee]=lt<<16|lt>>>16,Z[Ee]=lt<<8|lt>>>24,Q[Ee]=lt,ne?(ne=ke^ee[ee[ee[Ye^ke]]],de^=ee[ee[de]]):ne=de=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,l=0;for(;l<t.length&&n;)n=t[l]===this.key[l],l++;if(n)return;this.key=t;const g=this.keySize=t.length;if(g!==4&&g!==6&&g!==8)throw new Error("Invalid aes key size="+g);const T=this.ksRows=(g+6+1)*4;let I,k;const U=this.keySchedule=new Uint32Array(T),j=this.invKeySchedule=new Uint32Array(T),Z=this.sBox,Q=this.rcon,ee=this.invSubMix,ne=ee[0],de=ee[1],ce=ee[2],Ee=ee[3];let ke,Me;for(I=0;I<T;I++){if(I<g){ke=U[I]=t[I];continue}Me=ke,I%g===0?(Me=Me<<8|Me>>>24,Me=Z[Me>>>24]<<24|Z[Me>>>16&255]<<16|Z[Me>>>8&255]<<8|Z[Me&255],Me^=Q[I/g|0]<<24):g>6&&I%g===4&&(Me=Z[Me>>>24]<<24|Z[Me>>>16&255]<<16|Z[Me>>>8&255]<<8|Z[Me&255]),U[I]=ke=(U[I-g]^Me)>>>0}for(k=0;k<T;k++)I=T-k,k&3?Me=U[I]:Me=U[I-4],k<4||I<=4?j[k]=Me:j[k]=ne[Z[Me>>>24]]^de[Z[Me>>>16&255]]^ce[Z[Me>>>8&255]]^Ee[Z[Me&255]],j[k]=j[k]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,n){const l=this.keySize+6,g=this.invKeySchedule,T=this.invSBox,I=this.invSubMix,k=I[0],U=I[1],j=I[2],Z=I[3],Q=this.uint8ArrayToUint32Array_(n);let ee=Q[0],ne=Q[1],de=Q[2],ce=Q[3];const Ee=new Int32Array(e),ke=new Int32Array(Ee.length);let Me,Ye,lt,Ct,rt,vt,xt,at,Gt,dr,Lr,Ur,Rr,lr;const Ir=this.networkToHostOrderSwap;for(;t<Ee.length;){for(Gt=Ir(Ee[t]),dr=Ir(Ee[t+1]),Lr=Ir(Ee[t+2]),Ur=Ir(Ee[t+3]),rt=Gt^g[0],vt=Ur^g[1],xt=Lr^g[2],at=dr^g[3],Rr=4,lr=1;lr<l;lr++)Me=k[rt>>>24]^U[vt>>16&255]^j[xt>>8&255]^Z[at&255]^g[Rr],Ye=k[vt>>>24]^U[xt>>16&255]^j[at>>8&255]^Z[rt&255]^g[Rr+1],lt=k[xt>>>24]^U[at>>16&255]^j[rt>>8&255]^Z[vt&255]^g[Rr+2],Ct=k[at>>>24]^U[rt>>16&255]^j[vt>>8&255]^Z[xt&255]^g[Rr+3],rt=Me,vt=Ye,xt=lt,at=Ct,Rr=Rr+4;Me=T[rt>>>24]<<24^T[vt>>16&255]<<16^T[xt>>8&255]<<8^T[at&255]^g[Rr],Ye=T[vt>>>24]<<24^T[xt>>16&255]<<16^T[at>>8&255]<<8^T[rt&255]^g[Rr+1],lt=T[xt>>>24]<<24^T[at>>16&255]<<16^T[rt>>8&255]<<8^T[vt&255]^g[Rr+2],Ct=T[at>>>24]<<24^T[rt>>16&255]<<16^T[vt>>8&255]<<8^T[xt&255]^g[Rr+3],ke[t]=Ir(Me^ee),ke[t+1]=Ir(Ct^ne),ke[t+2]=Ir(lt^de),ke[t+3]=Ir(Ye^ce),ee=Gt,ne=dr,de=Lr,ce=Ur,t=t+4}return ke.buffer}}class Hr{constructor(e,t,n){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=n}expandKey(){const e=qr(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function qr(b){switch(b){case Mt.cbc:return"AES-CBC";case Mt.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${b}`)}}const Kr=16;class rn{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(n){}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const n=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?tr(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n,l){return this.useSoftware?new Promise((g,T)=>{const I=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(I,t,n,l);const k=this.flush();k?g(k.buffer):T(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,n,l)}softwareDecrypt(e,t,n,l){const{currentIV:g,currentResult:T,remainderData:I}=this;if(l!==Mt.cbc||t.byteLength!==16)return S.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),I&&(e=tt(I,e),this.remainderData=null);const k=this.getValidChunk(e);if(!k.length)return null;g&&(n=g);let U=this.softwareDecrypter;U||(U=this.softwareDecrypter=new Tr),U.expandKey(t);const j=T;return this.currentResult=U.decrypt(k.buffer,0,n),this.currentIV=k.slice(-16).buffer,j||null}webCryptoDecrypt(e,t,n,l){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n,l));this.key=t,this.fastAesKey=new Hr(this.subtle,t,l)}return this.fastAesKey.expandKey().then(g=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new rr(this.subtle,new Uint8Array(n),l).decrypt(e.buffer,g)):Promise.reject(new Error("web crypto not initialized"))).catch(g=>(S.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${g.name}: ${g.message}`),this.onWebCryptoError(e,t,n,l)))}onWebCryptoError(e,t,n,l){const g=this.enableSoftwareAES;if(g){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n,l);const T=this.flush();if(T)return T.buffer}throw new Error("WebCrypto"+(g?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%Kr;return n!==e.length&&(t=e.slice(0,n),this.remainderData=e.slice(n)),t}logOnce(e){this.logEnabled&&(S.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const En=Math.pow(2,17);class gn{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const n=e.url;if(!n)return Promise.reject(new _n({type:D.NETWORK_ERROR,details:W.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${n?"part list":"url"}`),networkDetails:null}));this.abort();const l=this.config,g=l.fLoader,T=l.loader;return new Promise((I,k)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(ne=>ne[0]==="GAP")){k($r(e));return}else e.gap=!1;const U=this.loader=g?new g(l):new T(l),j=bn(e);e.loader=U;const Z=vr(l.fragLoadPolicy.default),Q={loadPolicy:Z,timeout:Z.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:En};e.stats=U.stats;const ee={onSuccess:(ne,de,ce,Ee)=>{this.resetLoader(e,U);let ke=ne.data;ce.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(ke.slice(0,16)),ke=ke.slice(16)),I({frag:e,part:null,payload:ke,networkDetails:Ee})},onError:(ne,de,ce,Ee)=>{this.resetLoader(e,U),k(new _n({type:D.NETWORK_ERROR,details:W.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:i({url:n,data:void 0},ne),error:new Error(`HTTP Error ${ne.code} ${ne.text}`),networkDetails:ce,stats:Ee}))},onAbort:(ne,de,ce)=>{this.resetLoader(e,U),k(new _n({type:D.NETWORK_ERROR,details:W.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:ce,stats:ne}))},onTimeout:(ne,de,ce)=>{this.resetLoader(e,U),k(new _n({type:D.NETWORK_ERROR,details:W.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${Q.timeout}ms`),networkDetails:ce,stats:ne}))}};t&&(ee.onProgress=(ne,de,ce,Ee)=>t({frag:e,part:null,payload:ce,networkDetails:Ee})),U.load(j,Q,ee)})}loadPart(e,t,n){this.abort();const l=this.config,g=l.fLoader,T=l.loader;return new Promise((I,k)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){k($r(e,t));return}const U=this.loader=g?new g(l):new T(l),j=bn(e,t);e.loader=U;const Z=vr(l.fragLoadPolicy.default),Q={loadPolicy:Z,timeout:Z.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:En};t.stats=U.stats,U.load(j,Q,{onSuccess:(ee,ne,de,ce)=>{this.resetLoader(e,U),this.updateStatsFromPart(e,t);const Ee={frag:e,part:t,payload:ee.data,networkDetails:ce};n(Ee),I(Ee)},onError:(ee,ne,de,ce)=>{this.resetLoader(e,U),k(new _n({type:D.NETWORK_ERROR,details:W.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:i({url:j.url,data:void 0},ee),error:new Error(`HTTP Error ${ee.code} ${ee.text}`),networkDetails:de,stats:ce}))},onAbort:(ee,ne,de)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,U),k(new _n({type:D.NETWORK_ERROR,details:W.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:de,stats:ee}))},onTimeout:(ee,ne,de)=>{this.resetLoader(e,U),k(new _n({type:D.NETWORK_ERROR,details:W.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${Q.timeout}ms`),networkDetails:de,stats:ee}))}})})}updateStatsFromPart(e,t){const n=e.stats,l=t.stats,g=l.total;if(n.loaded+=l.loaded,g){const k=Math.round(e.duration/t.duration),U=Math.min(Math.round(n.loaded/g),k),Z=(k-U)*Math.round(n.loaded/U);n.total=n.loaded+Z}else n.total=Math.max(n.loaded,n.total);const T=n.loading,I=l.loading;T.start?T.first+=I.first-I.start:(T.start=I.start,T.first=I.first),T.end=I.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function bn(b,e=null){const t=e||b,n={frag:b,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},l=t.byteRangeStartOffset,g=t.byteRangeEndOffset;if(te(l)&&te(g)){var T;let I=l,k=g;if(b.sn==="initSegment"&&Sn((T=b.decryptdata)==null?void 0:T.method)){const U=g-l;U%16&&(k=g+(16-U%16)),l!==0&&(n.resetIV=!0,I=l-16)}n.rangeStart=I,n.rangeEnd=k}return n}function $r(b,e){const t=new Error(`GAP ${b.gap?"tag":"attribute"} found`),n={type:D.MEDIA_ERROR,details:W.FRAG_GAP,fatal:!1,frag:b,error:t,networkDetails:null};return e&&(n.part=e),(e||b).stats.aborted=!0,new _n(n)}function Sn(b){return b==="AES-128"||b==="AES-256"}class _n extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Ln extends m{constructor(e,t){super(e,t),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class ln{constructor(e,t,n,l=0,g=-1,T=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=cn(),this.buffering={audio:cn(),video:cn(),audiovideo:cn()},this.level=e,this.sn=t,this.id=n,this.size=l,this.part=g,this.partial=T}}function cn(){return{start:0,executeStart:0,executeEnd:0,end:0}}const fn={length:0,start:()=>0,end:()=>0};class Dr{static isBuffered(e,t){if(e){const n=Dr.getBuffered(e);for(let l=n.length;l--;)if(t>=n.start(l)&&t<=n.end(l))return!0}return!1}static bufferedRanges(e){if(e){const t=Dr.getBuffered(e);return Dr.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}static bufferInfo(e,t,n){if(e){const l=Dr.bufferedRanges(e);if(l.length)return Dr.bufferedInfo(l,t,n)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.length>1&&e.sort((j,Z)=>j.start-Z.start||Z.end-j.end);let l=-1,g=[];if(n)for(let j=0;j<e.length;j++){t>=e[j].start&&t<=e[j].end&&(l=j);const Z=g.length;if(Z){const Q=g[Z-1].end;e[j].start-Q<n?e[j].end>Q&&(g[Z-1].end=e[j].end):g.push(e[j])}else g.push(e[j])}else g=e;let T=0,I,k=t,U=t;for(let j=0;j<g.length;j++){const Z=g[j].start,Q=g[j].end;if(l===-1&&t>=Z&&t<=Q&&(l=j),t+n>=Z&&t<Q)k=Z,U=Q,T=U-t;else if(t+n<Z){I=Z;break}}return{len:T,start:k||0,end:U||0,nextStart:I,buffered:e,bufferedIndex:l}}static getBuffered(e){try{return e.buffered||fn}catch(t){return S.log("failed to get media.buffered",t),fn}}}const kn=/\{\$([a-zA-Z0-9-_]+)\}/g;function Bn(b){return kn.test(b)}function wn(b,e){if(b.variableList!==null||b.hasVariableRefs){const t=b.variableList;return e.replace(kn,n=>{const l=n.substring(2,n.length-1),g=t==null?void 0:t[l];return g===void 0?(b.playlistParsingError||(b.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${l}"`)),n):g})}return e}function Rn(b,e,t){let n=b.variableList;n||(b.variableList=n={});let l,g;if("QUERYPARAM"in e){l=e.QUERYPARAM;try{const T=new self.URL(t).searchParams;if(T.has(l))g=T.get(l);else throw new Error(`"${l}" does not match any query parameter in URI: "${t}"`)}catch(T){b.playlistParsingError||(b.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${T.message}`))}}else l=e.NAME,g=e.VALUE;l in n?b.playlistParsingError||(b.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${l}"`)):n[l]=g||""}function Yn(b,e,t){const n=e.IMPORT;if(t&&n in t){let l=b.variableList;l||(b.variableList=l={}),l[n]=t[n]}else b.playlistParsingError||(b.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}const Un=/^(\d+)x(\d+)$/,zn=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Vr{constructor(e,t){typeof e=="string"&&(e=Vr.parseAttrList(e,t)),u(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const n=new Uint8Array(t.length/2);for(let l=0;l<t.length/2;l++)n[l]=parseInt(t.slice(l*2,l*2+2),16);return n}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const n=this[e];return(n?n.split(/[ ,]+/):[]).reduce((l,g)=>(l[g.toLowerCase()]=!0,l),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=Un.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let n;const l={},g='"';for(zn.lastIndex=0;(n=zn.exec(e))!==null;){const T=n[1].trim();let I=n[2];const k=I.indexOf(g)===0&&I.lastIndexOf(g)===I.length-1;let U=!1;if(k)I=I.slice(1,-1);else switch(T){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":U=!0}if(t&&(k||U))I=wn(t,I);else if(!U&&!k)switch(T){case"CLOSED-CAPTIONS":if(I==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":S.warn(`${e}: attribute ${T} is missing quotes`)}l[T]=I}return l}}const ci="com.apple.hls.interstitial";function oi(b){return b!=="ID"&&b!=="CLASS"&&b!=="CUE"&&b!=="START-DATE"&&b!=="DURATION"&&b!=="END-DATE"&&b!=="END-ON-NEXT"}function $n(b){return b==="SCTE35-OUT"||b==="SCTE35-IN"||b==="SCTE35-CMD"}class ri{constructor(e,t,n=0){var l;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(t==null?void 0:t.tagAnchor)||null,this.tagOrder=(l=t==null?void 0:t.tagOrder)!=null?l:n,t){const g=t.attr;for(const T in g)if(Object.prototype.hasOwnProperty.call(e,T)&&e[T]!==g[T]){S.warn(`DATERANGE tag attribute: "${T}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=T;break}e=u(new Vr({}),g,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const g=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);te(g.getTime())&&(this._endDate=g)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return e===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}get startTime(){const{tagAnchor:e}=this;return e===null||e.programDateTime===null?(S.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const e=this._endDate||this._dateAtEnd;if(e)return e;const t=this.duration;return t!==null?this._dateAtEnd=new Date(this._startDate.getTime()+t*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(te(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return this.class===ci}get isValid(){return!!this.id&&!this._badValueForSameId&&te(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}const Qn=10;class jn{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}hasKey(e){return this.encryptedFragments.some(t=>{let n=t.decryptdata;return n||(t.setKeyFormat(e.keyFormat),n=t.decryptdata),!!n&&e.matches(n)})}get hasProgramDateTime(){return this.fragments.length?te(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Qn}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(t!==-1){for(let n=e.length;n--;)if(e[n].index>t)return e[n].index;return t}}return 0}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function Tn(b,e){return b.length===e.length?!b.some((t,n)=>t!==e[n]):!1}function Mn(b,e){return!b&&!e?!0:!b||!e?!1:Tn(b,e)}function On(b){return b==="AES-128"||b==="AES-256"||b==="AES-256-CTR"}function tn(b){switch(b){case"AES-128":case"AES-256":return Mt.cbc;case"AES-256-CTR":return Mt.ctr;default:throw new Error(`invalid full segment method ${b}`)}}function mn(b){return Uint8Array.from(atob(b),e=>e.charCodeAt(0))}function An(b){return Uint8Array.from(unescape(encodeURIComponent(b)),e=>e.charCodeAt(0))}function xr(b){const e=An(b).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function kr(b){const e=function(n,l,g){const T=n[l];n[l]=n[g],n[g]=T};e(b,0,3),e(b,1,2),e(b,4,5),e(b,6,7)}function Or(b){const e=b.split(":");let t=null;if(e[0]==="data"&&e.length===2){const n=e[1].split(";"),l=n[n.length-1].split(",");if(l.length===2){const g=l[0]==="base64",T=l[1];g?(n.splice(-1,1),t=mn(T)):t=xr(T)}}return t}const Nr=typeof self!="undefined"?self:void 0;var Br={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Yr={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Wn(b){switch(b){case Yr.FAIRPLAY:return Br.FAIRPLAY;case Yr.PLAYREADY:return Br.PLAYREADY;case Yr.WIDEVINE:return Br.WIDEVINE;case Yr.CLEARKEY:return Br.CLEARKEY}}function or(b){switch(b){case Br.FAIRPLAY:return Yr.FAIRPLAY;case Br.PLAYREADY:return Yr.PLAYREADY;case Br.WIDEVINE:return Yr.WIDEVINE;case Br.CLEARKEY:return Yr.CLEARKEY}}function Ar(b){const{drmSystems:e,widevineLicenseUrl:t}=b,n=e?[Br.FAIRPLAY,Br.WIDEVINE,Br.PLAYREADY,Br.CLEARKEY].filter(l=>!!e[l]):[];return!n[Br.WIDEVINE]&&t&&n.push(Br.WIDEVINE),n}const jr=function(b){return Nr!=null&&(b=Nr.navigator)!=null&&b.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function pn(b,e,t,n){let l;switch(b){case Br.FAIRPLAY:l=["cenc","sinf"];break;case Br.WIDEVINE:case Br.PLAYREADY:l=["cenc"];break;case Br.CLEARKEY:l=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${b}`)}return dn(l,e,t,n)}function dn(b,e,t,n){return[{initDataTypes:b,persistentState:n.persistentState||"optional",distinctiveIdentifier:n.distinctiveIdentifier||"optional",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:e.map(g=>({contentType:`audio/mp4; codecs=${g}`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:t.map(g=>({contentType:`video/mp4; codecs=${g}`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}function hi(b){var e;return!!b&&(b.sessionType==="persistent-license"||!!((e=b.sessionTypes)!=null&&e.some(t=>t==="persistent-license")))}function Zn(b){const e=new Uint16Array(b.buffer,b.byteOffset,b.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),n=t.substring(t.indexOf("<"),t.length),T=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(T){const I=T.childNodes[0]?T.childNodes[0].nodeValue:T.getAttribute("VALUE");if(I){const k=mn(I).subarray(0,16);return kr(k),k}}return null}let ni={};class Fn{static clearKeyUriToKeyIdMap(){ni={}}constructor(e,t,n,l=[1],g=null,T){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=l,this.iv=g,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!On(e),T!=null&&T.startsWith("0x")&&(this.keyId=new Uint8Array(P(T)))}matches(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&Tn(e.keyFormatVersions,this.keyFormatVersions)&&Mn(e.iv,this.iv)&&Mn(e.keyId,this.keyId)}isSupported(){if(this.method){if(On(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case Yr.FAIRPLAY:case Yr.WIDEVINE:case Yr.PLAYREADY:case Yr.CLEARKEY:return["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(On(this.method)&&this.uri&&!this.iv){typeof e!="number"&&(S.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const n=ki(e);return new Fn(this.method,this.uri,"identity",this.keyFormatVersions,n)}if(this.pssh&&this.keyId)return this;const t=Or(this.uri);if(t)switch(this.keyFormat){case Yr.WIDEVINE:if(this.pssh=t,!this.keyId&&t.length>=22){const n=t.length-22;this.keyId=t.subarray(n,n+16)}break;case Yr.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=ur(n,null,t),this.keyId=Zn(t);break}default:{let n=t.subarray(0,16);if(n.length!==16){const l=new Uint8Array(16);l.set(n,16-n.length),n=l}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){let n=ni[this.uri];if(!n){const l=Object.keys(ni).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,l),ni[this.uri]=n}this.keyId=n}return this}}function ki(b){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=b>>8*(15-t)&255;return e}const ia=/#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,aa=/#EXT-X-MEDIA:(.*)/g,Di=/^#EXT(?:INF|-X-TARGETDURATION):/m,Wi=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),Ki=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class li{static findGroup(e,t){for(let n=0;n<e.length;n++){const l=e[n];if(l.id===t)return l}}static resolve(e,t){return C.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return Di.test(e)}static parseMasterPlaylist(e,t){const n=Bn(e),l={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},g=[];ia.lastIndex=0;let T;for(;(T=ia.exec(e))!=null;)if(T[1]){var I;const U=new Vr(T[1],l),j=wn(l,T[2]),Z={attrs:U,bitrate:U.decimalInteger("BANDWIDTH")||U.decimalInteger("AVERAGE-BANDWIDTH"),name:U.NAME,url:li.resolve(j,t)},Q=U.decimalResolution("RESOLUTION");Q&&(Z.width=Q.width,Z.height=Q.height),Qi(U.CODECS,Z);const ee=U["SUPPLEMENTAL-CODECS"];ee&&(Z.supplemental={},Qi(ee,Z.supplemental)),(I=Z.unknownCodecs)!=null&&I.length||g.push(Z),l.levels.push(Z)}else if(T[3]){const U=T[3],j=T[4];switch(U){case"SESSION-DATA":{const Z=new Vr(j,l),Q=Z["DATA-ID"];Q&&(l.sessionData===null&&(l.sessionData={}),l.sessionData[Q]=Z);break}case"SESSION-KEY":{const Z=Vi(j,t,l);Z.encrypted&&Z.isSupported()?(l.sessionKeys===null&&(l.sessionKeys=[]),l.sessionKeys.push(Z)):S.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${j}"`);break}case"DEFINE":{{const Z=new Vr(j,l);Rn(l,Z,t)}break}case"CONTENT-STEERING":{const Z=new Vr(j,l);l.contentSteering={uri:li.resolve(Z["SERVER-URI"],t),pathwayId:Z["PATHWAY-ID"]||"."};break}case"START":{l.startTimeOffset=$i(j);break}}}const k=g.length>0&&g.length<l.levels.length;return l.levels=k?g:l.levels,l.levels.length===0&&(l.playlistParsingError=new Error("no levels found in manifest")),l}static parseMasterPlaylistMedia(e,t,n){let l;const g={},T=n.levels,I={AUDIO:T.map(U=>({id:U.attrs.AUDIO,audioCodec:U.audioCodec})),SUBTITLES:T.map(U=>({id:U.attrs.SUBTITLES,textCodec:U.textCodec})),"CLOSED-CAPTIONS":[]};let k=0;for(aa.lastIndex=0;(l=aa.exec(e))!==null;){const U=new Vr(l[1],n),j=U.TYPE;if(j){const Z=I[j],Q=g[j]||[];g[j]=Q;const ee=U.LANGUAGE,ne=U["ASSOC-LANGUAGE"],de=U.CHANNELS,ce=U.CHARACTERISTICS,Ee=U["INSTREAM-ID"],ke={attrs:U,bitrate:0,id:k++,groupId:U["GROUP-ID"]||"",name:U.NAME||ee||"",type:j,default:U.bool("DEFAULT"),autoselect:U.bool("AUTOSELECT"),forced:U.bool("FORCED"),lang:ee,url:U.URI?li.resolve(U.URI,t):""};if(ne&&(ke.assocLang=ne),de&&(ke.channels=de),ce&&(ke.characteristics=ce),Ee&&(ke.instreamId=Ee),Z!=null&&Z.length){const Me=li.findGroup(Z,ke.groupId)||Z[0];Hi(ke,Me,"audioCodec"),Hi(ke,Me,"textCodec")}Q.push(ke)}}return g}static parseLevelPlaylist(e,t,n,l,g,T){var I;const k={url:t},U=new jn(t),j=U.fragments,Z=[];let Q=null,ee=0,ne=0,de=0,ce=0,Ee=0,ke=null,Me=new se(l,k),Ye,lt,Ct,rt=-1,vt=!1,xt=null,at;if(Wi.lastIndex=0,U.m3u8=e,U.hasVariableRefs=Bn(e),((I=Wi.exec(e))==null?void 0:I[0])!=="#EXTM3U")return U.playlistParsingError=new Error("Missing format identifier #EXTM3U"),U;for(;(Ye=Wi.exec(e))!==null;){vt&&(vt=!1,Me=new se(l,k),Me.playlistOffset=de,Me.setStart(de),Me.sn=ee,Me.cc=ce,Ee&&(Me.bitrate=Ee),Me.level=n,Q&&(Me.initSegment=Q,Q.rawProgramDateTime&&(Me.rawProgramDateTime=Q.rawProgramDateTime,Q.rawProgramDateTime=null),xt&&(Me.setByteRange(xt),xt=null)));const Ur=Ye[1];if(Ur){Me.duration=parseFloat(Ur);const Rr=(" "+Ye[2]).slice(1);Me.title=Rr||null,Me.tagList.push(Rr?["INF",Ur,Rr]:["INF",Ur])}else if(Ye[3]){if(te(Me.duration)){Me.playlistOffset=de,Me.setStart(de),Ct&&oa(Me,Ct,U),Me.sn=ee,Me.level=n,Me.cc=ce,j.push(Me);const Rr=(" "+Ye[3]).slice(1);Me.relurl=wn(U,Rr),Pi(Me,ke,Z),ke=Me,de+=Me.duration,ee++,ne=0,vt=!0}}else{if(Ye=Ye[0].match(Ki),!Ye){S.warn("No matches on slow regex match for level playlist!");continue}for(lt=1;lt<Ye.length&&Ye[lt]===void 0;lt++);const Rr=(" "+Ye[lt]).slice(1),lr=(" "+Ye[lt+1]).slice(1),Ir=Ye[lt+2]?(" "+Ye[lt+2]).slice(1):null;switch(Rr){case"BYTERANGE":ke?Me.setByteRange(lr,ke):Me.setByteRange(lr);break;case"PROGRAM-DATE-TIME":Me.rawProgramDateTime=lr,Me.tagList.push(["PROGRAM-DATE-TIME",lr]),rt===-1&&(rt=j.length);break;case"PLAYLIST-TYPE":U.type&&fi(U,Rr,Ye),U.type=lr.toUpperCase();break;case"MEDIA-SEQUENCE":U.startSN!==0?fi(U,Rr,Ye):j.length>0&&la(U,Rr,Ye),ee=U.startSN=parseInt(lr);break;case"SKIP":{U.skippedSegments&&fi(U,Rr,Ye);const yr=new Vr(lr,U),Pr=yr.decimalInteger("SKIPPED-SEGMENTS");if(te(Pr)){U.skippedSegments+=Pr;for(let hr=Pr;hr--;)j.push(null);ee+=Pr}const Zr=yr.enumeratedString("RECENTLY-REMOVED-DATERANGES");Zr&&(U.recentlyRemovedDateranges=(U.recentlyRemovedDateranges||[]).concat(Zr.split(" ")));break}case"TARGETDURATION":U.targetduration!==0&&fi(U,Rr,Ye),U.targetduration=Math.max(parseInt(lr),1);break;case"VERSION":U.version!==null&&fi(U,Rr,Ye),U.version=parseInt(lr);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":U.live||fi(U,Rr,Ye),U.live=!1;break;case"#":(lr||Ir)&&Me.tagList.push(Ir?[lr,Ir]:[lr]);break;case"DISCONTINUITY":ce++,Me.tagList.push(["DIS"]);break;case"GAP":Me.gap=!0,Me.tagList.push([Rr]);break;case"BITRATE":Me.tagList.push([Rr,lr]),Ee=parseInt(lr)*1e3,te(Ee)?Me.bitrate=Ee:Ee=0;break;case"DATERANGE":{const yr=new Vr(lr,U),Pr=new ri(yr,U.dateRanges[yr.ID],U.dateRangeTagCount);U.dateRangeTagCount++,Pr.isValid||U.skippedSegments?U.dateRanges[Pr.id]=Pr:S.warn(`Ignoring invalid DATERANGE tag: "${lr}"`),Me.tagList.push(["EXT-X-DATERANGE",lr]);break}case"DEFINE":{{const yr=new Vr(lr,U);"IMPORT"in yr?Yn(U,yr,T):Rn(U,yr,t)}break}case"DISCONTINUITY-SEQUENCE":U.startCC!==0?fi(U,Rr,Ye):j.length>0&&la(U,Rr,Ye),U.startCC=ce=parseInt(lr);break;case"KEY":{const yr=Vi(lr,t,U);if(yr.isSupported()){if(yr.method==="NONE"){Ct=void 0;break}Ct||(Ct={});const Pr=Ct[yr.keyFormat];Pr!=null&&Pr.matches(yr)||(Pr&&(Ct=u({},Ct)),Ct[yr.keyFormat]=yr)}else S.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${lr}"`);break}case"START":U.startTimeOffset=$i(lr);break;case"MAP":{const yr=new Vr(lr,U);if(Me.duration){const Pr=new se(l,k);sa(Pr,yr,n,Ct),Q=Pr,Me.initSegment=Q,Q.rawProgramDateTime&&!Me.rawProgramDateTime&&(Me.rawProgramDateTime=Q.rawProgramDateTime)}else{const Pr=Me.byteRangeEndOffset;if(Pr){const Zr=Me.byteRangeStartOffset;xt=`${Pr-Zr}@${Zr}`}else xt=null;sa(Me,yr,n,Ct),Q=Me,vt=!0}Q.cc=ce;break}case"SERVER-CONTROL":{at&&fi(U,Rr,Ye),at=new Vr(lr),U.canBlockReload=at.bool("CAN-BLOCK-RELOAD"),U.canSkipUntil=at.optionalFloat("CAN-SKIP-UNTIL",0),U.canSkipDateRanges=U.canSkipUntil>0&&at.bool("CAN-SKIP-DATERANGES"),U.partHoldBack=at.optionalFloat("PART-HOLD-BACK",0),U.holdBack=at.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{U.partTarget&&fi(U,Rr,Ye);const yr=new Vr(lr);U.partTarget=yr.decimalFloatingPoint("PART-TARGET");break}case"PART":{let yr=U.partList;yr||(yr=U.partList=[]);const Pr=ne>0?yr[yr.length-1]:void 0,Zr=ne++,hr=new Vr(lr,U),fr=new ue(hr,Me,k,Zr,Pr);yr.push(fr),Me.duration+=fr.duration;break}case"PRELOAD-HINT":{const yr=new Vr(lr,U);U.preloadHint=yr;break}case"RENDITION-REPORT":{const yr=new Vr(lr,U);U.renditionReports=U.renditionReports||[],U.renditionReports.push(yr);break}default:S.warn(`line parsed but not handled: ${Ye}`);break}}}ke&&!ke.relurl?(j.pop(),de-=ke.duration,U.partList&&(U.fragmentHint=ke)):U.partList&&(Pi(Me,ke,Z),Me.cc=ce,U.fragmentHint=Me,Ct&&oa(Me,Ct,U)),U.targetduration||(U.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const Gt=j.length,dr=j[0],Lr=j[Gt-1];if(de+=U.skippedSegments*U.targetduration,de>0&&Gt&&Lr){U.averagetargetduration=de/Gt;const Ur=Lr.sn;U.endSN=Ur!=="initSegment"?Ur:0,U.live||(Lr.endList=!0),rt>0&&(va(j,rt),dr&&Z.unshift(dr))}return U.fragmentHint&&(de+=U.fragmentHint.duration),U.totalduration=de,Z.length&&U.dateRangeTagCount&&dr&&Gi(Z,U),U.endCC=ce,U}}function Gi(b,e){let t=b.length;if(!t)if(e.hasProgramDateTime){const I=e.fragments[e.fragments.length-1];b.push(I),t++}else return;const n=b[t-1],l=e.live?1/0:e.totalduration,g=Object.keys(e.dateRanges);for(let I=g.length;I--;){const k=e.dateRanges[g[I]],U=k.startDate.getTime();k.tagAnchor=n.ref;for(let j=t;j--;){var T;if(((T=b[j])==null?void 0:T.sn)<e.startSN)break;const Z=xi(e,U,b,j,l);if(Z!==-1){k.tagAnchor=e.fragments[Z].ref;break}}}}function xi(b,e,t,n,l){const g=t[n];if(g){const I=g.programDateTime;if(e>=I||n===0){var T;const k=(((T=t[n+1])==null?void 0:T.start)||l)-g.start;if(e<=I+k*1e3){const U=t[n].sn-b.startSN;if(U<0)return-1;const j=b.fragments;if(j.length>t.length){const Q=(t[n+1]||j[j.length-1]).sn-b.startSN;for(let ee=Q;ee>U;ee--){const ne=j[ee].programDateTime;if(e>=ne&&e<ne+j[ee].duration*1e3)return ee}}return U}}}return-1}function Vi(b,e,t){var n,l;const g=new Vr(b,t),T=(n=g.METHOD)!=null?n:"",I=g.URI,k=g.hexadecimalInteger("IV"),U=g.KEYFORMATVERSIONS,j=(l=g.KEYFORMAT)!=null?l:"identity";I&&g.IV&&!k&&S.error(`Invalid IV: ${g.IV}`);const Z=I?li.resolve(I,e):"",Q=(U||"1").split("/").map(Number).filter(Number.isFinite);return new Fn(T,Z,j,Q,k,g.KEYID)}function $i(b){const t=new Vr(b).decimalFloatingPoint("TIME-OFFSET");return te(t)?t:null}function Qi(b,e){let t=(b||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const l=t.filter(g=>Fr(g,n));l.length&&(e[`${n}Codec`]=l.map(g=>g.split("/")[0]).join(","),t=t.filter(g=>l.indexOf(g)===-1))}),e.unknownCodecs=t}function Hi(b,e,t){const n=e[t];n&&(b[t]=n)}function va(b,e){let t=b[e];for(let n=e;n--;){const l=b[n];if(!l)return;l.programDateTime=t.programDateTime-l.duration*1e3,t=l}}function Pi(b,e,t){b.rawProgramDateTime?t.push(b):e!=null&&e.programDateTime&&(b.programDateTime=e.endProgramDateTime)}function sa(b,e,t,n){b.relurl=e.URI,e.BYTERANGE&&b.setByteRange(e.BYTERANGE),b.level=t,b.sn="initSegment",n&&(b.levelkeys=n),b.initSegment=null}function oa(b,e,t){b.levelkeys=e;const{encryptedFragments:n}=t;(!n.length||n[n.length-1].levelkeys!==e)&&Object.keys(e).some(l=>e[l].isCommonEncryption)&&n.push(b)}function fi(b,e,t){b.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function la(b,e,t){b.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function Mi(b,e){const t=e.startPTS;if(te(t)){let n=0,l;e.sn>b.sn?(n=t-b.start,l=b):(n=b.start-t,l=e),l.duration!==n&&l.setDuration(n)}else e.sn>b.sn?b.cc===e.cc&&b.minEndPTS?e.setStart(b.start+(b.minEndPTS-b.start)):e.setStart(b.start+b.duration):e.setStart(Math.max(b.start-e.duration,0))}function _i(b,e,t,n,l,g,T){n-t<=0&&(T.warn("Fragment should have a positive duration",e),n=t+e.duration,g=l+e.duration);let k=t,U=n;const j=e.startPTS,Z=e.endPTS;if(te(j)){const Ee=Math.abs(j-t);b&&Ee>b.totalduration?T.warn(`media timestamps and playlist times differ by ${Ee}s for level ${e.level} ${b.url}`):te(e.deltaPTS)?e.deltaPTS=Math.max(Ee,e.deltaPTS):e.deltaPTS=Ee,k=Math.max(t,j),t=Math.min(t,j),l=e.startDTS!==void 0?Math.min(l,e.startDTS):l,U=Math.min(n,Z),n=Math.max(n,Z),g=e.endDTS!==void 0?Math.max(g,e.endDTS):g}const Q=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(n-e.start),e.startPTS=t,e.maxStartPTS=k,e.startDTS=l,e.endPTS=n,e.minEndPTS=U,e.endDTS=g;const ee=e.sn;if(!b||ee<b.startSN||ee>b.endSN)return 0;let ne;const de=ee-b.startSN,ce=b.fragments;for(ce[de]=e,ne=de;ne>0;ne--)Mi(ce[ne],ce[ne-1]);for(ne=de;ne<ce.length-1;ne++)Mi(ce[ne],ce[ne+1]);return b.fragmentHint&&Mi(ce[ce.length-1],b.fragmentHint),b.PTSKnown=b.alignedSliding=!0,Q}function nn(b,e,t){if(b===e)return;let n=null;const l=b.fragments;for(let j=l.length-1;j>=0;j--){const Z=l[j].initSegment;if(Z){n=Z;break}}b.fragmentHint&&delete b.fragmentHint.endPTS;let g;Vn(b,e,(j,Z,Q,ee)=>{if((!e.startCC||e.skippedSegments)&&Z.cc!==j.cc){const ne=j.cc-Z.cc;for(let de=Q;de<ee.length;de++)ee[de].cc+=ne;e.endCC=ee[ee.length-1].cc}te(j.startPTS)&&te(j.endPTS)&&(Z.setStart(Z.startPTS=j.startPTS),Z.startDTS=j.startDTS,Z.maxStartPTS=j.maxStartPTS,Z.endPTS=j.endPTS,Z.endDTS=j.endDTS,Z.minEndPTS=j.minEndPTS,Z.setDuration(j.endPTS-j.startPTS),Z.duration&&(g=Z),e.PTSKnown=e.alignedSliding=!0),j.hasStreams&&(Z.elementaryStreams=j.elementaryStreams),Z.loader=j.loader,j.hasStats&&(Z.stats=j.stats),j.initSegment&&(Z.initSegment=j.initSegment,n=j.initSegment)});const T=e.fragments,I=e.fragmentHint?T.concat(e.fragmentHint):T;if(n&&I.forEach(j=>{var Z;j&&(!j.initSegment||j.initSegment.relurl===((Z=n)==null?void 0:Z.relurl))&&(j.initSegment=n)}),e.skippedSegments){if(e.deltaUpdateFailed=T.some(j=>!j),e.deltaUpdateFailed){t.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let j=e.skippedSegments;j--;)T.shift();e.startSN=T[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=en(b.dateRanges,e,t));const j=b.fragments.filter(Z=>Z.rawProgramDateTime);if(b.hasProgramDateTime&&!e.hasProgramDateTime)for(let Z=1;Z<I.length;Z++)I[Z].programDateTime===null&&Pi(I[Z],I[Z-1],j);Gi(j,e)}e.endCC=T[T.length-1].cc}if(!e.startCC){var k;const j=mi(b,e.startSN-1);e.startCC=(k=j==null?void 0:j.cc)!=null?k:T[0].cc}Gn(b.partList,e.partList,(j,Z)=>{Z.elementaryStreams=j.elementaryStreams,Z.stats=j.stats}),g?_i(e,g,g.startPTS,g.endPTS,g.startDTS,g.endDTS,t):In(b,e),T.length&&(e.totalduration=e.edge-T[0].start),e.driftStartTime=b.driftStartTime,e.driftStart=b.driftStart;const U=e.advancedDateTime;if(e.advanced&&U){const j=e.edge;e.driftStart||(e.driftStartTime=U,e.driftStart=j),e.driftEndTime=U,e.driftEnd=j}else e.driftEndTime=b.driftEndTime,e.driftEnd=b.driftEnd,e.advancedDateTime=b.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=b.requestScheduled)}function en(b,e,t){const{dateRanges:n,recentlyRemovedDateranges:l}=e,g=u({},b);l&&l.forEach(k=>{delete g[k]});const I=Object.keys(g).length;return I?(Object.keys(n).forEach(k=>{const U=g[k],j=new ri(n[k].attr,U);j.isValid?(g[k]=j,U||(j.tagOrder+=I)):t.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${ot(n[k].attr)}"`)}),g):n}function Gn(b,e,t){if(b&&e){let n=0;for(let l=0,g=b.length;l<=g;l++){const T=b[l],I=e[l+n];T&&I&&T.index===I.index&&T.fragment.sn===I.fragment.sn?t(T,I):n--}}}function Vn(b,e,t){const n=e.skippedSegments,l=Math.max(b.startSN,e.startSN)-e.startSN,g=(b.fragmentHint?1:0)+(n?e.endSN:Math.min(b.endSN,e.endSN))-e.startSN,T=e.startSN-b.startSN,I=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,k=b.fragmentHint?b.fragments.concat(b.fragmentHint):b.fragments;for(let U=l;U<=g;U++){const j=k[T+U];let Z=I[U];if(n&&!Z&&j&&(Z=e.fragments[U]=j),j&&Z){t(j,Z,U,I);const Q=j.relurl,ee=Z.relurl;if(Q&&zi(Q,ee)){e.playlistParsingError=Cn(`media sequence mismatch ${Z.sn}:`,b,e,j,Z);return}else if(j.cc!==Z.cc){e.playlistParsingError=Cn(`discontinuity sequence mismatch (${j.cc}!=${Z.cc})`,b,e,j,Z);return}}}}function Cn(b,e,t,n,l){return new Error(`${b} ${l.url}
|
|
Playlist starting @${e.startSN}
|
|
${e.m3u8}
|
|
|
|
Playlist starting @${t.startSN}
|
|
${t.m3u8}`)}function In(b,e,t=!0){const n=e.startSN+e.skippedSegments-b.startSN,l=b.fragments,g=n>=0;let T=0;if(g&&n<l.length)T=l[n].start;else if(g&&e.startSN===b.endSN+1)T=b.fragmentEnd;else if(g&&t)T=b.fragmentStart+n*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)T=b.fragmentStart;else return;ii(e,T)}function ii(b,e){if(e){const t=b.fragments;for(let n=b.skippedSegments;n<t.length;n++)t[n].addStart(e);b.fragmentHint&&b.fragmentHint.addStart(e)}}function ai(b,e=1/0){let t=1e3*b.targetduration;if(b.updated){const n=b.fragments;if(n.length&&t*4>e){const g=n[n.length-1].duration*1e3;g<t&&(t=g)}}else t/=2;return Math.round(t)}function mi(b,e,t){if(!b)return null;let n=b.fragments[e-b.startSN];return n||(n=b.fragmentHint,n&&n.sn===e)?n:e<b.startSN&&t&&t.sn===e?t:null}function pi(b,e,t){return b?gi(b.partList,e,t):null}function gi(b,e,t){if(b)for(let n=b.length;n--;){const l=b[n];if(l.index===t&&l.fragment.sn===e)return l}return null}function Oi(b){b.forEach((e,t)=>{var n;(n=e.details)==null||n.fragments.forEach(l=>{l.level=t,l.initSegment&&(l.initSegment.level=t)})})}function zi(b,e){return b!==e&&e?Ra(b)!==Ra(e):!1}function Ra(b){return b.replace(/\?[^?]*$/,"")}function Ji(b,e){for(let n=0,l=b.length;n<l;n++){var t;if(((t=b[n])==null?void 0:t.cc)===e)return b[n]}return null}function Pn(b,e){return!!(b&&e.startCC<b.endCC&&e.endCC>b.startCC)}function yn(b,e){const t=b.start+e;b.startPTS=t,b.setStart(t),b.endPTS=t+b.duration}function Dn(b,e){const t=e.fragments;for(let n=0,l=t.length;n<l;n++)yn(t[n],b);e.fragmentHint&&yn(e.fragmentHint,b),e.alignedSliding=!0}function si(b,e){b&&(Jn(e,b),e.alignedSliding||Ni(e,b),!e.alignedSliding&&!e.skippedSegments&&In(b,e,!1))}function Jn(b,e){if(!Pn(e,b))return;const t=Math.min(e.endCC,b.endCC),n=Ji(e.fragments,t),l=Ji(b.fragments,t);if(!n||!l)return;S.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const g=n.start-l.start;Dn(g,b)}function Ni(b,e){if(!b.hasProgramDateTime||!e.hasProgramDateTime)return;const t=b.fragments,n=e.fragments;if(!t.length||!n.length)return;let l,g;const T=Math.min(e.endCC,b.endCC);e.startCC<T&&b.startCC<T&&(l=Ji(n,T),g=Ji(t,T)),(!l||!g)&&(l=n[Math.floor(n.length/2)],g=Ji(t,l.cc)||t[Math.floor(t.length/2)]);const I=l.programDateTime,k=g.programDateTime;if(!I||!k)return;const U=(k-I)/1e3-(g.start-l.start);Dn(U,b)}function Kn(b,e,t){qn(b,e,t),b.addEventListener(e,t)}function qn(b,e,t){b.removeEventListener(e,t)}const wa={toString:function(b){let e="";const t=b.length;for(let n=0;n<t;n++)e+=`[${b.start(n).toFixed(3)}-${b.end(n).toFixed(3)}]`;return e}},Kt={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};class Bi extends Ln{constructor(e,t,n,l,g){super(l,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=Kt.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:T,fragCurrent:I,media:k,mediaBuffer:U,state:j}=this,Z=k?k.currentTime:0,Q=Dr.bufferInfo(U||k,Z,T.maxBufferHole),ee=!Q.len;if(this.log(`Media seeking to ${te(Z)?Z.toFixed(3):Z}, state: ${j}, ${ee?"out of":"in"} buffer`),this.state===Kt.ENDED)this.resetLoadingState();else if(I){const ne=T.maxFragLookUpTolerance,de=I.start-ne,ce=I.start+I.duration+ne;if(ee||ce<Q.start||de>Q.end){const Ee=Z>ce;(Z<de||Ee)&&(Ee&&I.loader&&(this.log(`Cancelling fragment load for seek (sn: ${I.sn})`),I.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(k){this.fragmentTracker.removeFragmentsInRange(Z,1/0,this.playlistType,!0);const ne=this.lastCurrentTime;if(Z>ne&&(this.lastCurrentTime=Z),!this.loadingParts){const de=Math.max(Q.end,Z),ce=this.shouldLoadParts(this.getLevelDetails(),de);ce&&(this.log(`LL-Part loading ON after seeking to ${Z.toFixed(2)} with buffer @${de.toFixed(2)}`),this.loadingParts=ce)}}this.hls.hasEnoughToStart||(this.log(`Setting ${ee?"startPosition":"nextLoadPosition"} to ${Z} for seek without enough to start`),this.nextLoadPosition=Z,ee&&(this.startPosition=Z)),ee&&this.state===Kt.IDLE&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=g,this.hls=e,this.fragmentLoader=new gn(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new rn(e.config)}registerListeners(){const{hls:e}=this;e.on(y.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(y.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(y.MANIFEST_LOADING,this.onManifestLoading,this),e.on(y.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(y.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(y.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(y.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(y.MANIFEST_LOADING,this.onManifestLoading,this),e.off(y.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(y.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===Kt.STOPPED)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=Kt.STOPPED}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return t===-1&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const n=e.end||0,l=this.config.timelineOffset||0;if(n<=l)return!1;const g=e.buffered;this.config.maxBufferHole&&g&&g.length>1&&(e=Dr.bufferedInfo(g,e.start,0));const T=e.nextStart;if(T&&T>l&&T<t.edge||this.media.currentTime<e.start)return!1;const k=t.partList;if(k!=null&&k.length){const j=k[k.length-1];return Dr.isBuffered(this.media,j.start+j.duration/2)}const U=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(U)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null)return this.levelLastLoaded.details}get timelineOffset(){const e=this.config.timelineOffset;if(e){var t;return((t=this.getLevelDetails())==null?void 0:t.appliedTimelineOffset)||e}return 0}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;Kn(n,"seeking",this.onMediaSeeking),Kn(n,"ended",this.onMediaEnded);const l=this.config;this.levels&&l.autoStartLoad&&this.state===Kt.STOPPED&&this.startLoad(l.startPosition)}onMediaDetaching(e,t){const n=!!t.transferMedia,l=this.media;if(l!==null){if(l.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),qn(l,"seeking",this.onMediaSeeking),qn(l,"ended",this.onMediaEnded),this.keyLoader&&!n&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,n){this.resetLoadingState(),this.resetTransmuxer();return}this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(e,t){}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=Kt.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,n){this.startFragRequested=!0,this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){const l=g=>{const T=g.frag;if(this.fragContextChanged(T)){this.warn(`${T.type} sn: ${T.sn}${g.part?" part: "+g.part.index:""} of ${this.fragInfo(T,!1,g.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(T);return}T.stats.chunkCount++,this._handleFragmentLoadProgress(g)};this._doFragLoad(e,t,n,l).then(g=>{if(!g)return;const T=this.state,I=g.frag;if(this.fragContextChanged(I)){(T===Kt.FRAG_LOADING||!this.fragCurrent&&T===Kt.PARSING)&&(this.fragmentTracker.removeFragment(I),this.state=Kt.IDLE);return}"payload"in g&&(this.log(`Loaded ${I.type} sn: ${I.sn} of ${this.playlistLabel()} ${I.level}`),this.hls.trigger(y.FRAG_LOADED,g)),this._handleFragmentLoadComplete(g)}).catch(g=>{this.state===Kt.STOPPED||this.state===Kt.ERROR||(this.warn(`Frag error: ${(g==null?void 0:g.message)||g}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===Gr.APPENDING){const g=e.type,T=this.getFwdBufferInfo(this.mediaBuffer,g),I=Math.max(e.duration,T?T.len:this.config.maxBufferLength),k=this.backtrackFragment;((k?e.sn-k.sn:0)===1||this.reduceMaxBufferLength(I,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)===Gr.PARTIAL&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const t=e.details;return(t==null?void 0:t.live)&&t.type!=="EVENT"&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const l={startOffset:e,endOffset:t,type:n};this.hls.trigger(y.BUFFER_FLUSHING,l)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(n=>{const l=n==null?void 0:n.frag;if(!l||this.fragContextChanged(l)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:l}=this,{frag:g,payload:T}=n,I=g.decryptdata;if(T&&T.byteLength>0&&I!=null&&I.key&&I.iv&&On(I.method)){const k=self.performance.now();return this.decrypter.decrypt(new Uint8Array(T),I.key.buffer,I.iv.buffer,tn(I.method)).catch(U=>{throw l.trigger(y.ERROR,{type:D.MEDIA_ERROR,details:W.FRAG_DECRYPT_ERROR,fatal:!1,error:U,reason:U.message,frag:g}),U}).then(U=>{const j=self.performance.now();return l.trigger(y.FRAG_DECRYPTED,{frag:g,payload:U,stats:{tstart:k,tdecrypt:j}}),n.payload=U,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===Kt.STOPPED||this.state===Kt.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!==Kt.STOPPED&&(this.state=Kt.IDLE),e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}unhandledEncryptionError(e,t){var n,l;const g=e.tracks;if(g&&!t.encrypted&&((n=g.audio)!=null&&n.encrypted||(l=g.video)!=null&&l.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const T=this.media,I=new Error(`Encrypted track with no key in ${this.fragInfo(t)} (media ${T?"attached mediaKeys: "+T.mediaKeys:"detached"})`);return this.warn(I.message),!T||T.mediaKeys?!1:(this.hls.trigger(y.ERROR,{type:D.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_NO_KEYS,fatal:!1,error:I,frag:t}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const n=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)} > buffer:${n?wa.toString(Dr.getBuffered(n)):"(detached)"})`),q(e)){var l;if(e.type!==A.SUBTITLE){const T=e.elementaryStreams;if(!Object.keys(T).some(I=>!!T[I])){this.state=Kt.IDLE;return}}const g=(l=this.levels)==null?void 0:l[e.level];g!=null&&g.fragmentError&&(this.log(`Resetting level fragment error count of ${g.fragmentError} on frag buffered`),g.fragmentError=0)}this.state=Kt.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:l,partsLoaded:g}=e,T=!g||g.length===0||g.some(k=>!k),I=new ln(n.level,n.sn,n.stats.chunkCount+1,0,l?l.index:-1,!T);t.flush(I)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,l){var g;this.fragCurrent=e;const T=t.details;if(!this.levels||!T)throw new Error(`frag load aborted, missing level${T?"":" detail"}s`);let I=null;if(e.encrypted&&!((g=e.decryptdata)!=null&&g.key)){if(this.log(`Loading key for ${e.sn} of [${T.startSN}-${T.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=Kt.KEY_LOADING,this.fragCurrent=e,I=this.keyLoader.load(e).then(Q=>{if(!this.fragContextChanged(Q.frag))return this.hls.trigger(y.KEY_LOADED,Q),this.state===Kt.KEY_LOADING&&(this.state=Kt.IDLE),Q}),this.hls.trigger(y.KEY_LOADING,{frag:e}),this.fragCurrent===null)return this.log("context changed in KEY_LOADING"),Promise.resolve(null)}else e.encrypted||(I=this.keyLoader.loadClear(e,T.encryptedFragments,this.startFragRequested),I&&this.log("[eme] blocking frag load until media-keys acquired"));const k=this.fragPrevious;if(q(e)&&(!k||e.sn!==k.sn)){const Q=this.shouldLoadParts(t.details,e.end);Q!==this.loadingParts&&(this.log(`LL-Part loading ${Q?"ON":"OFF"} loading sn ${k==null?void 0:k.sn}->${e.sn}`),this.loadingParts=Q)}if(n=Math.max(e.start,n||0),this.loadingParts&&q(e)){const Q=T.partList;if(Q&&l){n>T.fragmentEnd&&T.fragmentHint&&(e=T.fragmentHint);const ee=this.getNextPart(Q,e,n);if(ee>-1){const ne=Q[ee];e=this.fragCurrent=ne.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${ne.index} (${ee}/${Q.length-1}) of ${this.fragInfo(e,!1,ne)}) cc: ${e.cc} [${T.startSN}-${T.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=ne.start+ne.duration,this.state=Kt.FRAG_LOADING;let de;return I?de=I.then(ce=>!ce||this.fragContextChanged(ce.frag)?null:this.doFragPartsLoad(e,ne,t,l)).catch(ce=>this.handleFragLoadError(ce)):de=this.doFragPartsLoad(e,ne,t,l).catch(ce=>this.handleFragLoadError(ce)),this.hls.trigger(y.FRAG_LOADING,{frag:e,part:ne,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):de}else if(!e.url||this.loadedEndOfParts(Q,n))return Promise.resolve(null)}}if(q(e)&&this.loadingParts){var U;this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)} Check buffer at sn: ${e.sn} loaded parts: ${(U=T.partList)==null?void 0:U.filter(Q=>Q.loaded).map(Q=>`[${Q.start}-${Q.end}]`)}`),this.loadingParts=!1}else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${"["+T.startSN+"-"+T.endSN+"]"}, target: ${parseFloat(n.toFixed(3))}`),te(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=Kt.FRAG_LOADING;const j=this.config.progressive;let Z;return j&&I?Z=I.then(Q=>!Q||this.fragContextChanged(Q.frag)?null:this.fragmentLoader.load(e,l)).catch(Q=>this.handleFragLoadError(Q)):Z=Promise.all([this.fragmentLoader.load(e,j?l:void 0),I]).then(([Q])=>(!j&&l&&l(Q),Q)).catch(Q=>this.handleFragLoadError(Q)),this.hls.trigger(y.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):Z}doFragPartsLoad(e,t,n,l){return new Promise((g,T)=>{var I;const k=[],U=(I=n.details)==null?void 0:I.partList,j=Z=>{this.fragmentLoader.loadPart(e,Z,l).then(Q=>{k[Z.index]=Q;const ee=Q.part;this.hls.trigger(y.FRAG_LOADED,Q);const ne=pi(n.details,e.sn,Z.index+1)||gi(U,e.sn,Z.index+1);if(ne)j(ne);else return g({frag:e,part:ee,partsLoaded:k})}).catch(T)};j(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;t.frag&&t.details===W.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):t.frag&&t.type===D.KEY_SYSTEM_ERROR?(t.frag.abortRequests(),this.resetFragmentLoading(t.frag)):this.hls.trigger(y.ERROR,t)}else this.hls.trigger(y.ERROR,{type:D.OTHER_ERROR,details:W.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==Kt.PARSING){!this.fragCurrent&&this.state!==Kt.STOPPED&&this.state!==Kt.ERROR&&(this.state=Kt.IDLE);return}const{frag:n,part:l,level:g}=t,T=self.performance.now();n.stats.parsing.end=T,l&&(l.stats.parsing.end=T);const I=this.getLevelDetails(),U=I&&n.sn>I.endSN||this.shouldLoadParts(I,n.end);U!==this.loadingParts&&(this.log(`LL-Part loading ${U?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=U),this.updateLevelTiming(n,l,g,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e.partList){var n;const g=e.partList[0];if(g.fragment.type===A.SUBTITLE)return!1;const T=g.end+(((n=e.fragmentHint)==null?void 0:n.duration)||0);if(t>=T){var l;if((this.hls.hasEnoughToStart?((l=this.media)==null?void 0:l.currentTime)||this.lastCurrentTime:this.getLoadPosition())>g.start-g.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:l,sn:g,part:T}=e;if(!(t!=null&&t[l]))return this.warn(`Levels object was unset while buffering fragment ${g} of ${this.playlistLabel()} ${l}. The current chunk will not be buffered.`),null;const I=t[l],k=I.details,U=T>-1?pi(k,g,T):null,j=U?U.fragment:mi(k,g,n);return j?(n&&n!==j&&(j.stats=n.stats),{frag:j,part:U,level:I}):null}bufferFragmentData(e,t,n,l,g){if(this.state!==Kt.PARSING)return;const{data1:T,data2:I}=e;let k=T;if(I&&(k=tt(T,I)),!k.length)return;const U=this.initPTS[t.cc],j=U?-U.baseTime/U.timescale:void 0,Z={type:e.type,frag:t,part:n,chunkMeta:l,offset:j,parent:t.type,data:k};if(this.hls.trigger(y.BUFFER_APPENDING,Z),e.dropped&&e.independent&&!n){if(g)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!Dr.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,l=Dr.bufferInfo(t,n,0),g=e.duration,T=Math.min(this.config.maxFragLookUpTolerance*2,g*.25),I=Math.max(Math.min(e.start-T,l.end-T),n+T);e.start-I>T&&this.flushMainBuffer(I,e.start)}getFwdBufferInfo(e,t){var n;const l=this.getLoadPosition();if(!te(l))return null;const T=this.lastCurrentTime>l||(n=this.media)!=null&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,l,t,T)}getFwdBufferInfoAtPos(e,t,n,l){const g=Dr.bufferInfo(e,t,l);if(g.len===0&&g.nextStart!==void 0){const T=this.fragmentTracker.getBufferedFrag(t,n);if(T&&(g.nextStart<=T.end||T.gap)){const I=Math.max(Math.min(g.nextStart,T.end)-t,l);return Dr.bufferInfo(e,t,I)}}return g}getMaxBufferLength(e){const{config:t}=this;let n;return e?n=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):n=t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const n=this.config,l=Math.max(Math.min(e-t,n.maxBufferLength),t),g=Math.max(e-t*3,n.maxMaxBufferLength/2,l);return g>=l?(n.maxMaxBufferLength=g,this.warn(`Reduce max buffer length to ${g}s`),!0):!1}getAppendedFrag(e,t=A.MAIN){const n=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,t):null;return n&&"fragment"in n?n.fragment:n}getNextFragment(e,t){const n=t.fragments,l=n.length;if(!l)return null;const{config:g}=this,T=n[0].start,I=g.lowLatencyMode&&!!t.partList;let k=null;if(t.live){const Z=g.initialLiveManifestSize;if(l<Z)return this.warn(`Not enough fragments to start playback (have: ${l}, need: ${Z})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<T){var U;I&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),k=this.getInitialLiveFragment(t);const Q=this.hls.startPosition,ee=this.hls.liveSyncPosition,ne=k?(Q!==-1&&Q>=T?Q:ee)||k.start:e;this.log(`Setting startPosition to ${ne} to match start frag at live edge. mainStart: ${Q} liveSyncPosition: ${ee} frag.start: ${(U=k)==null?void 0:U.start}`),this.startPosition=this.nextLoadPosition=ne}}else e<=T&&(k=n[0]);if(!k){const Z=this.loadingParts?t.partEnd:t.fragmentEnd;k=this.getFragmentAtPosition(e,Z,t)}let j=this.filterReplacedPrimary(k,t);if(!j&&k){const Z=k.sn-t.startSN;j=this.filterReplacedPrimary(n[Z+1]||null,t)}return this.mapToInitFragWhenRequired(j)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===Gr.OK||n===Gr.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,l,g){let T=null;if(e.gap&&(T=this.getNextFragment(this.nextLoadPosition,t),T&&!T.gap&&n.nextStart)){const I=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,l,0);if(I!==null&&n.len+I.len>=g){const k=T.sn;return this.loopSn!==k&&(this.log(`buffer full after gaps in "${l}" playlist starting at sn: ${k}`),this.loopSn=k),null}}return this.loopSn=void 0,T}get primaryPrefetch(){if(ua(this.config)){var e;if((e=this.hls.interstitialsManager)==null||(e=e.playingItem)==null?void 0:e.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(ua(this.config)&&e.type!==A.SUBTITLE){const n=this.hls.interstitialsManager,l=n==null?void 0:n.bufferingItem;if(l){const T=l.event;if(T){if(T.appendInPlace||Math.abs(e.start-l.start)>1||l.start===0)return null}else if(e.end<=l.start&&(t==null?void 0:t.live)===!1||e.start>l.end&&l.nextEvent&&(l.nextEvent.appendInPlace||e.start-l.end>1))return null}const g=n==null?void 0:n.playerQueue;if(g)for(let T=g.length;T--;){const I=g[T].interstitial;if(I.appendInPlace&&e.start>=I.startTime&&e.end<=I.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!e.initSegment.data&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,n){let l=-1,g=!1,T=!0;for(let I=0,k=e.length;I<k;I++){const U=e[I];if(T=T&&!U.independent,l>-1&&n<U.start)break;const j=U.loaded;j?l=-1:(g||(U.independent||T)&&U.fragment===t)&&(U.fragment!==t&&this.warn(`Need buffer at ${n} but next unloaded part starts at ${U.start}`),l=I),g=j}return l}loadedEndOfParts(e,t){let n;for(let l=e.length;l--;){if(n=e[l],!n.loaded)return!1;if(t>n.start)return!0}return!1}getInitialLiveFragment(e){const t=e.fragments,n=this.fragPrevious;let l=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),l=ar(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!l){const g=n.sn+1;if(g>=e.startSN&&g<=e.endSN){const T=t[g-e.startSN];n.cc===T.cc&&(l=T,this.log(`Live playlist, switching playlist, load frag with next SN: ${l.sn}`))}l||(l=Mr(e,n.cc,n.end),l&&this.log(`Live playlist, switching playlist, load frag with same CC: ${l.sn}`))}}else{const g=this.hls.liveSyncPosition;g!==null&&(l=this.getFragmentAtPosition(g,this.bitrateTest?e.fragmentEnd:e.edge,e))}return l}getFragmentAtPosition(e,t,n){const{config:l}=this;let{fragPrevious:g}=this,{fragments:T,endSN:I}=n;const{fragmentHint:k}=n,{maxFragLookUpTolerance:U}=l,j=n.partList,Z=!!(this.loadingParts&&j!=null&&j.length&&k);Z&&!this.bitrateTest&&j[j.length-1].fragment.sn===k.sn&&(T=T.concat(k),I=k.sn);let Q;if(e<t){var ee;const de=e<this.lastCurrentTime||e>t-U||(ee=this.media)!=null&&ee.paused||!this.startFragRequested?0:U;Q=mr(g,T,e,de)}else Q=T[T.length-1];if(Q){const ne=Q.sn-n.startSN,de=this.fragmentTracker.getState(Q);if((de===Gr.OK||de===Gr.PARTIAL&&Q.gap)&&(g=Q),g&&Q.sn===g.sn&&(!Z||j[0].fragment.sn>Q.sn||!n.live)&&Q.level===g.level){const Ee=T[ne+1];Q.sn<I&&this.fragmentTracker.getState(Ee)!==Gr.OK?Q=Ee:Q=null}}return Q}alignPlaylists(e,t,n){const l=e.fragments.length;if(!l)return this.warn("No fragments in live playlist"),0;const g=e.fragmentStart,T=!t,I=e.alignedSliding&&te(g);if(T||!I&&!g){si(n,e);const k=e.fragmentStart;return this.log(`Live playlist sliding: ${k.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${l}`),k}return g}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let n=this.startPosition;n<t&&(n=-1);const l=this.timelineOffset;if(n===-1){const g=this.startTimeOffset!==null,T=g?this.startTimeOffset:e.startTimeOffset;T!==null&&te(T)?(n=t+T,T<0&&(n+=e.edge),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Setting startPosition to ${n} for start time offset ${T} found in ${g?"multivariant":"media"} playlist`),this.startPosition=n):e.live?(n=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${n}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=n=0),this.lastCurrentTime=n+l}this.nextLoadPosition=n+l}getLoadPosition(){var e;const{media:t}=this;let n=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?n=t.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&q(e)&&e.stats.aborted&&(this.log(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==Kt.FRAG_LOADING_WAITING_RETRY)&&(this.state=Kt.IDLE)}onFragmentOrKeyLoadError(e,t){var n;if(t.chunkMeta&&!t.frag){const Ee=this.getCurrentContext(t.chunkMeta);Ee&&(t.frag=Ee.frag)}const l=t.frag;if(!l||l.type!==e||!this.levels)return;if(this.fragContextChanged(l)){var g;this.warn(`Frag load error must match current frag to retry ${l.url} > ${(g=this.fragCurrent)==null?void 0:g.url}`);return}const T=t.details===W.FRAG_GAP;T&&this.fragmentTracker.fragBuffered(l,!0);const I=t.errorAction;if(!I){this.state=Kt.ERROR;return}const{action:k,flags:U,retryCount:j=0,retryConfig:Z}=I,Q=!!Z,ee=Q&&k===Wr.RetryRequest,ne=Q&&!I.resolved&&U===wr.MoveAllAlternatesMatchingHost,de=(n=this.hls.latestLevelDetails)==null?void 0:n.live;if(!ee&&ne&&q(l)&&!l.endList&&de)this.resetFragmentErrors(e),this.treatAsGap(l),I.resolved=!0;else if((ee||ne)&&j<Z.maxNumRetry){var ce;const Ee=zr((ce=t.response)==null?void 0:ce.code),ke=Cr(Z,j);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+ke,this.state=Kt.FRAG_LOADING_WAITING_RETRY,I.resolved=!0,Ee){this.log("Waiting for connection (offline)"),this.retryDate=1/0,t.reason="offline";return}this.warn(`Fragment ${l.sn} of ${e} ${l.level} errored with ${t.details}, retrying loading ${j+1}/${Z.maxNumRetry} in ${ke}ms`)}else if(Z)if(this.resetFragmentErrors(e),j<Z.maxNumRetry)!T&&k!==Wr.RemoveAlternatePermanently&&(I.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${j})`);return}else k===Wr.SendAlternateToPenaltyBox?this.state=Kt.WAITING_LEVEL:this.state=Kt.ERROR;this.tickImmediate()}checkRetryDate(){const e=self.performance.now(),t=this.retryDate,n=t===1/0;(!t||e>=t||n&&!zr(0))&&(n&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=Kt.IDLE)}reduceLengthAndFlushBuffer(e){if(this.state===Kt.PARSING||this.state===Kt.PARSED){const t=e.frag,n=e.parent,l=this.getFwdBufferInfo(this.mediaBuffer,n),g=l&&l.len>.5;g&&this.reduceMaxBufferLength(l.len,(t==null?void 0:t.duration)||10);const T=!g;return T&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),T}return!1}resetFragmentErrors(e){e===A.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==Kt.STOPPED&&(this.state=Kt.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const l=Dr.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,l,n),this.state===Kt.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==Kt.STOPPED&&(this.state=Kt.IDLE)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const e=this.levelLastLoaded,t=e?e.details:null;t!=null&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.log(`Loading context changed while buffering sn ${e.sn} of ${this.playlistLabel()} ${e.level===-1?"<removed>":e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,l){const g=n.details;if(!g){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((k,U)=>{const j=e.elementaryStreams[U];if(j){const Z=j.endPTS-j.startPTS;if(Z<=0)return this.warn(`Could not parse fragment ${e.sn} ${U} duration reliably (${Z})`),k||!1;const Q=l?0:_i(g,e,j.startPTS,j.endPTS,j.startDTS,j.endDTS,this);return this.hls.trigger(y.LEVEL_PTS_UPDATED,{details:g,level:n,drift:Q,type:U,frag:e,start:j.startPTS,end:j.endPTS}),!0}return k},!1)){var I;if(n.fragmentError===0&&this.treatAsGap(e,n),((I=this.transmuxer)==null?void 0:I.error)===null){const k=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(k.message),this.hls.trigger(y.ERROR,{type:D.MEDIA_ERROR,details:W.FRAG_PARSING_ERROR,fatal:!1,error:k,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=Kt.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(y.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===A.MAIN?"level":"track"}fragInfo(e,t=!0,n){var l,g;return`${this.playlistLabel()} ${e.level} (${n?"part":"frag"}:[${((l=t&&!n?e.startPTS:(n||e).start)!=null?l:NaN).toFixed(3)}-${((g=t&&!n?e.endPTS:(n||e).end)!=null?g:NaN).toFixed(3)}]${n&&e.type==="main"?"INDEPENDENT="+(n.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;(e=this.transmuxer)==null||e.reset()}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function ua(b){return!!b.interstitialsController&&b.enableInterstitialPlayback!==!1}class Ca{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=pl(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function pl(b,e){const t=new Uint8Array(e);let n=0;for(let l=0;l<b.length;l++){const g=b[l];t.set(g,n),n+=g.length}return t}var Qa={exports:{}},ks;function gl(){return ks||(ks=1,function(b){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function l(k,U,j){this.fn=k,this.context=U,this.once=j||!1}function g(k,U,j,Z,Q){if(typeof j!="function")throw new TypeError("The listener must be a function");var ee=new l(j,Z||k,Q),ne=t?t+U:U;return k._events[ne]?k._events[ne].fn?k._events[ne]=[k._events[ne],ee]:k._events[ne].push(ee):(k._events[ne]=ee,k._eventsCount++),k}function T(k,U){--k._eventsCount===0?k._events=new n:delete k._events[U]}function I(){this._events=new n,this._eventsCount=0}I.prototype.eventNames=function(){var U=[],j,Z;if(this._eventsCount===0)return U;for(Z in j=this._events)e.call(j,Z)&&U.push(t?Z.slice(1):Z);return Object.getOwnPropertySymbols?U.concat(Object.getOwnPropertySymbols(j)):U},I.prototype.listeners=function(U){var j=t?t+U:U,Z=this._events[j];if(!Z)return[];if(Z.fn)return[Z.fn];for(var Q=0,ee=Z.length,ne=new Array(ee);Q<ee;Q++)ne[Q]=Z[Q].fn;return ne},I.prototype.listenerCount=function(U){var j=t?t+U:U,Z=this._events[j];return Z?Z.fn?1:Z.length:0},I.prototype.emit=function(U,j,Z,Q,ee,ne){var de=t?t+U:U;if(!this._events[de])return!1;var ce=this._events[de],Ee=arguments.length,ke,Me;if(ce.fn){switch(ce.once&&this.removeListener(U,ce.fn,void 0,!0),Ee){case 1:return ce.fn.call(ce.context),!0;case 2:return ce.fn.call(ce.context,j),!0;case 3:return ce.fn.call(ce.context,j,Z),!0;case 4:return ce.fn.call(ce.context,j,Z,Q),!0;case 5:return ce.fn.call(ce.context,j,Z,Q,ee),!0;case 6:return ce.fn.call(ce.context,j,Z,Q,ee,ne),!0}for(Me=1,ke=new Array(Ee-1);Me<Ee;Me++)ke[Me-1]=arguments[Me];ce.fn.apply(ce.context,ke)}else{var Ye=ce.length,lt;for(Me=0;Me<Ye;Me++)switch(ce[Me].once&&this.removeListener(U,ce[Me].fn,void 0,!0),Ee){case 1:ce[Me].fn.call(ce[Me].context);break;case 2:ce[Me].fn.call(ce[Me].context,j);break;case 3:ce[Me].fn.call(ce[Me].context,j,Z);break;case 4:ce[Me].fn.call(ce[Me].context,j,Z,Q);break;default:if(!ke)for(lt=1,ke=new Array(Ee-1);lt<Ee;lt++)ke[lt-1]=arguments[lt];ce[Me].fn.apply(ce[Me].context,ke)}}return!0},I.prototype.on=function(U,j,Z){return g(this,U,j,Z,!1)},I.prototype.once=function(U,j,Z){return g(this,U,j,Z,!0)},I.prototype.removeListener=function(U,j,Z,Q){var ee=t?t+U:U;if(!this._events[ee])return this;if(!j)return T(this,ee),this;var ne=this._events[ee];if(ne.fn)ne.fn===j&&(!Q||ne.once)&&(!Z||ne.context===Z)&&T(this,ee);else{for(var de=0,ce=[],Ee=ne.length;de<Ee;de++)(ne[de].fn!==j||Q&&!ne[de].once||Z&&ne[de].context!==Z)&&ce.push(ne[de]);ce.length?this._events[ee]=ce.length===1?ce[0]:ce:T(this,ee)}return this},I.prototype.removeAllListeners=function(U){var j;return U?(j=t?t+U:U,this._events[j]&&T(this,j)):(this._events=new n,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=t,I.EventEmitter=I,b.exports=I}(Qa)),Qa.exports}var vl=gl(),Ja=F(vl);const ya="1.6.11",ca={};function yl(){return typeof __HLS_WORKER_BUNDLE__=="function"}function El(){const b=ca[ya];if(b)return b.clientCount++,b;const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e),l={worker:new self.Worker(t),objectURL:t,clientCount:1};return ca[ya]=l,l}function xl(b){const e=ca[b];if(e)return e.clientCount++,e;const t=new self.URL(b,self.location.href).href,l={worker:new self.Worker(t),scriptURL:t,clientCount:1};return ca[b]=l,l}function Tl(b){const e=ca[b||ya];if(e&&e.clientCount--===1){const{worker:n,objectURL:l}=e;delete ca[b||ya],l&&self.URL.revokeObjectURL(l),n.terminate()}}function Ws(b,e){return e+10<=b.length&&b[e]===51&&b[e+1]===68&&b[e+2]===73&&b[e+3]<255&&b[e+4]<255&&b[e+6]<128&&b[e+7]<128&&b[e+8]<128&&b[e+9]<128}function qa(b,e){return e+10<=b.length&&b[e]===73&&b[e+1]===68&&b[e+2]===51&&b[e+3]<255&&b[e+4]<255&&b[e+6]<128&&b[e+7]<128&&b[e+8]<128&&b[e+9]<128}function Ia(b,e){let t=0;return t=(b[e]&127)<<21,t|=(b[e+1]&127)<<14,t|=(b[e+2]&127)<<7,t|=b[e+3]&127,t}function Ea(b,e){const t=e;let n=0;for(;qa(b,e);){n+=10;const l=Ia(b,e+6);n+=l,Ws(b,e+10)&&(n+=10),e+=n}if(n>0)return b.subarray(t,t+n)}function Al(b,e,t,n){const l=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],g=e[t+2],T=g>>2&15;if(T>12){const ee=new Error(`invalid ADTS sampling index:${T}`);b.emit(y.ERROR,y.ERROR,{type:D.MEDIA_ERROR,details:W.FRAG_PARSING_ERROR,fatal:!0,error:ee,reason:ee.message});return}const I=(g>>6&3)+1,k=e[t+3]>>6&3|(g&1)<<2,U="mp4a.40."+I,j=l[T];let Z=T;(I===5||I===29)&&(Z-=3);const Q=[I<<3|(Z&14)>>1,(Z&1)<<7|k<<3];return S.log(`manifest codec:${n}, parsed codec:${U}, channels:${k}, rate:${j} (ADTS object type:${I} sampling index:${T})`),{config:Q,samplerate:j,channelCount:k,codec:U,parsedCodec:U,manifestCodec:n}}function Ks(b,e){return b[e]===255&&(b[e+1]&246)===240}function Gs(b,e){return b[e+1]&1?7:9}function es(b,e){return(b[e+3]&3)<<11|b[e+4]<<3|(b[e+5]&224)>>>5}function bl(b,e){return e+5<b.length}function Pa(b,e){return e+1<b.length&&Ks(b,e)}function Sl(b,e){return bl(b,e)&&Ks(b,e)&&es(b,e)<=b.length-e}function Dl(b,e){if(Pa(b,e)){const t=Gs(b,e);if(e+t>=b.length)return!1;const n=es(b,e);if(n<=t)return!1;const l=e+n;return l===b.length||Pa(b,l)}return!1}function Vs(b,e,t,n,l){if(!b.samplerate){const g=Al(e,t,n,l);if(!g)return;u(b,g)}}function Hs(b){return 1024*9e4/b}function Ll(b,e){const t=Gs(b,e);if(e+t<=b.length){const n=es(b,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function zs(b,e,t,n,l){const g=Hs(b.samplerate),T=n+l*g,I=Ll(e,t);let k;if(I){const{frameLength:Z,headerLength:Q}=I,ee=Q+Z,ne=Math.max(0,t+ee-e.length);ne?(k=new Uint8Array(ee-Q),k.set(e.subarray(t+Q,e.length),0)):k=e.subarray(t+Q,t+ee);const de={unit:k,pts:T};return ne||b.samples.push(de),{sample:de,length:ee,missing:ne}}const U=e.length-t;return k=new Uint8Array(U),k.set(e.subarray(t,e.length),0),{sample:{unit:k,pts:T},length:U,missing:-1}}function Rl(b,e){return qa(b,e)&&Ia(b,e+6)+10<=b.length-e}function wl(b){return b instanceof ArrayBuffer?b:b.byteOffset==0&&b.byteLength==b.buffer.byteLength?b.buffer:new Uint8Array(b).buffer}function ts(b,e=0,t=1/0){return Cl(b,e,t,Uint8Array)}function Cl(b,e,t,n){const l=Il(b);let g=1;"BYTES_PER_ELEMENT"in n&&(g=n.BYTES_PER_ELEMENT);const T=Pl(b)?b.byteOffset:0,I=(T+b.byteLength)/g,k=(T+e)/g,U=Math.floor(Math.max(0,Math.min(k,I))),j=Math.floor(Math.min(U+Math.max(t,0),I));return new n(l,U,j-U)}function Il(b){return b instanceof ArrayBuffer?b:b.buffer}function Pl(b){return b&&b.buffer instanceof ArrayBuffer&&b.byteLength!==void 0&&b.byteOffset!==void 0}function Ml(b){const e={key:b.type,description:"",data:"",mimeType:null,pictureType:null},t=3;if(b.size<2)return;if(b.data[0]!==t){console.log("Ignore frame with unrecognized character encoding");return}const n=b.data.subarray(1).indexOf(0);if(n===-1)return;const l=z(ts(b.data,1,n)),g=b.data[2+n],T=b.data.subarray(3+n).indexOf(0);if(T===-1)return;const I=z(ts(b.data,3+n,T));let k;return l==="-->"?k=z(ts(b.data,4+n+T)):k=wl(b.data.subarray(4+n+T)),e.mimeType=l,e.pictureType=g,e.description=I,e.data=k,e}function Ol(b){if(b.size<2)return;const e=z(b.data,!0),t=new Uint8Array(b.data.subarray(e.length+1));return{key:b.type,info:e,data:t.buffer}}function Nl(b){if(b.size<2)return;if(b.type==="TXXX"){let t=1;const n=z(b.data.subarray(t),!0);t+=n.length+1;const l=z(b.data.subarray(t));return{key:b.type,info:n,data:l}}const e=z(b.data.subarray(1));return{key:b.type,info:"",data:e}}function Bl(b){if(b.type==="WXXX"){if(b.size<2)return;let t=1;const n=z(b.data.subarray(t),!0);t+=n.length+1;const l=z(b.data.subarray(t));return{key:b.type,info:n,data:l}}const e=z(b.data);return{key:b.type,info:"",data:e}}function Ul(b){return b.type==="PRIV"?Ol(b):b.type[0]==="W"?Bl(b):b.type==="APIC"?Ml(b):Nl(b)}function Fl(b){const e=String.fromCharCode(b[0],b[1],b[2],b[3]),t=Ia(b,4),n=10;return{type:e,size:t,data:b.subarray(n,n+t)}}const Ma=10,kl=10;function js(b){let e=0;const t=[];for(;qa(b,e);){const n=Ia(b,e+6);b[e+5]>>6&1&&(e+=Ma),e+=Ma;const l=e+n;for(;e+kl<l;){const g=Fl(b.subarray(e)),T=Ul(g);T&&t.push(T),e+=g.size+Ma}Ws(b,e)&&(e+=Ma)}return t}function Zs(b){return b&&b.key==="PRIV"&&b.info==="com.apple.streaming.transportStreamTimestamp"}function Wl(b){if(b.data.byteLength===8){const e=new Uint8Array(b.data),t=e[3]&1;let n=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return n/=45,t&&(n+=4772185884e-2),Math.round(n)}}function rs(b){const e=js(b);for(let t=0;t<e.length;t++){const n=e[t];if(Zs(n))return Wl(n)}}let di=function(b){return b.audioId3="org.id3",b.dateRange="com.apple.quicktime.HLS",b.emsg="https://aomedia.org/emsg/ID3",b.misbklv="urn:misb:KLV:bin:1910.1",b}({});function Li(b="",e=9e4){return{type:b,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class ns{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,n,l){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,n){}demux(e,t){this.cachedData&&(e=tt(this.cachedData,e),this.cachedData=null);let n=Ea(e,0),l=n?n.length:0,g;const T=this._audioTrack,I=this._id3Track,k=n?rs(n):void 0,U=e.length;for((this.basePTS===null||this.frameIndex===0&&te(k))&&(this.basePTS=Kl(k,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&I.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:di.audioId3,duration:Number.POSITIVE_INFINITY});l<U;){if(this.canParse(e,l)){const j=this.appendFrame(T,e,l);j?(this.frameIndex++,this.lastPTS=j.sample.pts,l+=j.length,g=l):l=U}else Rl(e,l)?(n=Ea(e,l),I.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:di.audioId3,duration:Number.POSITIVE_INFINITY}),l+=n.length,g=l):l++;if(l===U&&g!==U){const j=e.slice(g);this.cachedData?this.cachedData=tt(this.cachedData,j):this.cachedData=j}}return{audioTrack:T,videoTrack:Li(),id3Track:I,textTrack:Li()}}demuxSampleAes(e,t,n){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:Li(),id3Track:this._id3Track,textTrack:Li()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const Kl=(b,e,t)=>{if(te(b))return b*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};let Oa=null;const Gl=[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],Vl=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Hl=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],zl=[0,1,1,4];function Xs(b,e,t,n,l){if(t+24>e.length)return;const g=Ys(e,t);if(g&&t+g.frameLength<=e.length){const T=g.samplesPerFrame*9e4/g.sampleRate,I=n+l*T,k={unit:e.subarray(t,t+g.frameLength),pts:I,dts:I};return b.config=[],b.channelCount=g.channelCount,b.samplerate=g.sampleRate,b.samples.push(k),{sample:k,length:g.frameLength,missing:0}}}function Ys(b,e){const t=b[e+1]>>3&3,n=b[e+1]>>1&3,l=b[e+2]>>4&15,g=b[e+2]>>2&3;if(t!==1&&l!==0&&l!==15&&g!==3){const T=b[e+2]>>1&1,I=b[e+3]>>6,k=t===3?3-n:n===3?3:4,U=Gl[k*14+l-1]*1e3,Z=Vl[(t===3?0:t===2?1:2)*3+g],Q=I===3?1:2,ee=Hl[t][n],ne=zl[n],de=ee*8*ne,ce=Math.floor(ee*U/Z+T)*ne;if(Oa===null){const Me=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Oa=Me?parseInt(Me[1]):0}return!!Oa&&Oa<=87&&n===2&&U>=224e3&&I===0&&(b[e+3]=b[e+3]|128),{sampleRate:Z,channelCount:Q,frameLength:ce,samplesPerFrame:de}}}function is(b,e){return b[e]===255&&(b[e+1]&224)===224&&(b[e+1]&6)!==0}function $s(b,e){return e+1<b.length&&is(b,e)}function jl(b,e){return is(b,e)&&4<=b.length-e}function Qs(b,e){if(e+1<b.length&&is(b,e)){const n=Ys(b,e);let l=4;n!=null&&n.frameLength&&(l=n.frameLength);const g=e+l;return g===b.length||$s(b,g)}return!1}class Zl extends ns{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,l){super.resetInitSegment(e,t,n,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:l,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const n=Ea(e,0);let l=(n==null?void 0:n.length)||0;if(Qs(e,l))return!1;for(let g=e.length;l<g;l++)if(Dl(e,l))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return Sl(e,t)}appendFrame(e,t,n){Vs(e,this.observer,t,n,e.manifestCodec);const l=zs(e,t,n,this.basePTS,this.frameIndex);if(l&&l.missing===0)return l}}const Js=(b,e)=>{let t=0,n=5;e+=n;const l=new Uint32Array(1),g=new Uint32Array(1),T=new Uint8Array(1);for(;n>0;){T[0]=b[e];const I=Math.min(n,8),k=8-I;g[0]=4278190080>>>24+k<<k,l[0]=(T[0]&g[0])>>k,t=t?t<<I|l[0]:l[0],e+=1,n-=I}return t};class Xl extends ns{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,l){super.resetInitSegment(e,t,n,l),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:l,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){const l=qs(e,t,n,this.basePTS,this.frameIndex);if(l!==-1)return{sample:e.samples[e.samples.length-1],length:l,missing:0}}static probe(e){if(!e)return!1;const t=Ea(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&rs(t)!==void 0&&Js(e,n)<16}}function qs(b,e,t,n,l){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const g=e[t+4]>>6;if(g>=3)return-1;const I=[48e3,44100,32e3][g],k=e[t+4]&63,j=[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][k*3+g]*2;if(t+j>e.length)return-1;const Z=e[t+6]>>5;let Q=0;Z===2?Q+=2:(Z&1&&Z!==1&&(Q+=2),Z&4&&(Q+=2));const ee=(e[t+6]<<8|e[t+7])>>12-Q&1,de=[2,1,2,3,3,4,4,5][Z]+ee,ce=e[t+5]>>3,Ee=e[t+5]&7,ke=new Uint8Array([g<<6|ce<<1|Ee>>2,(Ee&3)<<6|Z<<3|ee<<2|k>>4,k<<4&224]),Me=1536/I*9e4,Ye=n+l*Me,lt=e.subarray(t,t+j);return b.config=ke,b.channelCount=de,b.samplerate=I,b.samples.push({unit:lt,pts:Ye}),j}class Yl extends ns{resetInitSegment(e,t,n,l){super.resetInitSegment(e,t,n,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:l,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=Ea(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&rs(t)!==void 0&&Js(e,n)<=16)return!1;for(let l=e.length;n<l;n++)if(Qs(e,n))return S.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return jl(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return Xs(e,t,n,this.basePTS,this.frameIndex)}}const $l=/\/emsg[-/]ID3/i;class Ql{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,l){const g=this.videoTrack=Li("video",1),T=this.audioTrack=Li("audio",1),I=this.txtTrack=Li("text",1);if(this.id3Track=Li("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const k=Fe(e);if(k.video){const{id:U,timescale:j,codec:Z,supplemental:Q}=k.video;g.id=U,g.timescale=I.timescale=j,g.codec=Z,g.supplemental=Q}if(k.audio){const{id:U,timescale:j,codec:Z}=k.audio;T.id=U,T.timescale=j,T.codec=Z}I.id=Ge.text,g.sampleDuration=0,g.duration=T.duration=l}resetContiguity(){this.remainderData=null}static probe(e){return Re(e)}demux(e,t){this.timeOffset=t;let n=e;const l=this.videoTrack,g=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=tt(this.remainderData,e));const I=Ze(n);this.remainderData=I.remainder,l.samples=I.valid||new Uint8Array}else l.samples=n;const T=this.extractID3Track(l,t);return g.samples=dt(t,l),{videoTrack:l,audioTrack:this.audioTrack,id3Track:T,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const l=this.extractID3Track(t,this.timeOffset);return n.samples=dt(e,t),{videoTrack:t,audioTrack:Li(),id3Track:l,textTrack:Li()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const l=ve(e.samples,["emsg"]);l&&l.forEach(g=>{const T=st(g);if($l.test(T.schemeIdUri)){const I=eo(T,t);let k=T.eventDuration===4294967295?Number.POSITIVE_INFINITY:T.eventDuration/T.timeScale;k<=.001&&(k=Number.POSITIVE_INFINITY);const U=T.payload;n.samples.push({data:U,len:U.byteLength,dts:I,pts:I,type:di.emsg,duration:k})}else if(this.config.enableEmsgKLVMetadata&&T.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const I=eo(T,t);n.samples.push({data:T.payload,len:T.payload.byteLength,dts:I,pts:I,type:di.misbklv,duration:Number.POSITIVE_INFINITY})}})}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}}function eo(b,e){return te(b.presentationTime)?b.presentationTime/b.timeScale:e+b.presentationTimeDelta/b.timeScale}class Jl{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new rn(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,Mt.cbc)}decryptAacSample(e,t,n){const l=e[t].unit;if(l.length<=16)return;const g=l.subarray(16,l.length-l.length%16),T=g.buffer.slice(g.byteOffset,g.byteOffset+g.length);this.decryptBuffer(T).then(I=>{const k=new Uint8Array(I);l.set(k,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)}).catch(n)}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let l=0;for(let g=32;g<e.length-16;g+=160,l+=16)n.set(e.subarray(g,g+16),l);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let l=0;for(let g=32;g<e.length-16;g+=160,l+=16)e.set(n.subarray(l,l+16),g);return e}decryptAvcSample(e,t,n,l,g){const T=Bt(g.data),I=this.getAvcEncryptedData(T);this.decryptBuffer(I.buffer).then(k=>{g.data=this.getAvcDecryptedUnit(T,k),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,l)}).catch(l)}decryptAvcSamples(e,t,n,l){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length){l();return}const g=e[t].units;for(;!(n>=g.length);n++){const T=g[n];if(!(T.data.length<=48||T.type!==1&&T.type!==5)&&(this.decryptAvcSample(e,t,n,l,T),!this.decrypter.isSync()))return}}}}class to{constructor(){this.VideoSample=null}createVideoSample(e,t,n){return{key:e,frame:!1,pts:t,dts:n,units:[],length:0}}getLastNalUnit(e){var t;let n=this.VideoSample,l;if((!n||n.units.length===0)&&(n=e[e.length-1]),(t=n)!=null&&t.units){const g=n.units;l=g[g.length-1]}return l}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const n=t.samples,l=n.length;if(l){const g=n[l-1];e.pts=g.pts,e.dts=g.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,n){const l=t.byteLength;let g=e.naluState||0;const T=g,I=[];let k=0,U,j,Z,Q=-1,ee=0;for(g===-1&&(Q=0,ee=this.getNALuType(t,0),g=0,k=1);k<l;){if(U=t[k++],!g){g=U?0:1;continue}if(g===1){g=U?0:2;continue}if(!U)g=3;else if(U===1){if(j=k-g-1,Q>=0){const ne={data:t.subarray(Q,j),type:ee};I.push(ne)}else{const ne=this.getLastNalUnit(e.samples);ne&&(T&&k<=4-T&&ne.state&&(ne.data=ne.data.subarray(0,ne.data.byteLength-T)),j>0&&(ne.data=tt(ne.data,t.subarray(0,j)),ne.state=0))}k<l?(Z=this.getNALuType(t,k),Q=k,ee=Z,g=0):g=-1}else g=0}if(Q>=0&&g>=0){const ne={data:t.subarray(Q,l),type:ee,state:g};I.push(ne)}if(I.length===0){const ne=this.getLastNalUnit(e.samples);ne&&(ne.data=tt(ne.data,t))}return e.naluState=g,I}}class xa{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,l=new Uint8Array(4),g=Math.min(4,t);if(g===0)throw new Error("no bytes available");l.set(e.subarray(n,n+g)),this.word=new DataView(l.buffer).getUint32(0),this.bitsAvailable=g*8,this.bytesAvailable-=g}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&&S.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?n<<t|this.readBits(t):n}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class ql extends to{parsePES(e,t,n,l){const g=this.parseNALu(e,n.data,l);let T=this.VideoSample,I,k=!1;n.data=null,T&&g.length&&!e.audFound&&(this.pushAccessUnit(T,e),T=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),g.forEach(U=>{var j,Z;switch(U.type){case 1:{let de=!1;I=!0;const ce=U.data;if(k&&ce.length>4){const Ee=this.readSliceType(ce);(Ee===2||Ee===4||Ee===7||Ee===9)&&(de=!0)}if(de){var Q;(Q=T)!=null&&Q.frame&&!T.key&&(this.pushAccessUnit(T,e),T=this.VideoSample=null)}T||(T=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),T.frame=!0,T.key=de;break}case 5:I=!0,(j=T)!=null&&j.frame&&!T.key&&(this.pushAccessUnit(T,e),T=this.VideoSample=null),T||(T=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),T.key=!0,T.frame=!0;break;case 6:{I=!0,Nt(U.data,1,n.pts,t.samples);break}case 7:{var ee,ne;I=!0,k=!0;const de=U.data,ce=this.readSPS(de);if(!e.sps||e.width!==ce.width||e.height!==ce.height||((ee=e.pixelRatio)==null?void 0:ee[0])!==ce.pixelRatio[0]||((ne=e.pixelRatio)==null?void 0:ne[1])!==ce.pixelRatio[1]){e.width=ce.width,e.height=ce.height,e.pixelRatio=ce.pixelRatio,e.sps=[de];const Ee=de.subarray(1,4);let ke="avc1.";for(let Me=0;Me<3;Me++){let Ye=Ee[Me].toString(16);Ye.length<2&&(Ye="0"+Ye),ke+=Ye}e.codec=ke}break}case 8:I=!0,e.pps=[U.data];break;case 9:I=!0,e.audFound=!0,(Z=T)!=null&&Z.frame&&(this.pushAccessUnit(T,e),T=null),T||(T=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:I=!0;break;default:I=!1;break}T&&I&&T.units.push(U)}),l&&T&&(this.pushAccessUnit(T,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new xa(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let n=8,l=8,g;for(let T=0;T<e;T++)l!==0&&(g=t.readEG(),l=(n+g+256)%256),n=l===0?n:l}readSPS(e){const t=new xa(e);let n=0,l=0,g=0,T=0,I,k,U;const j=t.readUByte.bind(t),Z=t.readBits.bind(t),Q=t.readUEG.bind(t),ee=t.readBoolean.bind(t),ne=t.skipBits.bind(t),de=t.skipEG.bind(t),ce=t.skipUEG.bind(t),Ee=this.skipScalingList.bind(this);j();const ke=j();if(Z(5),ne(3),j(),ce(),ke===100||ke===110||ke===122||ke===244||ke===44||ke===83||ke===86||ke===118||ke===128){const vt=Q();if(vt===3&&ne(1),ce(),ce(),ne(1),ee())for(k=vt!==3?8:12,U=0;U<k;U++)ee()&&(U<6?Ee(16,t):Ee(64,t))}ce();const Me=Q();if(Me===0)Q();else if(Me===1)for(ne(1),de(),de(),I=Q(),U=0;U<I;U++)de();ce(),ne(1);const Ye=Q(),lt=Q(),Ct=Z(1);Ct===0&&ne(1),ne(1),ee()&&(n=Q(),l=Q(),g=Q(),T=Q());let rt=[1,1];if(ee()&&ee())switch(j()){case 1:rt=[1,1];break;case 2:rt=[12,11];break;case 3:rt=[10,11];break;case 4:rt=[16,11];break;case 5:rt=[40,33];break;case 6:rt=[24,11];break;case 7:rt=[20,11];break;case 8:rt=[32,11];break;case 9:rt=[80,33];break;case 10:rt=[18,11];break;case 11:rt=[15,11];break;case 12:rt=[64,33];break;case 13:rt=[160,99];break;case 14:rt=[4,3];break;case 15:rt=[3,2];break;case 16:rt=[2,1];break;case 255:{rt=[j()<<8|j(),j()<<8|j()];break}}return{width:Math.ceil((Ye+1)*16-n*2-l*2),height:(2-Ct)*(lt+1)*16-(Ct?2:4)*(g+T),pixelRatio:rt}}}class eu extends to{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,n,l){const g=this.parseNALu(e,n.data,l);let T=this.VideoSample,I,k=!1;n.data=null,T&&g.length&&!e.audFound&&(this.pushAccessUnit(T,e),T=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),g.forEach(U=>{var j,Z;switch(U.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:T||(T=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),T.frame=!0,I=!0;break;case 16:case 17:case 18:case 21:if(I=!0,k){var Q;(Q=T)!=null&&Q.frame&&!T.key&&(this.pushAccessUnit(T,e),T=this.VideoSample=null)}T||(T=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),T.key=!0,T.frame=!0;break;case 19:case 20:I=!0,(j=T)!=null&&j.frame&&!T.key&&(this.pushAccessUnit(T,e),T=this.VideoSample=null),T||(T=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),T.key=!0,T.frame=!0;break;case 39:I=!0,Nt(U.data,2,n.pts,t.samples);break;case 32:I=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=u(e.params,this.readVPS(U.data)),this.initVPS=U.data),e.vps=[U.data];break;case 33:if(I=!0,k=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],U.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const ee=this.readSPS(U.data);e.width=ee.width,e.height=ee.height,e.pixelRatio=ee.pixelRatio,e.codec=ee.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const ne in ee.params)e.params[ne]=ee.params[ne]}this.pushParameterSet(e.sps,U.data,e.vps),T||(T=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),T.key=!0;break;case 34:if(I=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const ee=this.readPPS(U.data);for(const ne in ee)e.params[ne]=ee[ne]}this.pushParameterSet(e.pps,U.data,e.vps)}break;case 35:I=!0,e.audFound=!0,(Z=T)!=null&&Z.frame&&(this.pushAccessUnit(T,e),T=null),T||(T=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;default:I=!1;break}T&&I&&T.units.push(U)}),l&&T&&(this.pushAccessUnit(T,e),this.VideoSample=null)}pushParameterSet(e,t,n){(n&&n[0]===this.initVPS||!n&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let n=0;for(let l=0;l<e.byteLength;l++)l>=2&&e[l]===3&&e[l-1]===0&&e[l-2]===0||(t[n]=e[l],n++);return new Uint8Array(t.buffer,0,n)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new xa(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const n=t.readBits(3),l=t.readBoolean();return{numTemporalLayers:n+1,temporalIdNested:l}}readSPS(e){const t=new xa(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const n=t.readBits(3);t.readBoolean();const l=t.readBits(2),g=t.readBoolean(),T=t.readBits(5),I=t.readUByte(),k=t.readUByte(),U=t.readUByte(),j=t.readUByte(),Z=t.readUByte(),Q=t.readUByte(),ee=t.readUByte(),ne=t.readUByte(),de=t.readUByte(),ce=t.readUByte(),Ee=t.readUByte(),ke=[],Me=[];for(let vn=0;vn<n;vn++)ke.push(t.readBoolean()),Me.push(t.readBoolean());if(n>0)for(let vn=n;vn<8;vn++)t.readBits(2);for(let vn=0;vn<n;vn++)ke[vn]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),Me[vn]&&t.readUByte();t.readUEG();const Ye=t.readUEG();Ye==3&&t.skipBits(1);const lt=t.readUEG(),Ct=t.readUEG(),rt=t.readBoolean();let vt=0,xt=0,at=0,Gt=0;rt&&(vt+=t.readUEG(),xt+=t.readUEG(),at+=t.readUEG(),Gt+=t.readUEG());const dr=t.readUEG(),Lr=t.readUEG(),Ur=t.readUEG(),Rr=t.readBoolean();for(let vn=Rr?0:n;vn<=n;vn++)t.skipUEG(),t.skipUEG(),t.skipUEG();if(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.readBoolean()&&t.readBoolean())for(let ti=0;ti<4;ti++)for(let Ei=0;Ei<(ti===3?2:6);Ei++)if(!t.readBoolean())t.readUEG();else{const Si=Math.min(64,1<<4+(ti<<1));ti>1&&t.readEG();for(let ga=0;ga<Si;ga++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const yr=t.readUEG();let Pr=0;for(let vn=0;vn<yr;vn++){let ti=!1;if(vn!==0&&(ti=t.readBoolean()),ti){vn===yr&&t.readUEG(),t.readBoolean(),t.readUEG();let Ei=0;for(let ra=0;ra<=Pr;ra++){const Si=t.readBoolean();let ga=!1;Si||(ga=t.readBoolean()),(Si||ga)&&Ei++}Pr=Ei}else{const Ei=t.readUEG(),ra=t.readUEG();Pr=Ei+ra;for(let Si=0;Si<Ei;Si++)t.readUEG(),t.readBoolean();for(let Si=0;Si<ra;Si++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const vn=t.readUEG();for(let ti=0;ti<vn;ti++){for(let Ei=0;Ei<Ur+4;Ei++)t.readBits(1);t.readBits(1)}}let hr=0,fr=1,an=1,xn=!0,sn=1,hn=0;t.readBoolean(),t.readBoolean();let ei=!1;if(t.readBoolean()){if(t.readBoolean()){const na=t.readUByte(),ll=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],$a=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];na>0&&na<16?(fr=ll[na-1],an=$a[na-1]):na===255&&(fr=t.readBits(16),an=t.readBits(16))}if(t.readBoolean()&&t.readBoolean(),t.readBoolean()&&(t.readBits(3),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.readUByte(),t.readUByte())),t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(),t.readBoolean(),ei=t.readBoolean(),ei&&(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG()),t.readBoolean()&&(sn=t.readBits(32),hn=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const $a=t.readBoolean(),ul=t.readBoolean();let Da=!1;($a||ul)&&(Da=t.readBoolean(),Da&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),Da&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let cl=0;cl<=n;cl++){xn=t.readBoolean();const Mh=xn||t.readBoolean();let hl=!1;Mh?t.readEG():hl=t.readBoolean();const fl=hl?1:t.readUEG()+1;if($a)for(let La=0;La<fl;La++)t.readUEG(),t.readUEG(),Da&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(ul)for(let La=0;La<fl;La++)t.readUEG(),t.readUEG(),Da&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),hr=t.readUEG())}let yi=lt,Ii=Ct;if(rt){let vn=1,ti=1;Ye===1?vn=ti=2:Ye==2&&(vn=2),yi=lt-vn*xt-vn*vt,Ii=Ct-ti*Gt-ti*at}const ta=l?["A","B","C"][l]:"",Ph=I<<24|k<<16|U<<8|j;let Us=0;for(let vn=0;vn<32;vn++)Us=(Us|(Ph>>vn&1)<<31-vn)>>>0;let Fs=Us.toString(16);return T===1&&Fs==="2"&&(Fs="6"),{codecString:`hvc1.${ta}${T}.${Fs}.${g?"H":"L"}${Ee}.B0`,params:{general_tier_flag:g,general_profile_idc:T,general_profile_space:l,general_profile_compatibility_flags:[I,k,U,j],general_constraint_indicator_flags:[Z,Q,ee,ne,de,ce],general_level_idc:Ee,bit_depth:dr+8,bit_depth_luma_minus8:dr,bit_depth_chroma_minus8:Lr,min_spatial_segmentation_idc:hr,chroma_format_idc:Ye,frame_rate:{fixed:xn,fps:hn/sn}},width:yi,height:Ii,pixelRatio:[fr,an]}}readPPS(e){const t=new xa(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2),t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const l=t.readBoolean(),g=t.readBoolean();let T=1;return g&&l?T=0:g?T=3:l&&(T=2),{parallelismType:T}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const Hn=188;class ji{constructor(e,t,n,l){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=l,this.videoParser=null}static probe(e,t){const n=ji.syncOffset(e);return n>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${n}`),n!==-1}static syncOffset(e){const t=e.length;let n=Math.min(Hn*5,t-Hn)+1,l=0;for(;l<n;){let g=!1,T=-1,I=0;for(let k=l;k<t;k+=Hn)if(e[k]===71&&(t-k===Hn||e[k+Hn]===71)){if(I++,T===-1&&(T=k,T!==0&&(n=Math.min(T+Hn*99,e.length-Hn)+1)),g||(g=as(e,k)===0),g&&I>1&&(T===0&&I>2||k+Hn>n))return T}else{if(I)return-1;break}l++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:Ge[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,n,l){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=ji.createTrack("video"),this._videoTrack.duration=l,this._audioTrack=ji.createTrack("audio",l),this._id3Track=ji.createTrack("id3"),this._txtTrack=ji.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,l=!1){n||(this.sampleAes=null);let g;const T=this._videoTrack,I=this._audioTrack,k=this._id3Track,U=this._txtTrack;let j=T.pid,Z=T.pesData,Q=I.pid,ee=k.pid,ne=I.pesData,de=k.pesData,ce=null,Ee=this.pmtParsed,ke=this._pmtId,Me=e.length;if(this.remainderData&&(e=tt(this.remainderData,e),Me=e.length,this.remainderData=null),Me<Hn&&!l)return this.remainderData=e,{audioTrack:I,videoTrack:T,id3Track:k,textTrack:U};const Ye=Math.max(0,ji.syncOffset(e));Me-=(Me-Ye)%Hn,Me<e.byteLength&&!l&&(this.remainderData=new Uint8Array(e.buffer,Me,e.buffer.byteLength-Me));let lt=0;for(let rt=Ye;rt<Me;rt+=Hn)if(e[rt]===71){const vt=!!(e[rt+1]&64),xt=as(e,rt),at=(e[rt+3]&48)>>4;let Gt;if(at>1){if(Gt=rt+5+e[rt+4],Gt===rt+Hn)continue}else Gt=rt+4;switch(xt){case j:vt&&(Z&&(g=ha(Z,this.logger))&&(this.readyVideoParser(T.segmentCodec),this.videoParser!==null&&this.videoParser.parsePES(T,U,g,!1)),Z={data:[],size:0}),Z&&(Z.data.push(e.subarray(Gt,rt+Hn)),Z.size+=rt+Hn-Gt);break;case Q:if(vt){if(ne&&(g=ha(ne,this.logger)))switch(I.segmentCodec){case"aac":this.parseAACPES(I,g);break;case"mp3":this.parseMPEGPES(I,g);break;case"ac3":this.parseAC3PES(I,g);break}ne={data:[],size:0}}ne&&(ne.data.push(e.subarray(Gt,rt+Hn)),ne.size+=rt+Hn-Gt);break;case ee:vt&&(de&&(g=ha(de,this.logger))&&this.parseID3PES(k,g),de={data:[],size:0}),de&&(de.data.push(e.subarray(Gt,rt+Hn)),de.size+=rt+Hn-Gt);break;case 0:vt&&(Gt+=e[Gt]+1),ke=this._pmtId=tu(e,Gt);break;case ke:{vt&&(Gt+=e[Gt]+1);const dr=ru(e,Gt,this.typeSupported,n,this.observer,this.logger);j=dr.videoPid,j>0&&(T.pid=j,T.segmentCodec=dr.segmentVideoCodec),Q=dr.audioPid,Q>0&&(I.pid=Q,I.segmentCodec=dr.segmentAudioCodec),ee=dr.id3Pid,ee>0&&(k.pid=ee),ce!==null&&!Ee&&(this.logger.warn(`MPEG-TS PMT found at ${rt} after unknown PID '${ce}'. Backtracking to sync byte @${Ye} to parse all TS packets.`),ce=null,rt=Ye-188),Ee=this.pmtParsed=!0;break}case 17:case 8191:break;default:ce=xt;break}}else lt++;lt>0&&ss(this.observer,new Error(`Found ${lt} TS packet/s that do not start with 0x47`),void 0,this.logger),T.pesData=Z,I.pesData=ne,k.pesData=de;const Ct={audioTrack:I,videoTrack:T,id3Track:k,textTrack:U};return l&&this.extractRemainingSamples(Ct),Ct}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:l,textTrack:g}=e,T=n.pesData,I=t.pesData,k=l.pesData;let U;if(T&&(U=ha(T,this.logger))?(this.readyVideoParser(n.segmentCodec),this.videoParser!==null&&(this.videoParser.parsePES(n,g,U,!0),n.pesData=null)):n.pesData=T,I&&(U=ha(I,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,U);break;case"mp3":this.parseMPEGPES(t,U);break;case"ac3":this.parseAC3PES(t,U);break}t.pesData=null}else I!=null&&I.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=I;k&&(U=ha(k,this.logger))?(this.parseID3PES(l,U),l.pesData=null):l.pesData=k}demuxSampleAes(e,t,n){const l=this.demux(e,n,!0,!this.config.progressive),g=this.sampleAes=new Jl(this.observer,this.config,t);return this.decrypt(l,g)}readyVideoParser(e){this.videoParser===null&&(e==="avc"?this.videoParser=new ql:e==="hevc"&&(this.videoParser=new eu))}decrypt(e,t){return new Promise(n=>{const{audioTrack:l,videoTrack:g}=e;l.samples&&l.segmentCodec==="aac"?t.decryptAacSamples(l.samples,0,()=>{g.samples?t.decryptAvcSamples(g.samples,0,0,()=>{n(e)}):n(e)}):g.samples&&t.decryptAvcSamples(g.samples,0,0,()=>{n(e)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(e,t){let n=0;const l=this.aacOverFlow;let g=t.data;if(l){this.aacOverFlow=null;const Z=l.missing,Q=l.sample.unit.byteLength;if(Z===-1)g=tt(l.sample.unit,g);else{const ee=Q-Z;l.sample.unit.set(g.subarray(0,Z),ee),e.samples.push(l.sample),n=l.missing}}let T,I;for(T=n,I=g.length;T<I-1&&!Pa(g,T);T++);if(T!==n){let Z;const Q=T<I-1;if(Q?Z=`AAC PES did not start with ADTS header,offset:${T}`:Z="No ADTS header found in AAC PES",ss(this.observer,new Error(Z),Q,this.logger),!Q)return}Vs(e,this.observer,g,T,this.audioCodec);let k;if(t.pts!==void 0)k=t.pts;else if(l){const Z=Hs(e.samplerate);k=l.sample.pts+Z}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let U=0,j;for(;T<I;)if(j=zs(e,g,T,k,U),T+=j.length,j.missing){this.aacOverFlow=j;break}else for(U++;T<I-1&&!Pa(g,T);T++);}parseMPEGPES(e,t){const n=t.data,l=n.length;let g=0,T=0;const I=t.pts;if(I===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;T<l;)if($s(n,T)){const k=Xs(e,n,T,I,g);if(k)T+=k.length,g++;else break}else T++}parseAC3PES(e,t){{const n=t.data,l=t.pts;if(l===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const g=n.length;let T=0,I=0,k;for(;I<g&&(k=qs(e,n,I,l,T++))>0;)I+=k}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=u({},t,{type:this._videoTrack?di.emsg:di.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function as(b,e){return((b[e+1]&31)<<8)+b[e+2]}function tu(b,e){return(b[e+10]&31)<<8|b[e+11]}function ru(b,e,t,n,l,g){const T={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},I=(b[e+1]&15)<<8|b[e+2],k=e+3+I-4,U=(b[e+10]&15)<<8|b[e+11];for(e+=12+U;e<k;){const j=as(b,e),Z=(b[e+3]&15)<<8|b[e+4];switch(b[e]){case 207:if(!n){os("ADTS AAC",g);break}case 15:T.audioPid===-1&&(T.audioPid=j);break;case 21:T.id3Pid===-1&&(T.id3Pid=j);break;case 219:if(!n){os("H.264",g);break}case 27:T.videoPid===-1&&(T.videoPid=j);break;case 3:case 4:!t.mpeg&&!t.mp3?g.log("MPEG audio found, not supported in this browser"):T.audioPid===-1&&(T.audioPid=j,T.segmentAudioCodec="mp3");break;case 193:if(!n){os("AC-3",g);break}case 129:t.ac3?T.audioPid===-1&&(T.audioPid=j,T.segmentAudioCodec="ac3"):g.log("AC-3 audio found, not supported in this browser");break;case 6:if(T.audioPid===-1&&Z>0){let Q=e+5,ee=Z;for(;ee>2;){switch(b[Q]){case 106:t.ac3!==!0?g.log("AC-3 audio found, not supported in this browser for now"):(T.audioPid=j,T.segmentAudioCodec="ac3");break}const de=b[Q+1]+2;Q+=de,ee-=de}}break;case 194:case 135:return ss(l,new Error("Unsupported EC-3 in M2TS found"),void 0,g),T;case 36:T.videoPid===-1&&(T.videoPid=j,T.segmentVideoCodec="hevc",g.log("HEVC in M2TS found"));break}e+=Z+5}return T}function ss(b,e,t,n){n.warn(`parsing error: ${e.message}`),b.emit(y.ERROR,y.ERROR,{type:D.MEDIA_ERROR,details:W.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function os(b,e){e.log(`${b} with AES-128-CBC encryption found in unencrypted stream`)}function ha(b,e){let t=0,n,l,g,T,I;const k=b.data;if(!b||b.size===0)return null;for(;k[0].length<19&&k.length>1;)k[0]=tt(k[0],k[1]),k.splice(1,1);if(n=k[0],(n[0]<<16)+(n[1]<<8)+n[2]===1){if(l=(n[4]<<8)+n[5],l&&l>b.size-6)return null;const j=n[7];j&192&&(T=(n[9]&14)*536870912+(n[10]&255)*4194304+(n[11]&254)*16384+(n[12]&255)*128+(n[13]&254)/2,j&64?(I=(n[14]&14)*536870912+(n[15]&255)*4194304+(n[16]&254)*16384+(n[17]&255)*128+(n[18]&254)/2,T-I>60*9e4&&(e.warn(`${Math.round((T-I)/9e4)}s delta between PTS and DTS, align them`),T=I)):I=T),g=n[8];let Z=g+9;if(b.size<=Z)return null;b.size-=Z;const Q=new Uint8Array(b.size);for(let ee=0,ne=k.length;ee<ne;ee++){n=k[ee];let de=n.byteLength;if(Z)if(Z>de){Z-=de;continue}else n=n.subarray(Z),de-=Z,Z=0;Q.set(n,t),t+=de}return l&&(l-=g+3),{data:Q,pts:T,dts:I,len:l}}return null}class nu{static getSilentFrame(e,t){switch(e){case"mp4a.40.2":if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(t===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(t===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}}}const Zi=Math.pow(2,32)-1;class ct{static init(){ct.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let e;for(e in ct.types)ct.types.hasOwnProperty(e)&&(ct.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);ct.HDLR_TYPES={video:t,audio:n};const l=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),g=new Uint8Array([0,0,0,0,0,0,0,0]);ct.STTS=ct.STSC=ct.STCO=g,ct.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),ct.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),ct.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),ct.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const T=new Uint8Array([105,115,111,109]),I=new Uint8Array([97,118,99,49]),k=new Uint8Array([0,0,0,1]);ct.FTYP=ct.box(ct.types.ftyp,T,k,T,I),ct.DINF=ct.box(ct.types.dinf,ct.box(ct.types.dref,l))}static box(e,...t){let n=8,l=t.length;const g=l;for(;l--;)n+=t[l].byteLength;const T=new Uint8Array(n);for(T[0]=n>>24&255,T[1]=n>>16&255,T[2]=n>>8&255,T[3]=n&255,T.set(e,4),l=0,n=8;l<g;l++)T.set(t[l],n),n+=t[l].byteLength;return T}static hdlr(e){return ct.box(ct.types.hdlr,ct.HDLR_TYPES[e])}static mdat(e){return ct.box(ct.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(Zi+1)),l=Math.floor(t%(Zi+1));return ct.box(ct.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,l>>24,l>>16&255,l>>8&255,l&255,85,196,0,0]))}static mdia(e){return ct.box(ct.types.mdia,ct.mdhd(e.timescale||0,e.duration||0),ct.hdlr(e.type),ct.minf(e))}static mfhd(e){return ct.box(ct.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"?ct.box(ct.types.minf,ct.box(ct.types.smhd,ct.SMHD),ct.DINF,ct.stbl(e)):ct.box(ct.types.minf,ct.box(ct.types.vmhd,ct.VMHD),ct.DINF,ct.stbl(e))}static moof(e,t,n){return ct.box(ct.types.moof,ct.mfhd(e),ct.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=ct.trak(e[t]);return ct.box.apply(null,[ct.types.moov,ct.mvhd(e[0].timescale||0,e[0].duration||0)].concat(n).concat(ct.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=ct.trex(e[t]);return ct.box.apply(null,[ct.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(Zi+1)),l=Math.floor(t%(Zi+1)),g=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,l>>24,l>>16&255,l>>8&255,l&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 ct.box(ct.types.mvhd,g)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let l,g;for(l=0;l<t.length;l++)g=t[l].flags,n[l+4]=g.dependsOn<<4|g.isDependedOn<<2|g.hasRedundancy;return ct.box(ct.types.sdtp,n)}static stbl(e){return ct.box(ct.types.stbl,ct.stsd(e),ct.box(ct.types.stts,ct.STTS),ct.box(ct.types.stsc,ct.STSC),ct.box(ct.types.stsz,ct.STSZ),ct.box(ct.types.stco,ct.STCO))}static avc1(e){let t=[],n=[],l,g,T;for(l=0;l<e.sps.length;l++)g=e.sps[l],T=g.byteLength,t.push(T>>>8&255),t.push(T&255),t=t.concat(Array.prototype.slice.call(g));for(l=0;l<e.pps.length;l++)g=e.pps[l],T=g.byteLength,n.push(T>>>8&255),n.push(T&255),n=n.concat(Array.prototype.slice.call(g));const I=ct.box(ct.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),k=e.width,U=e.height,j=e.pixelRatio[0],Z=e.pixelRatio[1];return ct.box(ct.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,k>>8&255,k&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]),I,ct.box(ct.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),ct.box(ct.types.pasp,new Uint8Array([j>>24,j>>16&255,j>>8&255,j&255,Z>>24,Z>>16&255,Z>>8&255,Z&255])))}static esds(e){const t=e.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...t,6,1,2])}static audioStsd(e){const t=e.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount||0,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return ct.box(ct.types.mp4a,ct.audioStsd(e),ct.box(ct.types.esds,ct.esds(e)))}static mp3(e){return ct.box(ct.types[".mp3"],ct.audioStsd(e))}static ac3(e){return ct.box(ct.types["ac-3"],ct.audioStsd(e),ct.box(ct.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return ct.box(ct.types.stsd,ct.STSD,ct.mp4a(e));if(t==="ac3"&&e.config)return ct.box(ct.types.stsd,ct.STSD,ct.ac3(e));if(t==="mp3"&&e.codec==="mp3")return ct.box(ct.types.stsd,ct.STSD,ct.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return ct.box(ct.types.stsd,ct.STSD,ct.avc1(e));if(t==="hevc"&&e.vps)return ct.box(ct.types.stsd,ct.STSD,ct.hvc1(e))}else throw new Error("video track missing pps or sps");throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`)}static tkhd(e){const t=e.id,n=(e.duration||0)*(e.timescale||0),l=e.width||0,g=e.height||0,T=Math.floor(n/(Zi+1)),I=Math.floor(n%(Zi+1));return ct.box(ct.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,T>>24,T>>16&255,T>>8&255,T&255,I>>24,I>>16&255,I>>8&255,I&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,l>>8&255,l&255,0,0,g>>8&255,g&255,0,0]))}static traf(e,t){const n=ct.sdtp(e),l=e.id,g=Math.floor(t/(Zi+1)),T=Math.floor(t%(Zi+1));return ct.box(ct.types.traf,ct.box(ct.types.tfhd,new Uint8Array([0,0,0,0,l>>24,l>>16&255,l>>8&255,l&255])),ct.box(ct.types.tfdt,new Uint8Array([1,0,0,0,g>>24,g>>16&255,g>>8&255,g&255,T>>24,T>>16&255,T>>8&255,T&255])),ct.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,ct.box(ct.types.trak,ct.tkhd(e),ct.mdia(e))}static trex(e){const t=e.id;return ct.box(ct.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||[],l=n.length,g=12+16*l,T=new Uint8Array(g);let I,k,U,j,Z,Q;for(t+=8+g,T.set([e.type==="video"?1:0,0,15,1,l>>>24&255,l>>>16&255,l>>>8&255,l&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),I=0;I<l;I++)k=n[I],U=k.duration,j=k.size,Z=k.flags,Q=k.cts,T.set([U>>>24&255,U>>>16&255,U>>>8&255,U&255,j>>>24&255,j>>>16&255,j>>>8&255,j&255,Z.isLeading<<2|Z.dependsOn,Z.isDependedOn<<6|Z.hasRedundancy<<4|Z.paddingValue<<1|Z.isNonSync,Z.degradPrio&61440,Z.degradPrio&15,Q>>>24&255,Q>>>16&255,Q>>>8&255,Q&255],12+16*I);return ct.box(ct.types.trun,T)}static initSegment(e){ct.types||ct.init();const t=ct.moov(e);return tt(ct.FTYP,t)}static hvc1(e){const t=e.params,n=[e.vps,e.sps,e.pps],l=4,g=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),l-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),n.length]);let T=g.length;for(let ne=0;ne<n.length;ne+=1){T+=3;for(let de=0;de<n[ne].length;de+=1)T+=2+n[ne][de].length}const I=new Uint8Array(T);I.set(g,0),T=g.length;const k=n.length-1;for(let ne=0;ne<n.length;ne+=1){I.set(new Uint8Array([32+ne|(ne===k?128:0),0,n[ne].length]),T),T+=3;for(let de=0;de<n[ne].length;de+=1)I.set(new Uint8Array([n[ne][de].length>>8,n[ne][de].length&255]),T),T+=2,I.set(n[ne][de],T),T+=n[ne][de].length}const U=ct.box(ct.types.hvcC,I),j=e.width,Z=e.height,Q=e.pixelRatio[0],ee=e.pixelRatio[1];return ct.box(ct.types.hvc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,j>>8&255,j&255,Z>>8&255,Z&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),U,ct.box(ct.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),ct.box(ct.types.pasp,new Uint8Array([Q>>24,Q>>16&255,Q>>8&255,Q&255,ee>>24,ee>>16&255,ee>>8&255,ee&255])))}}ct.types=void 0,ct.HDLR_TYPES=void 0,ct.STTS=void 0,ct.STSC=void 0,ct.STCO=void 0,ct.STSZ=void 0,ct.VMHD=void 0,ct.SMHD=void 0,ct.STSD=void 0,ct.FTYP=void 0,ct.DINF=void 0;const ro=9e4;function ls(b,e,t=1,n=!1){const l=b*e*t;return n?Math.round(l):l}function iu(b,e,t=1,n=!1){return ls(b,e,1/t,n)}function Ta(b,e=!1){return ls(b,1e3,1/ro,e)}function au(b,e=1){return ls(b,ro,1/e)}const su=10*1e3,ou=1024,lu=1152,uu=1536;let fa=null,us=null;function no(b,e,t,n){return{duration:e,size:t,cts:n,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:b?2:1,isNonSync:b?0:1}}}class Na extends m{constructor(e,t,n,l){if(super("mp4-remuxer",l),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.ISGenerated=!1,fa===null){const T=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);fa=T?parseInt(T[1]):0}if(us===null){const g=navigator.userAgent.match(/Safari\/(\d+)/i);us=g?parseInt(g[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){this.log("initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e[0].pts,l=e.reduce((g,T)=>{let I=T.pts,k=I-g;return k<-4294967296&&(t=!0,I=vi(I,n),k=I-g),k>0?g:I},n);return t&&this.debug("PTS rollover detected"),l}remux(e,t,n,l,g,T,I,k){let U,j,Z,Q,ee,ne,de=g,ce=g;const Ee=e.pid>-1,ke=t.pid>-1,Me=t.samples.length,Ye=e.samples.length>0,lt=I&&Me>0||Me>1;if((!Ee||Ye)&&(!ke||lt)||this.ISGenerated||I){if(this.ISGenerated){var rt,vt,xt,at;const Ur=this.videoTrackConfig;(Ur&&(t.width!==Ur.width||t.height!==Ur.height||((rt=t.pixelRatio)==null?void 0:rt[0])!==((vt=Ur.pixelRatio)==null?void 0:vt[0])||((xt=t.pixelRatio)==null?void 0:xt[1])!==((at=Ur.pixelRatio)==null?void 0:at[1]))||!Ur&<||this.nextAudioTs===null&&Ye)&&this.resetInitSegment()}this.ISGenerated||(Z=this.generateIS(e,t,g,T));const Gt=this.isVideoContiguous;let dr=-1,Lr;if(lt&&(dr=cu(t.samples),!Gt&&this.config.forceKeyFrameOnDiscontinuity))if(ne=!0,dr>0){this.warn(`Dropped ${dr} out of ${Me} video samples due to a missing keyframe`);const Ur=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(dr),t.dropped+=dr,ce+=(t.samples[0].pts-Ur)/t.inputTimeScale,Lr=ce}else dr===-1&&(this.warn(`No keyframe found out of ${Me} video samples`),ne=!1);if(this.ISGenerated){if(Ye&<){const Ur=this.getVideoStartPts(t.samples),lr=(vi(e.samples[0].pts,Ur)-Ur)/t.inputTimeScale;de+=Math.max(0,lr),ce+=Math.max(0,-lr)}if(Ye){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),Z=this.generateIS(e,t,g,T)),j=this.remuxAudio(e,de,this.isAudioContiguous,T,ke||lt||k===A.AUDIO?ce:void 0),lt){const Ur=j?j.endPTS-j.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),Z=this.generateIS(e,t,g,T)),U=this.remuxVideo(t,ce,Gt,Ur)}}else lt&&(U=this.remuxVideo(t,ce,Gt,0));U&&(U.firstKeyFrame=dr,U.independent=dr!==-1,U.firstKeyFramePTS=Lr)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(ee=io(n,g,this._initPTS,this._initDTS)),l.samples.length&&(Q=ao(l,g,this._initPTS))),{audio:j,video:U,initSegment:Z,independent:ne,text:Q,id3:ee}}generateIS(e,t,n,l){const g=e.samples,T=t.samples,I=this.typeSupported,k={},U=this._initPTS;let j=!U||l,Z="audio/mp4",Q,ee,ne,de=-1;if(j&&(Q=ee=1/0),e.config&&g.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":I.mpeg?(Z="audio/mpeg",e.codec=""):I.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}k.audio={id:"audio",container:Z,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&I.mpeg?new Uint8Array(0):ct.initSegment([e]),metadata:{channelCount:e.channelCount}},j&&(de=e.id,ne=e.inputTimeScale,!U||ne!==U.timescale?Q=ee=g[0].pts-Math.round(ne*n):j=!1)}if(t.sps&&t.pps&&T.length){if(t.timescale=t.inputTimeScale,k.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:ct.initSegment([t]),metadata:{width:t.width,height:t.height}},j)if(de=t.id,ne=t.inputTimeScale,!U||ne!==U.timescale){const ce=this.getVideoStartPts(T),Ee=Math.round(ne*n);ee=Math.min(ee,vi(T[0].dts,ce)-Ee),Q=Math.min(Q,ce-Ee)}else j=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(k).length)return this.ISGenerated=!0,j?(U&&this.warn(`Timestamps at playlist time: ${l?"":"~"}${n} ${Q/ne} != initPTS: ${U.baseTime/U.timescale} (${U.baseTime}/${U.timescale}) trackId: ${U.trackId}`),this.log(`Found initPTS at playlist time: ${n} offset: ${Q/ne} (${Q}/${ne}) trackId: ${de}`),this._initPTS={baseTime:Q,timescale:ne,trackId:de},this._initDTS={baseTime:ee,timescale:ne,trackId:de}):Q=ne=void 0,{tracks:k,initPTS:Q,timescale:ne,trackId:de}}remuxVideo(e,t,n,l){const g=e.inputTimeScale,T=e.samples,I=[],k=T.length,U=this._initPTS,j=U.baseTime*g/U.timescale;let Z=this.nextVideoTs,Q=8,ee=this.videoSampleDuration,ne,de,ce=Number.POSITIVE_INFINITY,Ee=Number.NEGATIVE_INFINITY,ke=!1;if(!n||Z===null){const hr=j+t*g,fr=T[0].pts-vi(T[0].dts,T[0].pts);fa&&Z!==null&&Math.abs(hr-fr-(Z+j))<15e3?n=!0:Z=hr-fr-j}const Me=Z+j;for(let hr=0;hr<k;hr++){const fr=T[hr];fr.pts=vi(fr.pts,Me),fr.dts=vi(fr.dts,Me),fr.dts<T[hr>0?hr-1:hr].dts&&(ke=!0)}ke&&T.sort(function(hr,fr){const an=hr.dts-fr.dts,xn=hr.pts-fr.pts;return an||xn}),ne=T[0].dts,de=T[T.length-1].dts;const Ye=de-ne,lt=Ye?Math.round(Ye/(k-1)):ee||e.inputTimeScale/30;if(n){const hr=ne-Me,fr=hr>lt,an=hr<-1;if((fr||an)&&(fr?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Ta(hr,!0)} ms (${hr}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Ta(-hr,!0)} ms (${hr}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!an||Me>=T[0].pts||fa)){ne=Me;const xn=T[0].pts-hr;if(fr)T[0].dts=ne,T[0].pts=xn;else{let sn=!0;for(let hn=0;hn<T.length&&!(T[hn].dts>xn&&sn);hn++){const ei=T[hn].pts;if(T[hn].dts-=hr,T[hn].pts-=hr,hn<T.length-1){const Xn=T[hn+1].pts,yi=T[hn].pts,Ii=Xn<=yi,ta=Xn<=ei;sn=Ii==ta}}}this.log(`Video: Initial PTS/DTS adjusted: ${Ta(xn,!0)}/${Ta(ne,!0)}, delta: ${Ta(hr,!0)} ms`)}}ne=Math.max(0,ne);let Ct=0,rt=0,vt=ne;for(let hr=0;hr<k;hr++){const fr=T[hr],an=fr.units,xn=an.length;let sn=0;for(let hn=0;hn<xn;hn++)sn+=an[hn].data.length;rt+=sn,Ct+=xn,fr.length=sn,fr.dts<vt?(fr.dts=vt,vt+=lt/4|0||1):vt=fr.dts,ce=Math.min(fr.pts,ce),Ee=Math.max(fr.pts,Ee)}de=T[k-1].dts;const xt=rt+4*Ct+8;let at;try{at=new Uint8Array(xt)}catch(hr){this.observer.emit(y.ERROR,y.ERROR,{type:D.MUX_ERROR,details:W.REMUX_ALLOC_ERROR,fatal:!1,error:hr,bytes:xt,reason:`fail allocating video mdat ${xt}`});return}const Gt=new DataView(at.buffer);Gt.setUint32(0,xt),at.set(ct.types.mdat,4);let dr=!1,Lr=Number.POSITIVE_INFINITY,Ur=Number.POSITIVE_INFINITY,Rr=Number.NEGATIVE_INFINITY,lr=Number.NEGATIVE_INFINITY;for(let hr=0;hr<k;hr++){const fr=T[hr],an=fr.units;let xn=0;for(let ei=0,Xn=an.length;ei<Xn;ei++){const yi=an[ei],Ii=yi.data,ta=yi.data.byteLength;Gt.setUint32(Q,ta),Q+=4,at.set(Ii,Q),Q+=ta,xn+=4+ta}let sn;if(hr<k-1)ee=T[hr+1].dts-fr.dts,sn=T[hr+1].pts-fr.pts;else{const ei=this.config,Xn=hr>0?fr.dts-T[hr-1].dts:lt;if(sn=hr>0?fr.pts-T[hr-1].pts:lt,ei.stretchShortVideoTrack&&this.nextAudioTs!==null){const yi=Math.floor(ei.maxBufferHole*g),Ii=(l?ce+l*g:this.nextAudioTs+j)-fr.pts;Ii>yi?(ee=Ii-Xn,ee<0?ee=Xn:dr=!0,this.log(`It is approximately ${Ii/90} ms to the next segment; using duration ${ee/90} ms for the last video frame.`)):ee=Xn}else ee=Xn}const hn=Math.round(fr.pts-fr.dts);Lr=Math.min(Lr,ee),Rr=Math.max(Rr,ee),Ur=Math.min(Ur,sn),lr=Math.max(lr,sn),I.push(no(fr.key,ee,xn,hn))}if(I.length){if(fa){if(fa<70){const hr=I[0].flags;hr.dependsOn=2,hr.isNonSync=0}}else if(us&&lr-Ur<Rr-Lr&</Rr<.025&&I[0].cts===0){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let hr=ne;for(let fr=0,an=I.length;fr<an;fr++){const xn=hr+I[fr].duration,sn=hr+I[fr].cts;if(fr<an-1){const hn=xn+I[fr+1].cts;I[fr].duration=hn-sn}else I[fr].duration=fr?I[fr-1].duration:lt;I[fr].cts=0,hr=xn}}}ee=dr||!ee?lt:ee;const Ir=de+ee;this.nextVideoTs=Z=Ir-j,this.videoSampleDuration=ee,this.isVideoContiguous=!0;const Zr={data1:ct.moof(e.sequenceNumber++,ne,u(e,{samples:I})),data2:at,startPTS:(ce-j)/g,endPTS:(Ee+ee-j)/g,startDTS:(ne-j)/g,endDTS:Z/g,type:"video",hasAudio:!1,hasVideo:!0,nb:I.length,dropped:e.dropped};return e.samples=[],e.dropped=0,Zr}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return lu;case"ac3":return uu;default:return ou}}remuxAudio(e,t,n,l,g){const T=e.inputTimeScale,I=e.samplerate?e.samplerate:T,k=T/I,U=this.getSamplesPerFrame(e),j=U*k,Z=this._initPTS,Q=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,ee=[],ne=g!==void 0;let de=e.samples,ce=Q?0:8,Ee=this.nextAudioTs||-1;const ke=Z.baseTime*T/Z.timescale,Me=ke+t*T;if(this.isAudioContiguous=n=n||de.length&&Ee>0&&(l&&Math.abs(Me-(Ee+ke))<9e3||Math.abs(vi(de[0].pts,Me)-(Ee+ke))<20*j),de.forEach(function(lr){lr.pts=vi(lr.pts,Me)}),!n||Ee<0){if(de=de.filter(lr=>lr.pts>=0),!de.length)return;g===0?Ee=0:l&&!ne?Ee=Math.max(0,Me-ke):Ee=de[0].pts-ke}if(e.segmentCodec==="aac"){const lr=this.config.maxAudioFramesDrift;for(let Ir=0,yr=Ee+ke;Ir<de.length;Ir++){const Pr=de[Ir],Zr=Pr.pts,hr=Zr-yr,fr=Math.abs(1e3*hr/T);if(hr<=-lr*j&&ne)Ir===0&&(this.warn(`Audio frame @ ${(Zr/T).toFixed(3)}s overlaps marker by ${Math.round(1e3*hr/T)} ms.`),this.nextAudioTs=Ee=Zr-ke,yr=Zr);else if(hr>=lr*j&&fr<su&&ne){let an=Math.round(hr/j);for(yr=Zr-an*j;yr<0&&an&&j;)an--,yr+=j;Ir===0&&(this.nextAudioTs=Ee=yr-ke),this.warn(`Injecting ${an} audio frames @ ${((yr-ke)/T).toFixed(3)}s due to ${Math.round(1e3*hr/T)} ms gap.`);for(let xn=0;xn<an;xn++){let sn=nu.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);sn||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),sn=Pr.unit.subarray()),de.splice(Ir,0,{unit:sn,pts:yr}),yr+=j,Ir++}}Pr.pts=yr,yr+=j}}let Ye=null,lt=null,Ct,rt=0,vt=de.length;for(;vt--;)rt+=de[vt].unit.byteLength;for(let lr=0,Ir=de.length;lr<Ir;lr++){const yr=de[lr],Pr=yr.unit;let Zr=yr.pts;if(lt!==null){const fr=ee[lr-1];fr.duration=Math.round((Zr-lt)/k)}else if(n&&e.segmentCodec==="aac"&&(Zr=Ee+ke),Ye=Zr,rt>0){rt+=ce;try{Ct=new Uint8Array(rt)}catch(fr){this.observer.emit(y.ERROR,y.ERROR,{type:D.MUX_ERROR,details:W.REMUX_ALLOC_ERROR,fatal:!1,error:fr,bytes:rt,reason:`fail allocating audio mdat ${rt}`});return}Q||(new DataView(Ct.buffer).setUint32(0,rt),Ct.set(ct.types.mdat,4))}else return;Ct.set(Pr,ce);const hr=Pr.byteLength;ce+=hr,ee.push(no(!0,U,hr,0)),lt=Zr}const xt=ee.length;if(!xt)return;const at=ee[ee.length-1];Ee=lt-ke,this.nextAudioTs=Ee+k*at.duration;const Gt=Q?new Uint8Array(0):ct.moof(e.sequenceNumber++,Ye/k,u({},e,{samples:ee}));e.samples=[];const dr=(Ye-ke)/T,Lr=Ee/T,Rr={data1:Gt,data2:Ct,startPTS:dr,endPTS:Lr,startDTS:dr,endDTS:Lr,type:"audio",hasAudio:!0,hasVideo:!1,nb:xt};return this.isAudioContiguous=!0,Rr}}function vi(b,e){let t;if(e===null)return b;for(e<b?t=-8589934592:t=8589934592;Math.abs(b-e)>4294967296;)b+=t;return b}function cu(b){for(let e=0;e<b.length;e++)if(b[e].key)return e;return-1}function io(b,e,t,n){const l=b.samples.length;if(!l)return;const g=b.inputTimeScale;for(let I=0;I<l;I++){const k=b.samples[I];k.pts=vi(k.pts-t.baseTime*g/t.timescale,e*g)/g,k.dts=vi(k.dts-n.baseTime*g/n.timescale,e*g)/g}const T=b.samples;return b.samples=[],{samples:T}}function ao(b,e,t){const n=b.samples.length;if(!n)return;const l=b.inputTimeScale;for(let T=0;T<n;T++){const I=b.samples[T];I.pts=vi(I.pts-t.baseTime*l/t.timescale,e*l)/l}b.samples.sort((T,I)=>T.pts-I.pts);const g=b.samples;return b.samples=[],{samples:g}}class hu extends m{constructor(e,t,n,l){super("passthrough-remuxer",l),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(e){this.lastEndTime=null;const t=this.initPTS;t&&e&&t.baseTime===e.baseTime&&t.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,n,l){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(e,l),this.emitInitSegment=!0}generateInitSegment(e,t){let{audioCodec:n,videoCodec:l}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const{audio:g,video:T}=this.initData=Fe(e);if(t)Te(e,t);else{const k=g||T;k!=null&&k.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${k.codec}")!`)}g&&(n=so(g,H.AUDIO,this)),T&&(l=so(T,H.VIDEO,this));const I={};g&&T?I.audiovideo={container:"video/mp4",codec:n+","+l,supplemental:T.supplemental,encrypted:T.encrypted,initSegment:e,id:"main"}:g?I.audio={container:"audio/mp4",codec:n,encrypted:g.encrypted,initSegment:e,id:"audio"}:T?I.video={container:"video/mp4",codec:l,supplemental:T.supplemental,encrypted:T.encrypted,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=I}remux(e,t,n,l,g,T){var I,k;let{initPTS:U,lastEndTime:j}=this;const Z={audio:void 0,video:void 0,text:l,id3:n,initSegment:void 0};te(j)||(j=this.lastEndTime=g||0);const Q=t.samples;if(!Q.length)return Z;const ee={initPTS:void 0,timescale:void 0,trackId:void 0};let ne=this.initData;if((I=ne)!=null&&I.length||(this.generateInitSegment(Q),ne=this.initData),!((k=ne)!=null&&k.length))return this.warn("Failed to generate initSegment."),Z;this.emitInitSegment&&(ee.tracks=this.initTracks,this.emitInitSegment=!1);const de=Be(Q,ne,this),ce=ne.audio?de[ne.audio.id]:null,Ee=ne.video?de[ne.video.id]:null,ke=Ba(Ee,1/0),Me=Ba(ce,1/0),Ye=Ba(Ee,0,!0),lt=Ba(ce,0,!0);let Ct=g,rt=0;const vt=ce&&(!Ee||!U&&Me<ke||U&&U.trackId===ne.audio.id),xt=vt?ce:Ee;if(xt){const yr=xt.timescale,Pr=xt.start-g*yr,Zr=vt?ne.audio.id:ne.video.id;Ct=xt.start/yr,rt=vt?lt-Me:Ye-ke,(T||!U)&&(fu(U,Ct,g,rt)||yr!==U.timescale)&&(U&&this.warn(`Timestamps at playlist time: ${T?"":"~"}${g} ${Pr/yr} != initPTS: ${U.baseTime/U.timescale} (${U.baseTime}/${U.timescale}) trackId: ${U.trackId}`),this.log(`Found initPTS at playlist time: ${g} offset: ${Ct-g} (${Pr}/${yr}) trackId: ${Zr}`),U=null,ee.initPTS=Pr,ee.timescale=yr,ee.trackId=Zr)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${g}`);U?(ee.initPTS=U.baseTime,ee.timescale=U.timescale,ee.trackId=U.trackId):((!ee.timescale||ee.trackId===void 0||ee.initPTS===void 0)&&(this.warn("Could not set initPTS"),ee.initPTS=Ct,ee.timescale=1,ee.trackId=-1),this.initPTS=U={baseTime:ee.initPTS,timescale:ee.timescale,trackId:ee.trackId});const at=Ct-U.baseTime/U.timescale,Gt=at+rt;rt>0?this.lastEndTime=Gt:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const dr=!!ne.audio,Lr=!!ne.video;let Ur="";dr&&(Ur+="audio"),Lr&&(Ur+="video");const Rr=(ne.audio?ne.audio.encrypted:!1)||(ne.video?ne.video.encrypted:!1),lr={data1:Q,startPTS:at,startDTS:at,endPTS:Gt,endDTS:Gt,type:Ur,hasAudio:dr,hasVideo:Lr,nb:1,dropped:0,encrypted:Rr};Z.audio=dr&&!Lr?lr:void 0,Z.video=Lr?lr:void 0;const Ir=Ee==null?void 0:Ee.sampleCount;if(Ir){const yr=Ee.keyFrameIndex,Pr=yr!==-1;lr.nb=Ir,lr.dropped=yr===0||this.isVideoContiguous?0:Pr?yr:Ir,lr.independent=Pr,lr.firstKeyFrame=yr,Pr&&Ee.keyFrameStart&&(lr.firstKeyFramePTS=(Ee.keyFrameStart-U.baseTime)/U.timescale),this.isVideoContiguous||(Z.independent=Pr),this.isVideoContiguous||(this.isVideoContiguous=Pr),lr.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${yr}/${Ir} dropped: ${lr.dropped} start: ${lr.firstKeyFramePTS||"NA"}`)}return Z.initSegment=ee,Z.id3=io(n,g,U,U),l.samples.length&&(Z.text=ao(l,g,U)),Z}}function Ba(b,e,t=!1){return(b==null?void 0:b.start)!==void 0?(b.start+(t?b.duration:0))/b.timescale:e}function fu(b,e,t,n){if(b===null)return!0;const l=Math.max(n,1),g=e-b.baseTime/b.timescale;return Math.abs(g-t)>l}function so(b,e,t){const n=b.codec;return n&&n.length>4?n:e===H.AUDIO?n==="ec-3"||n==="ac-3"||n==="alac"?n:n==="fLaC"||n==="Opus"?Vt(n,!1):(t.warn(`Unhandled audio codec "${n}" in mp4 MAP`),n||"mp4a"):(t.warn(`Unhandled video codec "${n}" in mp4 MAP`),n||"avc1")}let Ui;try{Ui=self.performance.now.bind(self.performance)}catch(b){Ui=Date.now}const Ua=[{demux:Ql,remux:hu},{demux:ji,remux:Na},{demux:Zl,remux:Na},{demux:Yl,remux:Na}];Ua.splice(2,0,{demux:Xl,remux:Na});class oo{constructor(e,t,n,l,g,T){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=n,this.id=g,this.logger=T}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,l){const g=n.transmuxing;g.executeStart=Ui();let T=new Uint8Array(e);const{currentTransmuxState:I,transmuxConfig:k}=this;l&&(this.currentTransmuxState=l);const{contiguous:U,discontinuity:j,trackSwitch:Z,accurateTimeOffset:Q,timeOffset:ee,initSegmentChange:ne}=l||I,{audioCodec:de,videoCodec:ce,defaultInitPts:Ee,duration:ke,initSegmentData:Me}=k,Ye=du(T,t);if(Ye&&On(Ye.method)){const vt=this.getDecrypter(),xt=tn(Ye.method);if(vt.isSync()){let at=vt.softwareDecrypt(T,Ye.key.buffer,Ye.iv.buffer,xt);if(n.part>-1){const dr=vt.flush();at=dr&&dr.buffer}if(!at)return g.executeEnd=Ui(),cs(n);T=new Uint8Array(at)}else return this.asyncResult=!0,this.decryptionPromise=vt.webCryptoDecrypt(T,Ye.key.buffer,Ye.iv.buffer,xt).then(at=>{const Gt=this.push(at,null,n);return this.decryptionPromise=null,Gt}),this.decryptionPromise}const lt=this.needsProbing(j,Z);if(lt){const vt=this.configureTransmuxer(T);if(vt)return this.logger.warn(`[transmuxer] ${vt.message}`),this.observer.emit(y.ERROR,y.ERROR,{type:D.MEDIA_ERROR,details:W.FRAG_PARSING_ERROR,fatal:!1,error:vt,reason:vt.message}),g.executeEnd=Ui(),cs(n)}(j||Z||ne||lt)&&this.resetInitSegment(Me,de,ce,ke,t),(j||ne||lt)&&this.resetInitialTimestamp(Ee),U||this.resetContiguity();const Ct=this.transmux(T,Ye,ee,Q,n);this.asyncResult=Aa(Ct);const rt=this.currentTransmuxState;return rt.contiguous=!0,rt.discontinuity=!1,rt.trackSwitch=!1,g.executeEnd=Ui(),Ct}flush(e){const t=e.transmuxing;t.executeStart=Ui();const{decrypter:n,currentTransmuxState:l,decryptionPromise:g}=this;if(g)return this.asyncResult=!0,g.then(()=>this.flush(e));const T=[],{timeOffset:I}=l;if(n){const Z=n.flush();Z&&T.push(this.push(Z.buffer,null,e))}const{demuxer:k,remuxer:U}=this;if(!k||!U){t.executeEnd=Ui();const Z=[cs(e)];return this.asyncResult?Promise.resolve(Z):Z}const j=k.flush(I);return Aa(j)?(this.asyncResult=!0,j.then(Z=>(this.flushRemux(T,Z,e),T))):(this.flushRemux(T,j,e),this.asyncResult?Promise.resolve(T):T)}flushRemux(e,t,n){const{audioTrack:l,videoTrack:g,id3Track:T,textTrack:I}=t,{accurateTimeOffset:k,timeOffset:U}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===A.MAIN?"level":"track"} ${n.level}`);const j=this.remuxer.remux(l,g,T,I,U,k,!0,this.id);e.push({remuxResult:j,chunkMeta:n}),n.transmuxing.executeEnd=Ui()}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,l,g){const{demuxer:T,remuxer:I}=this;!T||!I||(T.resetInitSegment(e,t,n,l),I.resetInitSegment(e,t,n,g))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,l,g){let T;return t&&t.method==="SAMPLE-AES"?T=this.transmuxSampleAes(e,t,n,l,g):T=this.transmuxUnencrypted(e,n,l,g),T}transmuxUnencrypted(e,t,n,l){const{audioTrack:g,videoTrack:T,id3Track:I,textTrack:k}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(g,T,I,k,t,n,!1,this.id),chunkMeta:l}}transmuxSampleAes(e,t,n,l,g){return this.demuxer.demuxSampleAes(e,t,n).then(T=>({remuxResult:this.remuxer.remux(T.audioTrack,T.videoTrack,T.id3Track,T.textTrack,n,l,!1,this.id),chunkMeta:g}))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:l}=this;let g;for(let Z=0,Q=Ua.length;Z<Q;Z++){var T;if((T=Ua[Z].demux)!=null&&T.probe(e,this.logger)){g=Ua[Z];break}}if(!g)return new Error("Failed to find demuxer by probing fragment data");const I=this.demuxer,k=this.remuxer,U=g.remux,j=g.demux;(!k||!(k instanceof U))&&(this.remuxer=new U(n,t,l,this.logger)),(!I||!(I instanceof j))&&(this.demuxer=new j(n,t,l,this.logger),this.probe=j.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new rn(this.config)),e}}function du(b,e){let t=null;return b.byteLength>0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const cs=b=>({remuxResult:{},chunkMeta:b});function Aa(b){return"then"in b&&b.then instanceof Function}class _u{constructor(e,t,n,l,g){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=l,this.defaultInitPts=g||null}}class mu{constructor(e,t,n,l,g,T){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=l,this.timeOffset=g,this.initSegmentChange=T}}let lo=0;class uo{constructor(e,t,n,l){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=lo++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=k=>{const U=k.data,j=this.hls;if(!(!j||!(U!=null&&U.event)||U.instanceNo!==this.instanceNo))switch(U.event){case"init":{var Z;const Q=(Z=this.workerContext)==null?void 0:Z.objectURL;Q&&self.URL.revokeObjectURL(Q);break}case"transmuxComplete":{this.handleTransmuxComplete(U.data);break}case"flush":{this.onFlush(U.data);break}case"workerLog":{j.logger[U.data.logType]&&j.logger[U.data.logType](U.data.message);break}default:{U.data=U.data||{},U.data.frag=this.frag,U.data.part=this.part,U.data.id=this.id,j.trigger(U.event,U.data);break}}},this.onWorkerError=k=>{if(!this.hls)return;const U=new Error(`${k.message} (${k.filename}:${k.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(y.ERROR,{type:D.OTHER_ERROR,details:W.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:U})};const g=e.config;this.hls=e,this.id=t,this.useWorker=!!g.enableWorker,this.onTransmuxComplete=n,this.onFlush=l;const T=(k,U)=>{U=U||{},U.frag=this.frag||void 0,k===y.ERROR&&(U=U,U.parent=this.id,U.part=this.part,this.error=U.error),this.hls.trigger(k,U)};this.observer=new Ja,this.observer.on(y.FRAG_DECRYPTED,T),this.observer.on(y.ERROR,T);const I=Ft(g.preferManagedMediaSource);if(this.useWorker&&typeof Worker!="undefined"){const k=this.hls.logger;if(g.workerPath||yl()){try{g.workerPath?(k.log(`loading Web Worker ${g.workerPath} for "${t}"`),this.workerContext=xl(g.workerPath)):(k.log(`injecting Web Worker for "${t}"`),this.workerContext=El());const{worker:j}=this.workerContext;j.addEventListener("message",this.onWorkerMessage),j.addEventListener("error",this.onWorkerError),j.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:I,id:t,config:ot(g)})}catch(j){k.warn(`Error setting up "${t}" Web Worker, fallback to inline`,j),this.terminateWorker(),this.error=null,this.transmuxer=new oo(this.observer,I,g,"",t,e.logger)}return}}this.transmuxer=new oo(this.observer,I,g,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=lo++;const t=this.hls.config,n=Ft(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:n,id:this.id,config:ot(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),Tl(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,n,l,g,T,I,k,U,j){var Z,Q;U.transmuxing.start=self.performance.now();const{instanceNo:ee,transmuxer:ne}=this,de=T?T.start:g.start,ce=g.decryptdata,Ee=this.frag,ke=!(Ee&&g.cc===Ee.cc),Me=!(Ee&&U.level===Ee.level),Ye=Ee?U.sn-Ee.sn:-1,lt=this.part?U.part-this.part.index:-1,Ct=Ye===0&&U.id>1&&U.id===(Ee==null?void 0:Ee.stats.chunkCount),rt=!Me&&(Ye===1||Ye===0&&(lt===1||Ct&<<=0)),vt=self.performance.now();(Me||Ye||g.stats.parsing.start===0)&&(g.stats.parsing.start=vt),T&&(lt||!rt)&&(T.stats.parsing.start=vt);const xt=!(Ee&&((Z=g.initSegment)==null?void 0:Z.url)===((Q=Ee.initSegment)==null?void 0:Q.url)),at=new mu(ke,rt,k,Me,de,xt);if(!rt||ke||xt){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${g.type} sn: ${U.sn}${U.part>-1?" part: "+U.part:""} ${this.id===A.MAIN?"level":"track"}: ${U.level} id: ${U.id}
|
|
discontinuity: ${ke}
|
|
trackSwitch: ${Me}
|
|
contiguous: ${rt}
|
|
accurateTimeOffset: ${k}
|
|
timeOffset: ${de}
|
|
initSegmentChange: ${xt}`);const Gt=new _u(n,l,t,I,j);this.configureTransmuxer(Gt)}if(this.frag=g,this.part=T,this.workerContext)this.workerContext.worker.postMessage({instanceNo:ee,cmd:"demux",data:e,decryptdata:ce,chunkMeta:U,state:at},e instanceof ArrayBuffer?[e]:[]);else if(ne){const Gt=ne.push(e,ce,U,at);Aa(Gt)?Gt.then(dr=>{this.handleTransmuxComplete(dr)}).catch(dr=>{this.transmuxerError(dr,U,"transmuxer-interface push error")}):this.handleTransmuxComplete(Gt)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:n}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(n){const l=n.flush(e);Aa(l)?l.then(g=>{this.handleFlushResult(g,e)}).catch(g=>{this.transmuxerError(g,e,"transmuxer-interface flush error")}):this.handleFlushResult(l,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(y.ERROR,{type:D.MEDIA_ERROR,details:W.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach(n=>{this.handleTransmuxComplete(n)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:n}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):n&&n.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const co=100;class pu extends Bi{constructor(e,t,n){super(e,t,n,"audio-stream-controller",A.AUDIO),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(y.LEVEL_LOADED,this.onLevelLoaded,this),e.on(y.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(y.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(y.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(y.BUFFER_RESET,this.onBufferReset,this),e.on(y.BUFFER_CREATED,this.onBufferCreated,this),e.on(y.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(y.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(y.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(y.FRAG_LOADING,this.onFragLoading,this),e.on(y.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(y.LEVEL_LOADED,this.onLevelLoaded,this),e.off(y.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(y.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(y.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(y.BUFFER_RESET,this.onBufferReset,this),e.off(y.BUFFER_CREATED,this.onBufferCreated,this),e.off(y.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(y.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(y.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(y.FRAG_LOADING,this.onFragLoading,this),e.off(y.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:n,initPTS:l,timescale:g,trackId:T}){if(n===A.MAIN){const I=t.cc,k=this.fragCurrent;if(this.initPTS[I]={baseTime:l,timescale:g,trackId:T},this.log(`InitPTS for cc: ${I} found from main: ${l/g} (${l}/${g}) trackId: ${T}`),this.mainAnchor=t,this.state===Kt.WAITING_INIT_PTS){const U=this.waitingData;(!U&&!this.loadingParts||U&&U.frag.cc!==I)&&this.syncWithAnchor(t,U==null?void 0:U.frag)}else!this.hls.hasEnoughToStart&&k&&k.cc!==I?(k.abortRequests(),this.syncWithAnchor(t,k)):this.state===Kt.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var n;const l=((n=this.mainFragLoading)==null?void 0:n.frag)||null;if(t&&(l==null?void 0:l.cc)===t.cc)return;const g=(l||e).cc,T=this.getLevelDetails(),I=this.getLoadPosition(),k=Mr(T,g,I);k&&(this.log(`Syncing with main frag at ${k.start} cc ${k.cc}`),this.startFragRequested=!1,this.nextLoadPosition=k.start,this.resetLoadingState(),this.state===Kt.IDLE&&this.doTickIdle())}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=Kt.STOPPED;return}const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(co),n>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n,this.state=Kt.IDLE):this.state=Kt.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case Kt.IDLE:this.doTickIdle();break;case Kt.WAITING_TRACK:{const{levels:e,trackId:t}=this,n=e==null?void 0:e[t],l=n==null?void 0:n.details;if(l&&!this.waitForLive(n)){if(this.waitForCdnTuneIn(l))break;this.state=Kt.WAITING_INIT_PTS}break}case Kt.FRAG_LOADING_WAITING_RETRY:{this.checkRetryDate();break}case Kt.WAITING_INIT_PTS:{const e=this.waitingData;if(e){const{frag:t,part:n,cache:l,complete:g}=e,T=this.mainAnchor;if(this.initPTS[t.cc]!==void 0){this.waitingData=null,this.state=Kt.FRAG_LOADING;const I=l.flush().buffer,k={frag:t,part:n,payload:I,networkDetails:null};this._handleFragmentLoadProgress(k),g&&super._handleFragmentLoadComplete(k)}else T&&T.cc!==e.frag.cc&&this.syncWithAnchor(T,e.frag)}else this.state=Kt.IDLE}}this.onTickEnd()}resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:n,media:l,trackId:g}=this,T=t.config;if(!this.buffering||!l&&!this.primaryPrefetch&&(this.startFragRequested||!T.startFragPrefetch)||!(n!=null&&n[g]))return;const I=n[g],k=I.details;if(!k||this.waitForLive(I)||this.waitForCdnTuneIn(k)){this.state=Kt.WAITING_TRACK,this.startFragRequested=!1;return}const U=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&U&&(this.bufferFlushed=!1,this.afterBufferFlushed(U,H.AUDIO,A.AUDIO));const j=this.getFwdBufferInfo(U,A.AUDIO);if(j===null)return;if(!this.switchingTrack&&this._streamEnded(j,k)){t.trigger(y.BUFFER_EOS,{type:"audio"}),this.state=Kt.ENDED;return}const Z=j.len,Q=t.maxBufferLength,ee=k.fragments,ne=ee[0].start,de=this.getLoadPosition(),ce=this.flushing?de:j.end;if(this.switchingTrack&&l){const Me=de;k.PTSKnown&&Me<ne&&(j.end>ne||j.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),l.currentTime=ne+.05)}if(Z>=Q&&!this.switchingTrack&&ce<ee[ee.length-1].start)return;let Ee=this.getNextFragment(ce,k);if(Ee&&this.isLoopLoading(Ee,ce)&&(Ee=this.getNextFragmentLoopLoading(Ee,k,j,A.MAIN,Q)),!Ee){this.bufferFlushed=!0;return}let ke=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&ke&&q(Ee)&&!Ee.endList&&(!k.live||!this.loadingParts&&ce<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(ke)===Gr.OK&&(this.mainFragLoading=ke=null),ke&&q(ke))){if(Ee.start>ke.end){const Ye=this.fragmentTracker.getFragAtPos(ce,A.MAIN);Ye&&Ye.end>ke.end&&(ke=Ye,this.mainFragLoading={frag:Ye,targetBufferTime:null})}if(Ee.start>ke.end)return}this.loadFragment(Ee,I,ce)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new ht(n))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:l}=this;l&&(l.abortRequests(),this.removeUnbufferedFrags(l.start)),this.resetLoadingState(),n?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==Kt.STOPPED&&(this.setInterval(co),this.state=Kt.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(y.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(e,t){var n;const{levels:l}=this,{details:g,id:T,groupId:I,track:k}=t;if(!l){this.warn(`Audio tracks reset while loading track ${T} "${k.name}" of "${I}"`);return}const U=this.mainDetails;if(!U||g.endCC>U.endCC||U.expired){this.cachedTrackLoadedData=t,this.state!==Kt.STOPPED&&(this.state=Kt.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${T} "${k.name}" of "${I}" loaded [${g.startSN},${g.endSN}]${g.lastPartSn?`[part-${g.lastPartSn}-${g.lastPartIndex}]`:""},duration:${g.totalduration}`);const j=l[T];let Z=0;if(g.live||(n=j.details)!=null&&n.live){if(this.checkLiveUpdate(g),g.deltaUpdateFailed)return;if(j.details){var Q;Z=this.alignPlaylists(g,j.details,(Q=this.levelLastLoaded)==null?void 0:Q.details)}g.alignedSliding||(Jn(g,U),g.alignedSliding||Ni(g,U),Z=g.fragmentStart)}j.details=g,this.levelLastLoaded=j,this.startFragRequested||this.setStartPosition(U,Z),this.hls.trigger(y.AUDIO_TRACK_UPDATED,{details:g,id:T,groupId:t.groupId}),this.state===Kt.WAITING_TRACK&&!this.waitForCdnTuneIn(g)&&(this.state=Kt.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:l,payload:g}=e,{config:T,trackId:I,levels:k}=this;if(!k){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=k[I];if(!U){this.warn("Audio track is undefined on fragment load progress");return}const j=U.details;if(!j){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const Z=T.defaultAudioCodec||U.audioCodec||"mp4a.40.2";let Q=this.transmuxer;Q||(Q=this.transmuxer=new uo(this.hls,A.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const ee=this.initPTS[n.cc],ne=(t=n.initSegment)==null?void 0:t.data;if(ee!==void 0){const ce=l?l.index:-1,Ee=ce!==-1,ke=new ln(n.level,n.sn,n.stats.chunkCount,g.byteLength,ce,Ee);Q.push(g,ne,Z,"",n,l,j.totalduration,!1,ke,ee)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${j.startSN} ,${j.endSN}],track ${I}`);const{cache:de}=this.waitingData=this.waitingData||{frag:n,part:l,cache:new Ca,complete:!1};de.push(new Uint8Array(g)),this.state!==Kt.STOPPED&&(this.state=Kt.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===A.MAIN&&q(t.frag)&&(this.mainFragLoading=t,this.state===Kt.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:n,part:l}=t;if(n.type!==A.AUDIO){!this.audioOnly&&n.type===A.MAIN&&!n.elementaryStreams.video&&!n.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${l?" p: "+l.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(q(n)){this.fragPrevious=n;const g=this.switchingTrack;g&&(this.bufferedTrack=g,this.switchingTrack=null,this.hls.trigger(y.AUDIO_TRACK_SWITCHED,i({},g)))}this.fragBufferedComplete(n,l),this.media&&this.tick()}onError(e,t){var n;if(t.fatal){this.state=Kt.ERROR;return}switch(t.details){case W.FRAG_GAP:case W.FRAG_PARSING_ERROR:case W.FRAG_DECRYPT_ERROR:case W.FRAG_LOAD_ERROR:case W.FRAG_LOAD_TIMEOUT:case W.KEY_LOAD_ERROR:case W.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(A.AUDIO,t);break;case W.AUDIO_TRACK_LOAD_ERROR:case W.AUDIO_TRACK_LOAD_TIMEOUT:case W.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===Kt.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===L.AUDIO_TRACK&&(this.state=Kt.IDLE);break;case W.BUFFER_ADD_CODEC_ERROR:case W.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)||this.resetLoadingState();break;case W.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case W.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==H.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==H.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===Kt.ENDED&&(this.state=Kt.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,A.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:l}=this,{remuxResult:g,chunkMeta:T}=e,I=this.getCurrentContext(T);if(!I){this.resetWhenMissingContext(T);return}const{frag:k,part:U,level:j}=I,{details:Z}=j,{audio:Q,text:ee,id3:ne,initSegment:de}=g;if(this.fragContextChanged(k)||!Z){this.fragmentTracker.removeFragment(k);return}if(this.state=Kt.PARSING,this.switchingTrack&&Q&&this.completeAudioSwitch(this.switchingTrack),de!=null&&de.tracks){const ce=k.initSegment||k;if(this.unhandledEncryptionError(de,k))return;this._bufferInitSegment(j,de.tracks,ce,T),l.trigger(y.FRAG_PARSING_INIT_SEGMENT,{frag:ce,id:n,tracks:de.tracks})}if(Q){const{startPTS:ce,endPTS:Ee,startDTS:ke,endDTS:Me}=Q;U&&(U.elementaryStreams[H.AUDIO]={startPTS:ce,endPTS:Ee,startDTS:ke,endDTS:Me}),k.setElementaryStreamInfo(H.AUDIO,ce,Ee,ke,Me),this.bufferFragmentData(Q,k,U,T)}if(ne!=null&&(t=ne.samples)!=null&&t.length){const ce=u({id:n,frag:k,details:Z},ne);l.trigger(y.FRAG_PARSING_METADATA,ce)}if(ee){const ce=u({id:n,frag:k,details:Z},ee);l.trigger(y.FRAG_PARSING_USERDATA,ce)}}_bufferInitSegment(e,t,n,l){if(this.state!==Kt.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const g=t.audio;g.id=A.AUDIO;const T=e.audioCodec;this.log(`Init audio buffer, container:${g.container}, codecs[level/parsed]=[${T}/${g.codec}]`),T&&T.split(",").length===1&&(g.levelCodec=T),this.hls.trigger(y.BUFFER_CODECS,t);const I=g.initSegment;if(I!=null&&I.byteLength){const k={type:"audio",frag:n,part:null,chunkMeta:l,parent:n.type,data:I};this.hls.trigger(y.BUFFER_APPENDING,k)}this.tickImmediate()}loadFragment(e,t,n){const l=this.fragmentTracker.getState(e);if(this.switchingTrack||l===Gr.NOT_LOADED||l===Gr.PARTIAL){var g;if(!q(e))this._loadInitSegment(e,t);else if((g=t.details)!=null&&g.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=Kt.WAITING_INIT_PTS;const T=this.mainDetails;T&&T.fragmentStart!==t.details.fragmentStart&&Ni(t.details,T)}else super.loadFragment(e,t,n)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:n,assocLang:l,characteristics:g,audioCodec:T,channels:I}=this.bufferedTrack;Et({name:t,lang:n,assocLang:l,characteristics:g,audioCodec:T,channels:I},e,zt)||(_r(e.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=e)}}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(y.AUDIO_TRACK_SWITCHED,i({},e))}}class hs extends m{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const l=t==null?void 0:t.renditionReports;if(l){let g=-1;for(let T=0;T<l.length;T++){const I=l[T];let k;try{k=new self.URL(I.URI,t.url).href}catch(U){this.warn(`Could not construct new URL for Rendition Report: ${U}`),k=I.URI||""}if(k===e){g=T;break}else k===e.substring(0,k.length)&&(g=T)}if(g!==-1){const T=l[g],I=parseInt(T["LAST-MSN"])||t.lastPartSn;let k=parseInt(T["LAST-PART"])||t.lastPartIndex;if(this.hls.config.lowLatencyMode){const j=Math.min(t.age-t.partTarget,t.targetduration);k>=0&&j>t.partTarget&&(k+=1)}const U=n&&He(n);return new Qe(I,k>=0?k:void 0,U)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}return e}playlistLoaded(e,t,n){const{details:l,stats:g}=t,T=self.performance.now(),I=g.loading.first?Math.max(0,T-g.loading.first):0;l.advancedDateTime=Date.now()-I;const k=this.hls.config.timelineOffset;if(k!==l.appliedTimelineOffset){const j=Math.max(k||0,0);l.appliedTimelineOffset=j,l.fragments.forEach(Z=>{Z.setStart(Z.playlistOffset+j)})}if(l.live||n!=null&&n.live){const j="levelInfo"in t?t.levelInfo:t.track;if(l.reloaded(n),n&&l.fragments.length>0){nn(n,l,this);const ke=l.playlistParsingError;if(ke){this.warn(ke);const Me=this.hls;if(!Me.config.ignorePlaylistParsingErrors){var U;const{networkDetails:Ye}=t;Me.trigger(y.ERROR,{type:D.NETWORK_ERROR,details:W.LEVEL_PARSING_ERROR,fatal:!1,url:l.url,error:ke,reason:ke.message,level:t.level||void 0,parent:(U=l.fragments[0])==null?void 0:U.type,networkDetails:Ye,stats:g});return}l.playlistParsingError=null}}l.requestScheduled===-1&&(l.requestScheduled=g.loading.start);const Z=this.hls.mainForwardBufferInfo,Q=Z?Z.end-Z.len:0,ee=(l.edge-Q)*1e3,ne=ai(l,ee);if(l.requestScheduled+ne<T?l.requestScheduled=T:l.requestScheduled+=ne,this.log(`live playlist ${e} ${l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:l.updated?"UPDATED":"MISSED"}`),!this.canLoad||!l.live)return;let de,ce,Ee;if(l.canBlockReload&&l.endSN&&l.advanced){const ke=this.hls.config.lowLatencyMode,Me=l.lastPartSn,Ye=l.endSN,lt=l.lastPartIndex,Ct=lt!==-1,rt=Me===Ye;Ct?rt?(ce=Ye+1,Ee=ke?0:lt):(ce=Me,Ee=ke?lt+1:l.maxPartIndex):ce=Ye+1;const vt=l.age,xt=vt+l.ageHeader;let at=Math.min(xt-l.partTarget,l.targetduration*1.5);if(at>0){if(xt>l.targetduration*3)this.log(`Playlist last advanced ${vt.toFixed(2)}s ago. Omitting segment and part directives.`),ce=void 0,Ee=void 0;else if(n!=null&&n.tuneInGoal&&xt-l.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${at} with playlist age: ${l.age}`),at=0;else{const Gt=Math.floor(at/l.targetduration);if(ce+=Gt,Ee!==void 0){const dr=Math.round(at%l.targetduration/l.partTarget);Ee+=dr}this.log(`CDN Tune-in age: ${l.ageHeader}s last advanced ${vt.toFixed(2)}s goal: ${at} skip sn ${Gt} to part ${Ee}`)}l.tuneInGoal=at}if(de=this.getDeliveryDirectives(l,t.deliveryDirectives,ce,Ee),ke||!rt){l.requestScheduled=T,this.loadingPlaylist(j,de);return}}else(l.canBlockReload||l.canSkipUntil)&&(de=this.getDeliveryDirectives(l,t.deliveryDirectives,ce,Ee));de&&ce!==void 0&&l.canBlockReload&&(l.requestScheduled=g.loading.first+Math.max(ne-I*2,ne/2)),this.scheduleLoading(j,de,l)}else this.clearTimer()}scheduleLoading(e,t,n){const l=n||e.details;if(!l){this.loadingPlaylist(e,t);return}const g=self.performance.now(),T=l.requestScheduled;if(g>=T){this.loadingPlaylist(e,t);return}const I=T-g;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(I)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),I)}getDeliveryDirectives(e,t,n,l){let g=He(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,l=t.part,g=ze.No),new Qe(n,l,g)}checkRetry(e){const t=e.details,n=Sr(e),l=e.errorAction,{action:g,retryCount:T=0,retryConfig:I}=l||{},k=!!l&&!!I&&(g===Wr.RetryRequest||!l.resolved&&g===Wr.SendAlternateToPenaltyBox);if(k){var U;if(T>=I.maxNumRetry)return!1;if(n&&(U=e.context)!=null&&U.deliveryDirectives)this.warn(`Retrying playlist loading ${T+1}/${I.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const j=Cr(I,T);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),j),this.warn(`Retrying playlist loading ${T+1}/${I.maxNumRetry} after "${t}" in ${j}ms`)}e.levelRetry=!0,l.resolved=!0}return k}}function ho(b,e){if(b.length!==e.length)return!1;for(let t=0;t<b.length;t++)if(!ba(b[t].attrs,e[t].attrs))return!1;return!0}function ba(b,e,t){const n=b["STABLE-RENDITION-ID"];return n&&!t?n===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(l=>b[l]!==e[l])}function fs(b,e){return e.label.toLowerCase()===b.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(b.lang||"").toLowerCase())}class gu extends hs{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(y.MANIFEST_LOADING,this.onManifestLoading,this),e.on(y.MANIFEST_PARSED,this.onManifestParsed,this),e.on(y.LEVEL_LOADING,this.onLevelLoading,this),e.on(y.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(y.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(y.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(y.MANIFEST_LOADING,this.onManifestLoading,this),e.off(y.MANIFEST_PARSED,this.onManifestParsed,this),e.off(y.LEVEL_LOADING,this.onLevelLoading,this),e.off(y.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(y.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(y.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:l,details:g}=t,T=this.tracksInGroup[n];if(!T||T.groupId!==l){this.warn(`Audio track with id:${n} and group:${l} not found in active group ${T==null?void 0:T.groupId}`);return}const I=T.details;T.details=t.details,this.log(`Audio track ${n} "${T.name}" lang:${T.lang} group:${l} loaded [${g.startSN}-${g.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,I)}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,l=this.groupIds;let g=this.currentTrack;if(!n||(l==null?void 0:l.length)!==(n==null?void 0:n.length)||n!=null&&n.some(I=>(l==null?void 0:l.indexOf(I))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const I=this.tracks.filter(Q=>!n||n.indexOf(Q.groupId)!==-1);if(I.length)this.selectDefaultTrack&&!I.some(Q=>Q.default)&&(this.selectDefaultTrack=!1),I.forEach((Q,ee)=>{Q.id=ee});else if(!g&&!this.tracksInGroup.length)return;this.tracksInGroup=I;const k=this.hls.config.audioPreference;if(!g&&k){const Q=Ke(k,I,zt);if(Q>-1)g=I[Q];else{const ee=Ke(k,this.tracks);g=this.tracks[ee]}}let U=this.findTrackId(g);U===-1&&g&&(U=this.findTrackId(null));const j={audioTracks:I};this.log(`Updating audio tracks, ${I.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(y.AUDIO_TRACKS_UPDATED,j);const Z=this.trackId;if(U!==-1&&Z===-1)this.setAudioTrack(U);else if(I.length&&Z===-1){var T;const Q=new Error(`No audio track selected for current audio group-ID(s): ${(T=this.groupIds)==null?void 0:T.join(",")} track count: ${I.length}`);this.warn(Q.message),this.hls.trigger(y.ERROR,{type:D.MEDIA_ERROR,details:W.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:Q})}}}onError(e,t){t.fatal||!t.context||t.context.type===L.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const l=this.currentTrack;if(l&&Et(e,l,zt))return l;const g=Ke(e,this.tracksInGroup,zt);if(g>-1){const T=this.tracksInGroup[g];return this.setAudioTrack(g),T}else if(l){let T=t.loadLevel;T===-1&&(T=t.firstAutoLevel);const I=er(e,t.levels,n,T,zt);if(I===-1)return null;t.nextLoadLevel=I}if(e.channels||e.audioCodec){const T=Ke(e,n);if(T>-1)return n[T]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,l=t[e],g=l.details&&!l.details.live;if(e===this.trackId&&l===n&&g||(this.log(`Switching to audio-track ${e} "${l.name}" lang:${l.lang} group:${l.groupId} channels:${l.channels}`),this.trackId=e,this.currentTrack=l,this.hls.trigger(y.AUDIO_TRACK_SWITCHING,i({},l)),g))return;const T=this.switchParams(l.url,n==null?void 0:n.details,l.details);this.loadPlaylist(T)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const l=t[n];if(!(this.selectDefaultTrack&&!l.default)&&(!e||Et(e,l,zt)))return n}if(e){const{name:n,lang:l,assocLang:g,characteristics:T,audioCodec:I,channels:k}=e;for(let U=0;U<t.length;U++){const j=t[U];if(Et({name:n,lang:l,assocLang:g,characteristics:T,audioCodec:I,channels:k},j,zt))return U}for(let U=0;U<t.length;U++){const j=t[U];if(ba(e.attrs,j.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return U}for(let U=0;U<t.length;U++){const j=t[U];if(ba(e.attrs,j.attrs,["LANGUAGE"]))return U}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&_r(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,l=e.groupId,g=this.getUrlWithDirectives(e.url,t),T=e.details,I=T==null?void 0:T.age;this.log(`Loading audio-track ${n} "${e.name}" lang:${e.lang} group:${l}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${I&&T.live?" age "+I.toFixed(1)+(T.type?" "+T.type||0:""):""} ${g}`),this.hls.trigger(y.AUDIO_TRACK_LOADING,{url:g,id:n,groupId:l,deliveryDirectives:t||null,track:e})}}class vu{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,n){if(this.queues===null||this.tracks===null)return;const l=this.queues[t];l.push(e),l.length===1&&!n&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const n={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(n,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const n={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(n)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const n=(t=e[0])==null?void 0:t.label;(n==="async-blocker"||n==="async-blocker-prepend")&&(e[0].execute(),e.splice(0,1))})}unblockAudio(e){if(this.queues===null)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(this.queues===null||this.tracks===null)return;const t=this.queues[e];if(t.length){const l=t[0];try{l.execute()}catch(g){var n;if(l.onError(g),this.queues===null||this.tracks===null)return;const T=(n=this.tracks[e])==null?void 0:n.buffer;T!=null&&T.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues!==null&&(this.queues[e].shift(),this.executeNext(e))}current(e){var t;return((t=this.queues)==null?void 0:t[e][0])||null}toString(){const{queues:e,tracks:t}=this;return e===null||t===null?"<destroyed>":`
|
|
${this.list("video")}
|
|
${this.list("audio")}
|
|
${this.list("audiovideo")}}`}list(e){var t,n;return(t=this.queues)!=null&&t[e]||(n=this.tracks)!=null&&n[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const n=(t=this.tracks)==null?void 0:t[e],l=n==null?void 0:n.buffer;return l?`SourceBuffer${l.updating?" updating":""}${n.ended?" ended":""}${n.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(n=>n.label).join(", "))||""}}const fo=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,_o="HlsJsTrackRemovedError";class yu extends Error{constructor(e){super(e),this.name=_o}}class Eu extends m{constructor(e,t){super("buffer-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=n=>{var l;this.hls&&((l=this.mediaSource)==null?void 0:l.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=n=>{const{media:l,mediaSource:g}=this;n&&this.log("Media source opened"),!(!l||!g)&&(g.removeEventListener("sourceopen",this._onMediaSourceOpen),l.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(y.MEDIA_ATTACHED,{media:l,mediaSource:g}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:n,_objectUrl:l}=this;n!==l&&this.error(`Media element src was set while attaching MediaSource (${l} > ${n})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=R(w(e.config.preferManagedMediaSource)),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:e}=this;e.on(y.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(y.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(y.MANIFEST_LOADING,this.onManifestLoading,this),e.on(y.MANIFEST_PARSED,this.onManifestParsed,this),e.on(y.BUFFER_RESET,this.onBufferReset,this),e.on(y.BUFFER_APPENDING,this.onBufferAppending,this),e.on(y.BUFFER_CODECS,this.onBufferCodecs,this),e.on(y.BUFFER_EOS,this.onBufferEos,this),e.on(y.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(y.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(y.FRAG_PARSED,this.onFragParsed,this),e.on(y.FRAG_CHANGED,this.onFragChanged,this),e.on(y.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(y.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(y.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(y.MANIFEST_LOADING,this.onManifestLoading,this),e.off(y.MANIFEST_PARSED,this.onManifestParsed,this),e.off(y.BUFFER_RESET,this.onBufferReset,this),e.off(y.BUFFER_APPENDING,this.onBufferAppending,this),e.off(y.BUFFER_CODECS,this.onBufferCodecs,this),e.off(y.BUFFER_EOS,this.onBufferEos,this),e.off(y.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(y.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(y.FRAG_PARSED,this.onFragParsed,this),e.off(y.FRAG_CHANGED,this.onFragChanged,this),e.off(y.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const n={};if(this.operationQueue){const g=this.isUpdating();g||this.operationQueue.removeBlockers();const T=this.isQueued();(g||T)&&this.warn(`Transfering MediaSource with${T?" operations in queue":""}${g?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const l=this.transferData;return!this.sourceBufferCount&&l&&l.mediaSource===t?u(n,l.tracks):this.sourceBuffers.forEach(g=>{const[T]=g;T&&(n[T]=u({},this.tracks[T]),this.removeBuffer(T)),g[0]=g[1]=null}),{media:e,mediaSource:t,tracks:n}}initTracks(){const e={};this.sourceBuffers=[[null,null],[null,null]],this.tracks=e,this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){var n;let l=2;(t.audio&&!t.video||!t.altAudio)&&(l=1),this.bufferCodecEventsTotal=l,this.log(`${l} bufferCodec event(s) expected.`),(n=this.transferData)!=null&&n.mediaSource&&this.sourceBufferCount&&l&&this.bufferCreated()}onMediaAttaching(e,t){const n=this.media=t.media;this.transferData=this.overrides=void 0;const l=w(this.appendSource);if(l){const g=!!t.mediaSource;(g||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const T=this.mediaSource=t.mediaSource||new l;if(this.assignMediaSource(T),g)this._objectUrl=n.src,this.attachTransferred();else{const I=this._objectUrl=self.URL.createObjectURL(T);if(this.appendSource)try{n.removeAttribute("src");const k=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||k&&T instanceof k,mo(n),xu(n,I),n.load()}catch(k){n.src=I}else n.src=I}n.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,n;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(n=e.constructor)==null?void 0:n.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,t=this.transferData;if(!t||!e)return;const n=this.tracks,l=t.tracks,g=l?Object.keys(l):null,T=g?g.length:0,I=()=>{Promise.resolve().then(()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()})};if(l&&g&&T){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log("attachTransferred: waiting for SourceBuffer track info");return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})
|
|
required tracks: ${ot(n,(k,U)=>k==="initSegment"?void 0:U)};
|
|
transfer tracks: ${ot(l,(k,U)=>k==="initSegment"?void 0:U)}}`),!O(l,n)){t.mediaSource=null,t.tracks=void 0;const k=e.currentTime,U=this.details,j=Math.max(k,(U==null?void 0:U.fragments[0].start)||0);if(j-k>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${k} -> ${j}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(l)}"->"${Object.keys(n)}") start time: ${j} currentTime: ${k}`),this.onMediaDetaching(y.MEDIA_DETACHING,{}),this.onMediaAttaching(y.MEDIA_ATTACHING,t),e.currentTime=j;return}this.transferData=void 0,g.forEach(k=>{const U=k,j=l[U];if(j){const Z=j.buffer;if(Z){const Q=this.fragmentTracker,ee=j.id;if(Q.hasFragments(ee)||Q.hasParts(ee)){const ce=Dr.getBuffered(Z);Q.detectEvictedFragments(U,ce,ee,null,!0)}const ne=ds(U),de=[U,Z];this.sourceBuffers[ne]=de,Z.updating&&this.operationQueue&&this.operationQueue.prependBlocker(U),this.trackSourceBuffer(U,j)}}}),I(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),I()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const n=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:l,mediaSource:g,_objectUrl:T}=this;if(g){if(this.log(`media source ${n?"transferring":"detaching"}`),n)this.sourceBuffers.forEach(([I])=>{I&&this.removeBuffer(I)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const I=g.readyState==="open";try{const k=g.sourceBuffers;for(let U=k.length;U--;)I&&k[U].abort(),g.removeSourceBuffer(k[U]);I&&g.endOfStream()}catch(k){this.warn(`onMediaDetaching: ${k.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}g.removeEventListener("sourceopen",this._onMediaSourceOpen),g.removeEventListener("sourceended",this._onMediaSourceEnded),g.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(g.removeEventListener("startstreaming",this._onStartStreaming),g.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}l&&(l.removeEventListener("emptied",this._onMediaEmptied),n||(T&&self.URL.revokeObjectURL(T),this.mediaSrc===T?(l.removeAttribute("src"),this.appendSource&&mo(l),l.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(y.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const n=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),n)try{var l;(l=this.mediaSource)!=null&&l.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(g){this.warn(`onBufferReset ${e}`,g)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[ds(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new vu(this.tracks)}onBufferCodecs(e,t){const n=this.tracks,l=Object.keys(t);this.log(`BUFFER_CODECS: "${l}" (current SB count ${this.sourceBufferCount})`);const g="audiovideo"in t&&(n.audio||n.video)||n.audiovideo&&("audio"in t||"video"in t),T=!g&&this.sourceBufferCount&&this.media&&l.some(I=>!n[I]);if(g||T){this.warn(`Unsupported transition between "${Object.keys(n)}" and "${l}" SourceBuffers`);return}l.forEach(I=>{var k,U;const j=t[I],{id:Z,codec:Q,levelCodec:ee,container:ne,metadata:de,supplemental:ce}=j;let Ee=n[I];const ke=(k=this.transferData)==null||(k=k.tracks)==null?void 0:k[I],Me=ke!=null&&ke.buffer?ke:Ee,Ye=(Me==null?void 0:Me.pendingCodec)||(Me==null?void 0:Me.codec),lt=Me==null?void 0:Me.levelCodec;Ee||(Ee=n[I]={buffer:void 0,listeners:[],codec:Q,supplemental:ce,container:ne,levelCodec:ee,metadata:de,id:Z});const Ct=Yt(Ye,lt),rt=Ct==null?void 0:Ct.replace(fo,"$1");let vt=Yt(Q,ee);const xt=(U=vt)==null?void 0:U.replace(fo,"$1");vt&&Ct&&rt!==xt&&(I.slice(0,5)==="audio"&&(vt=Vt(vt,this.appendSource)),this.log(`switching codec ${Ye} to ${vt}`),vt!==(Ee.pendingCodec||Ee.codec)&&(Ee.pendingCodec=vt),Ee.container=ne,this.appendChangeType(I,ne,vt))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&this.mediaSourceOpenOrEnded&&this.checkPendingTracks()}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((e,t)=>{const n=this.tracks[t];return e[t]={id:n.id,container:n.container,codec:n.codec,levelCodec:n.levelCodec},e},{})}appendChangeType(e,t,n){const l=`${t};codecs=${n}`,g={label:`change-type=${l}`,execute:()=>{const T=this.tracks[e];if(T){const I=T.buffer;I!=null&&I.changeType&&(this.log(`changing ${e} sourceBuffer type to ${l}`),I.changeType(l),T.codec=n,T.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:T=>{this.warn(`Failed to change ${e} SourceBuffer type`,T)}};this.append(g,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const n=e.start,l=n+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(n,A.MAIN))==null?void 0:t.gap)===!0)return;const T={label:"block-audio",execute:()=>{var I;const k=this.tracks.video;(this.lastVideoAppendEnd>l||k!=null&&k.buffer&&Dr.isBuffered(k.buffer,l)||((I=this.fragmentTracker.getAppendedFrag(l,A.MAIN))==null?void 0:I.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:I=>{this.warn("Error executing block-audio operation",I)}};this.blockedAudioAppend={op:T,frag:e},this.append(T,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:n}=this,{data:l,type:g,parent:T,frag:I,part:k,chunkMeta:U,offset:j}=t,Z=U.buffering[g],{sn:Q,cc:ee}=I,ne=self.performance.now();Z.start=ne;const de=I.stats.buffering,ce=k?k.stats.buffering:null;de.start===0&&(de.start=ne),ce&&ce.start===0&&(ce.start=ne);const Ee=n.audio;let ke=!1;g==="audio"&&(Ee==null?void 0:Ee.container)==="audio/mpeg"&&(ke=!this.lastMpegAudioChunk||U.id===1||this.lastMpegAudioChunk.sn!==U.sn,this.lastMpegAudioChunk=U);const Me=n.video,Ye=Me==null?void 0:Me.buffer;if(Ye&&Q!=="initSegment"){const rt=k||I,vt=this.blockedAudioAppend;if(g==="audio"&&T!=="main"&&!this.blockedAudioAppend&&!(Me.ending||Me.ended)){const at=rt.start+rt.duration*.05,Gt=Ye.buffered,dr=this.currentOp("video");!Gt.length&&!dr?this.blockAudio(rt):!dr&&!Dr.isBuffered(Ye,at)&&this.lastVideoAppendEnd<at&&this.blockAudio(rt)}else if(g==="video"){const xt=rt.end;if(vt){const at=vt.frag.start;(xt>at||xt<this.lastVideoAppendEnd||Dr.isBuffered(Ye,at))&&this.unblockAudio()}this.lastVideoAppendEnd=xt}}const lt=(k||I).start,Ct={label:`append-${g}`,execute:()=>{var rt;Z.executeStart=self.performance.now();const vt=(rt=this.tracks[g])==null?void 0:rt.buffer;vt&&(ke?this.updateTimestampOffset(vt,lt,.1,g,Q,ee):j!==void 0&&te(j)&&this.updateTimestampOffset(vt,j,1e-6,g,Q,ee)),this.appendExecutor(l,g)},onStart:()=>{},onComplete:()=>{const rt=self.performance.now();Z.executeEnd=Z.end=rt,de.first===0&&(de.first=rt),ce&&ce.first===0&&(ce.first=rt);const vt={};this.sourceBuffers.forEach(([xt,at])=>{xt&&(vt[xt]=Dr.getBuffered(at))}),this.appendErrors[g]=0,g==="audio"||g==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(y.BUFFER_APPENDED,{type:g,frag:I,part:k,chunkMeta:U,parent:I.type,timeRanges:vt})},onError:rt=>{var vt;const xt={type:D.MEDIA_ERROR,parent:I.type,details:W.BUFFER_APPEND_ERROR,sourceBufferName:g,frag:I,part:k,chunkMeta:U,error:rt,err:rt,fatal:!1},at=(vt=this.media)==null?void 0:vt.error;if(rt.code===DOMException.QUOTA_EXCEEDED_ERR||rt.name=="QuotaExceededError"||"quota"in rt)xt.details=W.BUFFER_FULL_ERROR;else if(rt.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!at)xt.errorAction=Xr(!0);else if(rt.name===_o&&this.sourceBufferCount===0)xt.errorAction=Xr(!0);else{const Gt=++this.appendErrors[g];this.warn(`Failed ${Gt}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${g}" sourceBuffer (${at||"no media error"})`),(Gt>=this.hls.config.appendErrorMaxRetry||at)&&(xt.fatal=!0)}this.hls.trigger(y.ERROR,xt)}};this.append(Ct,g,this.isPending(this.tracks[g]))}getFlushOp(e,t,n){return this.log(`queuing "${e}" remove ${t}-${n}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,n)},onStart:()=>{},onComplete:()=>{this.hls.trigger(y.BUFFER_FLUSHED,{type:e})},onError:l=>{this.warn(`Failed to remove ${t}-${n} from "${e}" SourceBuffer`,l)}}}onBufferFlushing(e,t){const{type:n,startOffset:l,endOffset:g}=t;n?this.append(this.getFlushOp(n,l,g),n):this.sourceBuffers.forEach(([T])=>{T&&this.append(this.getFlushOp(T,l,g),T)})}onFragParsed(e,t){const{frag:n,part:l}=t,g=[],T=l?l.elementaryStreams:n.elementaryStreams;T[H.AUDIOVIDEO]?g.push("audiovideo"):(T[H.AUDIO]&&g.push("audio"),T[H.VIDEO]&&g.push("video"));const I=()=>{const k=self.performance.now();n.stats.buffering.end=k,l&&(l.stats.buffering.end=k);const U=l?l.stats:n.stats;this.hls.trigger(y.FRAG_BUFFERED,{frag:n,part:l,stats:U,id:n.type})};g.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(I,g).catch(k=>{this.warn(`Fragment buffered callback ${k}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{if(e){const t=this.tracks[e];if(t)return!t.ended||t.ending}return!1})}onBufferEos(e,t){var n;this.sourceBuffers.forEach(([T])=>{if(T){const I=this.tracks[T];(!t.type||t.type===T)&&(I.ending=!0,I.ended||(I.ended=!0,this.log(`${T} buffer reached EOS`)))}});const l=((n=this.overrides)==null?void 0:n.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([T])=>{var I;return T&&!((I=this.tracks[T])!=null&&I.ended)})?l?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:T}=this;if(!T||T.readyState!=="open"){T&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${T.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),T.endOfStream(),this.hls.trigger(y.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(y.BUFFERED_TO_END,void 0)):t.type==="video"&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const e=this.getDurationAndRange();e&&this.updateMediaSource(e)})}onError(e,t){if(t.details===W.BUFFER_APPEND_ERROR&&t.frag){var n;const l=(n=t.errorAction)==null?void 0:n.nextAutoLevel;te(l)&&l!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||t===null||!this.sourceBufferCount)return;const l=e.config,g=n.currentTime,T=t.levelTargetDuration,I=t.live&&l.liveBackBufferLength!==null?l.liveBackBufferLength:l.backBufferLength;if(te(I)&&I>=0){const U=Math.max(I,T),j=Math.floor(g/T)*T-U;this.flushBackBuffer(g,T,j)}const k=l.frontBufferFlushThreshold;if(te(k)&&k>0){const U=Math.max(l.maxBufferLength,k),j=Math.max(U,T),Z=Math.floor(g/T)*T+j;this.flushFrontBuffer(g,T,Z)}}flushBackBuffer(e,t,n){this.sourceBuffers.forEach(([l,g])=>{if(g){const I=Dr.getBuffered(g);if(I.length>0&&n>I.start(0)){var T;this.hls.trigger(y.BACK_BUFFER_REACHED,{bufferEnd:n});const k=this.tracks[l];if((T=this.details)!=null&&T.live)this.hls.trigger(y.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(k!=null&&k.ended){this.log(`Cannot flush ${l} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(y.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:l})}}})}flushFrontBuffer(e,t,n){this.sourceBuffers.forEach(([l,g])=>{if(g){const T=Dr.getBuffered(g),I=T.length;if(I<2)return;const k=T.start(I-1),U=T.end(I-1);if(n>k||e>=k&&e<=U)return;this.hls.trigger(y.BUFFER_FLUSHING,{startOffset:k,endOffset:1/0,type:l})}})}getDurationAndRange(){var e;const{details:t,mediaSource:n}=this;if(!t||!this.media||(n==null?void 0:n.readyState)!=="open")return null;const l=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&n.setLiveSeekableRange){const U=Math.max(0,t.fragmentStart),j=Math.max(U,l);return{duration:1/0,start:U,end:j}}return{duration:1/0}}const g=(e=this.overrides)==null?void 0:e.duration;if(g)return te(g)?{duration:g}:null;const T=this.media.duration,I=te(n.duration)?n.duration:0;return l>I&&l>T||!te(T)?{duration:l}:null}updateMediaSource({duration:e,start:t,end:n}){const l=this.mediaSource;!this.media||!l||l.readyState!=="open"||(l.duration!==e&&(te(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),l.duration=e),t!==void 0&&n!==void 0&&(this.log(`MediaSource duration is set to ${l.duration}. Setting seekable range to ${t}-${n}.`),l.setLiveSeekableRange(t,n)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:n}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${ot(n)}`),this.tracksReady){var l;const g=(l=this.transferData)==null?void 0:l.tracks;g&&Object.keys(g).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,n])=>{if(t){const l=this.tracks[t];e[t]={buffer:n,container:l.container,codec:l.codec,supplemental:l.supplemental,levelCodec:l.levelCodec,id:l.id,metadata:l.metadata}}}),this.hls.trigger(y.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([t])=>{this.executeNext(t)})}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(y.ERROR,{type:D.MEDIA_ERROR,details:W.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:n}=this;if(!n)throw new Error("createSourceBuffers called when mediaSource was null");for(const g in e){const T=g,I=e[T];if(this.isPending(I)){const k=this.getTrackCodec(I,T),U=`${I.container};codecs=${k}`;I.codec=k,this.log(`creating sourceBuffer(${U})${this.currentOp(T)?" Queued":""} ${ot(I)}`);try{const j=n.addSourceBuffer(U),Z=ds(T),Q=[T,j];t[Z]=Q,I.buffer=j}catch(j){var l;this.error(`error while trying to add sourceBuffer: ${j.message}`),this.shiftAndExecuteNext(T),(l=this.operationQueue)==null||l.removeBlockers(),delete this.tracks[T],this.hls.trigger(y.ERROR,{type:D.MEDIA_ERROR,details:W.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:j,sourceBufferName:T,mimeType:U,parent:I.id});return}this.trackSourceBuffer(T,I)}}this.bufferCreated()}getTrackCodec(e,t){const n=e.supplemental;let l=e.codec;n&&(t==="video"||t==="audiovideo")&&Lt(n,"video")&&(l=jt(l,n));const g=Yt(l,e.levelCodec);return g?t.slice(0,5)==="audio"?Vt(g,this.appendSource):g:""}trackSourceBuffer(e,t){const n=t.buffer;if(!n)return;const l=this.getTrackCodec(t,e);this.tracks[e]={buffer:n,codec:l,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",(g,T)=>{const I=T.removedRanges;I!=null&&I.length&&this.hls.trigger(y.BUFFER_FLUSHED,{type:g})})}get mediaSrc(){var e,t;const n=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return n==null?void 0:n.src}onSBUpdateStart(e){const t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const n=this.currentOp(e);n&&(n.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var n;const l=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(n=this.mediaSource)==null?void 0:n.readyState}`);this.error(`${l}`,t),this.hls.trigger(y.ERROR,{type:D.MEDIA_ERROR,details:W.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:l,fatal:!1});const g=this.currentOp(e);g&&g.onError(l)}updateTimestampOffset(e,t,n,l,g,T){const I=t-e.timestampOffset;Math.abs(I)>=n&&(this.log(`Updating ${l} SourceBuffer timestampOffset to ${t} (sn: ${g} cc: ${T})`),e.timestampOffset=t)}removeExecutor(e,t,n){const{media:l,mediaSource:g}=this,T=this.tracks[e],I=T==null?void 0:T.buffer;if(!l||!g||!I){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const k=te(l.duration)?l.duration:1/0,U=te(g.duration)?g.duration:1/0,j=Math.max(0,t),Z=Math.min(n,k,U);Z>j&&(!T.ending||T.ended)?(T.ended=!1,this.log(`Removing [${j},${Z}] from the ${e} SourceBuffer`),I.remove(j,Z)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.tracks[t],l=n==null?void 0:n.buffer;if(!l)throw new yu(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,l.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:n}=this,l=t.map(T=>this.appendBlocker(T));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(l).then(T=>{n===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var n;const l=(n=this.tracks[t])==null?void 0:n.buffer;!l||l.updating||this.shiftAndExecuteNext(t)})}append(e,t,n){this.operationQueue&&this.operationQueue.append(e,t,n)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((e,t)=>e+(this.isPending(this.tracks[t])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((e,[t])=>e+(t?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([e])=>e).filter(e=>!!e)}addBufferListener(e,t,n){const l=this.tracks[e];if(!l)return;const g=l.buffer;if(!g)return;const T=n.bind(this,e);l.listeners.push({event:t,listener:T}),g.addEventListener(t,T)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const n=t.buffer;n&&(t.listeners.forEach(l=>{n.removeEventListener(l.event,l.listener)}),t.listeners.length=0)}}function mo(b){const e=b.querySelectorAll("source");[].slice.call(e).forEach(t=>{b.removeChild(t)})}function xu(b,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,b.appendChild(t)}function ds(b){return b==="audio"?1:0}class _s{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(y.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(y.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(y.MANIFEST_PARSED,this.onManifestParsed,this),e.on(y.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(y.BUFFER_CODECS,this.onBufferCodecs,this),e.on(y.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(y.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(y.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(y.MANIFEST_PARSED,this.onManifestParsed,this),e.off(y.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(y.BUFFER_CODECS,this.onBufferCodecs,this),e.off(y.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&te(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const e=this.hls.levels;if(e.length){const t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter((l,g)=>this.isLevelAllowed(l)&&g<=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 Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some(n=>e.bitrate===n.bitrate&&e.width===n.width&&e.height===n.height)}static getMaxLevelByMediaSize(e,t,n){if(!(e!=null&&e.length))return-1;const l=(I,k)=>k?I.width!==k.width||I.height!==k.height:!0;let g=e.length-1;const T=Math.max(t,n);for(let I=0;I<e.length;I+=1){const k=e[I];if((k.width>=T||k.height>=T)&&l(k,e[I+1])){g=I;break}}return g}}const ui={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},Tu={HLS:"h"};class Ri{constructor(e,t){Array.isArray(e)&&(e=e.map(n=>n instanceof Ri?n:new Ri(n))),this.value=e,this.params=t}}const Au="Dict";function bu(b){return Array.isArray(b)?JSON.stringify(b):b instanceof Map?"Map{}":b instanceof Set?"Set{}":typeof b=="object"?JSON.stringify(b):String(b)}function Su(b,e,t,n){return new Error(`failed to ${b} "${bu(e)}" as ${t}`,{cause:n})}function wi(b,e,t){return Su("serialize",b,e,t)}class po{constructor(e){this.description=e}}const go="Bare Item",Du="Boolean";function Lu(b){if(typeof b!="boolean")throw wi(b,Du);return b?"?1":"?0"}function Ru(b){return btoa(String.fromCharCode(...b))}const wu="Byte Sequence";function Cu(b){if(ArrayBuffer.isView(b)===!1)throw wi(b,wu);return`:${Ru(b)}:`}const Iu="Integer";function Pu(b){return b<-999999999999999||999999999999999<b}function vo(b){if(Pu(b))throw wi(b,Iu);return b.toString()}function Mu(b){return`@${vo(b.getTime()/1e3)}`}function yo(b,e){if(b<0)return-yo(-b,e);const t=Math.pow(10,e);if(Math.abs(b*t%1-.5)<Number.EPSILON){const l=Math.floor(b*t);return(l%2===0?l:l+1)/t}else return Math.round(b*t)/t}const Ou="Decimal";function Nu(b){const e=yo(b,3);if(Math.floor(Math.abs(e)).toString().length>12)throw wi(b,Ou);const t=e.toString();return t.includes(".")?t:`${t}.0`}const Bu="String",Uu=/[\x00-\x1f\x7f]+/;function Fu(b){if(Uu.test(b))throw wi(b,Bu);return`"${b.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function ku(b){return b.description||b.toString().slice(7,-1)}const Wu="Token";function Eo(b){const e=ku(b);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw wi(e,Wu);return e}function ms(b){switch(typeof b){case"number":if(!te(b))throw wi(b,go);return Number.isInteger(b)?vo(b):Nu(b);case"string":return Fu(b);case"symbol":return Eo(b);case"boolean":return Lu(b);case"object":if(b instanceof Date)return Mu(b);if(b instanceof Uint8Array)return Cu(b);if(b instanceof po)return Eo(b);default:throw wi(b,go)}}const Ku="Key";function ps(b){if(/^[a-z*][a-z0-9\-_.*]*$/.test(b)===!1)throw wi(b,Ku);return b}function gs(b){return b==null?"":Object.entries(b).map(([e,t])=>t===!0?`;${ps(e)}`:`;${ps(e)}=${ms(t)}`).join("")}function xo(b){return b instanceof Ri?`${ms(b.value)}${gs(b.params)}`:ms(b)}function Gu(b){return`(${b.value.map(xo).join(" ")})${gs(b.params)}`}function Vu(b,e={whitespace:!0}){if(typeof b!="object"||b==null)throw wi(b,Au);const t=b instanceof Map?b.entries():Object.entries(b),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([l,g])=>{g instanceof Ri||(g=new Ri(g));let T=ps(l);return g.value===!0?T+=gs(g.params):(T+="=",Array.isArray(g.value)?T+=Gu(g):T+=xo(g)),T}).join(`,${n}`)}function To(b,e){return Vu(b,e)}const Ci="CMCD-Object",Nn="CMCD-Request",qi="CMCD-Session",Xi="CMCD-Status",Hu={br:Ci,ab:Ci,d:Ci,ot:Ci,tb:Ci,tpb:Ci,lb:Ci,tab:Ci,lab:Ci,url:Ci,pb:Nn,bl:Nn,tbl:Nn,dl:Nn,ltc:Nn,mtp:Nn,nor:Nn,nrr:Nn,rc:Nn,sn:Nn,sta:Nn,su:Nn,ttfb:Nn,ttfbb:Nn,ttlb:Nn,cmsdd:Nn,cmsds:Nn,smrt:Nn,df:Nn,cs:Nn,ts:Nn,cid:qi,pr:qi,sf:qi,sid:qi,st:qi,v:qi,msd:qi,bs:Xi,bsd:Xi,cdn:Xi,rtp:Xi,bg:Xi,pt:Xi,ec:Xi,e:Xi},zu={REQUEST:Nn};function ju(b){return Object.keys(b).reduce((e,t)=>{var n;return(n=b[t])===null||n===void 0||n.forEach(l=>e[l]=t),e},{})}function Zu(b,e){const t={};if(!b)return t;const n=Object.keys(b),l=e?ju(e):{};return n.reduce((g,T)=>{var I;const k=Hu[T]||l[T]||zu.REQUEST,U=(I=g[k])!==null&&I!==void 0?I:g[k]={};return U[T]=b[T],g},t)}function Xu(b){return["ot","sf","st","e","sta"].includes(b)}function Yu(b){return typeof b=="number"?te(b):b!=null&&b!==""&&b!==!1}const Ao="event";function $u(b,e){const t=new URL(b),n=new URL(e);if(t.origin!==n.origin)return b;const l=t.pathname.split("/").slice(1),g=n.pathname.split("/").slice(1,-1);for(;l[0]===g[0];)l.shift(),g.shift();for(;g.length;)g.shift(),l.unshift("..");return l.join("/")+t.search+t.hash}const Fa=b=>Math.round(b),vs=(b,e)=>Array.isArray(b)?b.map(t=>vs(t,e)):b instanceof Ri&&typeof b.value=="string"?new Ri(vs(b.value,e),b.params):(e.baseUrl&&(b=$u(b,e.baseUrl)),e.version===1?encodeURIComponent(b):b),ka=b=>Fa(b/100)*100,Qu={br:Fa,d:Fa,bl:ka,dl:ka,mtp:ka,nor:(b,e)=>{let t=b;return e.version>=2&&(b instanceof Ri&&typeof b.value=="string"?t=new Ri([b]):typeof b=="string"&&(t=[b])),vs(t,e)},rtp:ka,tb:Fa},bo="request",So="response",ys=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts","v"],Ju=["e"],qu=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function Wa(b){return qu.test(b)}function ec(b){return ys.includes(b)||Ju.includes(b)||Wa(b)}const Do=["d","dl","nor","ot","rtp","su"];function tc(b){return ys.includes(b)||Do.includes(b)||Wa(b)}const rc=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];function nc(b){return ys.includes(b)||Do.includes(b)||rc.includes(b)||Wa(b)}const ic=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function ac(b){return ic.includes(b)||Wa(b)}const sc={[So]:nc,[Ao]:ec,[bo]:tc};function Lo(b,e={}){const t={};if(b==null||typeof b!="object")return t;const n=e.version||b.v||1,l=e.reportingMode||bo,g=n===1?ac:sc[l];let T=Object.keys(b).filter(g);const I=e.filter;typeof I=="function"&&(T=T.filter(I));const k=l===So||l===Ao;k&&!T.includes("ts")&&T.push("ts"),n>1&&!T.includes("v")&&T.push("v");const U=u({},Qu,e.formatters),j={version:n,reportingMode:l,baseUrl:e.baseUrl};return T.sort().forEach(Z=>{let Q=b[Z];const ee=U[Z];if(typeof ee=="function"&&(Q=ee(Q,j)),Z==="v"){if(n===1)return;Q=n}Z=="pr"&&Q===1||(k&&Z==="ts"&&!te(Q)&&(Q=Date.now()),Yu(Q)&&(Xu(Z)&&typeof Q=="string"&&(Q=new po(Q)),t[Z]=Q))}),t}function oc(b,e={}){const t={};if(!b)return t;const n=Lo(b,e),l=Zu(n,e==null?void 0:e.customHeaderMap);return Object.entries(l).reduce((g,[T,I])=>{const k=To(I,{whitespace:!1});return k&&(g[T]=k),g},t)}function lc(b,e,t){return u(b,oc(e,t))}const uc="CMCD";function cc(b,e={}){return b?To(Lo(b,e),{whitespace:!1}):""}function hc(b,e={}){if(!b)return"";const t=cc(b,e);return encodeURIComponent(t)}function fc(b,e={}){if(!b)return"";const t=hc(b,e);return`${uc}=${t}`}const Ro=/CMCD=[^&#]+/;function dc(b,e,t){const n=fc(e,t);if(!n)return b;if(Ro.test(b))return b.replace(Ro,n);const l=b.includes("?")?"&":"?";return`${b}${l}${n}`}class _c{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=l=>{try{this.apply(l,{ot:ui.MANIFEST,su:!this.initialized})}catch(g){this.hls.logger.warn("Could not generate manifest CMCD data.",g)}},this.applyFragmentData=l=>{try{const{frag:g,part:T}=l,I=this.hls.levels[g.level],k=this.getObjectType(g),U={d:(T||g).duration*1e3,ot:k};(k===ui.VIDEO||k===ui.AUDIO||k==ui.MUXED)&&(U.br=I.bitrate/1e3,U.tb=this.getTopBandwidth(k)/1e3,U.bl=this.getBufferLength(k));const j=T?this.getNextPart(T):this.getNextFrag(g);j!=null&&j.url&&j.url!==g.url&&(U.nor=j.url),this.apply(l,U)}catch(g){this.hls.logger.warn("Could not generate segment CMCD data.",g)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;n!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||e.sessionId,this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(y.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(y.MEDIA_DETACHED,this.onMediaDetached,this),e.on(y.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(y.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(y.MEDIA_DETACHED,this.onMediaDetached,this),e.off(y.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var n,l;this.audioBuffer=(n=t.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(l=t.tracks.video)==null?void 0:l.buffer}createData(){var e;return{v:1,sf:Tu.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){u(t,this.createData());const n=t.ot===ui.INIT||t.ot===ui.VIDEO||t.ot===ui.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:l}=this;l&&(t=Object.keys(t).reduce((T,I)=>(l.includes(I)&&(T[I]=t[I]),T),{}));const g={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),lc(e.headers,t,g)):e.url=dc(e.url,t,g)}getNextFrag(e){var t;const n=(t=this.hls.levels[e.level])==null?void 0:t.details;if(n){const l=e.sn-n.startSN;return n.fragments[l+1]}}getNextPart(e){var t;const{index:n,fragment:l}=e,g=(t=this.hls.levels[l.level])==null||(t=t.details)==null?void 0:t.partList;if(g){const{sn:T}=l;for(let I=g.length-1;I>=0;I--){const k=g[I];if(k.index===n&&k.fragment.sn===T)return g[I+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return ui.TIMED_TEXT;if(e.sn==="initSegment")return ui.INIT;if(t==="audio")return ui.AUDIO;if(t==="main")return this.hls.audioTracks.length?ui.VIDEO:ui.MUXED}getTopBandwidth(e){let t=0,n;const l=this.hls;if(e===ui.AUDIO)n=l.audioTracks;else{const g=l.maxAutoLevel,T=g>-1?g+1:l.levels.length;n=l.levels.slice(0,T)}return n.forEach(g=>{g.bitrate>t&&(t=g.bitrate)}),t>0?t:NaN}getBufferLength(e){const t=this.media,n=e===ui.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:Dr.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(g){this.loader=void 0,this.loader=new n(g)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(g,T,I){t(g),this.loader.load(g,T,I)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(g){this.loader=void 0,this.loader=new n(g)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(g,T,I){t(g),this.loader.load(g,T,I)}}}}const mc=3e5;class pc extends m{constructor(e){super("content-steering",e.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(y.MANIFEST_LOADING,this.onManifestLoading,this),e.on(y.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(y.MANIFEST_PARSED,this.onManifestParsed,this),e.on(y.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(y.MANIFEST_LOADING,this.onManifestLoading,this),e.off(y.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(y.MANIFEST_PARSED,this.onManifestParsed,this),e.off(y.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((e,t)=>(e.indexOf(t.pathwayId)===-1&&e.push(t.pathwayId),e),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(n=>n!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:n}=t;n!==null&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((n==null?void 0:n.action)===Wr.SendAlternateToPenaltyBox&&n.flags===wr.MoveAllAlternatesMatchingHost){const l=this.levels;let g=this._pathwayPriority,T=this.pathwayId;if(t.context){const{groupId:I,pathwayId:k,type:U}=t.context;I&&l?T=this.getPathwayForGroupId(I,U,T):k&&(T=k)}T in this.penalizedPathways||(this.penalizedPathways[T]=performance.now()),!g&&l&&(g=this.pathways()),g&&g.length>1&&(this.updatePathwayPriority(g),n.resolved=this.pathwayId!==T),t.details===W.BUFFER_APPEND_ERROR&&!t.fatal?n.resolved=!0:n.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${T} levels: ${l&&l.length} priorities: ${ot(g)} penalized: ${ot(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this._pathwayPriority=e;let t;const n=this.penalizedPathways,l=performance.now();Object.keys(n).forEach(g=>{l-n[g]>mc&&delete n[g]});for(let g=0;g<e.length;g++){const T=e[g];if(T in n)continue;if(T===this.pathwayId)return;const I=this.hls.nextLoadLevel,k=this.hls.levels[I];if(t=this.getLevelsForPathway(T),t.length>0){this.log(`Setting Pathway to "${T}"`),this.pathwayId=T,Oi(t),this.hls.trigger(y.LEVELS_UPDATED,{levels:t});const U=this.hls.levels[I];k&&U&&this.levels&&(U.attrs["STABLE-VARIANT-ID"]!==k.attrs["STABLE-VARIANT-ID"]&&U.bitrate!==k.bitrate&&this.log(`Unstable Pathways change from bitrate ${k.bitrate} to ${U.bitrate}`),this.hls.nextLoadLevel=I);break}}}getPathwayForGroupId(e,t,n){const l=this.getLevelsForPathway(n).concat(this.levels||[]);for(let g=0;g<l.length;g++)if(t===L.AUDIO_TRACK&&l[g].hasAudioGroup(e)||t===L.SUBTITLE_TRACK&&l[g].hasSubtitleGroup(e))return l[g].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},l={};e.forEach(g=>{const{ID:T,"BASE-ID":I,"URI-REPLACEMENT":k}=g;if(t.some(j=>j.pathwayId===T))return;const U=this.getLevelsForPathway(I).map(j=>{const Z=new Vr(j.attrs);Z["PATHWAY-ID"]=T;const Q=Z.AUDIO&&`${Z.AUDIO}_clone_${T}`,ee=Z.SUBTITLES&&`${Z.SUBTITLES}_clone_${T}`;Q&&(n[Z.AUDIO]=Q,Z.AUDIO=Q),ee&&(l[Z.SUBTITLES]=ee,Z.SUBTITLES=ee);const ne=Co(j.uri,Z["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",k),de=new ht({attrs:Z,audioCodec:j.audioCodec,bitrate:j.bitrate,height:j.height,name:j.name,url:ne,videoCodec:j.videoCodec,width:j.width});if(j.audioGroups)for(let ce=1;ce<j.audioGroups.length;ce++)de.addGroupId("audio",`${j.audioGroups[ce]}_clone_${T}`);if(j.subtitleGroups)for(let ce=1;ce<j.subtitleGroups.length;ce++)de.addGroupId("text",`${j.subtitleGroups[ce]}_clone_${T}`);return de});t.push(...U),wo(this.audioTracks,n,k,T),wo(this.subtitleTracks,l,k,T)})}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;this.loader&&this.loader.destroy(),this.loader=new n(t);let l;try{l=new self.URL(e)}catch(j){this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(l.protocol!=="data:"){const j=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;l.searchParams.set("_HLS_pathway",this.pathwayId),l.searchParams.set("_HLS_throughput",""+j)}const g={responseType:"json",url:l.href},T=t.steeringManifestLoadPolicy.default,I=T.errorRetry||T.timeoutRetry||{},k={loadPolicy:T,timeout:T.maxLoadTimeMs,maxRetry:I.maxNumRetry||0,retryDelay:I.retryDelayMs||0,maxRetryDelay:I.maxRetryDelayMs||0},U={onSuccess:(j,Z,Q,ee)=>{this.log(`Loaded steering manifest: "${l}"`);const ne=j.data;if((ne==null?void 0:ne.VERSION)!==1){this.log(`Steering VERSION ${ne.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=ne.TTL;const{"RELOAD-URI":de,"PATHWAY-CLONES":ce,"PATHWAY-PRIORITY":Ee}=ne;if(de)try{this.uri=new self.URL(de,l).href}catch(Me){this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${de}`);return}this.scheduleRefresh(this.uri||Q.url),ce&&this.clonePathways(ce);const ke={steeringManifest:ne,url:l.toString()};this.hls.trigger(y.STEERING_MANIFEST_LOADED,ke),Ee&&this.updatePathwayPriority(Ee)},onError:(j,Z,Q,ee)=>{if(this.log(`Error loading steering manifest: ${j.code} ${j.text} (${Z.url})`),this.stopLoad(),j.code===410){this.enabled=!1,this.log(`Steering manifest ${Z.url} no longer available`);return}let ne=this.timeToLoad*1e3;if(j.code===429){const de=this.loader;if(typeof(de==null?void 0:de.getResponseHeader)=="function"){const ce=de.getResponseHeader("Retry-After");ce&&(ne=parseFloat(ce)*1e3)}this.log(`Steering manifest ${Z.url} rate limited`);return}this.scheduleRefresh(this.uri||Z.url,ne)},onTimeout:(j,Z,Q)=>{this.log(`Timeout loading steering manifest (${Z.url})`),this.scheduleRefresh(this.uri||Z.url)}};this.log(`Requesting steering manifest: ${l}`),this.loader.load(g,k,U)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var n;const l=(n=this.hls)==null?void 0:n.media;if(l&&!l.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function wo(b,e,t,n){b&&Object.keys(e).forEach(l=>{const g=b.filter(T=>T.groupId===l).map(T=>{const I=u({},T);return I.details=void 0,I.attrs=new Vr(I.attrs),I.url=I.attrs.URI=Co(T.url,T.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),I.groupId=I.attrs["GROUP-ID"]=e[l],I.attrs["PATHWAY-ID"]=n,I});b.push(...g)})}function Co(b,e,t,n){const{HOST:l,PARAMS:g,[t]:T}=n;let I;e&&(I=T==null?void 0:T[e],I&&(b=I));const k=new self.URL(b);return l&&!I&&(k.host=l),g&&Object.keys(g).sort().forEach(U=>{U&&k.searchParams.set(U,g[U])}),k.href}class da extends m{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=da.CDMCleanupPromise?[da.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=t=>{const{initDataType:n,initData:l}=t,g=`"${t.type}" event: init data type: "${n}"`;if(this.debug(g),l!==null){if(!this.keyFormatPromise){let T=Object.keys(this.keySystemAccessPromises);T.length||(T=Ar(this.config));const I=T.map(or).filter(k=>!!k);this.keyFormatPromise=this.getKeyFormatPromise(I)}this.keyFormatPromise.then(T=>{const I=Wn(T);if(n!=="sinf"||I!==Br.FAIRPLAY){this.log(`Ignoring "${t.type}" event with init data type: "${n}" for selected key-system ${I}`);return}let k;try{const ee=Ae(new Uint8Array(l)),ne=mn(JSON.parse(ee).sinf),de=Oe(ne);if(!de)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");k=new Uint8Array(de.subarray(8,24))}catch(ee){this.warn(`${g} Failed to parse sinf: ${ee}`);return}const U=N(k),{keyIdToKeySessionPromise:j,mediaKeySessions:Z}=this;let Q=j[U];for(let ee=0;ee<Z.length;ee++){const ne=Z[ee],de=ne.decryptdata;if(!de.keyId)continue;const ce=N(de.keyId);if(U===ce||de.uri.replace(/-/g,"").indexOf(U)!==-1){if(Q=j[ce],!Q)continue;if(de.pssh)break;delete j[ce],de.pssh=new Uint8Array(l),de.keyId=k,Q=j[U]=Q.then(()=>this.generateRequestWithPreferredKeySession(ne,n,l,"encrypted-event-key-match")),Q.catch(Ee=>this.handleError(Ee));break}}Q||this.handleError(new Error(`Key ID ${U} not encountered in playlist. Key-system sessions ${Z.length}.`))}).catch(T=>this.handleError(T))}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(y.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(y.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(y.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(y.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(y.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(y.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(y.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(y.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(y.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(y.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,l=t==null?void 0:t[e];if(l)return l.licenseUrl;if(e===Br.WIDEVINE&&n)return n}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(t===void 0)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=t==null?void 0:t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(T,I,k)=>!!T&&k.indexOf(T)===I,l=t.map(T=>T.audioCodec).filter(n),g=t.map(T=>T.videoCodec).filter(n);return l.length+g.length===0&&g.push("avc1.42e01e"),new Promise((T,I)=>{const k=U=>{const j=U.shift();this.getMediaKeysPromise(j,l,g).then(Z=>T({keySystem:j,mediaKeys:Z})).catch(Z=>{U.length?k(U):Z instanceof Ti?I(Z):I(new Ti({type:D.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_NO_ACCESS,error:Z,fatal:!0},Z.message))})};k(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let l=`Configured requestMediaKeySystemAccess is not a function ${n}`;return jr===null&&self.location.protocol==="http:"&&(l=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(l))}return n(e,t)}getMediaKeysPromise(e,t,n){var l;const g=pn(e,t,n,this.config.drmSystemOptions||{});let T=this.keySystemAccessPromises[e],I=(l=T)==null?void 0:l.keySystemAccess;if(!I){this.log(`Requesting encrypted media "${e}" key-system access with config: ${ot(g)}`),I=this.requestMediaKeySystemAccess(e,g);const k=T=this.keySystemAccessPromises[e]={keySystemAccess:I};return I.catch(U=>{this.log(`Failed to obtain access to key-system "${e}": ${U}`)}),I.then(U=>{this.log(`Access for key-system "${U.keySystem}" obtained`);const j=this.fetchServerCertificate(e);this.log(`Create media-keys for "${e}"`);const Z=k.mediaKeys=U.createMediaKeys().then(Q=>(this.log(`Media-keys created for "${e}"`),k.hasMediaKeys=!0,j.then(ee=>ee?this.setMediaKeysServerCertificate(Q,e,ee):Q)));return Z.catch(Q=>{this.error(`Failed to create media-keys for "${e}"}: ${Q}`)}),Z})}return I.then(()=>T.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${N(e.keyId||[])}`);const l=n.createSession(),g={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:l,keyStatus:"status-pending"};return this.mediaKeySessions.push(g),g}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),l=this.getKeyIdString(t),g="cenc";this.keyIdToKeySessionPromise[l]=this.generateRequestWithPreferredKeySession(n,g,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return N(e.keyId)}updateKeySession(e,t){const n=e.mediaKeysSession;return this.log(`Updating key-session "${n.sessionId}" for keyId ${N(e.decryptdata.keyId||[])}
|
|
} (data length: ${t.byteLength})`),n.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>or(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:t,mediaKeys:n})=>this.attemptSetMediaKeys(t,n))}selectKeySystem(e){return new Promise((t,n)=>{this.getKeySystemSelectionPromise(e).then(({keySystem:l})=>{const g=or(l);g?t(g):n(new Error(`Unable to find format for key-system "${l}"`))}).catch(n)})}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){const t=Ar(this.config),n=e.map(Wn).filter(l=>!!l&&t.indexOf(l)!==-1);return this.selectKeySystem(n)}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),l=this.bannedKeyIds[n];if(l){const I=Io(l,t);return this.handleError(I,e.frag),Promise.reject(I)}const g=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${g}`);const T=this.keyIdToKeySessionPromise[n];if(!T){const I=this.getKeySystemForKeyPromise(t).then(({keySystem:k,mediaKeys:U})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${g}`),this.attemptSetMediaKeys(k,U).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:k,mediaKeys:U,decryptdata:t}))))).then(k=>{const U="cenc",j=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(k,U,j,"playlist-key")});return I.catch(k=>this.handleError(k,e.frag)),this.keyIdToKeySessionPromise[n]=I,I}return T}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e,t){this.hls&&(this.error(e.message),e instanceof Ti?(t&&(e.data.frag=t),this.hls.trigger(y.ERROR,e.data)):this.hls.trigger(y.ERROR,{type:D.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const l=Wn(e.keyFormat),g=l?[l]:Ar(this.config);return this.attemptKeySystemAccess(g)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=Ar(this.config)),e.length===0)throw new Ti({type:D.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${ot({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaKeys===t)return Promise.resolve();const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const l=Promise.all(n).then(()=>{if(!this.media)throw this.mediaKeys=null,new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.mediaKeys=t,this.setMediaKeysQueue.push(l),l.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(l),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(g=>n.indexOf(g)===-1)})}generateRequestWithPreferredKeySession(e,t,n,l){var g;const T=(g=this.config.drmSystems)==null||(g=g[e.keySystem])==null?void 0:g.generateRequest;if(T)try{const Q=T.call(this.hls,t,n,e);if(!Q)throw new Error("Invalid response from configured generateRequest filter");t=Q.initDataType,n=Q.initData?Q.initData:null,e.decryptdata.pssh=n?new Uint8Array(n):null}catch(Q){if(this.warn(Q.message),this.hls&&this.hls.config.debug)throw Q}if(n===null)return this.log(`Skipping key-session request for "${l}" (no initData)`),Promise.resolve(e);const I=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${l}": ${I} (init data type: ${t} length: ${n.byteLength})`);const k=new Ja,U=e._onmessage=Q=>{const ee=e.mediaKeysSession;if(!ee){k.emit("error",new Error("invalid state"));return}const{messageType:ne,message:de}=Q;this.log(`"${ne}" message event for session "${ee.sessionId}" message size: ${de.byteLength}`),ne==="license-request"||ne==="license-renewal"?this.renewLicense(e,de).catch(ce=>{k.eventNames().length?k.emit("error",ce):this.handleError(ce)}):ne==="license-release"?e.keySystem===Br.FAIRPLAY&&(this.updateKeySession(e,An("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${ne}"`)},j=e._onkeystatuseschange=Q=>{if(!e.mediaKeysSession){k.emit("error",new Error("invalid state"));return}const ne=e.keyStatus;this.onKeyStatusChange(e);const de=e.keyStatus;de!==ne&&(k.emit("keyStatus",de,e),de==="expired"&&(this.log(`${e.keySystem} expired for key ${I}`),this.renewKeySession(e)))};Kn(e.mediaKeysSession,"message",U),Kn(e.mediaKeysSession,"keystatuseschange",j);const Z=new Promise((Q,ee)=>{k.on("error",ee),k.on("keyStatus",(ne,{decryptdata:de})=>{ne.startsWith("usable")?Q():ne==="internal-error"||ne==="output-restricted"?ee(Io(ne,de)):ne==="expired"?ee(new Error(`key expired while generating request (keyId: ${I})`)):this.warn(`unhandled key status change "${ne}" (keyId: ${I})`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{this.log(`Request generated for key-session "${e.mediaKeysSession.sessionId}" keyId: ${I}`)}).catch(Q=>{throw new Ti({type:D.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_NO_SESSION,error:Q,decryptdata:e.decryptdata,fatal:!1},`Error generating key-session request: ${Q}`)}).then(()=>Z).catch(Q=>{throw k.removeAllListeners(),this.removeSession(e),Q}).then(()=>(k.removeAllListeners(),e))}onKeyStatusChange(e){const t=N(new Uint8Array(e.decryptdata.keyId||[]));e.mediaKeysSession.keyStatuses.forEach((n,l)=>{if(typeof l=="string"&&typeof n=="object"){const I=l;l=n,n=I}const g=N("buffer"in l?new Uint8Array(l.buffer,l.byteOffset,l.byteLength):new Uint8Array(l));n==="internal-error"&&(this.bannedKeyIds[g]=n);const T=g===t;this.log(`${T?"":"un"}matched key status change "${n}" for keyStatuses keyId: ${g} session keyId: ${t} uri: ${e.decryptdata.uri}`),T&&(e.keyStatus=n)})}fetchServerCertificate(e){const t=this.config,n=t.loader,l=new n(t),g=this.getServerCertificateUrl(e);return g?(this.log(`Fetching server certificate for "${e}"`),new Promise((T,I)=>{const k={responseType:"arraybuffer",url:g},U=t.certLoadPolicy.default,j={loadPolicy:U,timeout:U.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},Z={onSuccess:(Q,ee,ne,de)=>{T(Q.data)},onError:(Q,ee,ne,de)=>{I(new Ti({type:D.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:ne,response:i({url:k.url,data:void 0},Q)},`"${e}" certificate request failed (${g}). Status: ${Q.code} (${Q.text})`))},onTimeout:(Q,ee,ne)=>{I(new Ti({type:D.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:ne,response:{url:k.url,data:void 0}},`"${e}" certificate request timed out (${g})`))},onAbort:(Q,ee,ne)=>{I(new Error("aborted"))}};l.load(k,j,Z)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise((l,g)=>{e.setServerCertificate(n).then(T=>{this.log(`setServerCertificate ${T?"success":"not supported by CDM"} (${n.byteLength}) on "${t}"`),l(e)}).catch(T=>{g(new Ti({type:D.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:T,fatal:!0},T.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(n=>this.updateKeySession(e,new Uint8Array(n)).catch(l=>{throw new Ti({type:D.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:e.decryptdata,error:l,fatal:!1},l.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 l=new DOMParser().parseFromString(n,"application/xml"),g=l.querySelectorAll("HttpHeader");if(g.length>0){let j;for(let Z=0,Q=g.length;Z<Q;Z++){var T,I;j=g[Z];const ee=(T=j.querySelector("name"))==null?void 0:T.textContent,ne=(I=j.querySelector("value"))==null?void 0:I.textContent;ee&&ne&&e.setRequestHeader(ee,ne)}}const k=l.querySelector("Challenge"),U=k==null?void 0:k.textContent;if(!U)throw new Error("Cannot find <Challenge> in key message");return An(atob(U))}setupLicenseXHR(e,t,n,l){const g=this.config.licenseXhrSetup;return g?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return g.call(this.hls,e,t,n,l)}).catch(T=>{if(!n.decryptdata)throw T;return e.open("POST",t,!0),g.call(this.hls,e,t,n,l)}).then(T=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:T||l})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:l}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise((l,g)=>{const T=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${T}`);const I=new XMLHttpRequest;I.responseType="arraybuffer",I.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return g(new Error("invalid state"));if(I.readyState===4)if(I.status===200){this._requestLicenseFailureCount=0;let k=I.response;this.log(`License received ${k instanceof ArrayBuffer?k.byteLength:k}`);const U=this.config.licenseResponseCallback;if(U)try{k=U.call(this.hls,I,T,e)}catch(j){this.error(j)}l(k)}else{const k=n.errorRetry,U=k?k.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>U||I.status>=400&&I.status<500)g(new Ti({type:D.KEY_SYSTEM_ERROR,details:W.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:e.decryptdata,fatal:!0,networkDetails:I,response:{url:T,data:void 0,code:I.status,text:I.statusText}},`License Request XHR failed (${T}). Status: ${I.status} (${I.statusText})`));else{const j=U-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${j} attempts left`),this.requestLicense(e,t).then(l,g)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=I,this.setupLicenseXHR(I,T,e,t).then(({xhr:k,licenseChallenge:U})=>{e.keySystem==Br.PLAYREADY&&(U=this.unpackPlayReadyKeyMessage(k,U)),k.send(U)}).catch(g)})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,Kn(n,"encrypted",this.onMediaEncrypted),Kn(n,"waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(qn(e,"encrypted",this.onMediaEncrypted),qn(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;if(this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={},!this.mediaKeys&&!this.mediaKeySessions.length)return;const t=this.media,n=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,Fn.clearKeyUriToKeyIdMap();const l=n.length;da.CDMCleanupPromise=Promise.all(n.map(g=>this.removeSession(g)).concat(t==null||(e=t.setMediaKeys(null))==null?void 0:e.catch(g=>{this.log(`Could not clear media keys: ${g}`),this.hls&&this.hls.trigger(y.ERROR,{type:D.OTHER_ERROR,details:W.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${g}`)})}))).catch(g=>{this.log(`Could not close sessions and clear media keys: ${g}`),this.hls&&this.hls.trigger(y.ERROR,{type:D.OTHER_ERROR,details:W.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${g}`)})}).then(()=>{l&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this.keyFormatPromise=null,this.bannedKeyIds={}}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const n=t.reduce((l,g)=>(l.indexOf(g.keyFormat)===-1&&l.push(g.keyFormat),l),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n,decryptdata:l}=e;if(t){this.log(`Remove licenses and keys and close session "${t.sessionId}" keyId: ${N((l==null?void 0:l.keyId)||[])}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const g=this.mediaKeySessions.indexOf(e);g>-1&&this.mediaKeySessions.splice(g,1);const{drmSystemOptions:T}=this.config;return(hi(T)?new Promise((k,U)=>{self.setTimeout(()=>U(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(k).catch(U)}):Promise.resolve()).catch(k=>{this.log(`Could not remove session: ${k}`),this.hls&&this.hls.trigger(y.ERROR,{type:D.OTHER_ERROR,details:W.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${k}`)})}).then(()=>t.close()).catch(k=>{this.log(`Could not close session: ${k}`),this.hls&&this.hls.trigger(y.ERROR,{type:D.OTHER_ERROR,details:W.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${k}`)})})}}}da.CDMCleanupPromise=void 0;class Ti extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}function Io(b,e){const t=b==="output-restricted",n=t?W.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:W.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new Ti({type:D.KEY_SYSTEM_ERROR,details:n,fatal:!1,decryptdata:e},t?"HDCP level output restricted":`key status changed to "${b}"`)}class gc{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(y.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(y.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(y.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(y.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const l=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=l,l&&typeof l.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,n){const l=performance.now();if(t){if(this.lastTime){const g=l-this.lastTime,T=n-this.lastDroppedFrames,I=t-this.lastDecodedFrames,k=1e3*T/g,U=this.hls;if(U.trigger(y.FPS_DROP,{currentDropped:T,currentDecoded:I,totalDroppedFrames:n}),k>0&&T>U.config.fpsDroppedMonitoringThreshold*I){let j=U.currentLevel;U.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+j),j>0&&(U.autoLevelCapping===-1||U.autoLevelCapping>=j)&&(j=j-1,U.trigger(y.FPS_DROP_LEVEL_CAPPING,{level:j,droppedLevel:U.currentLevel}),U.autoLevelCapping=j,this.streamController.nextLevelSwitch())}}this.lastTime=l,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}function Po(b,e){let t;try{t=new Event("addtrack")}catch(n){t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=b,e.dispatchEvent(t)}function Mo(b,e){const t=b.mode;if(t==="disabled"&&(b.mode="hidden"),b.cues&&!b.cues.getCueById(e.id))try{if(b.addCue(e),!b.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(n){S.debug(`[texttrack-utils]: ${n}`);try{const l=new self.TextTrackCue(e.startTime,e.endTime,e.text);l.id=e.id,b.addCue(l)}catch(l){S.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${l}`)}}t==="disabled"&&(b.mode=t)}function _a(b,e){const t=b.mode;if(t==="disabled"&&(b.mode="hidden"),b.cues)for(let n=b.cues.length;n--;)e&&b.cues[n].removeEventListener("enter",e),b.removeCue(b.cues[n]);t==="disabled"&&(b.mode=t)}function Es(b,e,t,n){const l=b.mode;if(l==="disabled"&&(b.mode="hidden"),b.cues&&b.cues.length>0){const g=yc(b.cues,e,t);for(let T=0;T<g.length;T++)(!n||n(g[T]))&&b.removeCue(g[T])}l==="disabled"&&(b.mode=l)}function vc(b,e){if(e<=b[0].startTime)return 0;const t=b.length-1;if(e>b[t].endTime)return-1;let n=0,l=t,g;for(;n<=l;)if(g=Math.floor((l+n)/2),e<b[g].startTime)l=g-1;else if(e>b[g].startTime&&n<t)n=g+1;else return g;return b[n].startTime-e<e-b[l].startTime?n:l}function yc(b,e,t){const n=[],l=vc(b,e);if(l>-1)for(let g=l,T=b.length;g<T;g++){const I=b[g];if(I.startTime>=e&&I.endTime<=t)n.push(I);else if(I.startTime>t)return n}return n}function Ka(b){const e=[];for(let t=0;t<b.length;t++){const n=b[t];(n.kind==="subtitles"||n.kind==="captions")&&n.label&&e.push(b[t])}return e}class Ec extends hs{constructor(e){super(e,"subtitle-track-controller"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const n=Ka(this.media.textTracks);for(let g=0;g<n.length;g++)if(n[g].mode==="hidden")t=n[g];else if(n[g].mode==="showing"){t=n[g];break}const l=this.findTrackForTextTrack(t);this.subtitleTrack!==l&&this.setSubtitleTrack(l)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(y.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(y.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(y.MANIFEST_LOADING,this.onManifestLoading,this),e.on(y.MANIFEST_PARSED,this.onManifestParsed,this),e.on(y.LEVEL_LOADING,this.onLevelLoading,this),e.on(y.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(y.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(y.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(y.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(y.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(y.MANIFEST_LOADING,this.onManifestLoading,this),e.off(y.MANIFEST_PARSED,this.onManifestParsed,this),e.off(y.LEVEL_LOADING,this.onLevelLoading,this),e.off(y.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(y.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(y.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,t){const n=this.media;if(!n)return;const l=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,l)return;Ka(n.textTracks).forEach(T=>{_a(T)})}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:l,details:g}=t,T=this.tracksInGroup[n];if(!T||T.groupId!==l){this.warn(`Subtitle track with id:${n} and group:${l} not found in active group ${T==null?void 0:T.groupId}`);return}const I=T.details;T.details=t.details,this.log(`Subtitle track ${n} "${T.name}" lang:${T.lang} group:${l} loaded [${g.startSN}-${g.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,I)}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,l=this.groupIds;let g=this.currentTrack;if(!n||(l==null?void 0:l.length)!==(n==null?void 0:n.length)||n!=null&&n.some(T=>(l==null?void 0:l.indexOf(T))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const T=this.tracks.filter(j=>!n||n.indexOf(j.groupId)!==-1);if(T.length)this.selectDefaultTrack&&!T.some(j=>j.default)&&(this.selectDefaultTrack=!1),T.forEach((j,Z)=>{j.id=Z});else if(!g&&!this.tracksInGroup.length)return;this.tracksInGroup=T;const I=this.hls.config.subtitlePreference;if(!g&&I){this.selectDefaultTrack=!1;const j=Ke(I,T);if(j>-1)g=T[j];else{const Z=Ke(I,this.tracks);g=this.tracks[Z]}}let k=this.findTrackId(g);k===-1&&g&&(k=this.findTrackId(null));const U={subtitleTracks:T};this.log(`Updating subtitle tracks, ${T.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(y.SUBTITLE_TRACKS_UPDATED,U),k!==-1&&this.trackId===-1&&this.setSubtitleTrack(k)}}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let l=0;l<t.length;l++){const g=t[l];if(!(n&&!g.default||!n&&!e)&&(!e||Et(g,e)))return l}if(e){for(let l=0;l<t.length;l++){const g=t[l];if(ba(e.attrs,g.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return l}for(let l=0;l<t.length;l++){const g=t[l];if(ba(e.attrs,g.attrs,["LANGUAGE"]))return l}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const l=t[n];if(fs(l,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===L.SUBTITLE_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){if(e.id===-1)return this.setSubtitleTrack(-1),null;const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const n=this.currentTrack;if(n&&Et(e,n))return n;const l=Ke(e,this.tracksInGroup);if(l>-1){const g=this.tracksInGroup[l];return this.setSubtitleTrack(l),g}else{if(n)return null;{const g=Ke(e,t);if(g>-1)return t[g]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,l=e.groupId,g=this.getUrlWithDirectives(e.url,t),T=e.details,I=T==null?void 0:T.age;this.log(`Loading subtitle ${n} "${e.name}" lang:${e.lang} group:${l}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${I&&T.live?" age "+I.toFixed(1)+(T.type?" "+T.type||0:""):""} ${g}`),this.hls.trigger(y.SUBTITLE_TRACK_LOADING,{url:g,id:n,groupId:l,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=Ka(e.textTracks),n=this.currentTrack;let l;if(n&&(l=t.filter(g=>fs(n,g))[0],l||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach(g=>{g.mode!=="disabled"&&g!==l&&(g.mode="disabled")}),l){const g=this.subtitleDisplay?"showing":"hidden";l.mode!==g&&(l.mode=g)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!te(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,l=t[e]||null;if(this.trackId=e,this.currentTrack=l,this.toggleTrackModes(),!l){this.hls.trigger(y.SUBTITLE_TRACK_SWITCH,{id:e});return}const g=!!l.details&&!l.details.live;if(e===this.trackId&&l===n&&g)return;this.log(`Switching to subtitle-track ${e}`+(l?` "${l.name}" lang:${l.lang} group:${l.groupId}`:""));const{id:T,groupId:I="",name:k,type:U,url:j}=l;this.hls.trigger(y.SUBTITLE_TRACK_SWITCH,{id:T,groupId:I,name:k,type:U,url:j});const Z=this.switchParams(l.url,n==null?void 0:n.details,l.details);this.loadPlaylist(Z)}}function xc(){try{return crypto.randomUUID()}catch(b){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,l=>{const g=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(l=="x"?g:g&3|8).toString(16)})}}}function Sa(b){let e=5381,t=b.length;for(;t;)e=e*33^b.charCodeAt(--t);return(e>>>0).toString()}const ma=.025;let Ga=function(b){return b[b.Point=0]="Point",b[b.Range=1]="Range",b}({});function Tc(b,e,t){return`${b.identifier}-${t+1}-${Sa(e)}`}class Ac{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){var t;if(e>0&&e>=this.assetList.length)return!0;const n=this.playoutLimit;return e<=0||isNaN(n)?!1:n===0?!0:(((t=this.assetList[e])==null?void 0:t.startOffset)||0)>n}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return xs(e,t)}return e}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(this.startTime===0||this.snapOptions.out)return!0;const e=this.dateRange.tagAnchor;if(e){const t=this.dateRange.startTime,n=xs(t,e);return t-n<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=te(e)?e:this.duration;return this.cumulativeDuration+t}get resumeTime(){const e=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const t=this.resumeAnchor;if(t)return xs(e,t)}return e}get appendInPlace(){return this.appendInPlaceStarted?!0:this.appendInPlaceDisabled?!1:!!(!this.cue.once&&!this.cue.pre&&this.startIsAligned&&(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<ma))}set appendInPlace(e){if(this.appendInPlaceStarted){this.resetOnResume=!e;return}this.appendInPlaceDisabled=!e}get timelineStart(){return this._timelineStart!==null?this._timelineStart:this.startTime}set timelineStart(e){this._timelineStart=e}get duration(){const e=this.playoutLimit;let t;return this._duration!==null?t=this._duration:this.dateRange.duration?t=this.dateRange.duration:t=this.dateRange.plannedDuration||0,!isNaN(e)&&e<t&&(t=e),t}set duration(e){this._duration=e}get cue(){return this.dateRange.cue}get timelineOccupancy(){return this.dateRange.attr["X-TIMELINE-OCCUPIES"]==="RANGE"?Ga.Range:Ga.Point}get supplementsPrimary(){return this.dateRange.attr["X-TIMELINE-STYLE"]==="PRIMARY"}get contentMayVary(){return this.dateRange.attr["X-CONTENT-MAY-VARY"]!=="NO"}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||this.assetListResponse!==null}toString(){return bc(this)}}function xs(b,e){return b-e.start<e.duration/2&&!(Math.abs(b-(e.start+e.duration))<ma)?e.start:e.start+e.duration}function Oo(b,e,t){const n=new self.URL(b,t);return n.protocol!=="data:"&&n.searchParams.set("_HLS_primary_id",e),n}function Ts(b,e){for(;(t=b.assetList[++e])!=null&&t.error;)var t;return e}function bc(b){return`["${b.identifier}" ${b.cue.pre?"<pre>":b.cue.post?"<post>":""}${b.timelineStart.toFixed(2)}-${b.resumeTime.toFixed(2)}]`}function pa(b){const e=b.timelineStart,t=b.duration||0;return`["${b.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class Sc{constructor(e,t,n,l){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(y.PLAYOUT_LIMIT_REACHED,{})};const g=this.hls=new e(t);this.interstitial=n,this.assetItem=l;const T=()=>{this.hasDetails=!0};g.once(y.LEVEL_LOADED,T),g.once(y.AUDIO_TRACK_LOADED,T),g.once(y.SUBTITLE_TRACK_LOADED,T),g.on(y.MEDIA_ATTACHING,(I,{media:k})=>{this.removeMediaListeners(),this.mediaAttached=k,this.interstitial.playoutLimit&&(k.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&g.on(y.BUFFER_APPENDED,()=>{const j=this.bufferedEnd;this.reachedPlayout(j)&&(this._bufferedEosTime=j,g.trigger(y.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const e=this.hls;if(e)if(e.url)e.levels.length&&!e.started&&e.startLoad(-1,!0);else{let t=this.assetItem.uri;try{t=Oo(t,e.config.primarySessionId||"").href}catch(n){}e.loadSource(t)}}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e)return!1;const n=Math.min(this._bufferedEosTime||1/0,this.duration),l=this.timelineOffset,g=Dr.bufferInfo(e,l,0);return this.getAssetTime(g.end)>=n-.02}reachedPlayout(e){const n=this.interstitial.playoutLimit;return this.startOffset+e>=n}get destroyed(){var e;return!((e=this.hls)!=null&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return((e=this.hls)==null?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=Dr.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;if(!e)return 0;const t=this.interstitial.playoutLimit;if(t){const n=t-this.startOffset;if(n>0&&n<e)return n}return e}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return((e=this.hls)==null?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const n=e-t;if(Math.abs(n)>1/9e4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,n=this.duration;return Math.min(Math.max(0,e-t),n)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var e;(e=this.hls)!=null&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){var t;this.loadSource(),(t=this.hls)==null||t.attachMedia(e)}detachMedia(){var e;this.removeMediaListeners(),this.mediaAttached=null,(e=this.hls)==null||e.detachMedia()}resumeBuffering(){var e;(e=this.hls)==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.hls)==null||e.pauseBuffering()}transferMedia(){var e;return this.bufferSnapShot(),((e=this.hls)==null?void 0:e.transferMedia())||null}resetDetails(){const e=this.hls;if(e&&this.hasDetails){e.stopLoad();const t=n=>delete n.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,n){var l;(l=this.hls)==null||l.on(e,t)}once(e,t,n){var l;(l=this.hls)==null||l.once(e,t)}off(e,t,n){var l;(l=this.hls)==null||l.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${pa(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const No=.033;class Dc extends m{constructor(e,t){super("interstitials-sched",t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(e=>e.reset()),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce((n,l)=>e<=l.startOffset&&t>l.startOffset?(delete l.error,n+1):n,0):0}get duration(){const e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,t){if(e.event)return this.findEventIndex(e.event.identifier);let n=-1;e.nextEvent?n=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(n=this.findEventIndex(e.previousEvent.identifier)+1);const l=this.items;if(l)for(l[n]||(t===void 0&&(t=e.start),n=this.findItemIndexAtTime(t));n>=0&&(g=l[n])!=null&&g.event;){var g;n--}return n}findItemIndexAtTime(e,t){const n=this.items;if(n)for(let l=0;l<n.length;l++){let g=n[l];if(t&&t!=="primary"&&(g=g[t]),e===g.start||e>g.start&&e<g.end)return l}return-1}findJumpRestrictedIndex(e,t){const n=this.items;if(n)for(let l=e;l<=t&&n[l];l++){const g=n[l].event;if(g!=null&&g.restrictions.jump&&!g.appendInPlace)return l}return-1}findEventIndex(e){const t=this.items;if(t)for(let l=t.length;l--;){var n;if(((n=t[l].event)==null?void 0:n.identifier)===e)return l}return-1}findAssetIndex(e,t){const n=e.assetList,l=n.length;if(l>1)for(let g=0;g<l;g++){const T=n[g];if(!T.error){const I=T.timelineStart;if(t===I||t>I&&(t<I+(T.duration||0)||g===l-1))return g}}return 0}get assetIdAtEnd(){var e;const t=(e=this.items)==null||(e=e[this.length-1])==null?void 0:e.event;if(t){const n=t.assetList,l=n[n.length-1];if(l)return l.identifier}return null}parseInterstitialDateRanges(e,t){const n=e.main.details,{dateRanges:l}=n,g=this.events,T=this.parseDateRanges(l,{url:n.url},t),I=Object.keys(l),k=g?g.filter(U=>!I.includes(U.identifier)):[];T.length&&T.sort((U,j)=>{const Z=U.cue.pre,Q=U.cue.post,ee=j.cue.pre,ne=j.cue.post;if(Z&&!ee)return-1;if(ee&&!Z||Q&&!ne)return 1;if(ne&&!Q)return-1;if(!Z&&!ee&&!Q&&!ne){const de=U.startTime,ce=j.startTime;if(de!==ce)return de-ce}return U.dateRange.tagOrder-j.dateRange.tagOrder}),this.events=T,k.forEach(U=>{this.removeEvent(U)}),this.updateSchedule(e,k)}updateSchedule(e,t=[],n=!1){const l=this.events||[];if(l.length||t.length||this.length<2){const g=this.items,T=this.parseSchedule(l,e);(n||t.length||(g==null?void 0:g.length)!==T.length||T.some((k,U)=>Math.abs(k.playout.start-g[U].playout.start)>.005||Math.abs(k.playout.end-g[U].playout.end)>.005))&&(this.items=T,this.onScheduleUpdate(t,g))}}parseDateRanges(e,t,n){const l=[],g=Object.keys(e);for(let T=0;T<g.length;T++){const I=g[T],k=e[I];if(k.isInterstitial){let U=this.eventMap[I];U?U.setDateRange(k):(U=new Ac(k,t),this.eventMap[I]=U,n===!1&&(U.appendInPlace=n)),l.push(U)}}return l}parseSchedule(e,t){const n=[],l=t.main.details,g=l.live?1/0:l.edge;let T=0;if(e=e.filter(k=>!k.error&&!(k.cue.once&&k.hasPlayed)),e.length){this.resolveOffsets(e,t);let k=0,U=0;if(e.forEach((j,Z)=>{const Q=j.cue.pre,ee=j.cue.post,ne=e[Z-1]||null,de=j.appendInPlace,ce=ee?g:j.startOffset,Ee=j.duration,ke=j.timelineOccupancy===Ga.Range?Ee:0,Me=j.resumptionOffset,Ye=(ne==null?void 0:ne.startTime)===ce,lt=ce+j.cumulativeDuration;let Ct=de?lt+Ee:ce+Me;if(Q||!ee&&ce<=0){const vt=U;U+=ke,j.timelineStart=lt;const xt=T;T+=Ee,n.push({event:j,start:lt,end:Ct,playout:{start:xt,end:T},integrated:{start:vt,end:U}})}else if(ce<=g){if(!Ye){const at=ce-k;if(at>No){const Gt=k,dr=U;U+=at;const Lr=T;T+=at;const Ur={previousEvent:e[Z-1]||null,nextEvent:j,start:Gt,end:Gt+at,playout:{start:Lr,end:T},integrated:{start:dr,end:U}};n.push(Ur)}else at>0&&ne&&(ne.cumulativeDuration+=at,n[n.length-1].end=ce)}ee&&(Ct=lt),j.timelineStart=lt;const vt=U;U+=ke;const xt=T;T+=Ee,n.push({event:j,start:lt,end:Ct,playout:{start:xt,end:T},integrated:{start:vt,end:U}})}else return;const rt=j.resumeTime;ee||rt>g?k=g:k=rt}),k<g){var I;const j=k,Z=U,Q=g-k;U+=Q;const ee=T;T+=Q,n.push({previousEvent:((I=n[n.length-1])==null?void 0:I.event)||null,nextEvent:null,start:k,end:j+Q,playout:{start:ee,end:T},integrated:{start:Z,end:U}})}this.setDurations(g,T,U)}else n.push({previousEvent:null,nextEvent:null,start:0,end:g,playout:{start:0,end:g},integrated:{start:0,end:g}}),this.setDurations(g,g,g);return n}setDurations(e,t,n){this.durations={primary:e,playout:t,integrated:n}}resolveOffsets(e,t){const n=t.main.details,l=n.live?1/0:n.edge;let g=0,T=-1;e.forEach((I,k)=>{const U=I.cue.pre,j=I.cue.post,Z=U?0:j?l:I.startTime;this.updateAssetDurations(I),T===Z?I.cumulativeDuration=g:(g=0,T=Z),!j&&I.snapOptions.in&&(I.resumeAnchor=mr(null,n.fragments,I.startOffset+I.resumptionOffset,0,0)||void 0),I.appendInPlace&&!I.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(I,t)||(I.appendInPlace=!1)),!I.appendInPlace&&k+1<e.length&&e[k+1].startTime-e[k].resumeTime<No&&(e[k+1].appendInPlace=!1,e[k+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${I}`));const ee=te(I.resumeOffset)?I.resumeOffset:I.duration;g+=ee})}primaryCanResumeInPlaceAt(e,t){const n=e.resumeTime,l=e.startTime+e.resumptionOffset;return Math.abs(n-l)>ma?(this.log(`"${e.identifier}" resumption ${n} not aligned with estimated timeline end ${l}`),!1):!Object.keys(t).some(T=>{const I=t[T].details,k=I.edge;if(n>=k)return this.log(`"${e.identifier}" resumption ${n} past ${T} playlist end ${k}`),!1;const U=mr(null,I.fragments,n);if(!U)return this.log(`"${e.identifier}" resumption ${n} does not align with any fragments in ${T} playlist (${I.fragStart}-${I.fragmentEnd})`),!0;const j=T==="audio"?.175:0;return Math.abs(U.start-n)<ma+j||Math.abs(U.end-n)<ma+j?!1:(this.log(`"${e.identifier}" resumption ${n} not aligned with ${T} fragment bounds (${U.start}-${U.end} sn: ${U.sn} cc: ${U.cc})`),!0)})}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let n=0,l=!1,g=!1;for(let T=0;T<e.assetList.length;T++){const I=e.assetList[T],k=t+n;I.startOffset=n,I.timelineStart=k,l||(l=I.duration===null),g||(g=!!I.error);const U=I.error?0:I.duration||0;n+=U}l&&!g?e.duration=Math.max(n,e.duration):e.duration=n}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function Ai(b){return`[${b.event?'"'+b.event.identifier+'"':"primary"}: ${b.start.toFixed(2)}-${b.end.toFixed(2)}]`}class Lc{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const n=e.assetListUrl;let l;try{l=Oo(n,this.hls.sessionId,e.baseUrl)}catch(Q){const ee=this.assignAssetListError(e,W.ASSET_LIST_LOAD_ERROR,Q,n);this.hls.trigger(y.ERROR,ee);return}t&&l.protocol!=="data:"&&l.searchParams.set("_HLS_start_offset",""+t);const g=this.hls.config,T=g.loader,I=new T(g),k={responseType:"json",url:l.href},U=g.interstitialAssetListLoadPolicy.default,j={loadPolicy:U,timeout:U.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},Z={onSuccess:(Q,ee,ne,de)=>{const ce=Q.data,Ee=ce==null?void 0:ce.ASSETS;if(!Array.isArray(Ee)){const ke=this.assignAssetListError(e,W.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),ne.url,ee,de);this.hls.trigger(y.ERROR,ke);return}e.assetListResponse=ce,this.hls.trigger(y.ASSET_LIST_LOADED,{event:e,assetListResponse:ce,networkDetails:de})},onError:(Q,ee,ne,de)=>{const ce=this.assignAssetListError(e,W.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${Q.code} ${Q.text} (${ee.url})`),ee.url,de,ne);this.hls.trigger(y.ERROR,ce)},onTimeout:(Q,ee,ne)=>{const de=this.assignAssetListError(e,W.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${ee.url})`),ee.url,Q,ne);this.hls.trigger(y.ERROR,de)}};return I.load(k,j,Z),this.hls.trigger(y.ASSET_LIST_LOADING,{event:e}),I}assignAssetListError(e,t,n,l,g,T){return e.error=n,{type:D.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:l,error:n,networkDetails:T,stats:g}}}function Bo(b){b==null||b.play().catch(()=>{})}function Va(b,e){return`[${b}] Advancing timeline position to ${e}`}class Rc extends m{constructor(e,t){super("interstitials",e.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled||!this.schedule)return;const l=n-this.timelinePos;if(Math.abs(l)<1/7056e5)return;const T=l<=-.01;this.timelinePos=n,this.bufferedPos=n;const I=this.playingItem;if(!I){this.checkBuffer();return}if(T&&this.schedule.resetErrorsInRange(n,n-l)&&this.updateSchedule(!0),this.checkBuffer(),T&&n<I.start||n>=I.end){var k;const ee=this.findItemIndex(I);let ne=this.schedule.findItemIndexAtTime(n);if(ne===-1&&(ne=ee+(T?-1:1),this.log(`seeked ${T?"back ":""}to position not covered by schedule ${n} (resolving from ${ee} to ${ne})`)),!this.isInterstitial(I)&&(k=this.media)!=null&&k.paused&&(this.shouldPlay=!1),!T&&ne>ee){const de=this.schedule.findJumpRestrictedIndex(ee+1,ne);if(de>ee){this.setSchedulePosition(de);return}}this.setSchedulePosition(ne);return}const U=this.playingAsset;if(!U){if(this.playingLastItem&&this.isInterstitial(I)){const ee=I.event.assetList[0];ee&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(n,ee))}return}const j=U.timelineStart,Z=U.duration||0;if(T&&n<j||n>=j+Z){var Q;(Q=I.event)!=null&&Q.appendInPlace&&(this.clearInterstitial(I.event,I),this.flushFrontBuffer(n)),this.setScheduleToAssetAtTime(n,U)}},this.onTimeupdate=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;if(n>this.timelinePos)this.timelinePos=n,n>this.bufferedPos&&this.checkBuffer();else return;const l=this.playingItem;if(!l||this.playingLastItem)return;if(n>=l.end){this.timelinePos=l.end;const I=this.findItemIndex(l);this.setSchedulePosition(I+1)}const g=this.playingAsset;if(!g)return;const T=g.timelineStart+(g.duration||0);n>=T&&this.setScheduleToAssetAtTime(n,g)},this.onScheduleUpdate=(n,l)=>{const g=this.schedule;if(!g)return;const T=this.playingItem,I=g.events||[],k=g.items||[],U=g.durations,j=n.map(de=>de.identifier),Z=!!(I.length||j.length);(Z||l)&&this.log(`INTERSTITIALS_UPDATED (${I.length}): ${I}
|
|
Schedule: ${k.map(de=>Ai(de))} pos: ${this.timelinePos}`),j.length&&this.log(`Removed events ${j}`);let Q=null,ee=null;T&&(Q=this.updateItem(T,this.timelinePos),this.itemsMatch(T,Q)?this.playingItem=Q:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const ne=this.bufferingItem;if(ne&&(ee=this.updateItem(ne,this.bufferedPos),this.itemsMatch(ne,ee)?this.bufferingItem=ee:ne.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(ne.event,null))),n.forEach(de=>{de.assetList.forEach(ce=>{this.clearAssetPlayer(ce.identifier,null)})}),this.playerQueue.forEach(de=>{if(de.interstitial.appendInPlace){const ce=de.assetItem.timelineStart,Ee=de.timelineOffset-ce;if(Ee)try{de.timelineOffset=ce}catch(ke){Math.abs(Ee)>ma&&this.warn(`${ke} ("${de.assetId}" ${de.timelineOffset}->${ce})`)}}}),Z||l){if(this.hls.trigger(y.INTERSTITIALS_UPDATED,{events:I.slice(0),schedule:k.slice(0),durations:U,removedIds:j}),this.isInterstitial(T)&&j.includes(T.event.identifier)){this.warn(`Interstitial "${T.event.identifier}" removed while playing`),this.primaryFallback(T.event);return}T&&this.trimInPlace(Q,T),ne&&ee!==Q&&this.trimInPlace(ee,ne),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new Lc(e),this.schedule=new Dc(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e&&(e.on(y.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(y.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(y.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(y.MANIFEST_LOADING,this.onManifestLoading,this),e.on(y.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(y.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(y.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(y.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(y.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(y.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(y.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(y.BUFFER_APPENDED,this.onBufferAppended,this),e.on(y.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(y.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(y.MEDIA_ENDED,this.onMediaEnded,this),e.on(y.ERROR,this.onError,this),e.on(y.DESTROYING,this.onDestroying,this))}unregisterListeners(){const e=this.hls;e&&(e.off(y.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(y.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(y.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(y.MANIFEST_LOADING,this.onManifestLoading,this),e.off(y.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(y.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(y.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(y.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(y.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(y.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(y.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(y.BUFFER_CODECS,this.onBufferCodecs,this),e.off(y.BUFFER_APPENDED,this.onBufferAppended,this),e.off(y.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(y.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(y.MEDIA_ENDED,this.onMediaEnded,this),e.off(y.ERROR,this.onError,this),e.off(y.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;(e=this.getBufferingPlayer())==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.getBufferingPlayer())==null||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){qn(e,"play",this.onPlay),qn(e,"pause",this.onPause),qn(e,"seeking",this.onSeeking),qn(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const n=this.media=t.media;Kn(n,"seeking",this.onSeeking),Kn(n,"timeupdate",this.onTimeupdate),Kn(n,"play",this.onPlay),Kn(n,"pause",this.onPause)}onMediaAttached(e,t){const n=this.effectivePlayingItem,l=this.detachedData;if(this.detachedData=null,n===null)this.checkStart();else if(!l){this.clearScheduleState();const g=this.findItemIndex(n);this.setSchedulePosition(g)}}clearScheduleState(){this.log("clear schedule state"),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const n=!!t.transferMedia,l=this.media;if(this.media=null,!n&&(l&&this.removeMediaListeners(l),this.detachedData)){const g=this.getBufferingPlayer();g&&(this.log(`Removing schedule state for detachedData and ${g}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,g.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const e=this,t=()=>e.bufferingItem||e.waitingItem,n=Z=>Z&&e.getAssetPlayer(Z.identifier),l=(Z,Q,ee,ne,de)=>{if(Z){let ce=Z[Q].start;const Ee=Z.event;if(Ee){if(Q==="playout"||Ee.timelineOccupancy!==Ga.Point){const ke=n(ee);(ke==null?void 0:ke.interstitial)===Ee&&(ce+=ke.assetItem.startOffset+ke[de])}}else{const ke=ne==="bufferedPos"?T():e[ne];ce+=ke-Z.start}return ce}return 0},g=(Z,Q)=>{var ee;if(Z!==0&&Q!=="primary"&&(ee=e.schedule)!=null&&ee.length){var ne;const de=e.schedule.findItemIndexAtTime(Z),ce=(ne=e.schedule.items)==null?void 0:ne[de];if(ce){const Ee=ce[Q].start-ce.start;return Z+Ee}}return Z},T=()=>{const Z=e.bufferedPos;return Z===Number.MAX_VALUE?I("primary"):Math.max(Z,0)},I=Z=>{var Q,ee;return(Q=e.primaryDetails)!=null&&Q.live?e.primaryDetails.edge:((ee=e.schedule)==null?void 0:ee.durations[Z])||0},k=(Z,Q)=>{var ee,ne;const de=e.effectivePlayingItem;if(de!=null&&(ee=de.event)!=null&&ee.restrictions.skip||!e.schedule)return;e.log(`seek to ${Z} "${Q}"`);const ce=e.effectivePlayingItem,Ee=e.schedule.findItemIndexAtTime(Z,Q),ke=(ne=e.schedule.items)==null?void 0:ne[Ee],Me=e.getBufferingPlayer(),Ye=Me==null?void 0:Me.interstitial,lt=Ye==null?void 0:Ye.appendInPlace,Ct=ce&&e.itemsMatch(ce,ke);if(ce&&(lt||Ct)){const rt=n(e.playingAsset),vt=(rt==null?void 0:rt.media)||e.primaryMedia;if(vt){const xt=Q==="primary"?vt.currentTime:l(ce,Q,e.playingAsset,"timelinePos","currentTime"),at=Z-xt,Gt=(lt?xt:vt.currentTime)+at;if(Gt>=0&&(!rt||lt||Gt<=rt.duration)){vt.currentTime=Gt;return}}}if(ke){let rt=Z;if(Q!=="primary"){const xt=ke[Q].start,at=Z-xt;rt=ke.start+at}const vt=!e.isInterstitial(ke);if((!e.isInterstitial(ce)||ce.event.appendInPlace)&&(vt||ke.event.appendInPlace)){const xt=e.media||(lt?Me==null?void 0:Me.media:null);xt&&(xt.currentTime=rt)}else if(ce){const xt=e.findItemIndex(ce);if(Ee>xt){const Gt=e.schedule.findJumpRestrictedIndex(xt+1,Ee);if(Gt>xt){e.setSchedulePosition(Gt);return}}let at=0;if(vt)e.timelinePos=rt,e.checkBuffer();else{const Gt=ke.event.assetList,dr=Z-(ke[Q]||ke).start;for(let Lr=Gt.length;Lr--;){const Ur=Gt[Lr];if(Ur.duration&&dr>=Ur.startOffset&&dr<Ur.startOffset+Ur.duration){at=Lr;break}}}e.setSchedulePosition(Ee,at)}}},U=()=>{const Z=e.effectivePlayingItem;if(e.isInterstitial(Z))return Z;const Q=t();return e.isInterstitial(Q)?Q:null},j={get bufferedEnd(){const Z=t(),Q=e.bufferingItem;if(Q&&Q===Z){var ee;return l(Q,"playout",e.bufferingAsset,"bufferedPos","bufferedEnd")-Q.playout.start||((ee=e.bufferingAsset)==null?void 0:ee.startOffset)||0}return 0},get currentTime(){const Z=U(),Q=e.effectivePlayingItem;return Q&&Q===Z?l(Q,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-Q.playout.start:0},set currentTime(Z){const Q=U(),ee=e.effectivePlayingItem;ee&&ee===Q&&k(Z+ee.playout.start,"playout")},get duration(){const Z=U();return Z?Z.playout.end-Z.playout.start:0},get assetPlayers(){var Z;const Q=(Z=U())==null?void 0:Z.event.assetList;return Q?Q.map(ee=>e.getAssetPlayer(ee.identifier)):[]},get playingIndex(){var Z;const Q=(Z=U())==null?void 0:Z.event;return Q&&e.effectivePlayingAsset?Q.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return U()}};return this.manager={get events(){var Z;return((Z=e.schedule)==null||(Z=Z.events)==null?void 0:Z.slice(0))||[]},get schedule(){var Z;return((Z=e.schedule)==null||(Z=Z.items)==null?void 0:Z.slice(0))||[]},get interstitialPlayer(){return U()?j:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const Z=t();return e.findItemIndex(Z)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const Z=e.effectivePlayingItem;return e.findItemIndex(Z)},primary:{get bufferedEnd(){return T()},get currentTime(){const Z=e.timelinePos;return Z>0?Z:0},set currentTime(Z){k(Z,"primary")},get duration(){return I("primary")},get seekableStart(){var Z;return((Z=e.primaryDetails)==null?void 0:Z.fragmentStart)||0}},integrated:{get bufferedEnd(){return l(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return l(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(Z){k(Z,"integrated")},get duration(){return I("integrated")},get seekableStart(){var Z;return g(((Z=e.primaryDetails)==null?void 0:Z.fragmentStart)||0,"integrated")}},skip:()=>{const Z=e.effectivePlayingItem,Q=Z==null?void 0:Z.event;if(Q&&!Q.restrictions.skip){const ee=e.findItemIndex(Z);if(Q.appendInPlace){const ne=Z.playout.start+Z.event.duration;k(ne+.001,"playout")}else e.advanceAfterAssetEnded(Q,ee,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,n=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!n?!1:this.findItemIndex(t)===n.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t;if(this.mediaSelection===null)return;const n=this.waitingItem||this.playingItem;if(this.isInterstitial(n)&&!n.event.appendInPlace)return;let l=this.media;!l&&(e=this.bufferingItem)!=null&&(e=e.event)!=null&&e.appendInPlace&&(l=this.primaryMedia);const g=(t=l)==null?void 0:t.currentTime;if(!(g===void 0||!te(g)))return g}get primaryMedia(){var e;return this.media||((e=this.detachedData)==null?void 0:e.media)||null}isInterstitial(e){return!!(e!=null&&e.event)}retreiveMediaSource(e,t){const n=this.getAssetPlayer(e);n&&this.transferMediaFromPlayer(n,t)}transferMediaFromPlayer(e,t){const n=e.interstitial.appendInPlace,l=e.media;if(n&&l===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&l){this.detachedData={media:l};return}const g=e.transferMedia();this.log(`transfer MediaSource from ${e} ${ot(g)}`),this.detachedData=g}else t&&l&&(this.shouldPlay||(this.shouldPlay=!l.paused))}transferMediaTo(e,t){var n,l;if(e.media===t)return;let g=null;const T=this.hls,I=e!==T,k=I&&e.interstitial.appendInPlace,U=(n=this.detachedData)==null?void 0:n.mediaSource;let j;if(T.media)k&&(g=T.transferMedia(),this.detachedData=g),j="Primary";else if(U){const ne=this.getBufferingPlayer();ne?(g=ne.transferMedia(),j=`${ne}`):j="detached MediaSource"}else j="detached media";if(!g){if(U)g=this.detachedData,this.log(`using detachedData: MediaSource ${ot(g)}`);else if(!this.detachedData||T.media===t){const ne=this.playerQueue;ne.length>1&&ne.forEach(de=>{if(I&&de.interstitial.appendInPlace!==k){const ce=de.interstitial;this.clearInterstitial(de.interstitial,null),ce.appendInPlace=!1,ce.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${ce}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const Z=g&&"mediaSource"in g&&((l=g.mediaSource)==null?void 0:l.readyState)!=="closed",Q=Z&&g?g:t;this.log(`${Z?"transfering MediaSource":"attaching media"} to ${I?e:"Primary"} from ${j} (media.currentTime: ${t.currentTime})`);const ee=this.schedule;if(Q===g&&ee){const ne=I&&e.assetId===ee.assetIdAtEnd;Q.overrides={duration:ee.duration,endOfStream:!I||ne,cueRemoval:!I}}e.attachMedia(Q)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e==null?void 0:e.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const n=this.timelinePos,l=this.effectivePlayingItem;if(n===-1){const g=this.hls.startPosition;if(this.log(Va("checkStart",g)),this.timelinePos=g,t.length&&t[0].cue.pre){const T=e.findEventIndex(t[0].identifier);this.setSchedulePosition(T)}else if(g>=0||!this.primaryLive){const T=this.timelinePos=g>0?g:0,I=e.findItemIndexAtTime(T);this.setSchedulePosition(I)}}else if(l&&!this.playingItem){const g=e.findItemIndex(l);this.setSchedulePosition(g)}}advanceAssetBuffering(e,t){const n=e.event,l=n.findAssetIndex(t),g=Ts(n,l);if(!n.isAssetPastPlayoutLimit(g))this.bufferedToEvent(e,g);else if(this.schedule){var T;const I=(T=this.schedule.items)==null?void 0:T[this.findItemIndex(e)+1];I&&this.bufferedToItem(I)}}advanceAfterAssetEnded(e,t,n){const l=Ts(e,n);if(e.isAssetPastPlayoutLimit(l)){if(this.schedule){const g=this.schedule.items;if(g){const T=t+1,I=g.length;if(T>=I){this.setSchedulePosition(-1);return}const k=e.resumeTime;this.timelinePos<k&&(this.log(Va("advanceAfterAssetEnded",k)),this.timelinePos=k,e.appendInPlace&&this.advanceInPlace(k),this.checkBuffer(this.bufferedPos<k)),this.setSchedulePosition(T)}}}else{if(e.appendInPlace){const g=e.assetList[l];g&&this.advanceInPlace(g.timelineStart)}this.setSchedulePosition(t,l)}}setScheduleToAssetAtTime(e,t){const n=this.schedule;if(!n)return;const l=t.parentIdentifier,g=n.getEvent(l);if(g){const T=n.findEventIndex(l),I=n.findAssetIndex(g,e);this.advanceAfterAssetEnded(g,T,I-1)}}setSchedulePosition(e,t){var n;const l=(n=this.schedule)==null?void 0:n.items;if(!l||this.playbackDisabled)return;const g=e>=0?l[e]:null;this.log(`setSchedulePosition ${e}, ${t} (${g&&Ai(g)}) pos: ${this.timelinePos}`);const T=this.waitingItem||this.playingItem,I=this.playingLastItem;if(this.isInterstitial(T)){const j=T.event,Z=this.playingAsset,Q=Z==null?void 0:Z.identifier,ee=Q?this.getAssetPlayer(Q):null;if(ee&&Q&&(!this.eventItemsMatch(T,g)||t!==void 0&&Q!==j.assetList[t].identifier)){var k;const ne=j.findAssetIndex(Z);if(this.log(`INTERSTITIAL_ASSET_ENDED ${ne+1}/${j.assetList.length} ${pa(Z)}`),this.endedAsset=Z,this.playingAsset=null,this.hls.trigger(y.INTERSTITIAL_ASSET_ENDED,{asset:Z,assetListIndex:ne,event:j,schedule:l.slice(0),scheduleIndex:e,player:ee}),T!==this.playingItem){this.itemsMatch(T,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(j,this.findItemIndex(this.playingItem),ne);return}this.retreiveMediaSource(Q,g),ee.media&&!((k=this.detachedData)!=null&&k.mediaSource)&&ee.detachMedia()}if(!this.eventItemsMatch(T,g)&&(this.endedItem=T,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${j} ${Ai(T)}`),j.hasPlayed=!0,this.hls.trigger(y.INTERSTITIAL_ENDED,{event:j,schedule:l.slice(0),scheduleIndex:e}),j.cue.once)){var U;this.updateSchedule();const ne=(U=this.schedule)==null?void 0:U.items;if(g&&ne){const de=this.findItemIndex(g);this.advanceSchedule(de,ne,t,T,I)}return}}this.advanceSchedule(e,l,t,T,I)}advanceSchedule(e,t,n,l,g){const T=this.schedule;if(!T)return;const I=t[e]||null,k=this.primaryMedia,U=this.playerQueue;if(U.length&&U.forEach(j=>{const Z=j.interstitial,Q=T.findEventIndex(Z.identifier);(Q<e||Q>e+1)&&this.clearInterstitial(Z,I)}),this.isInterstitial(I)){this.timelinePos=Math.min(Math.max(this.timelinePos,I.start),I.end);const j=I.event;if(n===void 0){n=T.findAssetIndex(j,this.timelinePos);const ne=Ts(j,n-1);if(j.isAssetPastPlayoutLimit(ne)||j.appendInPlace&&this.timelinePos===I.end){this.advanceAfterAssetEnded(j,e,n);return}n=ne}const Z=this.waitingItem;this.assetsBuffered(I,k)||this.setBufferingItem(I);let Q=this.preloadAssets(j,n);if(this.eventItemsMatch(I,Z||l)||(this.waitingItem=I,this.log(`INTERSTITIAL_STARTED ${Ai(I)} ${j.appendInPlace?"append in place":""}`),this.hls.trigger(y.INTERSTITIAL_STARTED,{event:j,schedule:t.slice(0),scheduleIndex:e})),!j.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${j}`);return}if(j.assetListLoader&&(j.assetListLoader.destroy(),j.assetListLoader=void 0),!k){this.log(`Waiting for attachMedia to start Interstitial ${j}`);return}this.waitingItem=this.endedItem=null,this.playingItem=I;const ee=j.assetList[n];if(!ee){this.advanceAfterAssetEnded(j,e,n||0);return}if(Q||(Q=this.getAssetPlayer(ee.identifier)),Q===null||Q.destroyed){const ne=j.assetList.length;this.warn(`asset ${n+1}/${ne} player destroyed ${j}`),Q=this.createAssetPlayer(j,ee,n),Q.loadSource()}if(!this.eventItemsMatch(I,this.bufferingItem)&&j.appendInPlace&&this.isAssetBuffered(ee))return;this.startAssetPlayer(Q,n,t,e,k),this.shouldPlay&&Bo(Q.media)}else I?(this.resumePrimary(I,e,l),this.shouldPlay&&Bo(this.hls.media)):g&&this.isInterstitial(l)&&(this.endedItem=null,this.playingItem=l,l.event.appendInPlace||this.attachPrimary(T.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e;return(e=this.mediaSelection)==null?void 0:e.main.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,n){var l,g;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Ai(e)}`),!((l=this.detachedData)!=null&&l.mediaSource)){let I=this.timelinePos;(I<e.start||I>=e.end)&&(I=this.getPrimaryResumption(e,t),this.log(Va("resumePrimary",I)),this.timelinePos=I),this.attachPrimary(I,e)}if(!n)return;const T=(g=this.schedule)==null?void 0:g.items;T&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Ai(e)}`),this.hls.trigger(y.INTERSTITIALS_PRIMARY_RESUMED,{schedule:T.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const n=e.start;if(this.primaryLive){const l=this.primaryDetails;if(t===0)return this.hls.startPosition;if(l&&(n<l.fragmentStart||n>l.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:Dr.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,n){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const l=this.primaryMedia;if(!l)return;const g=this.hls;g.media?this.checkBuffer():(this.transferMediaTo(g,l),n&&this.startLoadingPrimaryAt(e,n)),n||(this.log(Va("attachPrimary",e)),this.timelinePos=e,this.startLoadingPrimaryAt(e,n))}startLoadingPrimaryAt(e,t){var n;const l=this.hls;!l.loadingEnabled||!l.media||Math.abs((((n=l.mainForwardBufferInfo)==null?void 0:n.start)||l.media.currentTime)-e)>.5?l.startLoad(e,t):l.bufferingEnabled||l.resumeBuffering()}onManifestLoading(){var e;this.stopLoad(),(e=this.schedule)==null||e.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(y.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(y.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1||!this.schedule)return;const n=this.hls.levels[t.level],l=i(i({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=l,this.schedule.parseInterstitialDateRanges(l,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const n=this.hls.audioTracks[t.id],l=this.mediaSelection;if(!l){this.altSelection=i(i({},this.altSelection),{},{audio:n});return}const g=i(i({},l),{},{audio:n});this.mediaSelection=g}onSubtitleTrackUpdated(e,t){const n=this.hls.subtitleTracks[t.id],l=this.mediaSelection;if(!l){this.altSelection=i(i({},this.altSelection),{},{subtitles:n});return}const g=i(i({},l),{},{subtitles:n});this.mediaSelection=g}onAudioTrackSwitching(e,t){const n=et(t);this.playerQueue.forEach(({hls:l})=>l&&(l.setAudioOption(t)||l.setAudioOption(n)))}onSubtitleTrackSwitch(e,t){const n=et(t);this.playerQueue.forEach(({hls:l})=>l&&(l.setSubtitleOption(t)||t.id!==-1&&l.setSubtitleOption(n)))}onBufferCodecs(e,t){const n=t.tracks;n&&(this.requiredTracks=n)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const n=this.playingItem;if(n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)){const l=this.timelinePos;this.bufferedPos=l,this.checkBuffer()}}onBufferedToEnd(e){if(!this.schedule)return;const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let l=0;l<t.length;l++){const g=t[l];if(g.cue.post){var n;const T=this.schedule.findEventIndex(g.identifier),I=(n=this.schedule.items)==null?void 0:n[T];this.isInterstitial(I)&&this.eventItemsMatch(I,this.bufferingItem)&&this.bufferedToItem(I,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const n=this.findItemIndex(t);this.setSchedulePosition(n+1)}else this.shouldPlay=!1}updateItem(e,t){var n;const l=(n=this.schedule)==null?void 0:n.items;if(e&&l){const g=this.findItemIndex(e,t);return l[g]||null}return null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach((g,T)=>{e.event.isAssetPastPlayoutLimit(T)&&this.clearAssetPlayer(g.identifier,null)});const n=e.end+.25,l=Dr.bufferInfo(this.primaryMedia,n,0);(l.end>n||(l.nextStart||0)>n)&&(this.log(`trim buffered interstitial ${Ai(e)} (was ${Ai(t)})`),this.attachPrimary(n,null,!0),this.flushFrontBuffer(n))}}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var n;return!!t&&(e===t||e.event.identifier===((n=t.event)==null?void 0:n.identifier))}findItemIndex(e,t){return e&&this.schedule?this.schedule.findItemIndex(e,t):-1}updateSchedule(e=!1){var t;const n=this.mediaSelection;n&&((t=this.schedule)==null||t.updateSchedule(n,[],e))}checkBuffer(e){var t;const n=(t=this.schedule)==null?void 0:t.items;if(!n)return;const l=Dr.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=l.len<1),this.updateBufferedPos(l.end,n,e)}updateBufferedPos(e,t,n){const l=this.schedule,g=this.bufferingItem;if(this.bufferedPos>e||!l)return;if(t.length===1&&this.itemsMatch(t[0],g)){this.bufferedPos=e;return}const T=this.playingItem,I=this.findItemIndex(T);let k=l.findItemIndexAtTime(e);if(this.bufferedPos<e){var U;const j=this.findItemIndex(g),Z=Math.min(j+1,t.length-1),Q=t[Z];if((k===-1&&g&&e>=g.end||(U=Q.event)!=null&&U.appendInPlace&&e+.01>=Q.start)&&(k=Z),this.isInterstitial(g)){const ee=g.event;if(Z-I>1&&ee.appendInPlace===!1||ee.assetList.length===0&&ee.assetListLoader)return}if(this.bufferedPos=e,k>j&&k>I)this.bufferedToItem(Q);else{const ee=this.primaryDetails;this.primaryLive&&ee&&e>ee.edge-ee.targetduration&&Q.start<ee.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(Q)&&this.preloadAssets(Q.event,0)}}else n&&T&&!this.itemsMatch(T,g)&&(k===I?this.bufferedToItem(T):k===I+1&&this.bufferedToItem(t[k]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(l=>{const g=this.getAssetPlayer(l.identifier);return!(g!=null&&g.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,n=this.schedule;if(!this.itemsMatch(e,t)&&n){const{items:l,events:g}=n;if(!l||!g)return t;const T=this.isInterstitial(e),I=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const k=I?I.remaining:t?t.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Ai(e)}`+(t?` (${k.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(T){const U=n.findAssetIndex(e.event,this.bufferedPos);e.event.assetList.forEach((j,Z)=>{const Q=this.getAssetPlayer(j.identifier);Q&&(Z===U&&Q.loadSource(),Q.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(U=>U.pauseBuffering());this.hls.trigger(y.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:g.slice(0),schedule:l.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==e&&(this.bufferingItem=e);return t}bufferedToItem(e,t=0){const n=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(n!==null){this.bufferingAsset=null;const l=this.detachedData;l?l.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),n=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(n)}bufferedToEvent(e,t){const n=e.event,l=n.assetList.length===0&&!n.assetListLoader,g=n.cue.once;if(l||!g){const T=this.preloadAssets(n,t);if(T!=null&&T.interstitial.appendInPlace){const I=this.primaryMedia;I&&this.bufferAssetPlayer(T,I)}}}preloadAssets(e,t){const n=e.assetUrl,l=e.assetList.length,g=l===0&&!e.assetListLoader,T=e.cue.once;if(g){const k=e.timelineStart;if(e.appendInPlace){var I;const Q=this.playingItem;!this.isInterstitial(Q)&&(Q==null||(I=Q.nextEvent)==null?void 0:I.identifier)===e.identifier&&this.flushFrontBuffer(k+.25)}let U,j=0;if(!this.playingItem&&this.primaryLive&&(j=this.hls.startPosition,j===-1&&(j=this.hls.liveSyncPosition||0)),j&&!(e.cue.pre||e.cue.post)){const Q=j-k;Q>0&&(U=Math.round(Q*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:l} ${e}${U?` live-start: ${j} start-offset: ${U}`:""}`),n)return this.createAsset(e,0,0,k,e.duration,n);const Z=this.assetListLoader.loadAssetList(e,U);Z&&(e.assetListLoader=Z)}else if(!T&&l){for(let U=t;U<l;U++){const j=e.assetList[U],Z=this.getAssetPlayerQueueIndex(j.identifier);(Z===-1||this.playerQueue[Z].destroyed)&&!j.error&&this.createAssetPlayer(e,j,U)}const k=e.assetList[t];if(k){const U=this.getAssetPlayer(k.identifier);return U&&U.loadSource(),U}}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(l=>{this.hls.trigger(y.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:l})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let n=0;n<t.length;n++)if(e===t[n].assetId)return n;return-1}getAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);return this.playerQueue[t]||null}getBufferingPlayer(){const{playerQueue:e,primaryMedia:t}=this;if(t){for(let n=0;n<e.length;n++)if(e[n].media===t)return e[n]}return null}createAsset(e,t,n,l,g,T){const I={parentIdentifier:e.identifier,identifier:Tc(e,T,t),duration:g,startOffset:n,timelineStart:l,uri:T};return this.createAssetPlayer(e,I,t)}createAssetPlayer(e,t,n){const l=this.hls,g=l.userConfig;let T=g.videoPreference;const I=l.loadLevelObj||l.levels[l.currentLevel];(T||I)&&(T=u({},T),I.videoCodec&&(T.videoCodec=I.videoCodec),I.videoRange&&(T.allowedVideoRanges=[I.videoRange]));const k=l.audioTracks[l.audioTrack],U=l.subtitleTracks[l.subtitleTrack];let j=0;if(this.primaryLive||e.appendInPlace){const Ye=this.timelinePos-t.timelineStart;if(Ye>1){const lt=t.duration;lt&&Ye<lt&&(j=Ye)}}const Z=t.identifier,Q=i(i({},g),{},{maxMaxBufferLength:Math.min(180,l.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:l.sessionId,assetPlayerId:Z,abrEwmaDefaultEstimate:l.bandwidthEstimate,interstitialsController:void 0,startPosition:j,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:T,audioPreference:k||g.audioPreference,subtitlePreference:U||g.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(Q.timelineOffset=t.timelineStart));const ee=Q.cmcd;ee!=null&&ee.sessionId&&ee.contentId&&(Q.cmcd=u({},ee,{contentId:Sa(t.uri)})),this.getAssetPlayer(Z)&&this.warn(`Duplicate date range identifier ${e} and asset ${Z}`);const ne=new Sc(this.HlsPlayerClass,Q,e,t);this.playerQueue.push(ne),e.assetList[n]=t;let de=!0;const ce=Ye=>{if(Ye.live){var lt;const vt=new Error(`Interstitials MUST be VOD assets ${e}`),xt={fatal:!0,type:D.OTHER_ERROR,details:W.INTERSTITIAL_ASSET_ITEM_ERROR,error:vt},at=((lt=this.schedule)==null?void 0:lt.findEventIndex(e.identifier))||-1;this.handleAssetItemError(xt,e,at,n,vt.message);return}const Ct=Ye.edge-Ye.fragmentStart,rt=t.duration;(de||rt===null||Ct>rt)&&(de=!1,this.log(`Interstitial asset "${Z}" duration change ${rt} > ${Ct}`),t.duration=Ct,this.updateSchedule())};ne.on(y.LEVEL_UPDATED,(Ye,{details:lt})=>ce(lt)),ne.on(y.LEVEL_PTS_UPDATED,(Ye,{details:lt})=>ce(lt)),ne.on(y.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());const Ee=(Ye,lt)=>{const Ct=this.getAssetPlayer(Z);if(Ct&<.tracks){Ct.off(y.BUFFER_CODECS,Ee),Ct.tracks=lt.tracks;const rt=this.primaryMedia;this.bufferingAsset===Ct.assetItem&&rt&&!Ct.media&&this.bufferAssetPlayer(Ct,rt)}};ne.on(y.BUFFER_CODECS,Ee);const ke=()=>{var Ye;const lt=this.getAssetPlayer(Z);if(this.log(`buffered to end of asset ${lt}`),!lt||!this.schedule)return;const Ct=this.schedule.findEventIndex(e.identifier),rt=(Ye=this.schedule.items)==null?void 0:Ye[Ct];this.isInterstitial(rt)&&this.advanceAssetBuffering(rt,t)};ne.on(y.BUFFERED_TO_END,ke);const Me=Ye=>()=>{if(!this.getAssetPlayer(Z)||!this.schedule)return;this.shouldPlay=!0;const Ct=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,Ct,Ye)};return ne.once(y.MEDIA_ENDED,Me(n)),ne.once(y.PLAYOUT_LIMIT_REACHED,Me(1/0)),ne.on(y.ERROR,(Ye,lt)=>{if(!this.schedule)return;const Ct=this.getAssetPlayer(Z);if(lt.details===W.BUFFER_STALLED_ERROR){if(Ct!=null&&Ct.appendInPlace){this.handleInPlaceStall(e);return}this.onTimeupdate(),this.checkBuffer(!0);return}this.handleAssetItemError(lt,e,this.schedule.findEventIndex(e.identifier),n,`Asset player error ${lt.error} ${e}`)}),ne.on(y.DESTROYING,()=>{if(!this.getAssetPlayer(Z)||!this.schedule)return;const lt=new Error(`Asset player destroyed unexpectedly ${Z}`),Ct={fatal:!0,type:D.OTHER_ERROR,details:W.INTERSTITIAL_ASSET_ITEM_ERROR,error:lt};this.handleAssetItemError(Ct,e,this.schedule.findEventIndex(e.identifier),n,lt.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${pa(t)}`),this.hls.trigger(y.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:ne}),ne}clearInterstitial(e,t){e.assetList.forEach(n=>{this.clearAssetPlayer(n.identifier,t)}),e.reset()}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(t!==-1){this.log(`reset asset player "${e}" after error`);const n=this.playerQueue[t];this.transferMediaFromPlayer(n,null),n.resetDetails()}}clearAssetPlayer(e,t){const n=this.getAssetPlayerQueueIndex(e);if(n!==-1){const l=this.playerQueue[n];this.log(`clear ${l} toSegment: ${t&&Ai(t)}`),this.transferMediaFromPlayer(l,t),this.playerQueue.splice(n,1),l.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,n,l,g){const{interstitial:T,assetItem:I,assetId:k}=e,U=T.assetList.length,j=this.playingAsset;this.endedAsset=null,this.playingAsset=I,(!j||j.identifier!==k)&&(j&&(this.clearAssetPlayer(j.identifier,n[l]),delete j.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${U} ${pa(I)}`),this.hls.trigger(y.INTERSTITIAL_ASSET_STARTED,{asset:I,assetListIndex:t,event:T,schedule:n.slice(0),scheduleIndex:l,player:e})),this.bufferAssetPlayer(e,g)}bufferAssetPlayer(e,t){var n,l;if(!this.schedule)return;const{interstitial:g,assetItem:T}=e,I=this.schedule.findEventIndex(g.identifier),k=(n=this.schedule.items)==null?void 0:n[I];if(!k)return;e.loadSource(),this.setBufferingItem(k),this.bufferingAsset=T;const U=this.getBufferingPlayer();if(U===e)return;const j=g.appendInPlace;if(j&&(U==null?void 0:U.interstitial.appendInPlace)===!1)return;const Z=(U==null?void 0:U.tracks)||((l=this.detachedData)==null?void 0:l.tracks)||this.requiredTracks;if(j&&T!==this.playingAsset){if(!e.tracks){this.log(`Waiting for track info before buffering ${e}`);return}if(Z&&!O(Z,e.tracks)){const Q=new Error(`Asset ${pa(T)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(Z)}')`),ee={fatal:!0,type:D.OTHER_ERROR,details:W.INTERSTITIAL_ASSET_ITEM_ERROR,error:Q},ne=g.findAssetIndex(T);this.handleAssetItemError(ee,g,I,ne,Q.message);return}}this.transferMediaTo(e,t)}handleInPlaceStall(e){const t=this.schedule,n=this.primaryMedia;if(!t||!n)return;const l=n.currentTime,g=t.findAssetIndex(e,l),T=e.assetList[g];if(T){const I=this.getAssetPlayer(T.identifier);if(I){const k=I.currentTime||l-T.timelineStart,U=I.duration-k;if(this.warn(`Stalled at ${k} of ${k+U} in ${I} ${e} (media.currentTime: ${l})`),k&&(U/n.playbackRate<.5||I.bufferedInPlaceToEnd(n))&&I.hls){const j=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,j,g)}}}}advanceInPlace(e){const t=this.primaryMedia;t&&t.currentTime<e&&(t.currentTime=e)}handleAssetItemError(e,t,n,l,g){if(e.details===W.BUFFER_STALLED_ERROR)return;const T=t.assetList[l]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${T&&pa(T)} ${e.error}`),!this.schedule)return;const I=(T==null?void 0:T.identifier)||"",k=this.getAssetPlayerQueueIndex(I),U=this.playerQueue[k]||null,j=this.schedule.items,Z=u({},e,{fatal:!1,errorAction:Xr(!0),asset:T,assetListIndex:l,event:t,schedule:j,scheduleIndex:n,player:U});if(this.hls.trigger(y.INTERSTITIAL_ASSET_ERROR,Z),!e.fatal)return;const Q=this.playingAsset,ee=this.bufferingAsset,ne=new Error(g);if(T&&(this.clearAssetPlayer(I,null),T.error=ne),!t.assetList.some(de=>!de.error))t.error=ne;else for(let de=l;de<t.assetList.length;de++)this.resetAssetPlayer(t.assetList[de].identifier);this.updateSchedule(!0),t.error?this.primaryFallback(t):Q&&Q.identifier===I?this.advanceAfterAssetEnded(t,n,l):ee&&ee.identifier===I&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,ee)}primaryFallback(e){const t=e.timelineStart,n=this.effectivePlayingItem;if(n){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${Ai(n)} error: ${e.error}`);let l=this.timelinePos;l===-1&&(l=this.hls.startPosition);const g=this.updateItem(n,l);if(this.itemsMatch(n,g)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t)),!this.schedule)return;const T=this.schedule.findItemIndexAtTime(l);this.setSchedulePosition(T)}else this.checkStart()}onAssetListLoaded(e,t){var n,l;const g=t.event,T=g.identifier,I=t.assetListResponse.ASSETS;if(!((n=this.schedule)!=null&&n.hasEvent(T)))return;const k=g.timelineStart,U=g.duration;let j=0;I.forEach((de,ce)=>{const Ee=parseFloat(de.DURATION);this.createAsset(g,ce,j,k+j,Ee,de.URI),j+=Ee}),g.duration=j,this.log(`Loaded asset-list with duration: ${j} (was: ${U}) ${g}`);const Z=this.waitingItem,Q=(Z==null?void 0:Z.event.identifier)===T;this.updateSchedule();const ee=(l=this.bufferingItem)==null?void 0:l.event;if(Q){var ne;const de=this.schedule.findEventIndex(T),ce=(ne=this.schedule.items)==null?void 0:ne[de];if(ce){if(!this.playingItem&&this.timelinePos>ce.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==de){g.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${g}`),this.updateSchedule(!0),this.primaryFallback(g);return}this.setBufferingItem(ce)}this.setSchedulePosition(de)}else if((ee==null?void 0:ee.identifier)===T){const de=g.assetList[0];if(de){const ce=this.getAssetPlayer(de.identifier);if(ee.appendInPlace){const Ee=this.primaryMedia;ce&&Ee&&this.bufferAssetPlayer(ce,Ee)}else ce&&ce.loadSource()}}}onError(e,t){if(this.schedule)switch(t.details){case W.ASSET_LIST_PARSING_ERROR:case W.ASSET_LIST_LOAD_ERROR:case W.ASSET_LIST_LOAD_TIMEOUT:{const n=t.interstitial;n&&(this.updateSchedule(!0),this.primaryFallback(n));break}case W.BUFFER_STALLED_ERROR:{const n=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(n)&&n.event.appendInPlace){this.handleInPlaceStall(n.event);return}this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}const Uo=500;class wc extends Bi{constructor(e,t,n){super(e,t,n,"subtitle-stream-controller",A.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(y.LEVEL_LOADED,this.onLevelLoaded,this),e.on(y.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(y.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(y.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(y.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(y.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(y.LEVEL_LOADED,this.onLevelLoaded,this),e.off(y.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(y.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(y.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(y.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(y.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=Kt.IDLE,this.setInterval(Uo),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:l}=t;if(this.fragContextChanged(n)||(q(n)&&(this.fragPrevious=n),this.state=Kt.IDLE),!l)return;const g=this.tracksBuffered[this.currentTrackId];if(!g)return;let T;const I=n.start;for(let U=0;U<g.length;U++)if(I>=g[U].start&&I<=g[U].end){T=g[U];break}const k=n.start+n.duration;T?T.end=k:(T={start:I,end:k},g.push(T)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:n,endOffset:l}=t;if(n===0&&l!==Number.POSITIVE_INFINITY){const g=l-1;if(g<=0)return;t.endOffsetSubtitles=Math.max(0,g),this.tracksBuffered.forEach(T=>{for(let I=0;I<T.length;){if(T[I].end<=g){T.shift();continue}else if(T[I].start<g)T[I].start=g;else break;I++}}),this.fragmentTracker.removeFragmentsInRange(n,g,A.SUBTITLE)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===A.SUBTITLE&&(t.details===W.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==Kt.STOPPED&&(this.state=Kt.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&ho(this.levels,t)){this.levels=t.map(n=>new ht(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const l=new ht(n);return this.tracksBuffered[l.id]=[],l}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,A.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 l=this.levels[this.currentTrackId];l!=null&&l.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,l&&this.state!==Kt.STOPPED&&this.setInterval(Uo)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:l,levels:g}=this,{details:T,id:I}=t;if(!g){this.warn(`Subtitle tracks were reset while loading level ${I}`);return}const k=g[I];if(I>=g.length||!k)return;this.log(`Subtitle track ${I} loaded [${T.startSN},${T.endSN}]${T.lastPartSn?`[part-${T.lastPartSn}-${T.lastPartIndex}]`:""},duration:${T.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let U=0;if(T.live||(n=k.details)!=null&&n.live){if(T.deltaUpdateFailed)return;const Z=this.mainDetails;if(!Z){this.startFragRequested=!1;return}const Q=Z.fragments[0];if(!k.details)T.hasProgramDateTime&&Z.hasProgramDateTime?(Ni(T,Z),U=T.fragmentStart):Q&&(U=Q.start,ii(T,U));else{var j;U=this.alignPlaylists(T,k.details,(j=this.levelLastLoaded)==null?void 0:j.details),U===0&&Q&&(U=Q.start,ii(T,U))}Z&&!this.startFragRequested&&this.setStartPosition(Z,U)}k.details=T,this.levelLastLoaded=k,I===l&&(this.hls.trigger(y.SUBTITLE_TRACK_UPDATED,{details:T,id:I,groupId:t.groupId}),this.tick(),T.live&&!this.fragCurrent&&this.media&&this.state===Kt.IDLE&&(mr(null,T.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),k.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,l=t.decryptdata,g=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&l!=null&&l.key&&l.iv&&On(l.method)){const T=performance.now();this.decrypter.decrypt(new Uint8Array(n),l.key.buffer,l.iv.buffer,tn(l.method)).catch(I=>{throw g.trigger(y.ERROR,{type:D.MEDIA_ERROR,details:W.FRAG_DECRYPT_ERROR,fatal:!1,error:I,reason:I.message,frag:t}),I}).then(I=>{const k=performance.now();g.trigger(y.FRAG_DECRYPTED,{frag:t,payload:I,stats:{tstart:T,tdecrypt:k}})}).catch(I=>{this.warn(`${I.name}: ${I.message}`),this.state=Kt.IDLE})}}doTick(){if(!this.media){this.state=Kt.IDLE;return}if(this.state===Kt.IDLE){const{currentTrackId:e,levels:t}=this,n=t==null?void 0:t[e];if(!n||!t.length||!n.details||this.waitForLive(n))return;const{config:l}=this,g=this.getLoadPosition(),T=Dr.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],g,l.maxBufferHole),{end:I,len:k}=T,U=n.details,j=this.hls.maxBufferLength+U.levelTargetDuration;if(k>j)return;const Z=U.fragments,Q=Z.length,ee=U.edge;let ne=null;const de=this.fragPrevious;if(I<ee){const ke=l.maxFragLookUpTolerance,Me=I>ee-ke?0:ke;ne=mr(de,Z,Math.max(Z[0].start,I),Me),!ne&&de&&de.start<Z[0].start&&(ne=Z[0])}else ne=Z[Q-1];if(ne=this.filterReplacedPrimary(ne,n.details),!ne)return;const ce=ne.sn-U.startSN,Ee=Z[ce-1];if(Ee&&Ee.cc===ne.cc&&this.fragmentTracker.getState(Ee)===Gr.NOT_LOADED&&(ne=Ee),this.fragmentTracker.getState(ne)===Gr.NOT_LOADED){const ke=this.mapToInitFragWhenRequired(ne);ke&&this.loadFragment(ke,n,I)}}}loadFragment(e,t,n){q(e)?super.loadFragment(e,t,n):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new Cc(this.tracksBuffered[this.currentTrackId]||[])}}class Cc{constructor(e){this.buffered=void 0;const t=(n,l,g)=>{if(l=l>>>0,l>g-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${l}) is greater than the maximum bound (${g})`);return e[l][n]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}const Ic={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},Fo=b=>String.fromCharCode(Ic[b]||b),bi=15,Fi=100,Pc={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Mc={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Oc={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Nc={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Bc=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Uc{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;S.log(`${this.time} [${e}] ${n}`)}}}const ea=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class ko{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let n=0;n<t.length;n++){const l=t[n];e.hasOwnProperty(l)&&(this[l]=e[l])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class Fc{constructor(){this.uchar=" ",this.penState=new ko}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class kc{constructor(e){this.chars=[],this.pos=0,this.currPenState=new ko,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<Fi;t++)this.chars.push(new Fc);this.logger=e}equals(e){for(let t=0;t<Fi;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<Fi;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<Fi;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>Fi&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Fi)}moveCursor(e){const t=this.pos+e;if(e>1)for(let n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=Fo(e);if(this.pos>=Fi){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<Fi;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let n=0;n<Fi;n++){const l=this.chars[n].uchar;l!==" "&&(t=!1),e.push(l)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class As{constructor(e){this.rows=[],this.currRow=bi-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<bi;t++)this.rows.push(new kc(e));this.logger=e}reset(){for(let e=0;e<bi;e++)this.rows[e].clear();this.currRow=bi-1}equals(e){let t=!0;for(let n=0;n<bi;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<bi;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<bi;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>"pacData = "+ot(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let I=0;I<bi;I++)this.rows[I].clear();const g=this.currRow+1-this.nrRollUpRows,T=this.lastOutputScreen;if(T){const I=T.rows[g].cueStartTime,k=this.logger.time;if(I!==null&&k!==null&&I<k)for(let U=0;U<this.nrRollUpRows;U++)this.rows[t-this.nrRollUpRows+U+1].copy(T.rows[g+U])}}this.currRow=t;const n=this.rows[this.currRow];if(e.indent!==null){const g=e.indent,T=Math.max(g-1,0);n.setCursor(e.indent),e.color=n.chars[T].penState.foreground}const l={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(l)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+ot(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",l=-1;for(let g=0;g<bi;g++){const T=this.rows[g].getTextString();T&&(l=g+1,e?t.push("Row "+l+": '"+T+"'"):t.push(T.trim()))}return t.length>0&&(e?n="["+t.join(" | ")+"]":n=t.join(`
|
|
`)),n}getTextAndFormat(){return this.rows}}class Wo{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 As(n),this.nonDisplayedMemory=new As(n),this.lastOutputScreen=new As(n),this.currRollUpRow=this.displayedMemory.rows[bi-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[bi-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let n=0;n<e.length;n++)this.writeScreen.insertChar(e[n]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,l=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=l[n]}this.logger.log(2,"MIDROW: "+ot(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class Ko{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=Kc(),this.logger=void 0;const l=this.logger=new Uc;this.channels=[null,new Wo(e,t,l),new Wo(e+1,n,l)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let n=0;n<t.length;n+=2){const l=t[n]&127,g=t[n+1]&127;let T=!1,I=null;if(l===0&&g===0)continue;this.logger.log(3,()=>"["+ea([t[n],t[n+1]])+"] -> ("+ea([l,g])+")");const k=this.cmdHistory;if(l>=16&&l<=31){if(Wc(l,g,k)){Ha(null,null,k),this.logger.log(3,()=>"Repeated command ("+ea([l,g])+") is dropped");continue}Ha(l,g,this.cmdHistory),T=this.parseCmd(l,g),T||(T=this.parseMidrow(l,g)),T||(T=this.parsePAC(l,g)),T||(T=this.parseBackgroundAttributes(l,g))}else Ha(null,null,k);if(!T&&(I=this.parseChars(l,g),I)){const j=this.currentChannel;j&&j>0?this.channels[j].insertChars(I):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!T&&!I&&this.logger.log(2,()=>"Couldn't parse cleaned data "+ea([l,g])+" orig: "+ea([t[n],t[n+1]]))}}parseCmd(e,t){const n=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,l=(e===23||e===31)&&t>=33&&t<=35;if(!(n||l))return!1;const g=e===20||e===21||e===23?1:2,T=this.channels[g];return e===20||e===21||e===28||e===29?t===32?T.ccRCL():t===33?T.ccBS():t===34?T.ccAOF():t===35?T.ccAON():t===36?T.ccDER():t===37?T.ccRU(2):t===38?T.ccRU(3):t===39?T.ccRU(4):t===40?T.ccFON():t===41?T.ccRDC():t===42?T.ccTR():t===43?T.ccRTD():t===44?T.ccEDM():t===45?T.ccCR():t===46?T.ccENM():t===47&&T.ccEOC():T.ccTO(t-32),this.currentChannel=g,!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 l=this.channels[n];return l?(l.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+ea([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let n;const l=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,g=(e===16||e===24)&&t>=64&&t<=95;if(!(l||g))return!1;const T=e<=23?1:2;t>=64&&t<=95?n=T===1?Pc[e]:Oc[e]:n=T===1?Mc[e]:Nc[e];const I=this.channels[T];return I?(I.setPAC(this.interpretPAC(n,t)),this.currentChannel=T,!0):!1}interpretPAC(e,t){let n;const l={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?n=t-96:n=t-64,l.underline=(n&1)===1,n<=13?l.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(l.italics=!0,l.color="white"):l.indent=Math.floor((n-16)/2)*4,l}parseChars(e,t){let n,l=null,g=null;if(e>=25?(n=2,g=e-8):(n=1,g=e),g>=17&&g<=19){let T;g===17?T=t+80:g===18?T=t+112:T=t+144,this.logger.log(2,()=>"Special char '"+Fo(T)+"' in channel "+n),l=[T]}else e>=32&&e<=127&&(l=t===0?[e]:[e,t]);return l&&this.logger.log(3,()=>"Char codes = "+ea(l).join(",")),l}parseBackgroundAttributes(e,t){const n=(e===16||e===24)&&t>=32&&t<=47,l=(e===23||e===31)&&t>=45&&t<=47;if(!(n||l))return!1;let g;const T={};e===16||e===24?(g=Math.floor((t-32)/2),T.background=Bc[g],t%2===1&&(T.background=T.background+"_semi")):t===45?T.background="transparent":(T.foreground="black",t===47&&(T.underline=!0));const I=e<=23?1:2;return this.channels[I].setBkgData(T),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}Ha(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const n=this.channels[t];n&&n.cueSplitAtTime(e)}}}function Ha(b,e,t){t.a=b,t.b=e}function Wc(b,e,t){return t.a===b&&t.b===e}function Kc(){return{a:null,b:null}}var bs=function(){if(Nr!=null&&Nr.VTTCue)return self.VTTCue;const b=["","lr","rl"],e=["start","middle","end","left","right"];function t(I,k){if(typeof k!="string"||!Array.isArray(I))return!1;const U=k.toLowerCase();return~I.indexOf(U)?U:!1}function n(I){return t(b,I)}function l(I){return t(e,I)}function g(I,...k){let U=1;for(;U<arguments.length;U++){const j=arguments[U];for(const Z in j)I[Z]=j[Z]}return I}function T(I,k,U){const j=this,Z={enumerable:!0};j.hasBeenReset=!1;let Q="",ee=!1,ne=I,de=k,ce=U,Ee=null,ke="",Me=!0,Ye="auto",lt="start",Ct=50,rt="middle",vt=50,xt="middle";Object.defineProperty(j,"id",g({},Z,{get:function(){return Q},set:function(at){Q=""+at}})),Object.defineProperty(j,"pauseOnExit",g({},Z,{get:function(){return ee},set:function(at){ee=!!at}})),Object.defineProperty(j,"startTime",g({},Z,{get:function(){return ne},set:function(at){if(typeof at!="number")throw new TypeError("Start time must be set to a number.");ne=at,this.hasBeenReset=!0}})),Object.defineProperty(j,"endTime",g({},Z,{get:function(){return de},set:function(at){if(typeof at!="number")throw new TypeError("End time must be set to a number.");de=at,this.hasBeenReset=!0}})),Object.defineProperty(j,"text",g({},Z,{get:function(){return ce},set:function(at){ce=""+at,this.hasBeenReset=!0}})),Object.defineProperty(j,"region",g({},Z,{get:function(){return Ee},set:function(at){Ee=at,this.hasBeenReset=!0}})),Object.defineProperty(j,"vertical",g({},Z,{get:function(){return ke},set:function(at){const Gt=n(at);if(Gt===!1)throw new SyntaxError("An invalid or illegal string was specified.");ke=Gt,this.hasBeenReset=!0}})),Object.defineProperty(j,"snapToLines",g({},Z,{get:function(){return Me},set:function(at){Me=!!at,this.hasBeenReset=!0}})),Object.defineProperty(j,"line",g({},Z,{get:function(){return Ye},set:function(at){if(typeof at!="number"&&at!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");Ye=at,this.hasBeenReset=!0}})),Object.defineProperty(j,"lineAlign",g({},Z,{get:function(){return lt},set:function(at){const Gt=l(at);if(!Gt)throw new SyntaxError("An invalid or illegal string was specified.");lt=Gt,this.hasBeenReset=!0}})),Object.defineProperty(j,"position",g({},Z,{get:function(){return Ct},set:function(at){if(at<0||at>100)throw new Error("Position must be between 0 and 100.");Ct=at,this.hasBeenReset=!0}})),Object.defineProperty(j,"positionAlign",g({},Z,{get:function(){return rt},set:function(at){const Gt=l(at);if(!Gt)throw new SyntaxError("An invalid or illegal string was specified.");rt=Gt,this.hasBeenReset=!0}})),Object.defineProperty(j,"size",g({},Z,{get:function(){return vt},set:function(at){if(at<0||at>100)throw new Error("Size must be between 0 and 100.");vt=at,this.hasBeenReset=!0}})),Object.defineProperty(j,"align",g({},Z,{get:function(){return xt},set:function(at){const Gt=l(at);if(!Gt)throw new SyntaxError("An invalid or illegal string was specified.");xt=Gt,this.hasBeenReset=!0}})),j.displayState=void 0}return T.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},T}();class Gc{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Go(b){function e(n,l,g,T){return(n|0)*3600+(l|0)*60+(g|0)+parseFloat(T||0)}const t=b.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 Vc{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 l=0;l<n.length;++l)if(t===n[l]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1}}function Vo(b,e,t,n){const l=n?b.split(n):[b];for(const g in l){if(typeof l[g]!="string")continue;const T=l[g].split(t);if(T.length!==2)continue;const I=T[0],k=T[1];e(I,k)}}const Ss=new bs(0,0,""),za=Ss.align==="middle"?"middle":"center";function Hc(b,e,t){const n=b;function l(){const I=Go(b);if(I===null)throw new Error("Malformed timestamp: "+n);return b=b.replace(/^[^\sa-zA-Z-]+/,""),I}function g(I,k){const U=new Vc;Vo(I,function(Q,ee){let ne;switch(Q){case"region":for(let de=t.length-1;de>=0;de--)if(t[de].id===ee){U.set(Q,t[de].region);break}break;case"vertical":U.alt(Q,ee,["rl","lr"]);break;case"line":ne=ee.split(","),U.integer(Q,ne[0]),U.percent(Q,ne[0])&&U.set("snapToLines",!1),U.alt(Q,ne[0],["auto"]),ne.length===2&&U.alt("lineAlign",ne[1],["start",za,"end"]);break;case"position":ne=ee.split(","),U.percent(Q,ne[0]),ne.length===2&&U.alt("positionAlign",ne[1],["start",za,"end","line-left","line-right","auto"]);break;case"size":U.percent(Q,ee);break;case"align":U.alt(Q,ee,["start",za,"end","left","right"]);break}},/:/,/\s/),k.region=U.get("region",null),k.vertical=U.get("vertical","");let j=U.get("line","auto");j==="auto"&&Ss.line===-1&&(j=-1),k.line=j,k.lineAlign=U.get("lineAlign","start"),k.snapToLines=U.get("snapToLines",!0),k.size=U.get("size",100),k.align=U.get("align",za);let Z=U.get("position","auto");Z==="auto"&&Ss.position===50&&(Z=k.align==="start"||k.align==="left"?0:k.align==="end"||k.align==="right"?100:50),k.position=Z}function T(){b=b.replace(/^\s+/,"")}if(T(),e.startTime=l(),T(),b.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);b=b.slice(3),T(),e.endTime=l(),T(),g(b,e)}function Ho(b){return b.replace(/<br(?: \/)?>/gi,`
|
|
`)}class zc{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Gc,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 g=t.buffer,T=0;for(g=Ho(g);T<g.length&&g[T]!=="\r"&&g[T]!==`
|
|
`;)++T;const I=g.slice(0,T);return g[T]==="\r"&&++T,g[T]===`
|
|
`&&++T,t.buffer=g.slice(T),I}function l(g){Vo(g,function(T,I){},/:/)}try{let g="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;g=n();const I=g.match(/^()?WEBVTT([ \t].*)?$/);if(!(I!=null&&I[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let T=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(T?T=!1:g=n(),t.state){case"HEADER":/:/.test(g)?l(g):g||(t.state="ID");continue;case"NOTE":g||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(g)){t.state="NOTE";break}if(!g)continue;if(t.cue=new bs(0,0,""),t.state="CUE",g.indexOf("-->")===-1){t.cue.id=g;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{Hc(g,t.cue,t.regionList)}catch(I){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const I=g.indexOf("-->")!==-1;if(!g||I&&(T=!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+=g}continue;case"BADCUE":g||(t.state="ID")}}}catch(g){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 jc=/\r\n|\n\r|\n|\r/g,Ds=function(e,t,n=0){return e.slice(n,n+t.length)===t},Zc=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),l=parseInt(e.slice(-9,-7)),g=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!te(t)||!te(n)||!te(l)||!te(g))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*l,t+=60*60*1e3*g,t};function Ls(b,e,t){return Sa(b.toString())+Sa(e.toString())+Sa(t)}const Xc=function(e,t,n){let l=e[t],g=e[l.prevCC];if(!g||!g.new&&l.new){e.ccOffset=e.presentationOffset=l.start,l.new=!1;return}for(;(T=g)!=null&&T.new;){var T;e.ccOffset+=l.start-g.start,l.new=!1,l=g,g=e[l.prevCC]}e.presentationOffset=n};function Yc(b,e,t,n,l,g,T){const I=new zc,k=z(new Uint8Array(b)).trim().replace(jc,`
|
|
`).split(`
|
|
`),U=[],j=e?au(e.baseTime,e.timescale):0;let Z="00:00.000",Q=0,ee=0,ne,de=!0;I.oncue=function(ce){const Ee=t[n];let ke=t.ccOffset;const Me=(Q-j)/9e4;if(Ee!=null&&Ee.new&&(ee!==void 0?ke=t.ccOffset=Ee.start:Xc(t,n,Me)),Me){if(!e){ne=new Error("Missing initPTS for VTT MPEGTS");return}ke=Me-t.presentationOffset}const Ye=ce.endTime-ce.startTime,lt=vi((ce.startTime+ke-ee)*9e4,l*9e4)/9e4;ce.startTime=Math.max(lt,0),ce.endTime=Math.max(lt+Ye,0);const Ct=ce.text.trim();ce.text=decodeURIComponent(encodeURIComponent(Ct)),ce.id||(ce.id=Ls(ce.startTime,ce.endTime,Ct)),ce.endTime>0&&U.push(ce)},I.onparsingerror=function(ce){ne=ce},I.onflush=function(){if(ne){T(ne);return}g(U)},k.forEach(ce=>{if(de)if(Ds(ce,"X-TIMESTAMP-MAP=")){de=!1,ce.slice(16).split(",").forEach(Ee=>{Ds(Ee,"LOCAL:")?Z=Ee.slice(6):Ds(Ee,"MPEGTS:")&&(Q=parseInt(Ee.slice(7)))});try{ee=Zc(Z)/1e3}catch(Ee){ne=Ee}return}else ce===""&&(de=!1);I.parse(ce+`
|
|
`)}),I.flush()}const Rs="stpp.ttml.im1t",zo=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,jo=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,$c={left:"start",center:"center",right:"end",start:"start",end:"end"};function Zo(b,e,t,n){const l=ve(new Uint8Array(b),["mdat"]);if(l.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const g=l.map(I=>z(I)),T=iu(e.baseTime,1,e.timescale);try{g.forEach(I=>t(Qc(I,T)))}catch(I){n(I)}}function Qc(b,e){const l=new DOMParser().parseFromString(b,"text/xml").getElementsByTagName("tt")[0];if(!l)throw new Error("Invalid ttml");const g={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},T=Object.keys(g).reduce((Z,Q)=>(Z[Q]=l.getAttribute(`ttp:${Q}`)||g[Q],Z),{}),I=l.getAttribute("xml:space")!=="preserve",k=Xo(ws(l,"styling","style")),U=Xo(ws(l,"layout","region")),j=ws(l,"body","[begin]");return[].map.call(j,Z=>{const Q=Yo(Z,I);if(!Q||!Z.hasAttribute("begin"))return null;const ee=Is(Z.getAttribute("begin"),T),ne=Is(Z.getAttribute("dur"),T);let de=Is(Z.getAttribute("end"),T);if(ee===null)throw $o(Z);if(de===null){if(ne===null)throw $o(Z);de=ee+ne}const ce=new bs(ee-e,de-e,Q);ce.id=Ls(ce.startTime,ce.endTime,ce.text);const Ee=U[Z.getAttribute("region")],ke=k[Z.getAttribute("style")],Me=Jc(Ee,ke,k),{textAlign:Ye}=Me;if(Ye){const lt=$c[Ye];lt&&(ce.lineAlign=lt),ce.align=Ye}return u(ce,Me),ce}).filter(Z=>Z!==null)}function ws(b,e,t){const n=b.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function Xo(b){return b.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function Yo(b,e){return[].slice.call(b.childNodes).reduce((t,n,l)=>{var g;return n.nodeName==="br"&&l?t+`
|
|
`:(g=n.childNodes)!=null&&g.length?Yo(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function Jc(b,e,t){const n="http://www.w3.org/ns/ttml#styling";let l=null;const g=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],T=b!=null&&b.hasAttribute("style")?b.getAttribute("style"):null;return T&&t.hasOwnProperty(T)&&(l=t[T]),g.reduce((I,k)=>{const U=Cs(e,n,k)||Cs(b,n,k)||Cs(l,n,k);return U&&(I[k]=U),I},{})}function Cs(b,e,t){return b&&b.hasAttributeNS(e,t)?b.getAttributeNS(e,t):null}function $o(b){return new Error(`Could not parse ttml timestamp ${b}`)}function Is(b,e){if(!b)return null;let t=Go(b);return t===null&&(zo.test(b)?t=qc(b,e):jo.test(b)&&(t=eh(b,e))),t}function qc(b,e){const t=zo.exec(b),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 eh(b,e){const t=jo.exec(b),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 ja{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,n){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class th{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=qo(),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(y.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(y.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(y.MANIFEST_LOADING,this.onManifestLoading,this),e.on(y.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(y.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(y.FRAG_LOADING,this.onFragLoading,this),e.on(y.FRAG_LOADED,this.onFragLoaded,this),e.on(y.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(y.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(y.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(y.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(y.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(y.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(y.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(y.MANIFEST_LOADING,this.onManifestLoading,this),e.off(y.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(y.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(y.FRAG_LOADING,this.onFragLoading,this),e.off(y.FRAG_LOADED,this.onFragLoaded,this),e.off(y.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(y.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(y.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(y.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(y.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new ja(this,"textTrack1"),t=new ja(this,"textTrack2"),n=new ja(this,"textTrack3"),l=new ja(this,"textTrack4");this.cea608Parser1=new Ko(1,e,t),this.cea608Parser2=new Ko(3,n,l)}addCues(e,t,n,l,g){let T=!1;for(let I=g.length;I--;){const k=g[I],U=rh(k[0],k[1],t,n);if(U>=0&&(k[0]=Math.min(k[0],t),k[1]=Math.max(k[1],n),T=!0,U/(n-t)>.5))return}if(T||g.push([t,n]),this.config.renderTextTracksNatively){const I=this.captionsTracks[e];this.Cues.newCue(I,t,n,l)}else{const I=this.Cues.newCue(null,t,n,l);this.hls.trigger(y.CUES_PARSED,{type:"captions",cues:I,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:l,timescale:g,trackId:T}){const{unparsedVttFrags:I}=this;n===A.MAIN&&(this.initPTS[t.cc]={baseTime:l,timescale:g,trackId:T}),I.length&&(this.unparsedVttFrags=[],I.forEach(k=>{this.initPTS[k.frag.cc]?this.onFragLoaded(y.FRAG_LOADED,k):this.hls.trigger(y.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:k.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let l=0;l<n.textTracks.length;l++){const g=n.textTracks[l];if(Jo(g,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return g}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:l}=this,{label:g,languageCode:T}=t[e],I=this.getExistingTrack(g,T);if(I)n[e]=I,_a(n[e]),Po(n[e],l);else{const k=this.createTextTrack("captions",g,T);k&&(k[e]=!0,n[e]=k)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const n=t.label,l={_id:e,label:n,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=l,this.hls.trigger(y.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[l]})}createTextTrack(e,t,n){const l=this.media;if(l)return l.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const n=!!t.transferMedia;if(this.media=null,n)return;const{captionsTracks:l}=this;Object.keys(l).forEach(g=>{_a(l[g]),delete l[g]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=qo(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let n=0;n<t.length;n++)_a(t[n])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],l=n.some(g=>g.textCodec===Rs);if(this.config.enableWebVTT||l&&this.config.enableIMSC1){if(ho(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const T=this.media,I=T?Ka(T.textTracks):null;if(this.tracks.forEach((k,U)=>{let j;if(I){let Z=null;for(let Q=0;Q<I.length;Q++)if(I[Q]&&Jo(I[Q],k)){Z=I[Q],I[Q]=null;break}Z&&(j=Z)}if(j)_a(j);else{const Z=Qo(k);j=this.createTextTrack(Z,k.name,k.lang),j&&(j.mode="disabled")}j&&this.textTracks.push(j)}),I!=null&&I.length){const k=I.filter(U=>U!==null).map(U=>U.label);k.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${k.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const T=this.tracks.map(I=>({label:I.name,kind:I.type.toLowerCase(),default:I.default,subtitleTrack:I}));this.hls.trigger(y.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:T})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(n=>{const l=/(?:CC|SERVICE)([1-4])/.exec(n.instreamId);if(!l)return;const g=`textTrack${l[1]}`,T=this.captionsProperties[g];T&&(T.label=n.name,n.lang&&(T.languageCode=n.lang),T.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===A.MAIN){var n,l;const{cea608Parser1:g,cea608Parser2:T,lastSn:I}=this,{cc:k,sn:U}=t.frag,j=(n=(l=t.part)==null?void 0:l.index)!=null?n:-1;g&&T&&(U!==I+1||U===I&&j!==this.lastPartIndex+1||k!==this.lastCc)&&(g.reset(),T.reset()),this.lastCc=k,this.lastSn=U,this.lastPartIndex=j}}onFragLoaded(e,t){const{frag:n,payload:l}=t;if(n.type===A.SUBTITLE)if(l.byteLength){const g=n.decryptdata,T="stats"in t;if(g==null||!g.encrypted||T){const I=this.tracks[n.level],k=this.vttCCs;k[n.cc]||(k[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),I&&I.textCodec===Rs?this._parseIMSC1(n,l):this._parseVTTs(t)}}else this.hls.trigger(y.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;Zo(t,this.initPTS[e.cc],l=>{this._appendCues(l,e.level),n.trigger(y.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},l=>{n.logger.log(`Failed to parse IMSC1: ${l}`),n.trigger(y.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:l})})}_parseVTTs(e){var t;const{frag:n,payload:l}=e,{initPTS:g,unparsedVttFrags:T}=this,I=g.length-1;if(!g[n.cc]&&I===-1){T.push(e);return}const k=this.hls,U=(t=n.initSegment)!=null&&t.data?tt(n.initSegment.data,new Uint8Array(l)).buffer:l;Yc(U,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,j=>{this._appendCues(j,n.level),k.trigger(y.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},j=>{const Z=j.message==="Missing initPTS for VTT MPEGTS";Z?T.push(e):this._fallbackToIMSC1(n,l),k.logger.log(`Failed to parse VTT cue: ${j}`),!(Z&&I>n.cc)&&k.trigger(y.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:j})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||Zo(t,this.initPTS[e.cc],()=>{n.textCodec=Rs,this._parseIMSC1(e,t)},()=>{n.textCodec="wvtt"})}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const l=this.textTracks[t];if(!l||l.mode==="disabled")return;e.forEach(g=>Mo(l,g))}else{const l=this.tracks[t];if(!l)return;const g=l.default?"default":"subtitles"+t;n.trigger(y.CUES_PARSED,{type:"subtitles",cues:e,track:g})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===A.SUBTITLE&&this.onFragLoaded(y.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:n,samples:l}=t;if(!(n.type===A.MAIN&&this.closedCaptionsForLevel(n)==="NONE"))for(let g=0;g<l.length;g++){const T=l[g].bytes;if(T){this.cea608Parser1||this.initCea608Parsers();const I=this.extractCea608Data(T);this.cea608Parser1.addData(l[g].pts,I[0]),this.cea608Parser2.addData(l[g].pts,I[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:l,type:g}){const{media:T}=this;if(!(!T||T.currentTime<n)){if(!g||g==="video"){const{captionsTracks:I}=this;Object.keys(I).forEach(k=>Es(I[k],t,n))}if(this.config.renderTextTracksNatively&&t===0&&l!==void 0){const{textTracks:I}=this;Object.keys(I).forEach(k=>Es(I[k],t,l))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let l=2;for(let g=0;g<n;g++){const T=e[l++],I=127&e[l++],k=127&e[l++];if(I===0&&k===0)continue;if((4&T)!==0){const j=3&T;(j===0||j===1)&&(t[j].push(I),t[j].push(k))}}return t}}function Qo(b){return b.characteristics&&/transcribes-spoken-dialog/gi.test(b.characteristics)&&/describes-music-and-sound/gi.test(b.characteristics)?"captions":"subtitles"}function Jo(b,e){return!!b&&b.kind===Qo(e)&&fs(e,b)}function rh(b,e,t,n){return Math.min(e,n)-Math.max(b,t)}function qo(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const nh=/\s/,ih={newCue(b,e,t,n){const l=[];let g,T,I,k,U;const j=self.VTTCue||self.TextTrackCue;for(let Q=0;Q<n.rows.length;Q++)if(g=n.rows[Q],I=!0,k=0,U="",!g.isEmpty()){var Z;for(let de=0;de<g.chars.length;de++)nh.test(g.chars[de].uchar)&&I?k++:(U+=g.chars[de].uchar,I=!1);g.cueStartTime=e,e===t&&(t+=1e-4),k>=16?k--:k++;const ee=Ho(U.trim()),ne=Ls(e,t,ee);b!=null&&(Z=b.cues)!=null&&Z.getCueById(ne)||(T=new j(e,t,ee),T.id=ne,T.line=Q+1,T.align="left",T.position=10+Math.min(80,Math.floor(k*8/32)*10),l.push(T))}return b&&l.length&&(l.sort((Q,ee)=>Q.line==="auto"||ee.line==="auto"?0:Q.line>8&&ee.line>8?ee.line-Q.line:Q.line-ee.line),l.forEach(Q=>Mo(b,Q))),l}};function ah(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(b){}return!1}const sh=/(\d+)-(\d+)\/(\d+)/;class el{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||ch,this.controller=new self.AbortController,this.stats=new M}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 l=this.stats;if(l.loading.start)throw new Error("Loader can only be used once.");l.loading.start=self.performance.now();const g=oh(e,this.controller.signal),T=e.responseType==="arraybuffer",I=T?"byteLength":"length",{maxTimeToFirstByteMs:k,maxLoadTimeMs:U}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,g),self.clearTimeout(this.requestTimeout),t.timeout=k&&te(k)?k:U,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(l,e,this.response))},t.timeout),(Aa(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(Z=>{var Q;this.response=this.loader=Z;const ee=Math.max(self.performance.now(),l.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=U,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(l,e,this.response))},U-(ee-l.loading.start)),!Z.ok){const{status:de,statusText:ce}=Z;throw new hh(ce||"fetch, bad network response",de,Z)}l.loading.first=ee,l.total=uh(Z.headers)||l.total;const ne=(Q=this.callbacks)==null?void 0:Q.onProgress;return ne&&te(t.highWaterMark)?this.loadProgressively(Z,l,e,t.highWaterMark,ne):T?Z.arrayBuffer():e.responseType==="json"?Z.json():Z.text()}).then(Z=>{var Q,ee;const ne=this.response;if(!ne)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),l.loading.end=Math.max(self.performance.now(),l.loading.first);const de=Z[I];de&&(l.loaded=l.total=de);const ce={url:ne.url,data:Z,code:ne.status},Ee=(Q=this.callbacks)==null?void 0:Q.onProgress;Ee&&!te(t.highWaterMark)&&Ee(l,e,Z,ne),(ee=this.callbacks)==null||ee.onSuccess(ce,l,e,ne)}).catch(Z=>{var Q;if(self.clearTimeout(this.requestTimeout),l.aborted)return;const ee=Z&&Z.code||0,ne=Z?Z.message:null;(Q=this.callbacks)==null||Q.onError({code:ee,text:ne},e,Z?Z.details:null,l)})}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,l=0,g){const T=new Ca,I=e.body.getReader(),k=()=>I.read().then(U=>{if(U.done)return T.dataLength&&g(t,n,T.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const j=U.value,Z=j.length;return t.loaded+=Z,Z<l||T.dataLength?(T.push(j),T.dataLength>=l&&g(t,n,T.flush().buffer,e)):g(t,n,j.buffer,e),k()}).catch(()=>Promise.reject());return k()}}function oh(b,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(u({},b.headers))};return b.rangeEnd&&t.headers.set("Range","bytes="+b.rangeStart+"-"+String(b.rangeEnd-1)),t}function lh(b){const e=sh.exec(b);if(e)return parseInt(e[2])-parseInt(e[1])+1}function uh(b){const e=b.get("Content-Range");if(e){const n=lh(e);if(te(n))return n}const t=b.get("Content-Length");if(t)return parseInt(t)}function ch(b,e){return new self.Request(b.url,e)}class hh extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const fh=/^age:\s*[\d.]+\s*$/im;class tl{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 M,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,l=this.stats;l.loading.first=0,l.loaded=0,l.aborted=!1;const g=this.xhrSetup;g?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return g(n,t.url)}).catch(T=>{if(!(this.loader!==n||this.stats.aborted))return n.open("GET",t.url,!0),g(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(T=>{var I;(I=this.callbacks)==null||I.onError({code:n.status,text:T.message},t,n,l)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const l=t.headers,{maxTimeToFirstByteMs:g,maxLoadTimeMs:T}=n.loadPolicy;if(l)for(const I in l)e.setRequestHeader(I,l[I]);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=g&&te(g)?g:T,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 l=t.readyState,g=this.config;if(!n.aborted&&l>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),g.timeout!==g.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),g.timeout=g.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),l===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const U=t.status,j=t.responseType==="text"?t.responseText:null;if(U>=200&&U<300){const ne=j!=null?j:t.response;if(ne!=null){var T,I;n.loading.end=Math.max(self.performance.now(),n.loading.first);const de=t.responseType==="arraybuffer"?ne.byteLength:ne.length;n.loaded=n.total=de,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first);const ce=(T=this.callbacks)==null?void 0:T.onProgress;ce&&ce(n,e,ne,t);const Ee={url:t.responseURL,data:ne,code:U};(I=this.callbacks)==null||I.onSuccess(Ee,n,e,t);return}}const Z=g.loadPolicy.errorRetry,Q=n.retry,ee={url:e.url,data:void 0,code:U};if(pr(Z,Q,!1,ee))this.retry(Z);else{var k;S.error(`${U} while loading ${e.url}`),(k=this.callbacks)==null||k.onError({code:U,text:t.statusText},e,t,n)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(pr(e,t,!0))this.retry(e);else{var n;S.warn(`timeout while loading ${(n=this.context)==null?void 0:n.url}`);const l=this.callbacks;l&&(this.abortInternal(),l.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=Cr(e,n.retry),n.retry++,S.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&&fh.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const dh={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},_h=i(i({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:tl,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Ve,bufferController:Eu,capLevelController:_s,errorController:on,fpsController:gc,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:jr,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:dh},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},mh()),{},{subtitleStreamController:wc,subtitleTrackController:Ec,timelineController:th,audioStreamController:pu,audioTrackController:gu,emeController:da,cmcdController:_c,contentSteeringController:pc,interstitialsController:Rc});function mh(){return{cueHandler:ih,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 ph(b,e,t){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const n=Ps(b),l=["manifest","level","frag"],g=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return l.forEach(T=>{const I=`${T==="level"?"playlist":T}LoadPolicy`,k=e[I]===void 0,U=[];g.forEach(j=>{const Z=`${T}Loading${j}`,Q=e[Z];if(Q!==void 0&&k){U.push(Z);const ee=n[I].default;switch(e[I]={default:ee},j){case"TimeOut":ee.maxLoadTimeMs=Q,ee.maxTimeToFirstByteMs=Q;break;case"MaxRetry":ee.errorRetry.maxNumRetry=Q,ee.timeoutRetry.maxNumRetry=Q;break;case"RetryDelay":ee.errorRetry.retryDelayMs=Q,ee.timeoutRetry.retryDelayMs=Q;break;case"MaxRetryTimeout":ee.errorRetry.maxRetryDelayMs=Q,ee.timeoutRetry.maxRetryDelayMs=Q;break}}}),U.length&&t.warn(`hls.js config: "${U.join('", "')}" setting(s) are deprecated, use "${I}": ${ot(e[I])}`)}),i(i({},n),e)}function Ps(b){return b&&typeof b=="object"?Array.isArray(b)?b.map(Ps):Object.keys(b).reduce((e,t)=>(e[t]=Ps(b[t]),e),{}):b}function gh(b,e){const t=b.loader;t!==el&&t!==tl?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),b.progressive=!1):ah()&&(b.loader=el,b.progressive=!0,b.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const Za=2,vh=.1,yh=.05,Eh=100;class xh extends Ln{constructor(e,t){super("gap-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var n;(n=this.media)!=null&&n.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var n;this.ended=((n=this.media)==null?void 0:n.currentTime)||1,this.hls.trigger(y.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(y.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(y.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(y.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(y.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(y.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(y.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(Eh),this.mediaSource=t.mediaSource;const n=this.media=t.media;Kn(n,"playing",this.onMediaPlaying),Kn(n,"waiting",this.onMediaWaiting),Kn(n,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:n}=this;n&&(qn(n,"playing",this.onMediaPlaying),qn(n,"waiting",this.onMediaWaiting),qn(n,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var n,l;const g=(n=this.hls)==null?void 0:n.config;if(!g)return;const T=this.media;if(!T)return;const{seeking:I}=T,k=this.seeking&&!I,U=!this.seeking&&I,j=T.paused&&!I||T.ended||T.playbackRate===0;if(this.seeking=I,e!==t){t&&(this.ended=0),this.moved=!0,I||(this.nudgeRetry=0,g.nudgeOnVideoHole&&!j&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(U||k){k&&this.stallResolved(e);return}if(j){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&T.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(y.MEDIA_ENDED,{stalled:!1}));return}if(!Dr.getBuffered(T).length){this.nudgeRetry=0;return}const Z=Dr.bufferInfo(T,e,0),Q=Z.nextStart||0,ee=this.fragmentTracker;if(I&&ee&&this.hls){const Ct=rl(this.hls.inFlightFragments,e),rt=Z.len>Za,vt=!Q||Ct||Q-e>Za&&!ee.getPartialFragment(e);if(rt||vt)return;this.moved=!1}const ne=(l=this.hls)==null?void 0:l.latestLevelDetails;if(!this.moved&&this.stalled!==null&&ee){if(!(Z.len>0)&&!Q)return;const rt=Math.max(Q,Z.start||0)-e,xt=!!(ne!=null&&ne.live)?ne.targetduration*2:Za,at=Xa(e,ee);if(rt>0&&(rt<=xt||at)){T.paused||this._trySkipBufferHole(at);return}}const de=g.detectStallWithCurrentTimeMs,ce=self.performance.now(),Ee=this.waiting;let ke=this.stalled;if(ke===null)if(Ee>0&&ce-Ee<de)ke=this.stalled=Ee;else{this.stalled=ce;return}const Me=ce-ke;if(!I&&(Me>=de||Ee)&&this.hls){var Ye;if(((Ye=this.mediaSource)==null?void 0:Ye.readyState)==="ended"&&!(ne!=null&&ne.live)&&Math.abs(e-((ne==null?void 0:ne.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(y.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(Z),!this.media||!this.hls)return}const lt=Dr.bufferInfo(T,e,g.maxBufferHole);this._tryFixBufferStall(lt,Me,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const n=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(y.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var n;const l=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(n=this.buffered.audio)!=null&&n.length&&l&&l.length>1&&e>l.end(0)){const g=Dr.bufferedInfo(Dr.timeRangesToArray(this.buffered.audio),e,0);if(g.len>1&&t>=g.start){const T=Dr.timeRangesToArray(l),I=Dr.bufferedInfo(T,t,0).bufferedIndex;if(I>-1&&I<T.length-1){const k=Dr.bufferedInfo(T,e,0).bufferedIndex,U=T[I].end,j=T[I+1].start;if((k===-1||k>I)&&j-U<1&&e-U<2){const Z=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${U} -> ${j} buffered index: ${k}`);this.warn(Z.message),this.media.currentTime+=1e-6;let Q=Xa(e,this.fragmentTracker);Q&&"fragment"in Q?Q=Q.fragment:Q||(Q=void 0);const ee=Dr.bufferInfo(this.media,e,0);this.hls.trigger(y.ERROR,{type:D.MEDIA_ERROR,details:W.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:Z,reason:Z.message,frag:Q,buffer:ee.len,bufferInfo:ee})}}}}}_tryFixBufferStall(e,t,n){var l,g;const{fragmentTracker:T,media:I}=this,k=(l=this.hls)==null?void 0:l.config;if(!I||!T||!k)return;const U=(g=this.hls)==null?void 0:g.latestLevelDetails,j=Xa(n,T);if((j||U!=null&&U.live&&n<U.fragmentStart)&&(this._trySkipBufferHole(j)||!this.media))return;const Z=e.buffered,Q=this.adjacentTraversal(e,n);(Z&&Z.length>1&&e.len>k.maxBufferHole||e.nextStart&&(e.nextStart-n<k.maxBufferHole||Q))&&(t>k.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const n=this.fragmentTracker,l=e.nextStart;if(n&&l){const g=n.getFragAtPos(t,A.MAIN),T=n.getFragAtPos(l,A.MAIN);if(g&&T)return T.sn-g.sn<2}return!1}_reportStall(e){const{hls:t,media:n,stallReported:l,stalled:g}=this;if(!l&&g!==null&&n&&t){this.stallReported=!0;const T=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${ot(e)})`);this.warn(T.message),t.trigger(y.ERROR,{type:D.MEDIA_ERROR,details:W.BUFFER_STALLED_ERROR,fatal:!1,error:T,buffer:e.len,bufferInfo:e,stalled:{start:g}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:n,media:l}=this,g=(t=this.hls)==null?void 0:t.config;if(!l||!n||!g)return 0;const T=l.currentTime,I=Dr.bufferInfo(l,T,0),k=T<I.start?I.start:I.nextStart;if(k&&this.hls){const j=I.len<=g.maxBufferHole,Z=I.len>0&&I.len<1&&l.readyState<3,Q=k-T;if(Q>0&&(j||Z)){if(Q>g.maxBufferHole){let ne=!1;if(T===0){const de=n.getAppendedFrag(0,A.MAIN);de&&k<de.end&&(ne=!0)}if(!ne&&e){var U;if(!((U=this.hls.loadLevelObj)!=null&&U.details)||rl(this.hls.inFlightFragments,k))return 0;let ce=!1,Ee=e.end;for(;Ee<k;){const ke=Xa(Ee,n);if(ke)Ee+=ke.duration;else{ce=!0;break}}if(ce)return 0}}const ee=Math.max(k+yh,T+vh);if(this.warn(`skipping hole, adjusting currentTime from ${T} to ${ee}`),this.moved=!0,l.currentTime=ee,!(e!=null&&e.gap)){const ne=new Error(`fragment loaded with buffer holes, seeking from ${T} to ${ee}`),de={type:D.MEDIA_ERROR,details:W.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:ne,reason:ne.message,buffer:I.len,bufferInfo:I};e&&("fragment"in e?de.part=e:de.frag=e),this.hls.trigger(y.ERROR,de)}return ee}}return 0}_tryNudgeBuffer(e){const{hls:t,media:n,nudgeRetry:l}=this,g=t==null?void 0:t.config;if(!n||!g)return 0;const T=n.currentTime;if(this.nudgeRetry++,l<g.nudgeMaxRetry){const I=T+(l+1)*g.nudgeOffset,k=new Error(`Nudging 'currentTime' from ${T} to ${I}`);this.warn(k.message),n.currentTime=I,t.trigger(y.ERROR,{type:D.MEDIA_ERROR,details:W.BUFFER_NUDGE_ON_STALL,error:k,fatal:!1,buffer:e.len,bufferInfo:e})}else{const I=new Error(`Playhead still not moving while enough data buffered @${T} after ${g.nudgeMaxRetry} nudges`);this.error(I.message),t.trigger(y.ERROR,{type:D.MEDIA_ERROR,details:W.BUFFER_STALLED_ERROR,error:I,fatal:!0,buffer:e.len,bufferInfo:e})}}}function rl(b,e){const t=nl(b.main);if(t&&t.start<=e)return t;const n=nl(b.audio);return n&&n.start<=e?n:null}function nl(b){if(!b)return null;switch(b.state){case Kt.IDLE:case Kt.STOPPED:case Kt.ENDED:case Kt.ERROR:return null}return b.frag}function Xa(b,e){return e.getAppendedFrag(b,A.MAIN)||e.getPartialFragment(b)}const Th=.25;function Ms(){if(typeof self!="undefined")return self.VTTCue||self.TextTrackCue}function Os(b,e,t,n,l){let g=new b(e,t,"");try{g.value=n,l&&(g.type=l)}catch(T){g=new b(e,t,ot(l?i({type:l},n):n))}return g}const Ya=(()=>{const b=Ms();try{b&&new b(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class Ah{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(y.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e&&(e.on(y.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(y.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(y.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(y.MANIFEST_LOADING,this.onManifestLoading,this),e.on(y.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(y.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(y.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(y.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(y.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(y.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(y.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(y.MANIFEST_LOADING,this.onManifestLoading,this),e.off(y.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(y.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(y.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(y.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(e,t){var n;this.media=t.media,((n=t.overrides)==null?void 0:n.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){var e;const t=(e=this.hls)==null?void 0:e.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&_a(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const n=e[t];if(n.kind==="metadata"&&n.label==="id3")return Po(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:n,enableID3MetadataCues:l}=this.hls.config;if(!n&&!l)return;const{samples:g}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const T=Ms();if(T)for(let I=0;I<g.length;I++){const k=g[I].type;if(k===di.emsg&&!n||!l)continue;const U=js(g[I].data),j=g[I].pts;let Z=j+g[I].duration;Z>Ya&&(Z=Ya),Z-j<=0&&(Z=j+Th);for(let ee=0;ee<U.length;ee++){const ne=U[ee];if(!Zs(ne)){this.updateId3CueEnds(j,k);const de=Os(T,j,Z,ne,k);de&&this.id3Track.addCue(de)}}}}updateId3CueEnds(e,t){var n;const l=(n=this.id3Track)==null?void 0:n.cues;if(l)for(let g=l.length;g--;){const T=l[g];T.type===t&&T.startTime<e&&T.endTime===Ya&&(T.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:l}){const{id3Track:g,hls:T}=this;if(!T)return;const{config:{enableEmsgMetadataCues:I,enableID3MetadataCues:k}}=T;if(g&&(I||k)){let U;l==="audio"?U=j=>j.type===di.audioId3&&k:l==="video"?U=j=>j.type===di.emsg&&I:U=j=>j.type===di.audioId3&&k||j.type===di.emsg&&I,Es(g,t,n,U)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;const{assetPlayerId:n,timelineOffset:l,enableDateRangeMetadataCues:g,interstitialsController:T}=this.hls.config;if(!g)return;const I=Ms();if(n&&l&&!T){const{fragmentStart:de,fragmentEnd:ce}=e;let Ee=this.assetCue;Ee?(Ee.startTime=de,Ee.endTime=ce):I&&(Ee=this.assetCue=Os(I,de,ce,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),Ee&&(Ee.id=n,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(Ee),Ee.addEventListener("enter",this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;const{id3Track:k}=this,{dateRanges:U}=e,j=Object.keys(U);let Z=this.dateRangeCuesAppended;if(k&&t){var Q;if((Q=k.cues)!=null&&Q.length){const de=Object.keys(Z).filter(ce=>!j.includes(ce));for(let ce=de.length;ce--;){var ee;const Ee=de[ce],ke=(ee=Z[Ee])==null?void 0:ee.cues;delete Z[Ee],ke&&Object.keys(ke).forEach(Me=>{const Ye=ke[Me];if(Ye){Ye.removeEventListener("enter",this.onEventCueEnter);try{k.removeCue(Ye)}catch(lt){}}})}}else Z=this.dateRangeCuesAppended={}}const ne=e.fragments[e.fragments.length-1];if(!(j.length===0||!te(ne==null?void 0:ne.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let de=0;de<j.length;de++){const ce=j[de],Ee=U[ce],ke=Ee.startTime,Me=Z[ce],Ye=(Me==null?void 0:Me.cues)||{};let lt=(Me==null?void 0:Me.durationKnown)||!1,Ct=Ya;const{duration:rt,endDate:vt}=Ee;if(vt&&rt!==null)Ct=ke+rt,lt=!0;else if(Ee.endOnNext&&!lt){const at=j.reduce((Gt,dr)=>{if(dr!==Ee.id){const Lr=U[dr];if(Lr.class===Ee.class&&Lr.startDate>Ee.startDate&&(!Gt||Ee.startDate<Gt.startDate))return Lr}return Gt},null);at&&(Ct=at.startTime,lt=!0)}const xt=Object.keys(Ee.attr);for(let at=0;at<xt.length;at++){const Gt=xt[at];if(!oi(Gt))continue;const dr=Ye[Gt];if(dr)lt&&!(Me!=null&&Me.durationKnown)?dr.endTime=Ct:Math.abs(dr.startTime-ke)>.01&&(dr.startTime=ke,dr.endTime=Ct);else if(I){let Lr=Ee.attr[Gt];$n(Gt)&&(Lr=P(Lr));const Rr=Os(I,ke,Ct,{key:Gt,data:Lr},di.dateRange);Rr&&(Rr.id=ce,this.id3Track.addCue(Rr),Ye[Gt]=Rr,T&&(Gt==="X-ASSET-LIST"||Gt==="X-ASSET-URL")&&Rr.addEventListener("enter",this.onEventCueEnter))}}Z[ce]={cues:Ye,dateRange:Ee,durationKnown:lt}}}}}class bh{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:t}=this,n=this.levelDetails;if(!t||!n)return;this.currentTime=t.currentTime;const l=this.computeLatency();if(l===null)return;this._latency=l;const{lowLatencyMode:g,maxLiveSyncPlaybackRate:T}=this.config;if(!g||T===1||!n.live)return;const I=this.targetLatency;if(I===null)return;const k=l-I,U=Math.min(this.maxLatency,I+n.targetduration);if(k<U&&k>.05&&this.forwardBufferLength>1){const Z=Math.min(2,Math.max(1,T)),Q=Math.round(2/(1+Math.exp(-.75*k-this.edgeStalled))*20)/20,ee=Math.min(Z,Math.max(1,Q));this.changeMediaPlaybackRate(t,ee)}else t.playbackRate!==1&&t.playbackRate!==0&&this.changeMediaPlaybackRate(t,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return((e=this.hls)==null?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(e===null||this.hls===null)return null;const{holdBack:t,partHoldBack:n,targetduration:l}=e,{liveSyncDuration:g,liveSyncDurationCount:T,lowLatencyMode:I}=this.config,k=this.hls.userConfig;let U=I&&n||t;(this._targetLatencyUpdated||k.liveSyncDuration||k.liveSyncDurationCount||U===0)&&(U=g!==void 0?g:T*l);const j=l;return U+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,j)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;const n=this.levelDetails;if(n===null)return null;const l=n.edge,g=e-t-this.edgeStalled,T=l-n.totalduration,I=l-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(T,g),I)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(y.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(y.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(y.MANIFEST_LOADING,this.onManifestLoading,this),e.on(y.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(y.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(y.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(y.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(y.MANIFEST_LOADING,this.onManifestLoading,this),e.off(y.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(y.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var n;t.details===W.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(n=this.levelDetails)!=null&&n.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var n,l;e.playbackRate!==t&&((n=this.hls)==null||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(l=this.targetLatency)==null?void 0:l.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class Sh extends hs{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(y.MANIFEST_LOADING,this.onManifestLoading,this),e.on(y.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(y.LEVEL_LOADED,this.onLevelLoaded,this),e.on(y.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(y.FRAG_BUFFERED,this.onFragBuffered,this),e.on(y.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(y.MANIFEST_LOADING,this.onManifestLoading,this),e.off(y.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(y.LEVEL_LOADED,this.onLevelLoaded,this),e.off(y.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(y.FRAG_BUFFERED,this.onFragBuffered,this),e.off(y.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,l=[],g={},T={};let I=!1,k=!1,U=!1;t.levels.forEach(j=>{const Z=j.attrs;let{audioCodec:Q,videoCodec:ee}=j;Q&&(j.audioCodec=Q=Vt(Q,n)||void 0),ee&&(ee=j.videoCodec=mt(ee));const{width:ne,height:de,unknownCodecs:ce}=j;let Ee=ce?ce.length:0;if(ce)for(let at=Ee;at--;){const Gt=ce[at];this.isAudioSupported(Gt)?(j.audioCodec=Q=Q?`${Q},${Gt}`:Gt,Ee--,Qt.audio[Q.substring(0,4)]=2):this.isVideoSupported(Gt)&&(j.videoCodec=ee=ee?`${ee},${Gt}`:Gt,Ee--,Qt.video[ee.substring(0,4)]=2)}if(I||(I=!!(ne&&de)),k||(k=!!ee),U||(U=!!Q),Ee||Q&&!this.isAudioSupported(Q)||ee&&!this.isVideoSupported(ee)){this.log(`Some or all CODECS not supported "${Z.CODECS}"`);return}const{CODECS:ke,"FRAME-RATE":Me,"HDCP-LEVEL":Ye,"PATHWAY-ID":lt,RESOLUTION:Ct,"VIDEO-RANGE":rt}=Z,xt=`${`${lt||"."}-`}${j.bitrate}-${Ct}-${Me}-${ke}-${rt}-${Ye}`;if(g[xt])if(g[xt].uri!==j.url&&!j.attrs["PATHWAY-ID"]){const at=T[xt]+=1;j.attrs["PATHWAY-ID"]=new Array(at+1).join(".");const Gt=this.createLevel(j);g[xt]=Gt,l.push(Gt)}else g[xt].addGroupId("audio",Z.AUDIO),g[xt].addGroupId("text",Z.SUBTITLES);else{const at=this.createLevel(j);g[xt]=at,T[xt]=1,l.push(at)}}),this.filterAndSortMediaOptions(l,t,I,k,U)}createLevel(e){const t=new ht(e),n=e.supplemental;if(n!=null&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){const l=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(l.message),t.supportedResult=J(l,[])}return t}isAudioSupported(e){return Lt(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Lt(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,l,g){let T=[],I=[],k=e;if((n||l)&&g&&(k=k.filter(({videoCodec:ce,videoRange:Ee,width:ke,height:Me})=>(!!ce||!!(ke&&Me))&&ut(Ee))),k.length===0){Promise.resolve().then(()=>{if(this.hls){let ce="no level with compatible codecs found in manifest",Ee=ce;t.levels.length&&(Ee=`one or more CODECS in variant not supported: ${ot(t.levels.map(Me=>Me.attrs.CODECS).filter((Me,Ye,lt)=>lt.indexOf(Me)===Ye))}`,this.warn(Ee),ce+=` (${Ee})`);const ke=new Error(ce);this.hls.trigger(y.ERROR,{type:D.MEDIA_ERROR,details:W.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:ke,reason:Ee})}});return}t.audioTracks&&(T=t.audioTracks.filter(ce=>!ce.audioCodec||this.isAudioSupported(ce.audioCodec)),il(T)),t.subtitles&&(I=t.subtitles,il(I));const U=k.slice(0);k.sort((ce,Ee)=>{if(ce.attrs["HDCP-LEVEL"]!==Ee.attrs["HDCP-LEVEL"])return(ce.attrs["HDCP-LEVEL"]||"")>(Ee.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&ce.height!==Ee.height)return ce.height-Ee.height;if(ce.frameRate!==Ee.frameRate)return ce.frameRate-Ee.frameRate;if(ce.videoRange!==Ee.videoRange)return be.indexOf(ce.videoRange)-be.indexOf(Ee.videoRange);if(ce.videoCodec!==Ee.videoCodec){const ke=ir(ce.videoCodec),Me=ir(Ee.videoCodec);if(ke!==Me)return Me-ke}if(ce.uri===Ee.uri&&ce.codecSet!==Ee.codecSet){const ke=Jt(ce.codecSet),Me=Jt(Ee.codecSet);if(ke!==Me)return Me-ke}return ce.averageBitrate!==Ee.averageBitrate?ce.averageBitrate-Ee.averageBitrate:0});let j=U[0];if(this.steering&&(k=this.steering.filterParsedLevels(k),k.length!==U.length)){for(let ce=0;ce<U.length;ce++)if(U[ce].pathwayId===k[0].pathwayId){j=U[ce];break}}this._levels=k;for(let ce=0;ce<k.length;ce++)if(k[ce]===j){var Z;this._firstLevel=ce;const Ee=j.bitrate,ke=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${k.length} level(s) found, first bitrate: ${Ee}`),((Z=this.hls.userConfig)==null?void 0:Z.abrEwmaDefaultEstimate)===void 0){const Me=Math.min(Ee,this.hls.config.abrEwmaDefaultEstimateMax);Me>ke&&ke===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=Me)}break}const Q=g&&!l,ee=this.hls.config,ne=!!(ee.audioStreamController&&ee.audioTrackController),de={levels:k,audioTracks:T,subtitleTracks:I,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:g,video:l,altAudio:ne&&!Q&&T.some(ce=>!!ce.url)};this.hls.trigger(y.MANIFEST_PARSED,de)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const j=new Error("invalid level idx"),Z=e<0;if(this.hls.trigger(y.ERROR,{type:D.OTHER_ERROR,details:W.LEVEL_SWITCH_ERROR,level:e,fatal:Z,error:j,reason:j.message}),Z)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,l=this.currentLevel,g=l?l.attrs["PATHWAY-ID"]:void 0,T=t[e],I=T.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=T,n===e&&l&&g===I)return;this.log(`Switching to level ${e} (${T.height?T.height+"p ":""}${T.videoRange?T.videoRange+" ":""}${T.codecSet?T.codecSet+" ":""}@${T.bitrate})${I?" with Pathway "+I:""} from level ${n}${g?" with Pathway "+g:""}`);const k={level:e,attrs:T.attrs,details:T.details,bitrate:T.bitrate,averageBitrate:T.averageBitrate,maxBitrate:T.maxBitrate,realBitrate:T.realBitrate,width:T.width,height:T.height,codecSet:T.codecSet,audioCodec:T.audioCodec,videoCodec:T.videoCodec,audioGroups:T.audioGroups,subtitleGroups:T.subtitleGroups,loaded:T.loaded,loadError:T.loadError,fragmentError:T.fragmentError,name:T.name,id:T.id,uri:T.uri,url:T.url,urlId:0,audioGroupIds:T.audioGroupIds,textGroupIds:T.textGroupIds};this.hls.trigger(y.LEVEL_SWITCHING,k);const U=T.details;if(!U||U.live){const j=this.switchParams(T.uri,l==null?void 0:l.details,U);this.loadPlaylist(j)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),n=e.filter(l=>t.indexOf(l)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=n}}onError(e,t){t.fatal||!t.context||t.context.type===L.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===A.MAIN){const n=t.elementaryStreams;if(!Object.keys(n).some(g=>!!n[g]))return;const l=this._levels[t.level];l!=null&&l.loadError&&(this.log(`Resetting level error count of ${l.loadError} on frag buffered`),l.loadError=0)}}onLevelLoaded(e,t){var n;const{level:l,details:g}=t,T=t.levelInfo;if(!T){var I;this.warn(`Invalid level index ${l}`),(I=t.deliveryDirectives)!=null&&I.skip&&(g.deltaUpdateFailed=!0);return}if(T===this.currentLevel||t.withoutMultiVariant){T.fragmentError===0&&(T.loadError=0);let k=T.details;k===t.details&&k.advanced&&(k=void 0),this.playlistLoaded(l,t,k)}else(n=t.deliveryDirectives)!=null&&n.skip&&(g.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=this.getUrlWithDirectives(e.uri,t),l=this.currentLevelIndex,g=e.attrs["PATHWAY-ID"],T=e.details,I=T==null?void 0:T.age;this.log(`Loading level index ${l}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${g?" Pathway "+g:""}${I&&T.live?" age "+I.toFixed(1)+(T.type?" "+T.type||0:""):""} ${n}`),this.hls.trigger(y.LEVEL_LOADING,{url:n,level:l,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;const n=this._levels.filter((g,T)=>T!==e?!0:(this.steering&&this.steering.removeLevel(g),g===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,g.details&&g.details.fragments.forEach(I=>I.level=-1)),!1));Oi(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const l=n.length-1;this._firstLevel=Math.min(this._firstLevel,l),this._startLevel&&(this._startLevel=Math.min(this._startLevel,l)),this.hls.trigger(y.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(y.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function il(b){const e={};b.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}function al(){return self.SourceBuffer||self.WebKitSourceBuffer}function sl(){if(!w())return!1;const e=al();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function Dh(){if(!sl())return!1;const b=w();return typeof(b==null?void 0:b.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>b.isTypeSupported(yt(e,"video")))||["mp4a.40.2","fLaC"].some(e=>b.isTypeSupported(yt(e,"audio"))))}function Lh(){var b;const e=al();return typeof(e==null||(b=e.prototype)==null?void 0:b.changeType)=="function"}const Rh=100;class wh extends Bi{constructor(e,t,n){super(e,t,n,"stream-controller",A.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const l=this.media,g=l?l.currentTime:null;if(g===null||!te(g)||(this.log(`Media seeked to ${g.toFixed(3)}`),!this.getBufferedFrag(g)))return;const T=this.getFwdBufferInfoAtPos(l,g,A.MAIN,0);if(T===null||T.len===0){this.warn(`Main forward buffer length at ${g} on "seeked" event ${T?T.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(y.MANIFEST_PARSED,this.onManifestParsed,this),e.on(y.LEVEL_LOADING,this.onLevelLoading,this),e.on(y.LEVEL_LOADED,this.onLevelLoaded,this),e.on(y.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(y.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(y.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(y.BUFFER_CREATED,this.onBufferCreated,this),e.on(y.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(y.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(y.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(y.MANIFEST_PARSED,this.onManifestParsed,this),e.off(y.LEVEL_LOADED,this.onLevelLoaded,this),e.off(y.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(y.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(y.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(y.BUFFER_CREATED,this.onBufferCreated,this),e.off(y.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(y.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(y.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:n,hls:l}=this;if(this.stopLoad(),this.setInterval(Rh),this.level=-1,!this.startFragRequested){let g=l.startLevel;g===-1&&(l.config.testBandwidth&&this.levels.length>1?(g=0,this.bitrateTest=!0):g=l.firstAutoLevel),l.nextLoadLevel=g,this.level=l.loadLevel,this._hasEnoughToStart=!!t}n>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=Kt.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=Kt.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Kt.WAITING_LEVEL:{const{levels:e,level:t}=this,n=e==null?void 0:e[t],l=n==null?void 0:n.details;if(l&&(!l.live||this.levelLastLoaded===n&&!this.waitForLive(n))){if(this.waitForCdnTuneIn(l))break;this.state=Kt.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=Kt.IDLE;break}break}case Kt.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate();break}this.state===Kt.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:l}=this;if(t===null||!l&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const g=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(n!=null&&n[g]))return;const T=n[g],I=this.getMainFwdBufferInfo();if(I===null)return;const k=this.getLevelDetails();if(k&&this._streamEnded(I,k)){const de={};this.altAudio===2&&(de.type="video"),this.hls.trigger(y.BUFFER_EOS,de),this.state=Kt.ENDED;return}if(!this.buffering)return;e.loadLevel!==g&&e.manualLevel===-1&&this.log(`Adapting to level ${g} from level ${this.level}`),this.level=e.nextLoadLevel=g;const U=T.details;if(!U||this.state===Kt.WAITING_LEVEL||this.waitForLive(T)){this.level=g,this.state=Kt.WAITING_LEVEL,this.startFragRequested=!1;return}const j=I.len,Z=this.getMaxBufferLength(T.maxBitrate);if(j>=Z)return;this.backtrackFragment&&this.backtrackFragment.start>I.end&&(this.backtrackFragment=null);const Q=this.backtrackFragment?this.backtrackFragment.start:I.end;let ee=this.getNextFragment(Q,U);if(this.couldBacktrack&&!this.fragPrevious&&ee&&q(ee)&&this.fragmentTracker.getState(ee)!==Gr.OK){var ne;const ce=((ne=this.backtrackFragment)!=null?ne:ee).sn-U.startSN,Ee=U.fragments[ce-1];Ee&&ee.cc===Ee.cc&&(ee=Ee,this.fragmentTracker.removeFragment(Ee))}else this.backtrackFragment&&I.len&&(this.backtrackFragment=null);if(ee&&this.isLoopLoading(ee,Q)){if(!ee.gap){const ce=this.audioOnly&&!this.altAudio?H.AUDIO:H.VIDEO,Ee=(ce===H.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;Ee&&this.afterBufferFlushed(Ee,ce,A.MAIN)}ee=this.getNextFragmentLoopLoading(ee,U,I,A.MAIN,Z)}ee&&(ee.initSegment&&!ee.initSegment.data&&!this.bitrateTest&&(ee=ee.initSegment),this.loadFragment(ee,T,Q))}loadFragment(e,t,n){const l=this.fragmentTracker.getState(e);l===Gr.NOT_LOADED||l===Gr.PARTIAL?q(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,n):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,A.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 l=this.getAppendedFrag(t.currentTime);l&&l.start>1&&this.flushMainBuffer(0,l.start-1);const g=this.getLevelDetails();if(g!=null&&g.live){const I=this.getMainFwdBufferInfo();if(!I||I.len<g.targetduration*2)return}if(!t.paused&&e){const I=this.hls.nextLoadLevel,k=e[I],U=this.fragLastKbps;U&&this.fragCurrent?n=this.fragCurrent.duration*k.maxBitrate/(1e3*U)+1:n=0}else n=0;const T=this.getBufferedFrag(t.currentTime+n);if(T){const I=this.followingBufferedFrag(T);if(I){this.abortCurrentFrag();const k=I.maxStartPTS?I.maxStartPTS:I.start,U=I.duration,j=Math.max(T.end,k+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*(this.couldBacktrack?.5:.125)),U*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(j,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case Kt.KEY_LOADING:case Kt.FRAG_LOADING:case Kt.FRAG_LOADING_WAITING_RETRY:case Kt.PARSING:case Kt.PARSED:this.state=Kt.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;Kn(n,"playing",this.onMediaPlaying),Kn(n,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:n}=this;n&&(qn(n,"playing",this.onMediaPlaying),qn(n,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t),!t.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(y.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let n=!1,l=!1;for(let g=0;g<t.levels.length;g++){const T=t.levels[g].audioCodec;T&&(n=n||T.indexOf("mp4a.40.2")!==-1,l=l||T.indexOf("mp4a.40.5")!==-1)}this.audioCodecSwitch=n&&l&&!Lh(),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!==Kt.IDLE)return;const l=t.levelInfo;(!l.details||l.details.live&&(this.levelLastLoaded!==l||l.details.expired)||this.waitForCdnTuneIn(l.details))&&(this.state=Kt.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:l,startFragRequested:g}=this,T=t.level,I=t.details,k=I.totalduration;if(!l){this.warn(`Levels were reset while loading level ${T}`);return}this.log(`Level ${T} loaded [${I.startSN},${I.endSN}]${I.lastPartSn?`[part-${I.lastPartSn}-${I.lastPartIndex}]`:""}, cc [${I.startCC}, ${I.endCC}] duration:${k}`);const U=t.levelInfo,j=this.fragCurrent;j&&(this.state===Kt.FRAG_LOADING||this.state===Kt.FRAG_LOADING_WAITING_RETRY)&&j.level!==t.level&&j.loader&&this.abortCurrentFrag();let Z=0;if(I.live||(n=U.details)!=null&&n.live){var Q;if(this.checkLiveUpdate(I),I.deltaUpdateFailed)return;Z=this.alignPlaylists(I,U.details,(Q=this.levelLastLoaded)==null?void 0:Q.details)}if(U.details=I,this.levelLastLoaded=U,g||this.setStartPosition(I,Z),this.hls.trigger(y.LEVEL_UPDATED,{details:I,level:T}),this.state===Kt.WAITING_LEVEL){if(this.waitForCdnTuneIn(I))return;this.state=Kt.IDLE}g&&I.live&&this.synchronizeToLiveEdge(I),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const l=this.hls.liveSyncPosition,g=this.getLoadPosition(),T=e.fragmentStart,I=e.edge,k=g>=T-t.maxFragLookUpTolerance&&g<=I;if(l!==null&&n.duration>l&&(g<l||!k)){const j=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!k&&n.readyState<4||g<I-j)&&(this._hasEnoughToStart||(this.nextLoadPosition=l),n.readyState))if(this.warn(`Playback: ${g.toFixed(3)} is located too far from the end of live sliding playlist: ${I}, reset currentTime to : ${l.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var U;const Z=Dr.bufferInfo(n,l,0);if(!((U=Z.buffered)!=null&&U.length)){n.currentTime=l;return}if(Z.start<=g){n.currentTime=l;return}const{nextStart:ee}=Dr.bufferedInfo(Z.buffered,g,0);ee&&(n.currentTime=ee)}else n.currentTime=l}}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:l,payload:g}=e,{levels:T}=this;if(!T){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const I=T[n.level];if(!I){this.warn(`Level ${n.level} not found on progress`);return}const k=I.details;if(!k){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const U=I.videoCodec,j=k.PTSKnown||!k.live,Z=(t=n.initSegment)==null?void 0:t.data,Q=this._getAudioCodec(I),ee=this.transmuxer=this.transmuxer||new uo(this.hls,A.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ne=l?l.index:-1,de=ne!==-1,ce=new ln(n.level,n.sn,n.stats.chunkCount,g.byteLength,ne,de),Ee=this.initPTS[n.cc];ee.push(g,Z,Q,U,n,l,k.totalduration,j,ce,Ee)}onAudioTrackSwitching(e,t){const n=this.hls,l=this.altAudio===2;if(_r(t.url,n))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const T=this.fragCurrent;T&&(this.log("Switching to main audio track, cancel main fragment load"),T.abortRequests(),this.fragmentTracker.removeFragment(T)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(l){this.fragmentTracker.removeAllFragments(),n.once(y.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(y.AUDIO_TRACK_SWITCHED,t)}),n.trigger(y.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}n.trigger(y.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=_r(t.url,this.hls);if(n){const l=this.videoBuffer;l&&this.mediaBuffer!==l&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=l)}this.altAudio=n?2:0,this.tick()}onBufferCreated(e,t){const n=t.tracks;let l,g,T=!1;for(const I in n){const k=n[I];if(k.id==="main"){if(g=I,l=k,I==="video"){const U=n[I];U&&(this.videoBuffer=U.buffer)}}else T=!0}T&&l?(this.log(`Alternate track found, use ${g}.buffered to schedule main fragment loading`),this.mediaBuffer=l.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:l}=t,g=n.type===A.MAIN;if(g){if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${l?" p: "+l.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===Kt.PARSED&&(this.state=Kt.IDLE);return}const I=l?l.stats:n.stats;this.fragLastKbps=Math.round(8*I.total/(I.buffering.end-I.loading.first)),q(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,l)}const T=this.media;T&&(!this._hasEnoughToStart&&Dr.getBuffered(T).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),g&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var n;if(t.fatal){this.state=Kt.ERROR;return}switch(t.details){case W.FRAG_GAP:case W.FRAG_PARSING_ERROR:case W.FRAG_DECRYPT_ERROR:case W.FRAG_LOAD_ERROR:case W.FRAG_LOAD_TIMEOUT:case W.KEY_LOAD_ERROR:case W.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(A.MAIN,t);break;case W.LEVEL_LOAD_ERROR:case W.LEVEL_LOAD_TIMEOUT:case W.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===Kt.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===L.LEVEL&&(this.state=Kt.IDLE);break;case W.BUFFER_ADD_CODEC_ERROR:case W.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case W.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY));break;case W.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=Kt.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==H.AUDIO||!this.altAudio){const n=(t===H.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;n&&(this.afterBufferFlushed(n,t,A.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t<n){if(e.seeking){this.log(`could not seek to ${n}, already seeking at ${t}`);return}const l=this.timelineOffset;l&&n&&(n+=l);const g=this.getLevelDetails(),T=Dr.getBuffered(e),I=T.length?T.start(0):0,k=I-n,U=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||k>0&&(k<U||this.loadingParts&&k<2*((g==null?void 0:g.partTarget)||0)))&&(this.log(`adjusting start position by ${k} to match buffer start`),n+=k,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${I}`),e.currentTime=n)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(n=>{const{hls:l}=this,g=n==null?void 0:n.frag;if(!g||this.fragContextChanged(g))return;t.fragmentError=0,this.state=Kt.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const T=g.stats;T.parsing.start=T.parsing.end=T.buffering.start=T.buffering.end=self.performance.now(),l.trigger(y.FRAG_LOADED,n),g.bitrateTest=!1}).catch(n=>{this.state===Kt.STOPPED||this.state===Kt.ERROR||(this.warn(n),this.resetFragmentLoading(e))})}_handleTransmuxComplete(e){const t=this.playlistType,{hls:n}=this,{remuxResult:l,chunkMeta:g}=e,T=this.getCurrentContext(g);if(!T){this.resetWhenMissingContext(g);return}const{frag:I,part:k,level:U}=T,{video:j,text:Z,id3:Q,initSegment:ee}=l,{details:ne}=U,de=this.altAudio?void 0:l.audio;if(this.fragContextChanged(I)){this.fragmentTracker.removeFragment(I);return}if(this.state=Kt.PARSING,ee){const ce=ee.tracks;if(ce){const Ye=I.initSegment||I;if(this.unhandledEncryptionError(ee,I))return;this._bufferInitSegment(U,ce,Ye,g),n.trigger(y.FRAG_PARSING_INIT_SEGMENT,{frag:Ye,id:t,tracks:ce})}const Ee=ee.initPTS,ke=ee.timescale,Me=this.initPTS[I.cc];if(te(Ee)&&(!Me||Me.baseTime!==Ee||Me.timescale!==ke)){const Ye=ee.trackId;this.initPTS[I.cc]={baseTime:Ee,timescale:ke,trackId:Ye},n.trigger(y.INIT_PTS_FOUND,{frag:I,id:t,initPTS:Ee,timescale:ke,trackId:Ye})}}if(j&&ne){de&&j.type==="audiovideo"&&this.logMuxedErr(I);const ce=ne.fragments[I.sn-1-ne.startSN],Ee=I.sn===ne.startSN,ke=!ce||I.cc>ce.cc;if(l.independent!==!1){const{startPTS:Me,endPTS:Ye,startDTS:lt,endDTS:Ct}=j;if(k)k.elementaryStreams[j.type]={startPTS:Me,endPTS:Ye,startDTS:lt,endDTS:Ct};else if(j.firstKeyFrame&&j.independent&&g.id===1&&!ke&&(this.couldBacktrack=!0),j.dropped&&j.independent){const rt=this.getMainFwdBufferInfo(),vt=(rt?rt.end:this.getLoadPosition())+this.config.maxBufferHole,xt=j.firstKeyFramePTS?j.firstKeyFramePTS:Me;if(!Ee&&vt<xt-this.config.maxBufferHole&&!ke){this.backtrack(I);return}else ke&&(I.gap=!0);I.setElementaryStreamInfo(j.type,I.start,Ye,I.start,Ct,!0)}else Ee&&Me-(ne.appliedTimelineOffset||0)>Za&&(I.gap=!0);I.setElementaryStreamInfo(j.type,Me,Ye,lt,Ct),this.backtrackFragment&&(this.backtrackFragment=I),this.bufferFragmentData(j,I,k,g,Ee||ke)}else if(Ee||ke)I.gap=!0;else{this.backtrack(I);return}}if(de){const{startPTS:ce,endPTS:Ee,startDTS:ke,endDTS:Me}=de;k&&(k.elementaryStreams[H.AUDIO]={startPTS:ce,endPTS:Ee,startDTS:ke,endDTS:Me}),I.setElementaryStreamInfo(H.AUDIO,ce,Ee,ke,Me),this.bufferFragmentData(de,I,k,g)}if(ne&&Q!=null&&Q.samples.length){const ce={id:t,frag:I,details:ne,samples:Q.samples};n.trigger(y.FRAG_PARSING_METADATA,ce)}if(ne&&Z){const ce={id:t,frag:I,details:ne,samples:Z.samples};n.trigger(y.FRAG_PARSING_USERDATA,ce)}}logMuxedErr(e){this.warn(`${q(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,l){if(this.state!==Kt.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));const{audio:g,video:T,audiovideo:I}=t;if(g){const U=e.audioCodec;let j=Yt(g.codec,U);j==="mp4a"&&(j="mp4a.40.5");const Z=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){j&&(j.indexOf("mp4a.40.5")!==-1?j="mp4a.40.2":j="mp4a.40.5");const Q=g.metadata;Q&&"channelCount"in Q&&(Q.channelCount||1)!==1&&Z.indexOf("firefox")===-1&&(j="mp4a.40.5")}j&&j.indexOf("mp4a.40.5")!==-1&&Z.indexOf("android")!==-1&&g.container!=="audio/mpeg"&&(j="mp4a.40.2",this.log(`Android: force audio codec to ${j}`)),U&&U!==j&&this.log(`Swapping manifest audio codec "${U}" for "${j}"`),g.levelCodec=j,g.id=A.MAIN,this.log(`Init audio buffer, container:${g.container}, codecs[selected/level/parsed]=[${j||""}/${U||""}/${g.codec}]`),delete t.audiovideo}if(T){T.levelCodec=e.videoCodec,T.id=A.MAIN;const U=T.codec;if((U==null?void 0:U.length)===4)switch(U){case"hvc1":case"hev1":T.codec="hvc1.1.6.L120.90";break;case"av01":T.codec="av01.0.04M.08";break;case"avc1":T.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${T.container}, codecs[level/parsed]=[${e.videoCodec||""}/${U}]${T.codec!==U?" parsed-corrected="+T.codec:""}${T.supplemental?" supplemental="+T.supplemental:""}`),delete t.audiovideo}I&&(this.log(`Init audiovideo buffer, container:${I.container}, codecs[level/parsed]=[${e.codecs}/${I.codec}]`),delete t.video,delete t.audio);const k=Object.keys(t);if(k.length){if(this.hls.trigger(y.BUFFER_CODECS,t),!this.hls)return;k.forEach(U=>{const Z=t[U].initSegment;Z!=null&&Z.byteLength&&this.hls.trigger(y.BUFFER_APPENDING,{type:U,data:Z,frag:n,part:null,chunkMeta:l,parent:n.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,A.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,n=e==null?void 0:e[t];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=Kt.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(Dr.isBuffered(e,n)?t=this.getAppendedFrag(n):Dr.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const l=this.fragPlaying,g=t.level;(!l||t.sn!==l.sn||l.level!==g)&&(this.fragPlaying=t,this.hls.trigger(y.FRAG_CHANGED,{frag:t}),(!l||l.level!==g)&&this.hls.trigger(y.LEVEL_SWITCHED,{level:g}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;return te(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(te(t)){const n=this.getLevelDetails(),l=this.currentFrag||(n?mr(null,n.fragments,t):null);if(l){const g=l.programDateTime;if(g!==null){const T=g+(t-l.start)*1e3;return new Date(T)}}}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 Ch extends m{constructor(e,t){super("key-loader",t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyIdToKeyInfo){const l=this.keyIdToKeyInfo[n].loader;if(l){var t;if(e&&e!==((t=l.context)==null?void 0:t.frag.type))return;l.abort()}}}detach(){for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=W.KEY_LOAD_ERROR,n,l,g){return new _n({type:D.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:g,error:n,networkDetails:l})}loadClear(e,t,n){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let l=0,g=t.length;l<g;l++){const T=t[l];if(e.cc<=T.cc&&(!q(e)||!q(T)||e.sn<T.sn)||!n&&l==g-1)return this.emeController.selectKeySystemFormat(T).then(I=>{if(!this.emeController)return;T.setKeyFormat(I);const k=Wn(I);if(k)return this.emeController.getKeySystemAccess([k])})}if(this.config.requireKeySystemAccessOnStart){const l=Ar(this.config);if(l.length)return this.emeController.getKeySystemAccess(l)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,l;t&&e.setKeyFormat(t);const g=e.decryptdata;if(!g){const j=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,W.KEY_LOAD_ERROR,j))}const T=g.uri;if(!T)return Promise.reject(this.createKeyLoadError(e,W.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${T}"`)));const I=Ns(g);let k=this.keyIdToKeyInfo[I];if((n=k)!=null&&n.decryptdata.key)return g.key=k.decryptdata.key,Promise.resolve({frag:e,keyInfo:k});if((l=k)!=null&&l.keyLoadPromise){var U;switch((U=k.mediaKeySessionContext)==null?void 0:U.keyStatus){case"usable":case"usable-in-future":return k.keyLoadPromise.then(Z=>{const{keyInfo:Q}=Z;return g.key=Q.decryptdata.key,{frag:e,keyInfo:Q}})}}switch(this.log(`Loading key ${N(g.keyId||[])} from ${e.type} ${e.level}`),k=this.keyIdToKeyInfo[I]={decryptdata:g,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},g.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return g.keyFormat==="identity"?this.loadKeyHTTP(k,e):this.loadKeyEME(k,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(k,e);default:return Promise.reject(this.createKeyLoadError(e,W.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${g.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const l=this.emeController.loadKey(n);return(e.keyLoadPromise=l.then(g=>(e.mediaKeySessionContext=g,n))).catch(g=>{throw e.keyLoadPromise=null,g.data&&(g.data.frag=t),g})}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,l=n.loader,g=new l(n);return t.keyLoader=e.loader=g,e.keyLoadPromise=new Promise((T,I)=>{const k={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},U=n.keyLoadPolicy.default,j={loadPolicy:U,timeout:U.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},Z={onSuccess:(Q,ee,ne,de)=>{const{frag:ce,keyInfo:Ee,url:ke}=ne,Me=Ns(Ee.decryptdata)||ke;if(!ce.decryptdata||Ee!==this.keyIdToKeyInfo[Me])return I(this.createKeyLoadError(ce,W.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),de));Ee.decryptdata.key=ce.decryptdata.key=new Uint8Array(Q.data),ce.keyLoader=null,Ee.loader=null,T({frag:ce,keyInfo:Ee})},onError:(Q,ee,ne,de)=>{this.resetLoader(ee),I(this.createKeyLoadError(t,W.KEY_LOAD_ERROR,new Error(`HTTP Error ${Q.code} loading key ${Q.text}`),ne,i({url:k.url,data:void 0},Q)))},onTimeout:(Q,ee,ne)=>{this.resetLoader(ee),I(this.createKeyLoadError(t,W.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),ne))},onAbort:(Q,ee,ne)=>{this.resetLoader(ee),I(this.createKeyLoadError(t,W.INTERNAL_ABORTED,new Error("key loading aborted"),ne))}};g.load(k,j,Z)})}resetLoader(e){const{frag:t,keyInfo:n,url:l}=e,g=n.loader;t.keyLoader===g&&(t.keyLoader=null,n.loader=null);const T=Ns(n.decryptdata)||l;delete this.keyIdToKeyInfo[T],g&&g.destroy()}}function Ns(b){const e=b.keyId;return e?N(e):b.uri}function ol(b){const{type:e}=b;switch(e){case L.AUDIO_TRACK:return A.AUDIO;case L.SUBTITLE_TRACK:return A.SUBTITLE;default:return A.MAIN}}function Bs(b,e){let t=b.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class Ih{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(y.MANIFEST_LOADING,this.onManifestLoading,this),e.on(y.LEVEL_LOADING,this.onLevelLoading,this),e.on(y.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(y.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(y.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(y.MANIFEST_LOADING,this.onManifestLoading,this),e.off(y.LEVEL_LOADING,this.onLevelLoading,this),e.off(y.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(y.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(y.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,l=t.loader,g=n||l,T=new g(t);return this.loaders[e.type]=T,T}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:L.MANIFEST,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:n,level:l,pathwayId:g,url:T,deliveryDirectives:I,levelInfo:k}=t;this.load({id:n,level:l,pathwayId:g,responseType:"text",type:L.LEVEL,url:T,deliveryDirectives:I,levelOrTrack:k})}onAudioTrackLoading(e,t){const{id:n,groupId:l,url:g,deliveryDirectives:T,track:I}=t;this.load({id:n,groupId:l,level:null,responseType:"text",type:L.AUDIO_TRACK,url:g,deliveryDirectives:T,levelOrTrack:I})}onSubtitleTrackLoading(e,t){const{id:n,groupId:l,url:g,deliveryDirectives:T,track:I}=t;this.load({id:n,groupId:l,level:null,responseType:"text",type:L.SUBTITLE_TRACK,url:g,deliveryDirectives:T,levelOrTrack:I})}onLevelsUpdated(e,t){const n=this.loaders[L.LEVEL];if(n){const l=n.context;l&&!t.levels.some(g=>g===l.levelOrTrack)&&(n.abort(),delete this.loaders[L.LEVEL])}}load(e){var t;const n=this.hls.config;let l=this.getInternalLoader(e);if(l){const U=this.hls.logger,j=l.context;if(j&&j.levelOrTrack===e.levelOrTrack&&(j.url===e.url||j.deliveryDirectives&&!e.deliveryDirectives)){j.url===e.url?U.log(`[playlist-loader]: ignore ${e.url} ongoing request`):U.log(`[playlist-loader]: ignore ${e.url} in favor of ${j.url}`);return}U.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),l.abort()}let g;if(e.type===L.MANIFEST?g=n.manifestLoadPolicy.default:g=u({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),l=this.createInternalLoader(e),te((t=e.deliveryDirectives)==null?void 0:t.part)){let U;if(e.type===L.LEVEL&&e.level!==null?U=this.hls.levels[e.level].details:e.type===L.AUDIO_TRACK&&e.id!==null?U=this.hls.audioTracks[e.id].details:e.type===L.SUBTITLE_TRACK&&e.id!==null&&(U=this.hls.subtitleTracks[e.id].details),U){const j=U.partTarget,Z=U.targetduration;if(j&&Z){const Q=Math.max(j*3,Z*.8)*1e3;g=u({},g,{maxTimeToFirstByteMs:Math.min(Q,g.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(Q,g.maxTimeToFirstByteMs)})}}}const T=g.errorRetry||g.timeoutRetry||{},I={loadPolicy:g,timeout:g.maxLoadTimeMs,maxRetry:T.maxNumRetry||0,retryDelay:T.retryDelayMs||0,maxRetryDelay:T.maxRetryDelayMs||0},k={onSuccess:(U,j,Z,Q)=>{const ee=this.getInternalLoader(Z);this.resetInternalLoader(Z.type);const ne=U.data;if(ne.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(U,Z,new Error("no EXTM3U delimiter"),Q||null,j);return}j.parsing.start=performance.now(),li.isMediaPlaylist(ne)||Z.type!==L.MANIFEST?this.handleTrackOrLevelPlaylist(U,j,Z,Q||null,ee):this.handleMasterPlaylist(U,j,Z,Q)},onError:(U,j,Z,Q)=>{this.handleNetworkError(j,Z,!1,U,Q)},onTimeout:(U,j,Z)=>{this.handleNetworkError(j,Z,!0,void 0,U)}};l.load(e,I,k)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:n}=this.hls;(e||n)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,n,l){const g=this.hls,T=e.data,I=Bs(e,n),k=li.parseMasterPlaylist(T,I);if(k.playlistParsingError){this.handleManifestParsingError(e,n,k.playlistParsingError,l,t);return}const{contentSteering:U,levels:j,sessionData:Z,sessionKeys:Q,startTimeOffset:ee,variableList:ne}=k;this.variableList=ne;const{AUDIO:de=[],SUBTITLES:ce,"CLOSED-CAPTIONS":Ee}=li.parseMasterPlaylistMedia(T,I,k);de.length&&!de.some(Me=>!Me.url)&&j[0].audioCodec&&!j[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),de.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Vr({}),bitrate:0,url:""})),g.trigger(y.MANIFEST_LOADED,{levels:j,audioTracks:de,subtitles:ce,captions:Ee,contentSteering:U,url:I,stats:t,networkDetails:l,sessionData:Z,sessionKeys:Q,startTimeOffset:ee,variableList:ne})}handleTrackOrLevelPlaylist(e,t,n,l,g){const T=this.hls,{id:I,level:k,type:U}=n,j=Bs(e,n),Z=te(k)?k:te(I)?I:0,Q=ol(n),ee=li.parseLevelPlaylist(e.data,j,Z,Q,0,this.variableList);if(U===L.MANIFEST){const ne={attrs:new Vr({}),bitrate:0,details:ee,name:"",url:j};ee.requestScheduled=t.loading.start+ai(ee,0),T.trigger(y.MANIFEST_LOADED,{levels:[ne],audioTracks:[],url:j,stats:t,networkDetails:l,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=ee,this.handlePlaylistLoaded(ee,e,t,n,l,g)}handleManifestParsingError(e,t,n,l,g){this.hls.trigger(y.ERROR,{type:D.NETWORK_ERROR,details:W.MANIFEST_PARSING_ERROR,fatal:t.type===L.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:l,stats:g})}handleNetworkError(e,t,n=!1,l,g){let T=`A network ${n?"timeout":"error"+(l?" (status "+l.code+")":"")} occurred while loading ${e.type}`;e.type===L.LEVEL?T+=`: ${e.level} id: ${e.id}`:(e.type===L.AUDIO_TRACK||e.type===L.SUBTITLE_TRACK)&&(T+=` id: ${e.id} group-id: "${e.groupId}"`);const I=new Error(T);this.hls.logger.warn(`[playlist-loader]: ${T}`);let k=W.UNKNOWN,U=!1;const j=this.getInternalLoader(e);switch(e.type){case L.MANIFEST:k=n?W.MANIFEST_LOAD_TIMEOUT:W.MANIFEST_LOAD_ERROR,U=!0;break;case L.LEVEL:k=n?W.LEVEL_LOAD_TIMEOUT:W.LEVEL_LOAD_ERROR,U=!1;break;case L.AUDIO_TRACK:k=n?W.AUDIO_TRACK_LOAD_TIMEOUT:W.AUDIO_TRACK_LOAD_ERROR,U=!1;break;case L.SUBTITLE_TRACK:k=n?W.SUBTITLE_TRACK_LOAD_TIMEOUT:W.SUBTITLE_LOAD_ERROR,U=!1;break}j&&this.resetInternalLoader(e.type);const Z={type:D.NETWORK_ERROR,details:k,fatal:U,url:e.url,loader:j,context:e,error:I,networkDetails:t,stats:g};if(l){const Q=(t==null?void 0:t.url)||e.url;Z.response=i({url:Q,data:void 0},l)}this.hls.trigger(y.ERROR,Z)}handlePlaylistLoaded(e,t,n,l,g,T){const I=this.hls,{type:k,level:U,id:j,groupId:Z,deliveryDirectives:Q}=l,ee=Bs(t,l),ne=ol(l),de=typeof l.level=="number"&&ne===A.MAIN?U:void 0;if(!e.fragments.length){const Ee=e.playlistParsingError=new Error("No Segments found in Playlist");I.trigger(y.ERROR,{type:D.NETWORK_ERROR,details:W.LEVEL_EMPTY_ERROR,fatal:!1,url:ee,error:Ee,reason:Ee.message,response:t,context:l,level:de,parent:ne,networkDetails:g,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const ce=e.playlistParsingError;if(ce){if(this.hls.logger.warn(`${ce} ${e.url}`),!I.config.ignorePlaylistParsingErrors){I.trigger(y.ERROR,{type:D.NETWORK_ERROR,details:W.LEVEL_PARSING_ERROR,fatal:!1,url:ee,error:ce,reason:ce.message,response:t,context:l,level:de,parent:ne,networkDetails:g,stats:n});return}e.playlistParsingError=null}switch(e.live&&T&&(T.getCacheAge&&(e.ageHeader=T.getCacheAge()||0),(!T.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),k){case L.MANIFEST:case L.LEVEL:I.trigger(y.LEVEL_LOADED,{details:e,levelInfo:l.levelOrTrack||I.levels[0],level:de||0,id:j||0,stats:n,networkDetails:g,deliveryDirectives:Q,withoutMultiVariant:k===L.MANIFEST});break;case L.AUDIO_TRACK:I.trigger(y.AUDIO_TRACK_LOADED,{details:e,track:l.levelOrTrack,id:j||0,groupId:Z||"",stats:n,networkDetails:g,deliveryDirectives:Q});break;case L.SUBTITLE_TRACK:I.trigger(y.SUBTITLE_TRACK_LOADED,{details:e,track:l.levelOrTrack,id:j||0,groupId:Z||"",stats:n,networkDetails:g,deliveryDirectives:Q});break}}}class Yi{static get version(){return ya}static isMSESupported(){return sl()}static isSupported(){return Dh()}static getMediaSource(){return w()}static get Events(){return y}static get MetadataSchema(){return di}static get ErrorTypes(){return D}static get ErrorDetails(){return W}static get DefaultConfig(){return Yi.defaultConfig?Yi.defaultConfig:_h}static set DefaultConfig(e){Yi.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new Ja,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const t=this.logger=E(e.debug||!1,"Hls instance",e.assetPlayerId),n=this.config=ph(Yi.DefaultConfig,e,t);this.userConfig=e,n.progressive&&gh(n,t);const{abrController:l,bufferController:g,capLevelController:T,errorController:I,fpsController:k}=n,U=new I(this),j=this.abrController=new l(this),Z=new un(this),Q=n.interstitialsController,ee=Q?this.interstitialsController=new Q(this,Yi):null,ne=this.bufferController=new g(this,Z),de=this.capLevelController=new T(this),ce=new k(this),Ee=new Ih(this),ke=n.contentSteeringController,Me=ke?new ke(this):null,Ye=this.levelController=new Sh(this,Me),lt=new Ah(this),Ct=new Ch(this.config,this.logger),rt=this.streamController=new wh(this,Z,Ct),vt=this.gapController=new xh(this,Z);de.setStreamController(rt),ce.setStreamController(rt);const xt=[Ee,Ye,rt];ee&&xt.splice(1,0,ee),Me&&xt.splice(1,0,Me),this.networkControllers=xt;const at=[j,ne,vt,de,ce,lt,Z];this.audioTrackController=this.createController(n.audioTrackController,xt);const Gt=n.audioStreamController;Gt&&xt.push(this.audioStreamController=new Gt(this,Z,Ct)),this.subtitleTrackController=this.createController(n.subtitleTrackController,xt);const dr=n.subtitleStreamController;dr&&xt.push(this.subtititleStreamController=new dr(this,Z,Ct)),this.createController(n.timelineController,at),Ct.emeController=this.emeController=this.createController(n.emeController,at),this.cmcdController=this.createController(n.cmcdController,at),this.latencyController=this.createController(bh,at),this.coreComponents=at,xt.push(U);const Lr=U.onErrorOut;typeof Lr=="function"&&this.on(y.ERROR,Lr,U),this.on(y.MANIFEST_LOADED,Ee.onManifestLoaded,Ee)}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,l){this._emitter.off(e,t,n,l)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const l=e===y.ERROR;this.trigger(y.ERROR,{type:D.OTHER_ERROR,details:W.INTERNAL_EXCEPTION,fatal:l,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(y.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const g=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(y.ERROR,{type:D.OTHER_ERROR,details:W.ATTACH_MEDIA_ERROR,fatal:!0,error:g});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,n=t?e.media:e,l=t?e:{media:n};this._media=n,this.trigger(y.MEDIA_ATTACHING,l)}detachMedia(){this.logger.log("detachMedia"),this.trigger(y.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(y.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,n=this._url,l=this._url=C.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${l}`),t&&n&&(n!==l||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(y.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(e,t),!(!this.started||!this.networkControllers));n++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){const e={[A.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[A.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[A.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=e==null?void 0:e.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=xc()),e}get levels(){const e=this.levelController.levels;return e||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){const{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){Pe(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 l=0;l<n;l++)if(e[l].maxBitrate>=t)return l;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let l;if(t===-1&&e!=null&&e.length?l=e.length-1:l=t,n)for(let g=l;g--;){const T=e[g].attrs["HDCP-LEVEL"];if(T&&T<=n)return g}return l}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return((t=this.audioTrackController)==null?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return((t=this.subtitleTrackController)==null?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){var e;return((e=this.interstitialsController)==null?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){const n=Ne(t);return _e(e,n,navigator.mediaCapabilities)}}Yi.defaultConfig=void 0},16722:function(qt,$e,ae){"use strict";ae.d($e,{Z:function(){return A}});const te=s=>typeof s=="object"&&s!=null&&s.nodeType===1,re=(s,x)=>(!x||s!=="hidden")&&s!=="visible"&&s!=="clip",X=(s,x)=>{if(s.clientHeight<s.scrollHeight||s.clientWidth<s.scrollWidth){const c=getComputedStyle(s,null);return re(c.overflowY,x)||re(c.overflowX,x)||(u=>{const f=(i=>{if(!i.ownerDocument||!i.ownerDocument.defaultView)return null;try{return i.ownerDocument.defaultView.frameElement}catch(o){return null}})(u);return!!f&&(f.clientHeight<u.scrollHeight||f.clientWidth<u.scrollWidth)})(s)}return!1},D=(s,x,c,u,f,i,o,d)=>i<s&&o>x||i>s&&o<x?0:i<=s&&d<=c||o>=x&&d>=c?i-s-u:o>x&&d<c||i<s&&d>c?o-x+f:0,W=s=>{const x=s.parentElement;return x==null?s.getRootNode().host||null:x},y=(s,x)=>{var c,u,f,i;if(typeof document=="undefined")return[];const{scrollMode:o,block:d,inline:m,boundary:_,skipOverflowHiddenElements:h}=x,v=typeof _=="function"?_:se=>se!==_;if(!te(s))throw new TypeError("Invalid target");const r=document.scrollingElement||document.documentElement,a=[];let p=s;for(;te(p)&&v(p);){if(p=W(p),p===r){a.push(p);break}p!=null&&p===document.body&&X(p)&&!X(document.documentElement)||p!=null&&X(p,h)&&a.push(p)}const E=(u=(c=window.visualViewport)==null?void 0:c.width)!=null?u:innerWidth,S=(i=(f=window.visualViewport)==null?void 0:f.height)!=null?i:innerHeight,{scrollX:w,scrollY:R}=window,{height:O,width:z,top:N,right:P,bottom:F,left:K}=s.getBoundingClientRect(),{top:B,right:V,bottom:C,left:M}=(se=>{const ue=window.getComputedStyle(se);return{top:parseFloat(ue.scrollMarginTop)||0,right:parseFloat(ue.scrollMarginRight)||0,bottom:parseFloat(ue.scrollMarginBottom)||0,left:parseFloat(ue.scrollMarginLeft)||0}})(s);let H=d==="start"||d==="nearest"?N-B:d==="end"?F+C:N+O/2-B+C,$=m==="center"?K+z/2-M+V:m==="end"?P+V:K-M;const q=[];for(let se=0;se<a.length;se++){const ue=a[se],{height:pe,width:xe,top:De,right:Ue,bottom:Ge,left:Ae}=ue.getBoundingClientRect();if(o==="if-needed"&&N>=0&&K>=0&&F<=S&&P<=E&&(ue===r&&!X(ue)||N>=De&&F<=Ge&&K>=Ae&&P<=Ue))return q;const We=getComputedStyle(ue),we=parseInt(We.borderLeftWidth,10),Se=parseInt(We.borderTopWidth,10),ge=parseInt(We.borderRightWidth,10),Re=parseInt(We.borderBottomWidth,10);let ve=0,Le=0;const Fe="offsetWidth"in ue?ue.offsetWidth-ue.clientWidth-we-ge:0,me="offsetHeight"in ue?ue.offsetHeight-ue.clientHeight-Se-Re:0,oe="offsetWidth"in ue?ue.offsetWidth===0?0:xe/ue.offsetWidth:0,ie="offsetHeight"in ue?ue.offsetHeight===0?0:pe/ue.offsetHeight:0;if(r===ue)ve=d==="start"?H:d==="end"?H-S:d==="nearest"?D(R,R+S,S,Se,Re,R+H,R+H+O,O):H-S/2,Le=m==="start"?$:m==="center"?$-E/2:m==="end"?$-E:D(w,w+E,E,we,ge,w+$,w+$+z,z),ve=Math.max(0,ve+R),Le=Math.max(0,Le+w);else{ve=d==="start"?H-De-Se:d==="end"?H-Ge+Re+me:d==="nearest"?D(De,Ge,pe,Se,Re+me,H,H+O,O):H-(De+pe/2)+me/2,Le=m==="start"?$-Ae-we:m==="center"?$-(Ae+xe/2)+Fe/2:m==="end"?$-Ue+ge+Fe:D(Ae,Ue,xe,we,ge+Fe,$,$+z,z);const{scrollLeft:fe,scrollTop:ye}=ue;ve=ie===0?0:Math.max(0,Math.min(ye+ve/ie,ue.scrollHeight-pe/ie+me)),Le=oe===0?0:Math.max(0,Math.min(fe+Le/oe,ue.scrollWidth-xe/oe+Fe)),H+=ye-ve,$+=fe-Le}q.push({el:ue,top:ve,left:Le})}return q},L=s=>s===!1?{block:"end",inline:"nearest"}:(x=>x===Object(x)&&Object.keys(x).length!==0)(s)?s:{block:"start",inline:"nearest"};function A(s,x){if(!s.isConnected||!(f=>{let i=f;for(;i&&i.parentNode;){if(i.parentNode===document)return!0;i=i.parentNode instanceof ShadowRoot?i.parentNode.host:i.parentNode}return!1})(s))return;const c=(f=>{const i=window.getComputedStyle(f);return{top:parseFloat(i.scrollMarginTop)||0,right:parseFloat(i.scrollMarginRight)||0,bottom:parseFloat(i.scrollMarginBottom)||0,left:parseFloat(i.scrollMarginLeft)||0}})(s);if((f=>typeof f=="object"&&typeof f.behavior=="function")(x))return x.behavior(y(s,x));const u=typeof x=="boolean"||x==null?void 0:x.behavior;for(const{el:f,top:i,left:o}of y(s,L(x))){const d=i-c.top+c.bottom,m=o-c.left+c.right;f.scroll({top:d,left:m,behavior:u})}}}}]);
|
|
}()); |