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

1 line
1.2 MiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(self.webpackChunk=self.webpackChunk||[]).push([[2303],{95869:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(54476),i=n(59301),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M688 264c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48zm-8 136H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM480 544H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm-48 308H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h264c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm356.8-74.4c29-26.3 47.2-64.3 47.2-106.6 0-79.5-64.5-144-144-144s-144 64.5-144 144c0 42.3 18.2 80.3 47.2 106.6-57 32.5-96.2 92.7-99.2 162.1-.2 4.5 3.5 8.3 8 8.3h48.1c4.2 0 7.7-3.3 8-7.6C564 871.2 621.7 816 692 816s128 55.2 131.9 124.4c.2 4.2 3.7 7.6 8 7.6H880c4.6 0 8.2-3.8 8-8.3-2.9-69.5-42.2-129.6-99.2-162.1zM692 591c44.2 0 80 35.8 80 80s-35.8 80-80 80-80-35.8-80-80 35.8-80 80-80z"}}]},name:"solution",theme:"outlined"},A=n(7657),a=function(t,e){return i.createElement(A.Z,(0,r.Z)({},t,{ref:e,icon:s}))};var o=i.forwardRef(a)},65030:function(t,e,n){"use strict";n.d(e,{Z:function(){return Z}});var r=n(33885),i=n(42978),s=n(75931),A=n(43403),a=n(92310),o=n.n(a),l=n(29301),u=n(76846),c=n(96452),h=n(6089),d=n(80402),f=n(34280),p=n(49658),g=n(59301),m=n(54476),_=n(77900),w=n(8654);function y(t){var e=t.prefixCls,n=t.align,r=t.arrow,i=t.arrowPos,s=r||{},A=s.className,a=s.content,l=i.x,u=void 0===l?0:l,c=i.y,h=void 0===c?0:c,d=g.useRef();if(!n||!n.points)return null;var f={position:"absolute"};if(!1!==n.autoArrow){var p=n.points[0],m=n.points[1],_=p[0],w=p[1],y=m[0],v=m[1];_!==y&&["t","b"].includes(_)?"t"===_?f.top=0:f.bottom=0:f.top=h,w!==v&&["l","r"].includes(w)?"l"===w?f.left=0:f.right=0:f.left=u}return g.createElement("div",{ref:d,className:o()("".concat(e,"-arrow"),A),style:f},a)}function v(t){var e=t.prefixCls,n=t.open,r=t.zIndex,i=t.mask,s=t.motion;return i?g.createElement(_.default,(0,m.Z)({},s,{motionAppear:!0,visible:n,removeOnLeave:!0}),(function(t){var n=t.className;return g.createElement("div",{style:{zIndex:r},className:o()("".concat(e,"-mask"),n)})})):null}var B=g.memo((function(t){return t.children}),(function(t,e){return e.cache}));var b=g.forwardRef((function(t,e){var n=t.popup,s=t.className,A=t.prefixCls,a=t.style,u=t.target,c=t.onVisibleChanged,h=t.open,d=t.keepDom,p=t.fresh,b=t.onClick,E=t.mask,C=t.arrow,k=t.arrowPos,F=t.align,T=t.motion,S=t.maskMotion,x=t.forceRender,I=t.getPopupContainer,D=t.autoDestroy,U=t.portal,L=t.zIndex,R=t.onMouseEnter,Q=t.onMouseLeave,O=t.onPointerEnter,P=t.onPointerDownCapture,M=t.ready,N=t.offsetX,H=t.offsetY,K=t.offsetR,$=t.offsetB,G=t.onAlign,V=t.onPrepare,j=t.stretch,Z=t.targetWidth,W=t.targetHeight,z="function"==typeof n?n():n,Y=h||d,X=(null==I?void 0:I.length)>0,q=g.useState(!I||!X),J=(0,i.Z)(q,2),tt=J[0],et=J[1];if((0,f.Z)((function(){!tt&&X&&u&&et(!0)}),[tt,X,u]),!tt)return null;var nt="auto",rt={left:"-1000vw",top:"-1000vh",right:nt,bottom:nt};if(M||!h){var it,st=F.points,At=F.dynamicInset||(null===(it=F._experimental)||void 0===it?void 0:it.dynamicInset),at=At&&"r"===st[0][1],ot=At&&"b"===st[0][0];at?(rt.right=K,rt.left=nt):(rt.left=N,rt.right=nt),ot?(rt.bottom=$,rt.top=nt):(rt.top=H,rt.bottom=nt)}var lt={};return j&&(j.includes("height")&&W?lt.height=W:j.includes("minHeight")&&W&&(lt.minHeight=W),j.includes("width")&&Z?lt.width=Z:j.includes("minWidth")&&Z&&(lt.minWidth=Z)),h||(lt.pointerEvents="none"),g.createElement(U,{open:x||Y,getContainer:I&&function(){return I(u)},autoDestroy:D},g.createElement(v,{prefixCls:A,open:h,zIndex:L,mask:E,motion:S}),g.createElement(l.Z,{onResize:G,disabled:!h},(function(t){return g.createElement(_.default,(0,m.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:x,leavedClassName:"".concat(A,"-hidden")},T,{onAppearPrepare:V,onEnterPrepare:V,visible:h,onVisibleChanged:function(t){var e;null==T||null===(e=T.onVisibleChanged)||void 0===e||e.call(T,t),c(t)}}),(function(n,i){var l=n.className,u=n.style,c=o()(A,l,s);return g.createElement("div",{ref:(0,w.sQ)(t,e,i),className:c,style:(0,r.Z)((0,r.Z)((0,r.Z)((0,r.Z)({"--arrow-x":"".concat(k.x||0,"px"),"--arrow-y":"".concat(k.y||0,"px")},rt),lt),u),{},{boxSizing:"border-box",zIndex:L},a),onMouseEnter:R,onMouseLeave:Q,onPointerEnter:O,onClick:b,onPointerDownCapture:P},C&&g.createElement(y,{prefixCls:A,arrow:C,arrowPos:k,align:F}),g.createElement(B,{cache:!h&&!p},z))}))})))}));var E=g.forwardRef((function(t,e){var n=t.children,r=t.getTriggerDOMNode,i=(0,w.Yr)(n),s=g.useCallback((function(t){(0,w.mH)(e,r?r(t):t)}),[r]),A=(0,w.x1)(s,(0,w.C4)(n));return i?g.cloneElement(n,{ref:A}):n})),C=g.createContext(null);function k(t){return t?Array.isArray(t)?t:[t]:[]}function F(t,e,n,r){return g.useMemo((function(){var i=k(null!=n?n:e),s=k(null!=r?r:e),A=new Set(i),a=new Set(s);return t&&(A.has("hover")&&(A.delete("hover"),A.add("click")),a.has("hover")&&(a.delete("hover"),a.add("click"))),[A,a]}),[t,e,n,r])}var T=n(29194);function S(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?t[0]===e[0]:t[0]===e[0]&&t[1]===e[1]}function x(t,e,n,r){for(var i=n.points,s=Object.keys(t),A=0;A<s.length;A+=1){var a,o=s[A];if(S(null===(a=t[o])||void 0===a?void 0:a.points,i,r))return"".concat(e,"-placement-").concat(o)}return""}function I(t,e,n,r){return e||(n?{motionName:"".concat(t,"-").concat(n)}:r?{motionName:r}:null)}function D(t){return t.ownerDocument.defaultView}function U(t){for(var e=[],n=null==t?void 0:t.parentElement,r=["hidden","scroll","clip","auto"];n;){var i=D(n).getComputedStyle(n);[i.overflowX,i.overflowY,i.overflow].some((function(t){return r.includes(t)}))&&e.push(n),n=n.parentElement}return e}function L(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isNaN(t)?e:t}function R(t){return L(parseFloat(t),0)}function Q(t,e){var n=(0,r.Z)({},t);return(e||[]).forEach((function(t){if(!(t instanceof HTMLBodyElement||t instanceof HTMLHtmlElement)){var e=D(t).getComputedStyle(t),r=e.overflow,i=e.overflowClipMargin,s=e.borderTopWidth,A=e.borderBottomWidth,a=e.borderLeftWidth,o=e.borderRightWidth,l=t.getBoundingClientRect(),u=t.offsetHeight,c=t.clientHeight,h=t.offsetWidth,d=t.clientWidth,f=R(s),p=R(A),g=R(a),m=R(o),_=L(Math.round(l.width/h*1e3)/1e3),w=L(Math.round(l.height/u*1e3)/1e3),y=(h-d-g-m)*_,v=(u-c-f-p)*w,B=f*w,b=p*w,E=g*_,C=m*_,k=0,F=0;if("clip"===r){var T=R(i);k=T*_,F=T*w}var S=l.x+E-k,x=l.y+B-F,I=S+l.width+2*k-E-C-y,U=x+l.height+2*F-B-b-v;n.left=Math.max(n.left,S),n.top=Math.max(n.top,x),n.right=Math.min(n.right,I),n.bottom=Math.min(n.bottom,U)}})),n}function O(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n="".concat(e),r=n.match(/^(.*)\%$/);return r?t*(parseFloat(r[1])/100):parseFloat(n)}function P(t,e){var n=e||[],r=(0,i.Z)(n,2),s=r[0],A=r[1];return[O(t.width,s),O(t.height,A)]}function M(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return[t[0],t[1]]}function N(t,e){var n,r=e[0],i=e[1];return n="t"===r?t.y:"b"===r?t.y+t.height:t.y+t.height/2,{x:"l"===i?t.x:"r"===i?t.x+t.width:t.x+t.width/2,y:n}}function H(t,e){var n={t:"b",b:"t",l:"r",r:"l"};return t.map((function(t,r){return r===e?n[t]||"c":t})).join("")}function K(t,e,n,s,A,a,o){var l=g.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:A[s]||{}}),c=(0,i.Z)(l,2),d=c[0],p=c[1],m=g.useRef(0),_=g.useMemo((function(){return e?U(e):[]}),[e]),w=g.useRef({});t||(w.current={});var y=(0,h.Z)((function(){if(e&&n&&t){var l,c,h,d,f,g=e,m=g.ownerDocument,y=D(g),v=y.getComputedStyle(g).position,B=g.style.left,b=g.style.top,E=g.style.right,C=g.style.bottom,k=g.style.overflow,F=(0,r.Z)((0,r.Z)({},A[s]),a),S=m.createElement("div");if(null===(l=g.parentElement)||void 0===l||l.appendChild(S),S.style.left="".concat(g.offsetLeft,"px"),S.style.top="".concat(g.offsetTop,"px"),S.style.position=v,S.style.height="".concat(g.offsetHeight,"px"),S.style.width="".concat(g.offsetWidth,"px"),g.style.left="0",g.style.top="0",g.style.right="auto",g.style.bottom="auto",g.style.overflow="hidden",Array.isArray(n))f={x:n[0],y:n[1],width:0,height:0};else{var x,I,U=n.getBoundingClientRect();U.x=null!==(x=U.x)&&void 0!==x?x:U.left,U.y=null!==(I=U.y)&&void 0!==I?I:U.top,f={x:U.x,y:U.y,width:U.width,height:U.height}}var R=g.getBoundingClientRect(),O=y.getComputedStyle(g),K=O.height,$=O.width;R.x=null!==(c=R.x)&&void 0!==c?c:R.left,R.y=null!==(h=R.y)&&void 0!==h?h:R.top;var G=m.documentElement,V=G.clientWidth,j=G.clientHeight,Z=G.scrollWidth,W=G.scrollHeight,z=G.scrollTop,Y=G.scrollLeft,X=R.height,q=R.width,J=f.height,tt=f.width,et={left:0,top:0,right:V,bottom:j},nt={left:-Y,top:-z,right:Z-Y,bottom:W-z},rt=F.htmlRegion,it="visible",st="visibleFirst";"scroll"!==rt&&rt!==st&&(rt=it);var At=rt===st,at=Q(nt,_),ot=Q(et,_),lt=rt===it?ot:at,ut=At?ot:lt;g.style.left="auto",g.style.top="auto",g.style.right="0",g.style.bottom="0";var ct=g.getBoundingClientRect();g.style.left=B,g.style.top=b,g.style.right=E,g.style.bottom=C,g.style.overflow=k,null===(d=g.parentElement)||void 0===d||d.removeChild(S);var ht=L(Math.round(q/parseFloat($)*1e3)/1e3),dt=L(Math.round(X/parseFloat(K)*1e3)/1e3);if(0===ht||0===dt||(0,u.Sh)(n)&&!(0,T.Z)(n))return;var ft=F.offset,pt=F.targetOffset,gt=P(R,ft),mt=(0,i.Z)(gt,2),_t=mt[0],wt=mt[1],yt=P(f,pt),vt=(0,i.Z)(yt,2),Bt=vt[0],bt=vt[1];f.x-=Bt,f.y-=bt;var Et=F.points||[],Ct=(0,i.Z)(Et,2),kt=Ct[0],Ft=M(Ct[1]),Tt=M(kt),St=N(f,Ft),xt=N(R,Tt),It=(0,r.Z)({},F),Dt=St.x-xt.x+_t,Ut=St.y-xt.y+wt;function ke(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:lt,r=R.x+t,i=R.y+e,s=r+q,A=i+X,a=Math.max(r,n.left),o=Math.max(i,n.top),l=Math.min(s,n.right),u=Math.min(A,n.bottom);return Math.max(0,(l-a)*(u-o))}var Lt,Rt,Qt,Ot,Pt=ke(Dt,Ut),Mt=ke(Dt,Ut,ot),Nt=N(f,["t","l"]),Ht=N(R,["t","l"]),Kt=N(f,["b","r"]),$t=N(R,["b","r"]),Gt=F.overflow||{},Vt=Gt.adjustX,jt=Gt.adjustY,Zt=Gt.shiftX,Wt=Gt.shiftY,zt=function(t){return"boolean"==typeof t?t:t>=0};function Fe(){Lt=R.y+Ut,Rt=Lt+X,Qt=R.x+Dt,Ot=Qt+q}Fe();var Yt=zt(jt),Xt=Tt[0]===Ft[0];if(Yt&&"t"===Tt[0]&&(Rt>ut.bottom||w.current.bt)){var qt=Ut;Xt?qt-=X-J:qt=Nt.y-$t.y-wt;var Jt=ke(Dt,qt),te=ke(Dt,qt,ot);Jt>Pt||Jt===Pt&&(!At||te>=Mt)?(w.current.bt=!0,Ut=qt,wt=-wt,It.points=[H(Tt,0),H(Ft,0)]):w.current.bt=!1}if(Yt&&"b"===Tt[0]&&(Lt<ut.top||w.current.tb)){var ee=Ut;Xt?ee+=X-J:ee=Kt.y-Ht.y-wt;var ne=ke(Dt,ee),re=ke(Dt,ee,ot);ne>Pt||ne===Pt&&(!At||re>=Mt)?(w.current.tb=!0,Ut=ee,wt=-wt,It.points=[H(Tt,0),H(Ft,0)]):w.current.tb=!1}var ie=zt(Vt),se=Tt[1]===Ft[1];if(ie&&"l"===Tt[1]&&(Ot>ut.right||w.current.rl)){var Ae=Dt;se?Ae-=q-tt:Ae=Nt.x-$t.x-_t;var ae=ke(Ae,Ut),oe=ke(Ae,Ut,ot);ae>Pt||ae===Pt&&(!At||oe>=Mt)?(w.current.rl=!0,Dt=Ae,_t=-_t,It.points=[H(Tt,1),H(Ft,1)]):w.current.rl=!1}if(ie&&"r"===Tt[1]&&(Qt<ut.left||w.current.lr)){var le=Dt;se?le+=q-tt:le=Kt.x-Ht.x-_t;var ue=ke(le,Ut),ce=ke(le,Ut,ot);ue>Pt||ue===Pt&&(!At||ce>=Mt)?(w.current.lr=!0,Dt=le,_t=-_t,It.points=[H(Tt,1),H(Ft,1)]):w.current.lr=!1}Fe();var he=!0===Zt?0:Zt;"number"==typeof he&&(Qt<ot.left&&(Dt-=Qt-ot.left-_t,f.x+tt<ot.left+he&&(Dt+=f.x-ot.left+tt-he)),Ot>ot.right&&(Dt-=Ot-ot.right-_t,f.x>ot.right-he&&(Dt+=f.x-ot.right+he)));var de=!0===Wt?0:Wt;"number"==typeof de&&(Lt<ot.top&&(Ut-=Lt-ot.top-wt,f.y+J<ot.top+de&&(Ut+=f.y-ot.top+J-de)),Rt>ot.bottom&&(Ut-=Rt-ot.bottom-wt,f.y>ot.bottom-de&&(Ut+=f.y-ot.bottom+de)));var fe=R.x+Dt,pe=fe+q,ge=R.y+Ut,me=ge+X,_e=f.x,we=_e+tt,ye=f.y,ve=ye+J,Be=(Math.max(fe,_e)+Math.min(pe,we))/2-fe,be=(Math.max(ge,ye)+Math.min(me,ve))/2-ge;null==o||o(e,It);var Ee=ct.right-R.x-(Dt+R.width),Ce=ct.bottom-R.y-(Ut+R.height);1===ht&&(Dt=Math.round(Dt),Ee=Math.round(Ee)),1===dt&&(Ut=Math.round(Ut),Ce=Math.round(Ce)),p({ready:!0,offsetX:Dt/ht,offsetY:Ut/dt,offsetR:Ee/ht,offsetB:Ce/dt,arrowX:Be/ht,arrowY:be/dt,scaleX:ht,scaleY:dt,align:It})}})),v=function(){p((function(t){return(0,r.Z)((0,r.Z)({},t),{},{ready:!1})}))};return(0,f.Z)(v,[s]),(0,f.Z)((function(){t||v()}),[t]),[d.ready,d.offsetX,d.offsetY,d.offsetR,d.offsetB,d.arrowX,d.arrowY,d.scaleX,d.scaleY,d.align,function(){m.current+=1;var t=m.current;Promise.resolve().then((function(){m.current===t&&y()}))}]}var $=n(94480);function G(t,e,n,r,i){(0,f.Z)((function(){if(t&&e&&n){var s=n,A=U(e),a=U(s),o=D(s),l=new Set([o].concat((0,$.Z)(A),(0,$.Z)(a)));function u(){r(),i()}return l.forEach((function(t){t.addEventListener("scroll",u,{passive:!0})})),o.addEventListener("resize",u,{passive:!0}),r(),function(){l.forEach((function(t){t.removeEventListener("scroll",u),o.removeEventListener("resize",u)}))}}}),[t,e,n])}n(48736);function V(t,e,n,r,i,s,A,a){var o=g.useRef(t);o.current=t;var l=g.useRef(!1);return g.useEffect((function(){if(e&&r&&(!i||s)){var t=function(){l.current=!1},u=function(t){var e;!o.current||A((null===(e=t.composedPath)||void 0===e||null===(e=e.call(t))||void 0===e?void 0:e[0])||t.target)||l.current||a(!1)},h=D(r);h.addEventListener("pointerdown",t,!0),h.addEventListener("mousedown",u,!0),h.addEventListener("contextmenu",u,!0);var d=(0,c.A)(n);return d&&(d.addEventListener("mousedown",u,!0),d.addEventListener("contextmenu",u,!0)),function(){h.removeEventListener("pointerdown",t,!0),h.removeEventListener("mousedown",u,!0),h.removeEventListener("contextmenu",u,!0),d&&(d.removeEventListener("mousedown",u,!0),d.removeEventListener("contextmenu",u,!0))}}}),[e,n,r,i,s]),function(){l.current=!0}}var j=["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"];var Z=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A.Z,e=g.forwardRef((function(e,n){var A=e.prefixCls,a=void 0===A?"rc-trigger-popup":A,m=e.children,_=e.action,w=void 0===_?"hover":_,y=e.showAction,v=e.hideAction,B=e.popupVisible,k=e.defaultPopupVisible,T=e.onPopupVisibleChange,S=e.afterPopupVisibleChange,D=e.mouseEnterDelay,U=e.mouseLeaveDelay,L=void 0===U?.1:U,R=e.focusDelay,Q=e.blurDelay,O=e.mask,P=e.maskClosable,M=void 0===P||P,N=e.getPopupContainer,H=e.forceRender,$=e.autoDestroy,Z=e.destroyPopupOnHide,W=e.popup,z=e.popupClassName,Y=e.popupStyle,X=e.popupPlacement,q=e.builtinPlacements,J=void 0===q?{}:q,tt=e.popupAlign,et=e.zIndex,nt=e.stretch,rt=e.getPopupClassNameFromAlign,it=e.fresh,st=e.alignPoint,At=e.onPopupClick,at=e.onPopupAlign,ot=e.arrow,lt=e.popupMotion,ut=e.maskMotion,ct=e.popupTransitionName,ht=e.popupAnimation,dt=e.maskTransitionName,ft=e.maskAnimation,pt=e.className,gt=e.getTriggerDOMNode,mt=(0,s.Z)(e,j),_t=$||Z||!1,wt=g.useState(!1),yt=(0,i.Z)(wt,2),vt=yt[0],Bt=yt[1];(0,f.Z)((function(){Bt((0,p.Z)())}),[]);var bt=g.useRef({}),Et=g.useContext(C),Ct=g.useMemo((function(){return{registerSubPopup:function(t,e){bt.current[t]=e,null==Et||Et.registerSubPopup(t,e)}}}),[Et]),kt=(0,d.Z)(),Ft=g.useState(null),Tt=(0,i.Z)(Ft,2),St=Tt[0],xt=Tt[1],It=g.useRef(null),Dt=(0,h.Z)((function(t){It.current=t,(0,u.Sh)(t)&&St!==t&&xt(t),null==Et||Et.registerSubPopup(kt,t)})),Ut=g.useState(null),Lt=(0,i.Z)(Ut,2),Rt=Lt[0],Qt=Lt[1],Ot=g.useRef(null),Pt=(0,h.Z)((function(t){(0,u.Sh)(t)&&Rt!==t&&(Qt(t),Ot.current=t)})),Mt=g.Children.only(m),Nt=(null==Mt?void 0:Mt.props)||{},Ht={},Kt=(0,h.Z)((function(t){var e,n,r=Rt;return(null==r?void 0:r.contains(t))||(null===(e=(0,c.A)(r))||void 0===e?void 0:e.host)===t||t===r||(null==St?void 0:St.contains(t))||(null===(n=(0,c.A)(St))||void 0===n?void 0:n.host)===t||t===St||Object.values(bt.current).some((function(e){return(null==e?void 0:e.contains(t))||t===e}))})),$t=I(a,lt,ht,ct),Gt=I(a,ut,ft,dt),Vt=g.useState(k||!1),jt=(0,i.Z)(Vt,2),Zt=jt[0],Wt=jt[1],zt=null!=B?B:Zt,Yt=(0,h.Z)((function(t){void 0===B&&Wt(t)}));(0,f.Z)((function(){Wt(B||!1)}),[B]);var Xt=g.useRef(zt);Xt.current=zt;var qt=g.useRef([]);qt.current=[];var Jt=(0,h.Z)((function(t){var e;Yt(t),(null!==(e=qt.current[qt.current.length-1])&&void 0!==e?e:zt)!==t&&(qt.current.push(t),null==T||T(t))})),te=g.useRef(),ee=function(){clearTimeout(te.current)},ne=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;ee(),0===e?Jt(t):te.current=setTimeout((function(){Jt(t)}),1e3*e)};g.useEffect((function(){return ee}),[]);var re=g.useState(!1),ie=(0,i.Z)(re,2),se=ie[0],Ae=ie[1];(0,f.Z)((function(t){t&&!zt||Ae(!0)}),[zt]);var ae=g.useState(null),oe=(0,i.Z)(ae,2),le=oe[0],ue=oe[1],ce=g.useState(null),he=(0,i.Z)(ce,2),de=he[0],fe=he[1],pe=function(t){fe([t.clientX,t.clientY])},ge=K(zt,St,st&&null!==de?de:Rt,X,J,tt,at),me=(0,i.Z)(ge,11),_e=me[0],we=me[1],ye=me[2],ve=me[3],Be=me[4],be=me[5],Ee=me[6],Ce=me[7],ke=me[8],Fe=me[9],Te=me[10],Se=F(vt,w,y,v),xe=(0,i.Z)(Se,2),Ie=xe[0],De=xe[1],Ue=Ie.has("click"),Le=De.has("click")||De.has("contextMenu"),Re=(0,h.Z)((function(){se||Te()}));G(zt,Rt,St,Re,(function(){Xt.current&&st&&Le&&ne(!1)})),(0,f.Z)((function(){Re()}),[de,X]),(0,f.Z)((function(){!zt||null!=J&&J[X]||Re()}),[JSON.stringify(tt)]);var Qe=g.useMemo((function(){var t=x(J,a,Fe,st);return o()(t,null==rt?void 0:rt(Fe))}),[Fe,rt,J,a,st]);g.useImperativeHandle(n,(function(){return{nativeElement:Ot.current,popupElement:It.current,forceAlign:Re}}));var Oe=g.useState(0),Pe=(0,i.Z)(Oe,2),Me=Pe[0],Ne=Pe[1],He=g.useState(0),Ke=(0,i.Z)(He,2),$e=Ke[0],Ge=Ke[1],Ve=function(){if(nt&&Rt){var t=Rt.getBoundingClientRect();Ne(t.width),Ge(t.height)}};function je(t,e,n,r){Ht[t]=function(i){var s;null==r||r(i),ne(e,n);for(var A=arguments.length,a=new Array(A>1?A-1:0),o=1;o<A;o++)a[o-1]=arguments[o];null===(s=Nt[t])||void 0===s||s.call.apply(s,[Nt,i].concat(a))}}(0,f.Z)((function(){le&&(Te(),le(),ue(null))}),[le]),(Ue||Le)&&(Ht.onClick=function(t){var e;Xt.current&&Le?ne(!1):!Xt.current&&Ue&&(pe(t),ne(!0));for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];null===(e=Nt.onClick)||void 0===e||e.call.apply(e,[Nt,t].concat(r))});var Ze,We,ze=V(zt,Le,Rt,St,O,M,Kt,ne),Ye=Ie.has("hover"),Xe=De.has("hover");Ye&&(je("onMouseEnter",!0,D,(function(t){pe(t)})),je("onPointerEnter",!0,D,(function(t){pe(t)})),Ze=function(t){(zt||se)&&null!=St&&St.contains(t.target)&&ne(!0,D)},st&&(Ht.onMouseMove=function(t){var e;null===(e=Nt.onMouseMove)||void 0===e||e.call(Nt,t)})),Xe&&(je("onMouseLeave",!1,L),je("onPointerLeave",!1,L),We=function(){ne(!1,L)}),Ie.has("focus")&&je("onFocus",!0,R),De.has("focus")&&je("onBlur",!1,Q),Ie.has("contextMenu")&&(Ht.onContextMenu=function(t){var e;Xt.current&&De.has("contextMenu")?ne(!1):(pe(t),ne(!0)),t.preventDefault();for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];null===(e=Nt.onContextMenu)||void 0===e||e.call.apply(e,[Nt,t].concat(r))}),pt&&(Ht.className=o()(Nt.className,pt));var qe=g.useRef(!1);qe.current||(qe.current=H||zt||se);var Je=(0,r.Z)((0,r.Z)({},Nt),Ht),tn={};["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"].forEach((function(t){mt[t]&&(tn[t]=function(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];null===(e=Je[t])||void 0===e||e.call.apply(e,[Je].concat(r)),mt[t].apply(mt,r)})}));var en=g.cloneElement(Mt,(0,r.Z)((0,r.Z)({},Je),tn)),nn={x:be,y:Ee},rn=ot?(0,r.Z)({},!0!==ot?ot:{}):null;return g.createElement(g.Fragment,null,g.createElement(l.Z,{disabled:!zt,ref:Pt,onResize:function(){Ve(),Re()}},g.createElement(E,{getTriggerDOMNode:gt},en)),qe.current&&g.createElement(C.Provider,{value:Ct},g.createElement(b,{portal:t,ref:Dt,prefixCls:a,popup:W,className:o()(z,Qe),style:Y,target:Rt,onMouseEnter:Ze,onMouseLeave:We,onPointerEnter:Ze,zIndex:et,open:zt,keepDom:se,fresh:it,onClick:At,onPointerDownCapture:ze,mask:O,motion:$t,maskMotion:Gt,onVisibleChanged:function(t){Ae(!1),Te(),null==S||S(t)},onPrepare:function(){return new Promise((function(t){Ve(),ue((function(){return t}))}))},forceRender:H,autoDestroy:_t,getPopupContainer:N,align:Fe,arrow:rn,arrowPos:nn,ready:_e,offsetX:we,offsetY:ye,offsetR:ve,offsetB:Be,onAlign:Re,stretch:nt,targetWidth:Me/Ce,targetHeight:$e/ke})))}));return e}(A.Z)},82595:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return st}});var r=n(7557),i=n.n(r),s=n(41498),A=n.n(s),a=n(82242),o=n.n(a),l=n(79800),u=n.n(l),c=n(39647),h=n.n(c),d=n(59301),f=n(56656),p=n.n(f),g=n(86129),m=n.n(g),_=n(87281),w=n(76805),y=n(62957),v=n(6767),B=n(77019),b=n(5269),E=n(99571),C=n(458),k=n(91882),F=n(37285),T=n(54172),S=n(71114),x=n(82326),I=n(29787),D=n(27812),U=n(95869),L=n(87169),R=n(26227),Q=n(51200),O=n(40189),P=n(30406),M=n(37205),N=n.n(M),H=n(28284),K=n(71051),$=n(37568),G=n(37712),V=function(t){var e=t.defaultValue,n=t.onBlur,r=t.max,i=t.className,s=void 0===i?"game-score":i,A=(0,d.useState)(e),a=u()(A,2),o=a[0],l=a[1];return(0,d.useEffect)((function(){l(e)}),[e]),(0,G.jsx)(K.Z,{max:r,min:0,className:s,value:o,onChange:function(t){l(t)},onBlur:function(){o&&(n(o>r?r:o),l(null))}})},j={greyText:"greyText___lvEE6",info:"info___El01Z",label:"label___GmvST",blackContent:"blackContent___FYo0Z",orangeContent:"orangeContent____uYQ3",inputLabel:"inputLabel___ruiZm",tableTitle:"tableTitle___ir3x7",scoreTable:"scoreTable___b9Z37"},Z=n(3974),W=n(33313),z=(0,w.connect)((function(t){return{shixunHomeworks:t.shixunHomeworks,classroomList:t.classroomList}}))((function(t){var e,r,s=t.shixunHomeworks,a=t.dispatch,l=t.classroomList,c=t.gethomeworkreport,h=t.homeWorkReport,f=(s.shixunWorkReport,(0,w.useParams)()),p=(0,d.useState)(!1),g=u()(p,2),m=g[0],C=g[1],k=(0,d.useState)(!1),F=u()(k,2),S=F[0],x=F[1],I=(0,d.useState)(""),D=u()(I,2),U=D[0],L=D[1],R=H.Z.useForm(),Q=u()(R,1)[0],P=H.Z.useWatch("comment",Q),M=H.Z.useWatch("hidden_comment",Q),z=(0,d.useState)(!1),Y=u()(z,2),X=Y[0],q=Y[1],J=(0,d.useRef)({}),tt=y.Z.useModal(),et=u()(tt,2),nt=et[0],rt=(et[1],function(){var t=A()(i()().mark((function t(){var e;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(!0),e=Q.getFieldsValue(),t.next=4,(0,_.ZP)("/api/student_works/".concat(f.homeworkId,"/shixun_work_comment.json"),{method:"post",body:{hidden_comment:e.hidden_comment,comment:e.comment}});case 4:0===t.sent.status&&(v.ZP.success("点评成功"),Q.resetFields(),a({type:"classroomList/setActionTabs",payload:{}}),c()),x(!1);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()),it=function(){var t=A()(i()().mark((function t(){var e;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(U){t.next=3;break}return v.ZP.warning("请填写分数"),t.abrupt("return");case 3:return x(!0),e=Q.getFieldsValue(),t.next=7,(0,_.ZP)("/api/student_works/".concat(f.homeworkId,"/add_score.json"),{method:"post",body:{comment:e.comment,score:U}});case 7:0===t.sent.status&&(v.ZP.success("点评成功"),a({type:"classroomList/setActionTabs",payload:{}}),c()),x(!1);case 10:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),st=function(){var t=A()(i()().mark((function t(e){var n,r,s;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.mes,r=e.setChatData,e.setTyping,t.next=3,(0,_.ZP)("/api/intelligent_reviews/large_model_intelligent_qa.json",{method:"post",body:o()({query:n,student_work_id:f.homeworkId},J.current)});case 3:(s=t.sent).answer=-3==(null==s?void 0:s.status)?s.message:null==s?void 0:s.answer,null!=s&&s.answer&&r((function(t){return N()(t).map((function(e,n){return n===t.length-1?o()(o()({},e),{},{text:null==s?void 0:s.answer,loading:!1,response:s}):e}))}));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),At=[{title:"任务名称",dataIndex:"shixun_name",ellipsis:!0},{title:"开启时间",dataIndex:"open_time",width:160,render:function(t){return t||"--"}},{title:"评测次数",dataIndex:"evaluate_count",width:110},{title:"完成时间",dataIndex:"finished_time",width:160},{title:"实训耗时",dataIndex:"cost_time",width:160},{title:"缺评扣分",dataIndex:"absence_penalty",width:90,render:function(t){return t||"--"}},{title:"得分",dataIndex:"score",width:90,render:function(t,e){return(0,G.jsxs)("div",{children:[(0,G.jsx)("span",{style:{color:parseFloat(e.score_full)!==parseFloat(t)?"#E30000":"#53C41B"},children:t}),"/",e.score_full]})}},{title:"调分",width:100,dataIndex:"action",render:function(t,e){return(0,O.GJ)()?(0,G.jsx)(V,{max:e.score_full,onBlur:function(){var t=A()(i()().mark((function t(e){var n,r;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(0,O.Rm)()||null!==(n=l.AssistantObject.practice)&&void 0!==n&&n.can_appraise){t.next=3;break}return v.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能"),t.abrupt("return");case 3:return t.next=5,(0,_.ZP)("/api/student_works/".concat(f.homeworkId,"/adjust_score.json"),{method:"post",body:{score:e}});case 5:r=t.sent,c(),0===r.status&&v.ZP.success("调分成功");case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}):null!=h&&h.is_anonymous?(0,G.jsx)(K.Z,{min:0,value:U,onChange:function(t){return L(t)},max:e.score_full}):t}}].filter((function(t){return null==h||!h.is_anonymous||!["late_penalty","score","absence_penalty"].includes(t.dataIndex)}));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(y.Z,{centered:!0,width:1080,title:"点评作业",afterClose:function(){Q.resetFields(),L("")},confirmLoading:S,open:"更改点评"===l.actionTabs.key,okText:"确定",cancelText:"取消",onOk:A()(i()().mark((function t(){var e,n;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(0,O.Rm)()||null!==(e=l.AssistantObject.practice)&&void 0!==e&&e.can_appraise){t.next=3;break}return v.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能"),t.abrupt("return");case 3:if(null==h||!h.is_anonymous){t.next=6;break}return it(),t.abrupt("return");case 6:n=Q.getFieldsValue(),"{}"===JSON.stringify(n)||""===n.hidden_comment&&""===n.comment?C(!0):rt();case 8:case"end":return t.stop()}}),t)}))),onCancel:function(){a({type:"classroomList/setActionTabs",payload:{}})},children:[(0,G.jsxs)(B.Z,{className:j.info,children:[(0,G.jsxs)(b.Z,{children:[(0,G.jsx)("span",{className:"".concat(j.label," ").concat(j.greyText),children:"姓名"}),(0,G.jsx)("span",{className:j.blackContent,children:null==h?void 0:h.username})]}),(0,G.jsxs)(b.Z,{children:[(0,G.jsx)("span",{className:"".concat(j.label," ").concat(j.greyText),children:"学号"}),(0,G.jsx)("span",{className:j.blackContent,children:(null==h?void 0:h.student_id)||"--"})]}),!(null!=h&&h.is_anonymous)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(b.Z,{children:[(0,G.jsx)("span",{className:"".concat(j.label," ").concat(j.greyText),children:"班级"}),(0,G.jsx)("span",{className:j.blackContent,children:(null==h?void 0:h.group_name)||"--"})]}),(0,G.jsxs)(b.Z,{children:[(0,G.jsx)("span",{className:"".concat(j.label," ").concat(j.greyText),children:"补交扣分"}),(0,G.jsx)("span",{className:j.orangeContent,children:(null==h||null===(e=h.stage_list[0])||void 0===e?void 0:e.late_penalty)||"--"})]}),(0,G.jsxs)(b.Z,{children:[(0,G.jsx)("span",{className:"".concat(j.label," ").concat(j.greyText),children:"缺评扣分"}),(0,G.jsx)("span",{className:j.orangeContent,children:(null==h||null===(r=h.stage_list[0])||void 0===r?void 0:r.absence_penalty)||"--"})]}),(0,G.jsxs)(b.Z,{children:[(0,G.jsx)("span",{className:"".concat(j.label," ").concat(j.greyText),children:"总成绩"}),(0,G.jsx)("span",{className:j.orangeContent,children:(null==h?void 0:h.stage_list[0].score)||"--"})]})]})]}),(0,G.jsxs)(H.Z,{form:Q,onChange:function(){m&&C(!1)},children:[(0,G.jsxs)("div",{className:"w-full flex justify-between item-center",children:[(0,G.jsx)("div",{className:"".concat(j.inputLabel," ").concat(j.greyText),style:{marginBottom:0},children:null!=h&&h.is_anonymous?"评语":"学生和课堂老师可见"}),(0,G.jsx)("div",{className:"mb10",children:(0,G.jsx)(Z.Z,{title:"智能评阅",visible:X,onOpen:function(t){t.chatData;var e=t.setChatData,n=t.setLoading,r=t.getData,i=t.renderChatItems;a({type:"shixunHomeworks/setActionTabs",payload:{key:"智能评阅配置",onOk:function(t){J.current=t,q(!0),n(!0);var s=i();s[0].show=!1,e(s),r()}}})},onClose:function(){q(!1)},loadingOption:{text:"AI评阅中..."},hideUpload:!0,showDefaultTips:!1,hideInputBox:!0,customRequest:st,extraAnswerAction:function(t){var e;return!t.loading&&![-1,-3].includes(null==t||null===(e=t.response)||void 0===e?void 0:e.status)&&(0,G.jsxs)("div",{className:j.apply,onClick:function(){var e=function(){var e,n,r;Q.setFieldsValue({comment:null==t||null===(e=t.response)||void 0===e?void 0:e.remarks,hidden_comment:null==t||null===(n=t.response)||void 0===n?void 0:n.remarks}),L(null==t||null===(r=t.response)||void 0===r?void 0:r.score),q(!1)};U||P||M?nt.confirm({icon:null,title:"提示",centered:!0,content:"系统检测到评分或评语输入框中已有内容,一键应用将会覆盖原有内容。是否应用?",okText:"应用",onOk:e}):e()},children:[(0,G.jsx)("i",{style:{color:"#3061D0"},className:"iconfont icon-yijianyingyong1 font12 mr5"}),"一键应用"]})},children:(0,G.jsx)(E.ZP,{icon:(0,G.jsx)("img",{src:n(11689)}),type:"link",children:"智能评阅"})})})]}),(0,G.jsx)(H.Z.Item,{name:"comment",children:(0,G.jsx)($.Z.TextArea,{placeholder:"请输入评阅内容",rows:3})}),!(null!=h&&h.is_anonymous)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("div",{className:"".concat(j.inputLabel," ").concat(j.greyText),children:"仅课堂老师可见"}),(0,G.jsx)(H.Z.Item,{name:"hidden_comment",children:(0,G.jsx)($.Z.TextArea,{placeholder:"请输入评阅内容",rows:3})})," "]})]}),m&&(0,G.jsx)("p",{className:"c-red",children:"评阅内容至少有一个不为空"}),(0,G.jsx)("div",{className:j.tableTitle,children:"关卡成绩"}),(0,G.jsx)(T.Z,{className:j.scoreTable,dataSource:null==h?void 0:h.stage_list,rowKey:"challenge_id",pagination:!1,columns:At})]}),(0,G.jsx)(W.Z,{})]})})),Y={},X=(0,w.connect)((function(t){return{shixunHomeworks:t.shixunHomeworks}}))((function(t){var e,n=t.shixunHomeworks,r=t.dispatch,s=t.gethomeworkreport,a=t.homeWorkReport;n.shixunWorkReport;console.log(a,"homeWorkReport");var o=(0,w.useParams)(),l=(0,d.useState)(!1),c=u()(l,2),h=c[0],f=c[1],p=H.Z.useForm(),g=u()(p,1)[0],m=(null==n||null===(e=n.actionTabs)||void 0===e||null===(e=e.selectArrs)||void 0===e?void 0:e.data)||{},b=m.user_name,E=m.score,C=m.comment_time,k=m.content,F=m.score_id,T=m.user_id,S=function(){var t=A()(i()().mark((function t(){var e;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.validateFields();case 2:return f(!0),e=g.getFieldsValue(),t.next=6,(0,_.ZP)("/api/student_works/".concat(o.homeworkId,"/appeal_anonymous_score.json"),{method:"post",body:{comment:e.comment,score_id:F,userId:T}});case 6:0===t.sent.status&&(v.ZP.success("操作成功"),r({type:"shixunHomeworks/setActionTabs",payload:{}}),s()),f(!1);case 9:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return(0,G.jsxs)(y.Z,{centered:!0,width:600,title:"匿评申诉",afterClose:function(){g.resetFields()},confirmLoading:h,open:"匿评申诉"===n.actionTabs.key,okText:"确定",cancelText:"取消",onOk:S,onCancel:function(){r({type:"shixunHomeworks/setActionTabs",payload:{}})},children:[(0,G.jsxs)("div",{className:"p20",style:{background:"#F7F8F9",padding:15,marginBottom:20},children:[(0,G.jsxs)(B.Z,{justify:"space-between",className:Y.info,children:[(0,G.jsxs)("span",{children:[(0,G.jsx)("span",{className:"c-grey-666",children:b}),(0,G.jsx)("span",{className:"c-grey-333 ml5",children:"调分为"}),(0,G.jsxs)("span",{className:"c-orange ml5",children:[E,"分"]})]}),(0,G.jsx)("span",{className:"c-grey-333",children:C})]}),(0,G.jsx)("div",{className:"c-grey-333 mt5",children:k})]}),(0,G.jsx)(H.Z,{form:g,className:"mt15",layout:"vertical",children:(0,G.jsx)(H.Z.Item,{name:"comment",label:"申诉",rules:[{required:!0,message:"请输入申诉原因"}],children:(0,G.jsx)($.Z.TextArea,{placeholder:"请输入申诉原因",rows:3})})})]})})),q=n(72576),J={flex_box_center:"flex_box_center___uz0LL",flex_space_between:"flex_space_between___kuKI5",flex_box_vertical_center:"flex_box_vertical_center___VzPH1",flex_box_center_end:"flex_box_center_end___Tyr1U",flex_box_column:"flex_box_column___qsgVa",title:"title___SFyGM",export:"export___ezPhH",title1_right:"title1_right___tMOJn",userPic:"userPic___mW4Rr",userInfo:"userInfo___vYvSZ",listItem:"listItem___gJf4Z",rightInfo:"rightInfo___PRYRt",shixunTitle:"shixunTitle___STlvE",shixunWrp:"shixunWrp___knhTt",footerBar:"footerBar___R5IlQ",footerBarStatic:"footerBarStatic___M4EQj",exitComment:"exitComment___NoCI4",nextComment:"nextComment___sFj7z",modal:"modal___TwQdH",tag:"tag___RErUu"},tt=n(83449),et=n(53517),nt=n(44164),rt=n.n(nt),it=["shixunHomeworks","classroomList","globalSetting","loading","user","dispatch"],st=(0,w.connect)((function(t){var e=t.shixunHomeworks,n=t.classroomList,r=t.loading,i=t.globalSetting,s=t.user;return{shixunHomeworks:e,classroomList:n,globalSetting:i,loading:r.effects,user:s}}))((function(t){var e,n,r,s,a,l,c=t.shixunHomeworks,f=t.classroomList,g=(t.globalSetting,t.loading,t.user),M=t.dispatch,N=(h()(t,it),(0,d.useState)(o()({},(0,w.useParams)()))),H=u()(N,2),K=H[0],$=H[1],j=(0,w.useParams)(),Z=(0,w.useLocation)(),W=(0,d.useState)([]),Y=(u()(W,0),(0,d.useState)({last:!1})),nt=u()(Y,2),st=nt[0],At=nt[1],at=(0,d.useState)({last:!1}),ot=u()(at,2),lt=ot[0],ut=ot[1],ct=(0,d.useRef)(),ht=(0,d.useRef)(),dt=(0,d.useState)(!1),ft=u()(dt,2),pt=ft[0],gt=ft[1],mt=(0,d.useState)(!1),_t=u()(mt,2),wt=_t[0],yt=_t[1],vt=(0,d.useState)(!1),Bt=u()(vt,2),bt=(Bt[0],Bt[1]),Et=(0,d.useState)(),Ct=u()(Et,2),kt=Ct[0],Ft=Ct[1],Tt=(0,d.useState)(),St=u()(Tt,2),xt=St[0],It=St[1],Dt=(0,d.useState)(!0),Ut=u()(Dt,2),Lt=Ut[0],Rt=Ut[1],Qt=(0,d.useState)(),Ot=u()(Qt,2),Pt=(Ot[0],Ot[1]),Mt=(0,O.GJ)(),Nt=(0,d.useState)(new(m())),Ht=u()(Nt,2),Kt=Ht[0],$t=Ht[1],Gt=(0,d.useState)(0),Vt=u()(Gt,2),jt=(Vt[0],Vt[1],(0,d.useState)([])),Zt=u()(jt,2),Wt=Zt[0],zt=Zt[1],Yt=(0,d.useState)(!1),Xt=u()(Yt,2),qt=Xt[0],Jt=Xt[1],te=(0,d.useState)(!1),ee=u()(te,2),ne=ee[0],re=ee[1],ie=(0,d.useState)(""),se=u()(ie,2),Ae=se[0],ae=se[1],oe=(0,d.useState)(!1),le=u()(oe,2),ue=(le[0],le[1]),ce=(0,d.useState)(!0),he=u()(ce,2),de=(he[0],he[1]),fe=(0,d.useState)(0),pe=u()(fe,2),ge=(pe[0],pe[1]),me=(0,w.useSearchParams)(),_e=u()(me,1)[0],we=function(){var t=A()(i()().mark((function t(){return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(g.userInfo.is_teacher||g.userInfo.admin)&&(ue(!0),de(!1));case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();(0,d.useEffect)((function(){we(),console.log("打印的------",kt),console.log(c),ae(null==kt?void 0:kt.repeat_minus_score)}),[kt,g]),(0,d.useEffect)((function(){console.log("触发这",null==kt?void 0:kt.work_score),ge(null==kt?void 0:kt.work_score)}),[null==kt?void 0:kt.work_score,Ae]),(0,d.useEffect)((function(){return M({type:"globalSetting/footerToggle",payload:!1}),function(){M({type:"globalSetting/footerToggle",payload:!0})}}),[]),(0,d.useEffect)((function(){if(kt){var t,e=[];null==kt||null===(t=kt.target_test_sets)||void 0===t||t.map((function(t,n){var r;null==t||null===(r=t.targets)||void 0===r||r.map((function(r,i){var s;r.name=null==t?void 0:t.name,r.total_target_score=null==t?void 0:t.total_target_score,r.actual_target_score=null==t?void 0:t.actual_target_score,r.rowSpan=0===i?null==t||null===(s=t.targets)||void 0===s?void 0:s.length:0,r.order=n+1,e.push(r)}))})),Pt(e),M({type:"classroomList/getAssistantPermissions",payload:{course_id:K.coursesId}})}}),[kt]),(0,d.useEffect)((function(){"导出实训报告"===c.actionTabs.key&&Wt.length>0&&null!=kt&&kt.course_name&&be("all")}),[null==kt?void 0:kt.course_name]),(0,d.useEffect)((function(){console.log(j),$(o()({},j))}),[Z.pathname]);var ye=function(){document.body.scrollIntoView()};function ve(){return(ve=A()(i()().mark((function t(){var e,n,r,s,A,a,l;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=JSON.parse(localStorage.all_student_works_param||"{}"),t.next=3,M({type:"shixunHomeworks/getAllStudentWorks",payload:o()(o()({},K),r)});case 3:s=t.sent,zt(s.all_student_works),(A=null===(e=s.all_student_works)||void 0===e?void 0:e.map((function(t){return String(t.student_work_id)})).indexOf(K.homeworkId))===(null===(n=s.all_student_works)||void 0===n?void 0:n.length)-1?At({last:!0}):At(null===(a=s.all_student_works)||void 0===a?void 0:a[A+1]),ut(0===A?{last:!0}:null===(l=s.all_student_works)||void 0===l?void 0:l[A-1]);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Be=function(){document.querySelectorAll("canvas").forEach((function(t){(!t.clientWidth||!t.clientHeight)&&t.remove()}))},be=function(){var t=A()(i()().mark((function t(e){var n,r,s,a,o,l,u,c,h,d,f,p;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=function(){return(u=A()(i()().mark((function t(){var e,r,s,A,o;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,_.ZP)("/api/student_works/".concat(Wt[n].student_work_id,"/jupyter_work_report.json"),{method:"get"});case 2:if(0!==(null==(e=t.sent)?void 0:e.status)){t.next=14;break}if(Ft(e.data),null==e||null===(r=e.data)||void 0===r||null===(r=r.shixun_detail[0])||void 0===r||!r.myshixun_identifier){t.next=13;break}return Rt(!0),t.next=9,(0,_.ZP)("/api/jupyters/preview_tpi.json",{method:"get",params:{identifier:null==e||null===(s=e.data)||void 0===s||null===(s=s.shixun_detail[0])||void 0===s?void 0:s.myshixun_identifier,student_work_id:null==e||null===(A=e.data)||void 0===A?void 0:A.work_id}});case 9:0===(o=t.sent).status&&(It(o.html_content),Rt(!1),Te(),a()),t.next=14;break;case 13:a();case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)},l=function(){return u.apply(this,arguments)},o=function(){return o=A()(i()().mark((function t(){return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:ye(),n++,setTimeout(A()(i()().mark((function t(){var e,a,o,u,c,h;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Be(),a=Kt.folder("".concat(null==kt||null===(e=kt.stage_list[0])||void 0===e?void 0:e.shixun_name)),o=document.querySelector("#export-all").children,u=rt()(),c=i()().mark((function t(e){return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.set(s).from(o[e]).toContainer().toCanvas().toPdf().get("pdf").then(function(){var t=A()(i()().mark((function t(n){return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e<o.length-1)){t.next=3;break}return t.next=3,n.addPage();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 2:case"end":return t.stop()}}),t)})),h=0;case 6:if(!(h<o.length)){t.next=11;break}return t.delegateYield(c(h),"t0",8);case 8:h++,t.next=6;break;case 11:a.file("".concat(Wt[n-1].student_work_user_name,".pdf"),u.output("blob")),r.update({content:(0,G.jsxs)("div",{children:["当前进度: ",(0,G.jsx)("span",{className:"c-blue",children:n}),"/",null==Wt?void 0:Wt.length,(0,G.jsx)("br",{}),"请勿关闭浏览器窗口"]})}),n==(null==Wt?void 0:Wt.length)?(r.destroy(),Ee()):l();case 14:case"end":return t.stop()}}),t)}))),2200);case 3:case"end":return t.stop()}}),t)}))),o.apply(this,arguments)},a=function(){return o.apply(this,arguments)},n=0,r=y.Z.info({width:460,title:(0,G.jsxs)("div",{children:["正在导出实训报告,",(0,G.jsx)("span",{className:"c-red",children:"请勿关闭或操作当前浏览器窗口"})]}),content:(0,G.jsxs)("div",{children:["当前进度: ",(0,G.jsx)("span",{className:"c-blue",children:n+1}),"/","all"!==e?1:null==Wt?void 0:Wt.length,(0,G.jsx)("br",{}),"请勿关闭浏览器窗口"]}),maskClosable:!1,className:J.modal,onOk:function(){}}),s={margin:[0,0],filename:"".concat(null==kt?void 0:kt.username,".pdf"),html2canvas:{useCORS:!0,letterRendering:!0},jsPDF:{unit:"mm",format:"a4",orientation:"landscape"}},!("all"!==e||(null==Wt?void 0:Wt.length)<2)){t.next=27;break}Be(),ye(),c=ht.current.children,h=rt()(),d=Kt.folder("".concat(null==kt?void 0:kt.username)),f=i()().mark((function t(e){return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.set(s).from(c[e]).toContainer().toCanvas().toPdf().get("pdf").then(function(){var t=A()(i()().mark((function t(n){return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e<c.length-1)){t.next=3;break}return t.next=3,n.addPage();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 2:case"end":return t.stop()}}),t)})),p=0;case 15:if(!(p<c.length)){t.next=20;break}return t.delegateYield(f(p),"t0",17);case 17:p++,t.next=15;break;case 20:return gt(!1),d.file("".concat(null==kt?void 0:kt.username,".pdf"),h.output("blob"),{base64:!1}),r.destroy(),Ee(),t.abrupt("return");case 27:l();case 28:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Ee=function(){Kt.generateAsync({type:"blob"}).then((function(t){var e=document.createElement("a");e.href=window.URL.createObjectURL(t),e.download=(null==kt?void 0:kt.course_name)+".zip",document.body.appendChild(e);var n=document.createEvent("MouseEvents");n.initEvent("click",!1,!1),e.dispatchEvent(n),document.body.removeChild(e),$t(new(m()))})),bt(!1)};(0,d.useEffect)((function(){Se()}),[K.homeworkId]),(0,d.useEffect)((function(){null!=kt&&kt.work_id&&((0,O.GJ)()||null!=kt&&kt.is_anonymous)&&function(){ve.apply(this,arguments)}()}),[null==kt?void 0:kt.work_id]),(0,d.useEffect)((function(){console.log(kt)}),[kt]);var Ce=function(){var t=A()(i()().mark((function t(){var e;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,_.ZP)("/api/student_works/".concat(K.homeworkId,"/jupyter_work_report.json"),{method:"get"});case 2:0===(null==(e=t.sent)?void 0:e.status)&&Ft(e.data);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ke=function(){var t=A()(i()().mark((function t(){var e,n,r,s,A;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,_.ZP)("/api/student_works/".concat(K.homeworkId,"/jupyter_work_report.json"),{method:"get"});case 2:if(0!==(null==(e=t.sent)?void 0:e.status)){t.next=15;break}if(Ft(e.data),null==e||null===(n=e.data)||void 0===n||null===(n=n.shixun_detail[0])||void 0===n||!n.myshixun_identifier){t.next=15;break}return Rt(!0),t.next=9,(0,_.ZP)("/api/jupyters/preview_tpi.json",{method:"get",params:{identifier:null==e||null===(r=e.data)||void 0===r||null===(r=r.shixun_detail[0])||void 0===r?void 0:r.myshixun_identifier,student_work_id:null==e||null===(s=e.data)||void 0===s?void 0:s.work_id}});case 9:if(0!==(A=t.sent).status){t.next=15;break}return It(A.html_content),Rt(!1),Fe(A.html_content),t.abrupt("return");case 15:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Fe=function(t){var e;null==t||null===(e=t.match)||void 0===e||null===(e=e.call(t,/<script [^>]*src=['"]([^'"]+)[^>]*>/gi))||void 0===e||e.map((function(t){var e=document.createElement("script");e.src=/<script [^>]*src=['"]([^'"]+)[^>]*>/gi.exec(t)[1],document.body.appendChild(e)})),Te()},Te=function(){try{window.MathJax&&(MathJax.Hub.Config({TeX:{equationNumbers:{autoNumber:"AMS",useLabelIds:!0}},tex2jax:{inlineMath:[["$","$"],["\\\\(","\\\\)"]],displayMath:[["$$","$$"],["\\\\[","\\\\]"]],processEscapes:!0,processEnvironments:!0},displayAlign:"center",CommonHTML:{linebreaks:{automatic:!0}},"HTML-CSS":{linebreaks:{automatic:!0}}}),MathJax.Hub.Queue(["Typeset",MathJax.Hub]))}catch(t){}},Se=function(){var t=A()(i()().mark((function t(){return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:yt(!0),ke(),yt(!1);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),xe=[{title:"任务名称",dataIndex:"shixun_name",ellipsis:!0,render:function(t,e,n){return t}},{title:"开启时间",dataIndex:"open_time",width:null!=kt&&kt.is_anonymous?220:170,render:function(t){return t||"--"}},{title:"评测次数",dataIndex:"evaluate_count",width:null!=kt&&kt.is_anonymous?140:90},{title:"完成时间",dataIndex:"finished_time",width:null!=kt&&kt.is_anonymous?220:170},{title:"实训耗时",dataIndex:"cost_time",width:130},{title:"补交扣分",dataIndex:"late_penalty",width:90,render:function(t){return t||"--"}},{title:"缺评扣分",dataIndex:"absence_penalty",width:90,render:function(t){return t||"--"}},{title:"得分",dataIndex:"score",width:100,render:function(t,e){return(0,G.jsxs)("div",{children:[(0,G.jsx)("span",{style:{color:parseFloat(e.score_full)!==parseFloat(t)?"red":"green"},children:t||0}),"/",e.score_full]})}},{title:"调分",dataIndex:"action",width:110,render:function(t,e){return Mt?(0,G.jsx)(V,{max:e.score_full,onBlur:function(){var t=A()(i()().mark((function t(e){var n,r;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(0,O.Rm)()||null!==(n=f.AssistantObject.practice)&&void 0!==n&&n.can_appraise){t.next=3;break}return v.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能"),t.abrupt("return");case 3:return t.next=5,(0,_.ZP)("/api/student_works/".concat(K.homeworkId,"/adjust_score.json"),{method:"post",body:{score:e}});case 5:r=t.sent,Ce(),0===r.status&&v.ZP.success("操作成功");case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}):t}}].filter((function(t){return null==kt||!kt.is_anonymous||!["late_penalty","absence_penalty","score","action"].includes(t.dataIndex)})),Ie=null==kt?void 0:kt.comment_scores.map((function(t){var e,n,r;return{children:(0,G.jsxs)(B.Z,{children:[(0,G.jsx)(b.Z,{span:24,children:(0,G.jsxs)(B.Z,{children:[(0,G.jsxs)(b.Z,{flex:1,children:[(0,G.jsx)("span",{className:"c-light-black mr10",children:t.user_name}),(0,G.jsx)("span",{children:"调分为"}),(0,G.jsxs)("span",{className:"ml10 c-orange",children:[t.score?t.score:0,"分"]})]}),(0,G.jsx)(b.Z,{children:(0,G.jsx)("span",{className:"c-light-black ml10",children:t.comment_time})})]})}),(0,G.jsx)(b.Z,{span:24,className:"mt8",children:(0,G.jsxs)(B.Z,{className:"mt8",children:[(0,G.jsx)(b.Z,{span:22,children:t.content?(0,G.jsx)(tt.Z,{value:t.content,style:{fontSize:14}}):(0,G.jsx)("span",{className:"c-light-black",children:"暂未写评语"})}),(0,G.jsx)(b.Z,{className:"tr",span:2,children:(null==t?void 0:t.can_appeal)&&!(null!=t&&t.is_invalid)&&(0,G.jsx)(E.ZP,{size:"small",type:"primary",onClick:function(){M({type:"shixunHomeworks/setActionTabs",payload:{key:"匿评申诉",selectArrs:{data:o()({},t)}}})},children:"申诉"})})]})}),!(null==t||!t.appeal_info)&&(0,G.jsx)(b.Z,{span:24,className:"mt8",children:(0,G.jsxs)("div",{className:"p20",style:{background:"#F7F8F9",padding:15},children:[(0,G.jsxs)(B.Z,{justify:"space-between",children:[(0,G.jsxs)("span",{children:[(0,G.jsx)("span",{className:"c-grey-333",children:null==t||null===(e=t.appeal_info)||void 0===e?void 0:e.user_name}),(0,G.jsxs)("span",{children:[1===(null==t?void 0:t.appeal_status)&&(0,G.jsx)("span",{className:"tag-style bg-orange ml10 ".concat(J.tag),children:"申诉中"}),2===(null==t?void 0:t.appeal_status)&&(0,G.jsx)("span",{className:"tag-style bg-grey-ede c-light-black ml10 ".concat(J.tag),children:"申诉已撤销"}),3===(null==t?void 0:t.appeal_status)&&(0,G.jsx)("span",{className:"tag-style ml10 ".concat(J.tag),style:{background:"#57BE40"},children:"申诉成功"}),4===(null==t?void 0:t.appeal_status)&&(0,G.jsx)("span",{className:"tag-style bg-grey-ede c-light-black ml10 ".concat(J.tag),children:"申诉被拒绝"}),5===(null==t?void 0:t.appeal_status)&&(0,G.jsx)("span",{className:"tag-style c-light-black ml10 ".concat(J.tag),style:{background:"#E9EAED"},children:"申诉失败"})]})]}),(0,G.jsxs)("span",{className:"c-light-black",children:[" ",p()(null==t||null===(n=t.appeal_info)||void 0===n?void 0:n.time).format("YYYY-MM-DD HH:mm:ss")]})]}),(0,G.jsxs)(B.Z,{justify:"space-between",className:"mt10",children:[(0,G.jsx)(b.Z,{flex:1,children:null===(r=t.appeal_info)||void 0===r?void 0:r.content}),(0,G.jsxs)(b.Z,{style:{flexShrink:0,marginLeft:"auto"},children:[1===(null==t?void 0:t.appeal_status)&&(0,O.GJ)()&&(0,G.jsx)("span",{onClick:function(){var e;y.Z.confirm({title:"接受申诉",icon:null,content:"此匿评记录将作废,匿评学生的作品将被扣减违规匿评分 是否确认接受申诉?",onOk:(e=A()(i()().mark((function e(){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.ZP)("/api/student_works/".concat(K.homeworkId,"/deal_appeal_score.json"),{method:"post",body:{score_id:t.score_id,status:3}});case 2:0===(null==(n=e.sent)?void 0:n.status)&&Ce();case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},className:"c-red current",children:"接受申诉"}),1===(null==t?void 0:t.appeal_status)&&(0,O.GJ)()&&(0,G.jsx)("span",{onClick:function(){var e;y.Z.confirm({icon:null,title:"接受申诉",content:"此匿评记录被认为合理,是否确认拒绝申诉?",onOk:(e=A()(i()().mark((function e(){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.ZP)("/api/student_works/".concat(K.homeworkId,"/deal_appeal_score.json"),{method:"post",body:{score_id:t.score_id,status:4}});case 2:0===(null==(n=e.sent)?void 0:n.status)&&Ce();case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},className:"c-light-black current ml10",children:"拒绝申诉"})]})]})]})})]})}})),De=function(t){It(null),M({type:"shixunHomeworks/setActionTabs",payload:{key:"",type:2}}),setTimeout((function(){"next"===t?w.history.push("/classrooms/".concat(K.coursesId,"/common_homework/").concat(K.categoryId,"/").concat(null==st?void 0:st.student_work_id,"/comment?page=").concat(_e.get("page"))):w.history.push("/classrooms/".concat(K.coursesId,"/common_homework/").concat(K.categoryId,"/").concat(null==lt?void 0:lt.student_work_id,"/comment?page=").concat(_e.get("page")))}),200)};return console.log(!(null==kt||!kt.category),null==kt?void 0:kt.course_id,"homeWorkReport"),(0,G.jsxs)("section",{className:"bg-fafafa",style:{position:"sticky",top:0},children:[(0,G.jsx)("div",{className:"edu-container mt10",style:{paddingBottom:100},children:(0,G.jsxs)(C.Z,{loading:wt,active:!0,avatar:{size:40},paragraph:{rows:5},children:[(0,G.jsxs)("div",{className:"edu-container",children:[(null==kt?void 0:kt.course_id)&&(0,G.jsxs)("section",{className:"animated fadeIn",children:[(0,G.jsx)("aside",{className:"",children:(null==kt?void 0:kt.category)&&(0,G.jsxs)(k.Z,{separator:">",children:[(0,G.jsx)(k.Z.Item,{children:(0,G.jsx)(w.Link,{to:"/classrooms/".concat(null==kt?void 0:kt.course_id,"/common_homework"),children:null==kt?void 0:kt.course_name})}),(0,G.jsx)(k.Z.Item,{children:(0,G.jsx)(w.Link,{to:"/classrooms/".concat(null==kt?void 0:kt.course_id,"/common_homework/").concat(null!=kt&&kt.category.main?"":null==kt?void 0:kt.category.category_id),children:null==kt?void 0:kt.category.category_name})}),(0,G.jsx)(k.Z.Item,{children:(0,G.jsx)(w.Link,{to:"/classrooms/".concat(null==kt?void 0:kt.course_id,"/common_homework/").concat(null==kt?void 0:kt.homework_common_id,"/detail"),children:"作业详情"})}),(0,G.jsx)(k.Z.Item,{children:null==kt?void 0:kt.username})]})}),(0,G.jsx)("aside",{className:[J.title1,"mt20"].join(" "),children:(0,G.jsxs)(B.Z,{align:"middle",children:[(0,G.jsxs)(b.Z,{flex:1,children:[(0,G.jsx)(w.Link,{to:"/classrooms/".concat(null==kt?void 0:kt.course_id,"/common_homework/").concat(null==kt?void 0:kt.homework_common_id,"/detail?page=").concat(_e.get("page")),children:(0,G.jsx)(D.Z,{className:"font16 c-black"})}),(0,G.jsx)("strong",{style:{fontWeight:700},className:"font20 ml5",children:null==kt?void 0:kt.shixun_name}),(0,G.jsx)(P.VV,{status:null==kt?void 0:kt.homework_status})]}),(0,G.jsxs)(b.Z,{className:J.title1_right,children:[!(null!=kt&&kt.is_anonymous)&&!(null==kt||!kt.work_status)&&(0,G.jsxs)(E.ZP,{children:[(0,G.jsx)("span",{className:"iconfont icon-yijiandianping mr5"}),(0,G.jsx)(w.Link,{className:"c-black",target:"_blank",to:"/tasks/".concat(null==kt||null===(e=kt.shixun_detail)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.myshixun_identifier,"/jupyter").concat((0,O.GJ)()?"":"?homework_common_id=".concat(j.categoryId)),children:(0,O.GJ)()?"查看学员实训":"查看实训"})]}),(0,O.GJ)()&&!(null!=kt&&null!==(n=kt.homework_status)&&void 0!==n&&n.includes("已截止"))&&(0,G.jsxs)(E.ZP,{className:"ml10",onClick:A()(i()().mark((function t(){return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,M({type:"shixunHomeworks/setActionTabs",payload:{key:"redoShixunModal",homework_common_id:j.categoryId,student_work_id:j.homeworkId}});case 2:case"end":return t.stop()}}),t)}))),children:[(0,G.jsx)("span",{className:"iconfont icon-dahuizhongzuo3x mr5"}),"打回重做"]}),!(null!=kt&&kt.is_anonymous)&&(0,G.jsxs)(E.ZP,{className:"ml10",onClick:function(){var t;!(0,O.Rm)()||null!==(t=f.AssistantObject.normal)&&void 0!==t&&t.can_download?be(""):v.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能")},loading:pt,children:[(0,G.jsx)("span",{className:"iconfont icon-daochu mr5"}),"导出实训报告"]}),(0,O.GJ)()&&(null==Wt?void 0:Wt.length)>1&&(0,G.jsxs)(E.ZP,{className:"ml10",onClick:function(){var t;!(0,O.Rm)()||null!==(t=f.AssistantObject.normal)&&void 0!==t&&t.can_download?be("all"):v.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能")},children:[(0,G.jsx)("span",{className:"iconfont icon-daochu mr5"}),"导出全部学生实训报告"]})]})]})})]}),(0,G.jsx)("aside",{className:"mt30 relative"})]}),(0,G.jsx)("aside",{className:"edu-container bg-white",ref:ct,children:(0,G.jsx)("div",{id:"export-all",ref:ht,children:(0,G.jsxs)("div",{id:"export-all-1",children:[(0,G.jsxs)("div",{className:J.title,children:[(0,G.jsx)("h1",{children:"总体评价"}),(0,G.jsx)("div",{children:!(null!=kt&&null!==(r=kt.homework_status)&&void 0!==r&&r.includes("已截止")&&(0,O.dE)())&&((0,O.GJ)()||(null==kt?void 0:kt.is_anonymous))&&(0,G.jsxs)(E.ZP,{className:"mr20",type:"primary",onClick:function(){M({type:"classroomList/setActionTabs",payload:{key:"更改点评",selectArrs:{myshixun_identifier:null==kt?void 0:kt.user_id,data:o()({},kt)}}})},children:[(0,G.jsx)(U.Z,{}),null!=kt&&kt.has_shixun_work_comment?"更改点评":"点评作业"]})})]}),(0,G.jsx)(F.Z,{style:{marginTop:0}}),(0,G.jsxs)(B.Z,{className:"pl30 pr30",children:[(0,G.jsx)(b.Z,{children:(0,G.jsx)("img",{className:J.userPic,src:"".concat(Q.Z.IMG_SERVER,"/images/").concat(null==kt?void 0:kt.image_url),alt:null==kt?void 0:kt.username})}),(0,G.jsxs)(b.Z,{className:"pt20",children:[(0,G.jsx)("span",{className:"font16 ml40",children:null==kt?void 0:kt.username}),(0,G.jsx)(P.Y,{status:null==kt?void 0:kt.work_status}),(0,G.jsxs)("ul",{className:J.userInfo,children:[(0,G.jsxs)("li",{children:["学号:",(null==kt?void 0:kt.student_id)||"--"]}),((0,O.GJ)()||!(null!=kt&&kt.is_anonymous))&&(0,G.jsxs)("li",{children:["分班:",(null==kt?void 0:kt.group_name)||"--"]}),(0,G.jsx)("br",{})]})]})]}),(0,G.jsx)("aside",{className:"pl30 pr30 mt30 mb10",children:(0,G.jsx)(T.Z,{dataSource:null==kt?void 0:kt.stage_list,rowKey:function(t){return null==t?void 0:t.challenge_id},pagination:!1,columns:xe})}),((null==kt?void 0:kt.work_comment_hidden)||(null==kt?void 0:kt.work_comment))&&(0,G.jsxs)("div",{children:[(0,G.jsxs)(B.Z,{align:"middle",children:[(0,G.jsx)(b.Z,{flex:1,children:(0,G.jsx)("h1",{className:J.title,children:"点评内容"})}),(0,G.jsx)(b.Z,{className:"pr30",children:(0,O.GJ)()&&(0,G.jsxs)(E.ZP,{onClick:A()(i()().mark((function t(){return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:y.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",icon:(0,G.jsx)(L.Z,{}),content:"是否确认删除?",onOk:function(){return A()(i()().mark((function t(){return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,et.gZ)({comment_id:null==kt?void 0:kt.comment_id,homeworkId:K.homeworkId});case 2:0===t.sent.status&&(v.ZP.success("删除成功"),Ce());case 4:case"end":return t.stop()}}),t)})))()}});case 1:case"end":return t.stop()}}),t)}))),children:[(0,G.jsx)(R.Z,{}),"删除"]})})]}),(null==kt?void 0:kt.work_comment)&&(0,G.jsxs)("aside",{className:"pl30 pr30",style:{marginTop:"-5px"},children:[(0,G.jsx)("span",{className:"c-light-black font12",children:"# 学生和课堂老师可见"}),(0,G.jsx)("br",{}),(0,G.jsx)(tt.Z,{value:null==kt?void 0:kt.work_comment,className:"font14"})]}),(null==kt?void 0:kt.work_comment_hidden)&&(0,G.jsxs)("aside",{className:"pl30 pr30 mt15",children:[(0,G.jsx)("span",{className:"c-light-black font12",children:"# 仅课堂老师可见"}),(0,G.jsx)("br",{}),(0,G.jsx)(tt.Z,{value:null==kt?void 0:kt.work_comment_hidden,className:"font14"})]})]}),(null==kt?void 0:kt.comment_scores.length)>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("h1",{className:J.title,children:"调分原因"}),(0,G.jsx)("aside",{className:"pl30 pr30",style:{marginTop:"4px"},children:(0,G.jsx)(S.Z,{items:Ie})})]}),(null==kt||null===(s=kt.shixun_detail[0])||void 0===s?void 0:s.myshixun_identifier)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("h1",{className:J.title,style:{marginTop:"-20px"},children:"实训详情"}),(0,G.jsx)("aside",{className:"pl30 pr30",children:(0,G.jsxs)("div",{className:J.shixunWrp,children:[(0,G.jsxs)("h2",{children:[(0,G.jsxs)("span",{children:["评测代码",(0,G.jsx)("span",{className:"ml5 font12 c-grey-999",children:"未通过本题,展示最后提交评测的代码详情"})]}),(0,G.jsx)("span",{children:(0,G.jsxs)(x.default,{style:{width:200},value:null==kt||null===(a=kt.shixun_detail[0])||void 0===a?void 0:a.path,children:[" ",null==kt?void 0:kt.shixun_detail.map((function(t){return(0,G.jsx)(Option,{value:t.path,children:t.path})}))," "]})})]}),(0,G.jsx)(I.Z,{spinning:Lt,children:(0,G.jsx)("div",{style:{width:"100%",minHeight:"550px",padding:"16px"},dangerouslySetInnerHTML:{__html:xt}})})]})})]})]})})}),((0,O.GJ)()||(null==kt?void 0:kt.is_anonymous))&&(0,G.jsx)("aside",{className:"".concat(J.footerBar," ").concat(pt?J.footerBarStatic:""),children:(0,G.jsx)("aside",{className:"edu-container",children:(0,G.jsxs)(B.Z,{align:"middle",children:[(0,G.jsx)(b.Z,{flex:"1",children:(0,G.jsx)(w.Link,{className:J.exitComment,to:"/classrooms/".concat(K.coursesId,"/common_homework/").concat(K.categoryId,"/detail?page=").concat(_e.get("page")),children:"返回列表"})}),(0,G.jsxs)(b.Z,{flex:"1",className:"tr",children:[(0,G.jsx)(E.ZP,{type:"default",disabled:null==lt?void 0:lt.last,onClick:function(){return De()},children:"上一个"}),(0,G.jsx)(E.ZP,{type:"default",style:{marginLeft:"20px",marginRight:"20px"},disabled:null==st?void 0:st.last,onClick:function(){return De("next")},children:"下一个"}),!(null!=kt&&null!==(l=kt.homework_status)&&void 0!==l&&l.includes("已截止")&&(0,O.dE)())&&((0,O.GJ)()||(null==kt?void 0:kt.is_anonymous))&&(0,G.jsx)(E.ZP,{type:"primary",onClick:A()(i()().mark((function t(){return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:M({type:"classroomList/setActionTabs",payload:{key:"更改点评",selectArrs:{myshixun_identifier:null==kt?void 0:kt.user_id,data:o()({},kt)}}});case 1:case"end":return t.stop()}}),t)}))),children:"点评作业"})]})]})})})]})}),(0,G.jsx)(X,{gethomeworkreport:Ce,homeWorkReport:kt}),(0,G.jsx)(z,{gethomeworkreport:Ce,homeWorkReport:kt}),(0,G.jsx)(q.Z,{getData:Ce}),(0,G.jsxs)(y.Z,{open:qt,width:860,centered:!0,onCancel:function(){Jt(!1)},title:"计时规则说明",footer:null,children:[(0,G.jsxs)("div",{style:{color:"#333333",fontWeight:400},children:[(0,G.jsx)("span",{style:{fontWeight:500},children:"1、页面停留时长"}),(0,G.jsx)("br",{}),(0,G.jsx)("span",{children:"学生进入关卡的答题页面开始计时,直至学生关卡评测通过,则计时结束;"}),(0,G.jsx)("br",{}),(0,G.jsx)("span",{children:" 学生进入关卡的答题页面开始计时,若学生关闭/退出答题页面,则计时暂停,再次进入答题页面时开始累计计时直至评测通过,则计时结束;"}),(0,G.jsx)("span",{style:{color:"#FA6400",display:"flex",height:34,alignItems:"center"},children:" 可能会造成时长评估与实际做题能力不符的情况 "}),(0,G.jsx)("span",{children:"a、学生进入关卡看完题后退出答题页面完成代码设计再复制进平台答题页面进行评测无法评估学生的学习和思考时间。"})]}),(0,G.jsxs)("div",{style:{color:"#333333",marginTop:20,fontWeight:400},children:[(0,G.jsx)("span",{style:{fontWeight:500},children:"2、关卡总耗时"}),(0,G.jsx)("br",{}),(0,G.jsx)("span",{style:{},children:"学生第一次进入关卡答题页面开始计时,直至该关卡评测通过,则计时结束。 "}),(0,G.jsx)("br",{}),(0,G.jsx)("span",{children:" 另,即使关卡闯关过程中,学生退出/关闭答题页面,也将持续计时,直至该关卡通过。"}),(0,G.jsx)("span",{style:{color:"#FA6400",display:"flex",height:44,paddingTop:10},children:" 可能会造成时长评估与实际做题能力不符的情况 "}),(0,G.jsx)("span",{children:"a、学生从其他同学处看到题目后完成代码设计再进入关卡答题页面将已完成的代码复制至平台进行评测"}),(0,G.jsx)("br",{}),(0,G.jsx)("span",{children:"b、学生第一次打开关卡后因为某种原因离开页面时隔多日才再次进入平台闯关就会导致学生关卡总耗时过长"})]}),(0,G.jsxs)("div",{style:{color:"#333333",marginTop:20,fontWeight:400},children:[(0,G.jsx)("span",{style:{fontWeight:500},children:"3、作业通关时长"}),(0,G.jsx)("br",{}),(0,G.jsx)("span",{style:{},children:"从老师发布的实训作业开始时间,开始计时,直至学生实训通关(包括迟交通关),结束计时。如果学生未通关,则该生的闯关耗时为老师设置的实训开始时间至实训截止时间,如果老师开启了补交,则该生的闯关耗时为实训开始时间至实训补交截止时间。"})]}),(0,G.jsxs)("div",{style:{color:"#333333",marginTop:20,fontWeight:400},children:[(0,G.jsx)("span",{style:{fontWeight:500},children:"规则目的"}),(0,G.jsx)("br",{}),(0,G.jsx)("span",{style:{},children:"鼓励学生在实训作业发布的第一时间,立即登录平台完成实训作业的通关。"})]})]}),(0,G.jsx)(y.Z,{open:ne,title:"实训总耗时说明",centered:!0,footer:null,onCancel:function(){re(!1)},width:600,children:(0,G.jsxs)("div",{style:{fontWeight:400,color:"#333333"},children:[(0,G.jsxs)("div",{children:["1、当计时规则为“",(0,G.jsx)("span",{style:{color:"#145DFF"},children:"页面停留时长"}),"”时,实训总耗时为所有关卡耗时相加之和;"]}),(0,G.jsxs)("div",{style:{margin:"20px 0px"},children:["2、当计时规则为“",(0,G.jsx)("span",{style:{color:"#145DFF"},children:"关卡总耗时"}),"”时,实训总耗时为所有关卡耗时相加之和;"]}),(0,G.jsxs)("div",{children:["3、当计时规则为“",(0,G.jsx)("span",{style:{color:"#145DFF"},children:"作业通关时长"}),"”时,实训总耗时为实训发布时间至实训通关时间,当学生未通关时,实训总耗时为实训发布时间至实训截止时间。"]})]})})]})}))},72576:function(t,e,n){"use strict";var r=n(7557),i=n.n(r),s=n(41498),A=n.n(s),a=n(62957),o=n(6767),l=n(87281),u=n(76805),c=n(40189),h=n(37712);e.Z=(0,u.connect)((function(t){return{shixunHomeworks:t.shixunHomeworks,classroomList:t.classroomList}}))((function(t){var e=t.shixunHomeworks,n=t.dispatch,r=t.classroomList,s=t.getData;return(0,h.jsxs)(a.Z,{centered:!0,title:"提示",open:"redoShixunModal"===e.actionTabs.key,okText:"确定",cancelText:"取消",onOk:A()(i()().mark((function t(){var A;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(0,c.Rm)()||null!==(A=r.AssistantObject.normal)&&void 0!==A&&A.can_redo){t.next=3;break}return o.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能"),t.abrupt("return");case 3:return t.next=5,(0,l.ZP)("/api/homework_commons/".concat(e.actionTabs.homework_common_id,"/batch_redo_modal.json"),{method:"post",body:{student_work_id:e.actionTabs.student_work_id}});case 5:0===t.sent.status&&(o.ZP.success("操作成功"),n({type:"shixunHomeworks/setActionTabs",payload:{}}),s());case 7:case"end":return t.stop()}}),t)}))),onCancel:function(){n({type:"shixunHomeworks/setActionTabs",payload:{}})},children:[(0,h.jsxs)("p",{children:["该作业将被打回重做,",e.actionTabs.isshixun?"学生实训":"学生作品提交","记录将被清空!"]}),(0,h.jsx)("p",{children:"确定打回?"})]})}))},71114:function(t,e,n){"use strict";n.d(e,{Z:function(){return E}});var r=n(59301),i=n(92310),s=n.n(i),A=n(48755),a=n(83397),o=n(36237),l=n(63356),u=n(16931),c=n(51636);const h=t=>{const{componentCls:e,calc:n}=t;return{[e]:Object.assign(Object.assign({},(0,l.Wf)(t)),{margin:0,padding:0,listStyle:"none",[`${e}-item`]:{position:"relative",margin:0,paddingBottom:t.itemPaddingBottom,fontSize:t.fontSize,listStyle:"none","&-tail":{position:"absolute",insetBlockStart:t.itemHeadSize,insetInlineStart:n(n(t.itemHeadSize).sub(t.tailWidth)).div(2).equal(),height:`calc(100% - ${(0,o.unit)(t.itemHeadSize)})`,borderInlineStart:`${(0,o.unit)(t.tailWidth)} ${t.lineType} ${t.tailColor}`},"&-pending":{[`${e}-item-head`]:{fontSize:t.fontSizeSM,backgroundColor:"transparent"},[`${e}-item-tail`]:{display:"none"}},"&-head":{position:"absolute",width:t.itemHeadSize,height:t.itemHeadSize,backgroundColor:t.dotBg,border:`${(0,o.unit)(t.dotBorderWidth)} ${t.lineType} transparent`,borderRadius:"50%","&-blue":{color:t.colorPrimary,borderColor:t.colorPrimary},"&-red":{color:t.colorError,borderColor:t.colorError},"&-green":{color:t.colorSuccess,borderColor:t.colorSuccess},"&-gray":{color:t.colorTextDisabled,borderColor:t.colorTextDisabled}},"&-head-custom":{position:"absolute",insetBlockStart:n(t.itemHeadSize).div(2).equal(),insetInlineStart:n(t.itemHeadSize).div(2).equal(),width:"auto",height:"auto",marginBlockStart:0,paddingBlock:t.customHeadPaddingVertical,lineHeight:1,textAlign:"center",border:0,borderRadius:0,transform:"translate(-50%, -50%)"},"&-content":{position:"relative",insetBlockStart:n(n(t.fontSize).mul(t.lineHeight).sub(t.fontSize)).mul(-1).add(t.lineWidth).equal(),marginInlineStart:n(t.margin).add(t.itemHeadSize).equal(),marginInlineEnd:0,marginBlockStart:0,marginBlockEnd:0,wordBreak:"break-word"},"&-last":{[`> ${e}-item-tail`]:{display:"none"},[`> ${e}-item-content`]:{minHeight:n(t.controlHeightLG).mul(1.2).equal()}}},[`&${e}-alternate,\n &${e}-right,\n &${e}-label`]:{[`${e}-item`]:{"&-tail, &-head, &-head-custom":{insetInlineStart:"50%"},"&-head":{marginInlineStart:n(t.marginXXS).mul(-1).equal(),"&-custom":{marginInlineStart:n(t.tailWidth).div(2).equal()}},"&-left":{[`${e}-item-content`]:{insetInlineStart:`calc(50% - ${(0,o.unit)(t.marginXXS)})`,width:`calc(50% - ${(0,o.unit)(t.marginSM)})`,textAlign:"start"}},"&-right":{[`${e}-item-content`]:{width:`calc(50% - ${(0,o.unit)(t.marginSM)})`,margin:0,textAlign:"end"}}}},[`&${e}-right`]:{[`${e}-item-right`]:{[`${e}-item-tail,\n ${e}-item-head,\n ${e}-item-head-custom`]:{insetInlineStart:`calc(100% - ${(0,o.unit)(n(n(t.itemHeadSize).add(t.tailWidth)).div(2).equal())})`},[`${e}-item-content`]:{width:`calc(100% - ${(0,o.unit)(n(t.itemHeadSize).add(t.marginXS).equal())})`}}},[`&${e}-pending\n ${e}-item-last\n ${e}-item-tail`]:{display:"block",height:`calc(100% - ${(0,o.unit)(t.margin)})`,borderInlineStart:`${(0,o.unit)(t.tailWidth)} dotted ${t.tailColor}`},[`&${e}-reverse\n ${e}-item-last\n ${e}-item-tail`]:{display:"none"},[`&${e}-reverse ${e}-item-pending`]:{[`${e}-item-tail`]:{insetBlockStart:t.margin,display:"block",height:`calc(100% - ${(0,o.unit)(t.margin)})`,borderInlineStart:`${(0,o.unit)(t.tailWidth)} dotted ${t.tailColor}`},[`${e}-item-content`]:{minHeight:n(t.controlHeightLG).mul(1.2).equal()}},[`&${e}-label`]:{[`${e}-item-label`]:{position:"absolute",insetBlockStart:n(n(t.fontSize).mul(t.lineHeight).sub(t.fontSize)).mul(-1).add(t.tailWidth).equal(),width:`calc(50% - ${(0,o.unit)(t.marginSM)})`,textAlign:"end"},[`${e}-item-right`]:{[`${e}-item-label`]:{insetInlineStart:`calc(50% + ${(0,o.unit)(t.marginSM)})`,width:`calc(50% - ${(0,o.unit)(t.marginSM)})`,textAlign:"start"}}},"&-rtl":{direction:"rtl",[`${e}-item-head-custom`]:{transform:"translate(50%, -50%)"}}})}};var d=(0,u.I$)("Timeline",(t=>{const e=(0,c.mergeToken)(t,{itemHeadSize:10,customHeadPaddingVertical:t.paddingXXS,paddingInlineEnd:2});return[h(e)]}),(t=>({tailColor:t.colorSplit,tailWidth:t.lineWidthBold,dotBorderWidth:t.wireframe?t.lineWidthBold:3*t.lineWidth,dotBg:t.colorBgContainer,itemPaddingBottom:1.25*t.padding}))),f=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};var p=t=>{var{prefixCls:e,className:n,color:i="blue",dot:a,pending:o=!1,position:l,label:u,children:c}=t,h=f(t,["prefixCls","className","color","dot","pending","position","label","children"]);const{getPrefixCls:d}=r.useContext(A.E_),p=d("timeline",e),g=s()(`${p}-item`,{[`${p}-item-pending`]:o},n),m=/blue|red|green|gray/.test(i||"")?void 0:i,_=s()(`${p}-item-head`,{[`${p}-item-head-custom`]:!!a,[`${p}-item-head-${i}`]:!m});return r.createElement("li",Object.assign({},h,{className:g}),u&&r.createElement("div",{className:`${p}-item-label`},u),r.createElement("div",{className:`${p}-item-tail`}),r.createElement("div",{className:_,style:{borderColor:m,color:m}},a),r.createElement("div",{className:`${p}-item-content`},c))},g=n(94480),m=n(58617),_=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};var w=t=>{var{prefixCls:e,className:n,pending:i=!1,children:A,items:a,rootClassName:o,reverse:l=!1,direction:u,hashId:c,pendingDot:h,mode:d=""}=t,f=_(t,["prefixCls","className","pending","children","items","rootClassName","reverse","direction","hashId","pendingDot","mode"]);const w=(t,n)=>"alternate"===d?"right"===t?`${e}-item-right`:"left"===t||n%2==0?`${e}-item-left`:`${e}-item-right`:"left"===d?`${e}-item-left`:"right"===d||"right"===t?`${e}-item-right`:"",y=(0,g.Z)(a||[]),v="boolean"==typeof i?null:i;i&&y.push({pending:!!i,dot:h||r.createElement(m.Z,null),children:v}),l&&y.reverse();const B=y.length,b=`${e}-item-last`,E=y.filter((t=>!!t)).map(((t,e)=>{var n;const A=e===B-2?b:"",a=e===B-1?b:"",{className:o}=t,u=_(t,["className"]);return r.createElement(p,Object.assign({},u,{className:s()([o,!l&&i?A:a,w(null!==(n=null==t?void 0:t.position)&&void 0!==n?n:"",e)]),key:(null==t?void 0:t.key)||e}))})),C=y.some((t=>!!(null==t?void 0:t.label))),k=s()(e,{[`${e}-pending`]:!!i,[`${e}-reverse`]:!!l,[`${e}-${d}`]:!!d&&!C,[`${e}-label`]:C,[`${e}-rtl`]:"rtl"===u},n,o,c);return r.createElement("ul",Object.assign({},f,{className:k}),E)},y=n(11592);var v=function(t,e){return t&&Array.isArray(t)?t:(0,y.Z)(e).map((t=>{var e,n;return Object.assign({children:null!==(n=null===(e=null==t?void 0:t.props)||void 0===e?void 0:e.children)&&void 0!==n?n:""},t.props)}))},B=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const b=t=>{const{getPrefixCls:e,direction:n,timeline:i}=r.useContext(A.E_),{prefixCls:o,children:l,items:u,className:c,style:h}=t,f=B(t,["prefixCls","children","items","className","style"]),p=e("timeline",o);const g=(0,a.Z)(p),[m,_,y]=d(p,g),b=v(u,l);return m(r.createElement(w,Object.assign({},f,{className:s()(null==i?void 0:i.className,c,y,g),style:Object.assign(Object.assign({},null==i?void 0:i.style),h),prefixCls:p,direction:n,items:b,hashId:_})))};b.Item=p;var E=b},86251:function(t,e){"use strict";e.byteLength=function(t){var e=o(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,s=o(t),A=s[0],a=s[1],l=new i(function(t,e,n){return 3*(e+n)/4-n}(0,A,a)),u=0,c=a>0?A-4:A;for(n=0;n<c;n+=4)e=r[t.charCodeAt(n)]<<18|r[t.charCodeAt(n+1)]<<12|r[t.charCodeAt(n+2)]<<6|r[t.charCodeAt(n+3)],l[u++]=e>>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===a&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,l[u++]=255&e);1===a&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,s=[],A=16383,a=0,o=r-i;a<o;a+=A)s.push(l(t,a,a+A>o?o:a+A));1===i?(e=t[r-1],s.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],s.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return s.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A=0,a=s.length;A<a;++A)n[A]=s[A],r[s.charCodeAt(A)]=A;function o(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,r){for(var i,s,A=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),A.push(n[(s=i)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return A.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},19208:function(t,e,n){"use strict";var r=n(86251),i=n(67467),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.lW=o,e.h2=50;var A=2147483647;function a(t){if(t>A)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,o.prototype),e}function o(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return l(t,e,n)}function l(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|p(t,e),r=a(n),i=r.write(t,e);i!==n&&(r=r.slice(0,i));return r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(H(t,Uint8Array)){var e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(H(t,ArrayBuffer)||t&&H(t.buffer,ArrayBuffer))return d(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(H(t,SharedArrayBuffer)||t&&H(t.buffer,SharedArrayBuffer)))return d(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return o.from(r,e,n);var i=function(t){if(o.isBuffer(t)){var e=0|f(t.length),n=a(e);return 0===n.length||t.copy(n,0,0,e),n}if(void 0!==t.length)return"number"!=typeof t.length||K(t.length)?a(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return u(t),a(t<0?0:0|f(t))}function h(t){for(var e=t.length<0?0:0|f(t.length),n=a(e),r=0;r<e;r+=1)n[r]=255&t[r];return n}function d(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(r,o.prototype),r}function f(t){if(t>=A)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A.toString(16)+" bytes");return 0|t}function p(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||H(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return M(t).length;default:if(i)return r?-1:P(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,e,n);case"utf8":case"utf-8":return k(this,e,n);case"ascii":return T(this,e,n);case"latin1":case"binary":return S(this,e,n);case"base64":return C(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function _(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),K(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=o.from(e,r)),o.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,i){var s,A=1,a=t.length,o=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;A=2,a/=2,o/=2,n/=2}function l(t,e){return 1===A?t[e]:t.readUInt16BE(e*A)}if(i){var u=-1;for(s=n;s<a;s++)if(l(t,s)===l(e,-1===u?0:s-u)){if(-1===u&&(u=s),s-u+1===o)return u*A}else-1!==u&&(s-=s-u),u=-1}else for(n+o>a&&(n=a-o),s=n;s>=0;s--){for(var c=!0,h=0;h<o;h++)if(l(t,s+h)!==l(e,h)){c=!1;break}if(c)return s}return-1}function y(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var s=e.length;r>s/2&&(r=s/2);for(var A=0;A<r;++A){var a=parseInt(e.substr(2*A,2),16);if(K(a))return A;t[n+A]=a}return A}function v(t,e,n,r){return N(P(e,t.length-n),t,n,r)}function B(t,e,n,r){return N(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function b(t,e,n,r){return N(M(e),t,n,r)}function E(t,e,n,r){return N(function(t,e){for(var n,r,i,s=[],A=0;A<t.length&&!((e-=2)<0);++A)r=(n=t.charCodeAt(A))>>8,i=n%256,s.push(i),s.push(r);return s}(e,t.length-n),t,n,r)}function C(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function k(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var s,A,a,o,l=t[i],u=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c<=n)switch(c){case 1:l<128&&(u=l);break;case 2:128==(192&(s=t[i+1]))&&(o=(31&l)<<6|63&s)>127&&(u=o);break;case 3:s=t[i+1],A=t[i+2],128==(192&s)&&128==(192&A)&&(o=(15&l)<<12|(63&s)<<6|63&A)>2047&&(o<55296||o>57343)&&(u=o);break;case 4:s=t[i+1],A=t[i+2],a=t[i+3],128==(192&s)&&128==(192&A)&&128==(192&a)&&(o=(15&l)<<18|(63&s)<<12|(63&A)<<6|63&a)>65535&&o<1114112&&(u=o)}null===u?(u=65533,c=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=c}return function(t){var e=t.length;if(e<=F)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=F));return n}(r)}o.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(t,e,n){return l(t,e,n)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(t,e,n){return function(t,e,n){return u(t),t<=0?a(t):void 0!==e?"string"==typeof n?a(t).fill(e,n):a(t).fill(e):a(t)}(t,e,n)},o.allocUnsafe=function(t){return c(t)},o.allocUnsafeSlow=function(t){return c(t)},o.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==o.prototype},o.compare=function(t,e){if(H(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),H(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var n=t.length,r=e.length,i=0,s=Math.min(n,r);i<s;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=o.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var s=t[n];if(H(s,Uint8Array))i+s.length>r.length?o.from(s).copy(r,i):Uint8Array.prototype.set.call(r,s,i);else{if(!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i)}i+=s.length}return r},o.byteLength=p,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},o.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},o.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},o.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?k(this,0,t):g.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){var t="",n=e.h2;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},s&&(o.prototype[s]=o.prototype.inspect),o.prototype.compare=function(t,e,n,r,i){if(H(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var s=(i>>>=0)-(r>>>=0),A=(n>>>=0)-(e>>>=0),a=Math.min(s,A),l=this.slice(r,i),u=t.slice(e,n),c=0;c<a;++c)if(l[c]!==u[c]){s=l[c],A=u[c];break}return s<A?-1:A<s?1:0},o.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},o.prototype.indexOf=function(t,e,n){return _(this,t,e,n,!0)},o.prototype.lastIndexOf=function(t,e,n){return _(this,t,e,n,!1)},o.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return v(this,t,e,n);case"ascii":case"latin1":case"binary":return B(this,t,e,n);case"base64":return b(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var F=4096;function T(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function S(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function x(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",s=e;s<n;++s)i+=$[t[s]];return i}function I(t,e,n){for(var r=t.slice(e,n),i="",s=0;s<r.length-1;s+=2)i+=String.fromCharCode(r[s]+256*r[s+1]);return i}function D(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function U(t,e,n,r,i,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function L(t,e,n,r,i,s){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function R(t,e,n,r,s){return e=+e,n>>>=0,s||L(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function Q(t,e,n,r,s){return e=+e,n>>>=0,s||L(t,0,n,8),i.write(t,e,n,r,52,8),n+8}o.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);var r=this.subarray(t,e);return Object.setPrototypeOf(r,o.prototype),r},o.prototype.readUintLE=o.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||D(t,e,this.length);for(var r=this[t],i=1,s=0;++s<e&&(i*=256);)r+=this[t+s]*i;return r},o.prototype.readUintBE=o.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||D(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},o.prototype.readUint8=o.prototype.readUInt8=function(t,e){return t>>>=0,e||D(t,1,this.length),this[t]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||D(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||D(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||D(t,e,this.length);for(var r=this[t],i=1,s=0;++s<e&&(i*=256);)r+=this[t+s]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},o.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||D(t,e,this.length);for(var r=e,i=1,s=this[t+--r];r>0&&(i*=256);)s+=this[t+--r]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*e)),s},o.prototype.readInt8=function(t,e){return t>>>=0,e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||D(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(t,e){t>>>=0,e||D(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return t>>>=0,e||D(t,4,this.length),i.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||D(t,4,this.length),i.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||D(t,8,this.length),i.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||D(t,8,this.length),i.read(this,t,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e>>>=0,n>>>=0,r)||U(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,s=0;for(this[e]=255&t;++s<n&&(i*=256);)this[e+s]=t/i&255;return e+n},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e>>>=0,n>>>=0,r)||U(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||U(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||U(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||U(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||U(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||U(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);U(this,t,e,n,i-1,-i)}var s=0,A=1,a=0;for(this[e]=255&t;++s<n&&(A*=256);)t<0&&0===a&&0!==this[e+s-1]&&(a=1),this[e+s]=(t/A>>0)-a&255;return e+n},o.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);U(this,t,e,n,i-1,-i)}var s=n-1,A=1,a=0;for(this[e+s]=255&t;--s>=0&&(A*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/A>>0)-a&255;return e+n},o.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||U(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||U(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||U(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||U(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||U(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeFloatLE=function(t,e,n){return R(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return R(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){return Q(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){return Q(this,t,e,!1,n)},o.prototype.copy=function(t,e,n,r){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i=r-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),i},o.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){var i=t.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var s;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s<n;++s)this[s]=t;else{var A=o.isBuffer(t)?t:o.from(t,r),a=A.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<n-e;++s)this[s+e]=A[s%a]}return this};var O=/[^+/0-9A-Za-z-_]/g;function P(t,e){var n;e=e||1/0;for(var r=t.length,i=null,s=[],A=0;A<r;++A){if((n=t.charCodeAt(A))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(A+1===r){(e-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function M(t){return r.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function H(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function K(t){return t!=t}var $=function(){for(var t="0123456789abcdef",e=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)e[r+i]=t[n]+t[i];return e}()},64018:function(){window.PR_SHOULD_USE_CONTINUATION=!0,function(){var t=window,e=["break,continue,do,else,for,if,return,while"],n=[[e,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],r=[n,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],i=[n,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],s=[n,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],A=[n,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],a="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",o=[e,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],l=[e,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],u=[e,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],c=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,h="str",d="com",f="typ",p="lit",g="pun",m="pln",_="atv";function w(t,e,n,r,i){if(n){var s={sourceNode:t,pre:1,langExtension:null,numberLines:null,sourceCode:n,spans:null,basePos:e,decorations:null};r(s),i.push.apply(i,s.decorations)}}var y=/\S/;function v(t){for(var e=void 0,n=t.firstChild;n;n=n.nextSibling){var r=n.nodeType;e=1===r?e?t:n:3===r&&y.test(n.nodeValue)?t:e}return e===t?void 0:e}function B(t,e){var n,r={};!function(){for(var i=t.concat(e),s=[],A={},a=0,o=i.length;a<o;++a){var l=i[a],u=l[3];if(u)for(var c=u.length;--c>=0;)r[u.charAt(c)]=l;var h=l[1],d=""+h;A.hasOwnProperty(d)||(s.push(h),A[d]=null)}s.push(/[\0-\uffff]/),n=function(t){for(var e=0,n=!1,r=!1,i=0,s=t.length;i<s;++i)if((h=t[i]).ignoreCase)r=!0;else if(/[a-z]/i.test(h.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){n=!0,r=!1;break}var A={b:8,t:9,n:10,v:11,f:12,r:13};function a(t){var e=t.charCodeAt(0);if(92!==e)return e;var n=t.charAt(1);return(e=A[n])||("0"<=n&&n<="7"?parseInt(t.substring(1),8):"u"===n||"x"===n?parseInt(t.substring(2),16):t.charCodeAt(1))}function o(t){if(t<32)return(t<16?"\\x0":"\\x")+t.toString(16);var e=String.fromCharCode(t);return"\\"===e||"-"===e||"]"===e||"^"===e?"\\"+e:e}function l(t){var e=t.substring(1,t.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),n=[],r="^"===e[0],i=["["];r&&i.push("^");for(var s=r?1:0,A=e.length;s<A;++s){var l=e[s];if(/\\[bdsw]/i.test(l))i.push(l);else{var u,c=a(l);s+2<A&&"-"===e[s+1]?(u=a(e[s+2]),s+=2):u=c,n.push([c,u]),u<65||c>122||(u<65||c>90||n.push([32|Math.max(65,c),32|Math.min(u,90)]),u<97||c>122||n.push([-33&Math.max(97,c),-33&Math.min(u,122)]))}}n.sort((function(t,e){return t[0]-e[0]||e[1]-t[1]}));var h=[],d=[];for(s=0;s<n.length;++s)(f=n[s])[0]<=d[1]+1?d[1]=Math.max(d[1],f[1]):h.push(d=f);for(s=0;s<h.length;++s){var f=h[s];i.push(o(f[0])),f[1]>f[0]&&(f[1]+1>f[0]&&i.push("-"),i.push(o(f[1])))}return i.push("]"),i.join("")}function u(t){for(var r=t.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),i=r.length,s=[],A=0,a=0;A<i;++A)"("===(c=r[A])?++a:"\\"===c.charAt(0)&&(u=+c.substring(1))&&(u<=a?s[u]=-1:r[A]=o(u));for(A=1;A<s.length;++A)-1===s[A]&&(s[A]=++e);for(A=0,a=0;A<i;++A)if("("===(c=r[A]))s[++a]||(r[A]="(?:");else if("\\"===c.charAt(0)){var u;(u=+c.substring(1))&&u<=a&&(r[A]="\\"+s[u])}for(A=0;A<i;++A)"^"===r[A]&&"^"!==r[A+1]&&(r[A]="");if(t.ignoreCase&&n)for(A=0;A<i;++A){var c,h=(c=r[A]).charAt(0);c.length>=2&&"["===h?r[A]=l(c):"\\"!==h&&(r[A]=c.replace(/[a-zA-Z]/g,(function(t){var e=t.charCodeAt(0);return"["+String.fromCharCode(-33&e,32|e)+"]"})))}return r.join("")}var c=[];for(i=0,s=t.length;i<s;++i){var h;if((h=t[i]).global||h.multiline)throw new Error(""+h);c.push("(?:"+u(h)+")")}return new RegExp(c.join("|"),r?"gi":"g")}(s)}();var i=e.length,s=function(t){for(var A=t.sourceCode,a=t.basePos,o=t.sourceNode,l=[a,m],u=0,c=A.match(n)||[],h={},d=0,f=c.length;d<f;++d){var p,g=c[d],_=h[g],y=void 0;if("string"==typeof _)p=!1;else{var v=r[g.charAt(0)];if(v)y=g.match(v[1]),_=v[0];else{for(var B=0;B<i;++B)if(v=e[B],y=g.match(v[1])){_=v[0];break}y||(_=m)}!(p=_.length>=5&&"lang-"===_.substring(0,5))||y&&"string"==typeof y[1]||(p=!1,_="src"),p||(h[g]=_)}var b=u;if(u+=g.length,p){var E=y[1],C=g.indexOf(E),k=C+E.length;y[2]&&(C=(k=g.length-y[2].length)-E.length);var F=_.substring(5);w(o,a+b,g.substring(0,C),s,l),w(o,a+b+C,E,T(F,E),l),w(o,a+b+k,g.substring(k),s,l)}else l.push(a+b,_)}t.decorations=l};return s}function b(t){var e=[],n=[];t.tripleQuotedStrings?e.push([h,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]):t.multiLineStrings?e.push([h,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):e.push([h,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),t.verbatimStrings&&n.push([h,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var r=t.hashComments;r&&(t.cStyleComments?(r>1?e.push([d,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):e.push([d,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),n.push([h,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):e.push([d,/^#[^\r\n]*/,null,"#"])),t.cStyleComments&&(n.push([d,/^\/\/[^\r\n]*/,null]),n.push([d,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var i=t.regexLiterals;if(i){var s=i>1?"":"\n\r",A=s?".":"[\\S\\s]",a="/(?=[^/*"+s+"])(?:[^/\\x5B\\x5C"+s+"]|\\x5C"+A+"|\\x5B(?:[^\\x5C\\x5D"+s+"]|\\x5C"+A+")*(?:\\x5D|$))+/";n.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+a+")")])}var o=t.types;o&&n.push([f,o]);var l=(""+t.keywords).replace(/^ | $/g,"");l.length&&n.push(["kwd",new RegExp("^(?:"+l.replace(/[\s,]+/g,"|")+")\\b"),null]),e.push([m,/^\s+/,null," \r\n\t "]);var u="^.[^\\s\\w.$@'\"`/\\\\]*";return t.regexLiterals&&(u+="(?!s*/)"),n.push([p,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[m,/^[a-z_$][a-z_$@0-9]*/i,null],[p,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[m,/^\\[\s\S]?/,null],[g,new RegExp(u),null]),B(e,n)}var E=b({keywords:[r,s,i,A,a,o,l,u],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function C(t,e,n){for(var r=/(?:^|\s)nocode(?:\s|$)/,i=/\r\n?|\n/,s=t.ownerDocument,A=s.createElement("li");t.firstChild;)A.appendChild(t.firstChild);var a=[A];function o(t){var e=t.nodeType;if(1!=e||r.test(t.className)){if((3==e||4==e)&&n){var A=t.nodeValue,a=A.match(i);if(a){var u=A.substring(0,a.index);t.nodeValue=u;var c=A.substring(a.index+a[0].length);if(c)t.parentNode.insertBefore(s.createTextNode(c),t.nextSibling);l(t),u||t.parentNode.removeChild(t)}}}else if("br"===t.nodeName)l(t),t.parentNode&&t.parentNode.removeChild(t);else for(var h=t.firstChild;h;h=h.nextSibling)o(h)}function l(t){for(;!t.nextSibling;)if(!(t=t.parentNode))return;for(var e,n=function t(e,n){var r=n?e.cloneNode(!1):e,i=e.parentNode;if(i){var s=t(i,1),A=e.nextSibling;s.appendChild(r);for(var a=A;a;a=A)A=a.nextSibling,s.appendChild(a)}return r}(t.nextSibling,0);(e=n.parentNode)&&1===e.nodeType;)n=e;a.push(n)}for(var u=0;u<a.length;++u)o(a[u]);e===(0|e)&&a[0].setAttribute("value",e);var c=s.createElement("ol");c.className="linenums";for(var h=Math.max(0,e-1|0)||0,d=(u=0,a.length);u<d;++u)(A=a[u]).className="L"+(u+h)%10,A.firstChild||A.appendChild(s.createTextNode(" ")),c.appendChild(A);t.appendChild(c)}var k={};function F(e,n){for(var r=n.length;--r>=0;){var i=n[r];k.hasOwnProperty(i)?t.console&&console.warn("cannot override language handler %s",i):k[i]=e}}function T(t,e){return t&&k.hasOwnProperty(t)||(t=/^\s*</.test(e)?"default-markup":"default-code"),k[t]}function S(e){var n,r,i,s,A,a,o,l=e.langExtension;try{var u=(n=e.sourceNode,r=e.pre,i=/(?:^|\s)nocode(?:\s|$)/,s=[],A=0,a=[],o=0,function t(e){var n=e.nodeType;if(1==n){if(i.test(e.className))return;for(var l=e.firstChild;l;l=l.nextSibling)t(l);var u=e.nodeName.toLowerCase();"br"!==u&&"li"!==u||(s[o]="\n",a[o<<1]=A++,a[o++<<1|1]=e)}else if(3==n||4==n){var c=e.nodeValue;c.length&&(c=r?c.replace(/\r\n?/g,"\n"):c.replace(/[ \t\r\n]+/g," "),s[o]=c,a[o<<1]=A,A+=c.length,a[o++<<1|1]=e)}}(n),{sourceCode:s.join("").replace(/\n$/,""),spans:a}),c=u.sourceCode;e.sourceCode=c,e.spans=u.spans,e.basePos=0,T(l,c)(e),function(t){var e=/\bMSIE\s(\d+)/.exec(navigator.userAgent);e=e&&+e[1]<=8;var n,r,i=/\n/g,s=t.sourceCode,A=s.length,a=0,o=t.spans,l=o.length,u=0,c=t.decorations,h=c.length,d=0;for(c[h]=A,r=n=0;r<h;)c[r]!==c[r+2]?(c[n++]=c[r++],c[n++]=c[r++]):r+=2;for(h=n,r=n=0;r<h;){for(var f=c[r],p=c[r+1],g=r+2;g+2<=h&&c[g+1]===p;)g+=2;c[n++]=f,c[n++]=p,r=g}h=c.length=n;var m=t.sourceNode,_="";m&&(_=m.style.display,m.style.display="none");try{for(;u<l;){o[u];var w,y=o[u+2]||A,v=c[d+2]||A,B=(g=Math.min(y,v),o[u+1]);if(1!==B.nodeType&&(w=s.substring(a,g))){e&&(w=w.replace(i,"\r")),B.nodeValue=w;var b=B.ownerDocument,E=b.createElement("span");E.className=c[d+1];var C=B.parentNode;C.replaceChild(E,B),E.appendChild(B),a<y&&(o[u+1]=B=b.createTextNode(s.substring(g,y)),C.insertBefore(B,E.nextSibling))}(a=g)>=y&&(u+=2),a>=v&&(d+=2)}}finally{m&&(m.style.display=_)}}(e)}catch(e){t.console&&console.log(e&&e.stack||e)}}function x(t,e,n){var r=n||!1,i=e||null,s=document.createElement("div");return s.innerHTML="<pre>"+t+"</pre>",s=s.firstChild,r&&C(s,r,!0),S({langExtension:i,numberLines:r,sourceNode:s,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null}),s.innerHTML}function I(e,n){var r=n||document.body,i=r.ownerDocument||document;function s(t){return r.getElementsByTagName(t)}for(var A=[s("pre"),s("code"),s("xmp")],a=[],o=0;o<A.length;++o)for(var l=0,u=A[o].length;l<u;++l)a.push(A[o][l]);A=null;var c=Date;c.now||(c={now:function(){return+new Date}});var h=0,d=/\blang(?:uage)?-([\w.]+)(?!\S)/,f=/\bprettyprint\b/,p=/\bprettyprinted\b/,g=/pre|xmp/i,m=/^code$/i,_=/^(?:pre|code|xmp)$/i,w={};!function n(){for(var r=t.PR_SHOULD_USE_CONTINUATION?c.now()+250:1/0;h<a.length&&c.now()<r;h++){for(var s=a[h],A=w,o=s;o=o.previousSibling;){var l=o.nodeType,u=(7===l||8===l)&&o.nodeValue;if(u?!/^\??prettify\b/.test(u):3!==l||/\S/.test(o.nodeValue))break;if(u){A={},u.replace(/\b(\w+)=([\w:.%+-]+)/g,(function(t,e,n){A[e]=n}));break}}var y=s.className;if((A!==w||f.test(y))&&!p.test(y)){for(var B=!1,b=s.parentNode;b;b=b.parentNode){var E=b.tagName;if(_.test(E)&&b.className&&f.test(b.className)){B=!0;break}}if(!B){s.className+=" prettyprinted";var k,F,T=A.lang;if(!T)!(T=y.match(d))&&(k=v(s))&&m.test(k.tagName)&&(T=k.className.match(d)),T&&(T=T[1]);if(g.test(s.tagName))F=1;else{var x=s.currentStyle,I=i.defaultView,D=x?x.whiteSpace:I&&I.getComputedStyle?I.getComputedStyle(s,null).getPropertyValue("white-space"):0;F=D&&"pre"===D.substring(0,3)}var U=A.linenums;(U="true"===U||+U)||(U=!!(U=y.match(/\blinenums\b(?::(\d+))?/))&&(!U[1]||!U[1].length||+U[1])),U&&C(s,U,F),S({langExtension:T,sourceNode:s,numberLines:U,pre:F,sourceCode:null,basePos:null,spans:null,decorations:null})}}}h<a.length?t.setTimeout(n,250):"function"==typeof e&&e()}()}F(E,["default-code"]),F(B([],[[m,/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],[d,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[g,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),F(B([[m,/^[\s]+/,null," \t\r\n"],[_,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[g,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),F(B([],[[_,/^[\s\S]+/]]),["uq.val"]),F(b({keywords:r,hashComments:!0,cStyleComments:!0,types:c}),["c","cc","cpp","cxx","cyc","m"]),F(b({keywords:"null,true,false"}),["json"]),F(b({keywords:s,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:c}),["cs"]),F(b({keywords:i,cStyleComments:!0}),["java"]),F(b({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),F(b({keywords:o,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),F(b({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),F(b({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),F(b({keywords:A,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),F(b({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),F(B([],[[h,/^[\s\S]+/]]),["regex"]);var D=t.PR={createSimpleLexer:B,registerLangHandler:F,sourceDecorator:b,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:_,PR_COMMENT:d,PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:p,PR_NOCODE:"nocode",PR_PLAIN:m,PR_PUNCTUATION:g,PR_SOURCE:"src",PR_STRING:h,PR_TAG:"tag",PR_TYPE:f,prettyPrintOne:x,prettyPrint:I},U=t.define;"function"==typeof U&&U.amd&&U("google-code-prettify",[],(function(){return D}))}()},25769:function(t,e,n){"use strict";var r=n(98040),i={"text/plain":"Text","text/html":"Url",default:"Text"};t.exports=function(t,e){var n,s,A,a,o,l,u=!1;e||(e={}),n=e.debug||!1;try{if(A=r(),a=document.createRange(),o=document.getSelection(),(l=document.createElement("span")).textContent=t,l.ariaHidden="true",l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",(function(r){if(r.stopPropagation(),e.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var s=i[e.format]||i.default;window.clipboardData.setData(s,t)}else r.clipboardData.clearData(),r.clipboardData.setData(e.format,t);e.onCopy&&(r.preventDefault(),e.onCopy(r.clipboardData))})),document.body.appendChild(l),a.selectNodeContents(l),o.addRange(a),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),u=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),s=function(t){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return t.replace(/#{\s*key\s*}/g,e)}("message"in e?e.message:"Copy to clipboard: #{key}, Enter"),window.prompt(s,t)}}finally{o&&("function"==typeof o.removeRange?o.removeRange(a):o.removeAllRanges()),l&&document.body.removeChild(l),A()}return u}},6341:function(t,e,n){"use strict";function r(t,e="utf8"){return new TextDecoder(e).decode(t)}n.d(e,{Jx:function(){return wr}});const i=new TextEncoder;const s=(()=>{const t=new Uint8Array(4);return!((new Uint32Array(t.buffer)[0]=1)&t[0])})(),A={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class a{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(t=8192,e={}){let n=!1;"number"==typeof t?t=new ArrayBuffer(t):(n=!0,this.lastWrittenByte=t.byteLength);const r=e.offset?e.offset>>>0:0,i=t.byteLength-r;let s=r;(ArrayBuffer.isView(t)||t instanceof a)&&(t.byteLength!==t.buffer.byteLength&&(s=t.byteOffset+r),t=t.buffer),this.lastWrittenByte=n?i:0,this.buffer=t,this.length=i,this.byteLength=i,this.byteOffset=s,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,s,i),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}back(t=1){return this.offset-=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const t=this._marks.pop();if(void 0===t)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){const e=2*(this.offset+t),n=new Uint8Array(e);n.set(new Uint8Array(this.buffer)),this.buffer=n.buffer,this.length=e,this.byteLength=e,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){return this.readArray(t,"uint8")}readArray(t,e){const n=A[e].BYTES_PER_ELEMENT*t,r=this.byteOffset+this.offset,i=this.buffer.slice(r,r+n);if(this.littleEndian===s&&"uint8"!==e&&"int8"!==e){const t=new Uint8Array(this.buffer.slice(r,r+n));t.reverse();const i=new A[e](t.buffer);return this.offset+=n,i.reverse(),i}const a=new A[e](i);return this.offset+=n,a}readInt16(){const t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){const t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){const t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){const t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){const t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){const t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readBigInt64(){const t=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,t}readBigUint64(){const t=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let e="";for(let n=0;n<t;n++)e+=this.readChar();return e}readUtf8(t=1){return r(this.readBytes(t))}decodeText(t=1,e="utf8"){return r(this.readBytes(t),e)}writeBoolean(t){return this.writeUint8(t?255:0),this}writeInt8(t){return this.ensureAvailable(1),this._data.setInt8(this.offset++,t),this._updateLastWrittenByte(),this}writeUint8(t){return this.ensureAvailable(1),this._data.setUint8(this.offset++,t),this._updateLastWrittenByte(),this}writeByte(t){return this.writeUint8(t)}writeBytes(t){this.ensureAvailable(t.length);for(let e=0;e<t.length;e++)this._data.setUint8(this.offset++,t[e]);return this._updateLastWrittenByte(),this}writeInt16(t){return this.ensureAvailable(2),this._data.setInt16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(t){return this.ensureAvailable(2),this._data.setUint16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(t){return this.ensureAvailable(4),this._data.setInt32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(t){return this.ensureAvailable(4),this._data.setUint32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(t){return this.ensureAvailable(4),this._data.setFloat32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(t){return this.ensureAvailable(8),this._data.setFloat64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(t){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(t){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(t){return this.writeUint8(t.charCodeAt(0))}writeChars(t){for(let e=0;e<t.length;e++)this.writeUint8(t.charCodeAt(e));return this}writeUtf8(t){return this.writeBytes(function(t){return i.encode(t)}(t))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function o(t){let e=t.length;for(;--e>=0;)t[e]=0}const l=256,u=286,c=30,h=15,d=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),f=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),p=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),g=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),m=new Array(576);o(m);const _=new Array(60);o(_);const w=new Array(512);o(w);const y=new Array(256);o(y);const v=new Array(29);o(v);const B=new Array(c);function b(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}let E,C,k;function F(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}o(B);const T=t=>t<256?w[t]:w[256+(t>>>7)],S=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=(t,e,n)=>{t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,S(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)},I=(t,e,n)=>{x(t,n[2*e],n[2*e+1])},D=(t,e)=>{let n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1},U=(t,e,n)=>{const r=new Array(16);let i,s,A=0;for(i=1;i<=h;i++)A=A+n[i-1]<<1,r[i]=A;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=D(r[e]++,e))}},L=t=>{let e;for(e=0;e<u;e++)t.dyn_ltree[2*e]=0;for(e=0;e<c;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},R=t=>{t.bi_valid>8?S(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},Q=(t,e,n,r)=>{const i=2*e,s=2*n;return t[i]<t[s]||t[i]===t[s]&&r[e]<=r[n]},O=(t,e,n)=>{const r=t.heap[n];let i=n<<1;for(;i<=t.heap_len&&(i<t.heap_len&&Q(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!Q(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r},P=(t,e,n)=>{let r,i,s,A,a=0;if(0!==t.sym_next)do{r=255&t.pending_buf[t.sym_buf+a++],r+=(255&t.pending_buf[t.sym_buf+a++])<<8,i=t.pending_buf[t.sym_buf+a++],0===r?I(t,i,e):(s=y[i],I(t,s+l+1,e),A=d[s],0!==A&&(i-=v[s],x(t,i,A)),r--,s=T(r),I(t,s,n),A=f[s],0!==A&&(r-=B[s],x(t,r,A)))}while(a<t.sym_next);I(t,256,e)},M=(t,e)=>{const n=e.dyn_tree,r=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems;let A,a,o,l=-1;for(t.heap_len=0,t.heap_max=573,A=0;A<s;A++)0!==n[2*A]?(t.heap[++t.heap_len]=l=A,t.depth[A]=0):n[2*A+1]=0;for(;t.heap_len<2;)o=t.heap[++t.heap_len]=l<2?++l:0,n[2*o]=1,t.depth[o]=0,t.opt_len--,i&&(t.static_len-=r[2*o+1]);for(e.max_code=l,A=t.heap_len>>1;A>=1;A--)O(t,n,A);o=s;do{A=t.heap[1],t.heap[1]=t.heap[t.heap_len--],O(t,n,1),a=t.heap[1],t.heap[--t.heap_max]=A,t.heap[--t.heap_max]=a,n[2*o]=n[2*A]+n[2*a],t.depth[o]=(t.depth[A]>=t.depth[a]?t.depth[A]:t.depth[a])+1,n[2*A+1]=n[2*a+1]=o,t.heap[1]=o++,O(t,n,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const n=e.dyn_tree,r=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,A=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,o=e.stat_desc.max_length;let l,u,c,d,f,p,g=0;for(d=0;d<=h;d++)t.bl_count[d]=0;for(n[2*t.heap[t.heap_max]+1]=0,l=t.heap_max+1;l<573;l++)u=t.heap[l],d=n[2*n[2*u+1]+1]+1,d>o&&(d=o,g++),n[2*u+1]=d,u>r||(t.bl_count[d]++,f=0,u>=a&&(f=A[u-a]),p=n[2*u],t.opt_len+=p*(d+f),s&&(t.static_len+=p*(i[2*u+1]+f)));if(0!==g){do{for(d=o-1;0===t.bl_count[d];)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[o]--,g-=2}while(g>0);for(d=o;0!==d;d--)for(u=t.bl_count[d];0!==u;)c=t.heap[--l],c>r||(n[2*c+1]!==d&&(t.opt_len+=(d-n[2*c+1])*n[2*c],n[2*c+1]=d),u--)}})(t,e),U(n,l,t.bl_count)},N=(t,e,n)=>{let r,i,s=-1,A=e[1],a=0,o=7,l=4;for(0===A&&(o=138,l=3),e[2*(n+1)+1]=65535,r=0;r<=n;r++)i=A,A=e[2*(r+1)+1],++a<o&&i===A||(a<l?t.bl_tree[2*i]+=a:0!==i?(i!==s&&t.bl_tree[2*i]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,a=0,s=i,0===A?(o=138,l=3):i===A?(o=6,l=3):(o=7,l=4))},H=(t,e,n)=>{let r,i,s=-1,A=e[1],a=0,o=7,l=4;for(0===A&&(o=138,l=3),r=0;r<=n;r++)if(i=A,A=e[2*(r+1)+1],!(++a<o&&i===A)){if(a<l)do{I(t,i,t.bl_tree)}while(0!=--a);else 0!==i?(i!==s&&(I(t,i,t.bl_tree),a--),I(t,16,t.bl_tree),x(t,a-3,2)):a<=10?(I(t,17,t.bl_tree),x(t,a-3,3)):(I(t,18,t.bl_tree),x(t,a-11,7));a=0,s=i,0===A?(o=138,l=3):i===A?(o=6,l=3):(o=7,l=4)}};let K=!1;const $=(t,e,n,r)=>{x(t,0+(r?1:0),3),R(t),S(t,n),S(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n};var G=(t,e,n,r)=>{let i,s,A=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<l;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),M(t,t.l_desc),M(t,t.d_desc),A=(t=>{let e;for(N(t,t.dyn_ltree,t.l_desc.max_code),N(t,t.dyn_dtree,t.d_desc.max_code),M(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*g[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),i=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?$(t,e,n,r):4===t.strategy||s===i?(x(t,2+(r?1:0),3),P(t,m,_)):(x(t,4+(r?1:0),3),((t,e,n,r)=>{let i;for(x(t,e-257,5),x(t,n-1,5),x(t,r-4,4),i=0;i<r;i++)x(t,t.bl_tree[2*g[i]+1],3);H(t,t.dyn_ltree,e-1),H(t,t.dyn_dtree,n-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,A+1),P(t,t.dyn_ltree,t.dyn_dtree)),L(t),r&&R(t)},V={_tr_init:t=>{K||((()=>{let t,e,n,r,i;const s=new Array(16);for(n=0,r=0;r<28;r++)for(v[r]=n,t=0;t<1<<d[r];t++)y[n++]=r;for(y[n-1]=r,i=0,r=0;r<16;r++)for(B[r]=i,t=0;t<1<<f[r];t++)w[i++]=r;for(i>>=7;r<c;r++)for(B[r]=i<<7,t=0;t<1<<f[r]-7;t++)w[256+i++]=r;for(e=0;e<=h;e++)s[e]=0;for(t=0;t<=143;)m[2*t+1]=8,t++,s[8]++;for(;t<=255;)m[2*t+1]=9,t++,s[9]++;for(;t<=279;)m[2*t+1]=7,t++,s[7]++;for(;t<=287;)m[2*t+1]=8,t++,s[8]++;for(U(m,287,s),t=0;t<c;t++)_[2*t+1]=5,_[2*t]=D(t,5);E=new b(m,d,257,u,h),C=new b(_,f,0,c,h),k=new b(new Array(0),p,0,19,7)})(),K=!0),t.l_desc=new F(t.dyn_ltree,E),t.d_desc=new F(t.dyn_dtree,C),t.bl_desc=new F(t.bl_tree,k),t.bi_buf=0,t.bi_valid=0,L(t)},_tr_stored_block:$,_tr_flush_block:G,_tr_tally:(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(y[n]+l+1)]++,t.dyn_dtree[2*T(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{x(t,2,3),I(t,256,m),(t=>{16===t.bi_valid?(S(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var j=(t,e,n,r)=>{let i=65535&t|0,s=t>>>16&65535|0,A=0;for(;0!==n;){A=n>2e3?2e3:n,n-=A;do{i=i+e[r++]|0,s=s+i|0}while(--A);i%=65521,s%=65521}return i|s<<16|0};const Z=new Uint32Array((()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e})());var W=(t,e,n,r)=>{const i=Z,s=r+n;t^=-1;for(let n=r;n<s;n++)t=t>>>8^i[255&(t^e[n])];return-1^t},z={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Y={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:X,_tr_stored_block:q,_tr_flush_block:J,_tr_tally:tt,_tr_align:et}=V,{Z_NO_FLUSH:nt,Z_PARTIAL_FLUSH:rt,Z_FULL_FLUSH:it,Z_FINISH:st,Z_BLOCK:At,Z_OK:at,Z_STREAM_END:ot,Z_STREAM_ERROR:lt,Z_DATA_ERROR:ut,Z_BUF_ERROR:ct,Z_DEFAULT_COMPRESSION:ht,Z_FILTERED:dt,Z_HUFFMAN_ONLY:ft,Z_RLE:pt,Z_FIXED:gt,Z_DEFAULT_STRATEGY:mt,Z_UNKNOWN:_t,Z_DEFLATED:wt}=Y,yt=258,vt=262,Bt=42,bt=113,Et=666,Ct=(t,e)=>(t.msg=z[e],e),kt=t=>2*t-(t>4?9:0),Ft=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Tt=t=>{let e,n,r,i=t.w_size;e=t.hash_size,r=e;do{n=t.head[--r],t.head[r]=n>=i?n-i:0}while(--e);e=i,r=e;do{n=t.prev[--r],t.prev[r]=n>=i?n-i:0}while(--e)};let St=(t,e,n)=>(e<<t.hash_shift^n)&t.hash_mask;const xt=t=>{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))},It=(t,e)=>{J(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,xt(t.strm)},Dt=(t,e)=>{t.pending_buf[t.pending++]=e},Ut=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Lt=(t,e,n,r)=>{let i=t.avail_in;return i>r&&(i=r),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),n),1===t.state.wrap?t.adler=j(t.adler,e,i,n):2===t.state.wrap&&(t.adler=W(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)},Rt=(t,e)=>{let n,r,i=t.max_chain_length,s=t.strstart,A=t.prev_length,a=t.nice_match;const o=t.strstart>t.w_size-vt?t.strstart-(t.w_size-vt):0,l=t.window,u=t.w_mask,c=t.prev,h=t.strstart+yt;let d=l[s+A-1],f=l[s+A];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do{if(n=e,l[n+A]===f&&l[n+A-1]===d&&l[n]===l[s]&&l[++n]===l[s+1]){s+=2,n++;do{}while(l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&l[++s]===l[++n]&&s<h);if(r=yt-(h-s),s=h-yt,r>A){if(t.match_start=e,A=r,r>=a)break;d=l[s+A-1],f=l[s+A]}}}while((e=c[e&u])>o&&0!=--i);return A<=t.lookahead?A:t.lookahead},Qt=t=>{const e=t.w_size;let n,r,i;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-vt)&&(t.window.set(t.window.subarray(e,e+e-r),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Tt(t),r+=e),0===t.strm.avail_in)break;if(n=Lt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=n,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=St(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=St(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<vt&&0!==t.strm.avail_in)},Ot=(t,e)=>{let n,r,i,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,A=0,a=t.strm.avail_in;do{if(n=65535,i=t.bi_valid+42>>3,t.strm.avail_out<i)break;if(i=t.strm.avail_out-i,r=t.strstart-t.block_start,n>r+t.strm.avail_in&&(n=r+t.strm.avail_in),n>i&&(n=i),n<s&&(0===n&&e!==st||e===nt||n!==r+t.strm.avail_in))break;A=e===st&&n===r+t.strm.avail_in?1:0,q(t,0,0,A),t.pending_buf[t.pending-4]=n,t.pending_buf[t.pending-3]=n>>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,xt(t.strm),r&&(r>n&&(r=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+r),t.strm.next_out),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r,t.block_start+=r,n-=r),n&&(Lt(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(0===A);return a-=t.strm.avail_in,a&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),A?4:e!==nt&&e!==st&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(i=t.window_size-t.strstart,t.strm.avail_in>i&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,i+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),i>t.strm.avail_in&&(i=t.strm.avail_in),i&&(Lt(t.strm,t.window,t.strstart,i),t.strstart+=i,t.insert+=i>t.w_size-t.insert?t.w_size-t.insert:i),t.high_water<t.strstart&&(t.high_water=t.strstart),i=t.bi_valid+42>>3,i=t.pending_buf_size-i>65535?65535:t.pending_buf_size-i,s=i>t.w_size?t.w_size:i,r=t.strstart-t.block_start,(r>=s||(r||e===st)&&e!==nt&&0===t.strm.avail_in&&r<=i)&&(n=r>i?i:r,A=e===st&&0===t.strm.avail_in&&n===r?1:0,q(t,t.block_start,n,A),t.block_start+=n,xt(t.strm)),A?3:1)},Pt=(t,e)=>{let n,r;for(;;){if(t.lookahead<vt){if(Qt(t),t.lookahead<vt&&e===nt)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=St(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-vt&&(t.match_length=Rt(t,n)),t.match_length>=3)if(r=tt(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=St(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=St(t,t.ins_h,t.window[t.strstart+1]);else r=tt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(It(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===st?(It(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(It(t,!1),0===t.strm.avail_out)?1:2},Mt=(t,e)=>{let n,r,i;for(;;){if(t.lookahead<vt){if(Qt(t),t.lookahead<vt&&e===nt)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=St(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-vt&&(t.match_length=Rt(t,n),t.match_length<=5&&(t.strategy===dt||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,r=tt(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=St(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,r&&(It(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(r=tt(t,0,t.window[t.strstart-1]),r&&It(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=tt(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===st?(It(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(It(t,!1),0===t.strm.avail_out)?1:2};function Nt(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}const Ht=[new Nt(0,0,0,0,Ot),new Nt(4,4,8,4,Pt),new Nt(4,5,16,8,Pt),new Nt(4,6,32,32,Pt),new Nt(4,4,16,16,Mt),new Nt(8,16,32,32,Mt),new Nt(8,16,128,128,Mt),new Nt(8,32,128,256,Mt),new Nt(32,128,258,1024,Mt),new Nt(32,258,258,4096,Mt)];function Kt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=wt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Ft(this.dyn_ltree),Ft(this.dyn_dtree),Ft(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Ft(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Ft(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const $t=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==Bt&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==bt&&e.status!==Et?1:0},Gt=t=>{if($t(t))return Ct(t,lt);t.total_in=t.total_out=0,t.data_type=_t;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?Bt:bt,t.adler=2===e.wrap?0:1,e.last_flush=-2,X(e),at},Vt=t=>{const e=Gt(t);var n;return e===at&&((n=t.state).window_size=2*n.w_size,Ft(n.head),n.max_lazy_match=Ht[n.level].max_lazy,n.good_match=Ht[n.level].good_length,n.nice_match=Ht[n.level].nice_length,n.max_chain_length=Ht[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),e},jt=(t,e,n,r,i,s)=>{if(!t)return lt;let A=1;if(e===ht&&(e=6),r<0?(A=0,r=-r):r>15&&(A=2,r-=16),i<1||i>9||n!==wt||r<8||r>15||e<0||e>9||s<0||s>gt||8===r&&1!==A)return Ct(t,lt);8===r&&(r=9);const a=new Kt;return t.state=a,a.strm=t,a.status=Bt,a.wrap=A,a.gzhead=null,a.w_bits=r,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=e,a.strategy=s,a.method=n,Vt(t)};var Zt={deflateInit:(t,e)=>jt(t,e,wt,15,8,mt),deflateInit2:jt,deflateReset:Vt,deflateResetKeep:Gt,deflateSetHeader:(t,e)=>$t(t)||2!==t.state.wrap?lt:(t.state.gzhead=e,at),deflate:(t,e)=>{if($t(t)||e>At||e<0)return t?Ct(t,lt):lt;const n=t.state;if(!t.output||0!==t.avail_in&&!t.input||n.status===Et&&e!==st)return Ct(t,0===t.avail_out?ct:lt);const r=n.last_flush;if(n.last_flush=e,0!==n.pending){if(xt(t),0===t.avail_out)return n.last_flush=-1,at}else if(0===t.avail_in&&kt(e)<=kt(r)&&e!==st)return Ct(t,ct);if(n.status===Et&&0!==t.avail_in)return Ct(t,ct);if(n.status===Bt&&0===n.wrap&&(n.status=bt),n.status===Bt){let e=wt+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=ft||n.level<2?0:n.level<6?1:6===n.level?2:3,e|=r<<6,0!==n.strstart&&(e|=32),e+=31-e%31,Ut(n,e),0!==n.strstart&&(Ut(n,t.adler>>>16),Ut(n,65535&t.adler)),t.adler=1,n.status=bt,xt(t),0!==n.pending)return n.last_flush=-1,at}if(57===n.status)if(t.adler=0,Dt(n,31),Dt(n,139),Dt(n,8),n.gzhead)Dt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Dt(n,255&n.gzhead.time),Dt(n,n.gzhead.time>>8&255),Dt(n,n.gzhead.time>>16&255),Dt(n,n.gzhead.time>>24&255),Dt(n,9===n.level?2:n.strategy>=ft||n.level<2?4:0),Dt(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Dt(n,255&n.gzhead.extra.length),Dt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=W(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(Dt(n,0),Dt(n,0),Dt(n,0),Dt(n,0),Dt(n,0),Dt(n,9===n.level?2:n.strategy>=ft||n.level<2?4:0),Dt(n,3),n.status=bt,xt(t),0!==n.pending)return n.last_flush=-1,at;if(69===n.status){if(n.gzhead.extra){let e=n.pending,r=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>e&&(t.adler=W(t.adler,n.pending_buf,n.pending-e,e)),n.gzindex+=i,xt(t),0!==n.pending)return n.last_flush=-1,at;e=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>e&&(t.adler=W(t.adler,n.pending_buf,n.pending-e,e)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let e,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(t.adler=W(t.adler,n.pending_buf,n.pending-r,r)),xt(t),0!==n.pending)return n.last_flush=-1,at;r=0}e=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,Dt(n,e)}while(0!==e);n.gzhead.hcrc&&n.pending>r&&(t.adler=W(t.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let e,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(t.adler=W(t.adler,n.pending_buf,n.pending-r,r)),xt(t),0!==n.pending)return n.last_flush=-1,at;r=0}e=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,Dt(n,e)}while(0!==e);n.gzhead.hcrc&&n.pending>r&&(t.adler=W(t.adler,n.pending_buf,n.pending-r,r))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(xt(t),0!==n.pending))return n.last_flush=-1,at;Dt(n,255&t.adler),Dt(n,t.adler>>8&255),t.adler=0}if(n.status=bt,xt(t),0!==n.pending)return n.last_flush=-1,at}if(0!==t.avail_in||0!==n.lookahead||e!==nt&&n.status!==Et){let r=0===n.level?Ot(n,e):n.strategy===ft?((t,e)=>{let n;for(;;){if(0===t.lookahead&&(Qt(t),0===t.lookahead)){if(e===nt)return 1;break}if(t.match_length=0,n=tt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(It(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(It(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(It(t,!1),0===t.strm.avail_out)?1:2})(n,e):n.strategy===pt?((t,e)=>{let n,r,i,s;const A=t.window;for(;;){if(t.lookahead<=yt){if(Qt(t),t.lookahead<=yt&&e===nt)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=t.strstart-1,r=A[i],r===A[++i]&&r===A[++i]&&r===A[++i])){s=t.strstart+yt;do{}while(r===A[++i]&&r===A[++i]&&r===A[++i]&&r===A[++i]&&r===A[++i]&&r===A[++i]&&r===A[++i]&&r===A[++i]&&i<s);t.match_length=yt-(s-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=tt(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=tt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(It(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(It(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(It(t,!1),0===t.strm.avail_out)?1:2})(n,e):Ht[n.level].func(n,e);if(3!==r&&4!==r||(n.status=Et),1===r||3===r)return 0===t.avail_out&&(n.last_flush=-1),at;if(2===r&&(e===rt?et(n):e!==At&&(q(n,0,0,!1),e===it&&(Ft(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),xt(t),0===t.avail_out))return n.last_flush=-1,at}return e!==st?at:n.wrap<=0?ot:(2===n.wrap?(Dt(n,255&t.adler),Dt(n,t.adler>>8&255),Dt(n,t.adler>>16&255),Dt(n,t.adler>>24&255),Dt(n,255&t.total_in),Dt(n,t.total_in>>8&255),Dt(n,t.total_in>>16&255),Dt(n,t.total_in>>24&255)):(Ut(n,t.adler>>>16),Ut(n,65535&t.adler)),xt(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?at:ot)},deflateEnd:t=>{if($t(t))return lt;const e=t.state.status;return t.state=null,e===bt?Ct(t,ut):at},deflateSetDictionary:(t,e)=>{let n=e.length;if($t(t))return lt;const r=t.state,i=r.wrap;if(2===i||1===i&&r.status!==Bt||r.lookahead)return lt;if(1===i&&(t.adler=j(t.adler,e,n,0)),r.wrap=0,n>=r.w_size){0===i&&(Ft(r.head),r.strstart=0,r.block_start=0,r.insert=0);let t=new Uint8Array(r.w_size);t.set(e.subarray(n-r.w_size,n),0),e=t,n=r.w_size}const s=t.avail_in,A=t.next_in,a=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,Qt(r);r.lookahead>=3;){let t=r.strstart,e=r.lookahead-2;do{r.ins_h=St(r,r.ins_h,r.window[t+3-1]),r.prev[t&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=t,t++}while(--e);r.strstart=t,r.lookahead=2,Qt(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,t.next_in=A,t.input=a,t.avail_in=s,r.wrap=i,at},deflateInfo:"pako deflate (from Nodeca project)"};const Wt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var zt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const e in n)Wt(n,e)&&(t[e]=n[e])}}return t},Yt=t=>{let e=0;for(let n=0,r=t.length;n<r;n++)e+=t[n].length;const n=new Uint8Array(e);for(let e=0,r=0,i=t.length;e<i;e++){let i=t[e];n.set(i,r),r+=i.length}return n};let Xt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Xt=!1}const qt=new Uint8Array(256);for(let t=0;t<256;t++)qt[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;qt[254]=qt[254]=1;var Jt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,n,r,i,s,A=t.length,a=0;for(i=0;i<A;i++)n=t.charCodeAt(i),55296==(64512&n)&&i+1<A&&(r=t.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),a+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(a),s=0,i=0;s<a;i++)n=t.charCodeAt(i),55296==(64512&n)&&i+1<A&&(r=t.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?e[s++]=n:n<2048?(e[s++]=192|n>>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e},te=(t,e)=>{const n=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let r,i;const s=new Array(2*n);for(i=0,r=0;r<n;){let e=t[r++];if(e<128){s[i++]=e;continue}let A=qt[e];if(A>4)s[i++]=65533,r+=A-1;else{for(e&=2===A?31:3===A?15:7;A>1&&r<n;)e=e<<6|63&t[r++],A--;A>1?s[i++]=65533:e<65536?s[i++]=e:(e-=65536,s[i++]=55296|e>>10&1023,s[i++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Xt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n})(s,i)},ee=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let n=e-1;for(;n>=0&&128==(192&t[n]);)n--;return n<0||0===n?e:n+qt[t[n]]>e?n:e};var ne=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const re=Object.prototype.toString,{Z_NO_FLUSH:ie,Z_SYNC_FLUSH:se,Z_FULL_FLUSH:Ae,Z_FINISH:ae,Z_OK:oe,Z_STREAM_END:le,Z_DEFAULT_COMPRESSION:ue,Z_DEFAULT_STRATEGY:ce,Z_DEFLATED:he}=Y;function de(t){this.options=zt({level:ue,method:he,chunkSize:16384,windowBits:15,memLevel:8,strategy:ce},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ne,this.strm.avail_out=0;let n=Zt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==oe)throw new Error(z[n]);if(e.header&&Zt.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Jt(e.dictionary):"[object ArrayBuffer]"===re.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,n=Zt.deflateSetDictionary(this.strm,t),n!==oe)throw new Error(z[n]);this._dict_set=!0}}function fe(t,e){const n=new de(e);if(n.push(t,!0),n.err)throw n.msg||z[n.err];return n.result}de.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize;let i,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?ae:ie,"string"==typeof t?n.input=Jt(t):"[object ArrayBuffer]"===re.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(s===se||s===Ae)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(i=Zt.deflate(n,s),i===le)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Zt.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===oe;if(0!==n.avail_out){if(s>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},de.prototype.onData=function(t){this.chunks.push(t)},de.prototype.onEnd=function(t){t===oe&&(this.result=Yt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var pe={Deflate:de,deflate:fe,deflateRaw:function(t,e){return(e=e||{}).raw=!0,fe(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,fe(t,e)},constants:Y};const ge=16209;var me=function(t,e){let n,r,i,s,A,a,o,l,u,c,h,d,f,p,g,m,_,w,y,v,B,b,E,C;const k=t.state;n=t.next_in,E=t.input,r=n+(t.avail_in-5),i=t.next_out,C=t.output,s=i-(e-t.avail_out),A=i+(t.avail_out-257),a=k.dmax,o=k.wsize,l=k.whave,u=k.wnext,c=k.window,h=k.hold,d=k.bits,f=k.lencode,p=k.distcode,g=(1<<k.lenbits)-1,m=(1<<k.distbits)-1;t:do{d<15&&(h+=E[n++]<<d,d+=8,h+=E[n++]<<d,d+=8),_=f[h&g];e:for(;;){if(w=_>>>24,h>>>=w,d-=w,w=_>>>16&255,0===w)C[i++]=65535&_;else{if(!(16&w)){if(0==(64&w)){_=f[(65535&_)+(h&(1<<w)-1)];continue e}if(32&w){k.mode=16191;break t}t.msg="invalid literal/length code",k.mode=ge;break t}y=65535&_,w&=15,w&&(d<w&&(h+=E[n++]<<d,d+=8),y+=h&(1<<w)-1,h>>>=w,d-=w),d<15&&(h+=E[n++]<<d,d+=8,h+=E[n++]<<d,d+=8),_=p[h&m];n:for(;;){if(w=_>>>24,h>>>=w,d-=w,w=_>>>16&255,!(16&w)){if(0==(64&w)){_=p[(65535&_)+(h&(1<<w)-1)];continue n}t.msg="invalid distance code",k.mode=ge;break t}if(v=65535&_,w&=15,d<w&&(h+=E[n++]<<d,d+=8,d<w&&(h+=E[n++]<<d,d+=8)),v+=h&(1<<w)-1,v>a){t.msg="invalid distance too far back",k.mode=ge;break t}if(h>>>=w,d-=w,w=i-s,v>w){if(w=v-w,w>l&&k.sane){t.msg="invalid distance too far back",k.mode=ge;break t}if(B=0,b=c,0===u){if(B+=o-w,w<y){y-=w;do{C[i++]=c[B++]}while(--w);B=i-v,b=C}}else if(u<w){if(B+=o+u-w,w-=u,w<y){y-=w;do{C[i++]=c[B++]}while(--w);if(B=0,u<y){w=u,y-=w;do{C[i++]=c[B++]}while(--w);B=i-v,b=C}}}else if(B+=u-w,w<y){y-=w;do{C[i++]=c[B++]}while(--w);B=i-v,b=C}for(;y>2;)C[i++]=b[B++],C[i++]=b[B++],C[i++]=b[B++],y-=3;y&&(C[i++]=b[B++],y>1&&(C[i++]=b[B++]))}else{B=i-v;do{C[i++]=C[B++],C[i++]=C[B++],C[i++]=C[B++],y-=3}while(y>2);y&&(C[i++]=C[B++],y>1&&(C[i++]=C[B++]))}break}}break}}while(n<r&&i<A);y=d>>3,n-=y,d-=y<<3,h&=(1<<d)-1,t.next_in=n,t.next_out=i,t.avail_in=n<r?r-n+5:5-(n-r),t.avail_out=i<A?A-i+257:257-(i-A),k.hold=h,k.bits=d};const _e=15,we=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),ye=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),ve=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Be=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var be=(t,e,n,r,i,s,A,a)=>{const o=a.bits;let l,u,c,h,d,f,p=0,g=0,m=0,_=0,w=0,y=0,v=0,B=0,b=0,E=0,C=null;const k=new Uint16Array(16),F=new Uint16Array(16);let T,S,x,I=null;for(p=0;p<=_e;p++)k[p]=0;for(g=0;g<r;g++)k[e[n+g]]++;for(w=o,_=_e;_>=1&&0===k[_];_--);if(w>_&&(w=_),0===_)return i[s++]=20971520,i[s++]=20971520,a.bits=1,0;for(m=1;m<_&&0===k[m];m++);for(w<m&&(w=m),B=1,p=1;p<=_e;p++)if(B<<=1,B-=k[p],B<0)return-1;if(B>0&&(0===t||1!==_))return-1;for(F[1]=0,p=1;p<_e;p++)F[p+1]=F[p]+k[p];for(g=0;g<r;g++)0!==e[n+g]&&(A[F[e[n+g]]++]=g);if(0===t?(C=I=A,f=20):1===t?(C=we,I=ye,f=257):(C=ve,I=Be,f=0),E=0,g=0,p=m,d=s,y=w,v=0,c=-1,b=1<<w,h=b-1,1===t&&b>852||2===t&&b>592)return 1;for(;;){T=p-v,A[g]+1<f?(S=0,x=A[g]):A[g]>=f?(S=I[A[g]-f],x=C[A[g]-f]):(S=96,x=0),l=1<<p-v,u=1<<y,m=u;do{u-=l,i[d+(E>>v)+u]=T<<24|S<<16|x|0}while(0!==u);for(l=1<<p-1;E&l;)l>>=1;if(0!==l?(E&=l-1,E+=l):E=0,g++,0==--k[p]){if(p===_)break;p=e[n+A[g]]}if(p>w&&(E&h)!==c){for(0===v&&(v=w),d+=m,y=p-v,B=1<<y;y+v<_&&(B-=k[y+v],!(B<=0));)y++,B<<=1;if(b+=1<<y,1===t&&b>852||2===t&&b>592)return 1;c=E&h,i[c]=w<<24|y<<16|d-s|0}}return 0!==E&&(i[d+E]=p-v<<24|64<<16|0),a.bits=w,0};const{Z_FINISH:Ee,Z_BLOCK:Ce,Z_TREES:ke,Z_OK:Fe,Z_STREAM_END:Te,Z_NEED_DICT:Se,Z_STREAM_ERROR:xe,Z_DATA_ERROR:Ie,Z_MEM_ERROR:De,Z_BUF_ERROR:Ue,Z_DEFLATED:Le}=Y,Re=16180,Qe=16190,Oe=16191,Pe=16192,Me=16194,Ne=16199,He=16200,Ke=16206,$e=16209,Ge=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Ve(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const je=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<Re||e.mode>16211?1:0},Ze=t=>{if(je(t))return xe;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=Re,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,Fe},We=t=>{if(je(t))return xe;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Ze(t)},ze=(t,e)=>{let n;if(je(t))return xe;const r=t.state;return e<0?(n=0,e=-e):(n=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?xe:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,We(t))},Ye=(t,e)=>{if(!t)return xe;const n=new Ve;t.state=n,n.strm=t,n.window=null,n.mode=Re;const r=ze(t,e);return r!==Fe&&(t.state=null),r};let Xe,qe,Je=!0;const tn=t=>{if(Je){Xe=new Int32Array(512),qe=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(be(1,t.lens,0,288,Xe,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;be(2,t.lens,0,32,qe,0,t.work,{bits:5}),Je=!1}t.lencode=Xe,t.lenbits=9,t.distcode=qe,t.distbits=5},en=(t,e,n,r)=>{let i;const s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),r>=s.wsize?(s.window.set(e.subarray(n-s.wsize,n),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>r&&(i=r),s.window.set(e.subarray(n-r,n-r+i),s.wnext),(r-=i)?(s.window.set(e.subarray(n-r,n),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0};var nn={inflateReset:We,inflateReset2:ze,inflateResetKeep:Ze,inflateInit:t=>Ye(t,15),inflateInit2:Ye,inflate:(t,e)=>{let n,r,i,s,A,a,o,l,u,c,h,d,f,p,g,m,_,w,y,v,B,b,E=0;const C=new Uint8Array(4);let k,F;const T=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(je(t)||!t.output||!t.input&&0!==t.avail_in)return xe;n=t.state,n.mode===Oe&&(n.mode=Pe),A=t.next_out,i=t.output,o=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,l=n.hold,u=n.bits,c=a,h=o,b=Fe;t:for(;;)switch(n.mode){case Re:if(0===n.wrap){n.mode=Pe;break}for(;u<16;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}if(2&n.wrap&&35615===l){0===n.wbits&&(n.wbits=15),n.check=0,C[0]=255&l,C[1]=l>>>8&255,n.check=W(n.check,C,2,0),l=0,u=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){t.msg="incorrect header check",n.mode=$e;break}if((15&l)!==Le){t.msg="unknown compression method",n.mode=$e;break}if(l>>>=4,u-=4,B=8+(15&l),0===n.wbits&&(n.wbits=B),B>15||B>n.wbits){t.msg="invalid window size",n.mode=$e;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=512&l?16189:Oe,l=0,u=0;break;case 16181:for(;u<16;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}if(n.flags=l,(255&n.flags)!==Le){t.msg="unknown compression method",n.mode=$e;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=$e;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(C[0]=255&l,C[1]=l>>>8&255,n.check=W(n.check,C,2,0)),l=0,u=0,n.mode=16182;case 16182:for(;u<32;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}n.head&&(n.head.time=l),512&n.flags&&4&n.wrap&&(C[0]=255&l,C[1]=l>>>8&255,C[2]=l>>>16&255,C[3]=l>>>24&255,n.check=W(n.check,C,4,0)),l=0,u=0,n.mode=16183;case 16183:for(;u<16;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}n.head&&(n.head.xflags=255&l,n.head.os=l>>8),512&n.flags&&4&n.wrap&&(C[0]=255&l,C[1]=l>>>8&255,n.check=W(n.check,C,2,0)),l=0,u=0,n.mode=16184;case 16184:if(1024&n.flags){for(;u<16;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),512&n.flags&&4&n.wrap&&(C[0]=255&l,C[1]=l>>>8&255,n.check=W(n.check,C,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(d=n.length,d>a&&(d=a),d&&(n.head&&(B=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(s,s+d),B)),512&n.flags&&4&n.wrap&&(n.check=W(n.check,r,d,s)),a-=d,s+=d,n.length-=d),n.length))break t;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===a)break t;d=0;do{B=r[s+d++],n.head&&B&&n.length<65536&&(n.head.name+=String.fromCharCode(B))}while(B&&d<a);if(512&n.flags&&4&n.wrap&&(n.check=W(n.check,r,d,s)),a-=d,s+=d,B)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===a)break t;d=0;do{B=r[s+d++],n.head&&B&&n.length<65536&&(n.head.comment+=String.fromCharCode(B))}while(B&&d<a);if(512&n.flags&&4&n.wrap&&(n.check=W(n.check,r,d,s)),a-=d,s+=d,B)break t}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;u<16;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}if(4&n.wrap&&l!==(65535&n.check)){t.msg="header crc mismatch",n.mode=$e;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=Oe;break;case 16189:for(;u<32;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}t.adler=n.check=Ge(l),l=0,u=0,n.mode=Qe;case Qe:if(0===n.havedict)return t.next_out=A,t.avail_out=o,t.next_in=s,t.avail_in=a,n.hold=l,n.bits=u,Se;t.adler=n.check=1,n.mode=Oe;case Oe:if(e===Ce||e===ke)break t;case Pe:if(n.last){l>>>=7&u,u-=7&u,n.mode=Ke;break}for(;u<3;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}switch(n.last=1&l,l>>>=1,u-=1,3&l){case 0:n.mode=16193;break;case 1:if(tn(n),n.mode=Ne,e===ke){l>>>=2,u-=2;break t}break;case 2:n.mode=16196;break;case 3:t.msg="invalid block type",n.mode=$e}l>>>=2,u-=2;break;case 16193:for(l>>>=7&u,u-=7&u;u<32;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}if((65535&l)!=(l>>>16^65535)){t.msg="invalid stored block lengths",n.mode=$e;break}if(n.length=65535&l,l=0,u=0,n.mode=Me,e===ke)break t;case Me:n.mode=16195;case 16195:if(d=n.length,d){if(d>a&&(d=a),d>o&&(d=o),0===d)break t;i.set(r.subarray(s,s+d),A),a-=d,s+=d,o-=d,A+=d,n.length-=d;break}n.mode=Oe;break;case 16196:for(;u<14;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}if(n.nlen=257+(31&l),l>>>=5,u-=5,n.ndist=1+(31&l),l>>>=5,u-=5,n.ncode=4+(15&l),l>>>=4,u-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=$e;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;u<3;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}n.lens[T[n.have++]]=7&l,l>>>=3,u-=3}for(;n.have<19;)n.lens[T[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,k={bits:n.lenbits},b=be(0,n.lens,0,19,n.lencode,0,n.work,k),n.lenbits=k.bits,b){t.msg="invalid code lengths set",n.mode=$e;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;E=n.lencode[l&(1<<n.lenbits)-1],g=E>>>24,m=E>>>16&255,_=65535&E,!(g<=u);){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}if(_<16)l>>>=g,u-=g,n.lens[n.have++]=_;else{if(16===_){for(F=g+2;u<F;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}if(l>>>=g,u-=g,0===n.have){t.msg="invalid bit length repeat",n.mode=$e;break}B=n.lens[n.have-1],d=3+(3&l),l>>>=2,u-=2}else if(17===_){for(F=g+3;u<F;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}l>>>=g,u-=g,B=0,d=3+(7&l),l>>>=3,u-=3}else{for(F=g+7;u<F;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}l>>>=g,u-=g,B=0,d=11+(127&l),l>>>=7,u-=7}if(n.have+d>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=$e;break}for(;d--;)n.lens[n.have++]=B}}if(n.mode===$e)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=$e;break}if(n.lenbits=9,k={bits:n.lenbits},b=be(1,n.lens,0,n.nlen,n.lencode,0,n.work,k),n.lenbits=k.bits,b){t.msg="invalid literal/lengths set",n.mode=$e;break}if(n.distbits=6,n.distcode=n.distdyn,k={bits:n.distbits},b=be(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,k),n.distbits=k.bits,b){t.msg="invalid distances set",n.mode=$e;break}if(n.mode=Ne,e===ke)break t;case Ne:n.mode=He;case He:if(a>=6&&o>=258){t.next_out=A,t.avail_out=o,t.next_in=s,t.avail_in=a,n.hold=l,n.bits=u,me(t,h),A=t.next_out,i=t.output,o=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,l=n.hold,u=n.bits,n.mode===Oe&&(n.back=-1);break}for(n.back=0;E=n.lencode[l&(1<<n.lenbits)-1],g=E>>>24,m=E>>>16&255,_=65535&E,!(g<=u);){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}if(m&&0==(240&m)){for(w=g,y=m,v=_;E=n.lencode[v+((l&(1<<w+y)-1)>>w)],g=E>>>24,m=E>>>16&255,_=65535&E,!(w+g<=u);){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}l>>>=w,u-=w,n.back+=w}if(l>>>=g,u-=g,n.back+=g,n.length=_,0===m){n.mode=16205;break}if(32&m){n.back=-1,n.mode=Oe;break}if(64&m){t.msg="invalid literal/length code",n.mode=$e;break}n.extra=15&m,n.mode=16201;case 16201:if(n.extra){for(F=n.extra;u<F;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;E=n.distcode[l&(1<<n.distbits)-1],g=E>>>24,m=E>>>16&255,_=65535&E,!(g<=u);){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}if(0==(240&m)){for(w=g,y=m,v=_;E=n.distcode[v+((l&(1<<w+y)-1)>>w)],g=E>>>24,m=E>>>16&255,_=65535&E,!(w+g<=u);){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}l>>>=w,u-=w,n.back+=w}if(l>>>=g,u-=g,n.back+=g,64&m){t.msg="invalid distance code",n.mode=$e;break}n.offset=_,n.extra=15&m,n.mode=16203;case 16203:if(n.extra){for(F=n.extra;u<F;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=$e;break}n.mode=16204;case 16204:if(0===o)break t;if(d=h-o,n.offset>d){if(d=n.offset-d,d>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=$e;break}d>n.wnext?(d-=n.wnext,f=n.wsize-d):f=n.wnext-d,d>n.length&&(d=n.length),p=n.window}else p=i,f=A-n.offset,d=n.length;d>o&&(d=o),o-=d,n.length-=d;do{i[A++]=p[f++]}while(--d);0===n.length&&(n.mode=He);break;case 16205:if(0===o)break t;i[A++]=n.length,o--,n.mode=He;break;case Ke:if(n.wrap){for(;u<32;){if(0===a)break t;a--,l|=r[s++]<<u,u+=8}if(h-=o,t.total_out+=h,n.total+=h,4&n.wrap&&h&&(t.adler=n.check=n.flags?W(n.check,i,h,A-h):j(n.check,i,h,A-h)),h=o,4&n.wrap&&(n.flags?l:Ge(l))!==n.check){t.msg="incorrect data check",n.mode=$e;break}l=0,u=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;u<32;){if(0===a)break t;a--,l+=r[s++]<<u,u+=8}if(4&n.wrap&&l!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=$e;break}l=0,u=0}n.mode=16208;case 16208:b=Te;break t;case $e:b=Ie;break t;case 16210:return De;default:return xe}return t.next_out=A,t.avail_out=o,t.next_in=s,t.avail_in=a,n.hold=l,n.bits=u,(n.wsize||h!==t.avail_out&&n.mode<$e&&(n.mode<Ke||e!==Ee))&&en(t,t.output,t.next_out,h-t.avail_out),c-=t.avail_in,h-=t.avail_out,t.total_in+=c,t.total_out+=h,n.total+=h,4&n.wrap&&h&&(t.adler=n.check=n.flags?W(n.check,i,h,t.next_out-h):j(n.check,i,h,t.next_out-h)),t.data_type=n.bits+(n.last?64:0)+(n.mode===Oe?128:0)+(n.mode===Ne||n.mode===Me?256:0),(0===c&&0===h||e===Ee)&&b===Fe&&(b=Ue),b},inflateEnd:t=>{if(je(t))return xe;let e=t.state;return e.window&&(e.window=null),t.state=null,Fe},inflateGetHeader:(t,e)=>{if(je(t))return xe;const n=t.state;return 0==(2&n.wrap)?xe:(n.head=e,e.done=!1,Fe)},inflateSetDictionary:(t,e)=>{const n=e.length;let r,i,s;return je(t)?xe:(r=t.state,0!==r.wrap&&r.mode!==Qe?xe:r.mode===Qe&&(i=1,i=j(i,e,n,0),i!==r.check)?Ie:(s=en(t,e,n,n),s?(r.mode=16210,De):(r.havedict=1,Fe)))},inflateInfo:"pako inflate (from Nodeca project)"};var rn=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const sn=Object.prototype.toString,{Z_NO_FLUSH:An,Z_FINISH:an,Z_OK:on,Z_STREAM_END:ln,Z_NEED_DICT:un,Z_STREAM_ERROR:cn,Z_DATA_ERROR:hn,Z_MEM_ERROR:dn}=Y;function fn(t){this.options=zt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ne,this.strm.avail_out=0;let n=nn.inflateInit2(this.strm,e.windowBits);if(n!==on)throw new Error(z[n]);if(this.header=new rn,nn.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Jt(e.dictionary):"[object ArrayBuffer]"===sn.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=nn.inflateSetDictionary(this.strm,e.dictionary),n!==on)))throw new Error(z[n])}function pn(t,e){const n=new fn(e);if(n.push(t),n.err)throw n.msg||z[n.err];return n.result}fn.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let s,A,a;if(this.ended)return!1;for(A=e===~~e?e:!0===e?an:An,"[object ArrayBuffer]"===sn.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),s=nn.inflate(n,A),s===un&&i&&(s=nn.inflateSetDictionary(n,i),s===on?s=nn.inflate(n,A):s===hn&&(s=un));n.avail_in>0&&s===ln&&n.state.wrap>0&&0!==t[n.next_in];)nn.inflateReset(n),s=nn.inflate(n,A);switch(s){case cn:case hn:case un:case dn:return this.onEnd(s),this.ended=!0,!1}if(a=n.avail_out,n.next_out&&(0===n.avail_out||s===ln))if("string"===this.options.to){let t=ee(n.output,n.next_out),e=n.next_out-t,i=te(n.output,t);n.next_out=e,n.avail_out=r-e,e&&n.output.set(n.output.subarray(t,t+e),0),this.onData(i)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(s!==on||0!==a){if(s===ln)return s=nn.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},fn.prototype.onData=function(t){this.chunks.push(t)},fn.prototype.onEnd=function(t){t===on&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Yt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var gn={Inflate:fn,inflate:pn,inflateRaw:function(t,e){return(e=e||{}).raw=!0,pn(t,e)},ungzip:pn,constants:Y};const{Deflate:mn,deflate:_n,deflateRaw:wn,gzip:yn}=pe,{Inflate:vn,inflate:Bn,inflateRaw:bn,ungzip:En}=gn;var Cn=vn,kn=Bn;const Fn=[];for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)1&e?e=3988292384^e>>>1:e>>>=1;Fn[t]=e}const Tn=4294967295;function Sn(t,e){return(function(t,e,n){let r=t;for(let t=0;t<n;t++)r=Fn[255&(r^e[t])]^r>>>8;return r}(Tn,t,e)^Tn)>>>0}function xn(t,e,n){const r=t.readUint32(),i=Sn(new Uint8Array(t.buffer,t.byteOffset+t.offset-e-4,e),e);if(i!==r)throw new Error(`CRC mismatch for chunk ${n}. Expected ${r}, found ${i}`)}function In(t,e,n){for(let r=0;r<n;r++)e[r]=t[r]}function Dn(t,e,n,r){let i=0;for(;i<r;i++)e[i]=t[i];for(;i<n;i++)e[i]=t[i]+e[i-r]&255}function Un(t,e,n,r){let i=0;if(0===n.length)for(;i<r;i++)e[i]=t[i];else for(;i<r;i++)e[i]=t[i]+n[i]&255}function Ln(t,e,n,r,i){let s=0;if(0===n.length){for(;s<i;s++)e[s]=t[s];for(;s<r;s++)e[s]=t[s]+(e[s-i]>>1)&255}else{for(;s<i;s++)e[s]=t[s]+(n[s]>>1)&255;for(;s<r;s++)e[s]=t[s]+(e[s-i]+n[s]>>1)&255}}function Rn(t,e,n,r,i){let s=0;if(0===n.length){for(;s<i;s++)e[s]=t[s];for(;s<r;s++)e[s]=t[s]+e[s-i]&255}else{for(;s<i;s++)e[s]=t[s]+n[s]&255;for(;s<r;s++)e[s]=t[s]+Qn(e[s-i],n[s],n[s-i])&255}}function Qn(t,e,n){const r=t+e-n,i=Math.abs(r-t),s=Math.abs(r-e),A=Math.abs(r-n);return i<=s&&i<=A?t:s<=A?e:n}function On(t,e,n,r,i,s){switch(t){case 0:In(e,n,i);break;case 1:Dn(e,n,i,s);break;case 2:Un(e,n,r,i);break;case 3:Ln(e,n,r,i,s);break;case 4:Rn(e,n,r,i,s);break;default:throw new Error(`Unsupported filter: ${t}`)}}const Pn=new Uint16Array([255]),Mn=255===new Uint8Array(Pn.buffer)[0];const Nn=new Uint16Array([255]),Hn=255===new Uint8Array(Nn.buffer)[0],Kn=new Uint8Array(0);function $n(t){const{data:e,width:n,height:r,channels:i,depth:s}=t,A=Math.ceil(s/8)*i,a=Math.ceil(s/8*i*n),o=new Uint8Array(r*a);let l,u,c=Kn,h=0;for(let t=0;t<r;t++){switch(l=e.subarray(h+1,h+1+a),u=o.subarray(t*a,(t+1)*a),e[h]){case 0:In(l,u,a);break;case 1:Dn(l,u,a,A);break;case 2:Un(l,u,c,a);break;case 3:Ln(l,u,c,a,A);break;case 4:Rn(l,u,c,a,A);break;default:throw new Error(`Unsupported filter: ${e[h]}`)}c=u,h+=a+1}if(16===s){const t=new Uint16Array(o.buffer);if(Hn)for(let e=0;e<t.length;e++)t[e]=(255&(d=t[e]))<<8|d>>8&255;return t}return o;var d}const Gn=Uint8Array.of(137,80,78,71,13,10,26,10);function Vn(t){if(!function(t){if(t.length<Gn.length)return!1;for(let e=0;e<Gn.length;e++)if(t[e]!==Gn[e])return!1;return!0}(t.readBytes(Gn.length)))throw new Error("wrong PNG signature")}const jn="tEXt",Zn=new TextDecoder("latin1");function Wn(t){if(Yn(t),0===t.length||t.length>79)throw new Error("keyword length must be between 1 and 79")}const zn=/^[\u0000-\u00FF]*$/;function Yn(t){if(!zn.test(t))throw new Error("invalid latin1 text")}function Xn(t,e,n){const r=qn(e);t[r]=function(t,e){return Zn.decode(t.readBytes(e))}(e,n-r.length-1)}function qn(t){for(t.mark();0!==t.readByte(););const e=t.offset;t.reset();const n=Zn.decode(t.readBytes(e-t.offset-1));return t.skip(1),Wn(n),n}const Jn=-1,tr=0,er=2,nr=3,rr=4,ir=6,sr=-1,Ar=0,ar=-1,or=0,lr=-1,ur=0,cr=1,hr=0,dr=1,fr=2,pr=0,gr=1;class mr extends a{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(t,e={}){super(t);const{checkCrc:n=!1}=e;this._checkCrc=n,this._inflator=new Cn,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=sr,this._filterMethod=ar,this._interlaceMethod=lr,this._colorType=Jn,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(Vn(this);!this._end;){const t=this.readUint32(),e=this.readChars(4);this.decodeChunk(t,e)}return this.decodeImage(),this._png}decodeApng(){for(Vn(this);!this._end;){const t=this.readUint32(),e=this.readChars(4);this.decodeApngChunk(t,e)}return this.decodeApngImage(),this._apng}decodeChunk(t,e){const n=this.offset;switch(e){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(t);break;case"IDAT":this.decodeIDAT(t);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(t);break;case"iCCP":this.decodeiCCP(t);break;case jn:Xn(this._png.text,this,t);break;case"pHYs":this.decodepHYs();break;default:this.skip(t)}if(this.offset-n!==t)throw new Error(`Length mismatch while decoding chunk ${e}`);this._checkCrc?xn(this,t+4,e):this.skip(4)}decodeApngChunk(t,e){const n=this.offset;switch("fdAT"!==e&&"IDAT"!==e&&this._writingDataChunks&&this.pushDataToFrame(),e){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(t);break;default:this.decodeChunk(t,e),this.offset=n+t}if(this.offset-n!==t)throw new Error(`Length mismatch while decoding chunk ${e}`);this._checkCrc?xn(this,t+4,e):this.skip(4)}decodeIHDR(){const t=this._png;t.width=this.readUint32(),t.height=this.readUint32(),t.depth=function(t){if(1!==t&&2!==t&&4!==t&&8!==t&&16!==t)throw new Error(`invalid bit depth: ${t}`);return t}(this.readUint8());const e=this.readUint8();let n;switch(this._colorType=e,e){case tr:n=1;break;case er:n=3;break;case nr:n=1;break;case rr:n=2;break;case ir:n=4;break;default:throw new Error(`Unknown color type: ${e}`)}if(this._png.channels=n,this._compressionMethod=this.readUint8(),this._compressionMethod!==Ar)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const t={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(t)}decodePLTE(t){if(t%3!=0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);const e=t/3;this._hasPalette=!0;const n=[];this._palette=n;for(let t=0;t<e;t++)n.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(t){this._writingDataChunks=!0;const e=t,n=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,n,e)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(t)}decodeFDAT(t){this._writingDataChunks=!0;let e=t,n=this.offset+this.byteOffset;if(n+=4,e-=4,this._inflator.push(new Uint8Array(this.buffer,n,e)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(t)}decodetRNS(t){switch(this._colorType){case tr:case er:if(t%2!=0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${t}`);if(t/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${t/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(t/2);for(let e=0;e<t/2;e++)this._transparency[e]=this.readUint16();break;case nr:{if(t>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);let e=0;for(;e<t;e++){const t=this.readByte();this._palette[e].push(t)}for(;e<this._palette.length;e++)this._palette[e].push(255);break}default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(t){const e=qn(this),n=this.readUint8();if(n!==Ar)throw new Error(`Unsupported iCCP compression method: ${n}`);const r=this.readBytes(t-e.length-2);this._png.iccEmbeddedProfile={name:e,profile:kn(r)}}decodepHYs(){const t=this.readUint32(),e=this.readUint32(),n=this.readByte();this._png.resolution={x:t,y:e,unit:n}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let t=0;t<this._numberOfFrames;t++){const e={sequenceNumber:this._frames[t].sequenceNumber,delayNumber:this._frames[t].delayNumber,delayDenominator:this._frames[t].delayDenominator,data:8===this._apng.depth?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},n=this._frames.at(t);if(n){if(n.data=$n({data:n.data,width:n.width,height:n.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),0===t||0===n.xOffset&&0===n.yOffset&&n.width===this._png.width&&n.height===this._png.height)e.data=n.data;else{const r=this._apng.frames.at(t-1);this.disposeFrame(n,r,e),this.addFrameDataToCanvas(e,n)}this._apng.frames.push(e)}}return this._apng}disposeFrame(t,e,n){switch(t.disposeOp){case hr:break;case dr:for(let e=0;e<this._png.height;e++)for(let r=0;r<this._png.width;r++){const i=(e*t.width+r)*this._png.channels;for(let t=0;t<this._png.channels;t++)n.data[i+t]=0}break;case fr:n.data.set(e.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(t,e){const n=1<<this._png.depth,r=(t,n)=>({index:((t+e.yOffset)*this._png.width+e.xOffset+n)*this._png.channels,frameIndex:(t*e.width+n)*this._png.channels});switch(e.blendOp){case pr:for(let n=0;n<e.height;n++)for(let i=0;i<e.width;i++){const{index:s,frameIndex:A}=r(n,i);for(let n=0;n<this._png.channels;n++)t.data[s+n]=e.data[A+n]}break;case gr:for(let i=0;i<e.height;i++)for(let s=0;s<e.width;s++){const{index:A,frameIndex:a}=r(i,s);for(let r=0;r<this._png.channels;r++){const i=e.data[a+this._png.channels-1]/n,s=r%(this._png.channels-1)==0?1:e.data[a+r],o=Math.floor(i*s+(1-i)*t.data[A+r]);t.data[A+r]+=o}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const t=this._isAnimated?this._frames?.at(0).data:this._inflator.result;if(this._filterMethod!==or)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===ur)this._png.data=$n({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else{if(this._interlaceMethod!==cr)throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._png.data=function(t){const{data:e,width:n,height:r,channels:i,depth:s}=t,A=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],a=Math.ceil(s/8)*i,o=new Uint8Array(r*n*a);let l=0;for(let t=0;t<7;t++){const i=A[t],s=Math.ceil((n-i.x)/i.xStep),u=Math.ceil((r-i.y)/i.yStep);if(s<=0||u<=0)continue;const c=s*a,h=new Uint8Array(c);for(let t=0;t<u;t++){const A=e[l++],u=e.subarray(l,l+c);l+=c;const d=new Uint8Array(c);On(A,u,d,h,c,a),h.set(d);for(let e=0;e<s;e++){const s=i.x+e*i.xStep,A=i.y+t*i.yStep;if(!(s>=n||A>=r))for(let t=0;t<a;t++)o[(A*n+s)*a+t]=d[e*a+t]}}}if(16===s){const t=new Uint16Array(o.buffer);if(Mn)for(let e=0;e<t.length;e++)t[e]=(255&(u=t[e]))<<8|u>>8&255;return t}return o;var u}({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth})}this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const t=this._inflator.result,e=this._frames.at(-1);e?e.data=t:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:hr,blendOp:pr,data:t}),this._inflator=new Cn,this._writingDataChunks=!1}}var _r;function wr(t,e){return new mr(t,e).decode()}!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.METRE=1]="METRE"}(_r||(_r={}))},6330:function(t,e,n){"use strict";n.d(e,{iZ:function(){return N}});var r=Uint8Array,i=Uint16Array,s=Int32Array,A=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l=function(t,e){for(var n=new i(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var A=new s(n[30]);for(r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)A[a]=a-n[r]<<5|r;return{b:n,r:A}},u=l(A,2),c=u.b,h=u.r;c[28]=258,h[258]=28;for(var d=l(a,0),f=(d.b,d.r),p=new i(32768),g=0;g<32768;++g){var m=(43690&g)>>1|(21845&g)<<1;m=(61680&(m=(52428&m)>>2|(13107&m)<<2))>>4|(3855&m)<<4,p[g]=((65280&m)>>8|(255&m)<<8)>>1}var _=function(t,e,n){for(var r=t.length,s=0,A=new i(e);s<r;++s)t[s]&&++A[t[s]-1];var a,o=new i(e);for(s=1;s<e;++s)o[s]=o[s-1]+A[s-1]<<1;if(n){a=new i(1<<e);var l=15-e;for(s=0;s<r;++s)if(t[s])for(var u=s<<4|t[s],c=e-t[s],h=o[t[s]-1]++<<c,d=h|(1<<c)-1;h<=d;++h)a[p[h]>>l]=u}else for(a=new i(r),s=0;s<r;++s)t[s]&&(a[s]=p[o[t[s]-1]++]>>15-t[s]);return a},w=new r(288);for(g=0;g<144;++g)w[g]=8;for(g=144;g<256;++g)w[g]=9;for(g=256;g<280;++g)w[g]=7;for(g=280;g<288;++g)w[g]=8;var y=new r(32);for(g=0;g<32;++g)y[g]=5;var v=_(w,9,0),B=_(y,5,0),b=function(t){return(t+7)/8|0},E=function(t,e,n){return(null==e||e<0)&&(e=0),(null==n||n>t.length)&&(n=t.length),new r(t.subarray(e,n))},C=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},k=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},F=function(t,e){for(var n=[],s=0;s<t.length;++s)t[s]&&n.push({s:s,f:t[s]});var A=n.length,a=n.slice();if(!A)return{t:L,l:0};if(1==A){var o=new r(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort((function(t,e){return t.f-e.f})),n.push({s:-1,f:25001});var l=n[0],u=n[1],c=0,h=1,d=2;for(n[0]={s:-1,f:l.f+u.f,l:l,r:u};h!=A-1;)l=n[n[c].f<n[d].f?c++:d++],u=n[c!=h&&n[c].f<n[d].f?c++:d++],n[h++]={s:-1,f:l.f+u.f,l:l,r:u};var f=a[0].s;for(s=1;s<A;++s)a[s].s>f&&(f=a[s].s);var p=new i(f+1),g=T(n[h-1],p,0);if(g>e){s=0;var m=0,_=g-e,w=1<<_;for(a.sort((function(t,e){return p[e.s]-p[t.s]||t.f-e.f}));s<A;++s){var y=a[s].s;if(!(p[y]>e))break;m+=w-(1<<g-p[y]),p[y]=e}for(m>>=_;m>0;){var v=a[s].s;p[v]<e?m-=1<<e-p[v]++-1:++s}for(;s>=0&&m;--s){var B=a[s].s;p[B]==e&&(--p[B],++m)}g=e}return{t:new r(p),l:g}},T=function(t,e,n){return-1==t.s?Math.max(T(t.l,e,n+1),T(t.r,e,n+1)):e[t.s]=n},S=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new i(++e),r=0,s=t[0],A=1,a=function(t){n[r++]=t},o=1;o<=e;++o)if(t[o]==s&&o!=e)++A;else{if(!s&&A>2){for(;A>138;A-=138)a(32754);A>2&&(a(A>10?A-11<<5|28690:A-3<<5|12305),A=0)}else if(A>3){for(a(s),--A;A>6;A-=6)a(8304);A>2&&(a(A-3<<5|8208),A=0)}for(;A--;)a(s);A=1,s=t[o]}return{c:n.subarray(0,r),n:e}},x=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},I=function(t,e,n){var r=n.length,i=b(e+2);t[i]=255&r,t[i+1]=r>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<r;++s)t[i+s+4]=n[s];return 8*(i+4+r)},D=function(t,e,n,r,s,l,u,c,h,d,f){C(e,f++,n),++s[256];for(var p=F(s,15),g=p.t,m=p.l,b=F(l,15),E=b.t,T=b.l,D=S(g),U=D.c,L=D.n,R=S(E),Q=R.c,O=R.n,P=new i(19),M=0;M<U.length;++M)++P[31&U[M]];for(M=0;M<Q.length;++M)++P[31&Q[M]];for(var N=F(P,7),H=N.t,K=N.l,$=19;$>4&&!H[o[$-1]];--$);var G,V,j,Z,W=d+5<<3,z=x(s,w)+x(l,y)+u,Y=x(s,g)+x(l,E)+u+14+3*$+x(P,H)+2*P[16]+3*P[17]+7*P[18];if(h>=0&&W<=z&&W<=Y)return I(e,f,t.subarray(h,h+d));if(C(e,f,1+(Y<z)),f+=2,Y<z){G=_(g,m,0),V=g,j=_(E,T,0),Z=E;var X=_(H,K,0);C(e,f,L-257),C(e,f+5,O-1),C(e,f+10,$-4),f+=14;for(M=0;M<$;++M)C(e,f+3*M,H[o[M]]);f+=3*$;for(var q=[U,Q],J=0;J<2;++J){var tt=q[J];for(M=0;M<tt.length;++M){var et=31&tt[M];C(e,f,X[et]),f+=H[et],et>15&&(C(e,f,tt[M]>>5&127),f+=tt[M]>>12)}}}else G=v,V=w,j=B,Z=y;for(M=0;M<c;++M){var nt=r[M];if(nt>255){k(e,f,G[(et=nt>>18&31)+257]),f+=V[et+257],et>7&&(C(e,f,nt>>23&31),f+=A[et]);var rt=31&nt;k(e,f,j[rt]),f+=Z[rt],rt>3&&(k(e,f,nt>>5&8191),f+=a[rt])}else k(e,f,G[nt]),f+=V[nt]}return k(e,f,G[256]),f+V[256]},U=new s([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),L=new r(0),R=function(t,e,n,o,l,u){var c=u.z||t.length,d=new r(o+c+5*(1+Math.ceil(c/7e3))+l),p=d.subarray(o,d.length-l),g=u.l,m=7&(u.r||0);if(e){m&&(p[0]=u.r>>3);for(var _=U[e-1],w=_>>13,y=8191&_,v=(1<<n)-1,B=u.p||new i(32768),C=u.h||new i(v+1),k=Math.ceil(n/3),F=2*k,T=function(e){return(t[e]^t[e+1]<<k^t[e+2]<<F)&v},S=new s(25e3),x=new i(288),L=new i(32),R=0,Q=0,O=u.i||0,P=0,M=u.w||0,N=0;O+2<c;++O){var H=T(O),K=32767&O,$=C[H];if(B[K]=$,C[H]=K,M<=O){var G=c-O;if((R>7e3||P>24576)&&(G>423||!g)){m=D(t,p,0,S,x,L,Q,P,N,O-N,m),P=R=Q=0,N=O;for(var V=0;V<286;++V)x[V]=0;for(V=0;V<30;++V)L[V]=0}var j=2,Z=0,W=y,z=K-$&32767;if(G>2&&H==T(O-z))for(var Y=Math.min(w,G)-1,X=Math.min(32767,O),q=Math.min(258,G);z<=X&&--W&&K!=$;){if(t[O+j]==t[O+j-z]){for(var J=0;J<q&&t[O+J]==t[O+J-z];++J);if(J>j){if(j=J,Z=z,J>Y)break;var tt=Math.min(z,J-2),et=0;for(V=0;V<tt;++V){var nt=O-z+V&32767,rt=nt-B[nt]&32767;rt>et&&(et=rt,$=nt)}}}z+=(K=$)-($=B[K])&32767}if(Z){S[P++]=268435456|h[j]<<18|f[Z];var it=31&h[j],st=31&f[Z];Q+=A[it]+a[st],++x[257+it],++L[st],M=O+j,++R}else S[P++]=t[O],++x[t[O]]}}for(O=Math.max(O,M);O<c;++O)S[P++]=t[O],++x[t[O]];m=D(t,p,g,S,x,L,Q,P,N,O-N,m),g||(u.r=7&m|p[m/8|0]<<3,m-=7,u.h=C,u.p=B,u.i=O,u.w=M)}else{for(O=u.w||0;O<c+g;O+=65535){var At=O+65535;At>=c&&(p[m/8|0]=g,At=c),m=I(p,m+1,t.subarray(O,At))}u.i=c}return E(d,0,o+b(m)+l)},Q=function(){var t=1,e=0;return{p:function(n){for(var r=t,i=e,s=0|n.length,A=0;A!=s;){for(var a=Math.min(A+2655,s);A<a;++A)i+=r+=n[A];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}t=r,e=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(e%=65521))<<8|e>>8}}},O=function(t,e,n,i,s){if(!s&&(s={l:1},e.dictionary)){var A=e.dictionary.subarray(-32768),a=new r(A.length+t.length);a.set(A),a.set(t,A.length),t=a,s.w=A.length}return R(t,null==e.level?6:e.level,null==e.mem?s.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+e.mem,n,i,s)},P=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},M=function(t,e){var n=e.level,r=0==n?0:n<6?1:9==n?3:2;if(t[0]=120,t[1]=r<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=Q();i.p(e.dictionary),P(t,2,i.d())}};function N(t,e){e||(e={});var n=Q();n.p(t);var r=O(t,e,e.dictionary?6:2,4);return M(r,e),P(r,r.length-4,n.d()),r}var H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(L,{stream:!0}),1}catch(t){}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout},64270:function(t){t.exports=function(){"use strict";var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)};function r(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,s){function A(t){try{o(r.next(t))}catch(t){s(t)}}function a(t){try{o(r.throw(t))}catch(t){s(t)}}function o(t){t.done?n(t.value):i(t.value).then(A,a)}o((r=r.apply(t,e||[])).next())}))}function i(t,e){var n,r,i,s,A={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return o([t,e])}}function o(s){if(n)throw new TypeError("Generator is already executing.");for(;A;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return A.label++,{value:s[1],done:!1};case 5:A.label++,r=s[1],s=[0];continue;case 7:s=A.ops.pop(),A.trys.pop();continue;default:if(!((i=(i=A.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){A=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){A.label=s[1];break}if(6===s[0]&&A.label<i[1]){A.label=i[1],i=s;break}if(i&&A.label<i[2]){A.label=i[2],A.ops.push(s);break}i[2]&&A.ops.pop(),A.trys.pop();continue}s=e.call(t,A)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function s(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||e)}for(var A=function(){function t(t,e,n,r){this.left=t,this.top=e,this.width=n,this.height=r}return t.prototype.add=function(e,n,r,i){return new t(this.left+e,this.top+n,this.width+r,this.height+i)},t.fromClientRect=function(e,n){return new t(n.left+e.windowBounds.left,n.top+e.windowBounds.top,n.width,n.height)},t.fromDOMRectList=function(e,n){var r=Array.from(n).find((function(t){return 0!==t.width}));return r?new t(r.left+e.windowBounds.left,r.top+e.windowBounds.top,r.width,r.height):t.EMPTY},t.EMPTY=new t(0,0,0,0),t}(),a=function(t,e){return A.fromClientRect(t,e.getBoundingClientRect())},o=function(t){var e=t.body,n=t.documentElement;if(!e||!n)throw new Error("Unable to get document size");var r=Math.max(Math.max(e.scrollWidth,n.scrollWidth),Math.max(e.offsetWidth,n.offsetWidth),Math.max(e.clientWidth,n.clientWidth)),i=Math.max(Math.max(e.scrollHeight,n.scrollHeight),Math.max(e.offsetHeight,n.offsetHeight),Math.max(e.clientHeight,n.clientHeight));return new A(0,0,r,i)},l=function(t){for(var e=[],n=0,r=t.length;n<r;){var i=t.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var s=t.charCodeAt(n++);56320==(64512&s)?e.push(((1023&i)<<10)+(1023&s)+65536):(e.push(i),n--)}else e.push(i)}return e},u=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,t);var n=t.length;if(!n)return"";for(var r=[],i=-1,s="";++i<n;){var A=t[i];A<=65535?r.push(A):(A-=65536,r.push(55296+(A>>10),A%1024+56320)),(i+1===n||r.length>16384)&&(s+=String.fromCharCode.apply(String,r),r.length=0)}return s},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h="undefined"==typeof Uint8Array?[]:new Uint8Array(256),d=0;d<c.length;d++)h[c.charCodeAt(d)]=d;for(var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p="undefined"==typeof Uint8Array?[]:new Uint8Array(256),g=0;g<f.length;g++)p[f.charCodeAt(g)]=g;for(var m=function(t){var e,n,r,i,s,A=.75*t.length,a=t.length,o=0;"="===t[t.length-1]&&(A--,"="===t[t.length-2]&&A--);var l="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(A):new Array(A),u=Array.isArray(l)?l:new Uint8Array(l);for(e=0;e<a;e+=4)n=p[t.charCodeAt(e)],r=p[t.charCodeAt(e+1)],i=p[t.charCodeAt(e+2)],s=p[t.charCodeAt(e+3)],u[o++]=n<<2|r>>4,u[o++]=(15&r)<<4|i>>2,u[o++]=(3&i)<<6|63&s;return l},_=function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n.push(t[r+1]<<8|t[r]);return n},w=function(t){for(var e=t.length,n=[],r=0;r<e;r+=4)n.push(t[r+3]<<24|t[r+2]<<16|t[r+1]<<8|t[r]);return n},y=5,v=11,B=2,b=65536>>y,E=(1<<y)-1,C=b+(1024>>y)+32,k=65536>>v,F=(1<<v-y)-1,T=function(t,e,n){return t.slice?t.slice(e,n):new Uint16Array(Array.prototype.slice.call(t,e,n))},S=function(t,e,n){return t.slice?t.slice(e,n):new Uint32Array(Array.prototype.slice.call(t,e,n))},x=function(t,e){var n=m(t),r=Array.isArray(n)?w(n):new Uint32Array(n),i=Array.isArray(n)?_(n):new Uint16Array(n),s=24,A=T(i,s/2,r[4]/2),a=2===r[5]?T(i,(s+r[4])/2):S(r,Math.ceil((s+r[4])/4));return new I(r[0],r[1],r[2],r[3],A,a)},I=function(){function t(t,e,n,r,i,s){this.initialValue=t,this.errorValue=e,this.highStart=n,this.highValueIndex=r,this.index=i,this.data=s}return t.prototype.get=function(t){var e;if(t>=0){if(t<55296||t>56319&&t<=65535)return e=((e=this.index[t>>y])<<B)+(t&E),this.data[e];if(t<=65535)return e=((e=this.index[b+(t-55296>>y)])<<B)+(t&E),this.data[e];if(t<this.highStart)return e=C-k+(t>>v),e=this.index[e],e+=t>>y&F,e=((e=this.index[e])<<B)+(t&E),this.data[e];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},t}(),D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",U="undefined"==typeof Uint8Array?[]:new Uint8Array(256),L=0;L<D.length;L++)U[D.charCodeAt(L)]=L;var R=50,Q=1,O=2,P=3,M=4,N=5,H=7,K=8,$=9,G=10,V=11,j=12,Z=13,W=14,z=15,Y=16,X=17,q=18,J=19,tt=20,et=21,nt=22,rt=23,it=24,st=25,At=26,at=27,ot=28,lt=29,ut=30,ct=31,ht=32,dt=33,ft=34,pt=35,gt=36,mt=37,_t=38,wt=39,yt=40,vt=41,Bt=42,bt=43,Et=[9001,65288],Ct="!",kt="×",Ft="÷",Tt=x("KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),St=[ut,gt],xt=[Q,O,P,N],It=[G,K],Dt=[at,At],Ut=xt.concat(It),Lt=[_t,wt,yt,ft,pt],Rt=[z,Z],Qt=function(t,e){void 0===e&&(e="strict");var n=[],r=[],i=[];return t.forEach((function(t,s){var A=Tt.get(t);if(A>R?(i.push(!0),A-=R):i.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(t))return r.push(s),n.push(Y);if(A===M||A===V){if(0===s)return r.push(s),n.push(ut);var a=n[s-1];return-1===Ut.indexOf(a)?(r.push(r[s-1]),n.push(a)):(r.push(s),n.push(ut))}return r.push(s),A===ct?n.push("strict"===e?et:mt):A===Bt||A===lt?n.push(ut):A===bt?t>=131072&&t<=196605||t>=196608&&t<=262141?n.push(mt):n.push(ut):void n.push(A)})),[r,n,i]},Ot=function(t,e,n,r){var i=r[n];if(Array.isArray(t)?-1!==t.indexOf(i):t===i)for(var s=n;s<=r.length;){if((o=r[++s])===e)return!0;if(o!==G)break}if(i===G)for(s=n;s>0;){var A=r[--s];if(Array.isArray(t)?-1!==t.indexOf(A):t===A)for(var a=n;a<=r.length;){var o;if((o=r[++a])===e)return!0;if(o!==G)break}if(A!==G)break}return!1},Pt=function(t,e){for(var n=t;n>=0;){var r=e[n];if(r!==G)return r;n--}return 0},Mt=function(t,e,n,r,i){if(0===n[r])return kt;var s=r-1;if(Array.isArray(i)&&!0===i[s])return kt;var A=s-1,a=s+1,o=e[s],l=A>=0?e[A]:0,u=e[a];if(o===O&&u===P)return kt;if(-1!==xt.indexOf(o))return Ct;if(-1!==xt.indexOf(u))return kt;if(-1!==It.indexOf(u))return kt;if(Pt(s,e)===K)return Ft;if(Tt.get(t[s])===V)return kt;if((o===ht||o===dt)&&Tt.get(t[a])===V)return kt;if(o===H||u===H)return kt;if(o===$)return kt;if(-1===[G,Z,z].indexOf(o)&&u===$)return kt;if(-1!==[X,q,J,it,ot].indexOf(u))return kt;if(Pt(s,e)===nt)return kt;if(Ot(rt,nt,s,e))return kt;if(Ot([X,q],et,s,e))return kt;if(Ot(j,j,s,e))return kt;if(o===G)return Ft;if(o===rt||u===rt)return kt;if(u===Y||o===Y)return Ft;if(-1!==[Z,z,et].indexOf(u)||o===W)return kt;if(l===gt&&-1!==Rt.indexOf(o))return kt;if(o===ot&&u===gt)return kt;if(u===tt)return kt;if(-1!==St.indexOf(u)&&o===st||-1!==St.indexOf(o)&&u===st)return kt;if(o===at&&-1!==[mt,ht,dt].indexOf(u)||-1!==[mt,ht,dt].indexOf(o)&&u===At)return kt;if(-1!==St.indexOf(o)&&-1!==Dt.indexOf(u)||-1!==Dt.indexOf(o)&&-1!==St.indexOf(u))return kt;if(-1!==[at,At].indexOf(o)&&(u===st||-1!==[nt,z].indexOf(u)&&e[a+1]===st)||-1!==[nt,z].indexOf(o)&&u===st||o===st&&-1!==[st,ot,it].indexOf(u))return kt;if(-1!==[st,ot,it,X,q].indexOf(u))for(var c=s;c>=0;){if((h=e[c])===st)return kt;if(-1===[ot,it].indexOf(h))break;c--}if(-1!==[at,At].indexOf(u))for(c=-1!==[X,q].indexOf(o)?A:s;c>=0;){var h;if((h=e[c])===st)return kt;if(-1===[ot,it].indexOf(h))break;c--}if(_t===o&&-1!==[_t,wt,ft,pt].indexOf(u)||-1!==[wt,ft].indexOf(o)&&-1!==[wt,yt].indexOf(u)||-1!==[yt,pt].indexOf(o)&&u===yt)return kt;if(-1!==Lt.indexOf(o)&&-1!==[tt,At].indexOf(u)||-1!==Lt.indexOf(u)&&o===at)return kt;if(-1!==St.indexOf(o)&&-1!==St.indexOf(u))return kt;if(o===it&&-1!==St.indexOf(u))return kt;if(-1!==St.concat(st).indexOf(o)&&u===nt&&-1===Et.indexOf(t[a])||-1!==St.concat(st).indexOf(u)&&o===q)return kt;if(o===vt&&u===vt){for(var d=n[s],f=1;d>0&&e[--d]===vt;)f++;if(f%2!=0)return kt}return o===ht&&u===dt?kt:Ft},Nt=function(t,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var n=Qt(t,e.lineBreak),r=n[0],i=n[1],s=n[2];"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(i=i.map((function(t){return-1!==[st,ut,Bt].indexOf(t)?mt:t})));var A="keep-all"===e.wordBreak?s.map((function(e,n){return e&&t[n]>=19968&&t[n]<=40959})):void 0;return[r,i,A]},Ht=function(){function t(t,e,n,r){this.codePoints=t,this.required=e===Ct,this.start=n,this.end=r}return t.prototype.slice=function(){return u.apply(void 0,this.codePoints.slice(this.start,this.end))},t}(),Kt=function(t,e){var n=l(t),r=Nt(n,e),i=r[0],s=r[1],A=r[2],a=n.length,o=0,u=0;return{next:function(){if(u>=a)return{done:!0,value:null};for(var t=kt;u<a&&(t=Mt(n,s,i,++u,A))===kt;);if(t!==kt||u===a){var e=new Ht(n,t,o,u);return o=u,{value:e,done:!1}}return{done:!0,value:null}}}},$t=1,Gt=2,Vt=4,jt=8,Zt=10,Wt=47,zt=92,Yt=9,Xt=32,qt=34,Jt=61,te=35,ee=36,ne=37,re=39,ie=40,se=41,Ae=95,ae=45,oe=33,le=60,ue=62,ce=64,he=91,de=93,fe=61,pe=123,ge=63,me=125,_e=124,we=126,ye=128,ve=65533,Be=42,be=43,Ee=44,Ce=58,ke=59,Fe=46,Te=0,Se=8,xe=11,Ie=14,De=31,Ue=127,Le=-1,Re=48,Qe=97,Oe=101,Pe=102,Me=117,Ne=122,He=65,Ke=69,$e=70,Ge=85,Ve=90,je=function(t){return t>=Re&&t<=57},Ze=function(t){return t>=55296&&t<=57343},We=function(t){return je(t)||t>=He&&t<=$e||t>=Qe&&t<=Pe},ze=function(t){return t>=Qe&&t<=Ne},Ye=function(t){return t>=He&&t<=Ve},Xe=function(t){return ze(t)||Ye(t)},qe=function(t){return t>=ye},Je=function(t){return t===Zt||t===Yt||t===Xt},tn=function(t){return Xe(t)||qe(t)||t===Ae},en=function(t){return tn(t)||je(t)||t===ae},nn=function(t){return t>=Te&&t<=Se||t===xe||t>=Ie&&t<=De||t===Ue},rn=function(t,e){return t===zt&&e!==Zt},sn=function(t,e,n){return t===ae?tn(e)||rn(e,n):!!tn(t)||!(t!==zt||!rn(t,e))},An=function(t,e,n){return t===be||t===ae?!!je(e)||e===Fe&&je(n):je(t===Fe?e:t)},an=function(t){var e=0,n=1;t[e]!==be&&t[e]!==ae||(t[e]===ae&&(n=-1),e++);for(var r=[];je(t[e]);)r.push(t[e++]);var i=r.length?parseInt(u.apply(void 0,r),10):0;t[e]===Fe&&e++;for(var s=[];je(t[e]);)s.push(t[e++]);var A=s.length,a=A?parseInt(u.apply(void 0,s),10):0;t[e]!==Ke&&t[e]!==Oe||e++;var o=1;t[e]!==be&&t[e]!==ae||(t[e]===ae&&(o=-1),e++);for(var l=[];je(t[e]);)l.push(t[e++]);var c=l.length?parseInt(u.apply(void 0,l),10):0;return n*(i+a*Math.pow(10,-A))*Math.pow(10,o*c)},on={type:2},ln={type:3},un={type:4},cn={type:13},hn={type:8},dn={type:21},fn={type:9},pn={type:10},gn={type:11},mn={type:12},_n={type:14},wn={type:23},yn={type:1},vn={type:25},Bn={type:24},bn={type:26},En={type:27},Cn={type:28},kn={type:29},Fn={type:31},Tn={type:32},Sn=function(){function t(){this._value=[]}return t.prototype.write=function(t){this._value=this._value.concat(l(t))},t.prototype.read=function(){for(var t=[],e=this.consumeToken();e!==Tn;)t.push(e),e=this.consumeToken();return t},t.prototype.consumeToken=function(){var t=this.consumeCodePoint();switch(t){case qt:return this.consumeStringToken(qt);case te:var e=this.peekCodePoint(0),n=this.peekCodePoint(1),r=this.peekCodePoint(2);if(en(e)||rn(n,r)){var i=sn(e,n,r)?Gt:$t;return{type:5,value:this.consumeName(),flags:i}}break;case ee:if(this.peekCodePoint(0)===Jt)return this.consumeCodePoint(),cn;break;case re:return this.consumeStringToken(re);case ie:return on;case se:return ln;case Be:if(this.peekCodePoint(0)===Jt)return this.consumeCodePoint(),_n;break;case be:if(An(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case Ee:return un;case ae:var s=t,A=this.peekCodePoint(0),a=this.peekCodePoint(1);if(An(s,A,a))return this.reconsumeCodePoint(t),this.consumeNumericToken();if(sn(s,A,a))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();if(A===ae&&a===ue)return this.consumeCodePoint(),this.consumeCodePoint(),Bn;break;case Fe:if(An(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case Wt:if(this.peekCodePoint(0)===Be)for(this.consumeCodePoint();;){var o=this.consumeCodePoint();if(o===Be&&(o=this.consumeCodePoint())===Wt)return this.consumeToken();if(o===Le)return this.consumeToken()}break;case Ce:return bn;case ke:return En;case le:if(this.peekCodePoint(0)===oe&&this.peekCodePoint(1)===ae&&this.peekCodePoint(2)===ae)return this.consumeCodePoint(),this.consumeCodePoint(),vn;break;case ce:var l=this.peekCodePoint(0),c=this.peekCodePoint(1),h=this.peekCodePoint(2);if(sn(l,c,h))return{type:7,value:this.consumeName()};break;case he:return Cn;case zt:if(rn(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();break;case de:return kn;case fe:if(this.peekCodePoint(0)===Jt)return this.consumeCodePoint(),hn;break;case pe:return gn;case me:return mn;case Me:case Ge:var d=this.peekCodePoint(0),f=this.peekCodePoint(1);return d!==be||!We(f)&&f!==ge||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(t),this.consumeIdentLikeToken();case _e:if(this.peekCodePoint(0)===Jt)return this.consumeCodePoint(),fn;if(this.peekCodePoint(0)===_e)return this.consumeCodePoint(),dn;break;case we:if(this.peekCodePoint(0)===Jt)return this.consumeCodePoint(),pn;break;case Le:return Tn}return Je(t)?(this.consumeWhiteSpace(),Fn):je(t)?(this.reconsumeCodePoint(t),this.consumeNumericToken()):tn(t)?(this.reconsumeCodePoint(t),this.consumeIdentLikeToken()):{type:6,value:u(t)}},t.prototype.consumeCodePoint=function(){var t=this._value.shift();return void 0===t?-1:t},t.prototype.reconsumeCodePoint=function(t){this._value.unshift(t)},t.prototype.peekCodePoint=function(t){return t>=this._value.length?-1:this._value[t]},t.prototype.consumeUnicodeRangeToken=function(){for(var t=[],e=this.consumeCodePoint();We(e)&&t.length<6;)t.push(e),e=this.consumeCodePoint();for(var n=!1;e===ge&&t.length<6;)t.push(e),e=this.consumeCodePoint(),n=!0;if(n)return{type:30,start:parseInt(u.apply(void 0,t.map((function(t){return t===ge?Re:t}))),16),end:parseInt(u.apply(void 0,t.map((function(t){return t===ge?$e:t}))),16)};var r=parseInt(u.apply(void 0,t),16);if(this.peekCodePoint(0)===ae&&We(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var i=[];We(e)&&i.length<6;)i.push(e),e=this.consumeCodePoint();return{type:30,start:r,end:parseInt(u.apply(void 0,i),16)}}return{type:30,start:r,end:r}},t.prototype.consumeIdentLikeToken=function(){var t=this.consumeName();return"url"===t.toLowerCase()&&this.peekCodePoint(0)===ie?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===ie?(this.consumeCodePoint(),{type:19,value:t}):{type:20,value:t}},t.prototype.consumeUrlToken=function(){var t=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===Le)return{type:22,value:""};var e=this.peekCodePoint(0);if(e===re||e===qt){var n=this.consumeStringToken(this.consumeCodePoint());return 0===n.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===Le||this.peekCodePoint(0)===se)?(this.consumeCodePoint(),{type:22,value:n.value}):(this.consumeBadUrlRemnants(),wn)}for(;;){var r=this.consumeCodePoint();if(r===Le||r===se)return{type:22,value:u.apply(void 0,t)};if(Je(r))return this.consumeWhiteSpace(),this.peekCodePoint(0)===Le||this.peekCodePoint(0)===se?(this.consumeCodePoint(),{type:22,value:u.apply(void 0,t)}):(this.consumeBadUrlRemnants(),wn);if(r===qt||r===re||r===ie||nn(r))return this.consumeBadUrlRemnants(),wn;if(r===zt){if(!rn(r,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),wn;t.push(this.consumeEscapedCodePoint())}else t.push(r)}},t.prototype.consumeWhiteSpace=function(){for(;Je(this.peekCodePoint(0));)this.consumeCodePoint()},t.prototype.consumeBadUrlRemnants=function(){for(;;){var t=this.consumeCodePoint();if(t===se||t===Le)return;rn(t,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},t.prototype.consumeStringSlice=function(t){for(var e=5e4,n="";t>0;){var r=Math.min(e,t);n+=u.apply(void 0,this._value.splice(0,r)),t-=r}return this._value.shift(),n},t.prototype.consumeStringToken=function(t){for(var e="",n=0;;){var r=this._value[n];if(r===Le||void 0===r||r===t)return{type:0,value:e+=this.consumeStringSlice(n)};if(r===Zt)return this._value.splice(0,n),yn;if(r===zt){var i=this._value[n+1];i!==Le&&void 0!==i&&(i===Zt?(e+=this.consumeStringSlice(n),n=-1,this._value.shift()):rn(r,i)&&(e+=this.consumeStringSlice(n),e+=u(this.consumeEscapedCodePoint()),n=-1))}n++}},t.prototype.consumeNumber=function(){var t=[],e=Vt,n=this.peekCodePoint(0);for(n!==be&&n!==ae||t.push(this.consumeCodePoint());je(this.peekCodePoint(0));)t.push(this.consumeCodePoint());n=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(n===Fe&&je(r))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),e=jt;je(this.peekCodePoint(0));)t.push(this.consumeCodePoint());n=this.peekCodePoint(0),r=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((n===Ke||n===Oe)&&((r===be||r===ae)&&je(i)||je(r)))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),e=jt;je(this.peekCodePoint(0));)t.push(this.consumeCodePoint());return[an(t),e]},t.prototype.consumeNumericToken=function(){var t=this.consumeNumber(),e=t[0],n=t[1],r=this.peekCodePoint(0),i=this.peekCodePoint(1),s=this.peekCodePoint(2);return sn(r,i,s)?{type:15,number:e,flags:n,unit:this.consumeName()}:r===ne?(this.consumeCodePoint(),{type:16,number:e,flags:n}):{type:17,number:e,flags:n}},t.prototype.consumeEscapedCodePoint=function(){var t=this.consumeCodePoint();if(We(t)){for(var e=u(t);We(this.peekCodePoint(0))&&e.length<6;)e+=u(this.consumeCodePoint());Je(this.peekCodePoint(0))&&this.consumeCodePoint();var n=parseInt(e,16);return 0===n||Ze(n)||n>1114111?ve:n}return t===Le?ve:t},t.prototype.consumeName=function(){for(var t="";;){var e=this.consumeCodePoint();if(en(e))t+=u(e);else{if(!rn(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),t;t+=u(this.consumeEscapedCodePoint())}}},t}(),xn=function(){function t(t){this._tokens=t}return t.create=function(e){var n=new Sn;return n.write(e),new t(n.read())},t.parseValue=function(e){return t.create(e).parseComponentValue()},t.parseValues=function(e){return t.create(e).parseComponentValues()},t.prototype.parseComponentValue=function(){for(var t=this.consumeToken();31===t.type;)t=this.consumeToken();if(32===t.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(t);var e=this.consumeComponentValue();do{t=this.consumeToken()}while(31===t.type);if(32===t.type)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},t.prototype.parseComponentValues=function(){for(var t=[];;){var e=this.consumeComponentValue();if(32===e.type)return t;t.push(e),t.push()}},t.prototype.consumeComponentValue=function(){var t=this.consumeToken();switch(t.type){case 11:case 28:case 2:return this.consumeSimpleBlock(t.type);case 19:return this.consumeFunction(t)}return t},t.prototype.consumeSimpleBlock=function(t){for(var e={type:t,values:[]},n=this.consumeToken();;){if(32===n.type||Mn(n,t))return e;this.reconsumeToken(n),e.values.push(this.consumeComponentValue()),n=this.consumeToken()}},t.prototype.consumeFunction=function(t){for(var e={name:t.value,values:[],type:18};;){var n=this.consumeToken();if(32===n.type||3===n.type)return e;this.reconsumeToken(n),e.values.push(this.consumeComponentValue())}},t.prototype.consumeToken=function(){var t=this._tokens.shift();return void 0===t?Tn:t},t.prototype.reconsumeToken=function(t){this._tokens.unshift(t)},t}(),In=function(t){return 15===t.type},Dn=function(t){return 17===t.type},Un=function(t){return 20===t.type},Ln=function(t){return 0===t.type},Rn=function(t,e){return Un(t)&&t.value===e},Qn=function(t){return 31!==t.type},On=function(t){return 31!==t.type&&4!==t.type},Pn=function(t){var e=[],n=[];return t.forEach((function(t){if(4===t.type){if(0===n.length)throw new Error("Error parsing function args, zero tokens for arg");return e.push(n),void(n=[])}31!==t.type&&n.push(t)})),n.length&&e.push(n),e},Mn=function(t,e){return 11===e&&12===t.type||28===e&&29===t.type||2===e&&3===t.type},Nn=function(t){return 17===t.type||15===t.type},Hn=function(t){return 16===t.type||Nn(t)},Kn=function(t){return t.length>1?[t[0],t[1]]:[t[0]]},$n={type:17,number:0,flags:Vt},Gn={type:16,number:50,flags:Vt},Vn={type:16,number:100,flags:Vt},jn=function(t,e,n){var r=t[0],i=t[1];return[Zn(r,e),Zn(void 0!==i?i:r,n)]},Zn=function(t,e){if(16===t.type)return t.number/100*e;if(In(t))switch(t.unit){case"rem":case"em":return 16*t.number;default:return t.number}return t.number},Wn="deg",zn="grad",Yn="rad",Xn="turn",qn={name:"angle",parse:function(t,e){if(15===e.type)switch(e.unit){case Wn:return Math.PI*e.number/180;case zn:return Math.PI/200*e.number;case Yn:return e.number;case Xn:return 2*Math.PI*e.number}throw new Error("Unsupported angle type")}},Jn=function(t){return 15===t.type&&(t.unit===Wn||t.unit===zn||t.unit===Yn||t.unit===Xn)},tr=function(t){switch(t.filter(Un).map((function(t){return t.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[$n,$n];case"to top":case"bottom":return er(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[$n,Vn];case"to right":case"left":return er(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Vn,Vn];case"to bottom":case"top":return er(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Vn,$n];case"to left":case"right":return er(270)}return 0},er=function(t){return Math.PI*t/180},nr={name:"color",parse:function(t,e){if(18===e.type){var n=ur[e.name];if(void 0===n)throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return n(t,e.values)}if(5===e.type){if(3===e.value.length){var r=e.value.substring(0,1),i=e.value.substring(1,2),s=e.value.substring(2,3);return sr(parseInt(r+r,16),parseInt(i+i,16),parseInt(s+s,16),1)}if(4===e.value.length){r=e.value.substring(0,1),i=e.value.substring(1,2),s=e.value.substring(2,3);var A=e.value.substring(3,4);return sr(parseInt(r+r,16),parseInt(i+i,16),parseInt(s+s,16),parseInt(A+A,16)/255)}if(6===e.value.length)return r=e.value.substring(0,2),i=e.value.substring(2,4),s=e.value.substring(4,6),sr(parseInt(r,16),parseInt(i,16),parseInt(s,16),1);if(8===e.value.length)return r=e.value.substring(0,2),i=e.value.substring(2,4),s=e.value.substring(4,6),A=e.value.substring(6,8),sr(parseInt(r,16),parseInt(i,16),parseInt(s,16),parseInt(A,16)/255)}if(20===e.type){var a=hr[e.value.toUpperCase()];if(void 0!==a)return a}return hr.TRANSPARENT}},rr=function(t){return 0==(255&t)},ir=function(t){var e=255&t,n=255&t>>8,r=255&t>>16,i=255&t>>24;return e<255?"rgba("+i+","+r+","+n+","+e/255+")":"rgb("+i+","+r+","+n+")"},sr=function(t,e,n,r){return(t<<24|e<<16|n<<8|Math.round(255*r)<<0)>>>0},Ar=function(t,e){if(17===t.type)return t.number;if(16===t.type){var n=3===e?1:255;return 3===e?t.number/100*n:Math.round(t.number/100*n)}return 0},ar=function(t,e){var n=e.filter(On);if(3===n.length){var r=n.map(Ar),i=r[0],s=r[1],A=r[2];return sr(i,s,A,1)}if(4===n.length){var a=n.map(Ar),o=(i=a[0],s=a[1],A=a[2],a[3]);return sr(i,s,A,o)}return 0};function or(t,e,n){return n<0&&(n+=1),n>=1&&(n-=1),n<1/6?(e-t)*n*6+t:n<.5?e:n<2/3?6*(e-t)*(2/3-n)+t:t}var lr=function(t,e){var n=e.filter(On),r=n[0],i=n[1],s=n[2],A=n[3],a=(17===r.type?er(r.number):qn.parse(t,r))/(2*Math.PI),o=Hn(i)?i.number/100:0,l=Hn(s)?s.number/100:0,u=void 0!==A&&Hn(A)?Zn(A,1):1;if(0===o)return sr(255*l,255*l,255*l,1);var c=l<=.5?l*(o+1):l+o-l*o,h=2*l-c,d=or(h,c,a+1/3),f=or(h,c,a),p=or(h,c,a-1/3);return sr(255*d,255*f,255*p,u)},ur={hsl:lr,hsla:lr,rgb:ar,rgba:ar},cr=function(t,e){return nr.parse(t,xn.create(e).parseComponentValue())},hr={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},dr={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(t,e){return e.map((function(t){if(Un(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},fr={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},pr=function(t,e){var n=nr.parse(t,e[0]),r=e[1];return r&&Hn(r)?{color:n,stop:r}:{color:n,stop:null}},gr=function(t,e){var n=t[0],r=t[t.length-1];null===n.stop&&(n.stop=$n),null===r.stop&&(r.stop=Vn);for(var i=[],s=0,A=0;A<t.length;A++){var a=t[A].stop;if(null!==a){var o=Zn(a,e);o>s?i.push(o):i.push(s),s=o}else i.push(null)}var l=null;for(A=0;A<i.length;A++){var u=i[A];if(null===u)null===l&&(l=A);else if(null!==l){for(var c=A-l,h=(u-i[l-1])/(c+1),d=1;d<=c;d++)i[l+d-1]=h*d;l=null}}return t.map((function(t,n){return{color:t.color,stop:Math.max(Math.min(1,i[n]/e),0)}}))},mr=function(t,e,n){var r=e/2,i=n/2,s=Zn(t[0],e)-r,A=i-Zn(t[1],n);return(Math.atan2(A,s)+2*Math.PI)%(2*Math.PI)},_r=function(t,e,n){var r="number"==typeof t?t:mr(t,e,n),i=Math.abs(e*Math.sin(r))+Math.abs(n*Math.cos(r)),s=e/2,A=n/2,a=i/2,o=Math.sin(r-Math.PI/2)*a,l=Math.cos(r-Math.PI/2)*a;return[i,s-l,s+l,A-o,A+o]},wr=function(t,e){return Math.sqrt(t*t+e*e)},yr=function(t,e,n,r,i){return[[0,0],[0,e],[t,0],[t,e]].reduce((function(t,e){var s=e[0],A=e[1],a=wr(n-s,r-A);return(i?a<t.optimumDistance:a>t.optimumDistance)?{optimumCorner:e,optimumDistance:a}:t}),{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},vr=function(t,e,n,r,i){var s=0,A=0;switch(t.size){case 0:0===t.shape?s=A=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(n),Math.abs(n-i)):1===t.shape&&(s=Math.min(Math.abs(e),Math.abs(e-r)),A=Math.min(Math.abs(n),Math.abs(n-i)));break;case 2:if(0===t.shape)s=A=Math.min(wr(e,n),wr(e,n-i),wr(e-r,n),wr(e-r,n-i));else if(1===t.shape){var a=Math.min(Math.abs(n),Math.abs(n-i))/Math.min(Math.abs(e),Math.abs(e-r)),o=yr(r,i,e,n,!0),l=o[0],u=o[1];A=a*(s=wr(l-e,(u-n)/a))}break;case 1:0===t.shape?s=A=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(n),Math.abs(n-i)):1===t.shape&&(s=Math.max(Math.abs(e),Math.abs(e-r)),A=Math.max(Math.abs(n),Math.abs(n-i)));break;case 3:if(0===t.shape)s=A=Math.max(wr(e,n),wr(e,n-i),wr(e-r,n),wr(e-r,n-i));else if(1===t.shape){a=Math.max(Math.abs(n),Math.abs(n-i))/Math.max(Math.abs(e),Math.abs(e-r));var c=yr(r,i,e,n,!1);l=c[0],u=c[1],A=a*(s=wr(l-e,(u-n)/a))}}return Array.isArray(t.size)&&(s=Zn(t.size[0],r),A=2===t.size.length?Zn(t.size[1],i):s),[s,A]},Br=function(t,e){var n=er(180),r=[];return Pn(e).forEach((function(e,i){if(0===i){var s=e[0];if(20===s.type&&-1!==["top","left","right","bottom"].indexOf(s.value))return void(n=tr(e));if(Jn(s))return void(n=(qn.parse(t,s)+er(270))%er(360))}var A=pr(t,e);r.push(A)})),{angle:n,stops:r,type:1}},br="closest-side",Er="farthest-side",Cr="closest-corner",kr="farthest-corner",Fr="circle",Tr="ellipse",Sr="cover",xr="contain",Ir=function(t,e){var n=0,r=3,i=[],s=[];return Pn(e).forEach((function(e,A){var a=!0;if(0===A?a=e.reduce((function(t,e){if(Un(e))switch(e.value){case"center":return s.push(Gn),!1;case"top":case"left":return s.push($n),!1;case"right":case"bottom":return s.push(Vn),!1}else if(Hn(e)||Nn(e))return s.push(e),!1;return t}),a):1===A&&(a=e.reduce((function(t,e){if(Un(e))switch(e.value){case Fr:return n=0,!1;case Tr:return n=1,!1;case xr:case br:return r=0,!1;case Er:return r=1,!1;case Cr:return r=2,!1;case Sr:case kr:return r=3,!1}else if(Nn(e)||Hn(e))return Array.isArray(r)||(r=[]),r.push(e),!1;return t}),a)),a){var o=pr(t,e);i.push(o)}})),{size:r,shape:n,stops:i,position:s,type:2}},Dr=function(t){return 1===t.type},Ur=function(t){return 2===t.type},Lr={name:"image",parse:function(t,e){if(22===e.type){var n={url:e.value,type:0};return t.cache.addImage(e.value),n}if(18===e.type){var r=Or[e.name];if(void 0===r)throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return r(t,e.values)}throw new Error("Unsupported image type "+e.type)}};function Rr(t){return!(20===t.type&&"none"===t.value||18===t.type&&!Or[t.name])}var Qr,Or={"linear-gradient":function(t,e){var n=er(180),r=[];return Pn(e).forEach((function(e,i){if(0===i){var s=e[0];if(20===s.type&&"to"===s.value)return void(n=tr(e));if(Jn(s))return void(n=qn.parse(t,s))}var A=pr(t,e);r.push(A)})),{angle:n,stops:r,type:1}},"-moz-linear-gradient":Br,"-ms-linear-gradient":Br,"-o-linear-gradient":Br,"-webkit-linear-gradient":Br,"radial-gradient":function(t,e){var n=0,r=3,i=[],s=[];return Pn(e).forEach((function(e,A){var a=!0;if(0===A){var o=!1;a=e.reduce((function(t,e){if(o)if(Un(e))switch(e.value){case"center":return s.push(Gn),t;case"top":case"left":return s.push($n),t;case"right":case"bottom":return s.push(Vn),t}else(Hn(e)||Nn(e))&&s.push(e);else if(Un(e))switch(e.value){case Fr:return n=0,!1;case Tr:return n=1,!1;case"at":return o=!0,!1;case br:return r=0,!1;case Sr:case Er:return r=1,!1;case xr:case Cr:return r=2,!1;case kr:return r=3,!1}else if(Nn(e)||Hn(e))return Array.isArray(r)||(r=[]),r.push(e),!1;return t}),a)}if(a){var l=pr(t,e);i.push(l)}})),{size:r,shape:n,stops:i,position:s,type:2}},"-moz-radial-gradient":Ir,"-ms-radial-gradient":Ir,"-o-radial-gradient":Ir,"-webkit-radial-gradient":Ir,"-webkit-gradient":function(t,e){var n=er(180),r=[],i=1,s=0,A=3,a=[];return Pn(e).forEach((function(e,n){var s=e[0];if(0===n){if(Un(s)&&"linear"===s.value)return void(i=1);if(Un(s)&&"radial"===s.value)return void(i=2)}if(18===s.type)if("from"===s.name){var A=nr.parse(t,s.values[0]);r.push({stop:$n,color:A})}else if("to"===s.name)A=nr.parse(t,s.values[0]),r.push({stop:Vn,color:A});else if("color-stop"===s.name){var a=s.values.filter(On);if(2===a.length){A=nr.parse(t,a[1]);var o=a[0];Dn(o)&&r.push({stop:{type:16,number:100*o.number,flags:o.flags},color:A})}}})),1===i?{angle:(n+er(180))%er(360),stops:r,type:i}:{size:A,shape:s,stops:r,position:a,type:i}}},Pr={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(t,e){if(0===e.length)return[];var n=e[0];return 20===n.type&&"none"===n.value?[]:e.filter((function(t){return On(t)&&Rr(t)})).map((function(e){return Lr.parse(t,e)}))}},Mr={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(t,e){return e.map((function(t){if(Un(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Nr={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(t,e){return Pn(e).map((function(t){return t.filter(Hn)})).map(Kn)}},Hr={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(t,e){return Pn(e).map((function(t){return t.filter(Un).map((function(t){return t.value})).join(" ")})).map(Kr)}},Kr=function(t){switch(t){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(t){t.AUTO="auto",t.CONTAIN="contain",t.COVER="cover"}(Qr||(Qr={}));var $r,Gr={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(t,e){return Pn(e).map((function(t){return t.filter(Vr)}))}},Vr=function(t){return Un(t)||Hn(t)},jr=function(t){return{name:"border-"+t+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Zr=jr("top"),Wr=jr("right"),zr=jr("bottom"),Yr=jr("left"),Xr=function(t){return{name:"border-radius-"+t,initialValue:"0 0",prefix:!1,type:1,parse:function(t,e){return Kn(e.filter(Hn))}}},qr=Xr("top-left"),Jr=Xr("top-right"),ti=Xr("bottom-right"),ei=Xr("bottom-left"),ni=function(t){return{name:"border-"+t+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(t,e){switch(e){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},ri=ni("top"),ii=ni("right"),si=ni("bottom"),Ai=ni("left"),ai=function(t){return{name:"border-"+t+"-width",initialValue:"0",type:0,prefix:!1,parse:function(t,e){return In(e)?e.number:0}}},oi=ai("top"),li=ai("right"),ui=ai("bottom"),ci=ai("left"),hi={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},di={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(t,e){return"rtl"===e?1:0}},fi={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(t,e){return e.filter(Un).reduce((function(t,e){return t|pi(e.value)}),0)}},pi=function(t){switch(t){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},gi={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},mi={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(t,e){return 20===e.type&&"normal"===e.value?0:17===e.type||15===e.type?e.number:0}};!function(t){t.NORMAL="normal",t.STRICT="strict"}($r||($r={}));var _i,wi={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){return"strict"===e?$r.STRICT:$r.NORMAL}},yi={name:"line-height",initialValue:"normal",prefix:!1,type:4},vi=function(t,e){return Un(t)&&"normal"===t.value?1.2*e:17===t.type?e*t.number:Hn(t)?Zn(t,e):e},Bi={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(t,e){return 20===e.type&&"none"===e.value?null:Lr.parse(t,e)}},bi={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(t,e){return"inside"===e?0:1}},Ei={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},Ci=function(t){return{name:"margin-"+t,initialValue:"0",prefix:!1,type:4}},ki=Ci("top"),Fi=Ci("right"),Ti=Ci("bottom"),Si=Ci("left"),xi={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(t,e){return e.filter(Un).map((function(t){switch(t.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}}))}},Ii={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){return"break-word"===e?"break-word":"normal"}},Di=function(t){return{name:"padding-"+t,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Ui=Di("top"),Li=Di("right"),Ri=Di("bottom"),Qi=Di("left"),Oi={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(t,e){switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},Pi={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(t,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Mi={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(t,e){return 1===e.length&&Rn(e[0],"none")?[]:Pn(e).map((function(e){for(var n={color:hr.TRANSPARENT,offsetX:$n,offsetY:$n,blur:$n},r=0,i=0;i<e.length;i++){var s=e[i];Nn(s)?(0===r?n.offsetX=s:1===r?n.offsetY=s:n.blur=s,r++):n.color=nr.parse(t,s)}return n}))}},Ni={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},Hi={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(t,e){if(20===e.type&&"none"===e.value)return null;if(18===e.type){var n=Ki[e.name];if(void 0===n)throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return n(e.values)}return null}},Ki={matrix:function(t){var e=t.filter((function(t){return 17===t.type})).map((function(t){return t.number}));return 6===e.length?e:null},matrix3d:function(t){var e=t.filter((function(t){return 17===t.type})).map((function(t){return t.number})),n=e[0],r=e[1];e[2],e[3];var i=e[4],s=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var A=e[12],a=e[13];return e[14],e[15],16===e.length?[n,r,i,s,A,a]:null}},$i={type:16,number:50,flags:Vt},Gi=[$i,$i],Vi={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(t,e){var n=e.filter(Hn);return 2!==n.length?Gi:[n[0],n[1]]}},ji={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}}};!function(t){t.NORMAL="normal",t.BREAK_ALL="break-all",t.KEEP_ALL="keep-all"}(_i||(_i={}));for(var Zi={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"break-all":return _i.BREAK_ALL;case"keep-all":return _i.KEEP_ALL;default:return _i.NORMAL}}},Wi={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(t,e){if(20===e.type)return{auto:!0,order:0};if(Dn(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},zi={name:"time",parse:function(t,e){if(15===e.type)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},Yi={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(t,e){return Dn(e)?e.number:1}},Xi={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},qi={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(t,e){return e.filter(Un).map((function(t){switch(t.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0})).filter((function(t){return 0!==t}))}},Ji={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(t,e){var n=[],r=[];return e.forEach((function(t){switch(t.type){case 20:case 0:n.push(t.value);break;case 17:n.push(t.number.toString());break;case 4:r.push(n.join(" ")),n.length=0}})),n.length&&r.push(n.join(" ")),r.map((function(t){return-1===t.indexOf(" ")?t:"'"+t+"'"}))}},ts={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},es={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(t,e){return Dn(e)?e.number:Un(e)&&"bold"===e.value?700:400}},ns={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(t,e){return e.filter(Un).map((function(t){return t.value}))}},rs={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},is=function(t,e){return 0!=(t&e)},ss={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(t,e){if(0===e.length)return[];var n=e[0];return 20===n.type&&"none"===n.value?[]:e}},As={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(t,e){if(0===e.length)return null;var n=e[0];if(20===n.type&&"none"===n.value)return null;for(var r=[],i=e.filter(Qn),s=0;s<i.length;s++){var A=i[s],a=i[s+1];if(20===A.type){var o=a&&Dn(a)?a.number:1;r.push({counter:A.value,increment:o})}}return r}},as={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(t,e){if(0===e.length)return[];for(var n=[],r=e.filter(Qn),i=0;i<r.length;i++){var s=r[i],A=r[i+1];if(Un(s)&&"none"!==s.value){var a=A&&Dn(A)?A.number:0;n.push({counter:s.value,reset:a})}}return n}},os={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(t,e){return e.filter(In).map((function(e){return zi.parse(t,e)}))}},ls={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(t,e){if(0===e.length)return null;var n=e[0];if(20===n.type&&"none"===n.value)return null;var r=[],i=e.filter(Ln);if(i.length%2!=0)return null;for(var s=0;s<i.length;s+=2){var A=i[s].value,a=i[s+1].value;r.push({open:A,close:a})}return r}},us=function(t,e,n){if(!t)return"";var r=t[Math.min(e,t.length-1)];return r?n?r.open:r.close:""},cs={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(t,e){return 1===e.length&&Rn(e[0],"none")?[]:Pn(e).map((function(e){for(var n={color:255,offsetX:$n,offsetY:$n,blur:$n,spread:$n,inset:!1},r=0,i=0;i<e.length;i++){var s=e[i];Rn(s,"inset")?n.inset=!0:Nn(s)?(0===r?n.offsetX=s:1===r?n.offsetY=s:2===r?n.blur=s:n.spread=s,r++):n.color=nr.parse(t,s)}return n}))}},hs={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(t,e){var n=[0,1,2],r=[];return e.filter(Un).forEach((function(t){switch(t.value){case"stroke":r.push(1);break;case"fill":r.push(0);break;case"markers":r.push(2)}})),n.forEach((function(t){-1===r.indexOf(t)&&r.push(t)})),r}},ds={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},fs={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(t,e){return In(e)?e.number:0}},ps=function(){function t(t,e){var n,r;this.animationDuration=_s(t,os,e.animationDuration),this.backgroundClip=_s(t,dr,e.backgroundClip),this.backgroundColor=_s(t,fr,e.backgroundColor),this.backgroundImage=_s(t,Pr,e.backgroundImage),this.backgroundOrigin=_s(t,Mr,e.backgroundOrigin),this.backgroundPosition=_s(t,Nr,e.backgroundPosition),this.backgroundRepeat=_s(t,Hr,e.backgroundRepeat),this.backgroundSize=_s(t,Gr,e.backgroundSize),this.borderTopColor=_s(t,Zr,e.borderTopColor),this.borderRightColor=_s(t,Wr,e.borderRightColor),this.borderBottomColor=_s(t,zr,e.borderBottomColor),this.borderLeftColor=_s(t,Yr,e.borderLeftColor),this.borderTopLeftRadius=_s(t,qr,e.borderTopLeftRadius),this.borderTopRightRadius=_s(t,Jr,e.borderTopRightRadius),this.borderBottomRightRadius=_s(t,ti,e.borderBottomRightRadius),this.borderBottomLeftRadius=_s(t,ei,e.borderBottomLeftRadius),this.borderTopStyle=_s(t,ri,e.borderTopStyle),this.borderRightStyle=_s(t,ii,e.borderRightStyle),this.borderBottomStyle=_s(t,si,e.borderBottomStyle),this.borderLeftStyle=_s(t,Ai,e.borderLeftStyle),this.borderTopWidth=_s(t,oi,e.borderTopWidth),this.borderRightWidth=_s(t,li,e.borderRightWidth),this.borderBottomWidth=_s(t,ui,e.borderBottomWidth),this.borderLeftWidth=_s(t,ci,e.borderLeftWidth),this.boxShadow=_s(t,cs,e.boxShadow),this.color=_s(t,hi,e.color),this.direction=_s(t,di,e.direction),this.display=_s(t,fi,e.display),this.float=_s(t,gi,e.cssFloat),this.fontFamily=_s(t,Ji,e.fontFamily),this.fontSize=_s(t,ts,e.fontSize),this.fontStyle=_s(t,rs,e.fontStyle),this.fontVariant=_s(t,ns,e.fontVariant),this.fontWeight=_s(t,es,e.fontWeight),this.letterSpacing=_s(t,mi,e.letterSpacing),this.lineBreak=_s(t,wi,e.lineBreak),this.lineHeight=_s(t,yi,e.lineHeight),this.listStyleImage=_s(t,Bi,e.listStyleImage),this.listStylePosition=_s(t,bi,e.listStylePosition),this.listStyleType=_s(t,Ei,e.listStyleType),this.marginTop=_s(t,ki,e.marginTop),this.marginRight=_s(t,Fi,e.marginRight),this.marginBottom=_s(t,Ti,e.marginBottom),this.marginLeft=_s(t,Si,e.marginLeft),this.opacity=_s(t,Yi,e.opacity);var i=_s(t,xi,e.overflow);this.overflowX=i[0],this.overflowY=i[i.length>1?1:0],this.overflowWrap=_s(t,Ii,e.overflowWrap),this.paddingTop=_s(t,Ui,e.paddingTop),this.paddingRight=_s(t,Li,e.paddingRight),this.paddingBottom=_s(t,Ri,e.paddingBottom),this.paddingLeft=_s(t,Qi,e.paddingLeft),this.paintOrder=_s(t,hs,e.paintOrder),this.position=_s(t,Pi,e.position),this.textAlign=_s(t,Oi,e.textAlign),this.textDecorationColor=_s(t,Xi,null!==(n=e.textDecorationColor)&&void 0!==n?n:e.color),this.textDecorationLine=_s(t,qi,null!==(r=e.textDecorationLine)&&void 0!==r?r:e.textDecoration),this.textShadow=_s(t,Mi,e.textShadow),this.textTransform=_s(t,Ni,e.textTransform),this.transform=_s(t,Hi,e.transform),this.transformOrigin=_s(t,Vi,e.transformOrigin),this.visibility=_s(t,ji,e.visibility),this.webkitTextStrokeColor=_s(t,ds,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=_s(t,fs,e.webkitTextStrokeWidth),this.wordBreak=_s(t,Zi,e.wordBreak),this.zIndex=_s(t,Wi,e.zIndex)}return t.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},t.prototype.isTransparent=function(){return rr(this.backgroundColor)},t.prototype.isTransformed=function(){return null!==this.transform},t.prototype.isPositioned=function(){return 0!==this.position},t.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},t.prototype.isFloating=function(){return 0!==this.float},t.prototype.isInlineLevel=function(){return is(this.display,4)||is(this.display,33554432)||is(this.display,268435456)||is(this.display,536870912)||is(this.display,67108864)||is(this.display,134217728)},t}(),gs=function(){function t(t,e){this.content=_s(t,ss,e.content),this.quotes=_s(t,ls,e.quotes)}return t}(),ms=function(){function t(t,e){this.counterIncrement=_s(t,As,e.counterIncrement),this.counterReset=_s(t,as,e.counterReset)}return t}(),_s=function(t,e,n){var r=new Sn,i=null!=n?n.toString():e.initialValue;r.write(i);var s=new xn(r.read());switch(e.type){case 2:var A=s.parseComponentValue();return e.parse(t,Un(A)?A.value:e.initialValue);case 0:return e.parse(t,s.parseComponentValue());case 1:return e.parse(t,s.parseComponentValues());case 4:return s.parseComponentValue();case 3:switch(e.format){case"angle":return qn.parse(t,s.parseComponentValue());case"color":return nr.parse(t,s.parseComponentValue());case"image":return Lr.parse(t,s.parseComponentValue());case"length":var a=s.parseComponentValue();return Nn(a)?a:$n;case"length-percentage":var o=s.parseComponentValue();return Hn(o)?o:$n;case"time":return zi.parse(t,s.parseComponentValue())}}},ws="data-html2canvas-debug",ys=function(t){switch(t.getAttribute(ws)){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},vs=function(t,e){var n=ys(t);return 1===n||e===n},Bs=function(){function t(t,e){this.context=t,this.textNodes=[],this.elements=[],this.flags=0,vs(e,3),this.styles=new ps(t,window.getComputedStyle(e,null)),la(e)&&(this.styles.animationDuration.some((function(t){return t>0}))&&(e.style.animationDuration="0s"),null!==this.styles.transform&&(e.style.transform="none")),this.bounds=a(this.context,e),vs(e,4)&&(this.flags|=16)}return t}(),bs="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",Es="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cs="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ks=0;ks<Es.length;ks++)Cs[Es.charCodeAt(ks)]=ks;for(var Fs=function(t){var e,n,r,i,s,A=.75*t.length,a=t.length,o=0;"="===t[t.length-1]&&(A--,"="===t[t.length-2]&&A--);var l="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(A):new Array(A),u=Array.isArray(l)?l:new Uint8Array(l);for(e=0;e<a;e+=4)n=Cs[t.charCodeAt(e)],r=Cs[t.charCodeAt(e+1)],i=Cs[t.charCodeAt(e+2)],s=Cs[t.charCodeAt(e+3)],u[o++]=n<<2|r>>4,u[o++]=(15&r)<<4|i>>2,u[o++]=(3&i)<<6|63&s;return l},Ts=function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n.push(t[r+1]<<8|t[r]);return n},Ss=function(t){for(var e=t.length,n=[],r=0;r<e;r+=4)n.push(t[r+3]<<24|t[r+2]<<16|t[r+1]<<8|t[r]);return n},xs=5,Is=11,Ds=2,Us=65536>>xs,Ls=(1<<xs)-1,Rs=Us+(1024>>xs)+32,Qs=65536>>Is,Os=(1<<Is-xs)-1,Ps=function(t,e,n){return t.slice?t.slice(e,n):new Uint16Array(Array.prototype.slice.call(t,e,n))},Ms=function(t,e,n){return t.slice?t.slice(e,n):new Uint32Array(Array.prototype.slice.call(t,e,n))},Ns=function(t,e){var n=Fs(t),r=Array.isArray(n)?Ss(n):new Uint32Array(n),i=Array.isArray(n)?Ts(n):new Uint16Array(n),s=24,A=Ps(i,s/2,r[4]/2),a=2===r[5]?Ps(i,(s+r[4])/2):Ms(r,Math.ceil((s+r[4])/4));return new Hs(r[0],r[1],r[2],r[3],A,a)},Hs=function(){function t(t,e,n,r,i,s){this.initialValue=t,this.errorValue=e,this.highStart=n,this.highValueIndex=r,this.index=i,this.data=s}return t.prototype.get=function(t){var e;if(t>=0){if(t<55296||t>56319&&t<=65535)return e=((e=this.index[t>>xs])<<Ds)+(t&Ls),this.data[e];if(t<=65535)return e=((e=this.index[Us+(t-55296>>xs)])<<Ds)+(t&Ls),this.data[e];if(t<this.highStart)return e=Rs-Qs+(t>>Is),e=this.index[e],e+=t>>xs&Os,e=((e=this.index[e])<<Ds)+(t&Ls),this.data[e];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},t}(),Ks="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$s="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Gs=0;Gs<Ks.length;Gs++)$s[Ks.charCodeAt(Gs)]=Gs;var Vs,js=1,Zs=2,Ws=3,zs=4,Ys=5,Xs=7,qs=8,Js=9,tA=10,eA=11,nA=12,rA=13,iA=14,sA=15,AA=function(t){for(var e=[],n=0,r=t.length;n<r;){var i=t.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var s=t.charCodeAt(n++);56320==(64512&s)?e.push(((1023&i)<<10)+(1023&s)+65536):(e.push(i),n--)}else e.push(i)}return e},aA=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,t);var n=t.length;if(!n)return"";for(var r=[],i=-1,s="";++i<n;){var A=t[i];A<=65535?r.push(A):(A-=65536,r.push(55296+(A>>10),A%1024+56320)),(i+1===n||r.length>16384)&&(s+=String.fromCharCode.apply(String,r),r.length=0)}return s},oA=Ns(bs),lA="×",uA="÷",cA=function(t){return oA.get(t)},hA=function(t,e,n){var r=n-2,i=e[r],s=e[n-1],A=e[n];if(s===Zs&&A===Ws)return lA;if(s===Zs||s===Ws||s===zs)return uA;if(A===Zs||A===Ws||A===zs)return uA;if(s===qs&&-1!==[qs,Js,eA,nA].indexOf(A))return lA;if(!(s!==eA&&s!==Js||A!==Js&&A!==tA))return lA;if((s===nA||s===tA)&&A===tA)return lA;if(A===rA||A===Ys)return lA;if(A===Xs)return lA;if(s===js)return lA;if(s===rA&&A===iA){for(;i===Ys;)i=e[--r];if(i===iA)return lA}if(s===sA&&A===sA){for(var a=0;i===sA;)a++,i=e[--r];if(a%2==0)return lA}return uA},dA=function(t){var e=AA(t),n=e.length,r=0,i=0,s=e.map(cA);return{next:function(){if(r>=n)return{done:!0,value:null};for(var t=lA;r<n&&(t=hA(e,s,++r))===lA;);if(t!==lA||r===n){var A=aA.apply(null,e.slice(i,r));return i=r,{value:A,done:!1}}return{done:!0,value:null}}}},fA=function(t){for(var e,n=dA(t),r=[];!(e=n.next()).done;)e.value&&r.push(e.value.slice());return r},pA=function(t){var e=123;if(t.createRange){var n=t.createRange();if(n.getBoundingClientRect){var r=t.createElement("boundtest");r.style.height=e+"px",r.style.display="block",t.body.appendChild(r),n.selectNode(r);var i=n.getBoundingClientRect(),s=Math.round(i.height);if(t.body.removeChild(r),s===e)return!0}}return!1},gA=function(t){var e=t.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",t.body.appendChild(e);var n=t.createRange();e.innerHTML="function"==typeof"".repeat?"&#128104;".repeat(10):"";var r=e.firstChild,i=l(r.data).map((function(t){return u(t)})),s=0,A={},a=i.every((function(t,e){n.setStart(r,s),n.setEnd(r,s+t.length);var i=n.getBoundingClientRect();s+=t.length;var a=i.x>A.x||i.y>A.y;return A=i,0===e||a}));return t.body.removeChild(e),a},mA=function(){return void 0!==(new Image).crossOrigin},_A=function(){return"string"==typeof(new XMLHttpRequest).responseType},wA=function(t){var e=new Image,n=t.createElement("canvas"),r=n.getContext("2d");if(!r)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(e,0,0),n.toDataURL()}catch(t){return!1}return!0},yA=function(t){return 0===t[0]&&255===t[1]&&0===t[2]&&255===t[3]},vA=function(t){var e=t.createElement("canvas"),n=100;e.width=n,e.height=n;var r=e.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,n,n);var i=new Image,s=e.toDataURL();i.src=s;var A=BA(n,n,0,0,i);return r.fillStyle="red",r.fillRect(0,0,n,n),bA(A).then((function(e){r.drawImage(e,0,0);var i=r.getImageData(0,0,n,n).data;r.fillStyle="red",r.fillRect(0,0,n,n);var A=t.createElement("div");return A.style.backgroundImage="url("+s+")",A.style.height=n+"px",yA(i)?bA(BA(n,n,0,0,A)):Promise.reject(!1)})).then((function(t){return r.drawImage(t,0,0),yA(r.getImageData(0,0,n,n).data)})).catch((function(){return!1}))},BA=function(t,e,n,r,i){var s="http://www.w3.org/2000/svg",A=document.createElementNS(s,"svg"),a=document.createElementNS(s,"foreignObject");return A.setAttributeNS(null,"width",t.toString()),A.setAttributeNS(null,"height",e.toString()),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",n.toString()),a.setAttributeNS(null,"y",r.toString()),a.setAttributeNS(null,"externalResourcesRequired","true"),A.appendChild(a),a.appendChild(i),A},bA=function(t){return new Promise((function(e,n){var r=new Image;r.onload=function(){return e(r)},r.onerror=n,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(t))}))},EA={get SUPPORT_RANGE_BOUNDS(){var t=pA(document);return Object.defineProperty(EA,"SUPPORT_RANGE_BOUNDS",{value:t}),t},get SUPPORT_WORD_BREAKING(){var t=EA.SUPPORT_RANGE_BOUNDS&&gA(document);return Object.defineProperty(EA,"SUPPORT_WORD_BREAKING",{value:t}),t},get SUPPORT_SVG_DRAWING(){var t=wA(document);return Object.defineProperty(EA,"SUPPORT_SVG_DRAWING",{value:t}),t},get SUPPORT_FOREIGNOBJECT_DRAWING(){var t="function"==typeof Array.from&&"function"==typeof window.fetch?vA(document):Promise.resolve(!1);return Object.defineProperty(EA,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:t}),t},get SUPPORT_CORS_IMAGES(){var t=mA();return Object.defineProperty(EA,"SUPPORT_CORS_IMAGES",{value:t}),t},get SUPPORT_RESPONSE_TYPE(){var t=_A();return Object.defineProperty(EA,"SUPPORT_RESPONSE_TYPE",{value:t}),t},get SUPPORT_CORS_XHR(){var t="withCredentials"in new XMLHttpRequest;return Object.defineProperty(EA,"SUPPORT_CORS_XHR",{value:t}),t},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var t=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(EA,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:t}),t}},CA=function(){function t(t,e){this.text=t,this.bounds=e}return t}(),kA=function(t,e,n,r){var i=IA(e,n),s=[],a=0;return i.forEach((function(e){if(n.textDecorationLine.length||e.trim().length>0)if(EA.SUPPORT_RANGE_BOUNDS){var i=TA(r,a,e.length).getClientRects();if(i.length>1){var o=SA(e),l=0;o.forEach((function(e){s.push(new CA(e,A.fromDOMRectList(t,TA(r,l+a,e.length).getClientRects()))),l+=e.length}))}else s.push(new CA(e,A.fromDOMRectList(t,i)))}else{var u=r.splitText(e.length);s.push(new CA(e,FA(t,r))),r=u}else EA.SUPPORT_RANGE_BOUNDS||(r=r.splitText(e.length));a+=e.length})),s},FA=function(t,e){var n=e.ownerDocument;if(n){var r=n.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));var i=e.parentNode;if(i){i.replaceChild(r,e);var s=a(t,r);return r.firstChild&&i.replaceChild(r.firstChild,r),s}}return A.EMPTY},TA=function(t,e,n){var r=t.ownerDocument;if(!r)throw new Error("Node has no owner document");var i=r.createRange();return i.setStart(t,e),i.setEnd(t,e+n),i},SA=function(t){if(EA.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(t)).map((function(t){return t.segment}))}return fA(t)},xA=function(t,e){if(EA.SUPPORT_NATIVE_TEXT_SEGMENTATION){var n=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(n.segment(t)).map((function(t){return t.segment}))}return UA(t,e)},IA=function(t,e){return 0!==e.letterSpacing?SA(t):xA(t,e)},DA=[32,160,4961,65792,65793,4153,4241],UA=function(t,e){for(var n,r=Kt(t,{lineBreak:e.lineBreak,wordBreak:"break-word"===e.overflowWrap?"break-word":e.wordBreak}),i=[],s=function(){if(n.value){var t=n.value.slice(),e=l(t),r="";e.forEach((function(t){-1===DA.indexOf(t)?r+=u(t):(r.length&&i.push(r),i.push(u(t)),r="")})),r.length&&i.push(r)}};!(n=r.next()).done;)s();return i},LA=function(){function t(t,e,n){this.text=RA(e.data,n.textTransform),this.textBounds=kA(t,this.text,n,e)}return t}(),RA=function(t,e){switch(e){case 1:return t.toLowerCase();case 3:return t.replace(QA,OA);case 2:return t.toUpperCase();default:return t}},QA=/(^|\s|:|-|\(|\))([a-z])/g,OA=function(t,e,n){return t.length>0?e+n.toUpperCase():t},PA=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.src=n.currentSrc||n.src,r.intrinsicWidth=n.naturalWidth,r.intrinsicHeight=n.naturalHeight,r.context.cache.addImage(r.src),r}return e(n,t),n}(Bs),MA=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.canvas=n,r.intrinsicWidth=n.width,r.intrinsicHeight=n.height,r}return e(n,t),n}(Bs),NA=function(t){function n(e,n){var r=t.call(this,e,n)||this,i=new XMLSerializer,s=a(e,n);return n.setAttribute("width",s.width+"px"),n.setAttribute("height",s.height+"px"),r.svg="data:image/svg+xml,"+encodeURIComponent(i.serializeToString(n)),r.intrinsicWidth=n.width.baseVal.value,r.intrinsicHeight=n.height.baseVal.value,r.context.cache.addImage(r.svg),r}return e(n,t),n}(Bs),HA=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.value=n.value,r}return e(n,t),n}(Bs),KA=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.start=n.start,r.reversed="boolean"==typeof n.reversed&&!0===n.reversed,r}return e(n,t),n}(Bs),$A=[{type:15,flags:0,unit:"px",number:3}],GA=[{type:16,flags:0,number:50}],VA=function(t){return t.width>t.height?new A(t.left+(t.width-t.height)/2,t.top,t.height,t.height):t.width<t.height?new A(t.left,t.top+(t.height-t.width)/2,t.width,t.width):t},jA=function(t){var e=t.type===zA?new Array(t.value.length+1).join("•"):t.value;return 0===e.length?t.placeholder||"":e},ZA="checkbox",WA="radio",zA="password",YA=707406591,XA=function(t){function n(e,n){var r=t.call(this,e,n)||this;switch(r.type=n.type.toLowerCase(),r.checked=n.checked,r.value=jA(n),r.type!==ZA&&r.type!==WA||(r.styles.backgroundColor=3739148031,r.styles.borderTopColor=r.styles.borderRightColor=r.styles.borderBottomColor=r.styles.borderLeftColor=2779096575,r.styles.borderTopWidth=r.styles.borderRightWidth=r.styles.borderBottomWidth=r.styles.borderLeftWidth=1,r.styles.borderTopStyle=r.styles.borderRightStyle=r.styles.borderBottomStyle=r.styles.borderLeftStyle=1,r.styles.backgroundClip=[0],r.styles.backgroundOrigin=[0],r.bounds=VA(r.bounds)),r.type){case ZA:r.styles.borderTopRightRadius=r.styles.borderTopLeftRadius=r.styles.borderBottomRightRadius=r.styles.borderBottomLeftRadius=$A;break;case WA:r.styles.borderTopRightRadius=r.styles.borderTopLeftRadius=r.styles.borderBottomRightRadius=r.styles.borderBottomLeftRadius=GA}return r}return e(n,t),n}(Bs),qA=function(t){function n(e,n){var r=t.call(this,e,n)||this,i=n.options[n.selectedIndex||0];return r.value=i&&i.text||"",r}return e(n,t),n}(Bs),JA=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.value=n.value,r}return e(n,t),n}(Bs),ta=function(t){function n(e,n){var r=t.call(this,e,n)||this;r.src=n.src,r.width=parseInt(n.width,10)||0,r.height=parseInt(n.height,10)||0,r.backgroundColor=r.styles.backgroundColor;try{if(n.contentWindow&&n.contentWindow.document&&n.contentWindow.document.documentElement){r.tree=ia(e,n.contentWindow.document.documentElement);var i=n.contentWindow.document.documentElement?cr(e,getComputedStyle(n.contentWindow.document.documentElement).backgroundColor):hr.TRANSPARENT,s=n.contentWindow.document.body?cr(e,getComputedStyle(n.contentWindow.document.body).backgroundColor):hr.TRANSPARENT;r.backgroundColor=rr(i)?rr(s)?r.styles.backgroundColor:s:i}}catch(t){}return r}return e(n,t),n}(Bs),ea=["OL","UL","MENU"],na=function(t,e,n,r){for(var i=e.firstChild,s=void 0;i;i=s)if(s=i.nextSibling,aa(i)&&i.data.trim().length>0)n.textNodes.push(new LA(t,i,n.styles));else if(oa(i))if(Ca(i)&&i.assignedNodes)i.assignedNodes().forEach((function(e){return na(t,e,n,r)}));else{var A=ra(t,i);A.styles.isVisible()&&(sa(i,A,r)?A.flags|=4:Aa(A.styles)&&(A.flags|=2),-1!==ea.indexOf(i.tagName)&&(A.flags|=8),n.elements.push(A),i.slot,i.shadowRoot?na(t,i.shadowRoot,A,r):ba(i)||pa(i)||Ea(i)||na(t,i,A,r))}},ra=function(t,e){return wa(e)?new PA(t,e):ma(e)?new MA(t,e):pa(e)?new NA(t,e):ca(e)?new HA(t,e):ha(e)?new KA(t,e):da(e)?new XA(t,e):Ea(e)?new qA(t,e):ba(e)?new JA(t,e):ya(e)?new ta(t,e):new Bs(t,e)},ia=function(t,e){var n=ra(t,e);return n.flags|=4,na(t,e,n,n),n},sa=function(t,e,n){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||ga(t)&&n.styles.isTransparent()},Aa=function(t){return t.isPositioned()||t.isFloating()},aa=function(t){return t.nodeType===Node.TEXT_NODE},oa=function(t){return t.nodeType===Node.ELEMENT_NODE},la=function(t){return oa(t)&&void 0!==t.style&&!ua(t)},ua=function(t){return"object"==typeof t.className},ca=function(t){return"LI"===t.tagName},ha=function(t){return"OL"===t.tagName},da=function(t){return"INPUT"===t.tagName},fa=function(t){return"HTML"===t.tagName},pa=function(t){return"svg"===t.tagName},ga=function(t){return"BODY"===t.tagName},ma=function(t){return"CANVAS"===t.tagName},_a=function(t){return"VIDEO"===t.tagName},wa=function(t){return"IMG"===t.tagName},ya=function(t){return"IFRAME"===t.tagName},va=function(t){return"STYLE"===t.tagName},Ba=function(t){return"SCRIPT"===t.tagName},ba=function(t){return"TEXTAREA"===t.tagName},Ea=function(t){return"SELECT"===t.tagName},Ca=function(t){return"SLOT"===t.tagName},ka=function(t){return t.tagName.indexOf("-")>0},Fa=function(){function t(){this.counters={}}return t.prototype.getCounterValue=function(t){var e=this.counters[t];return e&&e.length?e[e.length-1]:1},t.prototype.getCounterValues=function(t){var e=this.counters[t];return e||[]},t.prototype.pop=function(t){var e=this;t.forEach((function(t){return e.counters[t].pop()}))},t.prototype.parse=function(t){var e=this,n=t.counterIncrement,r=t.counterReset,i=!0;null!==n&&n.forEach((function(t){var n=e.counters[t.counter];n&&0!==t.increment&&(i=!1,n.length||n.push(1),n[Math.max(0,n.length-1)]+=t.increment)}));var s=[];return i&&r.forEach((function(t){var n=e.counters[t.counter];s.push(t.counter),n||(n=e.counters[t.counter]=[]),n.push(t.reset)})),s},t}(),Ta={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Sa={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},xa={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Ia={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Da=function(t,e,n,r,i,s){return t<e||t>n?Va(t,i,s.length>0):r.integers.reduce((function(e,n,i){for(;t>=n;)t-=n,e+=r.values[i];return e}),"")+s},Ua=function(t,e,n,r){var i="";do{n||t--,i=r(t)+i,t/=e}while(t*e>=e);return i},La=function(t,e,n,r,i){var s=n-e+1;return(t<0?"-":"")+(Ua(Math.abs(t),s,r,(function(t){return u(Math.floor(t%s)+e)}))+i)},Ra=function(t,e,n){void 0===n&&(n=". ");var r=e.length;return Ua(Math.abs(t),r,!1,(function(t){return e[Math.floor(t%r)]}))+n},Qa=1,Oa=2,Pa=4,Ma=8,Na=function(t,e,n,r,i,s){if(t<-9999||t>9999)return Va(t,4,i.length>0);var A=Math.abs(t),a=i;if(0===A)return e[0]+a;for(var o=0;A>0&&o<=4;o++){var l=A%10;0===l&&is(s,Qa)&&""!==a?a=e[l]+a:l>1||1===l&&0===o||1===l&&1===o&&is(s,Oa)||1===l&&1===o&&is(s,Pa)&&t>100||1===l&&o>1&&is(s,Ma)?a=e[l]+(o>0?n[o-1]:"")+a:1===l&&o>0&&(a=n[o-1]+a),A=Math.floor(A/10)}return(t<0?r:"")+a},Ha="十百千萬",Ka="拾佰仟萬",$a="マイナス",Ga="마이너스",Va=function(t,e,n){var r=n?". ":"",i=n?"、":"",s=n?", ":"",A=n?" ":"";switch(e){case 0:return"•"+A;case 1:return"◦"+A;case 2:return"◾"+A;case 5:var a=La(t,48,57,!0,r);return a.length<4?"0"+a:a;case 4:return Ra(t,"〇一二三四五六七八九",i);case 6:return Da(t,1,3999,Ta,3,r).toLowerCase();case 7:return Da(t,1,3999,Ta,3,r);case 8:return La(t,945,969,!1,r);case 9:return La(t,97,122,!1,r);case 10:return La(t,65,90,!1,r);case 11:return La(t,1632,1641,!0,r);case 12:case 49:return Da(t,1,9999,Sa,3,r);case 35:return Da(t,1,9999,Sa,3,r).toLowerCase();case 13:return La(t,2534,2543,!0,r);case 14:case 30:return La(t,6112,6121,!0,r);case 15:return Ra(t,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return Ra(t,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return Na(t,"零一二三四五六七八九",Ha,"負",i,Oa|Pa|Ma);case 47:return Na(t,"零壹貳參肆伍陸柒捌玖",Ka,"負",i,Qa|Oa|Pa|Ma);case 42:return Na(t,"零一二三四五六七八九",Ha,"负",i,Oa|Pa|Ma);case 41:return Na(t,"零壹贰叁肆伍陆柒捌玖",Ka,"负",i,Qa|Oa|Pa|Ma);case 26:return Na(t,"〇一二三四五六七八九","十百千万",$a,i,0);case 25:return Na(t,"零壱弐参四伍六七八九","拾百千万",$a,i,Qa|Oa|Pa);case 31:return Na(t,"영일이삼사오육칠팔구","십백천만",Ga,s,Qa|Oa|Pa);case 33:return Na(t,"零一二三四五六七八九","十百千萬",Ga,s,0);case 32:return Na(t,"零壹貳參四五六七八九","拾百千",Ga,s,Qa|Oa|Pa);case 18:return La(t,2406,2415,!0,r);case 20:return Da(t,1,19999,Ia,3,r);case 21:return La(t,2790,2799,!0,r);case 22:return La(t,2662,2671,!0,r);case 22:return Da(t,1,10999,xa,3,r);case 23:return Ra(t,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Ra(t,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return La(t,3302,3311,!0,r);case 28:return Ra(t,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return Ra(t,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return La(t,3792,3801,!0,r);case 37:return La(t,6160,6169,!0,r);case 38:return La(t,4160,4169,!0,r);case 39:return La(t,2918,2927,!0,r);case 40:return La(t,1776,1785,!0,r);case 43:return La(t,3046,3055,!0,r);case 44:return La(t,3174,3183,!0,r);case 45:return La(t,3664,3673,!0,r);case 46:return La(t,3872,3881,!0,r);default:return La(t,48,57,!0,r)}},ja="data-html2canvas-ignore",Za=function(){function t(t,e,n){if(this.context=t,this.options=n,this.scrolledElements=[],this.referenceElement=e,this.counters=new Fa,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}return t.prototype.toIFrame=function(t,e){var n=this,s=za(t,e);if(!s.contentWindow)return Promise.reject("Unable to find iframe window");var A=t.defaultView.pageXOffset,a=t.defaultView.pageYOffset,o=s.contentWindow,l=o.document,u=qa(s).then((function(){return r(n,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return this.scrolledElements.forEach(ro),o&&(o.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||o.scrollY===e.top&&o.scrollX===e.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-e.left,o.scrollY-e.top,0,0))),t=this.options.onclone,void 0===(n=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:l.fonts&&l.fonts.ready?[4,l.fonts.ready]:[3,2];case 1:r.sent(),r.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,Xa(l)]:[3,4];case 3:r.sent(),r.label=4;case 4:return"function"==typeof t?[2,Promise.resolve().then((function(){return t(l,n)})).then((function(){return s}))]:[2,s]}}))}))}));return l.open(),l.write(eo(document.doctype)+"<html></html>"),no(this.referenceElement.ownerDocument,A,a),l.replaceChild(l.adoptNode(this.documentElement),l.documentElement),l.close(),u},t.prototype.createElementClone=function(t){if(vs(t,2),ma(t))return this.createCanvasClone(t);if(_a(t))return this.createVideoClone(t);if(va(t))return this.createStyleClone(t);var e=t.cloneNode(!1);return wa(e)&&(wa(t)&&t.currentSrc&&t.currentSrc!==t.src&&(e.src=t.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager")),ka(e)?this.createCustomElementClone(e):e},t.prototype.createCustomElementClone=function(t){var e=document.createElement("html2canvascustomelement");return to(t.style,e),e},t.prototype.createStyleClone=function(t){try{var e=t.sheet;if(e&&e.cssRules){var n=[].slice.call(e.cssRules,0).reduce((function(t,e){return e&&"string"==typeof e.cssText?t+e.cssText:t}),""),r=t.cloneNode(!1);return r.textContent=n,r}}catch(t){if(this.context.logger.error("Unable to access cssRules property",t),"SecurityError"!==t.name)throw t}return t.cloneNode(!1)},t.prototype.createCanvasClone=function(t){var e;if(this.options.inlineImages&&t.ownerDocument){var n=t.ownerDocument.createElement("img");try{return n.src=t.toDataURL(),n}catch(e){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",t)}}var r=t.cloneNode(!1);try{r.width=t.width,r.height=t.height;var i=t.getContext("2d"),s=r.getContext("2d");if(s)if(!this.options.allowTaint&&i)s.putImageData(i.getImageData(0,0,t.width,t.height),0,0);else{var A=null!==(e=t.getContext("webgl2"))&&void 0!==e?e:t.getContext("webgl");if(A){var a=A.getContextAttributes();!1===(null==a?void 0:a.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",t)}s.drawImage(t,0,0)}return r}catch(e){this.context.logger.info("Unable to clone canvas as it is tainted",t)}return r},t.prototype.createVideoClone=function(t){var e=t.ownerDocument.createElement("canvas");e.width=t.offsetWidth,e.height=t.offsetHeight;var n=e.getContext("2d");try{return n&&(n.drawImage(t,0,0,e.width,e.height),this.options.allowTaint||n.getImageData(0,0,e.width,e.height)),e}catch(e){this.context.logger.info("Unable to clone video as it is tainted",t)}var r=t.ownerDocument.createElement("canvas");return r.width=t.offsetWidth,r.height=t.offsetHeight,r},t.prototype.appendChildNode=function(t,e,n){oa(e)&&(Ba(e)||e.hasAttribute(ja)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&oa(e)&&va(e)||t.appendChild(this.cloneNode(e,n))},t.prototype.cloneChildNodes=function(t,e,n){for(var r=this,i=t.shadowRoot?t.shadowRoot.firstChild:t.firstChild;i;i=i.nextSibling)if(oa(i)&&Ca(i)&&"function"==typeof i.assignedNodes){var s=i.assignedNodes();s.length&&s.forEach((function(t){return r.appendChildNode(e,t,n)}))}else this.appendChildNode(e,i,n)},t.prototype.cloneNode=function(t,e){if(aa(t))return document.createTextNode(t.data);if(!t.ownerDocument)return t.cloneNode(!1);var n=t.ownerDocument.defaultView;if(n&&oa(t)&&(la(t)||ua(t))){var r=this.createElementClone(t);r.style.transitionProperty="none";var i=n.getComputedStyle(t),s=n.getComputedStyle(t,":before"),A=n.getComputedStyle(t,":after");this.referenceElement===t&&la(r)&&(this.clonedReferenceElement=r),ga(r)&&lo(r);var a=this.counters.parse(new ms(this.context,i)),o=this.resolvePseudoContent(t,r,s,Vs.BEFORE);ka(t)&&(e=!0),_a(t)||this.cloneChildNodes(t,r,e),o&&r.insertBefore(o,r.firstChild);var l=this.resolvePseudoContent(t,r,A,Vs.AFTER);return l&&r.appendChild(l),this.counters.pop(a),(i&&(this.options.copyStyles||ua(t))&&!ya(t)||e)&&to(i,r),0===t.scrollTop&&0===t.scrollLeft||this.scrolledElements.push([r,t.scrollLeft,t.scrollTop]),(ba(t)||Ea(t))&&(ba(r)||Ea(r))&&(r.value=t.value),r}return t.cloneNode(!1)},t.prototype.resolvePseudoContent=function(t,e,n,r){var i=this;if(n){var s=n.content,A=e.ownerDocument;if(A&&s&&"none"!==s&&"-moz-alt-content"!==s&&"none"!==n.display){this.counters.parse(new ms(this.context,n));var a=new gs(this.context,n),o=A.createElement("html2canvaspseudoelement");to(n,o),a.content.forEach((function(e){if(0===e.type)o.appendChild(A.createTextNode(e.value));else if(22===e.type){var n=A.createElement("img");n.src=e.value,n.style.opacity="1",o.appendChild(n)}else if(18===e.type){if("attr"===e.name){var r=e.values.filter(Un);r.length&&o.appendChild(A.createTextNode(t.getAttribute(r[0].value)||""))}else if("counter"===e.name){var s=e.values.filter(On),l=s[0],u=s[1];if(l&&Un(l)){var c=i.counters.getCounterValue(l.value),h=u&&Un(u)?Ei.parse(i.context,u.value):3;o.appendChild(A.createTextNode(Va(c,h,!1)))}}else if("counters"===e.name){var d=e.values.filter(On),f=(l=d[0],d[1]);if(u=d[2],l&&Un(l)){var p=i.counters.getCounterValues(l.value),g=u&&Un(u)?Ei.parse(i.context,u.value):3,m=f&&0===f.type?f.value:"",_=p.map((function(t){return Va(t,g,!1)})).join(m);o.appendChild(A.createTextNode(_))}}}else if(20===e.type)switch(e.value){case"open-quote":o.appendChild(A.createTextNode(us(a.quotes,i.quoteDepth++,!0)));break;case"close-quote":o.appendChild(A.createTextNode(us(a.quotes,--i.quoteDepth,!1)));break;default:o.appendChild(A.createTextNode(e.value))}})),o.className=Ao+" "+ao;var l=r===Vs.BEFORE?" "+Ao:" "+ao;return ua(e)?e.className.baseValue+=l:e.className+=l,o}}},t.destroy=function(t){return!!t.parentNode&&(t.parentNode.removeChild(t),!0)},t}();!function(t){t[t.BEFORE=0]="BEFORE",t[t.AFTER=1]="AFTER"}(Vs||(Vs={}));var Wa,za=function(t,e){var n=t.createElement("iframe");return n.className="html2canvas-container",n.style.visibility="hidden",n.style.position="fixed",n.style.left="-10000px",n.style.top="0px",n.style.border="0",n.width=e.width.toString(),n.height=e.height.toString(),n.scrolling="no",n.setAttribute(ja,"true"),t.body.appendChild(n),n},Ya=function(t){return new Promise((function(e){t.complete?e():t.src?(t.onload=e,t.onerror=e):e()}))},Xa=function(t){return Promise.all([].slice.call(t.images,0).map(Ya))},qa=function(t){return new Promise((function(e,n){var r=t.contentWindow;if(!r)return n("No window assigned for iframe");var i=r.document;r.onload=t.onload=function(){r.onload=t.onload=null;var n=setInterval((function(){i.body.childNodes.length>0&&"complete"===i.readyState&&(clearInterval(n),e(t))}),50)}}))},Ja=["all","d","content"],to=function(t,e){for(var n=t.length-1;n>=0;n--){var r=t.item(n);-1===Ja.indexOf(r)&&e.style.setProperty(r,t.getPropertyValue(r))}return e},eo=function(t){var e="";return t&&(e+="<!DOCTYPE ",t.name&&(e+=t.name),t.internalSubset&&(e+=t.internalSubset),t.publicId&&(e+='"'+t.publicId+'"'),t.systemId&&(e+='"'+t.systemId+'"'),e+=">"),e},no=function(t,e,n){t&&t.defaultView&&(e!==t.defaultView.pageXOffset||n!==t.defaultView.pageYOffset)&&t.defaultView.scrollTo(e,n)},ro=function(t){var e=t[0],n=t[1],r=t[2];e.scrollLeft=n,e.scrollTop=r},io=":before",so=":after",Ao="___html2canvas___pseudoelement_before",ao="___html2canvas___pseudoelement_after",oo='{\n content: "" !important;\n display: none !important;\n}',lo=function(t){uo(t,"."+Ao+io+oo+"\n ."+ao+so+oo)},uo=function(t,e){var n=t.ownerDocument;if(n){var r=n.createElement("style");r.textContent=e,t.appendChild(r)}},co=function(){function t(){}return t.getOrigin=function(e){var n=t._link;return n?(n.href=e,n.href=n.href,n.protocol+n.hostname+n.port):"about:blank"},t.isSameOrigin=function(e){return t.getOrigin(e)===t._origin},t.setContext=function(e){t._link=e.document.createElement("a"),t._origin=t.getOrigin(e.location.href)},t._origin="about:blank",t}(),ho=function(){function t(t,e){this.context=t,this._options=e,this._cache={}}return t.prototype.addImage=function(t){var e=Promise.resolve();return this.has(t)?e:yo(t)||mo(t)?((this._cache[t]=this.loadImage(t)).catch((function(){})),e):e},t.prototype.match=function(t){return this._cache[t]},t.prototype.loadImage=function(t){return r(this,void 0,void 0,(function(){var e,n,r,s,A=this;return i(this,(function(i){switch(i.label){case 0:return e=co.isSameOrigin(t),n=!_o(t)&&!0===this._options.useCORS&&EA.SUPPORT_CORS_IMAGES&&!e,r=!_o(t)&&!e&&!yo(t)&&"string"==typeof this._options.proxy&&EA.SUPPORT_CORS_XHR&&!n,e||!1!==this._options.allowTaint||_o(t)||yo(t)||r||n?(s=t,r?[4,this.proxy(s)]:[3,2]):[2];case 1:s=i.sent(),i.label=2;case 2:return this.context.logger.debug("Added image "+t.substring(0,256)),[4,new Promise((function(t,e){var r=new Image;r.onload=function(){return t(r)},r.onerror=e,(wo(s)||n)&&(r.crossOrigin="anonymous"),r.src=s,!0===r.complete&&setTimeout((function(){return t(r)}),500),A._options.imageTimeout>0&&setTimeout((function(){return e("Timed out ("+A._options.imageTimeout+"ms) loading image")}),A._options.imageTimeout)}))];case 3:return[2,i.sent()]}}))}))},t.prototype.has=function(t){return void 0!==this._cache[t]},t.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},t.prototype.proxy=function(t){var e=this,n=this._options.proxy;if(!n)throw new Error("No proxy defined");var r=t.substring(0,256);return new Promise((function(i,s){var A=EA.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(200===a.status)if("text"===A)i(a.response);else{var t=new FileReader;t.addEventListener("load",(function(){return i(t.result)}),!1),t.addEventListener("error",(function(t){return s(t)}),!1),t.readAsDataURL(a.response)}else s("Failed to proxy resource "+r+" with status code "+a.status)},a.onerror=s;var o=n.indexOf("?")>-1?"&":"?";if(a.open("GET",""+n+o+"url="+encodeURIComponent(t)+"&responseType="+A),"text"!==A&&a instanceof XMLHttpRequest&&(a.responseType=A),e._options.imageTimeout){var l=e._options.imageTimeout;a.timeout=l,a.ontimeout=function(){return s("Timed out ("+l+"ms) proxying "+r)}}a.send()}))},t}(),fo=/^data:image\/svg\+xml/i,po=/^data:image\/.*;base64,/i,go=/^data:image\/.*/i,mo=function(t){return EA.SUPPORT_SVG_DRAWING||!vo(t)},_o=function(t){return go.test(t)},wo=function(t){return po.test(t)},yo=function(t){return"blob"===t.substr(0,4)},vo=function(t){return"svg"===t.substr(-3).toLowerCase()||fo.test(t)},Bo=function(){function t(t,e){this.type=0,this.x=t,this.y=e}return t.prototype.add=function(e,n){return new t(this.x+e,this.y+n)},t}(),bo=function(t,e,n){return new Bo(t.x+(e.x-t.x)*n,t.y+(e.y-t.y)*n)},Eo=function(){function t(t,e,n,r){this.type=1,this.start=t,this.startControl=e,this.endControl=n,this.end=r}return t.prototype.subdivide=function(e,n){var r=bo(this.start,this.startControl,e),i=bo(this.startControl,this.endControl,e),s=bo(this.endControl,this.end,e),A=bo(r,i,e),a=bo(i,s,e),o=bo(A,a,e);return n?new t(this.start,r,A,o):new t(o,a,s,this.end)},t.prototype.add=function(e,n){return new t(this.start.add(e,n),this.startControl.add(e,n),this.endControl.add(e,n),this.end.add(e,n))},t.prototype.reverse=function(){return new t(this.end,this.endControl,this.startControl,this.start)},t}(),Co=function(t){return 1===t.type},ko=function(){function t(t){var e=t.styles,n=t.bounds,r=jn(e.borderTopLeftRadius,n.width,n.height),i=r[0],s=r[1],A=jn(e.borderTopRightRadius,n.width,n.height),a=A[0],o=A[1],l=jn(e.borderBottomRightRadius,n.width,n.height),u=l[0],c=l[1],h=jn(e.borderBottomLeftRadius,n.width,n.height),d=h[0],f=h[1],p=[];p.push((i+a)/n.width),p.push((d+u)/n.width),p.push((s+f)/n.height),p.push((o+c)/n.height);var g=Math.max.apply(Math,p);g>1&&(i/=g,s/=g,a/=g,o/=g,u/=g,c/=g,d/=g,f/=g);var m=n.width-a,_=n.height-c,w=n.width-u,y=n.height-f,v=e.borderTopWidth,B=e.borderRightWidth,b=e.borderBottomWidth,E=e.borderLeftWidth,C=Zn(e.paddingTop,t.bounds.width),k=Zn(e.paddingRight,t.bounds.width),F=Zn(e.paddingBottom,t.bounds.width),T=Zn(e.paddingLeft,t.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||s>0?Fo(n.left+E/3,n.top+v/3,i-E/3,s-v/3,Wa.TOP_LEFT):new Bo(n.left+E/3,n.top+v/3),this.topRightBorderDoubleOuterBox=i>0||s>0?Fo(n.left+m,n.top+v/3,a-B/3,o-v/3,Wa.TOP_RIGHT):new Bo(n.left+n.width-B/3,n.top+v/3),this.bottomRightBorderDoubleOuterBox=u>0||c>0?Fo(n.left+w,n.top+_,u-B/3,c-b/3,Wa.BOTTOM_RIGHT):new Bo(n.left+n.width-B/3,n.top+n.height-b/3),this.bottomLeftBorderDoubleOuterBox=d>0||f>0?Fo(n.left+E/3,n.top+y,d-E/3,f-b/3,Wa.BOTTOM_LEFT):new Bo(n.left+E/3,n.top+n.height-b/3),this.topLeftBorderDoubleInnerBox=i>0||s>0?Fo(n.left+2*E/3,n.top+2*v/3,i-2*E/3,s-2*v/3,Wa.TOP_LEFT):new Bo(n.left+2*E/3,n.top+2*v/3),this.topRightBorderDoubleInnerBox=i>0||s>0?Fo(n.left+m,n.top+2*v/3,a-2*B/3,o-2*v/3,Wa.TOP_RIGHT):new Bo(n.left+n.width-2*B/3,n.top+2*v/3),this.bottomRightBorderDoubleInnerBox=u>0||c>0?Fo(n.left+w,n.top+_,u-2*B/3,c-2*b/3,Wa.BOTTOM_RIGHT):new Bo(n.left+n.width-2*B/3,n.top+n.height-2*b/3),this.bottomLeftBorderDoubleInnerBox=d>0||f>0?Fo(n.left+2*E/3,n.top+y,d-2*E/3,f-2*b/3,Wa.BOTTOM_LEFT):new Bo(n.left+2*E/3,n.top+n.height-2*b/3),this.topLeftBorderStroke=i>0||s>0?Fo(n.left+E/2,n.top+v/2,i-E/2,s-v/2,Wa.TOP_LEFT):new Bo(n.left+E/2,n.top+v/2),this.topRightBorderStroke=i>0||s>0?Fo(n.left+m,n.top+v/2,a-B/2,o-v/2,Wa.TOP_RIGHT):new Bo(n.left+n.width-B/2,n.top+v/2),this.bottomRightBorderStroke=u>0||c>0?Fo(n.left+w,n.top+_,u-B/2,c-b/2,Wa.BOTTOM_RIGHT):new Bo(n.left+n.width-B/2,n.top+n.height-b/2),this.bottomLeftBorderStroke=d>0||f>0?Fo(n.left+E/2,n.top+y,d-E/2,f-b/2,Wa.BOTTOM_LEFT):new Bo(n.left+E/2,n.top+n.height-b/2),this.topLeftBorderBox=i>0||s>0?Fo(n.left,n.top,i,s,Wa.TOP_LEFT):new Bo(n.left,n.top),this.topRightBorderBox=a>0||o>0?Fo(n.left+m,n.top,a,o,Wa.TOP_RIGHT):new Bo(n.left+n.width,n.top),this.bottomRightBorderBox=u>0||c>0?Fo(n.left+w,n.top+_,u,c,Wa.BOTTOM_RIGHT):new Bo(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=d>0||f>0?Fo(n.left,n.top+y,d,f,Wa.BOTTOM_LEFT):new Bo(n.left,n.top+n.height),this.topLeftPaddingBox=i>0||s>0?Fo(n.left+E,n.top+v,Math.max(0,i-E),Math.max(0,s-v),Wa.TOP_LEFT):new Bo(n.left+E,n.top+v),this.topRightPaddingBox=a>0||o>0?Fo(n.left+Math.min(m,n.width-B),n.top+v,m>n.width+B?0:Math.max(0,a-B),Math.max(0,o-v),Wa.TOP_RIGHT):new Bo(n.left+n.width-B,n.top+v),this.bottomRightPaddingBox=u>0||c>0?Fo(n.left+Math.min(w,n.width-E),n.top+Math.min(_,n.height-b),Math.max(0,u-B),Math.max(0,c-b),Wa.BOTTOM_RIGHT):new Bo(n.left+n.width-B,n.top+n.height-b),this.bottomLeftPaddingBox=d>0||f>0?Fo(n.left+E,n.top+Math.min(y,n.height-b),Math.max(0,d-E),Math.max(0,f-b),Wa.BOTTOM_LEFT):new Bo(n.left+E,n.top+n.height-b),this.topLeftContentBox=i>0||s>0?Fo(n.left+E+T,n.top+v+C,Math.max(0,i-(E+T)),Math.max(0,s-(v+C)),Wa.TOP_LEFT):new Bo(n.left+E+T,n.top+v+C),this.topRightContentBox=a>0||o>0?Fo(n.left+Math.min(m,n.width+E+T),n.top+v+C,m>n.width+E+T?0:a-E+T,o-(v+C),Wa.TOP_RIGHT):new Bo(n.left+n.width-(B+k),n.top+v+C),this.bottomRightContentBox=u>0||c>0?Fo(n.left+Math.min(w,n.width-(E+T)),n.top+Math.min(_,n.height+v+C),Math.max(0,u-(B+k)),c-(b+F),Wa.BOTTOM_RIGHT):new Bo(n.left+n.width-(B+k),n.top+n.height-(b+F)),this.bottomLeftContentBox=d>0||f>0?Fo(n.left+E+T,n.top+y,Math.max(0,d-(E+T)),f-(b+F),Wa.BOTTOM_LEFT):new Bo(n.left+E+T,n.top+n.height-(b+F))}return t}();!function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=1]="TOP_RIGHT",t[t.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",t[t.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(Wa||(Wa={}));var Fo=function(t,e,n,r,i){var s=(Math.sqrt(2)-1)/3*4,A=n*s,a=r*s,o=t+n,l=e+r;switch(i){case Wa.TOP_LEFT:return new Eo(new Bo(t,l),new Bo(t,l-a),new Bo(o-A,e),new Bo(o,e));case Wa.TOP_RIGHT:return new Eo(new Bo(t,e),new Bo(t+A,e),new Bo(o,l-a),new Bo(o,l));case Wa.BOTTOM_RIGHT:return new Eo(new Bo(o,e),new Bo(o,e+a),new Bo(t+A,l),new Bo(t,l));case Wa.BOTTOM_LEFT:default:return new Eo(new Bo(o,l),new Bo(o-A,l),new Bo(t,e+a),new Bo(t,e))}},To=function(t){return[t.topLeftBorderBox,t.topRightBorderBox,t.bottomRightBorderBox,t.bottomLeftBorderBox]},So=function(t){return[t.topLeftContentBox,t.topRightContentBox,t.bottomRightContentBox,t.bottomLeftContentBox]},xo=function(t){return[t.topLeftPaddingBox,t.topRightPaddingBox,t.bottomRightPaddingBox,t.bottomLeftPaddingBox]},Io=function(){function t(t,e,n){this.offsetX=t,this.offsetY=e,this.matrix=n,this.type=0,this.target=6}return t}(),Do=function(){function t(t,e){this.path=t,this.target=e,this.type=1}return t}(),Uo=function(){function t(t){this.opacity=t,this.type=2,this.target=6}return t}(),Lo=function(t){return 0===t.type},Ro=function(t){return 1===t.type},Qo=function(t){return 2===t.type},Oo=function(t,e){return t.length===e.length&&t.some((function(t,n){return t===e[n]}))},Po=function(t,e,n,r,i){return t.map((function(t,s){switch(s){case 0:return t.add(e,n);case 1:return t.add(e+r,n);case 2:return t.add(e+r,n+i);case 3:return t.add(e,n+i)}return t}))},Mo=function(){function t(t){this.element=t,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return t}(),No=function(){function t(t,e){if(this.container=t,this.parent=e,this.effects=[],this.curves=new ko(this.container),this.container.styles.opacity<1&&this.effects.push(new Uo(this.container.styles.opacity)),null!==this.container.styles.transform){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new Io(n,r,i))}if(0!==this.container.styles.overflowX){var s=To(this.curves),A=xo(this.curves);Oo(s,A)?this.effects.push(new Do(s,6)):(this.effects.push(new Do(s,2)),this.effects.push(new Do(A,4)))}}return t.prototype.getEffects=function(t){for(var e=-1===[2,3].indexOf(this.container.styles.position),n=this.parent,r=this.effects.slice(0);n;){var i=n.effects.filter((function(t){return!Ro(t)}));if(e||0!==n.container.styles.position||!n.parent){if(r.unshift.apply(r,i),e=-1===[2,3].indexOf(n.container.styles.position),0!==n.container.styles.overflowX){var s=To(n.curves),A=xo(n.curves);Oo(s,A)||r.unshift(new Do(A,6))}}else r.unshift.apply(r,i);n=n.parent}return r.filter((function(e){return is(e.target,t)}))},t}(),Ho=function(t,e,n,r){t.container.elements.forEach((function(i){var s=is(i.flags,4),A=is(i.flags,2),a=new No(i,t);is(i.styles.display,2048)&&r.push(a);var o=is(i.flags,8)?[]:r;if(s||A){var l=s||i.styles.isPositioned()?n:e,u=new Mo(a);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var c=i.styles.zIndex.order;if(c<0){var h=0;l.negativeZIndex.some((function(t,e){return c>t.element.container.styles.zIndex.order?(h=e,!1):h>0})),l.negativeZIndex.splice(h,0,u)}else if(c>0){var d=0;l.positiveZIndex.some((function(t,e){return c>=t.element.container.styles.zIndex.order?(d=e+1,!1):d>0})),l.positiveZIndex.splice(d,0,u)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else i.styles.isFloating()?l.nonPositionedFloats.push(u):l.nonPositionedInlineLevel.push(u);Ho(a,u,s?u:n,o)}else i.styles.isInlineLevel()?e.inlineLevel.push(a):e.nonInlineLevel.push(a),Ho(a,e,n,o);is(i.flags,8)&&Ko(i,o)}))},Ko=function(t,e){for(var n=t instanceof KA?t.start:1,r=t instanceof KA&&t.reversed,i=0;i<e.length;i++){var s=e[i];s.container instanceof HA&&"number"==typeof s.container.value&&0!==s.container.value&&(n=s.container.value),s.listValue=Va(n,s.container.styles.listStyleType,!0),n+=r?-1:1}},$o=function(t){var e=new No(t,null),n=new Mo(e),r=[];return Ho(e,n,n,r),Ko(e.container,r),n},Go=function(t,e){switch(e){case 0:return zo(t.topLeftBorderBox,t.topLeftPaddingBox,t.topRightBorderBox,t.topRightPaddingBox);case 1:return zo(t.topRightBorderBox,t.topRightPaddingBox,t.bottomRightBorderBox,t.bottomRightPaddingBox);case 2:return zo(t.bottomRightBorderBox,t.bottomRightPaddingBox,t.bottomLeftBorderBox,t.bottomLeftPaddingBox);default:return zo(t.bottomLeftBorderBox,t.bottomLeftPaddingBox,t.topLeftBorderBox,t.topLeftPaddingBox)}},Vo=function(t,e){switch(e){case 0:return zo(t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox,t.topRightBorderBox,t.topRightBorderDoubleOuterBox);case 1:return zo(t.topRightBorderBox,t.topRightBorderDoubleOuterBox,t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox);case 2:return zo(t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox,t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox);default:return zo(t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox,t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox)}},jo=function(t,e){switch(e){case 0:return zo(t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox,t.topRightBorderDoubleInnerBox,t.topRightPaddingBox);case 1:return zo(t.topRightBorderDoubleInnerBox,t.topRightPaddingBox,t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox);case 2:return zo(t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox,t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox);default:return zo(t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox,t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox)}},Zo=function(t,e){switch(e){case 0:return Wo(t.topLeftBorderStroke,t.topRightBorderStroke);case 1:return Wo(t.topRightBorderStroke,t.bottomRightBorderStroke);case 2:return Wo(t.bottomRightBorderStroke,t.bottomLeftBorderStroke);default:return Wo(t.bottomLeftBorderStroke,t.topLeftBorderStroke)}},Wo=function(t,e){var n=[];return Co(t)?n.push(t.subdivide(.5,!1)):n.push(t),Co(e)?n.push(e.subdivide(.5,!0)):n.push(e),n},zo=function(t,e,n,r){var i=[];return Co(t)?i.push(t.subdivide(.5,!1)):i.push(t),Co(n)?i.push(n.subdivide(.5,!0)):i.push(n),Co(r)?i.push(r.subdivide(.5,!0).reverse()):i.push(r),Co(e)?i.push(e.subdivide(.5,!1).reverse()):i.push(e),i},Yo=function(t){var e=t.bounds,n=t.styles;return e.add(n.borderLeftWidth,n.borderTopWidth,-(n.borderRightWidth+n.borderLeftWidth),-(n.borderTopWidth+n.borderBottomWidth))},Xo=function(t){var e=t.styles,n=t.bounds,r=Zn(e.paddingLeft,n.width),i=Zn(e.paddingRight,n.width),s=Zn(e.paddingTop,n.width),A=Zn(e.paddingBottom,n.width);return n.add(r+e.borderLeftWidth,s+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+i),-(e.borderTopWidth+e.borderBottomWidth+s+A))},qo=function(t,e){return 0===t?e.bounds:2===t?Xo(e):Yo(e)},Jo=function(t,e){return 0===t?e.bounds:2===t?Xo(e):Yo(e)},tl=function(t,e,n){var r=qo(il(t.styles.backgroundOrigin,e),t),i=Jo(il(t.styles.backgroundClip,e),t),s=rl(il(t.styles.backgroundSize,e),n,r),A=s[0],a=s[1],o=jn(il(t.styles.backgroundPosition,e),r.width-A,r.height-a);return[sl(il(t.styles.backgroundRepeat,e),o,s,r,i),Math.round(r.left+o[0]),Math.round(r.top+o[1]),A,a]},el=function(t){return Un(t)&&t.value===Qr.AUTO},nl=function(t){return"number"==typeof t},rl=function(t,e,n){var r=e[0],i=e[1],s=e[2],A=t[0],a=t[1];if(!A)return[0,0];if(Hn(A)&&a&&Hn(a))return[Zn(A,n.width),Zn(a,n.height)];var o=nl(s);if(Un(A)&&(A.value===Qr.CONTAIN||A.value===Qr.COVER))return nl(s)?n.width/n.height<s!=(A.value===Qr.COVER)?[n.width,n.width/s]:[n.height*s,n.height]:[n.width,n.height];var l=nl(r),u=nl(i),c=l||u;if(el(A)&&(!a||el(a)))return l&&u?[r,i]:o||c?c&&o?[l?r:i*s,u?i:r/s]:[l?r:n.width,u?i:n.height]:[n.width,n.height];if(o){var h=0,d=0;return Hn(A)?h=Zn(A,n.width):Hn(a)&&(d=Zn(a,n.height)),el(A)?h=d*s:a&&!el(a)||(d=h/s),[h,d]}var f=null,p=null;if(Hn(A)?f=Zn(A,n.width):a&&Hn(a)&&(p=Zn(a,n.height)),null===f||a&&!el(a)||(p=l&&u?f/r*i:n.height),null!==p&&el(A)&&(f=l&&u?p/i*r:n.width),null!==f&&null!==p)return[f,p];throw new Error("Unable to calculate background-size for element")},il=function(t,e){var n=t[e];return void 0===n?t[0]:n},sl=function(t,e,n,r,i){var s=e[0],A=e[1],a=n[0],o=n[1];switch(t){case 2:return[new Bo(Math.round(r.left),Math.round(r.top+A)),new Bo(Math.round(r.left+r.width),Math.round(r.top+A)),new Bo(Math.round(r.left+r.width),Math.round(o+r.top+A)),new Bo(Math.round(r.left),Math.round(o+r.top+A))];case 3:return[new Bo(Math.round(r.left+s),Math.round(r.top)),new Bo(Math.round(r.left+s+a),Math.round(r.top)),new Bo(Math.round(r.left+s+a),Math.round(r.height+r.top)),new Bo(Math.round(r.left+s),Math.round(r.height+r.top))];case 1:return[new Bo(Math.round(r.left+s),Math.round(r.top+A)),new Bo(Math.round(r.left+s+a),Math.round(r.top+A)),new Bo(Math.round(r.left+s+a),Math.round(r.top+A+o)),new Bo(Math.round(r.left+s),Math.round(r.top+A+o))];default:return[new Bo(Math.round(i.left),Math.round(i.top)),new Bo(Math.round(i.left+i.width),Math.round(i.top)),new Bo(Math.round(i.left+i.width),Math.round(i.height+i.top)),new Bo(Math.round(i.left),Math.round(i.height+i.top))]}},Al="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",al="Hidden Text",ol=function(){function t(t){this._data={},this._document=t}return t.prototype.parseMetrics=function(t,e){var n=this._document.createElement("div"),r=this._document.createElement("img"),i=this._document.createElement("span"),s=this._document.body;n.style.visibility="hidden",n.style.fontFamily=t,n.style.fontSize=e,n.style.margin="0",n.style.padding="0",n.style.whiteSpace="nowrap",s.appendChild(n),r.src=Al,r.width=1,r.height=1,r.style.margin="0",r.style.padding="0",r.style.verticalAlign="baseline",i.style.fontFamily=t,i.style.fontSize=e,i.style.margin="0",i.style.padding="0",i.appendChild(this._document.createTextNode(al)),n.appendChild(i),n.appendChild(r);var A=r.offsetTop-i.offsetTop+2;n.removeChild(i),n.appendChild(this._document.createTextNode(al)),n.style.lineHeight="normal",r.style.verticalAlign="super";var a=r.offsetTop-n.offsetTop+2;return s.removeChild(n),{baseline:A,middle:a}},t.prototype.getMetrics=function(t,e){var n=t+" "+e;return void 0===this._data[n]&&(this._data[n]=this.parseMetrics(t,e)),this._data[n]},t}(),ll=function(){function t(t,e){this.context=t,this.options=e}return t}(),ul=1e4,cl=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r._activeEffects=[],r.canvas=n.canvas?n.canvas:document.createElement("canvas"),r.ctx=r.canvas.getContext("2d"),n.canvas||(r.canvas.width=Math.floor(n.width*n.scale),r.canvas.height=Math.floor(n.height*n.scale),r.canvas.style.width=n.width+"px",r.canvas.style.height=n.height+"px"),r.fontMetrics=new ol(document),r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-n.x,-n.y),r.ctx.textBaseline="bottom",r._activeEffects=[],r.context.logger.debug("Canvas renderer initialized ("+n.width+"x"+n.height+") with scale "+n.scale),r}return e(n,t),n.prototype.applyEffects=function(t){for(var e=this;this._activeEffects.length;)this.popEffect();t.forEach((function(t){return e.applyEffect(t)}))},n.prototype.applyEffect=function(t){this.ctx.save(),Qo(t)&&(this.ctx.globalAlpha=t.opacity),Lo(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),Ro(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},n.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},n.prototype.renderStack=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return t.element.container.styles.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},n.prototype.renderNode=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return is(t.container.flags,16),t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return e.sent(),[4,this.renderNodeContent(t)];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))},n.prototype.renderTextWithLetterSpacing=function(t,e,n){var r=this;0===e?this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+n):SA(t.text).reduce((function(e,i){return r.ctx.fillText(i,e,t.bounds.top+n),e+r.ctx.measureText(i).width}),t.bounds.left)},n.prototype.createFontStyle=function(t){var e=t.fontVariant.filter((function(t){return"normal"===t||"small-caps"===t})).join(""),n=gl(t.fontFamily).join(", "),r=In(t.fontSize)?""+t.fontSize.number+t.fontSize.unit:t.fontSize.number+"px";return[[t.fontStyle,e,t.fontWeight,r,n].join(" "),n,r]},n.prototype.renderTextNode=function(t,e){return r(this,void 0,void 0,(function(){var n,r,s,A,a,o,l,u,c=this;return i(this,(function(i){return n=this.createFontStyle(e),r=n[0],s=n[1],A=n[2],this.ctx.font=r,this.ctx.direction=1===e.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(s,A),o=a.baseline,l=a.middle,u=e.paintOrder,t.textBounds.forEach((function(t){u.forEach((function(n){switch(n){case 0:c.ctx.fillStyle=ir(e.color),c.renderTextWithLetterSpacing(t,e.letterSpacing,o);var r=e.textShadow;r.length&&t.text.trim().length&&(r.slice(0).reverse().forEach((function(n){c.ctx.shadowColor=ir(n.color),c.ctx.shadowOffsetX=n.offsetX.number*c.options.scale,c.ctx.shadowOffsetY=n.offsetY.number*c.options.scale,c.ctx.shadowBlur=n.blur.number,c.renderTextWithLetterSpacing(t,e.letterSpacing,o)})),c.ctx.shadowColor="",c.ctx.shadowOffsetX=0,c.ctx.shadowOffsetY=0,c.ctx.shadowBlur=0),e.textDecorationLine.length&&(c.ctx.fillStyle=ir(e.textDecorationColor||e.color),e.textDecorationLine.forEach((function(e){switch(e){case 1:c.ctx.fillRect(t.bounds.left,Math.round(t.bounds.top+o),t.bounds.width,1);break;case 2:c.ctx.fillRect(t.bounds.left,Math.round(t.bounds.top),t.bounds.width,1);break;case 3:c.ctx.fillRect(t.bounds.left,Math.ceil(t.bounds.top+l),t.bounds.width,1)}})));break;case 1:e.webkitTextStrokeWidth&&t.text.trim().length&&(c.ctx.strokeStyle=ir(e.webkitTextStrokeColor),c.ctx.lineWidth=e.webkitTextStrokeWidth,c.ctx.lineJoin=window.chrome?"miter":"round",c.ctx.strokeText(t.text,t.bounds.left,t.bounds.top+o)),c.ctx.strokeStyle="",c.ctx.lineWidth=0,c.ctx.lineJoin="miter"}}))})),[2]}))}))},n.prototype.renderReplacedElement=function(t,e,n){if(n&&t.intrinsicWidth>0&&t.intrinsicHeight>0){var r=Xo(t),i=xo(e);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,t.intrinsicWidth,t.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},n.prototype.renderNodeContent=function(t){return r(this,void 0,void 0,(function(){var e,r,s,a,o,l,u,c,h,d,f,p,g,m,_,w,y,v;return i(this,(function(i){switch(i.label){case 0:this.applyEffects(t.getEffects(4)),e=t.container,r=t.curves,s=e.styles,a=0,o=e.textNodes,i.label=1;case 1:return a<o.length?(l=o[a],[4,this.renderTextNode(l,s)]):[3,4];case 2:i.sent(),i.label=3;case 3:return a++,[3,1];case 4:if(!(e instanceof PA))return[3,8];i.label=5;case 5:return i.trys.push([5,7,,8]),[4,this.context.cache.match(e.src)];case 6:return _=i.sent(),this.renderReplacedElement(e,r,_),[3,8];case 7:return i.sent(),this.context.logger.error("Error loading image "+e.src),[3,8];case 8:if(e instanceof MA&&this.renderReplacedElement(e,r,e.canvas),!(e instanceof NA))return[3,12];i.label=9;case 9:return i.trys.push([9,11,,12]),[4,this.context.cache.match(e.svg)];case 10:return _=i.sent(),this.renderReplacedElement(e,r,_),[3,12];case 11:return i.sent(),this.context.logger.error("Error loading svg "+e.svg.substring(0,255)),[3,12];case 12:return e instanceof ta&&e.tree?[4,new n(this.context,{scale:this.options.scale,backgroundColor:e.backgroundColor,x:0,y:0,width:e.width,height:e.height}).render(e.tree)]:[3,14];case 13:u=i.sent(),e.width&&e.height&&this.ctx.drawImage(u,0,0,e.width,e.height,e.bounds.left,e.bounds.top,e.bounds.width,e.bounds.height),i.label=14;case 14:if(e instanceof XA&&(c=Math.min(e.bounds.width,e.bounds.height),e.type===ZA?e.checked&&(this.ctx.save(),this.path([new Bo(e.bounds.left+.39363*c,e.bounds.top+.79*c),new Bo(e.bounds.left+.16*c,e.bounds.top+.5549*c),new Bo(e.bounds.left+.27347*c,e.bounds.top+.44071*c),new Bo(e.bounds.left+.39694*c,e.bounds.top+.5649*c),new Bo(e.bounds.left+.72983*c,e.bounds.top+.23*c),new Bo(e.bounds.left+.84*c,e.bounds.top+.34085*c),new Bo(e.bounds.left+.39363*c,e.bounds.top+.79*c)]),this.ctx.fillStyle=ir(YA),this.ctx.fill(),this.ctx.restore()):e.type===WA&&e.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(e.bounds.left+c/2,e.bounds.top+c/2,c/4,0,2*Math.PI,!0),this.ctx.fillStyle=ir(YA),this.ctx.fill(),this.ctx.restore())),hl(e)&&e.value.length){switch(h=this.createFontStyle(s),y=h[0],d=h[1],f=this.fontMetrics.getMetrics(y,d).baseline,this.ctx.font=y,this.ctx.fillStyle=ir(s.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=fl(e.styles.textAlign),v=Xo(e),p=0,e.styles.textAlign){case 1:p+=v.width/2;break;case 2:p+=v.width}g=v.add(p,0,0,-v.height/2+1),this.ctx.save(),this.path([new Bo(v.left,v.top),new Bo(v.left+v.width,v.top),new Bo(v.left+v.width,v.top+v.height),new Bo(v.left,v.top+v.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new CA(e.value,g),s.letterSpacing,f),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!is(e.styles.display,2048))return[3,20];if(null===e.styles.listStyleImage)return[3,19];if(0!==(m=e.styles.listStyleImage).type)return[3,18];_=void 0,w=m.url,i.label=15;case 15:return i.trys.push([15,17,,18]),[4,this.context.cache.match(w)];case 16:return _=i.sent(),this.ctx.drawImage(_,e.bounds.left-(_.width+10),e.bounds.top),[3,18];case 17:return i.sent(),this.context.logger.error("Error loading list-style-image "+w),[3,18];case 18:return[3,20];case 19:t.listValue&&-1!==e.styles.listStyleType&&(y=this.createFontStyle(s)[0],this.ctx.font=y,this.ctx.fillStyle=ir(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",v=new A(e.bounds.left,e.bounds.top+Zn(e.styles.paddingTop,e.bounds.width),e.bounds.width,vi(s.lineHeight,s.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new CA(t.listValue,v),s.letterSpacing,vi(s.lineHeight,s.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),i.label=20;case 20:return[2]}}))}))},n.prototype.renderStackContent=function(t){return r(this,void 0,void 0,(function(){var e,n,r,s,A,a,o,l,u,c,h,d,f,p,g;return i(this,(function(i){switch(i.label){case 0:return is(t.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:i.sent(),e=0,n=t.negativeZIndex,i.label=2;case 2:return e<n.length?(g=n[e],[4,this.renderStack(g)]):[3,5];case 3:i.sent(),i.label=4;case 4:return e++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:i.sent(),r=0,s=t.nonInlineLevel,i.label=7;case 7:return r<s.length?(g=s[r],[4,this.renderNode(g)]):[3,10];case 8:i.sent(),i.label=9;case 9:return r++,[3,7];case 10:A=0,a=t.nonPositionedFloats,i.label=11;case 11:return A<a.length?(g=a[A],[4,this.renderStack(g)]):[3,14];case 12:i.sent(),i.label=13;case 13:return A++,[3,11];case 14:o=0,l=t.nonPositionedInlineLevel,i.label=15;case 15:return o<l.length?(g=l[o],[4,this.renderStack(g)]):[3,18];case 16:i.sent(),i.label=17;case 17:return o++,[3,15];case 18:u=0,c=t.inlineLevel,i.label=19;case 19:return u<c.length?(g=c[u],[4,this.renderNode(g)]):[3,22];case 20:i.sent(),i.label=21;case 21:return u++,[3,19];case 22:h=0,d=t.zeroOrAutoZIndexOrTransformedOrOpacity,i.label=23;case 23:return h<d.length?(g=d[h],[4,this.renderStack(g)]):[3,26];case 24:i.sent(),i.label=25;case 25:return h++,[3,23];case 26:f=0,p=t.positiveZIndex,i.label=27;case 27:return f<p.length?(g=p[f],[4,this.renderStack(g)]):[3,30];case 28:i.sent(),i.label=29;case 29:return f++,[3,27];case 30:return[2]}}))}))},n.prototype.mask=function(t){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(t.slice(0).reverse()),this.ctx.closePath()},n.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},n.prototype.formatPath=function(t){var e=this;t.forEach((function(t,n){var r=Co(t)?t.start:t;0===n?e.ctx.moveTo(r.x,r.y):e.ctx.lineTo(r.x,r.y),Co(t)&&e.ctx.bezierCurveTo(t.startControl.x,t.startControl.y,t.endControl.x,t.endControl.y,t.end.x,t.end.y)}))},n.prototype.renderRepeat=function(t,e,n,r){this.path(t),this.ctx.fillStyle=e,this.ctx.translate(n,r),this.ctx.fill(),this.ctx.translate(-n,-r)},n.prototype.resizeImage=function(t,e,n){var r;if(t.width===e&&t.height===n)return t;var i=(null!==(r=this.canvas.ownerDocument)&&void 0!==r?r:document).createElement("canvas");return i.width=Math.max(1,e),i.height=Math.max(1,n),i.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,e,n),i},n.prototype.renderBackgroundImage=function(t){return r(this,void 0,void 0,(function(){var e,n,r,s,A,a;return i(this,(function(o){switch(o.label){case 0:e=t.styles.backgroundImage.length-1,n=function(n){var s,A,a,o,l,u,c,h,d,f,p,g,m,_,w,y,v,B,b,E,C,k,F,T,S,x,I,D,U,L,R;return i(this,(function(i){switch(i.label){case 0:if(0!==n.type)return[3,5];s=void 0,A=n.url,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r.context.cache.match(A)];case 2:return s=i.sent(),[3,4];case 3:return i.sent(),r.context.logger.error("Error loading background-image "+A),[3,4];case 4:return s&&(a=tl(t,e,[s.width,s.height,s.width/s.height]),y=a[0],k=a[1],F=a[2],b=a[3],E=a[4],_=r.ctx.createPattern(r.resizeImage(s,b,E),"repeat"),r.renderRepeat(y,_,k,F)),[3,6];case 5:Dr(n)?(o=tl(t,e,[null,null,null]),y=o[0],k=o[1],F=o[2],b=o[3],E=o[4],l=_r(n.angle,b,E),u=l[0],c=l[1],h=l[2],d=l[3],f=l[4],(p=document.createElement("canvas")).width=b,p.height=E,g=p.getContext("2d"),m=g.createLinearGradient(c,d,h,f),gr(n.stops,u).forEach((function(t){return m.addColorStop(t.stop,ir(t.color))})),g.fillStyle=m,g.fillRect(0,0,b,E),b>0&&E>0&&(_=r.ctx.createPattern(p,"repeat"),r.renderRepeat(y,_,k,F))):Ur(n)&&(w=tl(t,e,[null,null,null]),y=w[0],v=w[1],B=w[2],b=w[3],E=w[4],C=0===n.position.length?[Gn]:n.position,k=Zn(C[0],b),F=Zn(C[C.length-1],E),T=vr(n,k,F,b,E),S=T[0],x=T[1],S>0&&x>0&&(I=r.ctx.createRadialGradient(v+k,B+F,0,v+k,B+F,S),gr(n.stops,2*S).forEach((function(t){return I.addColorStop(t.stop,ir(t.color))})),r.path(y),r.ctx.fillStyle=I,S!==x?(D=t.bounds.left+.5*t.bounds.width,U=t.bounds.top+.5*t.bounds.height,R=1/(L=x/S),r.ctx.save(),r.ctx.translate(D,U),r.ctx.transform(1,0,0,L,0,0),r.ctx.translate(-D,-U),r.ctx.fillRect(v,R*(B-U)+U,b,E*R),r.ctx.restore()):r.ctx.fill())),i.label=6;case 6:return e--,[2]}}))},r=this,s=0,A=t.styles.backgroundImage.slice(0).reverse(),o.label=1;case 1:return s<A.length?(a=A[s],[5,n(a)]):[3,4];case 2:o.sent(),o.label=3;case 3:return s++,[3,1];case 4:return[2]}}))}))},n.prototype.renderSolidBorder=function(t,e,n){return r(this,void 0,void 0,(function(){return i(this,(function(r){return this.path(Go(n,e)),this.ctx.fillStyle=ir(t),this.ctx.fill(),[2]}))}))},n.prototype.renderDoubleBorder=function(t,e,n,s){return r(this,void 0,void 0,(function(){var r,A;return i(this,(function(i){switch(i.label){case 0:return e<3?[4,this.renderSolidBorder(t,n,s)]:[3,2];case 1:return i.sent(),[2];case 2:return r=Vo(s,n),this.path(r),this.ctx.fillStyle=ir(t),this.ctx.fill(),A=jo(s,n),this.path(A),this.ctx.fill(),[2]}}))}))},n.prototype.renderNodeBackgroundAndBorders=function(t){return r(this,void 0,void 0,(function(){var e,n,r,s,A,a,o,l,u=this;return i(this,(function(i){switch(i.label){case 0:return this.applyEffects(t.getEffects(2)),e=t.container.styles,n=!rr(e.backgroundColor)||e.backgroundImage.length,r=[{style:e.borderTopStyle,color:e.borderTopColor,width:e.borderTopWidth},{style:e.borderRightStyle,color:e.borderRightColor,width:e.borderRightWidth},{style:e.borderBottomStyle,color:e.borderBottomColor,width:e.borderBottomWidth},{style:e.borderLeftStyle,color:e.borderLeftColor,width:e.borderLeftWidth}],s=dl(il(e.backgroundClip,0),t.curves),n||e.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),rr(e.backgroundColor)||(this.ctx.fillStyle=ir(e.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:i.sent(),this.ctx.restore(),e.boxShadow.slice(0).reverse().forEach((function(e){u.ctx.save();var n=To(t.curves),r=e.inset?0:ul,i=Po(n,-r+(e.inset?1:-1)*e.spread.number,(e.inset?1:-1)*e.spread.number,e.spread.number*(e.inset?-2:2),e.spread.number*(e.inset?-2:2));e.inset?(u.path(n),u.ctx.clip(),u.mask(i)):(u.mask(n),u.ctx.clip(),u.path(i)),u.ctx.shadowOffsetX=e.offsetX.number+r,u.ctx.shadowOffsetY=e.offsetY.number,u.ctx.shadowColor=ir(e.color),u.ctx.shadowBlur=e.blur.number,u.ctx.fillStyle=e.inset?ir(e.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()})),i.label=2;case 2:A=0,a=0,o=r,i.label=3;case 3:return a<o.length?0!==(l=o[a]).style&&!rr(l.color)&&l.width>0?2!==l.style?[3,5]:[4,this.renderDashedDottedBorder(l.color,l.width,A,t.curves,2)]:[3,11]:[3,13];case 4:return i.sent(),[3,11];case 5:return 3!==l.style?[3,7]:[4,this.renderDashedDottedBorder(l.color,l.width,A,t.curves,3)];case 6:return i.sent(),[3,11];case 7:return 4!==l.style?[3,9]:[4,this.renderDoubleBorder(l.color,l.width,A,t.curves)];case 8:return i.sent(),[3,11];case 9:return[4,this.renderSolidBorder(l.color,A,t.curves)];case 10:i.sent(),i.label=11;case 11:A++,i.label=12;case 12:return a++,[3,3];case 13:return[2]}}))}))},n.prototype.renderDashedDottedBorder=function(t,e,n,s,A){return r(this,void 0,void 0,(function(){var r,a,o,l,u,c,h,d,f,p,g,m,_,w,y,v;return i(this,(function(i){return this.ctx.save(),r=Zo(s,n),a=Go(s,n),2===A&&(this.path(a),this.ctx.clip()),Co(a[0])?(o=a[0].start.x,l=a[0].start.y):(o=a[0].x,l=a[0].y),Co(a[1])?(u=a[1].end.x,c=a[1].end.y):(u=a[1].x,c=a[1].y),h=0===n||2===n?Math.abs(o-u):Math.abs(l-c),this.ctx.beginPath(),3===A?this.formatPath(r):this.formatPath(a.slice(0,2)),d=e<3?3*e:2*e,f=e<3?2*e:e,3===A&&(d=e,f=e),p=!0,h<=2*d?p=!1:h<=2*d+f?(d*=g=h/(2*d+f),f*=g):(m=Math.floor((h+f)/(d+f)),_=(h-m*d)/(m-1),f=(w=(h-(m+1)*d)/m)<=0||Math.abs(f-_)<Math.abs(f-w)?_:w),p&&(3===A?this.ctx.setLineDash([0,d+f]):this.ctx.setLineDash([d,f])),3===A?(this.ctx.lineCap="round",this.ctx.lineWidth=e):this.ctx.lineWidth=2*e+1.1,this.ctx.strokeStyle=ir(t),this.ctx.stroke(),this.ctx.setLineDash([]),2===A&&(Co(a[0])&&(y=a[3],v=a[0],this.ctx.beginPath(),this.formatPath([new Bo(y.end.x,y.end.y),new Bo(v.start.x,v.start.y)]),this.ctx.stroke()),Co(a[1])&&(y=a[1],v=a[2],this.ctx.beginPath(),this.formatPath([new Bo(y.end.x,y.end.y),new Bo(v.start.x,v.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]}))}))},n.prototype.render=function(t){return r(this,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=ir(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),e=$o(t),[4,this.renderStack(e)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}}))}))},n}(ll),hl=function(t){return t instanceof JA||t instanceof qA||t instanceof XA&&t.type!==WA&&t.type!==ZA},dl=function(t,e){switch(t){case 0:return To(e);case 2:return So(e);default:return xo(e)}},fl=function(t){switch(t){case 1:return"center";case 2:return"right";default:return"left"}},pl=["-apple-system","system-ui"],gl=function(t){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?t.filter((function(t){return-1===pl.indexOf(t)})):t},ml=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.canvas=n.canvas?n.canvas:document.createElement("canvas"),r.ctx=r.canvas.getContext("2d"),r.options=n,r.canvas.width=Math.floor(n.width*n.scale),r.canvas.height=Math.floor(n.height*n.scale),r.canvas.style.width=n.width+"px",r.canvas.style.height=n.height+"px",r.ctx.scale(r.options.scale,r.options.scale),r.ctx.translate(-n.x,-n.y),r.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+n.width+"x"+n.height+" at "+n.x+","+n.y+") with scale "+n.scale),r}return e(n,t),n.prototype.render=function(t){return r(this,void 0,void 0,(function(){var e,n;return i(this,(function(r){switch(r.label){case 0:return e=BA(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,_l(e)];case 1:return n=r.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=ir(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}}))}))},n}(ll),_l=function(t){return new Promise((function(e,n){var r=new Image;r.onload=function(){e(r)},r.onerror=n,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(t))}))},wl=function(){function t(t){var e=t.id,n=t.enabled;this.id=e,this.enabled=n,this.start=Date.now()}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,s([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},t.prototype.getTime=function(){return Date.now()-this.start},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,s([this.id,this.getTime()+"ms"],t))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,s([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,s([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},t.instances={},t}(),yl=function(){function t(e,n){var r;this.windowBounds=n,this.instanceName="#"+t.instanceCount++,this.logger=new wl({id:this.instanceName,enabled:e.logging}),this.cache=null!==(r=e.cache)&&void 0!==r?r:new ho(this,e)}return t.instanceCount=1,t}(),vl=function(t,e){return void 0===e&&(e={}),Bl(t,e)};"undefined"!=typeof window&&co.setContext(window);var Bl=function(t,e){return r(void 0,void 0,void 0,(function(){var r,s,l,u,c,h,d,f,p,g,m,_,w,y,v,B,b,E,C,k,F,T,S,x,I,D,U,L,R,Q,O,P,M,N,H,K,$,G;return i(this,(function(i){switch(i.label){case 0:if(!t||"object"!=typeof t)return[2,Promise.reject("Invalid element provided as first argument")];if(!(r=t.ownerDocument))throw new Error("Element is not attached to a Document");if(!(s=r.defaultView))throw new Error("Document is not attached to a Window");return l={allowTaint:null!==(T=e.allowTaint)&&void 0!==T&&T,imageTimeout:null!==(S=e.imageTimeout)&&void 0!==S?S:15e3,proxy:e.proxy,useCORS:null!==(x=e.useCORS)&&void 0!==x&&x},u=n({logging:null===(I=e.logging)||void 0===I||I,cache:e.cache},l),c={windowWidth:null!==(D=e.windowWidth)&&void 0!==D?D:s.innerWidth,windowHeight:null!==(U=e.windowHeight)&&void 0!==U?U:s.innerHeight,scrollX:null!==(L=e.scrollX)&&void 0!==L?L:s.pageXOffset,scrollY:null!==(R=e.scrollY)&&void 0!==R?R:s.pageYOffset},h=new A(c.scrollX,c.scrollY,c.windowWidth,c.windowHeight),d=new yl(u,h),f=null!==(Q=e.foreignObjectRendering)&&void 0!==Q&&Q,p={allowTaint:null!==(O=e.allowTaint)&&void 0!==O&&O,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:f,copyStyles:f},d.logger.debug("Starting document clone with size "+h.width+"x"+h.height+" scrolled to "+-h.left+","+-h.top),g=new Za(d,t,p),(m=g.clonedReferenceElement)?[4,g.toIFrame(r,h)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return _=i.sent(),w=ga(m)||fa(m)?o(m.ownerDocument):a(d,m),y=w.width,v=w.height,B=w.left,b=w.top,E=bl(d,m,e.backgroundColor),C={canvas:e.canvas,backgroundColor:E,scale:null!==(M=null!==(P=e.scale)&&void 0!==P?P:s.devicePixelRatio)&&void 0!==M?M:1,x:(null!==(N=e.x)&&void 0!==N?N:0)+B,y:(null!==(H=e.y)&&void 0!==H?H:0)+b,width:null!==(K=e.width)&&void 0!==K?K:Math.ceil(y),height:null!==($=e.height)&&void 0!==$?$:Math.ceil(v)},f?(d.logger.debug("Document cloned, using foreign object rendering"),[4,new ml(d,C).render(m)]):[3,3];case 2:return k=i.sent(),[3,5];case 3:return d.logger.debug("Document cloned, element located at "+B+","+b+" with size "+y+"x"+v+" using computed rendering"),d.logger.debug("Starting DOM parsing"),F=ia(d,m),E===F.styles.backgroundColor&&(F.styles.backgroundColor=hr.TRANSPARENT),d.logger.debug("Starting renderer for element at "+C.x+","+C.y+" with size "+C.width+"x"+C.height),[4,new cl(d,C).render(F)];case 4:k=i.sent(),i.label=5;case 5:return(null===(G=e.removeContainer)||void 0===G||G)&&(Za.destroy(_)||d.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),d.logger.debug("Finished rendering"),[2,k]}}))}))},bl=function(t,e,n){var r=e.ownerDocument,i=r.documentElement?cr(t,getComputedStyle(r.documentElement).backgroundColor):hr.TRANSPARENT,s=r.body?cr(t,getComputedStyle(r.body).backgroundColor):hr.TRANSPARENT,A="string"==typeof n?cr(t,n):null===n?hr.TRANSPARENT:4294967295;return e===r.documentElement?rr(i)?rr(s)?A:s:i:A};return vl}()},67467:function(t,e){e.read=function(t,e,n,r,i){var s,A,a=8*i-r-1,o=(1<<a)-1,l=o>>1,u=-7,c=n?i-1:0,h=n?-1:1,d=t[e+c];for(c+=h,s=d&(1<<-u)-1,d>>=-u,u+=a;u>0;s=256*s+t[e+c],c+=h,u-=8);for(A=s&(1<<-u)-1,s>>=-u,u+=r;u>0;A=256*A+t[e+c],c+=h,u-=8);if(0===s)s=1-l;else{if(s===o)return A?NaN:1/0*(d?-1:1);A+=Math.pow(2,r),s-=l}return(d?-1:1)*A*Math.pow(2,s-r)},e.write=function(t,e,n,r,i,s){var A,a,o,l=8*s-i-1,u=(1<<l)-1,c=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:s-1,f=r?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,A=u):(A=Math.floor(Math.log(e)/Math.LN2),e*(o=Math.pow(2,-A))<1&&(A--,o*=2),(e+=A+c>=1?h/o:h*Math.pow(2,1-c))*o>=2&&(A++,o/=2),A+c>=u?(a=0,A=u):A+c>=1?(a=(e*o-1)*Math.pow(2,i),A+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),A=0));i>=8;t[n+d]=255&a,d+=f,a/=256,i-=8);for(A=A<<i|a,l+=i;l>0;t[n+d]=255&A,d+=f,A/=256,l-=8);t[n+d-f]|=128*p}},53184:function(t,e,n){"use strict";var r,i;r=[n(58553),n(87804),n(40998)],void 0===(i=function(t,e,n){return function(t,e,n){var r=function(e,n){return t.js_beautify(e,n)};return r.js=t.js_beautify,r.css=e.css_beautify,r.html=n.html_beautify,r.js_beautify=t.js_beautify,r.css_beautify=e.css_beautify,r.html_beautify=n.html_beautify,r}(t,e,n)}.apply(e,r))||(t.exports=i)},87804:function(t,e){var n;!function(){var r;!function(){"use strict";var t=[,,function(t){function e(t){this.__parent=t,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=[]}function n(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function r(t,r){this.__indent_cache=new n(t,r),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}e.prototype.clone_empty=function(){var t=new e(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},e.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},e.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},e.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.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)},e.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},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return 0===this.__items.length},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},e.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},n.prototype.get_indent_size=function(t,e){var n=this.__base_string_length;return e=e||0,t<0&&(n=0),n+=t*this.__indent_size,n+=e},n.prototype.get_indent_string=function(t,e){var n=this.__base_string;return e=e||0,t<0&&(t=0,n=""),e+=t*this.__indent_size,this.__ensure_cache(e),n+=this.__cache[e]},n.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)},r.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},r.prototype.get_line_number=function(){return this.__lines.length},r.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},r.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},r.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},r.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},r.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==t&&(n=n.replace(/[\n]/g,t)),n},r.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},r.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},r.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},r.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},r.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(" "))},r.prototype.remove_indent=function(t){for(var e=this.__lines.length;t<e;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},r.prototype.trim=function(t){for(t=void 0!==t&&t,this.current_line.trim();t&&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},r.prototype.just_added_newline=function(){return this.current_line.is_empty()},r.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},r.prototype.ensure_empty_line_above=function(t,n){for(var r=this.__lines.length-2;r>=0;){var i=this.__lines[r];if(i.is_empty())break;if(0!==i.item(0).indexOf(t)&&i.item(-1)!==n){this.__lines.splice(r+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},t.exports.Output=r},,,,function(t){function e(t,e){this.raw_options=n(t,e),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","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(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"])}function n(t,e){var n,i={};for(n in t=r(t))n!==e&&(i[n]=t[n]);if(e&&t[e])for(n in t[e])i[n]=t[e][n];return i}function r(t){var e,n={};for(e in t){n[e.replace(/-/g,"_")]=t[e]}return n}e.prototype._get_array=function(t,e){var n=this.raw_options[t],r=e||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(r=n.concat()):"string"==typeof n&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r},e.prototype._get_boolean=function(t,e){var n=this.raw_options[t];return void 0===n?!!e:!!n},e.prototype._get_characters=function(t,e){var n=this.raw_options[t],r=e||"";return"string"==typeof n&&(r=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),r},e.prototype._get_number=function(t,e){var n=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var r=parseInt(n,10);return isNaN(r)&&(r=e),r},e.prototype._get_selection=function(t,e,n){var r=this._get_selection_list(t,e,n);if(1!==r.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return r[0]},e.prototype._get_selection_list=function(t,e,n){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(n=n||[e[0]],!this._is_valid_selection(n,e))throw new Error("Invalid Default Value!");var r=this._get_array(t,n);if(!this._is_valid_selection(r,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return r},e.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},t.exports.Options=e,t.exports.normalizeOpts=r,t.exports.mergeOpts=n},,function(t){var e=RegExp.prototype.hasOwnProperty("sticky");function n(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position<this.__input_length},n.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},n.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},n.prototype.__match=function(t,n){t.lastIndex=n;var r=t.exec(this.__input);return!r||e&&t.sticky||r.index!==n&&(r=null),r},n.prototype.test=function(t,e){return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&!!this.__match(t,e)},n.prototype.testChar=function(t,e){var n=this.peek(e);return t.lastIndex=0,null!==n&&t.test(n)},n.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},n.prototype.read=function(t,e,n){var r,i="";return t&&(r=this.match(t))&&(i+=r[0]),!e||!r&&t||(i+=this.readUntil(e,n)),i},n.prototype.readUntil=function(t,e){var n,r=this.__position;t.lastIndex=this.__position;var i=t.exec(this.__input);return i?(r=i.index,e&&(r+=i[0].length)):r=this.__input_length,n=this.__input.substring(this.__position,r),this.__position=r,n},n.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},n.prototype.get_regexp=function(t,n){var r=null,i="g";return n&&e&&(i="y"),"string"==typeof t&&""!==t?r=new RegExp(t,i):t&&(r=new RegExp(t.source,i)),r},n.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},n.prototype.peekUntilAfter=function(t){var e=this.__position,n=this.readUntilAfter(t);return this.__position=e,n},n.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=n},,,,,function(t){function e(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}e.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(t);n;)e[n[1]]=n[2],n=this.__directive_pattern.exec(t);return e},e.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},t.exports.Directives=e},,function(t,e,n){var r=n(16).Beautifier,i=n(17).Options;t.exports=function(t,e){return new r(t,e).beautify()},t.exports.defaultOptions=function(){return new i}},function(t,e,n){var r=n(17).Options,i=n(2).Output,s=n(8).InputScanner,A=new(0,n(13).Directives)(/\/\*/,/\*\//),a=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,l=/\s/,u=/(?:\s|\n)+/g,c=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,h=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function d(t,e){this._source_text=t||"",this._options=new r(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"]}d.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},d.prototype.eatWhitespace=function(t){for(var e=l.test(this._input.peek()),n=0;l.test(this._input.peek());)this._ch=this._input.next(),t&&"\n"===this._ch&&(0===n||n<this._options.max_preserve_newlines)&&(n++,this._output.add_new_line(!0));return e},d.prototype.foundNestedPseudoClass=function(){for(var t=0,e=1,n=this._input.peek(e);n;){if("{"===n)return!0;if("("===n)t+=1;else if(")"===n){if(0===t)return!1;t-=1}else if(";"===n||"}"===n)return!1;e++,n=this._input.peek(e)}return!1},d.prototype.print_string=function(t){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(t)},d.prototype.preserveSingleSpace=function(t){t&&(this._output.space_before_token=!0)},d.prototype.indent=function(){this._indentLevel++},d.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},d.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===e&&(e="\n",t&&a.test(t||"")&&(e=t.match(a)[0]));var n=(t=t.replace(o,"\n")).match(/^[\t ]*/)[0];this._output=new i(this._options,n),this._input=new s(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var r,d,f=0,p=!1,g=!1,m=!1,_=!1,w=!1,y=this._ch,v=!1;r=""!==this._input.read(u),d=y,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),y=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var B=this._input.read(c),b=A.get_directives(B);b&&"start"===b.ignore&&(B+=A.readIgnored(this._input)),this.print_string(B),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(h)),this.eatWhitespace(!0);else if("$"===this._ch){this.preserveSingleSpace(r),this.print_string(this._ch);var E=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);E.match(/[ :]$/)&&(E=this.eatString(": ").replace(/\s+$/,""),this.print_string(E),this._output.space_before_token=!0),0===f&&-1!==E.indexOf(":")&&(g=!0,this.indent())}else if("@"===this._ch)if(this.preserveSingleSpace(r),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var C=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);C.match(/[ :]$/)&&(C=this.eatString(": ").replace(/\s+$/,""),this.print_string(C),this._output.space_before_token=!0),0===f&&-1!==C.indexOf(":")?(g=!0,this.indent()):C in this.NESTED_AT_RULE?(this._nestedLevel+=1,C in this.CONDITIONAL_GROUP_RULE&&(m=!0)):0!==f||g||(_=!0)}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(r),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)g&&(g=!1,this.outdent()),_=!1,m?(m=!1,p=this._indentLevel>=this._nestedLevel):p=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&p&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===d?this._output.space_before_token=!1:","!==d&&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(),"{"===d&&this._output.trim(!0),g&&(this.outdent(),g=!1),this.print_string(this._ch),p=!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),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var k=0;k<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;k++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[k])){v=!0;break}!p&&!m||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||_||0!==f?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),g||(g=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent()))}else if('"'===this._ch||"'"===this._ch){var F='"'===d||"'"===d;this.preserveSingleSpace(F||r),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(";"===this._ch)v=!1,0===f?(g&&(this.outdent(),g=!1),_=!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(),f++,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(")")),f&&(f--,this.outdent()));else{var T=!1;this._input.lookBack("with")&&(T=!0),this.preserveSingleSpace(r||T),this.print_string(this._ch),g&&"$"===d&&this._options.selector_separator_newline?(this._output.add_new_line(),w=!0):(this.eatWhitespace(),f++,this.indent())}else if(")"===this._ch)f&&(f--,this.outdent()),w&&";"===this._input.peek()&&this._options.selector_separator_newline&&(w=!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||g&&!w||0!==f||_?this._output.space_before_token=!0:this._output.add_new_line();else if(">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||g||0!==f)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(r),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),l.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var S='"'===d||"'"===d;this.preserveSingleSpace(S||r),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&v&&this._output.add_new_line()}else this._output.space_before_token=!0,this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&l.test(this._ch)&&(this._ch=""));return this._output.get_code(e)},t.exports.Beautifier=d},function(t,e,n){var r=n(6).Options;function i(t){r.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i<n.length;i++)"expand"!==n[i]?this.brace_style="collapse":this.brace_style=n[i]}i.prototype=new r,t.exports.Options=i}],e={};var n=function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,n),s.exports}(15);r=n}();var i=r;void 0===(n=function(){return{css_beautify:i}}.apply(e,[]))||(t.exports=n)}()},40998:function(t,e,n){var r,i;!function(){var s;!function(){"use strict";var t=[,,function(t){function e(t){this.__parent=t,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=[]}function n(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function r(t,r){this.__indent_cache=new n(t,r),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}e.prototype.clone_empty=function(){var t=new e(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},e.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},e.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},e.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.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)},e.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},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return 0===this.__items.length},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},e.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},n.prototype.get_indent_size=function(t,e){var n=this.__base_string_length;return e=e||0,t<0&&(n=0),n+=t*this.__indent_size,n+=e},n.prototype.get_indent_string=function(t,e){var n=this.__base_string;return e=e||0,t<0&&(t=0,n=""),e+=t*this.__indent_size,this.__ensure_cache(e),n+=this.__cache[e]},n.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)},r.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},r.prototype.get_line_number=function(){return this.__lines.length},r.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},r.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},r.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},r.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},r.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==t&&(n=n.replace(/[\n]/g,t)),n},r.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},r.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},r.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},r.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},r.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(" "))},r.prototype.remove_indent=function(t){for(var e=this.__lines.length;t<e;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},r.prototype.trim=function(t){for(t=void 0!==t&&t,this.current_line.trim();t&&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},r.prototype.just_added_newline=function(){return this.current_line.is_empty()},r.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},r.prototype.ensure_empty_line_above=function(t,n){for(var r=this.__lines.length-2;r>=0;){var i=this.__lines[r];if(i.is_empty())break;if(0!==i.item(0).indexOf(t)&&i.item(-1)!==n){this.__lines.splice(r+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},t.exports.Output=r},function(t){t.exports.Token=function(t,e,n,r){this.type=t,this.text=e,this.comments_before=null,this.newlines=n||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}},,,function(t){function e(t,e){this.raw_options=n(t,e),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","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(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"])}function n(t,e){var n,i={};for(n in t=r(t))n!==e&&(i[n]=t[n]);if(e&&t[e])for(n in t[e])i[n]=t[e][n];return i}function r(t){var e,n={};for(e in t){n[e.replace(/-/g,"_")]=t[e]}return n}e.prototype._get_array=function(t,e){var n=this.raw_options[t],r=e||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(r=n.concat()):"string"==typeof n&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r},e.prototype._get_boolean=function(t,e){var n=this.raw_options[t];return void 0===n?!!e:!!n},e.prototype._get_characters=function(t,e){var n=this.raw_options[t],r=e||"";return"string"==typeof n&&(r=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),r},e.prototype._get_number=function(t,e){var n=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var r=parseInt(n,10);return isNaN(r)&&(r=e),r},e.prototype._get_selection=function(t,e,n){var r=this._get_selection_list(t,e,n);if(1!==r.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return r[0]},e.prototype._get_selection_list=function(t,e,n){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(n=n||[e[0]],!this._is_valid_selection(n,e))throw new Error("Invalid Default Value!");var r=this._get_array(t,n);if(!this._is_valid_selection(r,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return r},e.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},t.exports.Options=e,t.exports.normalizeOpts=r,t.exports.mergeOpts=n},,function(t){var e=RegExp.prototype.hasOwnProperty("sticky");function n(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position<this.__input_length},n.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},n.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},n.prototype.__match=function(t,n){t.lastIndex=n;var r=t.exec(this.__input);return!r||e&&t.sticky||r.index!==n&&(r=null),r},n.prototype.test=function(t,e){return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&!!this.__match(t,e)},n.prototype.testChar=function(t,e){var n=this.peek(e);return t.lastIndex=0,null!==n&&t.test(n)},n.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},n.prototype.read=function(t,e,n){var r,i="";return t&&(r=this.match(t))&&(i+=r[0]),!e||!r&&t||(i+=this.readUntil(e,n)),i},n.prototype.readUntil=function(t,e){var n,r=this.__position;t.lastIndex=this.__position;var i=t.exec(this.__input);return i?(r=i.index,e&&(r+=i[0].length)):r=this.__input_length,n=this.__input.substring(this.__position,r),this.__position=r,n},n.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},n.prototype.get_regexp=function(t,n){var r=null,i="g";return n&&e&&(i="y"),"string"==typeof t&&""!==t?r=new RegExp(t,i):t&&(r=new RegExp(t.source,i)),r},n.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},n.prototype.peekUntilAfter=function(t){var e=this.__position,n=this.readUntilAfter(t);return this.__position=e,n},n.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=n},function(t,e,n){var r=n(8).InputScanner,i=n(3).Token,s=n(10).TokenStream,A=n(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(t,e){this._input=new r(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new A(this._input)};o.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new s,this._reset();for(var e=new i(a.START,""),n=null,r=[],A=new s;e.type!==a.EOF;){for(t=this._get_next_token(e,n);this._is_comment(t);)A.add(t),t=this._get_next_token(e,n);A.isEmpty()||(t.comments_before=A,A=new s),t.parent=n,this._is_opening(t)?(r.push(n),n=t):n&&this._is_closing(t,n)&&(t.opened=n,n.closed=t,n=r.pop(),t.parent=n),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(t,e){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},o.prototype._is_comment=function(t){return!1},o.prototype._is_opening=function(t){return!1},o.prototype._is_closing=function(t,e){return!1},o.prototype._create_token=function(t,e){return new i(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},t.exports.Tokenizer=o,t.exports.TOKEN=a},function(t){function e(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}e.prototype.restart=function(){this.__position=0},e.prototype.isEmpty=function(){return 0===this.__tokens_length},e.prototype.hasNext=function(){return this.__position<this.__tokens_length},e.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},e.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},e.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},t.exports.TokenStream=e},function(t,e,n){var r=n(12).Pattern;function i(t,e){r.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}i.prototype=new r,i.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},i.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(" "===t)this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t},i.prototype.matching=function(t,e){var n=this._create();return n.__set_whitespace_patterns(t,e),n._update(),n},i.prototype._create=function(){return new i(this._input,this)},i.prototype.__split=function(t,e){t.lastIndex=0;for(var n=0,r=[],i=t.exec(e);i;)r.push(e.substring(n,i.index)),n=i.index+i[0].length,i=t.exec(e);return n<e.length?r.push(e.substring(n,e.length)):r.push(""),r},t.exports.WhitespacePattern=i},function(t){function e(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}e.prototype.read=function(){var t=this._input.read(this._starting_pattern);return this._starting_pattern&&!t||(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},e.prototype.read_match=function(){return this._input.match(this._match_pattern)},e.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e},e.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e},e.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e},e.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e},e.prototype._create=function(){return new e(this._input,this)},e.prototype._update=function(){},t.exports.Pattern=e},function(t){function e(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}e.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(t);n;)e[n[1]]=n[2],n=this.__directive_pattern.exec(t);return e},e.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},t.exports.Directives=e},function(t,e,n){var r=n(12).Pattern,i={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function s(t,e){r.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},i),this._excluded=Object.assign({},i),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var n=new r(t);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}s.prototype=new r,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},s.prototype.read_options=function(t){var e=this._create();for(var n in i)e._disabled[n]=-1===t.templating.indexOf(n);return e._update(),e},s.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},s.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},s.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},s.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=(t=(t=t||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=(t=t||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=(t=(t=t||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return t},t.exports.TemplatablePattern=s},,,,function(t,e,n){var r=n(19).Beautifier,i=n(20).Options;t.exports=function(t,e,n,i){return new r(t,e,n,i).beautify()},t.exports.defaultOptions=function(){return new i}},function(t,e,n){var r=n(20).Options,i=n(2).Output,s=n(21).Tokenizer,A=n(21).TOKEN,a=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,l=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new i(t,e)};l.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},l.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},l.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},l.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},l.prototype.print_preserved_newlines=function(t){var e=0;t.type!==A.TEXT&&t.previous.type!==A.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines<this.max_preserve_newlines+1?t.newlines:this.max_preserve_newlines+1);for(var n=0;n<e;n++)this.print_newline(n>0);return 0!==e},l.prototype.traverse_whitespace=function(t){return!(!t.whitespace_before&&!t.newlines)&&(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0)},l.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},l.prototype.print_newline=function(t){this._output.add_new_line(t)},l.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))},l.prototype.indent=function(){this.indent_level++},l.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},l.prototype.get_full_indent=function(t){return(t=this.indent_level+(t||0))<1?"":this._output.get_indent_string(t)};var u=function(t,e){var n=null,r=null;return e.closed?("script"===t?n="text/javascript":"style"===t&&(n="text/css"),n=function(t){for(var e=null,n=t.next;n.type!==A.EOF&&t.closed!==n;){if(n.type===A.ATTRIBUTE&&"type"===n.text){n.next&&n.next.type===A.EQUALS&&n.next.next&&n.next.next.type===A.VALUE&&(e=n.next.next.text);break}n=n.next}return e}(e)||n,n.search("text/css")>-1?r="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?r="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?r="html":n.search(/test\/null/)>-1&&(r="null"),r):null};function c(t,e){return-1!==e.indexOf(t)}function h(t,e,n){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=n||0,this.parser_token=e||null}function d(t){this._printer=t,this._current_frame=null}function f(t,e,n,i){this._source_text=t||"",e=e||{},this._js_beautify=n,this._css_beautify=i,this._tag_stack=null;var s=new r(e,"html");this._options=s,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}d.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},d.prototype.record_tag=function(t){var e=new h(this._current_frame,t,this._printer.indent_level);this._current_frame=e},d.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},d.prototype._get_frame=function(t,e){for(var n=this._current_frame;n&&-1===t.indexOf(n.tag);){if(e&&-1!==e.indexOf(n.tag)){n=null;break}n=n.parent}return n},d.prototype.try_pop=function(t,e){var n=this._get_frame([t],e);return this._try_pop_frame(n)},d.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},f.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&a.test(t)&&(e=t.match(a)[0]));var n=(t=t.replace(o,"\n")).match(/^[\t ]*/)[0],r={text:"",type:""},i=new p(this._options),u=new l(this._options,n),c=new s(t,this._options).tokenize();this._tag_stack=new d(u);for(var h=null,f=c.next();f.type!==A.EOF;)f.type===A.TAG_OPEN||f.type===A.COMMENT?i=h=this._handle_tag_open(u,f,i,r,c):f.type===A.ATTRIBUTE||f.type===A.EQUALS||f.type===A.VALUE||f.type===A.TEXT&&!i.tag_complete?h=this._handle_inside_tag(u,f,i,r):f.type===A.TAG_CLOSE?h=this._handle_tag_close(u,f,i):f.type===A.TEXT?h=this._handle_text(u,f,i):f.type===A.CONTROL_FLOW_OPEN?h=this._handle_control_flow_open(u,f):f.type===A.CONTROL_FLOW_CLOSE?h=this._handle_control_flow_close(u,f):u.add_raw_token(f),r=h,f=c.next();return u._output.get_code(e)},f.prototype._handle_control_flow_open=function(t,e){var n={text:e.text,type:e.type};return t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),e.newlines?t.print_preserved_newlines(e):t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),t.print_token(e),t.indent(),n},f.prototype._handle_control_flow_close=function(t,e){var n={text:e.text,type:e.type};return t.deindent(),e.newlines?t.print_preserved_newlines(e):t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),t.print_token(e),n},f.prototype._handle_tag_close=function(t,e,n){var r={text:e.text,type:e.type};return t.alignment_size=0,n.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),n.is_unformatted?t.add_raw_token(e):("<"===n.tag_start_char&&(t.set_space_before_token("/"===e.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),!n.indent_content||n.is_unformatted||n.is_content_unformatted||(t.indent(),n.indent_content=!1),n.is_inline_element||n.is_unformatted||n.is_content_unformatted||t.set_wrap_point(),r},f.prototype._handle_inside_tag=function(t,e,n,r){var i=n.has_wrapped_attrs,s={text:e.text,type:e.type};return t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),n.is_unformatted?t.add_raw_token(e):"{"===n.tag_start_char&&e.type===A.TEXT?t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e):(e.type===A.ATTRIBUTE?t.set_space_before_token(!0):(e.type===A.EQUALS||e.type===A.VALUE&&e.previous.type===A.EQUALS)&&t.set_space_before_token(!1),e.type===A.ATTRIBUTE&&"<"===n.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),i=i||0!==e.newlines),this._is_wrap_attributes_force&&n.attr_count>=this._options.wrap_attributes_min_attrs&&(r.type!==A.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(t.print_newline(!1),i=!0)),t.print_token(e),i=i||t.previous_token_wrapped(),n.has_wrapped_attrs=i),s},f.prototype._handle_text=function(t,e,n){var r={text:e.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(t,e,n):n.is_unformatted||n.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),r},f.prototype._print_custom_beatifier_text=function(t,e,n){var r=this;if(""!==e.text){var i,s=e.text,A=1,a="",o="";"javascript"===n.custom_beautifier_name&&"function"==typeof this._js_beautify?i=this._js_beautify:"css"===n.custom_beautifier_name&&"function"==typeof this._css_beautify?i=this._css_beautify:"html"===n.custom_beautifier_name&&(i=function(t,e){return new f(t,e,r._js_beautify,r._css_beautify).beautify()}),"keep"===this._options.indent_scripts?A=0:"separate"===this._options.indent_scripts&&(A=-t.indent_level);var l=t.get_full_indent(A);if(s=s.replace(/\n[ \t]*$/,""),"html"!==n.custom_beautifier_name&&"<"===s[0]&&s.match(/^(<!--|<!\[CDATA\[)/)){var u=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(s);if(!u)return void t.add_raw_token(e);a=l+u[1]+"\n",s=u[4],u[5]&&(o=l+u[5]),s=s.replace(/\n[ \t]*$/,""),(u[2]||-1!==u[3].indexOf("\n"))&&(u=u[3].match(/[ \t]+$/))&&(e.whitespace_before=u[0])}if(s)if(i){var c=function(){this.eol="\n"};c.prototype=this._options.raw_options,s=i(l+s,new c)}else{var h=e.whitespace_before;h&&(s=s.replace(new RegExp("\n("+h+")?","g"),"\n")),s=l+s.replace(/\n/g,"\n"+l)}a&&(s=s?a+s+"\n"+o:a+o),t.print_newline(!1),s&&(e.text=s,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},f.prototype._handle_tag_open=function(t,e,n,r,i){var s=this._get_tag_open_token(e);if(!n.is_unformatted&&!n.is_content_unformatted||n.is_empty_element||e.type!==A.TAG_OPEN||s.is_start_tag?(t.traverse_whitespace(e),this._set_tag_position(t,e,s,n,r),s.is_inline_element||t.set_wrap_point(),t.print_token(e)):(t.add_raw_token(e),s.start_tag_token=this._tag_stack.try_pop(s.tag_name)),s.is_start_tag&&this._is_wrap_attributes_force){var a,o=0;do{(a=i.peek(o)).type===A.ATTRIBUTE&&(s.attr_count+=1),o+=1}while(a.type!==A.EOF&&a.type!==A.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(s.alignment_size=e.text.length+1),s.tag_complete||s.is_unformatted||(t.alignment_size=s.alignment_size),s};var p=function(t,e,n){if(this.parent=e||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="",n){var r;this.tag_start_char=n.text[0],this.text=n.text,"<"===this.tag_start_char?(r=n.text.match(/^<([^\s>]*)/),this.tag_check=r?r[1]:""):(r=n.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=r?r[1]:"",(n.text.startsWith("{{#>")||n.text.startsWith("{{~#>"))&&">"===this.tag_check[0]&&(">"===this.tag_check&&null!==n.next?this.tag_check=n.next.text.split(" ")[0]:this.tag_check=n.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),n.type===A.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||n.closed&&"/>"===n.closed.text;var i=2;"{"===this.tag_start_char&&this.text.length>=3&&"~"===this.text.charAt(2)&&(i=3),this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(!t.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(i)))}else this.tag_complete=!0};f.prototype._get_tag_open_token=function(t){var e=new p(this._options,this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||c(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&c(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&c(e.tag_check,this._options.content_unformatted),e.is_inline_element=c(e.tag_name,this._options.inline)||this._options.inline_custom_elements&&e.tag_name.includes("-")||"{"===e.tag_start_char,e},f.prototype._set_tag_position=function(t,e,n,r,i){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(n),"script"!==n.tag_name&&"style"!==n.tag_name||n.is_unformatted||n.is_content_unformatted||(n.custom_beautifier_name=u(n.tag_check,e)))),c(n.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),n.is_empty_element){if("{"===n.tag_start_char&&"else"===n.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1);"!--"===n.tag_name&&i.type===A.TAG_CLOSE&&r.is_end_tag&&-1===n.text.indexOf("\n")||(n.is_inline_element||n.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,n))}else if(n.is_end_tag){var s=!1;s=(s=n.start_tag_token&&n.start_tag_token.multiline_content)||!n.is_inline_element&&!(r.is_inline_element||r.is_unformatted)&&!(i.type===A.TAG_CLOSE&&n.start_tag_token===r)&&"TK_CONTENT"!==i.type,(n.is_content_unformatted||n.is_unformatted)&&(s=!1),s&&t.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,"<"===n.tag_start_char&&("html"===n.tag_name?n.indent_content=this._options.indent_inner_html:"head"===n.tag_name?n.indent_content=this._options.indent_head_inner_html:"body"===n.tag_name&&(n.indent_content=this._options.indent_body_inner_html)),n.is_inline_element||n.is_unformatted||"TK_CONTENT"===i.type&&!n.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,n)},f.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)};var g=["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"],m=["a","audio","del","ins","map","noscript","video"];f.prototype._do_optional_end_element=function(t){var e=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent){if("body"===t.tag_name)e=e||this._tag_stack.try_pop("head");else if("li"===t.tag_name)e=e||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if("dd"===t.tag_name||"dt"===t.tag_name)e=(e=e||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===t.parent.tag_name&&-1!==g.indexOf(t.tag_name)){var n=t.parent.parent;n&&-1!==m.indexOf(n.tag_name)||(e=e||this._tag_stack.try_pop("p"))}else"rp"===t.tag_name||"rt"===t.tag_name?e=(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===t.tag_name?e=e||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?e=e||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===t.tag_name||"tfoot"===t.tag_name?e=(e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===t.tag_name?e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==t.tag_name&&"td"!==t.tag_name||(e=(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}},t.exports.Beautifier=f},function(t,e,n){var r=n(6).Options;function i(t){r.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(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"])}i.prototype=new r,t.exports.Options=i},function(t,e,n){var r=n(9).Tokenizer,i=n(9).TOKEN,s=n(13).Directives,A=n(14).TemplatablePattern,a=n(12).Pattern,o={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:i.START,RAW:i.RAW,EOF:i.EOF},l=new s(/<\!--/,/-->/),u=function(t,e){r.call(this,t,e),this._current_tag_name="";var n=new A(this._input).read_options(this._options),i=new a(this._input);if(this.__patterns={word:n.until(/[\n\r\t <]/),word_control_flow_close_excluded:n.until(/[\n\r\t <}]/),single_quote:n.until_after(/'/),double_quote:n.until_after(/"/),attribute:n.until(/[\n\r\t =>]|\/>/),element_name:n.until(/[\n\r\t >\/]/),angular_control_flow_start:i.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),handlebars_open:i.until(/[\n\r\t }]/),handlebars_raw_close:i.until(/}}/),comment:i.starting_with(/<!--/).until_after(/-->/),cdata:i.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:i.starting_with(/<!\[/).until_after(/]>/),processing:i.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 s=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=i.matching(s).until_after(s)}};(u.prototype=new r)._is_comment=function(t){return!1},u.prototype._is_opening=function(t){return t.type===o.TAG_OPEN||t.type===o.CONTROL_FLOW_OPEN},u.prototype._is_closing=function(t,e){return t.type===o.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])||t.type===o.CONTROL_FLOW_CLOSE&&"}"===t.text&&e.text.endsWith("{")},u.prototype._reset=function(){this._current_tag_name=""},u.prototype._get_next_token=function(t,e){var n=null;this._readWhitespace();var r=this._input.peek();return null===r?this._create_token(o.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_open_handlebars(r,e))||this._read_attribute(r,t,e))||this._read_close(r,e))||this._read_script_and_style(r,t))||this._read_control_flows(r,e))||this._read_raw_content(r,t,e))||this._read_content_word(r,e))||this._read_comment_or_cdata(r))||this._read_processing(r))||this._read_open(r,e))||this._create_token(o.UNKNOWN,this._input.next())},u.prototype._read_comment_or_cdata=function(t){var e=null,n=null,r=null;"<"===t&&("!"===this._input.peek(1)&&((n=this.__patterns.comment.read())?(r=l.get_directives(n))&&"start"===r.ignore&&(n+=l.readIgnored(this._input)):n=this.__patterns.cdata.read()),n&&((e=this._create_token(o.COMMENT,n)).directives=r));return e},u.prototype._read_processing=function(t){var e=null,n=null;if("<"===t){var r=this._input.peek(1);"!"!==r&&"?"!==r||(n=(n=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),n&&((e=this._create_token(o.COMMENT,n)).directives=null)}return e},u.prototype._read_open=function(t,e){var n=null,r=null;return e&&e.type!==o.CONTROL_FLOW_OPEN||"<"===t&&(n=this._input.next(),"/"===this._input.peek()&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),r=this._create_token(o.TAG_OPEN,n)),r},u.prototype._read_open_handlebars=function(t,e){var n=null,r=null;return e&&e.type!==o.CONTROL_FLOW_OPEN||(this._options.templating.includes("angular")||this._options.indent_handlebars)&&"{"===t&&"{"===this._input.peek(1)&&(this._options.indent_handlebars&&"!"===this._input.peek(2)?(n=(n=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),r=this._create_token(o.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),r=this._create_token(o.TAG_OPEN,n))),r},u.prototype._read_control_flows=function(t,e){var n="",r=null;if(!this._options.templating.includes("angular"))return r;if("@"===t){if(""===(n=this.__patterns.angular_control_flow_start.read()))return r;for(var i=n.endsWith("(")?1:0,s=0;!n.endsWith("{")||i!==s;){var A=this._input.next();if(null===A)break;"("===A?i++:")"===A&&s++,n+=A}r=this._create_token(o.CONTROL_FLOW_OPEN,n)}else"}"===t&&e&&e.type===o.CONTROL_FLOW_OPEN&&(n=this._input.next(),r=this._create_token(o.CONTROL_FLOW_CLOSE,n));return r},u.prototype._read_close=function(t,e){var n=null,r=null;return e&&e.type===o.TAG_OPEN&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(n=this._input.next(),"/"===t&&(n+=this._input.next()),r=this._create_token(o.TAG_CLOSE,n)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),r=this._create_token(o.TAG_CLOSE,"}}"))),r},u.prototype._read_attribute=function(t,e,n){var r=null,i="";if(n&&"<"===n.text[0])if("="===t)r=this._create_token(o.EQUALS,this._input.next());else if('"'===t||"'"===t){var s=this._input.next();s+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),r=this._create_token(o.VALUE,s)}else(i=this.__patterns.attribute.read())&&(r=e.type===o.EQUALS?this._create_token(o.VALUE,i):this._create_token(o.ATTRIBUTE,i));return r},u.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},u.prototype._read_raw_content=function(t,e,n){var r="";if(n&&"{"===n.text[0])r=this.__patterns.handlebars_raw_close.read();else if(e.type===o.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var i=e.opened.text.substr(1).toLowerCase();this._is_content_unformatted(i)&&(r=this._input.readUntil(new RegExp("</"+i+"[\\n\\r\\t ]*?>","ig")))}return r?this._create_token(o.TEXT,r):null},u.prototype._read_script_and_style=function(t,e){if(e.type===o.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var n=e.opened.text.substr(1).toLowerCase();if("script"===n||"style"===n){var r=this._read_comment_or_cdata(t);if(r)return r.type=o.TEXT,r;var i=this._input.readUntil(new RegExp("</"+n+"[\\n\\r\\t ]*?>","ig"));if(i)return this._create_token(o.TEXT,i)}}return null},u.prototype._read_content_word=function(t,e){var n="";return this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(n=this.__patterns.unformatted_content_delimiter.read()),n||(n=e&&e.type===o.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),n?this._create_token(o.TEXT,n):null},t.exports.Tokenizer=u,t.exports.TOKEN=o}],e={};var n=function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,n),s.exports}(18);s=n}();var A=s;r=[n,n(58553),n(87804)],i=function(t){var e=n(58553),r=n(87804);return{html_beautify:function(t,n){return A(t,n,e.js_beautify,r.css_beautify)}}}.apply(e,r),void 0===i||(t.exports=i)}()},58553:function(t,e){var n;!function(){var r;!function(){"use strict";var t=[function(t,e,n){var r=n(1).Beautifier,i=n(5).Options;t.exports=function(t,e){return new r(t,e).beautify()},t.exports.defaultOptions=function(){return new i}},function(t,e,n){var r=n(2).Output,i=n(3).Token,s=n(4),A=n(5).Options,a=n(7).Tokenizer,o=n(7).line_starters,l=n(7).positionable_operators,u=n(7).TOKEN;function c(t,e){return-1!==e.indexOf(t)}function h(t,e){return t&&t.type===u.RESERVED&&t.text===e}function d(t,e){return t&&t.type===u.RESERVED&&c(t.text,e)}var f=["case","return","do","if","throw","else","await","break","continue","async"],p=function(t){for(var e={},n=0;n<t.length;n++)e[t[n].replace(/-/g,"_")]=t[n];return e}(["before-newline","after-newline","preserve-newline"]),g=[p.before_newline,p.preserve_newline],m="BlockStatement",_="Statement",w="ObjectLiteral",y="ArrayLiteral",v="ForInitializer",B="Conditional",b="Expression";function E(t,e){e.multiline_frame||e.mode===v||e.mode===B||t.remove_indent(e.start_line_index)}function C(t){return t===y}function k(t){return c(t,[b,v,B])}function F(t,e){e=e||{},this._source_text=t||"",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 A(e)}F.prototype.create_flags=function(t,e){var n=0;return t&&(n=t.indentation_level,!this._output.just_added_newline()&&t.line_indent_level>n&&(n=t.line_indent_level)),{mode:e,parent:t,last_token:t?t.last_token:new i(u.START_BLOCK,""),last_word:t?t.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:n,alignment:0,line_indent_level:t?t.line_indent_level:n,start_line_index:this._output.get_line_number(),ternary_depth:0}},F.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new r(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(m);var n=new a(t,this._options);return this._tokens=n.tokenize(),t},F.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._reset(this._source_text),e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&s.lineBreak.test(t||"")&&(e=t.match(s.lineBreak)[0]));for(var n=this._tokens.next();n;)this.handle_token(n),this._last_last_text=this._flags.last_token.text,this._flags.last_token=n,n=this._tokens.next();return this._output.get_code(e)},F.prototype.handle_token=function(t,e){t.type===u.START_EXPR?this.handle_start_expr(t):t.type===u.END_EXPR?this.handle_end_expr(t):t.type===u.START_BLOCK?this.handle_start_block(t):t.type===u.END_BLOCK?this.handle_end_block(t):t.type===u.WORD||t.type===u.RESERVED?this.handle_word(t):t.type===u.SEMICOLON?this.handle_semicolon(t):t.type===u.STRING?this.handle_string(t):t.type===u.EQUALS?this.handle_equals(t):t.type===u.OPERATOR?this.handle_operator(t):t.type===u.COMMA?this.handle_comma(t):t.type===u.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===u.COMMENT?this.handle_comment(t,e):t.type===u.DOT?this.handle_dot(t):t.type===u.EOF?this.handle_eof(t):(t.type,u.UNKNOWN,this.handle_unknown(t,e))},F.prototype.handle_whitespace_and_comments=function(t,e){var n=t.newlines,r=this._options.keep_array_indentation&&C(this._flags.mode);if(t.comments_before)for(var i=t.comments_before.next();i;)this.handle_whitespace_and_comments(i,e),this.handle_token(i,e),i=t.comments_before.next();if(r)for(var s=0;s<n;s+=1)this.print_newline(s>0,e);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,e);for(var A=1;A<n;A+=1)this.print_newline(!0,e)}};var T=["async","break","continue","return","throw","yield"];F.prototype.allow_wrap_or_preserved_newline=function(t,e){if(e=void 0!==e&&e,!this._output.just_added_newline()){var n=this._options.preserve_newlines&&t.newlines||e;if(c(this._flags.last_token.text,l)||c(t.text,l)){var r=c(this._flags.last_token.text,l)&&c(this._options.operator_position,g)||c(t.text,l);n=n&&r}if(n)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(d(this._flags.last_token,T))return;this._output.set_wrap_point()}}},F.prototype.print_newline=function(t,e){if(!e&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==u.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var n=this._tokens.peek();!(this._flags.mode!==_||this._flags.if_block&&h(n,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},F.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&t.newlines&&("["===t.text||C(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(t.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))},F.prototype.print_token=function(t){if(this._output.raw)this._output.add_raw_token(t);else{if(this._options.comma_first&&t.previous&&t.previous.type===u.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var e=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(e),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(t),this._output.non_breaking_space=!0,this._output.add_token(t.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},F.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},F.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))},F.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},F.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===_&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},F.prototype.start_of_object_property=function(){return this._flags.parent.mode===w&&this._flags.mode===_&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"]))},F.prototype.start_of_statement=function(t){var e=!1;return!!(e=(e=(e=(e=(e=(e=(e=e||d(this._flags.last_token,["var","let","const"])&&t.type===u.WORD)||h(this._flags.last_token,"do"))||!(this._flags.parent.mode===w&&this._flags.mode===_)&&d(this._flags.last_token,T)&&!t.newlines)||h(this._flags.last_token,"else")&&!(h(t,"if")&&!t.comments_before))||this._flags.last_token.type===u.END_EXPR&&(this._previous_flags.mode===v||this._previous_flags.mode===B))||this._flags.last_token.type===u.WORD&&this._flags.mode===m&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==u.WORD&&t.type!==u.RESERVED)||this._flags.mode===w&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||d(this._flags.last_token,["get","set"])))&&(this.set_mode(_),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,d(t,["do","for","if","while"])),!0)},F.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=b;if("["===t.text){if(this._flags.last_token.type===u.WORD||")"===this._flags.last_token.text)return d(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=y,C(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()),c(this._flags.last_token.type,[u.START_EXPR,u.END_EXPR,u.WORD,u.OPERATOR,u.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===u.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,e=v):c(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=B):c(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===t.whitespace_before?this._output.space_before_token=!1:(c(this._flags.last_token.text,o)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===u.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var r=this._tokens.peek(-4);d(n,["async","function"])||"*"===n.text&&d(r,["async","function"])?this._output.space_before_token=!0:this._flags.mode===w?"{"!==n.text&&","!==n.text&&("*"!==n.text||"{"!==r.text&&","!==r.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(t);(this._flags.last_token.type===u.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(c(this._last_last_text,["function","yield"])||this._flags.mode===w&&c(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===u.START_BLOCK?this.print_newline():this._flags.last_token.type!==u.END_EXPR&&this._flags.last_token.type!==u.START_EXPR&&this._flags.last_token.type!==u.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==u.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},F.prototype.handle_end_expr=function(t){for(;this._flags.mode===_;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&C(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==u.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(t),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===B&&(this._previous_flags.mode=b,this._flags.do_block=!1,this._flags.do_while=!1)},F.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),n=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===u.END_EXPR?(this.set_mode(m),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(m):n&&(c(n.text,[":",","])&&c(e.type,[u.STRING,u.WORD,u.RESERVED])||c(e.text,["get","set","..."])&&c(n.type,[u.WORD,u.RESERVED]))?c(this._last_last_text,["class","interface"])&&!c(n.text,[":",","])?this.set_mode(m):this.set_mode(w):this._flags.last_token.type===u.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(m):c(this._flags.last_token.type,[u.EQUALS,u.START_EXPR,u.COMMA,u.OPERATOR])||d(this._flags.last_token,["return","throw","import","default"])?this.set_mode(w):this.set_mode(m),this._flags.last_token&&d(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var r=!e.comments_before&&"}"===e.text,i=r&&"function"===this._flags.last_word&&this._flags.last_token.type===u.END_EXPR;if(this._options.brace_preserve_inline){var s=0,A=null;this._flags.inline_frame=!0;do{if(s+=1,(A=this._tokens.peek(s-1)).newlines){this._flags.inline_frame=!1;break}}while(A.type!==u.EOF&&(A.type!==u.END_BLOCK||A.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==u.OPERATOR&&(i||this._flags.last_token.type===u.EQUALS||d(this._flags.last_token,f)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!C(this._previous_flags.mode)||this._flags.last_token.type!==u.START_EXPR&&this._flags.last_token.type!==u.COMMA||((this._flags.last_token.type===u.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==u.OPERATOR&&this._flags.last_token.type!==u.START_EXPR&&(c(this._flags.last_token.type,[u.START_BLOCK,u.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(t),this.indent(),r||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},F.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===_;)this.restore_mode();var e=this._flags.last_token.type===u.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(C(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(t)},F.prototype.handle_word=function(t){if(t.type===u.RESERVED)if(c(t.text,["set","get"])&&this._flags.mode!==w)t.type=u.WORD;else if("import"===t.text&&c(this._tokens.peek().text,["(","."]))t.type=u.WORD;else if(c(t.text,["as","from"])&&!this._flags.import_block)t.type=u.WORD;else if(this._flags.mode===w){":"===this._tokens.peek().text&&(t.type=u.WORD)}if(this.start_of_statement(t)?d(this._flags.last_token,["var","let","const"])&&t.type===u.WORD&&(this._flags.declaration_statement=!0):!t.newlines||k(this._flags.mode)||this._flags.last_token.type===u.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===u.EQUALS||!this._options.preserve_newlines&&d(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(h(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&h(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===_;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&d(t,["case","default"]))return 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(t),void(this._flags.in_case=!0);if(this._flags.last_token.type!==u.COMMA&&this._flags.last_token.type!==u.START_EXPR&&this._flags.last_token.type!==u.EQUALS&&this._flags.last_token.type!==u.OPERATOR||this.start_of_object_property()||c(this._flags.last_token.text,["+","-"])&&":"===this._last_last_text&&this._flags.parent.mode===w||this.allow_wrap_or_preserved_newline(t),h(t,"function"))return(c(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!c(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==u.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD?d(this._flags.last_token,["get","set","new","export"])||d(this._flags.last_token,T)||h(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===u.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!k(this._flags.mode)&&!C(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var e="NONE";(this._flags.last_token.type===u.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":d(t,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):e="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&this._flags.mode===m?e="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&k(this._flags.mode)?e="SPACE":this._flags.last_token.type===u.STRING?e="NEWLINE":this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||"*"===this._flags.last_token.text&&(c(this._last_last_text,["function","yield"])||this._flags.mode===w&&c(this._last_last_text,["{",","]))?e="SPACE":this._flags.last_token.type===u.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===u.END_EXPR&&(this._output.space_before_token=!0,e="NEWLINE"),d(t,o)&&")"!==this._flags.last_token.text&&(e=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),d(t,["else","catch","finally"]))?(this._flags.last_token.type!==u.END_BLOCK||this._previous_flags.mode!==m||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?d(this._flags.last_token,f)||"declare"===this._flags.last_token.text&&d(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==u.END_EXPR?this._flags.last_token.type===u.START_EXPR&&d(t,["var","let","const"])||":"===this._flags.last_token.text||(h(t,"if")&&h(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):d(t,o)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&C(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0);!t.previous||t.previous.type!==u.WORD&&t.previous.type!==u.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===u.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&h(t,"from")&&(this._flags.import_block=!1))},F.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==_||this._flags.if_block&&h(e,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},F.prototype.handle_string=function(t){(!t.text.startsWith("`")||0!==t.newlines||""!==t.whitespace_before||")"!==t.previous.text&&this._flags.last_token.type!==u.WORD)&&(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):!t.text.startsWith("`")||this._flags.last_token.type!==u.END_EXPR||"]"!==t.previous.text&&")"!==t.previous.text||0!==t.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(t)},F.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},F.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(k(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(t)):this._flags.mode===w||this._flags.mode===_&&this._flags.parent.mode===w?(this._flags.mode===_&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},F.prototype.handle_operator=function(t){var e="*"===t.text&&(d(this._flags.last_token,["function","yield"])||c(this._flags.last_token.type,[u.START_BLOCK,u.COMMA,u.END_BLOCK,u.SEMICOLON])),n=c(t.text,["-","+"])&&(c(this._flags.last_token.type,[u.START_BLOCK,u.START_EXPR,u.EQUALS,u.OPERATOR])||c(this._flags.last_token.text,o)||","===this._flags.last_token.text);if(this.start_of_statement(t));else{var r=!e;this.handle_whitespace_and_comments(t,r)}if("*"!==t.text||this._flags.last_token.type!==u.DOT)if("::"!==t.text)if(c(t.text,["-","+"])&&this.start_of_object_property())this.print_token(t);else{if(this._flags.last_token.type===u.OPERATOR&&c(this._options.operator_position,g)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==u.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0));var i=!0,s=!0,A=!1;if(":"===t.text?0===this._flags.ternary_depth?i=!1:(this._flags.ternary_depth-=1,A=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!n&&!e&&this._options.preserve_newlines&&c(t.text,l)){var a=":"===t.text,h=a&&A,w=a&&!A;switch(this._options.operator_position){case p.before_newline:return this._output.space_before_token=!w,this.print_token(t),a&&!h||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case p.after_newline:return this._output.space_before_token=!0,!a||h?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case p.preserve_newline:return w||this.allow_wrap_or_preserved_newline(t),i=!(this._output.just_added_newline()||w),this._output.space_before_token=i,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),i=!1;var y=this._tokens.peek();s=y&&c(y.type,[u.WORD,u.RESERVED])}else if("..."===t.text)this.allow_wrap_or_preserved_newline(t),i=this._flags.last_token.type===u.START_BLOCK,s=!1;else if(c(t.text,["--","++","!","~"])||n){if(this._flags.last_token.type!==u.COMMA&&this._flags.last_token.type!==u.START_EXPR||this.allow_wrap_or_preserved_newline(t),i=!1,s=!1,t.newlines&&("--"===t.text||"++"===t.text||"~"===t.text)){var v=d(this._flags.last_token,f)&&t.newlines;v&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(v,!0)}";"===this._flags.last_token.text&&k(this._flags.mode)&&(i=!0),this._flags.last_token.type===u.RESERVED?i=!0:this._flags.last_token.type===u.END_EXPR?i=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===u.OPERATOR&&(i=c(t.text,["--","-","++","+"])&&c(this._flags.last_token.text,["--","-","++","+"]),c(t.text,["+","-"])&&c(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode!==m||this._flags.inline_frame)&&this._flags.mode!==_||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline()}this._output.space_before_token=this._output.space_before_token||i,this.print_token(t),this._output.space_before_token=s}else this.print_token(t);else this.print_token(t)},F.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):s.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},F.prototype.print_block_commment=function(t,e){var n,r=function(t){for(var e=[],n=(t=t.replace(s.allLineBreaks,"\n")).indexOf("\n");-1!==n;)e.push(t.substring(0,n)),n=(t=t.substring(n+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),i=!1,A=!1,a=t.whitespace_before,o=a.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(r[0]),this.print_newline(!1,e),r.length>1){for(i=function(t,e){for(var n=0;n<t.length;n++)if(t[n].trim().charAt(0)!==e)return!1;return!0}(r=r.slice(1),"*"),A=function(t,e){for(var n,r=0,i=t.length;r<i;r++)if((n=t[r])&&0!==n.indexOf(e))return!1;return!0}(r,a),i&&(this._flags.alignment=1),n=0;n<r.length;n++)i?(this.print_token_line_indentation(t),this._output.add_token(r[n].replace(/^\s+/g,""))):A&&r[n]?(this.print_token_line_indentation(t),this._output.add_token(r[n].substring(o))):(this._output.current_line.set_indent(-1),this._output.add_token(r[n])),this.print_newline(!1,e);this._flags.alignment=0}},F.prototype.handle_comment=function(t,e){t.newlines?this.print_newline(!1,e):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,e)},F.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),d(this._flags.last_token,f)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,")"===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(t)},F.prototype.handle_unknown=function(t,e){this.print_token(t),"\n"===t.text[t.text.length-1]&&this.print_newline(!1,e)},F.prototype.handle_eof=function(t){for(;this._flags.mode===_;)this.restore_mode();this.handle_whitespace_and_comments(t)},t.exports.Beautifier=F},function(t){function e(t){this.__parent=t,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=[]}function n(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function r(t,r){this.__indent_cache=new n(t,r),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}e.prototype.clone_empty=function(){var t=new e(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},e.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},e.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},e.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.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)},e.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},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return 0===this.__items.length},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},e.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},n.prototype.get_indent_size=function(t,e){var n=this.__base_string_length;return e=e||0,t<0&&(n=0),n+=t*this.__indent_size,n+=e},n.prototype.get_indent_string=function(t,e){var n=this.__base_string;return e=e||0,t<0&&(t=0,n=""),e+=t*this.__indent_size,this.__ensure_cache(e),n+=this.__cache[e]},n.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)},r.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},r.prototype.get_line_number=function(){return this.__lines.length},r.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},r.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},r.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},r.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},r.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==t&&(n=n.replace(/[\n]/g,t)),n},r.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},r.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},r.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},r.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},r.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(" "))},r.prototype.remove_indent=function(t){for(var e=this.__lines.length;t<e;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},r.prototype.trim=function(t){for(t=void 0!==t&&t,this.current_line.trim();t&&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},r.prototype.just_added_newline=function(){return this.current_line.is_empty()},r.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},r.prototype.ensure_empty_line_above=function(t,n){for(var r=this.__lines.length-2;r>=0;){var i=this.__lines[r];if(i.is_empty())break;if(0!==i.item(0).indexOf(t)&&i.item(-1)!==n){this.__lines.splice(r+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},t.exports.Output=r},function(t){t.exports.Token=function(t,e,n,r){this.type=t,this.text=e,this.comments_before=null,this.newlines=n||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}},function(t,e){var n="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",r="\\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",i="\\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",s="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",A="(?:"+s+"|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+r+"])",a="(?:"+s+"|["+n+r+i+"])*";e.identifier=new RegExp(A+a,"g"),e.identifierStart=new RegExp(A),e.identifierMatch=new RegExp("(?:"+s+"|["+n+r+i+"])+");e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g")},function(t,e,n){var r=n(6).Options,i=["before-newline","after-newline","preserve-newline"];function s(t){r.call(this,t,"js");var e=this.raw_options.brace_style||null;"expand-strict"===e?this.raw_options.brace_style="expand":"collapse-preserve-inline"===e?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var s=0;s<n.length;s++)"preserve-inline"===n[s]?this.brace_preserve_inline=!0:this.brace_style=n[s];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",i),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}s.prototype=new r,t.exports.Options=s},function(t){function e(t,e){this.raw_options=n(t,e),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","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(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"])}function n(t,e){var n,i={};for(n in t=r(t))n!==e&&(i[n]=t[n]);if(e&&t[e])for(n in t[e])i[n]=t[e][n];return i}function r(t){var e,n={};for(e in t){n[e.replace(/-/g,"_")]=t[e]}return n}e.prototype._get_array=function(t,e){var n=this.raw_options[t],r=e||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(r=n.concat()):"string"==typeof n&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r},e.prototype._get_boolean=function(t,e){var n=this.raw_options[t];return void 0===n?!!e:!!n},e.prototype._get_characters=function(t,e){var n=this.raw_options[t],r=e||"";return"string"==typeof n&&(r=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),r},e.prototype._get_number=function(t,e){var n=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var r=parseInt(n,10);return isNaN(r)&&(r=e),r},e.prototype._get_selection=function(t,e,n){var r=this._get_selection_list(t,e,n);if(1!==r.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return r[0]},e.prototype._get_selection_list=function(t,e,n){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(n=n||[e[0]],!this._is_valid_selection(n,e))throw new Error("Invalid Default Value!");var r=this._get_array(t,n);if(!this._is_valid_selection(r,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return r},e.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},t.exports.Options=e,t.exports.normalizeOpts=r,t.exports.mergeOpts=n},function(t,e,n){var r=n(8).InputScanner,i=n(9).Tokenizer,s=n(9).TOKEN,A=n(13).Directives,a=n(4),o=n(12).Pattern,l=n(14).TemplatablePattern;function u(t,e){return-1!==e.indexOf(t)}var c={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:s.START,RAW:s.RAW,EOF:s.EOF},h=new A(/\/\*/,/\*\//),d=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,f=/[0-9]/,p=/[^\d\.]/,g=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),m=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";m=(m="\\?\\.(?!\\d) "+(m=m.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var _,w=new RegExp(m),y="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),v=y.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),B=new RegExp("^(?:"+v.join("|")+")$"),b=function(t,e){i.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var n=new o(this._input),r=new l(this._input).read_options(this._options);this.__patterns={template:r,identifier:r.starting_with(a.identifier).matching(a.identifierMatch),number:n.matching(d),punct:n.matching(w),comment:n.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:n.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:n.matching(/<!--/),html_comment_end:n.matching(/-->/),include:n.starting_with(/#include/).until_after(a.lineBreak),shebang:n.starting_with(/#!/).until_after(a.lineBreak),xml:n.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:r.until(/['\\\n\r\u2028\u2029]/),double_quote:r.until(/["\\\n\r\u2028\u2029]/),template_text:r.until(/[`\\$]/),template_expression:r.until(/[`}\\]/)}};(b.prototype=new i)._is_comment=function(t){return t.type===c.COMMENT||t.type===c.BLOCK_COMMENT||t.type===c.UNKNOWN},b.prototype._is_opening=function(t){return t.type===c.START_BLOCK||t.type===c.START_EXPR},b.prototype._is_closing=function(t,e){return(t.type===c.END_BLOCK||t.type===c.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},b.prototype._reset=function(){_=!1},b.prototype._get_next_token=function(t,e){var n=null;this._readWhitespace();var r=this._input.peek();return null===r?this._create_token(c.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_non_javascript(r))||this._read_string(r))||this._read_pair(r,this._input.peek(1)))||this._read_word(t))||this._read_singles(r))||this._read_comment(r))||this._read_regexp(r,t))||this._read_xml(r,t))||this._read_punctuation())||this._create_token(c.UNKNOWN,this._input.next())},b.prototype._read_word=function(t){var e;return""!==(e=this.__patterns.identifier.read())?(e=e.replace(a.allLineBreaks,"\n"),t.type!==c.DOT&&(t.type!==c.RESERVED||"set"!==t.text&&"get"!==t.text)&&B.test(e)?"in"!==e&&"of"!==e||t.type!==c.WORD&&t.type!==c.STRING?this._create_token(c.RESERVED,e):this._create_token(c.OPERATOR,e):this._create_token(c.WORD,e)):""!==(e=this.__patterns.number.read())?this._create_token(c.WORD,e):void 0},b.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(c.START_EXPR,t):")"===t||"]"===t?e=this._create_token(c.END_EXPR,t):"{"===t?e=this._create_token(c.START_BLOCK,t):"}"===t?e=this._create_token(c.END_BLOCK,t):";"===t?e=this._create_token(c.SEMICOLON,t):"."===t&&p.test(this._input.peek(1))?e=this._create_token(c.DOT,t):","===t&&(e=this._create_token(c.COMMA,t)),e&&this._input.next(),e},b.prototype._read_pair=function(t,e){var n=null;return"#"===t&&"{"===e&&(n=this._create_token(c.START_BLOCK,t+e)),n&&(this._input.next(),this._input.next()),n},b.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(c.EQUALS,t):"?."===t?this._create_token(c.DOT,t):this._create_token(c.OPERATOR,t)},b.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(this._is_first_token()&&(e=this.__patterns.shebang.read()))return this._create_token(c.UNKNOWN,e.trim()+"\n");if(e=this.__patterns.include.read())return this._create_token(c.UNKNOWN,e.trim()+"\n");t=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(f)){do{n+=t=this._input.next()}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(n+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(n+="{}",this._input.next(),this._input.next())),this._create_token(c.WORD,n)}this._input.back()}else if("<"===t&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(a.newline);)e+=this._input.next();return _=!0,this._create_token(c.COMMENT,e)}}else if(_&&"-"===t&&(e=this.__patterns.html_comment_end.read()))return _=!1,this._create_token(c.COMMENT,e);return null},b.prototype._read_comment=function(t){var e=null;if("/"===t){var n="";if("*"===this._input.peek(1)){n=this.__patterns.block_comment.read();var r=h.get_directives(n);r&&"start"===r.ignore&&(n+=h.readIgnored(this._input)),n=n.replace(a.allLineBreaks,"\n"),(e=this._create_token(c.BLOCK_COMMENT,n)).directives=r}else"/"===this._input.peek(1)&&(n=this.__patterns.comment.read(),e=this._create_token(c.COMMENT,n))}return e},b.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=function(t){var e="",n=0,i=new r(t),s=null;for(;i.hasNext();)if((s=i.match(/([\s]|[^\\]|\\\\)+/g))&&(e+=s[0]),"\\"===i.peek()){if(i.next(),"x"===i.peek())s=i.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==i.peek()){e+="\\",i.hasNext()&&(e+=i.next());continue}(s=i.match(/u([0-9A-Fa-f]{4})/g))||(s=i.match(/u\{([0-9A-Fa-f]+)\}/g))}if(!s)return t;if((n=parseInt(s[1],16))>126&&n<=255&&0===s[0].indexOf("x"))return t;e+=n>=0&&n<32||n>1114111?"\\"+s[0]:34===n||39===n||92===n?"\\"+String.fromCharCode(n):String.fromCharCode(n)}return e}(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(a.allLineBreaks,"\n"),this._create_token(c.STRING,e)}return null},b.prototype._allow_regexp_or_xml=function(t){return t.type===c.RESERVED&&u(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===c.END_EXPR&&")"===t.text&&t.opened.previous.type===c.RESERVED&&u(t.opened.previous.text,["if","while","for"])||u(t.type,[c.COMMENT,c.START_EXPR,c.START_BLOCK,c.START,c.END_BLOCK,c.OPERATOR,c.EQUALS,c.EOF,c.SEMICOLON,c.COMMA])},b.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){for(var n=this._input.next(),r=!1,i=!1;this._input.hasNext()&&(r||i||this._input.peek()!==t)&&!this._input.testChar(a.newline);)n+=this._input.peek(),r?r=!1:(r="\\"===this._input.peek(),"["===this._input.peek()?i=!0:"]"===this._input.peek()&&(i=!1)),this._input.next();return this._input.peek()===t&&(n+=this._input.next(),n+=this._input.read(a.identifier)),this._create_token(c.STRING,n)}return null},b.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)){var n="",r=this.__patterns.xml.read_match();if(r){for(var i=r[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),s=0===i.indexOf("{"),A=0;r;){var o=!!r[1],l=r[2];if(!(!!r[r.length-1]||"![CDATA["===l.slice(0,8))&&(l===i||s&&l.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(o?--A:++A),n+=r[0],A<=0)break;r=this.__patterns.xml.read_match()}return r||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(a.allLineBreaks,"\n"),this._create_token(c.STRING,n)}}return null},b.prototype._read_string_recursive=function(t,e,n){var r,i;"'"===t?i=this.__patterns.single_quote:'"'===t?i=this.__patterns.double_quote:"`"===t?i=this.__patterns.template_text:"}"===t&&(i=this.__patterns.template_expression);for(var s=i.read(),A="";this._input.hasNext();){if((A=this._input.next())===t||!e&&a.newline.test(A)){this._input.back();break}"\\"===A&&this._input.hasNext()?("x"===(r=this._input.peek())||"u"===r?this.has_char_escapes=!0:"\r"===r&&"\n"===this._input.peek(1)&&this._input.next(),A+=this._input.next()):n&&("${"===n&&"$"===A&&"{"===this._input.peek()&&(A+=this._input.next()),n===A&&(A+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(A+=this._input.next()))),s+=A+=i.read()}return s},t.exports.Tokenizer=b,t.exports.TOKEN=c,t.exports.positionable_operators=g.slice(),t.exports.line_starters=y.slice()},function(t){var e=RegExp.prototype.hasOwnProperty("sticky");function n(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position<this.__input_length},n.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},n.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},n.prototype.__match=function(t,n){t.lastIndex=n;var r=t.exec(this.__input);return!r||e&&t.sticky||r.index!==n&&(r=null),r},n.prototype.test=function(t,e){return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&!!this.__match(t,e)},n.prototype.testChar=function(t,e){var n=this.peek(e);return t.lastIndex=0,null!==n&&t.test(n)},n.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},n.prototype.read=function(t,e,n){var r,i="";return t&&(r=this.match(t))&&(i+=r[0]),!e||!r&&t||(i+=this.readUntil(e,n)),i},n.prototype.readUntil=function(t,e){var n,r=this.__position;t.lastIndex=this.__position;var i=t.exec(this.__input);return i?(r=i.index,e&&(r+=i[0].length)):r=this.__input_length,n=this.__input.substring(this.__position,r),this.__position=r,n},n.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},n.prototype.get_regexp=function(t,n){var r=null,i="g";return n&&e&&(i="y"),"string"==typeof t&&""!==t?r=new RegExp(t,i):t&&(r=new RegExp(t.source,i)),r},n.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},n.prototype.peekUntilAfter=function(t){var e=this.__position,n=this.readUntilAfter(t);return this.__position=e,n},n.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=n},function(t,e,n){var r=n(8).InputScanner,i=n(3).Token,s=n(10).TokenStream,A=n(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(t,e){this._input=new r(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new A(this._input)};o.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new s,this._reset();for(var e=new i(a.START,""),n=null,r=[],A=new s;e.type!==a.EOF;){for(t=this._get_next_token(e,n);this._is_comment(t);)A.add(t),t=this._get_next_token(e,n);A.isEmpty()||(t.comments_before=A,A=new s),t.parent=n,this._is_opening(t)?(r.push(n),n=t):n&&this._is_closing(t,n)&&(t.opened=n,n.closed=t,n=r.pop(),t.parent=n),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(t,e){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},o.prototype._is_comment=function(t){return!1},o.prototype._is_opening=function(t){return!1},o.prototype._is_closing=function(t,e){return!1},o.prototype._create_token=function(t,e){return new i(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},t.exports.Tokenizer=o,t.exports.TOKEN=a},function(t){function e(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}e.prototype.restart=function(){this.__position=0},e.prototype.isEmpty=function(){return 0===this.__tokens_length},e.prototype.hasNext=function(){return this.__position<this.__tokens_length},e.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},e.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},e.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},t.exports.TokenStream=e},function(t,e,n){var r=n(12).Pattern;function i(t,e){r.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}i.prototype=new r,i.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},i.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(" "===t)this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t},i.prototype.matching=function(t,e){var n=this._create();return n.__set_whitespace_patterns(t,e),n._update(),n},i.prototype._create=function(){return new i(this._input,this)},i.prototype.__split=function(t,e){t.lastIndex=0;for(var n=0,r=[],i=t.exec(e);i;)r.push(e.substring(n,i.index)),n=i.index+i[0].length,i=t.exec(e);return n<e.length?r.push(e.substring(n,e.length)):r.push(""),r},t.exports.WhitespacePattern=i},function(t){function e(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}e.prototype.read=function(){var t=this._input.read(this._starting_pattern);return this._starting_pattern&&!t||(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},e.prototype.read_match=function(){return this._input.match(this._match_pattern)},e.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e},e.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e},e.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e},e.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e},e.prototype._create=function(){return new e(this._input,this)},e.prototype._update=function(){},t.exports.Pattern=e},function(t){function e(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}e.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(t);n;)e[n[1]]=n[2],n=this.__directive_pattern.exec(t);return e},e.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},t.exports.Directives=e},function(t,e,n){var r=n(12).Pattern,i={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function s(t,e){r.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},i),this._excluded=Object.assign({},i),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var n=new r(t);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}s.prototype=new r,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},s.prototype.read_options=function(t){var e=this._create();for(var n in i)e._disabled[n]=-1===t.templating.indexOf(n);return e._update(),e},s.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},s.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},s.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},s.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=(t=(t=t||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=(t=t||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=(t=(t=t||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return t},t.exports.TemplatablePattern=s}],e={};var n=function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,n),s.exports}(0);r=n}();var i=r;void 0===(n=function(){return{js_beautify:i}}.apply(e,[]))||(t.exports=n)}()},32834:function(t){t.exports=function(){"use strict";function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function e(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}function n(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=n(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s={exports:{}};function A(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function a(t){s.exports.defaults=t}s.exports={defaults:A(),getDefaults:A,changeDefaults:a};var o=/[&<>"']/,l=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,h={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},d=function(t){return h[t]};function f(t,e){if(e){if(o.test(t))return t.replace(l,d)}else if(u.test(t))return t.replace(c,d);return t}var p=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function g(t){return t.replace(p,(function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""}))}var m=/(^|[^\[])\^/g;function _(t,e){t=t.source||t,e=e||"";var n={replace:function(e,r){return r=(r=r.source||r).replace(m,"$1"),t=t.replace(e,r),n},getRegex:function(){return new RegExp(t,e)}};return n}var w=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function v(t,e,n){if(t){var r;try{r=decodeURIComponent(g(n)).replace(w,"").toLowerCase()}catch(t){return null}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return null}e&&!y.test(n)&&(n=k(e,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(t){return null}return n}var B={},b=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,C=/^([^:]+:\/*[^/]*)[\s\S]*$/;function k(t,e){B[" "+t]||(b.test(t)?B[" "+t]=t+"/":B[" "+t]=S(t,"/",!0));var n=-1===(t=B[" "+t]).indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(E,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(C,"$1")+e:t+e}function F(t){for(var e,n,r=1;r<arguments.length;r++)for(n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function T(t,e){var n=t.replace(/\|/g,(function(t,e,n){for(var r=!1,i=e;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/),r=0;if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function S(t,e,n){var r=t.length;if(0===r)return"";for(var i=0;i<r;){var s=t.charAt(r-i-1);if(s!==e||n){if(s===e||!n)break;i++}else i++}return t.substr(0,r-i)}function x(t,e){if(-1===t.indexOf(e[1]))return-1;for(var n=t.length,r=0,i=0;i<n;i++)if("\\"===t[i])i++;else if(t[i]===e[0])r++;else if(t[i]===e[1]&&--r<0)return i;return-1}function I(t){t&&t.sanitize&&!t.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function D(t,e){if(e<1)return"";for(var n="";e>1;)1&e&&(n+=t),e>>=1,t+=t;return n+t}var U={escape:f,unescape:g,edit:_,cleanUrl:v,resolveUrl:k,noopTest:{exec:function(){}},merge:F,splitCells:T,rtrim:S,findClosingBracket:x,checkSanitizeDeprecation:I,repeatString:D},L=s.exports.defaults,R=U.rtrim,Q=U.splitCells,O=U.escape,P=U.findClosingBracket;function M(t,e,n){var r=e.href,i=e.title?O(e.title):null,s=t[1].replace(/\\([\[\]])/g,"$1");return"!"!==t[0].charAt(0)?{type:"link",raw:n,href:r,title:i,text:s}:{type:"image",raw:n,href:r,title:i,text:O(s)}}function N(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var r=n[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:e[0].length>=r.length?t.slice(r.length):t})).join("\n")}var H=function(){function t(t){this.options=t||L}var e=t.prototype;return e.space=function(t){var e=this.rules.block.newline.exec(t);if(e)return e[0].length>1?{type:"space",raw:e[0]}:{raw:"\n"}},e.code=function(t){var e=this.rules.block.code.exec(t);if(e){var n=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:R(n,"\n")}}},e.fences=function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],r=N(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim():e[2],text:r}}},e.heading=function(t){var e=this.rules.block.heading.exec(t);if(e){var n=e[2].trim();if(/#$/.test(n)){var r=R(n,"#");this.options.pedantic?n=r.trim():r&&!/ $/.test(r)||(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n}}},e.nptable=function(t){var e=this.rules.block.nptable.exec(t);if(e){var n={type:"table",header:Q(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[],raw:e[0]};if(n.header.length===n.align.length){var r,i=n.align.length;for(r=0;r<i;r++)/^ *-+: *$/.test(n.align[r])?n.align[r]="right":/^ *:-+: *$/.test(n.align[r])?n.align[r]="center":/^ *:-+ *$/.test(n.align[r])?n.align[r]="left":n.align[r]=null;for(i=n.cells.length,r=0;r<i;r++)n.cells[r]=Q(n.cells[r],n.header.length);return n}}},e.hr=function(t){var e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:e[0]}},e.blockquote=function(t){var e=this.rules.block.blockquote.exec(t);if(e){var n=e[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:e[0],text:n}}},e.list=function(t){var e=this.rules.block.list.exec(t);if(e){var n,r,i,s,A,a,o,l,u,c=e[0],h=e[2],d=h.length>1,f={type:"list",raw:c,ordered:d,start:d?+h.slice(0,-1):"",loose:!1,items:[]},p=e[0].match(this.rules.block.item),g=!1,m=p.length;i=this.rules.block.listItemStart.exec(p[0]);for(var _=0;_<m;_++){if(c=n=p[_],this.options.pedantic||(u=n.match(new RegExp("\\n\\s*\\n {0,"+(i[0].length-1)+"}\\S")))&&(A=n.length-u.index+p.slice(_+1).join("\n").length,f.raw=f.raw.substring(0,f.raw.length-A),c=n=n.substring(0,u.index),m=_+1),_!==m-1){if(s=this.rules.block.listItemStart.exec(p[_+1]),this.options.pedantic?s[1].length>i[1].length:s[1].length>=i[0].length||s[1].length>3){p.splice(_,2,p[_]+(!this.options.pedantic&&s[1].length<i[0].length&&!p[_].match(/\n$/)?"":"\n")+p[_+1]),_--,m--;continue}(!this.options.pedantic||this.options.smartLists?s[2][s[2].length-1]!==h[h.length-1]:d===(1===s[2].length))&&(A=p.slice(_+1).join("\n").length,f.raw=f.raw.substring(0,f.raw.length-A),_=m-1),i=s}r=n.length,~(n=n.replace(/^ *([*+-]|\d+[.)]) ?/,"")).indexOf("\n ")&&(r-=n.length,n=this.options.pedantic?n.replace(/^ {1,4}/gm,""):n.replace(new RegExp("^ {1,"+r+"}","gm"),"")),n=R(n,"\n"),_!==m-1&&(c+="\n"),a=g||/\n\n(?!\s*$)/.test(c),_!==m-1&&(g="\n\n"===c.slice(-2),a||(a=g)),a&&(f.loose=!0),this.options.gfm&&(l=void 0,(o=/^\[[ xX]\] /.test(n))&&(l=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,""))),f.items.push({type:"list_item",raw:c,task:o,checked:l,loose:a,text:n})}return f}},e.html=function(t){var e=this.rules.block.html.exec(t);if(e)return{type:this.options.sanitize?"paragraph":"html",raw:e[0],pre:!this.options.sanitizer&&("pre"===e[1]||"script"===e[1]||"style"===e[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):O(e[0]):e[0]}},e.def=function(t){var e=this.rules.block.def.exec(t);if(e)return e[3]&&(e[3]=e[3].substring(1,e[3].length-1)),{type:"def",tag:e[1].toLowerCase().replace(/\s+/g," "),raw:e[0],href:e[2],title:e[3]}},e.table=function(t){var e=this.rules.block.table.exec(t);if(e){var n={type:"table",header:Q(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=e[0];var r,i=n.align.length;for(r=0;r<i;r++)/^ *-+: *$/.test(n.align[r])?n.align[r]="right":/^ *:-+: *$/.test(n.align[r])?n.align[r]="center":/^ *:-+ *$/.test(n.align[r])?n.align[r]="left":n.align[r]=null;for(i=n.cells.length,r=0;r<i;r++)n.cells[r]=Q(n.cells[r].replace(/^ *\| *| *\| *$/g,""),n.header.length);return n}}},e.lheading=function(t){var e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1]}},e.paragraph=function(t){var e=this.rules.block.paragraph.exec(t);if(e)return{type:"paragraph",raw:e[0],text:"\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1]}},e.text=function(t){var e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0]}},e.escape=function(t){var e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:O(e[1])}},e.tag=function(t,e,n){var r=this.rules.inline.tag.exec(t);if(r)return!e&&/^<a /i.test(r[0])?e=!0:e&&/^<\/a>/i.test(r[0])&&(e=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:e,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):O(r[0]):r[0]}},e.link=function(t){var e=this.rules.inline.link.exec(t);if(e){var n=e[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;var r=R(n.slice(0,-1),"\\");if((n.length-r.length)%2==0)return}else{var i=P(e[2],"()");if(i>-1){var s=(0===e[0].indexOf("!")?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,s).trim(),e[3]=""}}var A=e[2],a="";if(this.options.pedantic){var o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(A);o&&(A=o[1],a=o[3])}else a=e[3]?e[3].slice(1,-1):"";return A=A.trim(),/^</.test(A)&&(A=this.options.pedantic&&!/>$/.test(n)?A.slice(1):A.slice(1,-1)),M(e,{href:A?A.replace(this.rules.inline._escapes,"$1"):A,title:a?a.replace(this.rules.inline._escapes,"$1"):a},e[0])}},e.reflink=function(t,e){var n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){var r=(n[2]||n[1]).replace(/\s+/g," ");if(!(r=e[r.toLowerCase()])||!r.href){var i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return M(n,r,n[0])}},e.emStrong=function(t,e,n){void 0===n&&(n="");var r=this.rules.inline.emStrong.lDelim.exec(t);if(r&&(!r[3]||!n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var i=r[1]||r[2]||"";if(!i||i&&(""===n||this.rules.inline.punctuation.exec(n))){var s,A,a=r[0].length-1,o=a,l=0,u="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+a);null!=(r=u.exec(e));)if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6])if(A=s.length,r[3]||r[4])o+=A;else if(!((r[5]||r[6])&&a%3)||(a+A)%3){if(!((o-=A)>0))return A=Math.min(A,A+o+l),Math.min(a,A)%2?{type:"em",raw:t.slice(0,a+r.index+A+1),text:t.slice(1,a+r.index+A)}:{type:"strong",raw:t.slice(0,a+r.index+A+1),text:t.slice(2,a+r.index+A-1)}}else l+=A}}},e.codespan=function(t){var e=this.rules.inline.code.exec(t);if(e){var n=e[2].replace(/\n/g," "),r=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return r&&i&&(n=n.substring(1,n.length-1)),n=O(n,!0),{type:"codespan",raw:e[0],text:n}}},e.br=function(t){var e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}},e.del=function(t){var e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2]}},e.autolink=function(t,e){var n,r,i=this.rules.inline.autolink.exec(t);if(i)return r="@"===i[2]?"mailto:"+(n=O(this.options.mangle?e(i[1]):i[1])):n=O(i[1]),{type:"link",raw:i[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}},e.url=function(t,e){var n;if(n=this.rules.inline.url.exec(t)){var r,i;if("@"===n[2])i="mailto:"+(r=O(this.options.mangle?e(n[0]):n[0]));else{var s;do{s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(s!==n[0]);r=O(n[0]),i="www."===n[1]?"http://"+r:r}return{type:"link",raw:n[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}},e.inlineText=function(t,e,n){var r,i=this.rules.inline.text.exec(t);if(i)return r=e?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):O(i[0]):i[0]:O(this.options.smartypants?n(i[0]):i[0]),{type:"text",raw:i[0],text:r}},t}(),K=U.noopTest,$=U.edit,G=U.merge,V={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:K,table:K,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};V.def=$(V.def).replace("label",V._label).replace("title",V._title).getRegex(),V.bullet=/(?:[*+-]|\d{1,9}[.)])/,V.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,V.item=$(V.item,"gm").replace(/bull/g,V.bullet).getRegex(),V.listItemStart=$(/^( *)(bull) */).replace("bull",V.bullet).getRegex(),V.list=$(V.list).replace(/bull/g,V.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+V.def.source+")").getRegex(),V._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",V._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,V.html=$(V.html,"i").replace("comment",V._comment).replace("tag",V._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),V.paragraph=$(V._paragraph).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",V._tag).getRegex(),V.blockquote=$(V.blockquote).replace("paragraph",V.paragraph).getRegex(),V.normal=G({},V),V.gfm=G({},V.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),V.gfm.nptable=$(V.gfm.nptable).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",V._tag).getRegex(),V.gfm.table=$(V.gfm.table).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",V._tag).getRegex(),V.pedantic=G({},V.normal,{html:$("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",V._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:K,paragraph:$(V.normal._paragraph).replace("hr",V.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",V.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var j={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:K,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:K,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};j.punctuation=$(j.punctuation).replace(/punctuation/g,j._punctuation).getRegex(),j.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,j.escapedEmSt=/\\\*|\\_/g,j._comment=$(V._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),j.emStrong.lDelim=$(j.emStrong.lDelim).replace(/punct/g,j._punctuation).getRegex(),j.emStrong.rDelimAst=$(j.emStrong.rDelimAst,"g").replace(/punct/g,j._punctuation).getRegex(),j.emStrong.rDelimUnd=$(j.emStrong.rDelimUnd,"g").replace(/punct/g,j._punctuation).getRegex(),j._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,j._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,j._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,j.autolink=$(j.autolink).replace("scheme",j._scheme).replace("email",j._email).getRegex(),j._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,j.tag=$(j.tag).replace("comment",j._comment).replace("attribute",j._attribute).getRegex(),j._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,j._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,j._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,j.link=$(j.link).replace("label",j._label).replace("href",j._href).replace("title",j._title).getRegex(),j.reflink=$(j.reflink).replace("label",j._label).getRegex(),j.reflinkSearch=$(j.reflinkSearch,"g").replace("reflink",j.reflink).replace("nolink",j.nolink).getRegex(),j.normal=G({},j),j.pedantic=G({},j.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:$(/^!?\[(label)\]\((.*?)\)/).replace("label",j._label).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",j._label).getRegex()}),j.gfm=G({},j.normal,{escape:$(j.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),j.gfm.url=$(j.gfm.url,"i").replace("email",j.gfm._extended_email).getRegex(),j.breaks=G({},j.gfm,{br:$(j.br).replace("{2,}","*").getRegex(),text:$(j.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Z={block:V,inline:j},W=H,z=s.exports.defaults,Y=Z.block,X=Z.inline,q=U.repeatString;function J(t){return t.replace(/---/g,"—").replace(/--/g,"").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1").replace(/'/g,"").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function tt(t){var e,n,r="",i=t.length;for(e=0;e<i;e++)n=t.charCodeAt(e),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}var et=function(){function t(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||z,this.options.tokenizer=this.options.tokenizer||new W,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var e={block:Y.normal,inline:X.normal};this.options.pedantic?(e.block=Y.pedantic,e.inline=X.pedantic):this.options.gfm&&(e.block=Y.gfm,this.options.breaks?e.inline=X.breaks:e.inline=X.gfm),this.tokenizer.rules=e}t.lex=function(e,n){return new t(n).lex(e)},t.lexInline=function(e,n){return new t(n).inlineTokens(e)};var n=t.prototype;return n.lex=function(t){return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(t,this.tokens,!0),this.inline(this.tokens),this.tokens},n.blockTokens=function(t,e,n){var r,i,s,A;for(void 0===e&&(e=[]),void 0===n&&(n=!0),this.options.pedantic&&(t=t.replace(/^ +$/gm,""));t;)if(r=this.tokenizer.space(t))t=t.substring(r.raw.length),r.type&&e.push(r);else if(r=this.tokenizer.code(t))t=t.substring(r.raw.length),(A=e[e.length-1])&&"paragraph"===A.type?(A.raw+="\n"+r.raw,A.text+="\n"+r.text):e.push(r);else if(r=this.tokenizer.fences(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.heading(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.nptable(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.hr(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.blockquote(t))t=t.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],n),e.push(r);else if(r=this.tokenizer.list(t)){for(t=t.substring(r.raw.length),s=r.items.length,i=0;i<s;i++)r.items[i].tokens=this.blockTokens(r.items[i].text,[],!1);e.push(r)}else if(r=this.tokenizer.html(t))t=t.substring(r.raw.length),e.push(r);else if(n&&(r=this.tokenizer.def(t)))t=t.substring(r.raw.length),this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});else if(r=this.tokenizer.table(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.lheading(t))t=t.substring(r.raw.length),e.push(r);else if(n&&(r=this.tokenizer.paragraph(t)))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.text(t))t=t.substring(r.raw.length),(A=e[e.length-1])&&"text"===A.type?(A.raw+="\n"+r.raw,A.text+="\n"+r.text):e.push(r);else if(t){var a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}throw new Error(a)}return e},n.inline=function(t){var e,n,r,i,s,A,a=t.length;for(e=0;e<a;e++)switch((A=t[e]).type){case"paragraph":case"text":case"heading":A.tokens=[],this.inlineTokens(A.text,A.tokens);break;case"table":for(A.tokens={header:[],cells:[]},i=A.header.length,n=0;n<i;n++)A.tokens.header[n]=[],this.inlineTokens(A.header[n],A.tokens.header[n]);for(i=A.cells.length,n=0;n<i;n++)for(s=A.cells[n],A.tokens.cells[n]=[],r=0;r<s.length;r++)A.tokens.cells[n][r]=[],this.inlineTokens(s[r],A.tokens.cells[n][r]);break;case"blockquote":this.inline(A.tokens);break;case"list":for(i=A.items.length,n=0;n<i;n++)this.inline(A.items[n].tokens)}return t},n.inlineTokens=function(t,e,n,r){var i,s;void 0===e&&(e=[]),void 0===n&&(n=!1),void 0===r&&(r=!1);var A,a,o,l=t;if(this.tokens.links){var u=Object.keys(this.tokens.links);if(u.length>0)for(;null!=(A=this.tokenizer.rules.inline.reflinkSearch.exec(l));)u.includes(A[0].slice(A[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,A.index)+"["+q("a",A[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(A=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,A.index)+"["+q("a",A[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(A=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,A.index)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;t;)if(a||(o=""),a=!1,i=this.tokenizer.escape(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.tag(t,n,r)){t=t.substring(i.raw.length),n=i.inLink,r=i.inRawBlock;var c=e[e.length-1];c&&"text"===i.type&&"text"===c.type?(c.raw+=i.raw,c.text+=i.text):e.push(i)}else if(i=this.tokenizer.link(t))t=t.substring(i.raw.length),"link"===i.type&&(i.tokens=this.inlineTokens(i.text,[],!0,r)),e.push(i);else if(i=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(i.raw.length);var h=e[e.length-1];"link"===i.type?(i.tokens=this.inlineTokens(i.text,[],!0,r),e.push(i)):h&&"text"===i.type&&"text"===h.type?(h.raw+=i.raw,h.text+=i.text):e.push(i)}else if(i=this.tokenizer.emStrong(t,l,o))t=t.substring(i.raw.length),i.tokens=this.inlineTokens(i.text,[],n,r),e.push(i);else if(i=this.tokenizer.codespan(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.br(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.del(t))t=t.substring(i.raw.length),i.tokens=this.inlineTokens(i.text,[],n,r),e.push(i);else if(i=this.tokenizer.autolink(t,tt))t=t.substring(i.raw.length),e.push(i);else if(n||!(i=this.tokenizer.url(t,tt))){if(i=this.tokenizer.inlineText(t,r,J))t=t.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(o=i.raw.slice(-1)),a=!0,(s=e[e.length-1])&&"text"===s.type?(s.raw+=i.raw,s.text+=i.text):e.push(i);else if(t){var d="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(d);break}throw new Error(d)}}else t=t.substring(i.raw.length),e.push(i);return e},e(t,null,[{key:"rules",get:function(){return{block:Y,inline:X}}}]),t}(),nt=s.exports.defaults,rt=U.cleanUrl,it=U.escape,st=function(){function t(t){this.options=t||nt}var e=t.prototype;return e.code=function(t,e,n){var r=(e||"").match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(t,r);null!=i&&i!==t&&(n=!0,t=i)}return t=t.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+it(r,!0)+'">'+(n?t:it(t,!0))+"</code></pre>\n":"<pre><code>"+(n?t:it(t,!0))+"</code></pre>\n"},e.blockquote=function(t){return"<blockquote>\n"+t+"</blockquote>\n"},e.html=function(t){return t},e.heading=function(t,e,n,r){return this.options.headerIds?"<h"+e+' id="'+this.options.headerPrefix+r.slug(n)+'">'+t+"</h"+e+">\n":"<h"+e+">"+t+"</h"+e+">\n"},e.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},e.list=function(t,e,n){var r=e?"ol":"ul";return"<"+r+(e&&1!==n?' start="'+n+'"':"")+">\n"+t+"</"+r+">\n"},e.listitem=function(t){return"<li>"+t+"</li>\n"},e.checkbox=function(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},e.paragraph=function(t){return"<p>"+t+"</p>\n"},e.table=function(t,e){return e&&(e="<tbody>"+e+"</tbody>"),"<table>\n<thead>\n"+t+"</thead>\n"+e+"</table>\n"},e.tablerow=function(t){return"<tr>\n"+t+"</tr>\n"},e.tablecell=function(t,e){var n=e.header?"th":"td";return(e.align?"<"+n+' align="'+e.align+'">':"<"+n+">")+t+"</"+n+">\n"},e.strong=function(t){return"<strong>"+t+"</strong>"},e.em=function(t){return"<em>"+t+"</em>"},e.codespan=function(t){return"<code>"+t+"</code>"},e.br=function(){return this.options.xhtml?"<br/>":"<br>"},e.del=function(t){return"<del>"+t+"</del>"},e.link=function(t,e,n){if(null===(t=rt(this.options.sanitize,this.options.baseUrl,t)))return n;var r='<a href="'+it(t)+'"';return e&&(r+=' title="'+e+'"'),r+=">"+n+"</a>"},e.image=function(t,e,n){if(null===(t=rt(this.options.sanitize,this.options.baseUrl,t)))return n;var r='<img src="'+t+'" alt="'+n+'"';return e&&(r+=' title="'+e+'"'),r+=this.options.xhtml?"/>":">"},e.text=function(t){return t},t}(),At=function(){function t(){}var e=t.prototype;return e.strong=function(t){return t},e.em=function(t){return t},e.codespan=function(t){return t},e.del=function(t){return t},e.html=function(t){return t},e.text=function(t){return t},e.link=function(t,e,n){return""+n},e.image=function(t,e,n){return""+n},e.br=function(){return""},t}(),at=function(){function t(){this.seen={}}var e=t.prototype;return e.serialize=function(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},e.getNextSafeSlug=function(t,e){var n=t,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[t];do{n=t+"-"+ ++r}while(this.seen.hasOwnProperty(n))}return e||(this.seen[t]=r,this.seen[n]=0),n},e.slug=function(t,e){void 0===e&&(e={});var n=this.serialize(t);return this.getNextSafeSlug(n,e.dryrun)},t}(),ot=st,lt=At,ut=at,ct=s.exports.defaults,ht=U.unescape,dt=et,ft=function(){function t(t){this.options=t||ct,this.options.renderer=this.options.renderer||new ot,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new lt,this.slugger=new ut}t.parse=function(e,n){return new t(n).parse(e)},t.parseInline=function(e,n){return new t(n).parseInline(e)};var e=t.prototype;return e.parse=function(t,e){void 0===e&&(e=!0);var n,r,i,s,A,a,o,l,u,c,h,d,f,p,g,m,_,w,y="",v=t.length;for(n=0;n<v;n++)switch((c=t[n]).type){case"space":continue;case"hr":y+=this.renderer.hr();continue;case"heading":y+=this.renderer.heading(this.parseInline(c.tokens),c.depth,ht(this.parseInline(c.tokens,this.textRenderer)),this.slugger);continue;case"code":y+=this.renderer.code(c.text,c.lang,c.escaped);continue;case"table":for(l="",o="",s=c.header.length,r=0;r<s;r++)o+=this.renderer.tablecell(this.parseInline(c.tokens.header[r]),{header:!0,align:c.align[r]});for(l+=this.renderer.tablerow(o),u="",s=c.cells.length,r=0;r<s;r++){for(o="",A=(a=c.tokens.cells[r]).length,i=0;i<A;i++)o+=this.renderer.tablecell(this.parseInline(a[i]),{header:!1,align:c.align[i]});u+=this.renderer.tablerow(o)}y+=this.renderer.table(l,u);continue;case"blockquote":u=this.parse(c.tokens),y+=this.renderer.blockquote(u);continue;case"list":for(h=c.ordered,d=c.start,f=c.loose,s=c.items.length,u="",r=0;r<s;r++)m=(g=c.items[r]).checked,_=g.task,p="",g.task&&(w=this.renderer.checkbox(m),f?g.tokens.length>0&&"text"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):p+=w),p+=this.parse(g.tokens,f),u+=this.renderer.listitem(p,_,m);y+=this.renderer.list(u,h,d);continue;case"html":y+=this.renderer.html(c.text);continue;case"paragraph":y+=this.renderer.paragraph(this.parseInline(c.tokens));continue;case"text":for(u=c.tokens?this.parseInline(c.tokens):c.text;n+1<v&&"text"===t[n+1].type;)u+="\n"+((c=t[++n]).tokens?this.parseInline(c.tokens):c.text);y+=e?this.renderer.paragraph(u):u;continue;default:var B='Token with "'+c.type+'" type was not found.';if(this.options.silent)return void console.error(B);throw new Error(B)}return y},e.parseInline=function(t,e){e=e||this.renderer;var n,r,i="",s=t.length;for(n=0;n<s;n++)switch((r=t[n]).type){case"escape":case"text":i+=e.text(r.text);break;case"html":i+=e.html(r.text);break;case"link":i+=e.link(r.href,r.title,this.parseInline(r.tokens,e));break;case"image":i+=e.image(r.href,r.title,r.text);break;case"strong":i+=e.strong(this.parseInline(r.tokens,e));break;case"em":i+=e.em(this.parseInline(r.tokens,e));break;case"codespan":i+=e.codespan(r.text);break;case"br":i+=e.br();break;case"del":i+=e.del(this.parseInline(r.tokens,e));break;default:var A='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(A);throw new Error(A)}return i},t}(),pt=H,gt=st,mt=At,_t=at,wt=U.merge,yt=U.checkSanitizeDeprecation,vt=U.escape,Bt=s.exports.getDefaults,bt=s.exports.changeDefaults,Et=s.exports.defaults;function Ct(t,e,n){if(null==t)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof t)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");if("function"==typeof e&&(n=e,e=null),e=wt({},Ct.defaults,e||{}),yt(e),n){var r,i=e.highlight;try{r=dt.lex(t,e)}catch(t){return n(t)}var s=function(t){var s;if(!t)try{e.walkTokens&&Ct.walkTokens(r,e.walkTokens),s=ft.parse(r,e)}catch(e){t=e}return e.highlight=i,t?n(t):n(null,s)};if(!i||i.length<3)return s();if(delete e.highlight,!r.length)return s();var A=0;return Ct.walkTokens(r,(function(t){"code"===t.type&&(A++,setTimeout((function(){i(t.text,t.lang,(function(e,n){if(e)return s(e);null!=n&&n!==t.text&&(t.text=n,t.escaped=!0),0==--A&&s()}))}),0))})),void(0===A&&s())}try{var a=dt.lex(t,e);return e.walkTokens&&Ct.walkTokens(a,e.walkTokens),ft.parse(a,e)}catch(t){if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",e.silent)return"<p>An error occurred:</p><pre>"+vt(t.message+"",!0)+"</pre>";throw t}}return Ct.options=Ct.setOptions=function(t){return wt(Ct.defaults,t),bt(Ct.defaults),Ct},Ct.getDefaults=Bt,Ct.defaults=Et,Ct.use=function(t){var e=wt({},t);if(t.renderer&&function(){var n=Ct.defaults.renderer||new gt,r=function(e){var r=n[e];n[e]=function(){for(var i=arguments.length,s=new Array(i),A=0;A<i;A++)s[A]=arguments[A];var a=t.renderer[e].apply(n,s);return!1===a&&(a=r.apply(n,s)),a}};for(var i in t.renderer)r(i);e.renderer=n}(),t.tokenizer&&function(){var n=Ct.defaults.tokenizer||new pt,r=function(e){var r=n[e];n[e]=function(){for(var i=arguments.length,s=new Array(i),A=0;A<i;A++)s[A]=arguments[A];var a=t.tokenizer[e].apply(n,s);return!1===a&&(a=r.apply(n,s)),a}};for(var i in t.tokenizer)r(i);e.tokenizer=n}(),t.walkTokens){var n=Ct.defaults.walkTokens;e.walkTokens=function(e){t.walkTokens(e),n&&n(e)}}Ct.setOptions(e)},Ct.walkTokens=function(t,e){for(var n,r=i(t);!(n=r()).done;){var s=n.value;switch(e(s),s.type){case"table":for(var A,a=i(s.tokens.header);!(A=a()).done;){var o=A.value;Ct.walkTokens(o,e)}for(var l,u=i(s.tokens.cells);!(l=u()).done;)for(var c,h=i(l.value);!(c=h()).done;){var d=c.value;Ct.walkTokens(d,e)}break;case"list":Ct.walkTokens(s.items,e);break;default:s.tokens&&Ct.walkTokens(s.tokens,e)}}},Ct.parseInline=function(t,e){if(null==t)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof t)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");e=wt({},Ct.defaults,e||{}),yt(e);try{var n=dt.lexInline(t,e);return e.walkTokens&&Ct.walkTokens(n,e.walkTokens),ft.parseInline(n,e)}catch(t){if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",e.silent)return"<p>An error occurred:</p><pre>"+vt(t.message+"",!0)+"</pre>";throw t}},Ct.Parser=ft,Ct.parser=ft.parse,Ct.Renderer=gt,Ct.TextRenderer=mt,Ct.Lexer=dt,Ct.lexer=dt.lex,Ct.Tokenizer=pt,Ct.Slugger=_t,Ct.parse=Ct,Ct}()},11690:function(t){const e=/[&<>"']/,n=/[&<>"']/g,r=/[<>"']|&(?!#?\w+;)/,i=/[<>"']|&(?!#?\w+;)/g,s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},A=t=>s[t];const a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function o(t){return t.replace(a,((t,e)=>"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""))}const l=/(^|[^\[])\^/g;const u=/[^\w:]/g,c=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const h={},d=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,p=/^([^:]+:\/*[^/]*)[\s\S]*$/;function g(t,e){h[" "+t]||(d.test(t)?h[" "+t]=t+"/":h[" "+t]=m(t,"/",!0));const n=-1===(t=h[" "+t]).indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(f,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(p,"$1")+e:t+e}function m(t,e,n){const r=t.length;if(0===r)return"";let i=0;for(;i<r;){const s=t.charAt(r-i-1);if(s!==e||n){if(s===e||!n)break;i++}else i++}return t.substr(0,r-i)}t.exports={escape:function(t,s){if(s){if(e.test(t))return t.replace(n,A)}else if(r.test(t))return t.replace(i,A);return t},unescape:o,edit:function(t,e){t=t.source||t,e=e||"";const n={replace:(e,r)=>(r=(r=r.source||r).replace(l,"$1"),t=t.replace(e,r),n),getRegex:()=>new RegExp(t,e)};return n},cleanUrl:function(t,e,n){if(t){let t;try{t=decodeURIComponent(o(n)).replace(u,"").toLowerCase()}catch(t){return null}if(0===t.indexOf("javascript:")||0===t.indexOf("vbscript:")||0===t.indexOf("data:"))return null}e&&!c.test(n)&&(n=g(e,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(t){return null}return n},resolveUrl:g,noopTest:{exec:function(){}},merge:function(t){let e,n,r=1;for(;r<arguments.length;r++)for(n in e=arguments[r],e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},splitCells:function(t,e){const n=t.replace(/\|/g,((t,e,n)=>{let r=!1,i=e;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n},rtrim:m,findClosingBracket:function(t,e){if(-1===t.indexOf(e[1]))return-1;const n=t.length;let r=0,i=0;for(;i<n;i++)if("\\"===t[i])i++;else if(t[i]===e[0])r++;else if(t[i]===e[1]&&(r--,r<0))return i;return-1},checkSanitizeDeprecation:function(t){t&&t.sanitize&&!t.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")},repeatString:function(t,e){if(e<1)return"";let n="";for(;e>1;)1&e&&(n+=t),e>>=1,t+=t;return n+t}}},75918:function(t,e,n){"use strict";n.d(e,{Wi:function(){return o},Z0:function(){return l},aU:function(){return a},eZ:function(){return c},wY:function(){return u}});var r=n(4348),i=n(69323),s=n(13268),A=function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function A(t){try{o(r.next(t))}catch(t){s(t)}}function a(t){try{o(r.throw(t))}catch(t){s(t)}}function o(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(A,a)}o((r=r.apply(t,e||[])).next())}))};class a extends i.JT{constructor(t,e="",n="",i=!0,s){super(),this._onDidChange=this._register(new r.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=t,this._label=e,this._cssClass=n,this._enabled=i,this._actionCallback=s}get id(){return this._id}get label(){return this._label}set label(t){this._setLabel(t)}_setLabel(t){this._label!==t&&(this._label=t,this._onDidChange.fire({label:t}))}get tooltip(){return this._tooltip||""}set tooltip(t){this._setTooltip(t)}_setTooltip(t){this._tooltip!==t&&(this._tooltip=t,this._onDidChange.fire({tooltip:t}))}get class(){return this._cssClass}set class(t){this._setClass(t)}_setClass(t){this._cssClass!==t&&(this._cssClass=t,this._onDidChange.fire({class:t}))}get enabled(){return this._enabled}set enabled(t){this._setEnabled(t)}_setEnabled(t){this._enabled!==t&&(this._enabled=t,this._onDidChange.fire({enabled:t}))}get checked(){return this._checked}set checked(t){this._setChecked(t)}_setChecked(t){this._checked!==t&&(this._checked=t,this._onDidChange.fire({checked:t}))}run(t,e){return A(this,void 0,void 0,(function*(){this._actionCallback&&(yield this._actionCallback(t))}))}}class o extends i.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new r.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new r.Q5),this.onDidRun=this._onDidRun.event}run(t,e){return A(this,void 0,void 0,(function*(){if(!t.enabled)return;let n;this._onBeforeRun.fire({action:t});try{yield this.runAction(t,e)}catch(t){n=t}this._onDidRun.fire({action:t,error:n})}))}runAction(t,e){return A(this,void 0,void 0,(function*(){yield t.run(e)}))}}class l extends a{constructor(t){super(l.ID,t,t?"separator text":"separator"),this.checked=!1,this.enabled=!1}}l.ID="vs.actions.separator";class u{constructor(t,e,n,r){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=t,this.label=e,this.class=r,this._actions=n}get actions(){return this._actions}dispose(){}run(){return A(this,void 0,void 0,(function*(){}))}}class c extends a{constructor(){super(c.ID,s.N("submenu.empty","(empty)"),void 0,!1)}}c.ID="vs.actions.empty"},76068:function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}n.d(e,{ok:function(){return r}})},52615:function(t,e,n){"use strict";n.d(e,{CM:function(){return A},JL:function(){return a},dT:function(){return l},fK:function(){return s},lA:function(){return o}});var r=n(4348);const i=new class{constructor(){this._icons=new Map,this._onDidRegister=new r.Q5}add(t){const e=this._icons.get(t.id);e?t.description?e.description=t.description:console.error(`Duplicate registration of codicon ${t.id}`):(this._icons.set(t.id,t),this._onDidRegister.fire(t))}get(t){return this._icons.get(t)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}},s=i;function A(t,e){return new o(t,e)}function a(t){return t?t.replace(/\$\((.*?)\)/g,((t,e)=>` ${e} `)).trim():""}class o{constructor(t,e,n){this.id=t,this.definition=e,this.description=n,i.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var l;!function(t){t.iconNameSegment="[A-Za-z0-9]+",t.iconNameExpression="[A-Za-z0-9\\-]+",t.iconModifierExpression="~[A-Za-z]+";const e=new RegExp(`^(${t.iconNameExpression})(${t.iconModifierExpression})?$`);function n(t){if(t instanceof o)return["codicon","codicon-"+t.id];const r=e.exec(t.id);if(!r)return n(o.error);let[,i,s]=r;const A=["codicon","codicon-"+i];return s&&A.push("codicon-modifier-"+s.substr(1)),A}t.asClassNameArray=n,t.asClassName=function(t){return n(t).join(" ")},t.asCSSSelector=function(t){return"."+n(t).join(".")}}(l||(l={})),function(t){t.add=new t("add",{fontCharacter:"\\ea60"}),t.plus=new t("plus",t.add.definition),t.gistNew=new t("gist-new",t.add.definition),t.repoCreate=new t("repo-create",t.add.definition),t.lightbulb=new t("lightbulb",{fontCharacter:"\\ea61"}),t.lightBulb=new t("light-bulb",{fontCharacter:"\\ea61"}),t.repo=new t("repo",{fontCharacter:"\\ea62"}),t.repoDelete=new t("repo-delete",{fontCharacter:"\\ea62"}),t.gistFork=new t("gist-fork",{fontCharacter:"\\ea63"}),t.repoForked=new t("repo-forked",{fontCharacter:"\\ea63"}),t.gitPullRequest=new t("git-pull-request",{fontCharacter:"\\ea64"}),t.gitPullRequestAbandoned=new t("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),t.recordKeys=new t("record-keys",{fontCharacter:"\\ea65"}),t.keyboard=new t("keyboard",{fontCharacter:"\\ea65"}),t.tag=new t("tag",{fontCharacter:"\\ea66"}),t.tagAdd=new t("tag-add",{fontCharacter:"\\ea66"}),t.tagRemove=new t("tag-remove",{fontCharacter:"\\ea66"}),t.person=new t("person",{fontCharacter:"\\ea67"}),t.personFollow=new t("person-follow",{fontCharacter:"\\ea67"}),t.personOutline=new t("person-outline",{fontCharacter:"\\ea67"}),t.personFilled=new t("person-filled",{fontCharacter:"\\ea67"}),t.gitBranch=new t("git-branch",{fontCharacter:"\\ea68"}),t.gitBranchCreate=new t("git-branch-create",{fontCharacter:"\\ea68"}),t.gitBranchDelete=new t("git-branch-delete",{fontCharacter:"\\ea68"}),t.sourceControl=new t("source-control",{fontCharacter:"\\ea68"}),t.mirror=new t("mirror",{fontCharacter:"\\ea69"}),t.mirrorPublic=new t("mirror-public",{fontCharacter:"\\ea69"}),t.star=new t("star",{fontCharacter:"\\ea6a"}),t.starAdd=new t("star-add",{fontCharacter:"\\ea6a"}),t.starDelete=new t("star-delete",{fontCharacter:"\\ea6a"}),t.starEmpty=new t("star-empty",{fontCharacter:"\\ea6a"}),t.comment=new t("comment",{fontCharacter:"\\ea6b"}),t.commentAdd=new t("comment-add",{fontCharacter:"\\ea6b"}),t.alert=new t("alert",{fontCharacter:"\\ea6c"}),t.warning=new t("warning",{fontCharacter:"\\ea6c"}),t.search=new t("search",{fontCharacter:"\\ea6d"}),t.searchSave=new t("search-save",{fontCharacter:"\\ea6d"}),t.logOut=new t("log-out",{fontCharacter:"\\ea6e"}),t.signOut=new t("sign-out",{fontCharacter:"\\ea6e"}),t.logIn=new t("log-in",{fontCharacter:"\\ea6f"}),t.signIn=new t("sign-in",{fontCharacter:"\\ea6f"}),t.eye=new t("eye",{fontCharacter:"\\ea70"}),t.eyeUnwatch=new t("eye-unwatch",{fontCharacter:"\\ea70"}),t.eyeWatch=new t("eye-watch",{fontCharacter:"\\ea70"}),t.circleFilled=new t("circle-filled",{fontCharacter:"\\ea71"}),t.primitiveDot=new t("primitive-dot",{fontCharacter:"\\ea71"}),t.closeDirty=new t("close-dirty",{fontCharacter:"\\ea71"}),t.debugBreakpoint=new t("debug-breakpoint",{fontCharacter:"\\ea71"}),t.debugBreakpointDisabled=new t("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),t.debugHint=new t("debug-hint",{fontCharacter:"\\ea71"}),t.primitiveSquare=new t("primitive-square",{fontCharacter:"\\ea72"}),t.edit=new t("edit",{fontCharacter:"\\ea73"}),t.pencil=new t("pencil",{fontCharacter:"\\ea73"}),t.info=new t("info",{fontCharacter:"\\ea74"}),t.issueOpened=new t("issue-opened",{fontCharacter:"\\ea74"}),t.gistPrivate=new t("gist-private",{fontCharacter:"\\ea75"}),t.gitForkPrivate=new t("git-fork-private",{fontCharacter:"\\ea75"}),t.lock=new t("lock",{fontCharacter:"\\ea75"}),t.mirrorPrivate=new t("mirror-private",{fontCharacter:"\\ea75"}),t.close=new t("close",{fontCharacter:"\\ea76"}),t.removeClose=new t("remove-close",{fontCharacter:"\\ea76"}),t.x=new t("x",{fontCharacter:"\\ea76"}),t.repoSync=new t("repo-sync",{fontCharacter:"\\ea77"}),t.sync=new t("sync",{fontCharacter:"\\ea77"}),t.clone=new t("clone",{fontCharacter:"\\ea78"}),t.desktopDownload=new t("desktop-download",{fontCharacter:"\\ea78"}),t.beaker=new t("beaker",{fontCharacter:"\\ea79"}),t.microscope=new t("microscope",{fontCharacter:"\\ea79"}),t.vm=new t("vm",{fontCharacter:"\\ea7a"}),t.deviceDesktop=new t("device-desktop",{fontCharacter:"\\ea7a"}),t.file=new t("file",{fontCharacter:"\\ea7b"}),t.fileText=new t("file-text",{fontCharacter:"\\ea7b"}),t.more=new t("more",{fontCharacter:"\\ea7c"}),t.ellipsis=new t("ellipsis",{fontCharacter:"\\ea7c"}),t.kebabHorizontal=new t("kebab-horizontal",{fontCharacter:"\\ea7c"}),t.mailReply=new t("mail-reply",{fontCharacter:"\\ea7d"}),t.reply=new t("reply",{fontCharacter:"\\ea7d"}),t.organization=new t("organization",{fontCharacter:"\\ea7e"}),t.organizationFilled=new t("organization-filled",{fontCharacter:"\\ea7e"}),t.organizationOutline=new t("organization-outline",{fontCharacter:"\\ea7e"}),t.newFile=new t("new-file",{fontCharacter:"\\ea7f"}),t.fileAdd=new t("file-add",{fontCharacter:"\\ea7f"}),t.newFolder=new t("new-folder",{fontCharacter:"\\ea80"}),t.fileDirectoryCreate=new t("file-directory-create",{fontCharacter:"\\ea80"}),t.trash=new t("trash",{fontCharacter:"\\ea81"}),t.trashcan=new t("trashcan",{fontCharacter:"\\ea81"}),t.history=new t("history",{fontCharacter:"\\ea82"}),t.clock=new t("clock",{fontCharacter:"\\ea82"}),t.folder=new t("folder",{fontCharacter:"\\ea83"}),t.fileDirectory=new t("file-directory",{fontCharacter:"\\ea83"}),t.symbolFolder=new t("symbol-folder",{fontCharacter:"\\ea83"}),t.logoGithub=new t("logo-github",{fontCharacter:"\\ea84"}),t.markGithub=new t("mark-github",{fontCharacter:"\\ea84"}),t.github=new t("github",{fontCharacter:"\\ea84"}),t.terminal=new t("terminal",{fontCharacter:"\\ea85"}),t.console=new t("console",{fontCharacter:"\\ea85"}),t.repl=new t("repl",{fontCharacter:"\\ea85"}),t.zap=new t("zap",{fontCharacter:"\\ea86"}),t.symbolEvent=new t("symbol-event",{fontCharacter:"\\ea86"}),t.error=new t("error",{fontCharacter:"\\ea87"}),t.stop=new t("stop",{fontCharacter:"\\ea87"}),t.variable=new t("variable",{fontCharacter:"\\ea88"}),t.symbolVariable=new t("symbol-variable",{fontCharacter:"\\ea88"}),t.array=new t("array",{fontCharacter:"\\ea8a"}),t.symbolArray=new t("symbol-array",{fontCharacter:"\\ea8a"}),t.symbolModule=new t("symbol-module",{fontCharacter:"\\ea8b"}),t.symbolPackage=new t("symbol-package",{fontCharacter:"\\ea8b"}),t.symbolNamespace=new t("symbol-namespace",{fontCharacter:"\\ea8b"}),t.symbolObject=new t("symbol-object",{fontCharacter:"\\ea8b"}),t.symbolMethod=new t("symbol-method",{fontCharacter:"\\ea8c"}),t.symbolFunction=new t("symbol-function",{fontCharacter:"\\ea8c"}),t.symbolConstructor=new t("symbol-constructor",{fontCharacter:"\\ea8c"}),t.symbolBoolean=new t("symbol-boolean",{fontCharacter:"\\ea8f"}),t.symbolNull=new t("symbol-null",{fontCharacter:"\\ea8f"}),t.symbolNumeric=new t("symbol-numeric",{fontCharacter:"\\ea90"}),t.symbolNumber=new t("symbol-number",{fontCharacter:"\\ea90"}),t.symbolStructure=new t("symbol-structure",{fontCharacter:"\\ea91"}),t.symbolStruct=new t("symbol-struct",{fontCharacter:"\\ea91"}),t.symbolParameter=new t("symbol-parameter",{fontCharacter:"\\ea92"}),t.symbolTypeParameter=new t("symbol-type-parameter",{fontCharacter:"\\ea92"}),t.symbolKey=new t("symbol-key",{fontCharacter:"\\ea93"}),t.symbolText=new t("symbol-text",{fontCharacter:"\\ea93"}),t.symbolReference=new t("symbol-reference",{fontCharacter:"\\ea94"}),t.goToFile=new t("go-to-file",{fontCharacter:"\\ea94"}),t.symbolEnum=new t("symbol-enum",{fontCharacter:"\\ea95"}),t.symbolValue=new t("symbol-value",{fontCharacter:"\\ea95"}),t.symbolRuler=new t("symbol-ruler",{fontCharacter:"\\ea96"}),t.symbolUnit=new t("symbol-unit",{fontCharacter:"\\ea96"}),t.activateBreakpoints=new t("activate-breakpoints",{fontCharacter:"\\ea97"}),t.archive=new t("archive",{fontCharacter:"\\ea98"}),t.arrowBoth=new t("arrow-both",{fontCharacter:"\\ea99"}),t.arrowDown=new t("arrow-down",{fontCharacter:"\\ea9a"}),t.arrowLeft=new t("arrow-left",{fontCharacter:"\\ea9b"}),t.arrowRight=new t("arrow-right",{fontCharacter:"\\ea9c"}),t.arrowSmallDown=new t("arrow-small-down",{fontCharacter:"\\ea9d"}),t.arrowSmallLeft=new t("arrow-small-left",{fontCharacter:"\\ea9e"}),t.arrowSmallRight=new t("arrow-small-right",{fontCharacter:"\\ea9f"}),t.arrowSmallUp=new t("arrow-small-up",{fontCharacter:"\\eaa0"}),t.arrowUp=new t("arrow-up",{fontCharacter:"\\eaa1"}),t.bell=new t("bell",{fontCharacter:"\\eaa2"}),t.bold=new t("bold",{fontCharacter:"\\eaa3"}),t.book=new t("book",{fontCharacter:"\\eaa4"}),t.bookmark=new t("bookmark",{fontCharacter:"\\eaa5"}),t.debugBreakpointConditionalUnverified=new t("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),t.debugBreakpointConditional=new t("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),t.debugBreakpointConditionalDisabled=new t("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),t.debugBreakpointDataUnverified=new t("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),t.debugBreakpointData=new t("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),t.debugBreakpointDataDisabled=new t("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),t.debugBreakpointLogUnverified=new t("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),t.debugBreakpointLog=new t("debug-breakpoint-log",{fontCharacter:"\\eaab"}),t.debugBreakpointLogDisabled=new t("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),t.briefcase=new t("briefcase",{fontCharacter:"\\eaac"}),t.broadcast=new t("broadcast",{fontCharacter:"\\eaad"}),t.browser=new t("browser",{fontCharacter:"\\eaae"}),t.bug=new t("bug",{fontCharacter:"\\eaaf"}),t.calendar=new t("calendar",{fontCharacter:"\\eab0"}),t.caseSensitive=new t("case-sensitive",{fontCharacter:"\\eab1"}),t.check=new t("check",{fontCharacter:"\\eab2"}),t.checklist=new t("checklist",{fontCharacter:"\\eab3"}),t.chevronDown=new t("chevron-down",{fontCharacter:"\\eab4"}),t.dropDownButton=new t("drop-down-button",t.chevronDown.definition),t.chevronLeft=new t("chevron-left",{fontCharacter:"\\eab5"}),t.chevronRight=new t("chevron-right",{fontCharacter:"\\eab6"}),t.chevronUp=new t("chevron-up",{fontCharacter:"\\eab7"}),t.chromeClose=new t("chrome-close",{fontCharacter:"\\eab8"}),t.chromeMaximize=new t("chrome-maximize",{fontCharacter:"\\eab9"}),t.chromeMinimize=new t("chrome-minimize",{fontCharacter:"\\eaba"}),t.chromeRestore=new t("chrome-restore",{fontCharacter:"\\eabb"}),t.circleOutline=new t("circle-outline",{fontCharacter:"\\eabc"}),t.debugBreakpointUnverified=new t("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),t.circleSlash=new t("circle-slash",{fontCharacter:"\\eabd"}),t.circuitBoard=new t("circuit-board",{fontCharacter:"\\eabe"}),t.clearAll=new t("clear-all",{fontCharacter:"\\eabf"}),t.clippy=new t("clippy",{fontCharacter:"\\eac0"}),t.closeAll=new t("close-all",{fontCharacter:"\\eac1"}),t.cloudDownload=new t("cloud-download",{fontCharacter:"\\eac2"}),t.cloudUpload=new t("cloud-upload",{fontCharacter:"\\eac3"}),t.code=new t("code",{fontCharacter:"\\eac4"}),t.collapseAll=new t("collapse-all",{fontCharacter:"\\eac5"}),t.colorMode=new t("color-mode",{fontCharacter:"\\eac6"}),t.commentDiscussion=new t("comment-discussion",{fontCharacter:"\\eac7"}),t.compareChanges=new t("compare-changes",{fontCharacter:"\\eafd"}),t.creditCard=new t("credit-card",{fontCharacter:"\\eac9"}),t.dash=new t("dash",{fontCharacter:"\\eacc"}),t.dashboard=new t("dashboard",{fontCharacter:"\\eacd"}),t.database=new t("database",{fontCharacter:"\\eace"}),t.debugContinue=new t("debug-continue",{fontCharacter:"\\eacf"}),t.debugDisconnect=new t("debug-disconnect",{fontCharacter:"\\ead0"}),t.debugPause=new t("debug-pause",{fontCharacter:"\\ead1"}),t.debugRestart=new t("debug-restart",{fontCharacter:"\\ead2"}),t.debugStart=new t("debug-start",{fontCharacter:"\\ead3"}),t.debugStepInto=new t("debug-step-into",{fontCharacter:"\\ead4"}),t.debugStepOut=new t("debug-step-out",{fontCharacter:"\\ead5"}),t.debugStepOver=new t("debug-step-over",{fontCharacter:"\\ead6"}),t.debugStop=new t("debug-stop",{fontCharacter:"\\ead7"}),t.debug=new t("debug",{fontCharacter:"\\ead8"}),t.deviceCameraVideo=new t("device-camera-video",{fontCharacter:"\\ead9"}),t.deviceCamera=new t("device-camera",{fontCharacter:"\\eada"}),t.deviceMobile=new t("device-mobile",{fontCharacter:"\\eadb"}),t.diffAdded=new t("diff-added",{fontCharacter:"\\eadc"}),t.diffIgnored=new t("diff-ignored",{fontCharacter:"\\eadd"}),t.diffModified=new t("diff-modified",{fontCharacter:"\\eade"}),t.diffRemoved=new t("diff-removed",{fontCharacter:"\\eadf"}),t.diffRenamed=new t("diff-renamed",{fontCharacter:"\\eae0"}),t.diff=new t("diff",{fontCharacter:"\\eae1"}),t.discard=new t("discard",{fontCharacter:"\\eae2"}),t.editorLayout=new t("editor-layout",{fontCharacter:"\\eae3"}),t.emptyWindow=new t("empty-window",{fontCharacter:"\\eae4"}),t.exclude=new t("exclude",{fontCharacter:"\\eae5"}),t.extensions=new t("extensions",{fontCharacter:"\\eae6"}),t.eyeClosed=new t("eye-closed",{fontCharacter:"\\eae7"}),t.fileBinary=new t("file-binary",{fontCharacter:"\\eae8"}),t.fileCode=new t("file-code",{fontCharacter:"\\eae9"}),t.fileMedia=new t("file-media",{fontCharacter:"\\eaea"}),t.filePdf=new t("file-pdf",{fontCharacter:"\\eaeb"}),t.fileSubmodule=new t("file-submodule",{fontCharacter:"\\eaec"}),t.fileSymlinkDirectory=new t("file-symlink-directory",{fontCharacter:"\\eaed"}),t.fileSymlinkFile=new t("file-symlink-file",{fontCharacter:"\\eaee"}),t.fileZip=new t("file-zip",{fontCharacter:"\\eaef"}),t.files=new t("files",{fontCharacter:"\\eaf0"}),t.filter=new t("filter",{fontCharacter:"\\eaf1"}),t.flame=new t("flame",{fontCharacter:"\\eaf2"}),t.foldDown=new t("fold-down",{fontCharacter:"\\eaf3"}),t.foldUp=new t("fold-up",{fontCharacter:"\\eaf4"}),t.fold=new t("fold",{fontCharacter:"\\eaf5"}),t.folderActive=new t("folder-active",{fontCharacter:"\\eaf6"}),t.folderOpened=new t("folder-opened",{fontCharacter:"\\eaf7"}),t.gear=new t("gear",{fontCharacter:"\\eaf8"}),t.gift=new t("gift",{fontCharacter:"\\eaf9"}),t.gistSecret=new t("gist-secret",{fontCharacter:"\\eafa"}),t.gist=new t("gist",{fontCharacter:"\\eafb"}),t.gitCommit=new t("git-commit",{fontCharacter:"\\eafc"}),t.gitCompare=new t("git-compare",{fontCharacter:"\\eafd"}),t.gitMerge=new t("git-merge",{fontCharacter:"\\eafe"}),t.githubAction=new t("github-action",{fontCharacter:"\\eaff"}),t.githubAlt=new t("github-alt",{fontCharacter:"\\eb00"}),t.globe=new t("globe",{fontCharacter:"\\eb01"}),t.grabber=new t("grabber",{fontCharacter:"\\eb02"}),t.graph=new t("graph",{fontCharacter:"\\eb03"}),t.gripper=new t("gripper",{fontCharacter:"\\eb04"}),t.heart=new t("heart",{fontCharacter:"\\eb05"}),t.home=new t("home",{fontCharacter:"\\eb06"}),t.horizontalRule=new t("horizontal-rule",{fontCharacter:"\\eb07"}),t.hubot=new t("hubot",{fontCharacter:"\\eb08"}),t.inbox=new t("inbox",{fontCharacter:"\\eb09"}),t.issueClosed=new t("issue-closed",{fontCharacter:"\\eba4"}),t.issueReopened=new t("issue-reopened",{fontCharacter:"\\eb0b"}),t.issues=new t("issues",{fontCharacter:"\\eb0c"}),t.italic=new t("italic",{fontCharacter:"\\eb0d"}),t.jersey=new t("jersey",{fontCharacter:"\\eb0e"}),t.json=new t("json",{fontCharacter:"\\eb0f"}),t.kebabVertical=new t("kebab-vertical",{fontCharacter:"\\eb10"}),t.key=new t("key",{fontCharacter:"\\eb11"}),t.law=new t("law",{fontCharacter:"\\eb12"}),t.lightbulbAutofix=new t("lightbulb-autofix",{fontCharacter:"\\eb13"}),t.linkExternal=new t("link-external",{fontCharacter:"\\eb14"}),t.link=new t("link",{fontCharacter:"\\eb15"}),t.listOrdered=new t("list-ordered",{fontCharacter:"\\eb16"}),t.listUnordered=new t("list-unordered",{fontCharacter:"\\eb17"}),t.liveShare=new t("live-share",{fontCharacter:"\\eb18"}),t.loading=new t("loading",{fontCharacter:"\\eb19"}),t.location=new t("location",{fontCharacter:"\\eb1a"}),t.mailRead=new t("mail-read",{fontCharacter:"\\eb1b"}),t.mail=new t("mail",{fontCharacter:"\\eb1c"}),t.markdown=new t("markdown",{fontCharacter:"\\eb1d"}),t.megaphone=new t("megaphone",{fontCharacter:"\\eb1e"}),t.mention=new t("mention",{fontCharacter:"\\eb1f"}),t.milestone=new t("milestone",{fontCharacter:"\\eb20"}),t.mortarBoard=new t("mortar-board",{fontCharacter:"\\eb21"}),t.move=new t("move",{fontCharacter:"\\eb22"}),t.multipleWindows=new t("multiple-windows",{fontCharacter:"\\eb23"}),t.mute=new t("mute",{fontCharacter:"\\eb24"}),t.noNewline=new t("no-newline",{fontCharacter:"\\eb25"}),t.note=new t("note",{fontCharacter:"\\eb26"}),t.octoface=new t("octoface",{fontCharacter:"\\eb27"}),t.openPreview=new t("open-preview",{fontCharacter:"\\eb28"}),t.package_=new t("package",{fontCharacter:"\\eb29"}),t.paintcan=new t("paintcan",{fontCharacter:"\\eb2a"}),t.pin=new t("pin",{fontCharacter:"\\eb2b"}),t.play=new t("play",{fontCharacter:"\\eb2c"}),t.run=new t("run",{fontCharacter:"\\eb2c"}),t.plug=new t("plug",{fontCharacter:"\\eb2d"}),t.preserveCase=new t("preserve-case",{fontCharacter:"\\eb2e"}),t.preview=new t("preview",{fontCharacter:"\\eb2f"}),t.project=new t("project",{fontCharacter:"\\eb30"}),t.pulse=new t("pulse",{fontCharacter:"\\eb31"}),t.question=new t("question",{fontCharacter:"\\eb32"}),t.quote=new t("quote",{fontCharacter:"\\eb33"}),t.radioTower=new t("radio-tower",{fontCharacter:"\\eb34"}),t.reactions=new t("reactions",{fontCharacter:"\\eb35"}),t.references=new t("references",{fontCharacter:"\\eb36"}),t.refresh=new t("refresh",{fontCharacter:"\\eb37"}),t.regex=new t("regex",{fontCharacter:"\\eb38"}),t.remoteExplorer=new t("remote-explorer",{fontCharacter:"\\eb39"}),t.remote=new t("remote",{fontCharacter:"\\eb3a"}),t.remove=new t("remove",{fontCharacter:"\\eb3b"}),t.replaceAll=new t("replace-all",{fontCharacter:"\\eb3c"}),t.replace=new t("replace",{fontCharacter:"\\eb3d"}),t.repoClone=new t("repo-clone",{fontCharacter:"\\eb3e"}),t.repoForcePush=new t("repo-force-push",{fontCharacter:"\\eb3f"}),t.repoPull=new t("repo-pull",{fontCharacter:"\\eb40"}),t.repoPush=new t("repo-push",{fontCharacter:"\\eb41"}),t.report=new t("report",{fontCharacter:"\\eb42"}),t.requestChanges=new t("request-changes",{fontCharacter:"\\eb43"}),t.rocket=new t("rocket",{fontCharacter:"\\eb44"}),t.rootFolderOpened=new t("root-folder-opened",{fontCharacter:"\\eb45"}),t.rootFolder=new t("root-folder",{fontCharacter:"\\eb46"}),t.rss=new t("rss",{fontCharacter:"\\eb47"}),t.ruby=new t("ruby",{fontCharacter:"\\eb48"}),t.saveAll=new t("save-all",{fontCharacter:"\\eb49"}),t.saveAs=new t("save-as",{fontCharacter:"\\eb4a"}),t.save=new t("save",{fontCharacter:"\\eb4b"}),t.screenFull=new t("screen-full",{fontCharacter:"\\eb4c"}),t.screenNormal=new t("screen-normal",{fontCharacter:"\\eb4d"}),t.searchStop=new t("search-stop",{fontCharacter:"\\eb4e"}),t.server=new t("server",{fontCharacter:"\\eb50"}),t.settingsGear=new t("settings-gear",{fontCharacter:"\\eb51"}),t.settings=new t("settings",{fontCharacter:"\\eb52"}),t.shield=new t("shield",{fontCharacter:"\\eb53"}),t.smiley=new t("smiley",{fontCharacter:"\\eb54"}),t.sortPrecedence=new t("sort-precedence",{fontCharacter:"\\eb55"}),t.splitHorizontal=new t("split-horizontal",{fontCharacter:"\\eb56"}),t.splitVertical=new t("split-vertical",{fontCharacter:"\\eb57"}),t.squirrel=new t("squirrel",{fontCharacter:"\\eb58"}),t.starFull=new t("star-full",{fontCharacter:"\\eb59"}),t.starHalf=new t("star-half",{fontCharacter:"\\eb5a"}),t.symbolClass=new t("symbol-class",{fontCharacter:"\\eb5b"}),t.symbolColor=new t("symbol-color",{fontCharacter:"\\eb5c"}),t.symbolConstant=new t("symbol-constant",{fontCharacter:"\\eb5d"}),t.symbolEnumMember=new t("symbol-enum-member",{fontCharacter:"\\eb5e"}),t.symbolField=new t("symbol-field",{fontCharacter:"\\eb5f"}),t.symbolFile=new t("symbol-file",{fontCharacter:"\\eb60"}),t.symbolInterface=new t("symbol-interface",{fontCharacter:"\\eb61"}),t.symbolKeyword=new t("symbol-keyword",{fontCharacter:"\\eb62"}),t.symbolMisc=new t("symbol-misc",{fontCharacter:"\\eb63"}),t.symbolOperator=new t("symbol-operator",{fontCharacter:"\\eb64"}),t.symbolProperty=new t("symbol-property",{fontCharacter:"\\eb65"}),t.wrench=new t("wrench",{fontCharacter:"\\eb65"}),t.wrenchSubaction=new t("wrench-subaction",{fontCharacter:"\\eb65"}),t.symbolSnippet=new t("symbol-snippet",{fontCharacter:"\\eb66"}),t.tasklist=new t("tasklist",{fontCharacter:"\\eb67"}),t.telescope=new t("telescope",{fontCharacter:"\\eb68"}),t.textSize=new t("text-size",{fontCharacter:"\\eb69"}),t.threeBars=new t("three-bars",{fontCharacter:"\\eb6a"}),t.thumbsdown=new t("thumbsdown",{fontCharacter:"\\eb6b"}),t.thumbsup=new t("thumbsup",{fontCharacter:"\\eb6c"}),t.tools=new t("tools",{fontCharacter:"\\eb6d"}),t.triangleDown=new t("triangle-down",{fontCharacter:"\\eb6e"}),t.triangleLeft=new t("triangle-left",{fontCharacter:"\\eb6f"}),t.triangleRight=new t("triangle-right",{fontCharacter:"\\eb70"}),t.triangleUp=new t("triangle-up",{fontCharacter:"\\eb71"}),t.twitter=new t("twitter",{fontCharacter:"\\eb72"}),t.unfold=new t("unfold",{fontCharacter:"\\eb73"}),t.unlock=new t("unlock",{fontCharacter:"\\eb74"}),t.unmute=new t("unmute",{fontCharacter:"\\eb75"}),t.unverified=new t("unverified",{fontCharacter:"\\eb76"}),t.verified=new t("verified",{fontCharacter:"\\eb77"}),t.versions=new t("versions",{fontCharacter:"\\eb78"}),t.vmActive=new t("vm-active",{fontCharacter:"\\eb79"}),t.vmOutline=new t("vm-outline",{fontCharacter:"\\eb7a"}),t.vmRunning=new t("vm-running",{fontCharacter:"\\eb7b"}),t.watch=new t("watch",{fontCharacter:"\\eb7c"}),t.whitespace=new t("whitespace",{fontCharacter:"\\eb7d"}),t.wholeWord=new t("whole-word",{fontCharacter:"\\eb7e"}),t.window=new t("window",{fontCharacter:"\\eb7f"}),t.wordWrap=new t("word-wrap",{fontCharacter:"\\eb80"}),t.zoomIn=new t("zoom-in",{fontCharacter:"\\eb81"}),t.zoomOut=new t("zoom-out",{fontCharacter:"\\eb82"}),t.listFilter=new t("list-filter",{fontCharacter:"\\eb83"}),t.listFlat=new t("list-flat",{fontCharacter:"\\eb84"}),t.listSelection=new t("list-selection",{fontCharacter:"\\eb85"}),t.selection=new t("selection",{fontCharacter:"\\eb85"}),t.listTree=new t("list-tree",{fontCharacter:"\\eb86"}),t.debugBreakpointFunctionUnverified=new t("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),t.debugBreakpointFunction=new t("debug-breakpoint-function",{fontCharacter:"\\eb88"}),t.debugBreakpointFunctionDisabled=new t("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),t.debugStackframeActive=new t("debug-stackframe-active",{fontCharacter:"\\eb89"}),t.debugStackframeDot=new t("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),t.debugStackframe=new t("debug-stackframe",{fontCharacter:"\\eb8b"}),t.debugStackframeFocused=new t("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),t.debugBreakpointUnsupported=new t("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),t.symbolString=new t("symbol-string",{fontCharacter:"\\eb8d"}),t.debugReverseContinue=new t("debug-reverse-continue",{fontCharacter:"\\eb8e"}),t.debugStepBack=new t("debug-step-back",{fontCharacter:"\\eb8f"}),t.debugRestartFrame=new t("debug-restart-frame",{fontCharacter:"\\eb90"}),t.callIncoming=new t("call-incoming",{fontCharacter:"\\eb92"}),t.callOutgoing=new t("call-outgoing",{fontCharacter:"\\eb93"}),t.menu=new t("menu",{fontCharacter:"\\eb94"}),t.expandAll=new t("expand-all",{fontCharacter:"\\eb95"}),t.feedback=new t("feedback",{fontCharacter:"\\eb96"}),t.groupByRefType=new t("group-by-ref-type",{fontCharacter:"\\eb97"}),t.ungroupByRefType=new t("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),t.account=new t("account",{fontCharacter:"\\eb99"}),t.bellDot=new t("bell-dot",{fontCharacter:"\\eb9a"}),t.debugConsole=new t("debug-console",{fontCharacter:"\\eb9b"}),t.library=new t("library",{fontCharacter:"\\eb9c"}),t.output=new t("output",{fontCharacter:"\\eb9d"}),t.runAll=new t("run-all",{fontCharacter:"\\eb9e"}),t.syncIgnored=new t("sync-ignored",{fontCharacter:"\\eb9f"}),t.pinned=new t("pinned",{fontCharacter:"\\eba0"}),t.githubInverted=new t("github-inverted",{fontCharacter:"\\eba1"}),t.debugAlt=new t("debug-alt",{fontCharacter:"\\eb91"}),t.serverProcess=new t("server-process",{fontCharacter:"\\eba2"}),t.serverEnvironment=new t("server-environment",{fontCharacter:"\\eba3"}),t.pass=new t("pass",{fontCharacter:"\\eba4"}),t.stopCircle=new t("stop-circle",{fontCharacter:"\\eba5"}),t.playCircle=new t("play-circle",{fontCharacter:"\\eba6"}),t.record=new t("record",{fontCharacter:"\\eba7"}),t.debugAltSmall=new t("debug-alt-small",{fontCharacter:"\\eba8"}),t.vmConnect=new t("vm-connect",{fontCharacter:"\\eba9"}),t.cloud=new t("cloud",{fontCharacter:"\\ebaa"}),t.merge=new t("merge",{fontCharacter:"\\ebab"}),t.exportIcon=new t("export",{fontCharacter:"\\ebac"}),t.graphLeft=new t("graph-left",{fontCharacter:"\\ebad"}),t.magnet=new t("magnet",{fontCharacter:"\\ebae"}),t.notebook=new t("notebook",{fontCharacter:"\\ebaf"}),t.redo=new t("redo",{fontCharacter:"\\ebb0"}),t.checkAll=new t("check-all",{fontCharacter:"\\ebb1"}),t.pinnedDirty=new t("pinned-dirty",{fontCharacter:"\\ebb2"}),t.passFilled=new t("pass-filled",{fontCharacter:"\\ebb3"}),t.circleLargeFilled=new t("circle-large-filled",{fontCharacter:"\\ebb4"}),t.circleLargeOutline=new t("circle-large-outline",{fontCharacter:"\\ebb5"}),t.combine=new t("combine",{fontCharacter:"\\ebb6"}),t.gather=new t("gather",{fontCharacter:"\\ebb6"}),t.table=new t("table",{fontCharacter:"\\ebb7"}),t.variableGroup=new t("variable-group",{fontCharacter:"\\ebb8"}),t.typeHierarchy=new t("type-hierarchy",{fontCharacter:"\\ebb9"}),t.typeHierarchySub=new t("type-hierarchy-sub",{fontCharacter:"\\ebba"}),t.typeHierarchySuper=new t("type-hierarchy-super",{fontCharacter:"\\ebbb"}),t.gitPullRequestCreate=new t("git-pull-request-create",{fontCharacter:"\\ebbc"}),t.runAbove=new t("run-above",{fontCharacter:"\\ebbd"}),t.runBelow=new t("run-below",{fontCharacter:"\\ebbe"}),t.notebookTemplate=new t("notebook-template",{fontCharacter:"\\ebbf"}),t.debugRerun=new t("debug-rerun",{fontCharacter:"\\ebc0"}),t.workspaceTrusted=new t("workspace-trusted",{fontCharacter:"\\ebc1"}),t.workspaceUntrusted=new t("workspace-untrusted",{fontCharacter:"\\ebc2"}),t.workspaceUnspecified=new t("workspace-unspecified",{fontCharacter:"\\ebc3"}),t.terminalCmd=new t("terminal-cmd",{fontCharacter:"\\ebc4"}),t.terminalDebian=new t("terminal-debian",{fontCharacter:"\\ebc5"}),t.terminalLinux=new t("terminal-linux",{fontCharacter:"\\ebc6"}),t.terminalPowershell=new t("terminal-powershell",{fontCharacter:"\\ebc7"}),t.terminalTmux=new t("terminal-tmux",{fontCharacter:"\\ebc8"}),t.terminalUbuntu=new t("terminal-ubuntu",{fontCharacter:"\\ebc9"}),t.terminalBash=new t("terminal-bash",{fontCharacter:"\\ebca"}),t.arrowSwap=new t("arrow-swap",{fontCharacter:"\\ebcb"}),t.copy=new t("copy",{fontCharacter:"\\ebcc"}),t.personAdd=new t("person-add",{fontCharacter:"\\ebcd"}),t.filterFilled=new t("filter-filled",{fontCharacter:"\\ebce"}),t.wand=new t("wand",{fontCharacter:"\\ebcf"}),t.debugLineByLine=new t("debug-line-by-line",{fontCharacter:"\\ebd0"}),t.inspect=new t("inspect",{fontCharacter:"\\ebd1"}),t.layers=new t("layers",{fontCharacter:"\\ebd2"}),t.layersDot=new t("layers-dot",{fontCharacter:"\\ebd3"}),t.layersActive=new t("layers-active",{fontCharacter:"\\ebd4"}),t.compass=new t("compass",{fontCharacter:"\\ebd5"}),t.compassDot=new t("compass-dot",{fontCharacter:"\\ebd6"}),t.compassActive=new t("compass-active",{fontCharacter:"\\ebd7"}),t.azure=new t("azure",{fontCharacter:"\\ebd8"}),t.issueDraft=new t("issue-draft",{fontCharacter:"\\ebd9"}),t.gitPullRequestClosed=new t("git-pull-request-closed",{fontCharacter:"\\ebda"}),t.gitPullRequestDraft=new t("git-pull-request-draft",{fontCharacter:"\\ebdb"}),t.debugAll=new t("debug-all",{fontCharacter:"\\ebdc"}),t.debugCoverage=new t("debug-coverage",{fontCharacter:"\\ebdd"}),t.runErrors=new t("run-errors",{fontCharacter:"\\ebde"}),t.folderLibrary=new t("folder-library",{fontCharacter:"\\ebdf"}),t.debugContinueSmall=new t("debug-continue-small",{fontCharacter:"\\ebe0"}),t.beakerStop=new t("beaker-stop",{fontCharacter:"\\ebe1"}),t.graphLine=new t("graph-line",{fontCharacter:"\\ebe2"}),t.graphScatter=new t("graph-scatter",{fontCharacter:"\\ebe3"}),t.pieChart=new t("pie-chart",{fontCharacter:"\\ebe4"}),t.bracket=new t("bracket",t.json.definition),t.bracketDot=new t("bracket-dot",{fontCharacter:"\\ebe5"}),t.bracketError=new t("bracket-error",{fontCharacter:"\\ebe6"}),t.lockSmall=new t("lock-small",{fontCharacter:"\\ebe7"}),t.azureDevops=new t("azure-devops",{fontCharacter:"\\ebe8"}),t.verifiedFilled=new t("verified-filled",{fontCharacter:"\\ebe9"})}(o||(o={}))},79881:function(t,e,n){"use strict";n.d(e,{B8:function(){return h},Cp:function(){return s},F0:function(){return l},L6:function(){return c},VV:function(){return o},b1:function(){return u},dL:function(){return i},ri:function(){return A}});const r=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout((()=>{if(t.stack)throw new Error(t.message+"\n\n"+t.stack);throw t}),0)}}emit(t){this.listeners.forEach((e=>{e(t)}))}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}};function i(t){o(t)||r.onUnexpectedError(t)}function s(t){o(t)||r.onUnexpectedExternalError(t)}function A(t){if(t instanceof Error){let{name:e,message:n}=t;return{$isError:!0,name:e,message:n,stack:t.stacktrace||t.stack}}return t}const a="Canceled";function o(t){return t instanceof Error&&t.name===a&&t.message===a}function l(){const t=new Error(a);return t.name=t.message,t}function u(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}function c(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}class h extends Error{constructor(t){super("NotSupported"),t&&(this.message=t)}}},4348:function(t,e,n){"use strict";n.d(e,{D0:function(){return c},E7:function(){return h},K3:function(){return u},Q5:function(){return l},ZD:function(){return d},ju:function(){return r}});var r,i=n(79881),s=n(69323),A=n(34502),a=n(95830);!function(t){function e(t){return(e,n=null,r)=>{let i,s=!1;return i=t((t=>{if(!s)return i?i.dispose():s=!0,e.call(n,t)}),null,r),s&&i.dispose(),i}}function n(t,e){return a(((n,r=null,i)=>t((t=>n.call(r,e(t))),null,i)))}function r(t,e){return a(((n,r=null,i)=>t((t=>{e(t),n.call(r,t)}),null,i)))}function i(t,e){return a(((n,r=null,i)=>t((t=>e(t)&&n.call(r,t)),null,i)))}function A(t,e,r){let i=r;return n(t,(t=>(i=e(i,t),i)))}function a(t){let e;const n=new l({onFirstListenerAdd(){e=t(n.fire,n)},onLastListenerRemove(){e.dispose()}});return n.event}function o(t,e,n=100,r=!1,i){let s,A,a,o=0;const u=new l({leakWarningThreshold:i,onFirstListenerAdd(){s=t((t=>{o++,A=e(A,t),r&&!a&&(u.fire(A),A=void 0),clearTimeout(a),a=setTimeout((()=>{const t=A;A=void 0,a=void 0,(!r||o>1)&&u.fire(t),o=0}),n)}))},onLastListenerRemove(){s.dispose()}});return u.event}function u(t,e=((t,e)=>t===e)){let n,r=!0;return i(t,(t=>{const i=r||!e(t,n);return r=!1,n=t,i}))}t.None=()=>s.JT.None,t.once=e,t.map=n,t.forEach=r,t.filter=i,t.signal=function(t){return t},t.any=function(...t){return(e,n=null,r)=>(0,s.F8)(...t.map((t=>t((t=>e.call(n,t)),null,r))))},t.reduce=A,t.debounce=o,t.latch=u,t.split=function(e,n){return[t.filter(e,n),t.filter(e,(t=>!n(t)))]},t.buffer=function(t,e=!1,n=[]){let r=n.slice(),i=t((t=>{r?r.push(t):A.fire(t)}));const s=()=>{r&&r.forEach((t=>A.fire(t))),r=null},A=new l({onFirstListenerAdd(){i||(i=t((t=>A.fire(t))))},onFirstListenerDidAdd(){r&&(e?setTimeout(s):s())},onLastListenerRemove(){i&&i.dispose(),i=null}});return A.event};class c{constructor(t){this.event=t}map(t){return new c(n(this.event,t))}forEach(t){return new c(r(this.event,t))}filter(t){return new c(i(this.event,t))}reduce(t,e){return new c(A(this.event,t,e))}latch(){return new c(u(this.event))}debounce(t,e=100,n=!1,r){return new c(o(this.event,t,e,n,r))}on(t,e,n){return this.event(t,e,n)}once(t,n,r){return e(this.event)(t,n,r)}}t.chain=function(t){return new c(t)},t.fromNodeEventEmitter=function(t,e,n=(t=>t)){const r=(...t)=>i.fire(n(...t)),i=new l({onFirstListenerAdd:()=>t.on(e,r),onLastListenerRemove:()=>t.removeListener(e,r)});return i.event},t.fromDOMEventEmitter=function(t,e,n=(t=>t)){const r=(...t)=>i.fire(n(...t)),i=new l({onFirstListenerAdd:()=>t.addEventListener(e,r),onLastListenerRemove:()=>t.removeEventListener(e,r)});return i.event},t.toPromise=function(t){return new Promise((n=>e(t)(n)))}}(r||(r={}));class o{constructor(t){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${t}_${o._idPool++}`}start(t){this._stopWatch=new a.G(!0),this._listenerCount=t}stop(){if(this._stopWatch){const t=this._stopWatch.elapsed();this._elapsedOverall+=t,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${t.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}o._idPool=0;class l{constructor(t){var e;this._disposed=!1,this._options=t,this._leakageMon=void 0,this._perfMon=(null===(e=this._options)||void 0===e?void 0:e._profName)?new o(this._options._profName):void 0}get event(){return this._event||(this._event=(t,e,n)=>{var r;this._listeners||(this._listeners=new A.S);const i=this._listeners.isEmpty();i&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const a=this._listeners.push(e?[t,e]:t);i&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,t,e);const o=null===(r=this._leakageMon)||void 0===r?void 0:r.check(this._listeners.size),l=(0,s.OF)((()=>{if(o&&o(),!this._disposed&&(a(),this._options&&this._options.onLastListenerRemove)){this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)}}));return n instanceof s.SL?n.add(l):Array.isArray(n)&&n.push(l),l}),this._event}fire(t){var e,n;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new A.S);for(let e of this._listeners)this._deliveryQueue.push([e,t]);for(null===(e=this._perfMon)||void 0===e||e.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[t,e]=this._deliveryQueue.shift();try{"function"==typeof t?t.call(void 0,e):t[0].call(t[1],e)}catch(t){(0,i.dL)(t)}}null===(n=this._perfMon)||void 0===n||n.stop()}}dispose(){var t,e,n,r,i;this._disposed||(this._disposed=!0,null===(t=this._listeners)||void 0===t||t.clear(),null===(e=this._deliveryQueue)||void 0===e||e.clear(),null===(r=null===(n=this._options)||void 0===n?void 0:n.onLastListenerRemove)||void 0===r||r.call(n),null===(i=this._leakageMon)||void 0===i||i.dispose())}}class u extends l{constructor(t){super(t),this._isPaused=0,this._eventQueue=new A.S,this._mergeFn=null==t?void 0:t.merge}pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){const t=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(t))}else for(;!this._isPaused&&0!==this._eventQueue.size;)super.fire(this._eventQueue.shift())}fire(t){this._listeners&&(0!==this._isPaused?this._eventQueue.push(t):super.fire(t))}}class c extends u{constructor(t){var e;super(t),this._delay=null!==(e=t.delay)&&void 0!==e?e:100}fire(t){this._handle||(this.pause(),this._handle=setTimeout((()=>{this._handle=void 0,this.resume()}),this._delay)),super.fire(t)}}class h{constructor(){this.buffers=[]}wrapEvent(t){return(e,n,r)=>t((t=>{const r=this.buffers[this.buffers.length-1];r?r.push((()=>e.call(n,t))):e.call(n,t)}),void 0,r)}bufferEvents(t){const e=[];this.buffers.push(e);const n=t();return this.buffers.pop(),e.forEach((t=>t())),n}}class d{constructor(){this.listening=!1,this.inputEvent=r.None,this.inputEventListener=s.JT.None,this.emitter=new l({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(t){this.inputEvent=t,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=t(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},17845:function(t,e,n){"use strict";function r(t){const e=this;let n,r=!1;return function(){return r||(r=!0,n=t.apply(e,arguments)),n}}n.d(e,{I:function(){return r}})},88226:function(t,e,n){"use strict";var r;n.d(e,{$:function(){return r}}),function(t){t.is=function(t){return t&&"object"==typeof t&&"function"==typeof t[Symbol.iterator]};const e=Object.freeze([]);t.empty=function(){return e},t.single=function*(t){yield t},t.from=function(t){return t||e},t.isEmpty=function(t){return!t||!0===t[Symbol.iterator]().next().done},t.first=function(t){return t[Symbol.iterator]().next().value},t.some=function(t,e){for(const n of t)if(e(n))return!0;return!1},t.find=function(t,e){for(const n of t)if(e(n))return n},t.filter=function*(t,e){for(const n of t)e(n)&&(yield n)},t.map=function*(t,e){let n=0;for(const r of t)yield e(r,n++)},t.concat=function*(...t){for(const e of t)for(const t of e)yield t},t.concatNested=function*(t){for(const e of t)for(const t of e)yield t},t.reduce=function(t,e,n){let r=n;for(const n of t)r=e(r,n);return r},t.slice=function*(t,e,n=t.length){for(e<0&&(e+=t.length),n<0?n+=t.length:n>t.length&&(n=t.length);e<n;e++)yield t[e]},t.consume=function(e,n=Number.POSITIVE_INFINITY){const r=[];if(0===n)return[r,e];const i=e[Symbol.iterator]();for(let e=0;e<n;e++){const e=i.next();if(e.done)return[r,t.empty()];r.push(e.value)}return[r,{[Symbol.iterator](){return i}}]},t.equals=function(t,e,n=((t,e)=>t===e)){const r=t[Symbol.iterator](),i=e[Symbol.iterator]();for(;;){const t=r.next(),e=i.next();if(t.done!==e.done)return!1;if(t.done)return!0;if(!n(t.value,e.value))return!1}}}(r||(r={}))},69323:function(t,e,n){"use strict";n.d(e,{B9:function(){return h},F8:function(){return d},JT:function(){return g},Jz:function(){return _},OF:function(){return f},SL:function(){return p},Wf:function(){return c},XK:function(){return m},dk:function(){return l}});var r=n(17845),i=n(88226);let s=null;function A(t){return null==s||s.trackDisposable(t),t}function a(t){null==s||s.markAsDisposed(t)}function o(t,e){null==s||s.setParent(t,e)}function l(t){return null==s||s.markAsSingleton(t),t}class u extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`),this.errors=t}}function c(t){return"function"==typeof t.dispose&&0===t.dispose.length}function h(t){if(i.$.is(t)){let e=[];for(const n of t)if(n)try{n.dispose()}catch(t){e.push(t)}if(1===e.length)throw e[0];if(e.length>1)throw new u(e);return Array.isArray(t)?[]:t}if(t)return t.dispose(),t}function d(...t){const e=f((()=>h(t)));return function(t,e){if(s)for(const n of t)s.setParent(n,e)}(t,e),e}function f(t){const e=A({dispose:(0,r.I)((()=>{a(e),t()}))});return e}class p{constructor(){this._toDispose=new Set,this._isDisposed=!1,A(this)}dispose(){this._isDisposed||(a(this),this._isDisposed=!0,this.clear())}clear(){try{h(this._toDispose.values())}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return o(t,this),this._isDisposed?p.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}}p.DISABLE_DISPOSED_WARNING=!1;class g{constructor(){this._store=new p,A(this),o(this._store,this)}dispose(){a(this),this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}}g.None=Object.freeze({dispose(){}});class m{constructor(){this._isDisposed=!1,A(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){var e;this._isDisposed||t===this._value||(null===(e=this._value)||void 0===e||e.dispose(),t&&o(t,this),this._value=t)}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,a(this),null===(t=this._value)||void 0===t||t.dispose(),this._value=void 0}clearAndLeak(){const t=this._value;return this._value=void 0,t&&o(t,null),t}}class _{constructor(t){this.object=t}dispose(){}}},34502:function(t,e,n){"use strict";n.d(e,{S:function(){return i}});class r{constructor(t){this.element=t,this.next=r.Undefined,this.prev=r.Undefined}}r.Undefined=new r(void 0);class i{constructor(){this._first=r.Undefined,this._last=r.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===r.Undefined}clear(){let t=this._first;for(;t!==r.Undefined;){const e=t.next;t.prev=r.Undefined,t.next=r.Undefined,t=e}this._first=r.Undefined,this._last=r.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,e){const n=new r(t);if(this._first===r.Undefined)this._first=n,this._last=n;else if(e){const t=this._last;this._last=n,n.prev=t,t.next=n}else{const t=this._first;this._first=n,n.next=t,t.prev=n}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(n))}}shift(){if(this._first!==r.Undefined){const t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==r.Undefined){const t=this._last.element;return this._remove(this._last),t}}_remove(t){if(t.prev!==r.Undefined&&t.next!==r.Undefined){const e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===r.Undefined&&t.next===r.Undefined?(this._first=r.Undefined,this._last=r.Undefined):t.next===r.Undefined?(this._last=this._last.prev,this._last.next=r.Undefined):t.prev===r.Undefined&&(this._first=this._first.next,this._first.prev=r.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==r.Undefined;)yield t.element,t=t.next}}},23345:function(t,e,n){"use strict";n.d(e,{$L:function(){return C},ED:function(){return v},IJ:function(){return b},OS:function(){return S},WE:function(){return F},dz:function(){return B},gn:function(){return k},li:function(){return m},r:function(){return D},tY:function(){return E},xS:function(){return T}});var r,i=n(97671);const s="en";let A,a,o=!1,l=!1,u=!1,c=!1,h=!1,d=!1,f=!1,p=null,g=null;const m="object"==typeof self?self:"object"==typeof n.g?n.g:{};let _;void 0!==m.vscode&&void 0!==m.vscode.process?_=m.vscode.process:void 0!==i&&(_=i);const w="string"==typeof(null===(r=null==_?void 0:_.versions)||void 0===r?void 0:r.electron)&&"renderer"===_.type;if("object"!=typeof navigator||w)if("object"==typeof _){o="win32"===_.platform,l="darwin"===_.platform,u="linux"===_.platform,c=u&&!!_.env.SNAP&&!!_.env.SNAP_REVISION,A=s,p=s;const t=_.env.VSCODE_NLS_CONFIG;if(t)try{const e=JSON.parse(t),n=e.availableLanguages["*"];A=e.locale,p=n||s,g=e._translationsConfigFile}catch(t){}h=!0}else console.error("Unable to resolve platform.");else a=navigator.userAgent,o=a.indexOf("Windows")>=0,l=a.indexOf("Macintosh")>=0,f=(a.indexOf("Macintosh")>=0||a.indexOf("iPad")>=0||a.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,u=a.indexOf("Linux")>=0,d=!0,A=navigator.language,p=A;let y=0;l?y=1:o?y=3:u&&(y=2);const v=o,B=l,b=u,E=h,C=d,k=f,F=a,T=function(){if(m.setImmediate)return m.setImmediate.bind(m);if("function"==typeof m.postMessage&&!m.importScripts){let t=[];m.addEventListener("message",(e=>{if(e.data&&e.data.vscodeSetImmediateId)for(let n=0,r=t.length;n<r;n++){const r=t[n];if(r.id===e.data.vscodeSetImmediateId)return t.splice(n,1),void r.callback()}}));let e=0;return n=>{const r=++e;t.push({id:r,callback:n}),m.postMessage({vscodeSetImmediateId:r},"*")}}if("function"==typeof(null==_?void 0:_.nextTick))return _.nextTick.bind(_);const t=Promise.resolve();return e=>t.then(e)}(),S=l||f?2:o?1:3;let x=!0,I=!1;function D(){if(!I){I=!0;const t=new Uint8Array(2);t[0]=1,t[1]=2;const e=new Uint16Array(t.buffer);x=513===e[0]}return x}},95830:function(t,e,n){"use strict";n.d(e,{G:function(){return s}});var r=n(23345);const i=r.li.performance&&"function"==typeof r.li.performance.now;class s{constructor(t){this._highResolution=i&&t,this._startTime=this._now(),this._stopTime=-1}static create(t=!0){return new s(t)}stop(){this._stopTime=this._now()}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?r.li.performance.now():Date.now()}}},82983:function(t,e,n){"use strict";function r(t){return!t||"string"!=typeof t||0===t.trim().length}n.d(e,{$i:function(){return K},C8:function(){return Z},GF:function(){return d},HO:function(){return Q},IO:function(){return f},K7:function(){return j},Kw:function(){return Y},LC:function(){return m},Mh:function(){return T},P1:function(){return S},PJ:function(){return X},Qe:function(){return $},R1:function(){return h},RP:function(){return N},S6:function(){return q},TT:function(){return v},Ut:function(){return P},V8:function(){return _},WU:function(){return s},YK:function(){return I},YU:function(){return A},ZG:function(){return x},ZH:function(){return U},ab:function(){return G},c1:function(){return W},df:function(){return C},ec:function(){return a},fi:function(){return J},fy:function(){return o},j3:function(){return l},j_:function(){return b},m5:function(){return r},mK:function(){return E},mr:function(){return p},oH:function(){return et},oL:function(){return u},ok:function(){return F},ow:function(){return w},qq:function(){return k},qu:function(){return y},rL:function(){return D},uS:function(){return z},un:function(){return c},uq:function(){return g},vH:function(){return R},xe:function(){return V},zY:function(){return B}});const i=/{(\d+)}/g;function s(t,...e){return 0===e.length?t:t.replace(i,(function(t,n){const r=parseInt(n,10);return isNaN(r)||r<0||r>=e.length?t:e[r]}))}function A(t){return t.replace(/[<>&]/g,(function(t){switch(t){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return t}}))}function a(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function o(t,e=" "){return u(l(t,e),e)}function l(t,e){if(!t||!e)return t;const n=e.length;if(0===n||0===t.length)return t;let r=0;for(;t.indexOf(e,r)===r;)r+=n;return t.substring(r)}function u(t,e){if(!t||!e)return t;const n=e.length,r=t.length;if(0===n||0===r)return t;let i=r,s=-1;for(;s=t.lastIndexOf(e,i-1),-1!==s&&s+n===i;){if(0===s)return"";i=s}return t.substring(0,i)}function c(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function h(t){return t.replace(/\*/g,"")}function d(t,e,n={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=a(t)),n.wholeWord&&(/\B/.test(t.charAt(0))||(t="\\b"+t),/\B/.test(t.charAt(t.length-1))||(t+="\\b"));let r="";return n.global&&(r+="g"),n.matchCase||(r+="i"),n.multiline&&(r+="m"),n.unicode&&(r+="u"),new RegExp(t,r)}function f(t){if("^"===t.source||"^$"===t.source||"$"===t.source||"^\\s*$"===t.source)return!1;return!(!t.exec("")||0!==t.lastIndex)}function p(t){return(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")}function g(t){return t.split(/\r\n|\r|\n/)}function m(t){for(let e=0,n=t.length;e<n;e++){const n=t.charCodeAt(e);if(32!==n&&9!==n)return e}return-1}function _(t,e=0,n=t.length){for(let r=e;r<n;r++){const n=t.charCodeAt(r);if(32!==n&&9!==n)return t.substring(e,r)}return t.substring(e,n)}function w(t,e=t.length-1){for(let n=e;n>=0;n--){const e=t.charCodeAt(n);if(32!==e&&9!==e)return n}return-1}function y(t,e){return t<e?-1:t>e?1:0}function v(t,e,n=0,r=t.length,i=0,s=e.length){for(;n<r&&i<s;n++,i++){let r=t.charCodeAt(n),s=e.charCodeAt(i);if(r<s)return-1;if(r>s)return 1}const A=r-n,a=s-i;return A<a?-1:A>a?1:0}function B(t,e){return b(t,e,0,t.length,0,e.length)}function b(t,e,n=0,r=t.length,i=0,s=e.length){for(;n<r&&i<s;n++,i++){let A=t.charCodeAt(n),a=e.charCodeAt(i);if(A===a)continue;if(A>=128||a>=128)return v(t.toLowerCase(),e.toLowerCase(),n,r,i,s);E(A)&&(A-=32),E(a)&&(a-=32);const o=A-a;if(0!==o)return o}const A=r-n,a=s-i;return A<a?-1:A>a?1:0}function E(t){return t>=97&&t<=122}function C(t){return t>=65&&t<=90}function k(t,e){return t.length===e.length&&0===b(t,e)}function F(t,e){const n=e.length;return!(e.length>t.length)&&0===b(t,e,0,n)}function T(t,e){let n,r=Math.min(t.length,e.length);for(n=0;n<r;n++)if(t.charCodeAt(n)!==e.charCodeAt(n))return n;return r}function S(t,e){let n,r=Math.min(t.length,e.length);const i=t.length-1,s=e.length-1;for(n=0;n<r;n++)if(t.charCodeAt(i-n)!==e.charCodeAt(s-n))return n;return r}function x(t){return 55296<=t&&t<=56319}function I(t){return 56320<=t&&t<=57343}function D(t,e){return e-56320+(t-55296<<10)+65536}function U(t,e,n){const r=t.charCodeAt(n);if(x(r)&&n+1<e){const e=t.charCodeAt(n+1);if(I(e))return D(r,e)}return r}function L(t,e){const n=t.charCodeAt(e-1);if(I(n)&&e>1){const r=t.charCodeAt(e-2);if(x(r))return D(r,n)}return n}function R(t,e){const n=tt.getInstance(),r=e,i=t.length,s=U(t,i,e);e+=s>=65536?2:1;let A=n.getGraphemeBreakType(s);for(;e<i;){const r=U(t,i,e),s=n.getGraphemeBreakType(r);if(J(A,s))break;e+=r>=65536?2:1,A=s}return e-r}function Q(t,e){const n=tt.getInstance(),r=e,i=L(t,e);e-=i>=65536?2:1;let s=n.getGraphemeBreakType(i);for(;e>0;){const r=L(t,e),i=n.getGraphemeBreakType(r);if(J(i,s))break;e-=r>=65536?2:1,s=i}return r-e}const O=/(?:[\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 P(t){return O.test(t)}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 N(t){return M.test(t)}const H=/^[\t\n\r\x20-\x7E]*$/;function K(t){return H.test(t)}const $=/[\u2028\u2029]/;function G(t){return $.test(t)}function V(t){for(let e=0,n=t.length;e<n;e++)if(j(t.charCodeAt(e)))return!0;return!1}function j(t){return(t=+t)>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374}function Z(t){return t>=127462&&t<=127487||8986===t||8987===t||9200===t||9203===t||t>=9728&&t<=10175||11088===t||11093===t||t>=127744&&t<=128591||t>=128640&&t<=128764||t>=128992&&t<=129003||t>=129280&&t<=129535||t>=129648&&t<=129750}const W=String.fromCharCode(65279);function z(t){return!!(t&&t.length>0&&65279===t.charCodeAt(0))}function Y(t,e=!1){return!!t&&(e&&(t=t.replace(/\\./g,"")),t.toLowerCase()!==t)}function X(t){return(t%=52)<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}function q(t){return tt.getInstance().getGraphemeBreakType(t)}function J(t,e){return 0===t?5!==e&&7!==e:(2!==t||3!==e)&&(4===t||2===t||3===t||(4===e||2===e||3===e||(8!==t||8!==e&&9!==e&&11!==e&&12!==e)&&((11!==t&&9!==t||9!==e&&10!==e)&&((12!==t&&10!==t||10!==e)&&(5!==e&&13!==e&&(7!==e&&(1!==t&&((13!==t||14!==e)&&(6!==t||6!==e)))))))))}class tt{constructor(){this._data=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]")}static getInstance(){return tt._INSTANCE||(tt._INSTANCE=new tt),tt._INSTANCE}getGraphemeBreakType(t){if(t<32)return 10===t?3:13===t?2:4;if(t<127)return 0;const e=this._data,n=e.length/3;let r=1;for(;r<=n;)if(t<e[3*r])r*=2;else{if(!(t>e[3*r+1]))return e[3*r+2];r=2*r+1}return 0}}function et(t,e){if(0===t)return 0;const n=function(t,e){let n=L(e,t);t-=nt(n);for(;rt(n)||65039===n||8419===n;){if(0===t)return;n=L(e,t),t-=nt(n)}if(!Z(n))return;if(t>=0){const n=L(e,t);8205===n&&(t-=nt(n))}return t}(t,e);if(void 0!==n)return n;return t-=nt(L(e,t))}function nt(t){return t>=65536?2:1}function rt(t){return 127995<=t&&t<=127999}tt._INSTANCE=null},72999:function(t,e,n){"use strict";function r(t){return Array.isArray(t)}function i(t){return"string"==typeof t}function s(t){return!("object"!=typeof t||null===t||Array.isArray(t)||t instanceof RegExp||t instanceof Date)}function A(t){return"number"==typeof t&&!isNaN(t)}function a(t){return!0===t||!1===t}function o(t){return void 0===t}function l(t){return!u(t)}function u(t){return o(t)||null===t}function c(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function h(t){if(u(t))throw new Error("Assertion Failed: argument is undefined or null");return t}function d(t){return"function"==typeof t}function f(t,e){const n=Math.min(t.length,e.length);for(let r=0;r<n;r++)p(t[r],e[r])}function p(t,e){if(i(e)){if(typeof t!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(d(e)){try{if(t instanceof e)return}catch(t){}if(!u(t)&&t.constructor===e)return;if(1===e.length&&!0===e.call(void 0,t))return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function g(t){const e=[];for(const n of function(t){let e=[],n=Object.getPrototypeOf(t);for(;Object.prototype!==n;)e=e.concat(Object.getOwnPropertyNames(n)),n=Object.getPrototypeOf(n);return e}(t))"function"==typeof t[n]&&e.push(n);return e}function m(t,e){const n=t=>function(){const n=Array.prototype.slice.call(arguments,0);return e(t,n)};let r={};for(const e of t)r[e]=n(e);return r}function _(t){return null===t?void 0:t}function w(t,e="Unreachable"){throw new Error(e)}n.d(e,{$E:function(){return g},$K:function(){return l},D8:function(){return f},HD:function(){return i},IU:function(){return m},Jp:function(){return u},Kn:function(){return s},cW:function(){return h},f6:function(){return _},hj:function(){return A},jn:function(){return a},kJ:function(){return r},mf:function(){return d},o8:function(){return o},p_:function(){return c},vE:function(){return w}})},13268:function(t,e,n){"use strict";function r(t,e,...n){return function(t,e){let n;return n=0===e.length?t:t.replace(/\{(\d+)\}/g,(function(t,n){const r=n[0];return void 0!==e[r]?e[r]:t})),n}(e,n)}n.d(e,{N:function(){return r}})},96236:function(t,e,n){"use strict";n.d(e,{BH:function(){return _},NZ:function(){return w},U8:function(){return y},co:function(){return m},eH:function(){return g},vr:function(){return p}});var r=n(75918),i=n(52615),s=n(4348),A=n(88226),a=n(69323),o=n(34502),l=n(35884),u=n(90689),c=n(16925),h=n(49055),d=function(t,e,n,r){var i,s=arguments.length,A=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)A=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(A=(s<3?i(A):s>3?i(e,n,A):i(e,n))||A);return s>3&&A&&Object.defineProperty(e,n,A),A},f=function(t,e){return function(n,r){e(n,r,t)}};function p(t){return void 0!==t.command}class g{constructor(t){this.id=g._idPool++,this._debugName=t}}g._idPool=0,g.CommandPalette=new g("CommandPalette"),g.EditorContext=new g("EditorContext"),g.SimpleEditorContext=new g("SimpleEditorContext"),g.EditorContextCopy=new g("EditorContextCopy"),g.EditorContextPeek=new g("EditorContextPeek"),g.MenubarEditMenu=new g("MenubarEditMenu"),g.MenubarCopy=new g("MenubarCopy"),g.MenubarGoMenu=new g("MenubarGoMenu"),g.MenubarSelectionMenu=new g("MenubarSelectionMenu"),g.InlineCompletionsActions=new g("InlineCompletionsActions");const m=(0,c.yh)("menuService"),_=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new s.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:t=>t===g.CommandPalette}}addCommand(t){return this.addCommands(A.$.single(t))}addCommands(t){for(const e of t)this._commands.set(e.id,e);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,a.OF)((()=>{let e=!1;for(const n of t)e=this._commands.delete(n.id)||e;e&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)}))}getCommand(t){return this._commands.get(t)}getCommands(){const t=new Map;return this._commands.forEach(((e,n)=>t.set(n,e))),t}appendMenuItem(t,e){return this.appendMenuItems(A.$.single({id:t,item:e}))}appendMenuItems(t){const e=new Set,n=new o.S;for(const{id:r,item:i}of t){let t=this._menuItems.get(r);t||(t=new o.S,this._menuItems.set(r,t)),n.push(t.push(i)),e.add(r)}return this._onDidChangeMenu.fire(e),(0,a.OF)((()=>{if(n.size>0){for(let t of n)t();this._onDidChangeMenu.fire(e),n.clear()}}))}getMenuItems(t){let e;return e=this._menuItems.has(t)?[...this._menuItems.get(t)]:[],t===g.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(t){const e=new Set;for(const n of t)p(n)&&(e.add(n.command.id),n.alt&&e.add(n.alt.id));this._commands.forEach(((n,r)=>{e.has(r)||t.push({command:n})}))}};class w extends r.wY{constructor(t,e,n,r){super(`submenuitem.${t.submenu.id}`,"string"==typeof t.title?t.title:t.title.value,[],"submenu"),this.item=t,this._menuService=e,this._contextKeyService=n,this._options=r}get actions(){const t=[],e=this._menuService.createMenu(this.item.submenu,this._contextKeyService),n=e.getActions(this._options);e.dispose();for(const[,e]of n)e.length>0&&(t.push(...e),t.push(new r.Z0));return t.length&&t.pop(),t}}let y=class t{constructor(e,n,r,s,A){var a,o;if(this._commandService=A,this.id=e.id,this.label=(null==r?void 0:r.renderShortTitle)&&e.shortTitle?"string"==typeof e.shortTitle?e.shortTitle:e.shortTitle.value:"string"==typeof e.title?e.title:e.title.value,this.tooltip=null!==(o="string"==typeof e.tooltip?e.tooltip:null===(a=e.tooltip)||void 0===a?void 0:a.value)&&void 0!==o?o:"",this.enabled=!e.precondition||s.contextMatchesRules(e.precondition),this.checked=void 0,e.toggled){const t=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=s.contextMatchesRules(t.condition),this.checked&&t.tooltip&&(this.tooltip="string"==typeof t.tooltip?t.tooltip:t.tooltip.value),t.title&&(this.label="string"==typeof t.title?t.title:t.title.value)}this.item=e,this.alt=n?new t(n,void 0,r,s,A):void 0,this._options=r,h.kS.isThemeIcon(e.icon)&&(this.class=i.dT.asClassName(e.icon))}dispose(){}run(...t){var e,n;let r=[];return(null===(e=this._options)||void 0===e?void 0:e.arg)&&(r=[...r,this._options.arg]),(null===(n=this._options)||void 0===n?void 0:n.shouldForwardArgs)&&(r=[...r,...t]),this._commandService.executeCommand(this.id,...r)}};y=d([f(3,u.i6),f(4,l.H)],y)},35884:function(t,e,n){"use strict";n.d(e,{H:function(){return o},P:function(){return l}});var r=n(4348),i=n(88226),s=n(69323),A=n(34502),a=n(72999);const o=(0,n(16925).yh)("commandService"),l=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new r.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(t,e){if(!t)throw new Error("invalid command");if("string"==typeof t){if(!e)throw new Error("invalid command");return this.registerCommand({id:t,handler:e})}if(t.description){const e=[];for(let n of t.description.args)e.push(n.constraint);const n=t.handler;t.handler=function(t,...r){return(0,a.D8)(r,e),n(t,...r)}}const{id:n}=t;let r=this._commands.get(n);r||(r=new A.S,this._commands.set(n,r));let i=r.unshift(t),o=(0,s.OF)((()=>{i();const t=this._commands.get(n);(null==t?void 0:t.isEmpty())&&this._commands.delete(n)}));return this._onDidRegisterCommand.fire(n),o}registerCommandAlias(t,e){return l.registerCommand(t,((t,...n)=>t.get(o).executeCommand(e,...n)))}getCommand(t){const e=this._commands.get(t);if(e&&!e.isEmpty())return i.$.first(e)}getCommands(){const t=new Map;for(const e of this._commands.keys()){const n=this.getCommand(e);n&&t.set(e,n)}return t}};l.registerCommand("noop",(()=>{}))},90689:function(t,e,n){"use strict";n.d(e,{Ao:function(){return l},Eq:function(){return D},Fb:function(){return u},K8:function(){return R},i6:function(){return I},uy:function(){return x}});var r=n(23345),i=n(82983),s=n(16925);let A=r.WE||"";const a=new Map;a.set("false",!1),a.set("true",!0),a.set("isMac",r.dz),a.set("isLinux",r.IJ),a.set("isWindows",r.ED),a.set("isWeb",r.$L),a.set("isMacNative",r.dz&&!r.$L),a.set("isEdge",A.indexOf("Edg/")>=0),a.set("isFirefox",A.indexOf("Firefox")>=0),a.set("isChrome",A.indexOf("Chrome")>=0),a.set("isSafari",A.indexOf("Safari")>=0);const o=Object.prototype.hasOwnProperty;class l{static has(t){return f.create(t)}static equals(t,e){return p.create(t,e)}static regex(t,e){return C.create(t,e)}static not(t){return w.create(t)}static and(...t){return T.create(t,null)}static or(...t){return S.create(t,null,!0)}static deserialize(t,e=!1){if(t)return this._deserializeOrExpression(t,e)}static _deserializeOrExpression(t,e){let n=t.split("||");return S.create(n.map((t=>this._deserializeAndExpression(t,e))),null,!0)}static _deserializeAndExpression(t,e){let n=t.split("&&");return T.create(n.map((t=>this._deserializeOne(t,e))),null)}static _deserializeOne(t,e){if((t=t.trim()).indexOf("!=")>=0){let n=t.split("!=");return _.create(n[0].trim(),this._deserializeValue(n[1],e))}if(t.indexOf("==")>=0){let n=t.split("==");return p.create(n[0].trim(),this._deserializeValue(n[1],e))}if(t.indexOf("=~")>=0){let n=t.split("=~");return C.create(n[0].trim(),this._deserializeRegexValue(n[1],e))}if(t.indexOf(" in ")>=0){let e=t.split(" in ");return g.create(e[0].trim(),e[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(t)){const e=t.split(">=");return B.create(e[0].trim(),e[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(t)){const e=t.split(">");return v.create(e[0].trim(),e[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(t)){const e=t.split("<=");return E.create(e[0].trim(),e[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(t)){const e=t.split("<");return b.create(e[0].trim(),e[1].trim())}return/^\!\s*/.test(t)?w.create(t.substr(1).trim()):f.create(t)}static _deserializeValue(t,e){if("true"===(t=t.trim()))return!0;if("false"===t)return!1;let n=/^'([^']*)'$/.exec(t);return n?n[1].trim():t}static _deserializeRegexValue(t,e){if((0,i.m5)(t)){if(e)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let n=t.indexOf("/"),r=t.lastIndexOf("/");if(n===r||n<0){if(e)throw new Error(`bad regexp-value '${t}', missing /-enclosure`);return console.warn(`bad regexp-value '${t}', missing /-enclosure`),null}let s=t.slice(n+1,r),A="i"===t[r+1]?"i":"";try{return new RegExp(s,A)}catch(n){if(e)throw new Error(`bad regexp-value '${t}', parse error: ${n}`);return console.warn(`bad regexp-value '${t}', parse error: ${n}`),null}}}function u(t,e){const n=t?t.substituteConstants():void 0,r=e?e.substituteConstants():void 0;return!n&&!r||!(!n||!r)&&n.equals(r)}function c(t,e){return t.cmp(e)}class h{constructor(){this.type=0}cmp(t){return this.type-t.type}equals(t){return t.type===this.type}substituteConstants(){return this}evaluate(t){return!1}serialize(){return"false"}keys(){return[]}negate(){return d.INSTANCE}}h.INSTANCE=new h;class d{constructor(){this.type=1}cmp(t){return this.type-t.type}equals(t){return t.type===this.type}substituteConstants(){return this}evaluate(t){return!0}serialize(){return"true"}keys(){return[]}negate(){return h.INSTANCE}}d.INSTANCE=new d;class f{constructor(t,e){this.key=t,this.negated=e,this.type=2}static create(t,e=null){const n=a.get(t);return"boolean"==typeof n?n?d.INSTANCE:h.INSTANCE:new f(t,e)}cmp(t){return t.type!==this.type?this.type-t.type:U(this.key,t.key)}equals(t){return t.type===this.type&&this.key===t.key}substituteConstants(){const t=a.get(this.key);return"boolean"==typeof t?t?d.INSTANCE:h.INSTANCE:this}evaluate(t){return!!t.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=w.create(this.key,this)),this.negated}}class p{constructor(t,e,n){this.key=t,this.value=e,this.negated=n,this.type=4}static create(t,e,n=null){if("boolean"==typeof e)return e?f.create(t,n):w.create(t,n);const r=a.get(t);if("boolean"==typeof r){return e===(r?"true":"false")?d.INSTANCE:h.INSTANCE}return new p(t,e,n)}cmp(t){return t.type!==this.type?this.type-t.type:L(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type&&(this.key===t.key&&this.value===t.value)}substituteConstants(){const t=a.get(this.key);if("boolean"==typeof t){const e=t?"true":"false";return this.value===e?d.INSTANCE:h.INSTANCE}return this}evaluate(t){return t.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_.create(this.key,this.value,this)),this.negated}}class g{constructor(t,e){this.key=t,this.valueKey=e,this.type=10,this.negated=null}static create(t,e){return new g(t,e)}cmp(t){return t.type!==this.type?this.type-t.type:L(this.key,this.valueKey,t.key,t.valueKey)}equals(t){return t.type===this.type&&(this.key===t.key&&this.valueKey===t.valueKey)}substituteConstants(){return this}evaluate(t){const e=t.getValue(this.valueKey),n=t.getValue(this.key);return Array.isArray(e)?e.indexOf(n)>=0:"string"==typeof n&&"object"==typeof e&&null!==e&&o.call(e,n)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=m.create(this)),this.negated}}class m{constructor(t){this._actual=t,this.type=11}static create(t){return new m(t)}cmp(t){return t.type!==this.type?this.type-t.type:this._actual.cmp(t._actual)}equals(t){return t.type===this.type&&this._actual.equals(t._actual)}substituteConstants(){return this}evaluate(t){return!this._actual.evaluate(t)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class _{constructor(t,e,n){this.key=t,this.value=e,this.negated=n,this.type=5}static create(t,e,n=null){if("boolean"==typeof e)return e?w.create(t,n):f.create(t,n);const r=a.get(t);if("boolean"==typeof r){return e===(r?"true":"false")?h.INSTANCE:d.INSTANCE}return new _(t,e,n)}cmp(t){return t.type!==this.type?this.type-t.type:L(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type&&(this.key===t.key&&this.value===t.value)}substituteConstants(){const t=a.get(this.key);if("boolean"==typeof t){const e=t?"true":"false";return this.value===e?h.INSTANCE:d.INSTANCE}return this}evaluate(t){return t.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this.value,this)),this.negated}}class w{constructor(t,e){this.key=t,this.negated=e,this.type=3}static create(t,e=null){const n=a.get(t);return"boolean"==typeof n?n?h.INSTANCE:d.INSTANCE:new w(t,e)}cmp(t){return t.type!==this.type?this.type-t.type:U(this.key,t.key)}equals(t){return t.type===this.type&&this.key===t.key}substituteConstants(){const t=a.get(this.key);return"boolean"==typeof t?t?h.INSTANCE:d.INSTANCE:this}evaluate(t){return!t.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this)),this.negated}}function y(t,e){if("string"==typeof t){const e=parseFloat(t);isNaN(e)||(t=e)}return"string"==typeof t||"number"==typeof t?e(t):h.INSTANCE}class v{constructor(t,e,n){this.key=t,this.value=e,this.negated=n,this.type=12}static create(t,e,n=null){return y(e,(e=>new v(t,e,n)))}cmp(t){return t.type!==this.type?this.type-t.type:L(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type&&(this.key===t.key&&this.value===t.value)}substituteConstants(){return this}evaluate(t){return"string"!=typeof this.value&&parseFloat(t.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class B{constructor(t,e,n){this.key=t,this.value=e,this.negated=n,this.type=13}static create(t,e,n=null){return y(e,(e=>new B(t,e,n)))}cmp(t){return t.type!==this.type?this.type-t.type:L(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type&&(this.key===t.key&&this.value===t.value)}substituteConstants(){return this}evaluate(t){return"string"!=typeof this.value&&parseFloat(t.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=b.create(this.key,this.value,this)),this.negated}}class b{constructor(t,e,n){this.key=t,this.value=e,this.negated=n,this.type=14}static create(t,e,n=null){return y(e,(e=>new b(t,e,n)))}cmp(t){return t.type!==this.type?this.type-t.type:L(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type&&(this.key===t.key&&this.value===t.value)}substituteConstants(){return this}evaluate(t){return"string"!=typeof this.value&&parseFloat(t.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=B.create(this.key,this.value,this)),this.negated}}class E{constructor(t,e,n){this.key=t,this.value=e,this.negated=n,this.type=15}static create(t,e,n=null){return y(e,(e=>new E(t,e,n)))}cmp(t){return t.type!==this.type?this.type-t.type:L(this.key,this.value,t.key,t.value)}equals(t){return t.type===this.type&&(this.key===t.key&&this.value===t.value)}substituteConstants(){return this}evaluate(t){return"string"!=typeof this.value&&parseFloat(t.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 C{constructor(t,e){this.key=t,this.regexp=e,this.type=7,this.negated=null}static create(t,e){return new C(t,e)}cmp(t){if(t.type!==this.type)return this.type-t.type;if(this.key<t.key)return-1;if(this.key>t.key)return 1;const e=this.regexp?this.regexp.source:"",n=t.regexp?t.regexp.source:"";return e<n?-1:e>n?1:0}equals(t){if(t.type===this.type){const e=this.regexp?this.regexp.source:"",n=t.regexp?t.regexp.source:"";return this.key===t.key&&e===n}return!1}substituteConstants(){return this}evaluate(t){let e=t.getValue(this.key);return!!this.regexp&&this.regexp.test(e)}serialize(){const t=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${t}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=k.create(this)),this.negated}}class k{constructor(t){this._actual=t,this.type=8}static create(t){return new k(t)}cmp(t){return t.type!==this.type?this.type-t.type:this._actual.cmp(t._actual)}equals(t){return t.type===this.type&&this._actual.equals(t._actual)}substituteConstants(){return this}evaluate(t){return!this._actual.evaluate(t)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function F(t){let e=null;for(let n=0,r=t.length;n<r;n++){const r=t[n].substituteConstants();if(t[n]!==r&&null===e){e=[];for(let r=0;r<n;r++)e[r]=t[r]}null!==e&&(e[n]=r)}return null===e?t:e}class T{constructor(t,e){this.expr=t,this.negated=e,this.type=6}static create(t,e){return T._normalizeArr(t,e)}cmp(t){if(t.type!==this.type)return this.type-t.type;if(this.expr.length<t.expr.length)return-1;if(this.expr.length>t.expr.length)return 1;for(let e=0,n=this.expr.length;e<n;e++){const n=c(this.expr[e],t.expr[e]);if(0!==n)return n}return 0}equals(t){if(t.type===this.type){if(this.expr.length!==t.expr.length)return!1;for(let e=0,n=this.expr.length;e<n;e++)if(!this.expr[e].equals(t.expr[e]))return!1;return!0}return!1}substituteConstants(){const t=F(this.expr);return t===this.expr?this:T.create(t,this.negated)}evaluate(t){for(let e=0,n=this.expr.length;e<n;e++)if(!this.expr[e].evaluate(t))return!1;return!0}static _normalizeArr(t,e){const n=[];let r=!1;for(const e of t)if(e)if(1!==e.type){if(0===e.type)return h.INSTANCE;6!==e.type?n.push(e):n.push(...e.expr)}else r=!0;if(0===n.length&&r)return d.INSTANCE;if(0!==n.length){if(1===n.length)return n[0];n.sort(c);for(let t=1;t<n.length;t++)n[t-1].equals(n[t])&&(n.splice(t,1),t--);if(1===n.length)return n[0];for(;n.length>1;){const t=n[n.length-1];if(9!==t.type)break;n.pop();const e=n.pop(),r=0===n.length,i=S.create(t.expr.map((t=>T.create([t,e],null))),null,r);i&&(n.push(i),n.sort(c))}return 1===n.length?n[0]:new T(n,e)}}serialize(){return this.expr.map((t=>t.serialize())).join(" && ")}keys(){const t=[];for(let e of this.expr)t.push(...e.keys());return t}negate(){if(!this.negated){const t=[];for(let e of this.expr)t.push(e.negate());this.negated=S.create(t,this,!0)}return this.negated}}class S{constructor(t,e){this.expr=t,this.negated=e,this.type=9}static create(t,e,n){return S._normalizeArr(t,e,n)}cmp(t){if(t.type!==this.type)return this.type-t.type;if(this.expr.length<t.expr.length)return-1;if(this.expr.length>t.expr.length)return 1;for(let e=0,n=this.expr.length;e<n;e++){const n=c(this.expr[e],t.expr[e]);if(0!==n)return n}return 0}equals(t){if(t.type===this.type){if(this.expr.length!==t.expr.length)return!1;for(let e=0,n=this.expr.length;e<n;e++)if(!this.expr[e].equals(t.expr[e]))return!1;return!0}return!1}substituteConstants(){const t=F(this.expr);return t===this.expr?this:S.create(t,this.negated,!1)}evaluate(t){for(let e=0,n=this.expr.length;e<n;e++)if(this.expr[e].evaluate(t))return!0;return!1}static _normalizeArr(t,e,n){let r=[],i=!1;if(t){for(let e=0,n=t.length;e<n;e++){const n=t[e];if(n)if(0!==n.type){if(1===n.type)return d.INSTANCE;9!==n.type?r.push(n):r=r.concat(n.expr)}else i=!0}if(0===r.length&&i)return h.INSTANCE;r.sort(c)}if(0!==r.length){if(1===r.length)return r[0];for(let t=1;t<r.length;t++)r[t-1].equals(r[t])&&(r.splice(t,1),t--);if(1===r.length)return r[0];if(n){for(let t=0;t<r.length;t++)for(let e=t+1;e<r.length;e++)R(r[t],r[e])&&(r.splice(e,1),e--);if(1===r.length)return r[0]}return new S(r,e)}}serialize(){return this.expr.map((t=>t.serialize())).join(" || ")}keys(){const t=[];for(let e of this.expr)t.push(...e.keys());return t}negate(){if(!this.negated){let t=[];for(let e of this.expr)t.push(e.negate());for(;t.length>1;){const e=t.shift(),n=t.shift(),r=[];for(const t of Q(e))for(const e of Q(n))r.push(T.create([t,e],null));const i=0===t.length;t.unshift(S.create(r,null,i))}this.negated=t[0]}return this.negated}}class x extends f{constructor(t,e,n){super(t,null),this._defaultValue=e,"object"==typeof n?x._info.push(Object.assign(Object.assign({},n),{key:t})):!0!==n&&x._info.push({key:t,description:n,type:null!=e?typeof e:void 0})}static all(){return x._info.values()}bindTo(t){return t.createKey(this.key,this._defaultValue)}getValue(t){return t.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(t){return p.create(this.key,t)}}x._info=[];const I=(0,s.yh)("contextKeyService"),D="setContext";function U(t,e){return t<e?-1:t>e?1:0}function L(t,e,n,r){return t<n?-1:t>n?1:e<r?-1:e>r?1:0}function R(t,e){if(6===e.type&&9!==t.type&&6!==t.type)for(const n of e.expr)if(t.equals(n))return!0;const n=Q(t.negate()).concat(Q(e));n.sort(c);for(let t=0;t<n.length;t++){const e=n[t].negate();for(let r=t+1;r<n.length;r++){const t=n[r];if(e.equals(t))return!0}}return!1}function Q(t){return 9===t.type?t.expr:[t]}},16925:function(t,e,n){"use strict";var r;n.d(e,{I8:function(){return r},TG:function(){return i},jt:function(){return a},yh:function(){return A}}),function(t){t.serviceIds=new Map,t.DI_TARGET="$di$target",t.DI_DEPENDENCIES="$di$dependencies",t.getServiceDependencies=function(e){return e[t.DI_DEPENDENCIES]||[]}}(r||(r={}));const i=A("instantiationService");function s(t,e,n,i){e[r.DI_TARGET]===e?e[r.DI_DEPENDENCIES].push({id:t,index:n,optional:i}):(e[r.DI_DEPENDENCIES]=[{id:t,index:n,optional:i}],e[r.DI_TARGET]=e)}function A(t){if(r.serviceIds.has(t))return r.serviceIds.get(t);const e=function(t,n,r){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");s(e,t,r,!1)};return e.toString=()=>t,r.serviceIds.set(t,e),e}function a(t){return function(e,n,r){if(3!==arguments.length)throw new Error("@optional-decorator can only be used to decorate a parameter");s(t,e,r,!0)}}},44650:function(t,e,n){"use strict";n.d(e,{B:function(){return s}});var r=n(76068),i=n(72999);const s=new class{constructor(){this.data=new Map}add(t,e){r.ok(i.HD(t)),r.ok(i.Kn(e)),r.ok(!this.data.has(t),"There is already an extension with this id"),this.data.set(t,e)}as(t){return this.data.get(t)||null}}},66213:function(t,e,n){"use strict";var r;n.d(e,{e:function(){return r}}),function(t){t.DARK="dark",t.LIGHT="light",t.HIGH_CONTRAST="hc"}(r||(r={}))},49055:function(t,e,n){"use strict";n.d(e,{EN:function(){return h},IP:function(){return f},Ic:function(){return g},XE:function(){return l},bB:function(){return m},kS:function(){return c},m6:function(){return d}});var r=n(52615),i=n(4348),s=n(69323),A=n(16925),a=n(44650),o=n(66213);const l=(0,A.yh)("themeService");var u,c;function h(t){return{id:t}}function d(t){switch(t){case o.e.DARK:return"vs-dark";case o.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}!function(t){t.isThemeColor=function(t){return t&&"object"==typeof t&&"string"==typeof t.id}}(u||(u={})),function(t){t.isThemeIcon=function(t){return t&&"object"==typeof t&&"string"==typeof t.id&&(void 0===t.color||u.isThemeColor(t.color))};const e=new RegExp(`^\\$\\((${r.dT.iconNameExpression}(?:${r.dT.iconModifierExpression})?)\\)$`);t.fromString=function(t){const n=e.exec(t);if(!n)return;let[,r]=n;return{id:r}},t.modify=function(t,e){let n=t.id;const r=n.lastIndexOf("~");return-1!==r&&(n=n.substring(0,r)),e&&(n=`${n}~${e}`),{id:n}},t.isEqual=function(t,e){var n,r;return t.id===e.id&&(null===(n=t.color)||void 0===n?void 0:n.id)===(null===(r=e.color)||void 0===r?void 0:r.id)},t.asThemeIcon=function(t,e){return{id:t.id,color:e?h(e):void 0}},t.asClassNameArray=r.dT.asClassNameArray,t.asClassName=r.dT.asClassName,t.asCSSSelector=r.dT.asCSSSelector}(c||(c={}));const f={ThemingContribution:"base.contributions.theming"};let p=new class{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new i.Q5}onColorThemeChange(t){return this.themingParticipants.push(t),this.onThemingParticipantAddedEmitter.fire(t),(0,s.OF)((()=>{const e=this.themingParticipants.indexOf(t);this.themingParticipants.splice(e,1)}))}getThemingParticipants(){return this.themingParticipants}};function g(t){return p.onColorThemeChange(t)}a.B.add(f.ThemingContribution,p);class m extends s.JT{constructor(t){super(),this.themeService=t,this.theme=t.getColorTheme(),this._register(this.themeService.onDidColorThemeChange((t=>this.onThemeChange(t))))}onThemeChange(t){this.theme=t,this.updateStyles()}updateStyles(){}}},16632:function(t,e,n){"use strict";var r=n(54476),i=n(33885),s=n(20068),A=n(42978),a=n(75931),o=n(92310),l=n.n(o),u=n(18929),c=n(59301),h=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],d=(0,c.forwardRef)((function(t,e){var n=t.prefixCls,o=void 0===n?"rc-checkbox":n,d=t.className,f=t.style,p=t.checked,g=t.disabled,m=t.defaultChecked,_=void 0!==m&&m,w=t.type,y=void 0===w?"checkbox":w,v=t.title,B=t.onChange,b=(0,a.Z)(t,h),E=(0,c.useRef)(null),C=(0,c.useRef)(null),k=(0,u.Z)(_,{value:p}),F=(0,A.Z)(k,2),T=F[0],S=F[1];(0,c.useImperativeHandle)(e,(function(){return{focus:function(t){var e;null===(e=E.current)||void 0===e||e.focus(t)},blur:function(){var t;null===(t=E.current)||void 0===t||t.blur()},input:E.current,nativeElement:C.current}}));var x=l()(o,d,(0,s.Z)((0,s.Z)({},"".concat(o,"-checked"),T),"".concat(o,"-disabled"),g));return c.createElement("span",{className:x,title:v,style:f,ref:C},c.createElement("input",(0,r.Z)({},b,{className:"".concat(o,"-input"),ref:E,onChange:function(e){g||("checked"in t||S(e.target.checked),null==B||B({target:(0,i.Z)((0,i.Z)({},t),{},{type:y,checked:e.target.checked}),stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},nativeEvent:e.nativeEvent}))},disabled:g,checked:!!T,type:y})),c.createElement("span",{className:"".concat(o,"-inner")}))}));e.Z=d},96478:function(t,e,n){"use strict";n.d(e,{Z:function(){return B}});var r=n(54476),i=n(20068),s=n(42978),A=n(75931),a=n(65030),o=n(92310),l=n.n(o),u=n(8654),c=n(59301),h=n(10228),d=n(16089),f=h.Z.ESC,p=h.Z.TAB;var g=(0,c.forwardRef)((function(t,e){var n=t.overlay,r=t.arrow,i=t.prefixCls,s=(0,c.useMemo)((function(){return"function"==typeof n?n():n}),[n]),A=(0,u.sQ)(e,(0,u.C4)(s));return c.createElement(c.Fragment,null,r&&c.createElement("div",{className:"".concat(i,"-arrow")}),c.cloneElement(s,{ref:(0,u.Yr)(s)?A:void 0}))})),m={adjustX:1,adjustY:1},_=[0,0],w={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:_}},y=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function v(t,e){var n,o=t.arrow,h=void 0!==o&&o,m=t.prefixCls,_=void 0===m?"rc-dropdown":m,v=t.transitionName,B=t.animation,b=t.align,E=t.placement,C=void 0===E?"bottomLeft":E,k=t.placements,F=void 0===k?w:k,T=t.getPopupContainer,S=t.showAction,x=t.hideAction,I=t.overlayClassName,D=t.overlayStyle,U=t.visible,L=t.trigger,R=void 0===L?["hover"]:L,Q=t.autoFocus,O=t.overlay,P=t.children,M=t.onVisibleChange,N=(0,A.Z)(t,y),H=c.useState(),K=(0,s.Z)(H,2),$=K[0],G=K[1],V="visible"in t?U:$,j=c.useRef(null),Z=c.useRef(null),W=c.useRef(null);c.useImperativeHandle(e,(function(){return j.current}));var z=function(t){G(t),null==M||M(t)};!function(t){var e=t.visible,n=t.triggerRef,r=t.onVisibleChange,i=t.autoFocus,s=t.overlayRef,A=c.useRef(!1),a=function(){var t,i;e&&(null===(t=n.current)||void 0===t||null===(i=t.focus)||void 0===i||i.call(t),null==r||r(!1))},o=function(){var t;return!(null===(t=s.current)||void 0===t||!t.focus||(s.current.focus(),A.current=!0,0))},l=function(t){switch(t.keyCode){case f:a();break;case p:var e=!1;A.current||(e=o()),e?t.preventDefault():a()}};c.useEffect((function(){return e?(window.addEventListener("keydown",l),i&&(0,d.Z)(o,3),function(){window.removeEventListener("keydown",l),A.current=!1}):function(){A.current=!1}}),[e])}({visible:V,triggerRef:W,onVisibleChange:z,autoFocus:Q,overlayRef:Z});var Y,X,q,J=function(){return c.createElement(g,{ref:Z,overlay:O,prefixCls:_,arrow:h})},tt=c.cloneElement(P,{className:l()(null===(n=P.props)||void 0===n?void 0:n.className,V&&(Y=t.openClassName,void 0!==Y?Y:"".concat(_,"-open"))),ref:(0,u.Yr)(P)?(0,u.sQ)(W,(0,u.C4)(P)):void 0}),et=x;return et||-1===R.indexOf("contextMenu")||(et=["click"]),c.createElement(a.Z,(0,r.Z)({builtinPlacements:F},N,{prefixCls:_,ref:j,popupClassName:l()(I,(0,i.Z)({},"".concat(_,"-show-arrow"),h)),popupStyle:D,action:R,showAction:S,hideAction:et,popupPlacement:C,popupAlign:b,popupTransitionName:v,popupAnimation:B,popupVisible:V,stretch:(X=t.minOverlayWidthMatchTrigger,q=t.alignPoint,("minOverlayWidthMatchTrigger"in t?X:!q)?"minWidth":""),popup:"function"==typeof O?J:J(),onPopupVisibleChange:z,onPopupClick:function(e){var n=t.onOverlayClick;G(!1),n&&n(e)},getPopupContainer:T}),tt)}var B=c.forwardRef(v)},20922:function(t,e,n){"use strict";n.d(e,{Z:function(){return N}});var r=n(54476),i=n(20068),s=n(76190),A=n(42978),a=n(75931),o=n(67732),l=n(83652);function u(){return"function"==typeof BigInt}function c(t){return!t&&0!==t&&!Number.isNaN(t)||!String(t).trim()}function h(t){var e=t.trim(),n=e.startsWith("-");n&&(e=e.slice(1)),(e=e.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,"")).startsWith(".")&&(e="0".concat(e));var r=e||"0",i=r.split("."),s=i[0]||"0",A=i[1]||"0";"0"===s&&"0"===A&&(n=!1);var a=n?"-":"";return{negative:n,negativeStr:a,trimStr:r,integerStr:s,decimalStr:A,fullStr:"".concat(a).concat(r)}}function d(t){var e=String(t);return!Number.isNaN(Number(e))&&e.includes("e")}function f(t){var e=String(t);if(d(t)){var n=Number(e.slice(e.indexOf("e-")+2)),r=e.match(/\.(\d+)/);return null!=r&&r[1]&&(n+=r[1].length),n}return e.includes(".")&&g(e)?e.length-e.indexOf(".")-1:0}function p(t){var e=String(t);if(d(t)){if(t>Number.MAX_SAFE_INTEGER)return String(u()?BigInt(t).toString():Number.MAX_SAFE_INTEGER);if(t<Number.MIN_SAFE_INTEGER)return String(u()?BigInt(t).toString():Number.MIN_SAFE_INTEGER);e=t.toFixed(f(e))}return h(e).fullStr}function g(t){return"number"==typeof t?!Number.isNaN(t):!!t&&(/^\s*-?\d+(\.\d+)?\s*$/.test(t)||/^\s*-?\d+\.\s*$/.test(t)||/^\s*-?\.\d+\s*$/.test(t))}var m=function(){function t(e){if((0,o.Z)(this,t),(0,i.Z)(this,"origin",""),(0,i.Z)(this,"negative",void 0),(0,i.Z)(this,"integer",void 0),(0,i.Z)(this,"decimal",void 0),(0,i.Z)(this,"decimalLen",void 0),(0,i.Z)(this,"empty",void 0),(0,i.Z)(this,"nan",void 0),c(e))this.empty=!0;else if(this.origin=String(e),"-"===e||Number.isNaN(e))this.nan=!0;else{var n=e;if(d(n)&&(n=Number(n)),g(n="string"==typeof n?n:p(n))){var r=h(n);this.negative=r.negative;var s=r.trimStr.split(".");this.integer=BigInt(s[0]);var A=s[1]||"0";this.decimal=BigInt(A),this.decimalLen=A.length}else this.nan=!0}}return(0,l.Z)(t,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(t){var e="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(t,"0"));return BigInt(e)}},{key:"negate",value:function(){var e=new t(this.toString());return e.negative=!e.negative,e}},{key:"cal",value:function(e,n,r){var i=Math.max(this.getDecimalStr().length,e.getDecimalStr().length),s=n(this.alignDecimal(i),e.alignDecimal(i)).toString(),A=r(i),a=h(s),o=a.negativeStr,l=a.trimStr,u="".concat(o).concat(l.padStart(A+1,"0"));return new t("".concat(u.slice(0,-A),".").concat(u.slice(-A)))}},{key:"add",value:function(e){if(this.isInvalidate())return new t(e);var n=new t(e);return n.isInvalidate()?this:this.cal(n,(function(t,e){return t+e}),(function(t){return t}))}},{key:"multi",value:function(e){var n=new t(e);return this.isInvalidate()||n.isInvalidate()?new t(NaN):this.cal(n,(function(t,e){return t*e}),(function(t){return 2*t}))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(t){return this.toString()===(null==t?void 0:t.toString())}},{key:"lessEquals",value:function(t){return this.add(t.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t?this.isInvalidate()?"":h("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),t}(),_=function(){function t(e){(0,o.Z)(this,t),(0,i.Z)(this,"origin",""),(0,i.Z)(this,"number",void 0),(0,i.Z)(this,"empty",void 0),c(e)?this.empty=!0:(this.origin=String(e),this.number=Number(e))}return(0,l.Z)(t,[{key:"negate",value:function(){return new t(-this.toNumber())}},{key:"add",value:function(e){if(this.isInvalidate())return new t(e);var n=Number(e);if(Number.isNaN(n))return this;var r=this.number+n;if(r>Number.MAX_SAFE_INTEGER)return new t(Number.MAX_SAFE_INTEGER);if(r<Number.MIN_SAFE_INTEGER)return new t(Number.MIN_SAFE_INTEGER);var i=Math.max(f(this.number),f(n));return new t(r.toFixed(i))}},{key:"multi",value:function(e){var n=Number(e);if(this.isInvalidate()||Number.isNaN(n))return new t(NaN);var r=this.number*n;if(r>Number.MAX_SAFE_INTEGER)return new t(Number.MAX_SAFE_INTEGER);if(r<Number.MIN_SAFE_INTEGER)return new t(Number.MIN_SAFE_INTEGER);var i=Math.max(f(this.number),f(n));return new t(r.toFixed(i))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(t){return this.toNumber()===(null==t?void 0:t.toNumber())}},{key:"lessEquals",value:function(t){return this.add(t.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t?this.isInvalidate()?"":p(this.number):this.origin}}]),t}();function w(t){return u()?new m(t):new _(t)}function y(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(""===t)return"";var i=h(t),s=i.negativeStr,A=i.integerStr,a=i.decimalStr,o="".concat(e).concat(a),l="".concat(s).concat(A);if(n>=0){var u=Number(a[n]);if(u>=5&&!r){var c=w(t).add("".concat(s,"0.").concat("0".repeat(n)).concat(10-u));return y(c.toString(),e,n,r)}return 0===n?l:"".concat(l).concat(e).concat(a.padEnd(n,"0").slice(0,n))}return".0"===o?l:"".concat(l).concat(o)}var v=w,B=n(92310),b=n.n(B),E=n(36901),C=n(34280);var k=n(8654),F=n(59301),T=n(48736);var S=n(49658),x=function(){var t=(0,F.useState)(!1),e=(0,A.Z)(t,2),n=e[0],r=e[1];return(0,C.Z)((function(){r((0,S.Z)())}),[]),n},I=n(16089);function D(t){var e=t.prefixCls,n=t.upNode,s=t.downNode,A=t.upDisabled,a=t.downDisabled,o=t.onStep,l=F.useRef(),u=F.useRef([]),c=F.useRef();c.current=o;var h=function(){clearTimeout(l.current)},d=function(t,e){t.preventDefault(),h(),c.current(e),l.current=setTimeout((function t(){c.current(e),l.current=setTimeout(t,200)}),600)};if(F.useEffect((function(){return function(){h(),u.current.forEach((function(t){return I.Z.cancel(t)}))}}),[]),x())return null;var f="".concat(e,"-handler"),p=b()(f,"".concat(f,"-up"),(0,i.Z)({},"".concat(f,"-up-disabled"),A)),g=b()(f,"".concat(f,"-down"),(0,i.Z)({},"".concat(f,"-down-disabled"),a)),m=function(){return u.current.push((0,I.Z)(h))},_={unselectable:"on",role:"button",onMouseUp:m,onMouseLeave:m};return F.createElement("div",{className:"".concat(f,"-wrap")},F.createElement("span",(0,r.Z)({},_,{onMouseDown:function(t){d(t,!0)},"aria-label":"Increase Value","aria-disabled":A,className:p}),n||F.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-up-inner")})),F.createElement("span",(0,r.Z)({},_,{onMouseDown:function(t){d(t,!1)},"aria-label":"Decrease Value","aria-disabled":a,className:g}),s||F.createElement("span",{unselectable:"on",className:"".concat(e,"-handler-down-inner")})))}function U(t){var e="number"==typeof t?p(t):h(t).fullStr;return e.includes(".")?h(e.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:t+"0"}var L=n(30292),R=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","changeOnWheel","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","changeOnBlur","domRef"],Q=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","className","classNames"],O=function(t,e){return t||e.isEmpty()?e.toString():e.toNumber()},P=function(t){var e=v(t);return e.isInvalidate()?null:e},M=F.forwardRef((function(t,e){var n=t.prefixCls,o=t.className,l=t.style,u=t.min,c=t.max,h=t.step,d=void 0===h?1:h,m=t.defaultValue,_=t.value,w=t.disabled,B=t.readOnly,E=t.upHandler,S=t.downHandler,x=t.keyboard,L=t.changeOnWheel,Q=void 0!==L&&L,M=t.controls,N=void 0===M||M,H=(t.classNames,t.stringMode),K=t.parser,$=t.formatter,G=t.precision,V=t.decimalSeparator,j=t.onChange,Z=t.onInput,W=t.onPressEnter,z=t.onStep,Y=t.changeOnBlur,X=void 0===Y||Y,q=t.domRef,J=(0,a.Z)(t,R),tt="".concat(n,"-input"),et=F.useRef(null),nt=F.useState(!1),rt=(0,A.Z)(nt,2),it=rt[0],st=rt[1],At=F.useRef(!1),at=F.useRef(!1),ot=F.useRef(!1),lt=F.useState((function(){return v(null!=_?_:m)})),ut=(0,A.Z)(lt,2),ct=ut[0],ht=ut[1];var dt=F.useCallback((function(t,e){if(!e)return G>=0?G:Math.max(f(t),f(d))}),[G,d]),ft=F.useCallback((function(t){var e=String(t);if(K)return K(e);var n=e;return V&&(n=n.replace(V,".")),n.replace(/[^\w.-]+/g,"")}),[K,V]),pt=F.useRef(""),gt=F.useCallback((function(t,e){if($)return $(t,{userTyping:e,input:String(pt.current)});var n="number"==typeof t?p(t):t;if(!e){var r=dt(n,e);if(g(n)&&(V||r>=0))n=y(n,V||".",r)}return n}),[$,dt,V]),mt=F.useState((function(){var t=null!=m?m:_;return ct.isInvalidate()&&["string","number"].includes((0,s.Z)(t))?Number.isNaN(t)?"":t:gt(ct.toString(),!1)})),_t=(0,A.Z)(mt,2),wt=_t[0],yt=_t[1];function vt(t,e){yt(gt(t.isInvalidate()?t.toString(!1):t.toString(!e),e))}pt.current=wt;var Bt,bt,Et,Ct,kt,Ft=F.useMemo((function(){return P(c)}),[c,G]),Tt=F.useMemo((function(){return P(u)}),[u,G]),St=F.useMemo((function(){return!(!Ft||!ct||ct.isInvalidate())&&Ft.lessEquals(ct)}),[Ft,ct]),xt=F.useMemo((function(){return!(!Tt||!ct||ct.isInvalidate())&&ct.lessEquals(Tt)}),[Tt,ct]),It=(Bt=et.current,bt=it,Et=(0,F.useRef)(null),[function(){try{var t=Bt.selectionStart,e=Bt.selectionEnd,n=Bt.value,r=n.substring(0,t),i=n.substring(e);Et.current={start:t,end:e,value:n,beforeTxt:r,afterTxt:i}}catch(t){}},function(){if(Bt&&Et.current&&bt)try{var t=Bt.value,e=Et.current,n=e.beforeTxt,r=e.afterTxt,i=e.start,s=t.length;if(t.startsWith(n))s=n.length;else if(t.endsWith(r))s=t.length-Et.current.afterTxt.length;else{var A=n[i-1],a=t.indexOf(A,i-1);-1!==a&&(s=a+1)}Bt.setSelectionRange(s,s)}catch(t){(0,T.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(t.message))}}]),Dt=(0,A.Z)(It,2),Ut=Dt[0],Lt=Dt[1],Rt=function(t){return Ft&&!t.lessEquals(Ft)?Ft:Tt&&!Tt.lessEquals(t)?Tt:null},Qt=function(t){return!Rt(t)},Ot=function(t,e){var n,r=t,i=Qt(r)||r.isEmpty();if(r.isEmpty()||e||(r=Rt(r)||r,i=!0),!B&&!w&&i){var s=r.toString(),A=dt(s,e);return A>=0&&(r=v(y(s,".",A)),Qt(r)||(r=v(y(s,".",A,!0)))),r.equals(ct)||(n=r,void 0===_&&ht(n),null==j||j(r.isEmpty()?null:O(H,r)),void 0===_&&vt(r,e)),r}return ct},Pt=(Ct=(0,F.useRef)(0),kt=function(){I.Z.cancel(Ct.current)},(0,F.useEffect)((function(){return kt}),[]),function(t){kt(),Ct.current=(0,I.Z)((function(){t()}))}),Mt=function t(e){if(Ut(),pt.current=e,yt(e),!at.current){var n=ft(e),r=v(n);r.isNaN()||Ot(r,!0)}null==Z||Z(e),Pt((function(){var n=e;K||(n=e.replace(/。/g,".")),n!==e&&t(n)}))},Nt=function(t){var e;if(!(t&&St||!t&&xt)){At.current=!1;var n=v(ot.current?U(d):d);t||(n=n.negate());var r=(ct||v(0)).add(n.toString()),i=Ot(r,!1);null==z||z(O(H,i),{offset:ot.current?U(d):d,type:t?"up":"down"}),null===(e=et.current)||void 0===e||e.focus()}},Ht=function(t){var e,n=v(ft(wt));e=n.isNaN()?Ot(ct,t):Ot(n,t),void 0!==_?vt(ct,!1):e.isNaN()||vt(e,!1)};F.useEffect((function(){if(Q&&it){var t=function(t){Nt(t.deltaY<0),t.preventDefault()},e=et.current;if(e)return e.addEventListener("wheel",t,{passive:!1}),function(){return e.removeEventListener("wheel",t)}}}));return(0,C.o)((function(){ct.isInvalidate()||vt(ct,!1)}),[G,$]),(0,C.o)((function(){var t=v(_);ht(t);var e=v(ft(wt));t.equals(e)&&At.current&&!$||vt(t,At.current)}),[_]),(0,C.o)((function(){$&&Lt()}),[wt]),F.createElement("div",{ref:q,className:b()(n,o,(0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)({},"".concat(n,"-focused"),it),"".concat(n,"-disabled"),w),"".concat(n,"-readonly"),B),"".concat(n,"-not-a-number"),ct.isNaN()),"".concat(n,"-out-of-range"),!ct.isInvalidate()&&!Qt(ct))),style:l,onFocus:function(){st(!0)},onBlur:function(){X&&Ht(!1),st(!1),At.current=!1},onKeyDown:function(t){var e=t.key,n=t.shiftKey;At.current=!0,ot.current=n,"Enter"===e&&(at.current||(At.current=!1),Ht(!1),null==W||W(t)),!1!==x&&!at.current&&["Up","ArrowUp","Down","ArrowDown"].includes(e)&&(Nt("Up"===e||"ArrowUp"===e),t.preventDefault())},onKeyUp:function(){At.current=!1,ot.current=!1},onCompositionStart:function(){at.current=!0},onCompositionEnd:function(){at.current=!1,Mt(et.current.value)},onBeforeInput:function(){At.current=!0}},N&&F.createElement(D,{prefixCls:n,upNode:E,downNode:S,upDisabled:St,downDisabled:xt,onStep:Nt}),F.createElement("div",{className:"".concat(tt,"-wrap")},F.createElement("input",(0,r.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":u,"aria-valuemax":c,"aria-valuenow":ct.isInvalidate()?null:ct.toString(),step:d},J,{ref:(0,k.sQ)(et,e),className:tt,value:wt,onChange:function(t){Mt(t.target.value)},disabled:w,readOnly:B}))))}));var N=F.forwardRef((function(t,e){var n=t.disabled,i=t.style,s=t.prefixCls,A=void 0===s?"rc-input-number":s,o=t.value,l=t.prefix,u=t.suffix,c=t.addonBefore,h=t.addonAfter,d=t.className,f=t.classNames,p=(0,a.Z)(t,Q),g=F.useRef(null),m=F.useRef(null),_=F.useRef(null),w=function(t){_.current&&(0,L.nH)(_.current,t)};return F.useImperativeHandle(e,(function(){return t=_.current,e={focus:w,nativeElement:g.current.nativeElement||m.current},"undefined"!=typeof Proxy&&t?new Proxy(t,{get:function(t,n){if(e[n])return e[n];var r=t[n];return"function"==typeof r?r.bind(t):r}}):t;var t,e})),F.createElement(E.BaseInput,{className:d,triggerFocus:w,prefixCls:A,value:o,disabled:n,style:i,prefix:l,suffix:u,addonAfter:h,addonBefore:c,classNames:f,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"},ref:g},F.createElement(M,(0,r.Z)({prefixCls:A,disabled:n,ref:_,domRef:m,className:null==f?void 0:f.input},p)))}))},66003:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(75931),i=n(33885),s=n(76190),A=n(59301),a=["show"];function o(t,e){return A.useMemo((function(){var n={};e&&(n.show="object"===(0,s.Z)(e)&&e.formatter?e.formatter:!!e);var A=n=(0,i.Z)((0,i.Z)({},n),t),o=A.show,l=(0,r.Z)(A,a);return(0,i.Z)((0,i.Z)({},l),{},{show:!!o,showFormatter:"function"==typeof o?o:void 0,strategy:l.strategy||function(t){return t.length}})}),[t,e])}},36901:function(t,e,n){"use strict";n.r(e),n.d(e,{BaseInput:function(){return c},default:function(){return w}});var r=n(33885),i=n(54476),s=n(20068),A=n(76190),a=n(92310),o=n.n(a),l=n(59301),u=n(30292),c=l.forwardRef((function(t,e){var n,a,c,h=t.inputElement,d=t.children,f=t.prefixCls,p=t.prefix,g=t.suffix,m=t.addonBefore,_=t.addonAfter,w=t.className,y=t.style,v=t.disabled,B=t.readOnly,b=t.focused,E=t.triggerFocus,C=t.allowClear,k=t.value,F=t.handleReset,T=t.hidden,S=t.classes,x=t.classNames,I=t.dataAttrs,D=t.styles,U=t.components,L=t.onClear,R=null!=d?d:h,Q=(null==U?void 0:U.affixWrapper)||"span",O=(null==U?void 0:U.groupWrapper)||"span",P=(null==U?void 0:U.wrapper)||"span",M=(null==U?void 0:U.groupAddon)||"span",N=(0,l.useRef)(null),H=(0,u.X3)(t),K=(0,l.cloneElement)(R,{value:k,className:o()(null===(n=R.props)||void 0===n?void 0:n.className,!H&&(null==x?void 0:x.variant))||null}),$=(0,l.useRef)(null);if(l.useImperativeHandle(e,(function(){return{nativeElement:$.current||N.current}})),H){var G=null;if(C){var V=!v&&!B&&k,j="".concat(f,"-clear-icon"),Z="object"===(0,A.Z)(C)&&null!=C&&C.clearIcon?C.clearIcon:"✖";G=l.createElement("button",{type:"button",tabIndex:-1,onClick:function(t){null==F||F(t),null==L||L()},onMouseDown:function(t){return t.preventDefault()},className:o()(j,(0,s.Z)((0,s.Z)({},"".concat(j,"-hidden"),!V),"".concat(j,"-has-suffix"),!!g))},Z)}var W="".concat(f,"-affix-wrapper"),z=o()(W,(0,s.Z)((0,s.Z)((0,s.Z)((0,s.Z)((0,s.Z)({},"".concat(f,"-disabled"),v),"".concat(W,"-disabled"),v),"".concat(W,"-focused"),b),"".concat(W,"-readonly"),B),"".concat(W,"-input-with-clear-btn"),g&&C&&k),null==S?void 0:S.affixWrapper,null==x?void 0:x.affixWrapper,null==x?void 0:x.variant),Y=(g||C)&&l.createElement("span",{className:o()("".concat(f,"-suffix"),null==x?void 0:x.suffix),style:null==D?void 0:D.suffix},G,g);K=l.createElement(Q,(0,i.Z)({className:z,style:null==D?void 0:D.affixWrapper,onClick:function(t){var e;null!==(e=N.current)&&void 0!==e&&e.contains(t.target)&&(null==E||E())}},null==I?void 0:I.affixWrapper,{ref:N}),p&&l.createElement("span",{className:o()("".concat(f,"-prefix"),null==x?void 0:x.prefix),style:null==D?void 0:D.prefix},p),K,Y)}if((0,u.He)(t)){var X="".concat(f,"-group"),q="".concat(X,"-addon"),J="".concat(X,"-wrapper"),tt=o()("".concat(f,"-wrapper"),X,null==S?void 0:S.wrapper,null==x?void 0:x.wrapper),et=o()(J,(0,s.Z)({},"".concat(J,"-disabled"),v),null==S?void 0:S.group,null==x?void 0:x.groupWrapper);K=l.createElement(O,{className:et,ref:$},l.createElement(P,{className:tt},m&&l.createElement(M,{className:q},m),K,_&&l.createElement(M,{className:q},_)))}return l.cloneElement(K,{className:o()(null===(a=K.props)||void 0===a?void 0:a.className,w)||null,style:(0,r.Z)((0,r.Z)({},null===(c=K.props)||void 0===c?void 0:c.style),y),hidden:T})})),h=n(94480),d=n(42978),f=n(75931),p=n(18929),g=n(2738),m=n(66003),_=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],w=(0,l.forwardRef)((function(t,e){var n=t.autoComplete,A=t.onChange,a=t.onFocus,w=t.onBlur,y=t.onPressEnter,v=t.onKeyDown,B=t.onKeyUp,b=t.prefixCls,E=void 0===b?"rc-input":b,C=t.disabled,k=t.htmlSize,F=t.className,T=t.maxLength,S=t.suffix,x=t.showCount,I=t.count,D=t.type,U=void 0===D?"text":D,L=t.classes,R=t.classNames,Q=t.styles,O=t.onCompositionStart,P=t.onCompositionEnd,M=(0,f.Z)(t,_),N=(0,l.useState)(!1),H=(0,d.Z)(N,2),K=H[0],$=H[1],G=(0,l.useRef)(!1),V=(0,l.useRef)(!1),j=(0,l.useRef)(null),Z=(0,l.useRef)(null),W=function(t){j.current&&(0,u.nH)(j.current,t)},z=(0,p.Z)(t.defaultValue,{value:t.value}),Y=(0,d.Z)(z,2),X=Y[0],q=Y[1],J=null==X?"":String(X),tt=(0,l.useState)(null),et=(0,d.Z)(tt,2),nt=et[0],rt=et[1],it=(0,m.Z)(I,x),st=it.max||T,At=it.strategy(J),at=!!st&&At>st;(0,l.useImperativeHandle)(e,(function(){var t;return{focus:W,blur:function(){var t;null===(t=j.current)||void 0===t||t.blur()},setSelectionRange:function(t,e,n){var r;null===(r=j.current)||void 0===r||r.setSelectionRange(t,e,n)},select:function(){var t;null===(t=j.current)||void 0===t||t.select()},input:j.current,nativeElement:(null===(t=Z.current)||void 0===t?void 0:t.nativeElement)||j.current}})),(0,l.useEffect)((function(){V.current&&(V.current=!1),$((function(t){return(!t||!C)&&t}))}),[C]);var ot=function(t,e,n){var r,i,s=e;if(!G.current&&it.exceedFormatter&&it.max&&it.strategy(e)>it.max)e!==(s=it.exceedFormatter(e,{max:it.max}))&&rt([(null===(r=j.current)||void 0===r?void 0:r.selectionStart)||0,(null===(i=j.current)||void 0===i?void 0:i.selectionEnd)||0]);else if("compositionEnd"===n.source)return;q(s),j.current&&(0,u.rJ)(j.current,t,A,s)};(0,l.useEffect)((function(){var t;nt&&(null===(t=j.current)||void 0===t||t.setSelectionRange.apply(t,(0,h.Z)(nt)))}),[nt]);var lt,ut=function(t){ot(t,t.target.value,{source:"change"})},ct=function(t){G.current=!1,ot(t,t.currentTarget.value,{source:"compositionEnd"}),null==P||P(t)},ht=function(t){y&&"Enter"===t.key&&!V.current&&(V.current=!0,y(t)),null==v||v(t)},dt=function(t){"Enter"===t.key&&(V.current=!1),null==B||B(t)},ft=function(t){$(!0),null==a||a(t)},pt=function(t){V.current&&(V.current=!1),$(!1),null==w||w(t)},gt=at&&"".concat(E,"-out-of-range");return l.createElement(c,(0,i.Z)({},M,{prefixCls:E,className:o()(F,gt),handleReset:function(t){q(""),W(),j.current&&(0,u.rJ)(j.current,t,A)},value:J,focused:K,triggerFocus:W,suffix:function(){var t=Number(st)>0;if(S||it.show){var e=it.showFormatter?it.showFormatter({value:J,count:At,maxLength:st}):"".concat(At).concat(t?" / ".concat(st):"");return l.createElement(l.Fragment,null,it.show&&l.createElement("span",{className:o()("".concat(E,"-show-count-suffix"),(0,s.Z)({},"".concat(E,"-show-count-has-suffix"),!!S),null==R?void 0:R.count),style:(0,r.Z)({},null==Q?void 0:Q.count)},e),S)}return null}(),disabled:C,classes:L,classNames:R,styles:Q}),(lt=(0,g.Z)(t,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]),l.createElement("input",(0,i.Z)({autoComplete:n},lt,{onChange:ut,onFocus:ft,onBlur:pt,onKeyDown:ht,onKeyUp:dt,className:o()(E,(0,s.Z)({},"".concat(E,"-disabled"),C),null==R?void 0:R.input),style:null==Q?void 0:Q.input,ref:j,size:k,type:U,onCompositionStart:function(t){G.current=!0,null==O||O(t)},onCompositionEnd:ct}))))}))},30292:function(t,e,n){"use strict";function r(t){return!(!t.addonBefore&&!t.addonAfter)}function i(t){return!!(t.prefix||t.suffix||t.allowClear)}function s(t,e,n){var r=e.cloneNode(!0),i=Object.create(t,{target:{value:r},currentTarget:{value:r}});return r.value=n,"number"==typeof e.selectionStart&&"number"==typeof e.selectionEnd&&(r.selectionStart=e.selectionStart,r.selectionEnd=e.selectionEnd),r.setSelectionRange=function(){e.setSelectionRange.apply(e,arguments)},i}function A(t,e,n,r){if(n){var i=e;"click"!==e.type?"file"===t.type||void 0===r?n(i):n(i=s(e,t,r)):n(i=s(e,t,""))}}function a(t,e){if(t){t.focus(e);var n=(e||{}).cursor;if(n){var r=t.value.length;switch(n){case"start":t.setSelectionRange(0,0);break;case"end":t.setSelectionRange(r,r);break;default:t.setSelectionRange(0,r)}}}}n.d(e,{He:function(){return r},X3:function(){return i},nH:function(){return a},rJ:function(){return A}})},28321:function(t,e,n){"use strict";n.d(e,{iz:function(){return Nt},ck:function(){return wt},BW:function(){return $t},sN:function(){return wt},Wd:function(){return Pt},ZP:function(){return Xt},Xl:function(){return T}});var r=n(54476),i=n(20068),s=n(33885),A=n(94480),a=n(42978),o=n(75931),l=n(92310),u=n.n(l),c=n(11780),h=n(18929),d=n(13697),f=n(48736),p=n(59301),g=n(4676),m=p.createContext(null);function _(t,e){return void 0===t?null:"".concat(t,"-").concat(e)}function w(t){return _(p.useContext(m),t)}var y=n(80547),v=["children","locked"],B=p.createContext(null);function b(t){var e=t.children,n=t.locked,r=(0,o.Z)(t,v),i=p.useContext(B),A=(0,y.Z)((function(){return t=i,e=r,n=(0,s.Z)({},t),Object.keys(e).forEach((function(t){var r=e[t];void 0!==r&&(n[t]=r)})),n;var t,e,n}),[i,r],(function(t,e){return!(n||t[0]===e[0]&&(0,d.Z)(t[1],e[1],!0))}));return p.createElement(B.Provider,{value:A},e)}var E=[],C=p.createContext(null);function k(){return p.useContext(C)}var F=p.createContext(E);function T(t){var e=p.useContext(F);return p.useMemo((function(){return void 0!==t?[].concat((0,A.Z)(e),[t]):e}),[e,t])}var S=p.createContext(null),x=p.createContext({}),I=n(29194);function D(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,I.Z)(t)){var n=t.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(n)||t.isContentEditable||"a"===n&&!!t.getAttribute("href"),i=t.getAttribute("tabindex"),s=Number(i),A=null;return i&&!Number.isNaN(s)?A=s:r&&null===A&&(A=0),r&&t.disabled&&(A=null),null!==A&&(A>=0||e&&A<0)}return!1}function U(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(0,A.Z)(t.querySelectorAll("*")).filter((function(t){return D(t,e)}));return D(t,e)&&n.unshift(t),n}var L=n(10228),R=n(16089),Q=L.Z.LEFT,O=L.Z.RIGHT,P=L.Z.UP,M=L.Z.DOWN,N=L.Z.ENTER,H=L.Z.ESC,K=L.Z.HOME,$=L.Z.END,G=[P,M,Q,O];function V(t,e){return U(t,!0).filter((function(t){return e.has(t)}))}function j(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!t)return null;var i=V(t,e),s=i.length,A=i.findIndex((function(t){return n===t}));return r<0?-1===A?A=s-1:A-=1:r>0&&(A+=1),i[A=(A+s)%s]}var Z=function(t,e){var n=new Set,r=new Map,i=new Map;return t.forEach((function(t){var s=document.querySelector("[data-menu-id='".concat(_(e,t),"']"));s&&(n.add(s),i.set(s,t),r.set(t,s))})),{elements:n,key2element:r,element2key:i}};function W(t,e,n,r,s,A,a,o,l,u){var c=p.useRef(),h=p.useRef();h.current=e;var d=function(){R.Z.cancel(c.current)};return p.useEffect((function(){return function(){d()}}),[]),function(f){var p=f.which;if([].concat(G,[N,H,K,$]).includes(p)){var g=A(),m=Z(g,r),_=m,w=_.elements,y=_.key2element,v=_.element2key,B=function(t,e){for(var n=t||document.activeElement;n;){if(e.has(n))return n;n=n.parentElement}return null}(y.get(e),w),b=v.get(B),E=function(t,e,n,r){var s,A="prev",a="next",o="children",l="parent";if("inline"===t&&r===N)return{inlineTrigger:!0};var u=(0,i.Z)((0,i.Z)({},P,A),M,a),c=(0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)({},Q,n?a:A),O,n?A:a),M,o),N,o),h=(0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)({},P,A),M,a),N,o),H,l),Q,n?o:l),O,n?l:o);switch(null===(s={inline:u,horizontal:c,vertical:h,inlineSub:u,horizontalSub:h,verticalSub:h}["".concat(t).concat(e?"":"Sub")])||void 0===s?void 0:s[r]){case A:return{offset:-1,sibling:!0};case a:return{offset:1,sibling:!0};case l:return{offset:-1,sibling:!1};case o:return{offset:1,sibling:!1};default:return null}}(t,1===a(b,!0).length,n,p);if(!E&&p!==K&&p!==$)return;(G.includes(p)||[K,$].includes(p))&&f.preventDefault();var C=function(t){if(t){var e=t,n=t.querySelector("a");null!=n&&n.getAttribute("href")&&(e=n);var r=v.get(t);o(r),d(),c.current=(0,R.Z)((function(){h.current===r&&e.focus()}))}};if([K,$].includes(p)||E.sibling||!B){var k,F,T=V(k=B&&"inline"!==t?function(t){for(var e=t;e;){if(e.getAttribute("data-menu-list"))return e;e=e.parentElement}return null}(B):s.current,w);F=p===K?T[0]:p===$?T[T.length-1]:j(k,w,B,E.offset),C(F)}else if(E.inlineTrigger)l(b);else if(E.offset>0)l(b,!0),d(),c.current=(0,R.Z)((function(){m=Z(g,r);var t=B.getAttribute("aria-controls"),e=j(document.getElementById(t),m.elements);C(e)}),5);else if(E.offset<0){var S=a(b,!0),x=S[S.length-2],I=y.get(x);l(x,!1),C(I)}}null==u||u(f)}}var z="__RC_UTIL_PATH_SPLIT__",Y=function(t){return t.join(z)},X="rc-menu-more";function q(){var t=p.useState({}),e=(0,a.Z)(t,2)[1],n=(0,p.useRef)(new Map),r=(0,p.useRef)(new Map),i=p.useState([]),s=(0,a.Z)(i,2),o=s[0],l=s[1],u=(0,p.useRef)(0),c=(0,p.useRef)(!1),h=(0,p.useCallback)((function(t,i){var s=Y(i);r.current.set(s,t),n.current.set(t,s),u.current+=1;var A,a=u.current;A=function(){a===u.current&&(c.current||e({}))},Promise.resolve().then(A)}),[]),d=(0,p.useCallback)((function(t,e){var i=Y(e);r.current.delete(i),n.current.delete(t)}),[]),f=(0,p.useCallback)((function(t){l(t)}),[]),g=(0,p.useCallback)((function(t,e){var r=n.current.get(t)||"",i=r.split(z);return e&&o.includes(i[0])&&i.unshift(X),i}),[o]),m=(0,p.useCallback)((function(t,e){return t.filter((function(t){return void 0!==t})).some((function(t){return g(t,!0).includes(e)}))}),[g]),_=(0,p.useCallback)((function(t){var e="".concat(n.current.get(t)).concat(z),i=new Set;return(0,A.Z)(r.current.keys()).forEach((function(t){t.startsWith(e)&&i.add(r.current.get(t))})),i}),[]);return p.useEffect((function(){return function(){c.current=!0}}),[]),{registerPath:h,unregisterPath:d,refreshOverflowKeys:f,isSubPathKey:m,getKeyPath:g,getKeys:function(){var t=(0,A.Z)(n.current.keys());return o.length&&t.push(X),t},getSubPathKeys:_}}function J(t){var e=p.useRef(t);e.current=t;var n=p.useCallback((function(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return null===(t=e.current)||void 0===t?void 0:t.call.apply(t,[e].concat(r))}),[]);return t?n:void 0}var tt=Math.random().toFixed(5).toString().slice(2),et=0;var nt=n(67732),rt=n(83652),it=n(42403),st=n(158),At=n(2738),at=n(8654);function ot(t,e,n,r){var i=p.useContext(B),s=i.activeKey,A=i.onActive,a=i.onInactive,o={active:s===t};return e||(o.onMouseEnter=function(e){null==n||n({key:t,domEvent:e}),A(t)},o.onMouseLeave=function(e){null==r||r({key:t,domEvent:e}),a(t)}),o}function lt(t){var e=p.useContext(B),n=e.mode,r=e.rtl,i=e.inlineIndent;if("inline"!==n)return null;return r?{paddingRight:t*i}:{paddingLeft:t*i}}function ut(t){var e,n=t.icon,r=t.props,i=t.children;return null===n||!1===n?null:("function"==typeof n?e=p.createElement(n,(0,s.Z)({},r)):"boolean"!=typeof n&&(e=n),e||i||null)}var ct=["item"];function ht(t){var e=t.item,n=(0,o.Z)(t,ct);return Object.defineProperty(n,"item",{get:function(){return(0,f.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),e}}),n}var dt=["title","attribute","elementRef"],ft=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],pt=["active"],gt=function(t){(0,it.Z)(n,t);var e=(0,st.Z)(n);function n(){return(0,nt.Z)(this,n),e.apply(this,arguments)}return(0,rt.Z)(n,[{key:"render",value:function(){var t=this.props,e=t.title,n=t.attribute,i=t.elementRef,s=(0,o.Z)(t,dt),A=(0,At.Z)(s,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,f.ZP)(!n,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),p.createElement(c.Z.Item,(0,r.Z)({},n,{title:"string"==typeof e?e:void 0},A,{ref:i}))}}]),n}(p.Component),mt=p.forwardRef((function(t,e){var n=t.style,a=t.className,l=t.eventKey,c=(t.warnKey,t.disabled),h=t.itemIcon,d=t.children,f=t.role,g=t.onMouseEnter,m=t.onMouseLeave,_=t.onClick,y=t.onKeyDown,v=t.onFocus,b=(0,o.Z)(t,ft),E=w(l),C=p.useContext(B),k=C.prefixCls,F=C.onItemClick,S=C.disabled,I=C.overflowDisabled,D=C.itemIcon,U=C.selectedKeys,R=C.onActive,Q=p.useContext(x)._internalRenderMenuItem,O="".concat(k,"-item"),P=p.useRef(),M=p.useRef(),N=S||c,H=(0,at.x1)(e,M),K=T(l);var $=function(t){return{key:l,keyPath:(0,A.Z)(K).reverse(),item:P.current,domEvent:t}},G=h||D,V=ot(l,N,g,m),j=V.active,Z=(0,o.Z)(V,pt),W=U.includes(l),z=lt(K.length),Y={};"option"===t.role&&(Y["aria-selected"]=W);var X=p.createElement(gt,(0,r.Z)({ref:P,elementRef:H,role:null===f?"none":f||"menuitem",tabIndex:c?null:-1,"data-menu-id":I&&E?null:E},(0,At.Z)(b,["extra"]),Z,Y,{component:"li","aria-disabled":c,style:(0,s.Z)((0,s.Z)({},z),n),className:u()(O,(0,i.Z)((0,i.Z)((0,i.Z)({},"".concat(O,"-active"),j),"".concat(O,"-selected"),W),"".concat(O,"-disabled"),N),a),onClick:function(t){if(!N){var e=$(t);null==_||_(ht(e)),F(e)}},onKeyDown:function(t){if(null==y||y(t),t.which===L.Z.ENTER){var e=$(t);null==_||_(ht(e)),F(e)}},onFocus:function(t){R(l),null==v||v(t)}}),d,p.createElement(ut,{props:(0,s.Z)((0,s.Z)({},t),{},{isSelected:W}),icon:G}));return Q&&(X=Q(X,t,{selected:W})),X}));function _t(t,e){var n=t.eventKey,i=k(),s=T(n);return p.useEffect((function(){if(i)return i.registerPath(n,s),function(){i.unregisterPath(n,s)}}),[s]),i?null:p.createElement(mt,(0,r.Z)({},t,{ref:e}))}var wt=p.forwardRef(_t),yt=["className","children"],vt=function(t,e){var n=t.className,i=t.children,s=(0,o.Z)(t,yt),A=p.useContext(B),a=A.prefixCls,l=A.mode,c=A.rtl;return p.createElement("ul",(0,r.Z)({className:u()(a,c&&"".concat(a,"-rtl"),"".concat(a,"-sub"),"".concat(a,"-").concat("inline"===l?"inline":"vertical"),n),role:"menu"},s,{"data-menu-list":!0,ref:e}),i)},Bt=p.forwardRef(vt);Bt.displayName="SubMenuList";var bt=Bt,Et=n(11592);function Ct(t,e){return(0,Et.Z)(t).map((function(t,n){if(p.isValidElement(t)){var r,i,s=t.key,a=null!==(r=null===(i=t.props)||void 0===i?void 0:i.eventKey)&&void 0!==r?r:s;null==a&&(a="tmp_key-".concat([].concat((0,A.Z)(e),[n]).join("-")));var o={key:a,eventKey:a};return p.cloneElement(t,o)}return t}))}var kt=n(65030),Ft={adjustX:1,adjustY:1},Tt={topLeft:{points:["bl","tl"],overflow:Ft},topRight:{points:["br","tr"],overflow:Ft},bottomLeft:{points:["tl","bl"],overflow:Ft},bottomRight:{points:["tr","br"],overflow:Ft},leftTop:{points:["tr","tl"],overflow:Ft},leftBottom:{points:["br","bl"],overflow:Ft},rightTop:{points:["tl","tr"],overflow:Ft},rightBottom:{points:["bl","br"],overflow:Ft}},St={topLeft:{points:["bl","tl"],overflow:Ft},topRight:{points:["br","tr"],overflow:Ft},bottomLeft:{points:["tl","bl"],overflow:Ft},bottomRight:{points:["tr","br"],overflow:Ft},rightTop:{points:["tr","tl"],overflow:Ft},rightBottom:{points:["br","bl"],overflow:Ft},leftTop:{points:["tl","tr"],overflow:Ft},leftBottom:{points:["bl","br"],overflow:Ft}};function xt(t,e,n){return e||(n?n[t]||n.other:void 0)}var It={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function Dt(t){var e=t.prefixCls,n=t.visible,r=t.children,A=t.popup,o=t.popupStyle,l=t.popupClassName,c=t.popupOffset,h=t.disabled,d=t.mode,f=t.onVisibleChange,g=p.useContext(B),m=g.getPopupContainer,_=g.rtl,w=g.subMenuOpenDelay,y=g.subMenuCloseDelay,v=g.builtinPlacements,b=g.triggerSubMenuAction,E=g.forceSubMenuRender,C=g.rootClassName,k=g.motion,F=g.defaultMotions,T=p.useState(!1),S=(0,a.Z)(T,2),x=S[0],I=S[1],D=_?(0,s.Z)((0,s.Z)({},St),v):(0,s.Z)((0,s.Z)({},Tt),v),U=It[d],L=xt(d,k,F),Q=p.useRef(L);"inline"!==d&&(Q.current=L);var O=(0,s.Z)((0,s.Z)({},Q.current),{},{leavedClassName:"".concat(e,"-hidden"),removeOnLeave:!1,motionAppear:!0}),P=p.useRef();return p.useEffect((function(){return P.current=(0,R.Z)((function(){I(n)})),function(){R.Z.cancel(P.current)}}),[n]),p.createElement(kt.Z,{prefixCls:e,popupClassName:u()("".concat(e,"-popup"),(0,i.Z)({},"".concat(e,"-rtl"),_),l,C),stretch:"horizontal"===d?"minWidth":null,getPopupContainer:m,builtinPlacements:D,popupPlacement:U,popupVisible:x,popup:A,popupStyle:o,popupAlign:c&&{offset:c},action:h?[]:[b],mouseEnterDelay:w,mouseLeaveDelay:y,onPopupVisibleChange:f,forceRender:E,popupMotion:O,fresh:!0},r)}var Ut=n(77900);function Lt(t){var e=t.id,n=t.open,i=t.keyPath,A=t.children,o="inline",l=p.useContext(B),u=l.prefixCls,c=l.forceSubMenuRender,h=l.motion,d=l.defaultMotions,f=l.mode,g=p.useRef(!1);g.current=f===o;var m=p.useState(!g.current),_=(0,a.Z)(m,2),w=_[0],y=_[1],v=!!g.current&&n;p.useEffect((function(){g.current&&y(!1)}),[f]);var E=(0,s.Z)({},xt(o,h,d));i.length>1&&(E.motionAppear=!1);var C=E.onVisibleChanged;return E.onVisibleChanged=function(t){return g.current||t||y(!0),null==C?void 0:C(t)},w?null:p.createElement(b,{mode:o,locked:!g.current},p.createElement(Ut.default,(0,r.Z)({visible:v},E,{forceRender:c,removeOnLeave:!1,leavedClassName:"".concat(u,"-hidden")}),(function(t){var n=t.className,r=t.style;return p.createElement(bt,{id:e,className:n,style:r},A)})))}var Rt=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Qt=["active"],Ot=p.forwardRef((function(t,e){var n=t.style,A=t.className,l=t.title,h=t.eventKey,d=(t.warnKey,t.disabled),f=t.internalPopupClose,g=t.children,m=t.itemIcon,_=t.expandIcon,y=t.popupClassName,v=t.popupOffset,E=t.popupStyle,C=t.onClick,k=t.onMouseEnter,F=t.onMouseLeave,I=t.onTitleClick,D=t.onTitleMouseEnter,U=t.onTitleMouseLeave,L=(0,o.Z)(t,Rt),R=w(h),Q=p.useContext(B),O=Q.prefixCls,P=Q.mode,M=Q.openKeys,N=Q.disabled,H=Q.overflowDisabled,K=Q.activeKey,$=Q.selectedKeys,G=Q.itemIcon,V=Q.expandIcon,j=Q.onItemClick,Z=Q.onOpenChange,W=Q.onActive,z=p.useContext(x)._internalRenderSubMenuItem,Y=p.useContext(S).isSubPathKey,X=T(),q="".concat(O,"-submenu"),tt=N||d,et=p.useRef(),nt=p.useRef();var rt=null!=m?m:G,it=null!=_?_:V,st=M.includes(h),At=!H&&st,at=Y($,h),ct=ot(h,tt,D,U),dt=ct.active,ft=(0,o.Z)(ct,Qt),pt=p.useState(!1),gt=(0,a.Z)(pt,2),mt=gt[0],_t=gt[1],wt=function(t){tt||_t(t)},yt=p.useMemo((function(){return dt||"inline"!==P&&(mt||Y([K],h))}),[P,dt,K,mt,h,Y]),vt=lt(X.length),Bt=J((function(t){null==C||C(ht(t)),j(t)})),Et=R&&"".concat(R,"-popup"),Ct=p.useMemo((function(){return p.createElement(ut,{icon:"horizontal"!==P?it:void 0,props:(0,s.Z)((0,s.Z)({},t),{},{isOpen:At,isSubMenu:!0})},p.createElement("i",{className:"".concat(q,"-arrow")}))}),[P,it,t,At,q]),kt=p.createElement("div",(0,r.Z)({role:"menuitem",style:vt,className:"".concat(q,"-title"),tabIndex:tt?null:-1,ref:et,title:"string"==typeof l?l:null,"data-menu-id":H&&R?null:R,"aria-expanded":At,"aria-haspopup":!0,"aria-controls":Et,"aria-disabled":tt,onClick:function(t){tt||(null==I||I({key:h,domEvent:t}),"inline"===P&&Z(h,!st))},onFocus:function(){W(h)}},ft),l,Ct),Ft=p.useRef(P);if("inline"!==P&&X.length>1?Ft.current="vertical":Ft.current=P,!H){var Tt=Ft.current;kt=p.createElement(Dt,{mode:Tt,prefixCls:q,visible:!f&&At&&"inline"!==P,popupClassName:y,popupOffset:v,popupStyle:E,popup:p.createElement(b,{mode:"horizontal"===Tt?"vertical":Tt},p.createElement(bt,{id:Et,ref:nt},g)),disabled:tt,onVisibleChange:function(t){"inline"!==P&&Z(h,t)}},kt)}var St=p.createElement(c.Z.Item,(0,r.Z)({ref:e,role:"none"},L,{component:"li",style:n,className:u()(q,"".concat(q,"-").concat(P),A,(0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)({},"".concat(q,"-open"),At),"".concat(q,"-active"),yt),"".concat(q,"-selected"),at),"".concat(q,"-disabled"),tt)),onMouseEnter:function(t){wt(!0),null==k||k({key:h,domEvent:t})},onMouseLeave:function(t){wt(!1),null==F||F({key:h,domEvent:t})}}),kt,!H&&p.createElement(Lt,{id:Et,open:At,keyPath:X},g));return z&&(St=z(St,t,{selected:at,active:yt,open:At,disabled:tt})),p.createElement(b,{onItemClick:Bt,mode:"horizontal"===P?"vertical":P,itemIcon:rt,expandIcon:it},St)}));var Pt=p.forwardRef((function(t,e){var n,i=t.eventKey,s=t.children,A=T(i),a=Ct(s,A),o=k();return p.useEffect((function(){if(o)return o.registerPath(i,A),function(){o.unregisterPath(i,A)}}),[A]),n=o?a:p.createElement(Ot,(0,r.Z)({ref:e},t),a),p.createElement(F.Provider,{value:A},n)})),Mt=n(76190);function Nt(t){var e=t.className,n=t.style,r=p.useContext(B).prefixCls;return k()?null:p.createElement("li",{role:"separator",className:u()("".concat(r,"-item-divider"),e),style:n})}var Ht=["className","title","eventKey","children"],Kt=p.forwardRef((function(t,e){var n=t.className,i=t.title,s=(t.eventKey,t.children),A=(0,o.Z)(t,Ht),a=p.useContext(B).prefixCls,l="".concat(a,"-item-group");return p.createElement("li",(0,r.Z)({ref:e,role:"presentation"},A,{onClick:function(t){return t.stopPropagation()},className:u()(l,n)}),p.createElement("div",{role:"presentation",className:"".concat(l,"-title"),title:"string"==typeof i?i:void 0},i),p.createElement("ul",{role:"group",className:"".concat(l,"-list")},s))}));var $t=p.forwardRef((function(t,e){var n=t.eventKey,i=Ct(t.children,T(n));return k()?i:p.createElement(Kt,(0,r.Z)({ref:e},(0,At.Z)(t,["warnKey"])),i)})),Gt=["label","children","key","type","extra"];function Vt(t,e,n){var i=e.item,s=e.group,A=e.submenu,a=e.divider;return(t||[]).map((function(t,l){if(t&&"object"===(0,Mt.Z)(t)){var u=t,c=u.label,h=u.children,d=u.key,f=u.type,g=u.extra,m=(0,o.Z)(u,Gt),_=null!=d?d:"tmp-".concat(l);return h||"group"===f?"group"===f?p.createElement(s,(0,r.Z)({key:_},m,{title:c}),Vt(h,e,n)):p.createElement(A,(0,r.Z)({key:_},m,{title:c}),Vt(h,e,n)):"divider"===f?p.createElement(a,(0,r.Z)({key:_},m)):p.createElement(i,(0,r.Z)({key:_},m,{extra:g}),c,(!!g||0===g)&&p.createElement("span",{className:"".concat(n,"-item-extra")},g))}return null})).filter((function(t){return t}))}function jt(t,e,n,r,i){var A=t,a=(0,s.Z)({divider:Nt,item:wt,group:$t,submenu:Pt},r);return e&&(A=Vt(e,a,i)),Ct(A,n)}var Zt=["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"],Wt=[],zt=p.forwardRef((function(t,e){var n,l=t,f=l.prefixCls,_=void 0===f?"rc-menu":f,w=l.rootClassName,y=l.style,v=l.className,B=l.tabIndex,E=void 0===B?0:B,k=l.items,F=l.children,T=l.direction,I=l.id,D=l.mode,U=void 0===D?"vertical":D,L=l.inlineCollapsed,R=l.disabled,Q=l.disabledOverflow,O=l.subMenuOpenDelay,P=void 0===O?.1:O,M=l.subMenuCloseDelay,N=void 0===M?.1:M,H=l.forceSubMenuRender,K=l.defaultOpenKeys,$=l.openKeys,G=l.activeKey,j=l.defaultActiveFirst,z=l.selectable,Y=void 0===z||z,nt=l.multiple,rt=void 0!==nt&&nt,it=l.defaultSelectedKeys,st=l.selectedKeys,At=l.onSelect,at=l.onDeselect,ot=l.inlineIndent,lt=void 0===ot?24:ot,ut=l.motion,ct=l.defaultMotions,dt=l.triggerSubMenuAction,ft=void 0===dt?"hover":dt,pt=l.builtinPlacements,gt=l.itemIcon,mt=l.expandIcon,_t=l.overflowedIndicator,yt=void 0===_t?"...":_t,vt=l.overflowedIndicatorPopupClassName,Bt=l.getPopupContainer,bt=l.onClick,Et=l.onOpenChange,Ct=l.onKeyDown,kt=(l.openAnimation,l.openTransitionName,l._internalRenderMenuItem),Ft=l._internalRenderSubMenuItem,Tt=l._internalComponents,St=(0,o.Z)(l,Zt),xt=p.useMemo((function(){return[jt(F,k,Wt,Tt,_),jt(F,k,Wt,{},_)]}),[F,k,Tt]),It=(0,a.Z)(xt,2),Dt=It[0],Ut=It[1],Lt=p.useState(!1),Rt=(0,a.Z)(Lt,2),Qt=Rt[0],Ot=Rt[1],Mt=p.useRef(),Nt=function(t){var e=(0,h.Z)(t,{value:t}),n=(0,a.Z)(e,2),r=n[0],i=n[1];return p.useEffect((function(){et+=1;var t="".concat(tt,"-").concat(et);i("rc-menu-uuid-".concat(t))}),[]),r}(I),Ht="rtl"===T;var Kt=(0,h.Z)(K,{value:$,postState:function(t){return t||Wt}}),$t=(0,a.Z)(Kt,2),Gt=$t[0],Vt=$t[1],zt=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function n(){Vt(t),null==Et||Et(t)}e?(0,g.flushSync)(n):n()},Yt=p.useState(Gt),Xt=(0,a.Z)(Yt,2),qt=Xt[0],Jt=Xt[1],te=p.useRef(!1),ee=p.useMemo((function(){return"inline"!==U&&"vertical"!==U||!L?[U,!1]:["vertical",L]}),[U,L]),ne=(0,a.Z)(ee,2),re=ne[0],ie=ne[1],se="inline"===re,Ae=p.useState(re),ae=(0,a.Z)(Ae,2),oe=ae[0],le=ae[1],ue=p.useState(ie),ce=(0,a.Z)(ue,2),he=ce[0],de=ce[1];p.useEffect((function(){le(re),de(ie),te.current&&(se?Vt(qt):zt(Wt))}),[re,ie]);var fe=p.useState(0),pe=(0,a.Z)(fe,2),ge=pe[0],me=pe[1],_e=ge>=Dt.length-1||"horizontal"!==oe||Q;p.useEffect((function(){se&&Jt(Gt)}),[Gt]),p.useEffect((function(){return te.current=!0,function(){te.current=!1}}),[]);var we=q(),ye=we.registerPath,ve=we.unregisterPath,Be=we.refreshOverflowKeys,be=we.isSubPathKey,Ee=we.getKeyPath,Ce=we.getKeys,ke=we.getSubPathKeys,Fe=p.useMemo((function(){return{registerPath:ye,unregisterPath:ve}}),[ye,ve]),Te=p.useMemo((function(){return{isSubPathKey:be}}),[be]);p.useEffect((function(){Be(_e?Wt:Dt.slice(ge+1).map((function(t){return t.key})))}),[ge,_e]);var Se=(0,h.Z)(G||j&&(null===(n=Dt[0])||void 0===n?void 0:n.key),{value:G}),xe=(0,a.Z)(Se,2),Ie=xe[0],De=xe[1],Ue=J((function(t){De(t)})),Le=J((function(){De(void 0)}));(0,p.useImperativeHandle)(e,(function(){return{list:Mt.current,focus:function(t){var e,n,r=Ce(),i=Z(r,Nt),s=i.elements,A=i.key2element,a=i.element2key,o=V(Mt.current,s),l=null!=Ie?Ie:o[0]?a.get(o[0]):null===(e=Dt.find((function(t){return!t.props.disabled})))||void 0===e?void 0:e.key,u=A.get(l);l&&u&&(null==u||null===(n=u.focus)||void 0===n||n.call(u,t))}}}));var Re=(0,h.Z)(it||[],{value:st,postState:function(t){return Array.isArray(t)?t:null==t?Wt:[t]}}),Qe=(0,a.Z)(Re,2),Oe=Qe[0],Pe=Qe[1],Me=J((function(t){null==bt||bt(ht(t)),function(t){if(Y){var e,n=t.key,r=Oe.includes(n);e=rt?r?Oe.filter((function(t){return t!==n})):[].concat((0,A.Z)(Oe),[n]):[n],Pe(e);var i=(0,s.Z)((0,s.Z)({},t),{},{selectedKeys:e});r?null==at||at(i):null==At||At(i)}!rt&&Gt.length&&"inline"!==oe&&zt(Wt)}(t)})),Ne=J((function(t,e){var n=Gt.filter((function(e){return e!==t}));if(e)n.push(t);else if("inline"!==oe){var r=ke(t);n=n.filter((function(t){return!r.has(t)}))}(0,d.Z)(Gt,n,!0)||zt(n,!0)})),He=W(oe,Ie,Ht,Nt,Mt,Ce,Ee,De,(function(t,e){var n=null!=e?e:!Gt.includes(t);Ne(t,n)}),Ct);p.useEffect((function(){Ot(!0)}),[]);var Ke=p.useMemo((function(){return{_internalRenderMenuItem:kt,_internalRenderSubMenuItem:Ft}}),[kt,Ft]),$e="horizontal"!==oe||Q?Dt:Dt.map((function(t,e){return p.createElement(b,{key:t.key,overflowDisabled:e>ge},t)})),Ge=p.createElement(c.Z,(0,r.Z)({id:I,ref:Mt,prefixCls:"".concat(_,"-overflow"),component:"ul",itemComponent:wt,className:u()(_,"".concat(_,"-root"),"".concat(_,"-").concat(oe),v,(0,i.Z)((0,i.Z)({},"".concat(_,"-inline-collapsed"),he),"".concat(_,"-rtl"),Ht),w),dir:T,style:y,role:"menu",tabIndex:E,data:$e,renderRawItem:function(t){return t},renderRawRest:function(t){var e=t.length,n=e?Dt.slice(-e):null;return p.createElement(Pt,{eventKey:X,title:yt,disabled:_e,internalPopupClose:0===e,popupClassName:vt},n)},maxCount:"horizontal"!==oe||Q?c.Z.INVALIDATE:c.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(t){me(t)},onKeyDown:He},St));return p.createElement(x.Provider,{value:Ke},p.createElement(m.Provider,{value:Nt},p.createElement(b,{prefixCls:_,rootClassName:w,mode:oe,openKeys:Gt,rtl:Ht,disabled:R,motion:Qt?ut:null,defaultMotions:Qt?ct:null,activeKey:Ie,onActive:Ue,onInactive:Le,selectedKeys:Oe,inlineIndent:lt,subMenuOpenDelay:P,subMenuCloseDelay:N,forceSubMenuRender:H,builtinPlacements:pt,triggerSubMenuAction:ft,getPopupContainer:Bt,itemIcon:gt,expandIcon:mt,onItemClick:Me,onOpenChange:Ne},p.createElement(S.Provider,{value:Te},Ge),p.createElement("div",{style:{display:"none"},"aria-hidden":!0},p.createElement(C.Provider,{value:Fe},Ut)))))})),Yt=zt;Yt.Item=wt,Yt.SubMenu=Pt,Yt.ItemGroup=$t,Yt.Divider=Nt;var Xt=Yt},11780:function(t,e,n){"use strict";n.d(e,{Z:function(){return R}});var r=n(54476),i=n(33885),s=n(42978),A=n(75931),a=n(59301),o=n(92310),l=n.n(o),u=n(29301),c=n(34280),h=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],d=void 0;function f(t,e){var n=t.prefixCls,s=t.invalidate,o=t.item,c=t.renderItem,f=t.responsive,p=t.responsiveDisabled,g=t.registerSize,m=t.itemKey,_=t.className,w=t.style,y=t.children,v=t.display,B=t.order,b=t.component,E=void 0===b?"div":b,C=(0,A.Z)(t,h),k=f&&!v;function F(t){g(m,t)}a.useEffect((function(){return function(){F(null)}}),[]);var T,S=c&&o!==d?c(o,{index:B}):y;s||(T={opacity:k?0:1,height:k?0:d,overflowY:k?"hidden":d,order:f?B:d,pointerEvents:k?"none":d,position:k?"absolute":d});var x={};k&&(x["aria-hidden"]=!0);var I=a.createElement(E,(0,r.Z)({className:l()(!s&&n,_),style:(0,i.Z)((0,i.Z)({},T),w)},x,C,{ref:e}),S);return f&&(I=a.createElement(u.Z,{onResize:function(t){F(t.offsetWidth)},disabled:p},I)),I}var p=a.forwardRef(f);p.displayName="Item";var g=p,m=n(6089),_=n(4676),w=n(16089);function y(){var t=a.useRef(null);return function(e){t.current||(t.current=[],function(t){if("undefined"==typeof MessageChannel)(0,w.Z)(t);else{var e=new MessageChannel;e.port1.onmessage=function(){return t()},e.port2.postMessage(void 0)}}((function(){(0,_.unstable_batchedUpdates)((function(){t.current.forEach((function(t){t()})),t.current=null}))}))),t.current.push(e)}}function v(t,e){var n=a.useState(e),r=(0,s.Z)(n,2),i=r[0],A=r[1];return[i,(0,m.Z)((function(e){t((function(){A(e)}))}))]}var B=a.createContext(null),b=["component"],E=["className"],C=["className"],k=function(t,e){var n=a.useContext(B);if(!n){var i=t.component,s=void 0===i?"div":i,o=(0,A.Z)(t,b);return a.createElement(s,(0,r.Z)({},o,{ref:e}))}var u=n.className,c=(0,A.Z)(n,E),h=t.className,d=(0,A.Z)(t,C);return a.createElement(B.Provider,{value:null},a.createElement(g,(0,r.Z)({ref:e,className:l()(u,h)},c,d)))},F=a.forwardRef(k);F.displayName="RawItem";var T=F,S=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],x="responsive",I="invalidate";function D(t){return"+ ".concat(t.length," ...")}function U(t,e){var n=t.prefixCls,o=void 0===n?"rc-overflow":n,h=t.data,d=void 0===h?[]:h,f=t.renderItem,p=t.renderRawItem,m=t.itemKey,_=t.itemWidth,w=void 0===_?10:_,b=t.ssr,E=t.style,C=t.className,k=t.maxCount,F=t.renderRest,T=t.renderRawRest,U=t.suffix,L=t.component,R=void 0===L?"div":L,Q=t.itemComponent,O=t.onVisibleChange,P=(0,A.Z)(t,S),M="full"===b,N=y(),H=v(N,null),K=(0,s.Z)(H,2),$=K[0],G=K[1],V=$||0,j=v(N,new Map),Z=(0,s.Z)(j,2),W=Z[0],z=Z[1],Y=v(N,0),X=(0,s.Z)(Y,2),q=X[0],J=X[1],tt=v(N,0),et=(0,s.Z)(tt,2),nt=et[0],rt=et[1],it=v(N,0),st=(0,s.Z)(it,2),At=st[0],at=st[1],ot=(0,a.useState)(null),lt=(0,s.Z)(ot,2),ut=lt[0],ct=lt[1],ht=(0,a.useState)(null),dt=(0,s.Z)(ht,2),ft=dt[0],pt=dt[1],gt=a.useMemo((function(){return null===ft&&M?Number.MAX_SAFE_INTEGER:ft||0}),[ft,$]),mt=(0,a.useState)(!1),_t=(0,s.Z)(mt,2),wt=_t[0],yt=_t[1],vt="".concat(o,"-item"),Bt=Math.max(q,nt),bt=k===x,Et=d.length&&bt,Ct=k===I,kt=Et||"number"==typeof k&&d.length>k,Ft=(0,a.useMemo)((function(){var t=d;return Et?t=null===$&&M?d:d.slice(0,Math.min(d.length,V/w)):"number"==typeof k&&(t=d.slice(0,k)),t}),[d,w,$,k,Et]),Tt=(0,a.useMemo)((function(){return Et?d.slice(gt+1):d.slice(Ft.length)}),[d,Ft,Et,gt]),St=(0,a.useCallback)((function(t,e){var n;return"function"==typeof m?m(t):null!==(n=m&&(null==t?void 0:t[m]))&&void 0!==n?n:e}),[m]),xt=(0,a.useCallback)(f||function(t){return t},[f]);function It(t,e,n){(ft!==t||void 0!==e&&e!==ut)&&(pt(t),n||(yt(t<d.length-1),null==O||O(t)),void 0!==e&&ct(e))}function Dt(t,e){z((function(n){var r=new Map(n);return null===e?r.delete(t):r.set(t,e),r}))}function Ut(t){return W.get(St(Ft[t],t))}(0,c.Z)((function(){if(V&&"number"==typeof Bt&&Ft){var t=At,e=Ft.length,n=e-1;if(!e)return void It(0,null);for(var r=0;r<e;r+=1){var i=Ut(r);if(M&&(i=i||0),void 0===i){It(r-1,void 0,!0);break}if(t+=i,0===n&&t<=V||r===n-1&&t+Ut(n)<=V){It(n,null);break}if(t+Bt>V){It(r-1,t-i-At+nt);break}}U&&Ut(0)+At>V&&ct(null)}}),[V,W,nt,At,St,Ft]);var Lt=wt&&!!Tt.length,Rt={};null!==ut&&Et&&(Rt={position:"absolute",left:ut,top:0});var Qt={prefixCls:vt,responsive:Et,component:Q,invalidate:Ct},Ot=p?function(t,e){var n=St(t,e);return a.createElement(B.Provider,{key:n,value:(0,i.Z)((0,i.Z)({},Qt),{},{order:e,item:t,itemKey:n,registerSize:Dt,display:e<=gt})},p(t,e))}:function(t,e){var n=St(t,e);return a.createElement(g,(0,r.Z)({},Qt,{order:e,key:n,item:t,renderItem:xt,itemKey:n,registerSize:Dt,display:e<=gt}))},Pt={order:Lt?gt:Number.MAX_SAFE_INTEGER,className:"".concat(vt,"-rest"),registerSize:function(t,e){rt(e),J(nt)},display:Lt},Mt=F||D,Nt=T?a.createElement(B.Provider,{value:(0,i.Z)((0,i.Z)({},Qt),Pt)},T(Tt)):a.createElement(g,(0,r.Z)({},Qt,Pt),"function"==typeof Mt?Mt(Tt):Mt),Ht=a.createElement(R,(0,r.Z)({className:l()(!Ct&&o,C),style:E,ref:e},P),Ft.map(Ot),kt?Nt:null,U&&a.createElement(g,(0,r.Z)({},Qt,{responsive:bt,responsiveDisabled:!Et,order:gt,className:"".concat(vt,"-suffix"),registerSize:function(t,e){at(e)},display:!0,style:Rt}),U));return bt?a.createElement(u.Z,{onResize:function(t,e){G(e.clientWidth)},disabled:!Et},Ht):Ht}var L=a.forwardRef(U);L.displayName="Overflow",L.Item=T,L.RESPONSIVE=x,L.INVALIDATE=I;var R=L},29301:function(t,e,n){"use strict";n.d(e,{Z:function(){return b}});var r=n(54476),i=n(59301),s=n(11592),A=(n(48736),n(33885)),a=n(76190),o=n(76846),l=n(8654),u=i.createContext(null);var c=n(76374),h=new Map;var d=new c.Z((function(t){t.forEach((function(t){var e,n=t.target;null===(e=h.get(n))||void 0===e||e.forEach((function(t){return t(n)}))}))}));var f=n(67732),p=n(83652),g=n(42403),m=n(158),_=function(t){(0,g.Z)(n,t);var e=(0,m.Z)(n);function n(){return(0,f.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"render",value:function(){return this.props.children}}]),n}(i.Component);function w(t,e){var n=t.children,r=t.disabled,s=i.useRef(null),c=i.useRef(null),f=i.useContext(u),p="function"==typeof n,g=p?n(s):n,m=i.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),w=!p&&i.isValidElement(g)&&(0,l.Yr)(g),y=w?(0,l.C4)(g):null,v=(0,l.x1)(y,s),B=function(){var t;return(0,o.ZP)(s.current)||(s.current&&"object"===(0,a.Z)(s.current)?(0,o.ZP)(null===(t=s.current)||void 0===t?void 0:t.nativeElement):null)||(0,o.ZP)(c.current)};i.useImperativeHandle(e,(function(){return B()}));var b=i.useRef(t);b.current=t;var E=i.useCallback((function(t){var e=b.current,n=e.onResize,r=e.data,i=t.getBoundingClientRect(),s=i.width,a=i.height,o=t.offsetWidth,l=t.offsetHeight,u=Math.floor(s),c=Math.floor(a);if(m.current.width!==u||m.current.height!==c||m.current.offsetWidth!==o||m.current.offsetHeight!==l){var h={width:u,height:c,offsetWidth:o,offsetHeight:l};m.current=h;var d=o===Math.round(s)?s:o,p=l===Math.round(a)?a:l,g=(0,A.Z)((0,A.Z)({},h),{},{offsetWidth:d,offsetHeight:p});null==f||f(g,t,r),n&&Promise.resolve().then((function(){n(g,t)}))}}),[]);return i.useEffect((function(){var t,e,n=B();return n&&!r&&(t=n,e=E,h.has(t)||(h.set(t,new Set),d.observe(t)),h.get(t).add(e)),function(){return function(t,e){h.has(t)&&(h.get(t).delete(e),h.get(t).size||(d.unobserve(t),h.delete(t)))}(n,E)}}),[s.current,r]),i.createElement(_,{ref:c},w?i.cloneElement(g,{ref:v}):g)}var y=i.forwardRef(w);function v(t,e){var n=t.children;return("function"==typeof n?[n]:(0,s.Z)(n)).map((function(n,s){var A=(null==n?void 0:n.key)||"".concat("rc-observer-key","-").concat(s);return i.createElement(y,(0,r.Z)({},t,{key:A,ref:0===s?e:void 0}),n)}))}var B=i.forwardRef(v);B.Collection=function(t){var e=t.children,n=t.onBatchResize,r=i.useRef(0),s=i.useRef([]),A=i.useContext(u),a=i.useCallback((function(t,e,i){r.current+=1;var a=r.current;s.current.push({size:t,element:e,data:i}),Promise.resolve().then((function(){a===r.current&&(null==n||n(s.current),s.current=[])})),null==A||A(t,e,i)}),[n,A]);return i.createElement(u.Provider,{value:a},e)};var b=B},29125:function(t,e,n){"use strict";n.d(e,{G:function(){return A},Z:function(){return _}});var r=n(92310),i=n.n(r),s=n(59301);function A(t){var e=t.children,n=t.prefixCls,r=t.id,A=t.overlayInnerStyle,a=t.bodyClassName,o=t.className,l=t.style;return s.createElement("div",{className:i()("".concat(n,"-content"),o),style:l},s.createElement("div",{className:i()("".concat(n,"-inner"),a),id:r,role:"tooltip",style:A},"function"==typeof e?e():e))}var a=n(54476),o=n(33885),l=n(75931),u=n(65030),c={shiftX:64,adjustY:1},h={adjustX:1,shiftY:!0},d=[0,0],f={left:{points:["cr","cl"],overflow:h,offset:[-4,0],targetOffset:d},right:{points:["cl","cr"],overflow:h,offset:[4,0],targetOffset:d},top:{points:["bc","tc"],overflow:c,offset:[0,-4],targetOffset:d},bottom:{points:["tc","bc"],overflow:c,offset:[0,4],targetOffset:d},topLeft:{points:["bl","tl"],overflow:c,offset:[0,-4],targetOffset:d},leftTop:{points:["tr","tl"],overflow:h,offset:[-4,0],targetOffset:d},topRight:{points:["br","tr"],overflow:c,offset:[0,-4],targetOffset:d},rightTop:{points:["tl","tr"],overflow:h,offset:[4,0],targetOffset:d},bottomRight:{points:["tr","br"],overflow:c,offset:[0,4],targetOffset:d},rightBottom:{points:["bl","br"],overflow:h,offset:[4,0],targetOffset:d},bottomLeft:{points:["tl","bl"],overflow:c,offset:[0,4],targetOffset:d},leftBottom:{points:["br","bl"],overflow:h,offset:[-4,0],targetOffset:d}},p=n(80402),g=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],m=function(t,e){var n=t.overlayClassName,r=t.trigger,c=void 0===r?["hover"]:r,h=t.mouseEnterDelay,d=void 0===h?0:h,m=t.mouseLeaveDelay,_=void 0===m?.1:m,w=t.overlayStyle,y=t.prefixCls,v=void 0===y?"rc-tooltip":y,B=t.children,b=t.onVisibleChange,E=t.afterVisibleChange,C=t.transitionName,k=t.animation,F=t.motion,T=t.placement,S=void 0===T?"right":T,x=t.align,I=void 0===x?{}:x,D=t.destroyTooltipOnHide,U=void 0!==D&&D,L=t.defaultVisible,R=t.getTooltipContainer,Q=t.overlayInnerStyle,O=(t.arrowContent,t.overlay),P=t.id,M=t.showArrow,N=void 0===M||M,H=t.classNames,K=t.styles,$=(0,l.Z)(t,g),G=(0,p.Z)(P),V=(0,s.useRef)(null);(0,s.useImperativeHandle)(e,(function(){return V.current}));var j=(0,o.Z)({},$);"visible"in t&&(j.popupVisible=t.visible);var Z,W,z;return s.createElement(u.Z,(0,a.Z)({popupClassName:i()(n,null==H?void 0:H.root),prefixCls:v,popup:function(){return s.createElement(A,{key:"content",prefixCls:v,id:G,bodyClassName:null==H?void 0:H.body,overlayInnerStyle:(0,o.Z)((0,o.Z)({},Q),null==K?void 0:K.body)},O)},action:c,builtinPlacements:f,popupPlacement:S,ref:V,popupAlign:I,getPopupContainer:R,onPopupVisibleChange:b,afterPopupVisibleChange:E,popupTransitionName:C,popupAnimation:k,popupMotion:F,defaultPopupVisible:L,autoDestroy:U,mouseLeaveDelay:_,popupStyle:(0,o.Z)((0,o.Z)({},w),null==K?void 0:K.root),mouseEnterDelay:d,arrow:N},j),(Z=s.Children.only(B),W=(null==Z?void 0:Z.props)||{},z=(0,o.Z)((0,o.Z)({},W),{},{"aria-describedby":O?G:null}),s.cloneElement(B,z)))},_=(0,s.forwardRef)(m)},49658:function(t,e){"use strict";e.Z=function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var t=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(t)||/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(null==t?void 0:t.substr(0,4))}},83145:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CopyToClipboard=void 0;var r=s(n(59301)),i=s(n(25769));function s(t){return t&&t.__esModule?t:{default:t}}function A(t){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A(t)}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},s=Object.keys(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function c(t,e){return!e||"object"!==A(e)&&"function"!=typeof e?d(t):e}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function d(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function f(t,e){return f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},f(t,e)}function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var g=function(t){function e(){var t,n;l(this,e);for(var s=arguments.length,A=new Array(s),a=0;a<s;a++)A[a]=arguments[a];return p(d(n=c(this,(t=h(e)).call.apply(t,[this].concat(A)))),"onClick",(function(t){var e=n.props,s=e.text,A=e.onCopy,a=e.children,o=e.options,l=r.default.Children.only(a),u=(0,i.default)(s,o);A&&A(s,u),l&&l.props&&"function"==typeof l.props.onClick&&l.props.onClick(t)})),n}var n,s,A;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(e,t),n=e,s=[{key:"render",value:function(){var t=this.props,e=(t.text,t.onCopy,t.options,t.children),n=o(t,["text","onCopy","options","children"]),i=r.default.Children.only(e);return r.default.cloneElement(i,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(n,!0).forEach((function(e){p(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},n,{onClick:this.onClick}))}}],s&&u(n.prototype,s),A&&u(n,A),e}(r.default.PureComponent);e.CopyToClipboard=g,p(g,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(t,e,n){"use strict";var r=n(83145).CopyToClipboard;r.CopyToClipboard=r,t.exports=r},76374:function(t,e,n){"use strict";var r=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,r){return t[0]===e&&(n=r,!0)})),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];t.call(e,i[1],i[0])}},e}()}(),i="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,s=void 0!==n.g&&n.g.Math===Math?n.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),A="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(s):function(t){return setTimeout((function(){return t(Date.now())}),1e3/60)};var a=["top","right","bottom","left","width","height","size","weight"],o="undefined"!=typeof MutationObserver,l=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,r=!1,i=0;function s(){n&&(n=!1,t()),r&&o()}function a(){A(s)}function o(){var t=Date.now();if(n){if(t-i<2)return;r=!0}else n=!0,r=!1,setTimeout(a,e);i=t}return o}(this.refresh.bind(this),20)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},t.prototype.connect_=function(){i&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),o?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){i&&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)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;a.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),u=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},c=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||s},h=_(0,0,0,0);function d(t){return parseFloat(t)||0}function f(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce((function(e,n){return e+d(t["border-"+n+"-width"])}),0)}function p(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return h;var r=c(t).getComputedStyle(t),i=function(t){for(var e={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],s=t["padding-"+i];e[i]=d(s)}return e}(r),s=i.left+i.right,A=i.top+i.bottom,a=d(r.width),o=d(r.height);if("border-box"===r.boxSizing&&(Math.round(a+s)!==e&&(a-=f(r,"left","right")+s),Math.round(o+A)!==n&&(o-=f(r,"top","bottom")+A)),!function(t){return t===c(t).document.documentElement}(t)){var l=Math.round(a+s)-e,u=Math.round(o+A)-n;1!==Math.abs(l)&&(a-=l),1!==Math.abs(u)&&(o-=u)}return _(i.left,i.top,a,o)}var g="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof c(t).SVGGraphicsElement}:function(t){return t instanceof c(t).SVGElement&&"function"==typeof t.getBBox};function m(t){return i?g(t)?function(t){var e=t.getBBox();return _(0,0,e.width,e.height)}(t):p(t):h}function _(t,e,n,r){return{x:t,y:e,width:n,height:r}}var w=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=_(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=m(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),y=function(t,e){var n,r,i,s,A,a,o,l=(r=(n=e).x,i=n.y,s=n.width,A=n.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,o=Object.create(a.prototype),u(o,{x:r,y:i,width:s,height:A,top:i,right:r+s,bottom:A+i,left:r}),o);u(this,{target:t,contentRect:l})},v=function(){function t(t,e,n){if(this.activeObservations_=[],this.observations_=new r,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=n}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof c(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new w(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof c(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach((function(e){e.isActive()&&t.activeObservations_.push(e)}))},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map((function(t){return new y(t.target,t.broadcastRect())}));this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),B="undefined"!=typeof WeakMap?new WeakMap:new r,b=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=l.getInstance(),r=new v(e,n,this);B.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){b.prototype[t]=function(){var e;return(e=B.get(this))[t].apply(e,arguments)}}));var E=void 0!==s.ResizeObserver?s.ResizeObserver:b;e.Z=E},98040:function(t){t.exports=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,n=[],r=0;r<t.rangeCount;r++)n.push(t.getRangeAt(r));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null}return t.removeAllRanges(),function(){"Caret"===t.type&&t.removeAllRanges(),t.rangeCount||n.forEach((function(e){t.addRange(e)})),e&&e.focus()}}},80360:function(t,e,n){"use strict";n.d(e,{ZP:function(){return fo}});const r=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},i=Number.isSafeInteger||function(t){return"number"==typeof t&&Math.abs(t)<=s},s=Number.MAX_SAFE_INTEGER||9007199254740991;let A=function(t){return t.NETWORK_ERROR="networkError",t.MEDIA_ERROR="mediaError",t.KEY_SYSTEM_ERROR="keySystemError",t.MUX_ERROR="muxError",t.OTHER_ERROR="otherError",t}({}),a=function(t){return t.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",t.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",t.KEY_SYSTEM_NO_SESSION="keySystemNoSession",t.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",t.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",t.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",t.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",t.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",t.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",t.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",t.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",t.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",t.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",t.MANIFEST_LOAD_ERROR="manifestLoadError",t.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",t.MANIFEST_PARSING_ERROR="manifestParsingError",t.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",t.LEVEL_EMPTY_ERROR="levelEmptyError",t.LEVEL_LOAD_ERROR="levelLoadError",t.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",t.LEVEL_PARSING_ERROR="levelParsingError",t.LEVEL_SWITCH_ERROR="levelSwitchError",t.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",t.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",t.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",t.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",t.FRAG_LOAD_ERROR="fragLoadError",t.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",t.FRAG_DECRYPT_ERROR="fragDecryptError",t.FRAG_PARSING_ERROR="fragParsingError",t.FRAG_GAP="fragGap",t.REMUX_ALLOC_ERROR="remuxAllocError",t.KEY_LOAD_ERROR="keyLoadError",t.KEY_LOAD_TIMEOUT="keyLoadTimeOut",t.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",t.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",t.BUFFER_APPEND_ERROR="bufferAppendError",t.BUFFER_APPENDING_ERROR="bufferAppendingError",t.BUFFER_STALLED_ERROR="bufferStalledError",t.BUFFER_FULL_ERROR="bufferFullError",t.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",t.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",t.ASSET_LIST_LOAD_ERROR="assetListLoadError",t.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",t.ASSET_LIST_PARSING_ERROR="assetListParsingError",t.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",t.INTERNAL_EXCEPTION="internalException",t.INTERNAL_ABORTED="aborted",t.ATTACH_MEDIA_ERROR="attachMediaError",t.UNKNOWN="unknown",t}({}),o=function(t){return t.MEDIA_ATTACHING="hlsMediaAttaching",t.MEDIA_ATTACHED="hlsMediaAttached",t.MEDIA_DETACHING="hlsMediaDetaching",t.MEDIA_DETACHED="hlsMediaDetached",t.MEDIA_ENDED="hlsMediaEnded",t.STALL_RESOLVED="hlsStallResolved",t.BUFFER_RESET="hlsBufferReset",t.BUFFER_CODECS="hlsBufferCodecs",t.BUFFER_CREATED="hlsBufferCreated",t.BUFFER_APPENDING="hlsBufferAppending",t.BUFFER_APPENDED="hlsBufferAppended",t.BUFFER_EOS="hlsBufferEos",t.BUFFERED_TO_END="hlsBufferedToEnd",t.BUFFER_FLUSHING="hlsBufferFlushing",t.BUFFER_FLUSHED="hlsBufferFlushed",t.MANIFEST_LOADING="hlsManifestLoading",t.MANIFEST_LOADED="hlsManifestLoaded",t.MANIFEST_PARSED="hlsManifestParsed",t.LEVEL_SWITCHING="hlsLevelSwitching",t.LEVEL_SWITCHED="hlsLevelSwitched",t.LEVEL_LOADING="hlsLevelLoading",t.LEVEL_LOADED="hlsLevelLoaded",t.LEVEL_UPDATED="hlsLevelUpdated",t.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",t.LEVELS_UPDATED="hlsLevelsUpdated",t.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",t.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",t.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",t.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",t.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",t.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",t.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",t.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",t.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",t.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",t.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",t.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",t.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",t.CUES_PARSED="hlsCuesParsed",t.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",t.INIT_PTS_FOUND="hlsInitPtsFound",t.FRAG_LOADING="hlsFragLoading",t.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",t.FRAG_LOADED="hlsFragLoaded",t.FRAG_DECRYPTED="hlsFragDecrypted",t.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",t.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",t.FRAG_PARSING_METADATA="hlsFragParsingMetadata",t.FRAG_PARSED="hlsFragParsed",t.FRAG_BUFFERED="hlsFragBuffered",t.FRAG_CHANGED="hlsFragChanged",t.FPS_DROP="hlsFpsDrop",t.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",t.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",t.ERROR="hlsError",t.DESTROYING="hlsDestroying",t.KEY_LOADING="hlsKeyLoading",t.KEY_LOADED="hlsKeyLoaded",t.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",t.BACK_BUFFER_REACHED="hlsBackBufferReached",t.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",t.ASSET_LIST_LOADING="hlsAssetListLoading",t.ASSET_LIST_LOADED="hlsAssetListLoaded",t.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",t.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",t.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",t.INTERSTITIAL_STARTED="hlsInterstitialStarted",t.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",t.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",t.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",t.INTERSTITIAL_ENDED="hlsInterstitialEnded",t.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",t.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",t.EVENT_CUE_ENTER="hlsEventCueEnter",t}({});var l="manifest",u="level",c="audioTrack",h="subtitleTrack",d="main",f="audio",p="subtitle";class g{constructor(t,e=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=n}sample(t,e){const n=Math.pow(this.alpha_,t);this.estimate_=e*(1-n)+n*this.estimate_,this.totalWeight_+=t}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_}}class m{constructor(t,e,n,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new g(t),this.fast_=new g(e),this.defaultTTFB_=r,this.ttfb_=new g(t)}update(t,e){const{slow_:n,fast_:r,ttfb_:i}=this;n.halfLife!==t&&(this.slow_=new g(t,n.getEstimate(),n.getTotalWeight())),r.halfLife!==e&&(this.fast_=new g(e,r.getEstimate(),r.getTotalWeight())),i.halfLife!==t&&(this.ttfb_=new g(t,i.getEstimate(),i.getTotalWeight()))}sample(t,e){const n=(t=Math.max(t,this.minDelayMs_))/1e3,r=8*e/n;this.fast_.sample(n,r),this.slow_.sample(n,r)}sampleTTFB(t){const e=t/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(e,2)/2);this.ttfb_.sample(n,Math.max(t,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 _(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function w(){return w=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},w.apply(null,arguments)}function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function v(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach((function(e){_(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}class B{constructor(t,e){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=`[${t}]:`;this.trace=b,this.debug=e.debug.bind(null,n),this.log=e.log.bind(null,n),this.warn=e.warn.bind(null,n),this.info=e.info.bind(null,n),this.error=e.error.bind(null,n)}}const b=function(){},E={trace:b,debug:b,log:b,warn:b,info:b,error:b};function C(){return w({},E)}function k(t,e,n){return e[t]?e[t].bind(e):function(t,e){const n=self.console[t];return n?n.bind(self.console,`${e?"["+e+"] ":""}[${t}] >`):b}(t,n)}const F=C();const T=F;function S(t=!0){if("undefined"==typeof self)return;return(t||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function x(t,e){const n=Object.keys(t),r=Object.keys(e),i=n.length,s=r.length;return!i||!s||i===s&&!n.some((t=>-1===r.indexOf(t)))}function I(t,e=!1){if("undefined"!=typeof TextDecoder){const n=new TextDecoder("utf-8").decode(t);if(e){const t=n.indexOf("\0");return-1!==t?n.substring(0,t):n}return n.replace(/\0/g,"")}const n=t.length;let r,i,s,A="",a=0;for(;a<n;){if(r=t[a++],0===r&&e)return A;if(0!==r&&3!==r)switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:A+=String.fromCharCode(r);break;case 12:case 13:i=t[a++],A+=String.fromCharCode((31&r)<<6|63&i);break;case 14:i=t[a++],s=t[a++],A+=String.fromCharCode((15&r)<<12|(63&i)<<6|(63&s)<<0)}}return A}function D(t){let e="";for(let n=0;n<t.length;n++){let r=t[n].toString(16);r.length<2&&(r="0"+r),e+=r}return e}function U(t){return Uint8Array.from(t.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function L(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var R,Q={exports:{}};var O,P,M,N,H,K=(R||(R=1,O=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,P=/^(?=([^\/?#]*))\1([^]*)$/,M=/(?:\/|^)\.(?=\/)/g,N=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,Q.exports=H={buildAbsoluteURL:function(t,e,n){if(n=n||{},t=t.trim(),!(e=e.trim())){if(!n.alwaysNormalize)return t;var r=H.parseURL(t);if(!r)throw new Error("Error trying to parse base URL.");return r.path=H.normalizePath(r.path),H.buildURLFromParts(r)}var i=H.parseURL(e);if(!i)throw new Error("Error trying to parse relative URL.");if(i.scheme)return n.alwaysNormalize?(i.path=H.normalizePath(i.path),H.buildURLFromParts(i)):e;var s=H.parseURL(t);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var A=P.exec(s.path);s.netLoc=A[1],s.path=A[2]}s.netLoc&&!s.path&&(s.path="/");var a={scheme:s.scheme,netLoc:i.netLoc,path:null,params:i.params,query:i.query,fragment:i.fragment};if(!i.netLoc&&(a.netLoc=s.netLoc,"/"!==i.path[0]))if(i.path){var o=s.path,l=o.substring(0,o.lastIndexOf("/")+1)+i.path;a.path=H.normalizePath(l)}else a.path=s.path,i.params||(a.params=s.params,i.query||(a.query=s.query));return null===a.path&&(a.path=n.alwaysNormalize?H.normalizePath(i.path):i.path),H.buildURLFromParts(a)},parseURL:function(t){var e=O.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(M,"");t.length!==(t=t.replace(N,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}}),Q.exports);class ${constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var G="audio",V="video",j="audiovideo";class Z{constructor(t){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,"string"==typeof t&&(t={url:t}),this.base=t,function(t,e){const n=X(t,e);n&&(n.enumerable=!0,Object.defineProperty(t,e,n))}(this,"stats")}setByteRange(t,e){const n=t.split("@",2);let r;r=1===n.length?(null==e?void 0:e.byteRangeEndOffset)||0:parseInt(n[1]),this._byteRange=[r,parseInt(n[0])+r]}get baseurl(){return this.base.url}get byteRange(){return null===this._byteRange?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return null===this._streams&&(this._streams={[G]:null,[V]:null,[j]:null}),this._streams}set elementaryStreams(t){this._streams=t}get hasStats(){return null!==this._stats}get hasStreams(){return null!==this._streams}get stats(){return null===this._stats&&(this._stats=new $),this._stats}set stats(t){this._stats=t}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=K.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(t){this._url=t}clearElementaryStreamInfo(){const{elementaryStreams:t}=this;t[G]=null,t[V]=null,t[j]=null}}function W(t){return"initSegment"!==t.sn}class z extends Z{constructor(t,e){super(e),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=t}get byteLength(){if(this.hasStats){const t=this.stats.total;if(t)return t}if(this.byteRange.length){const t=this.byteRange[0],e=this.byteRange[1];if(r(t)&&r(e))return e-t}return null}get bitrate(){return this.byteLength?8*this.byteLength/this.duration:this._bitrate?this._bitrate:null}set bitrate(t){this._bitrate=t}get decryptdata(){var t;const{levelkeys:e}=this;if(!e||e.NONE)return null;if(e.identity)this._decryptdata||(this._decryptdata=e.identity.getDecryptData(this.sn));else if(null==(t=this._decryptdata)||!t.keyId){const t=Object.keys(e);if(1===t.length){const n=this._decryptdata=e[t[0]]||null;n&&(this._decryptdata=n.getDecryptData(this.sn,e))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(null===this.programDateTime)return null;const t=r(this.duration)?this.duration:0;return this.programDateTime+1e3*t}get encrypted(){var t;if(null!=(t=this._decryptdata)&&t.encrypted)return!0;if(this.levelkeys){var e;const t=Object.keys(this.levelkeys),n=t.length;if(n>1||1===n&&null!=(e=this.levelkeys[t[0]])&&e.encrypted)return!0}return!1}get programDateTime(){return null===this._programDateTime&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(t){r(t)?this._programDateTime=t:this._programDateTime=this.rawProgramDateTime=null}get ref(){return W(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(t){this.setStart(this.start+t)}setStart(t){this.start=t,this._ref&&(this._ref.start=t)}setDuration(t){this.duration=t,this._ref&&(this._ref.duration=t)}setKeyFormat(t){const e=this.levelkeys;if(e){var n;const r=e[t];!r||null!=(n=this._decryptdata)&&n.keyId||(this._decryptdata=r.getDecryptData(this.sn,e))}}abortRequests(){var t,e;null==(t=this.loader)||t.abort(),null==(e=this.keyLoader)||e.abort()}setElementaryStreamInfo(t,e,n,r,i,s=!1){const{elementaryStreams:A}=this,a=A[t];a?(a.startPTS=Math.min(a.startPTS,e),a.endPTS=Math.max(a.endPTS,n),a.startDTS=Math.min(a.startDTS,r),a.endDTS=Math.max(a.endDTS,i)):A[t]={startPTS:e,endPTS:n,startDTS:r,endDTS:i,partial:s}}}class Y extends Z{constructor(t,e,n,r,i){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=t.decimalFloatingPoint("DURATION"),this.gap=t.bool("GAP"),this.independent=t.bool("INDEPENDENT"),this.relurl=t.enumeratedString("URI"),this.fragment=e,this.index=r;const s=t.enumeratedString("BYTERANGE");s&&this.setByteRange(s,i),i&&(this.fragOffset=i.fragOffset+i.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:t}=this;return!!(t.audio||t.video||t.audiovideo)}}function X(t,e){const n=Object.getPrototypeOf(t);if(n){const t=Object.getOwnPropertyDescriptor(n,e);return t||X(n,e)}}const q=Math.pow(2,32)-1,J=[].push,tt={video:1,audio:2,id3:3,text:4};function et(t){return String.fromCharCode.apply(null,t)}function nt(t,e){const n=t[e]<<8|t[e+1];return n<0?65536+n:n}function rt(t,e){const n=st(t,e);return n<0?4294967296+n:n}function it(t,e){let n=rt(t,e);return n*=Math.pow(2,32),n+=rt(t,e+4),n}function st(t,e){return t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function At(t,e){const n=[];if(!e.length)return n;const r=t.byteLength;for(let i=0;i<r;){const s=rt(t,i),A=s>1?i+s:r;if(et(t.subarray(i+4,i+8))===e[0])if(1===e.length)n.push(t.subarray(i+8,A));else{const r=At(t.subarray(i+8,A),e.slice(1));r.length&&J.apply(n,r)}i=A}return n}function at(t){const e=[],n=t[0];let r=8;const i=rt(t,r);r+=4;let s=0,A=0;0===n?(s=rt(t,r),A=rt(t,r+4),r+=8):(s=it(t,r),A=it(t,r+8),r+=16),r+=2;let a=t.length+A;const o=nt(t,r);r+=2;for(let n=0;n<o;n++){let n=r;const s=rt(t,n);n+=4;const A=2147483647&s;if(1===(2147483648&s)>>>31)return T.warn("SIDX has hierarchical references (not supported)"),null;const o=rt(t,n);n+=4,e.push({referenceSize:A,subsegmentDuration:o,info:{duration:o/i,start:a,end:a+A-1}}),a+=A,n+=4,r=n}return{earliestPresentationTime:s,timescale:i,version:n,referencesCount:o,references:e}}function ot(t){const e=[],n=At(t,["moov","trak"]);for(let t=0;t<n.length;t++){const r=n[t],i=At(r,["tkhd"])[0];if(i){let t=i[0];const n=rt(i,0===t?12:20),s=At(r,["mdia","mdhd"])[0];if(s){t=s[0];const i=rt(s,0===t?12:20),A=At(r,["mdia","hdlr"])[0];if(A){const t=et(A.subarray(8,12)),s={soun:G,vide:V}[t],a=lt(At(r,["mdia","minf","stbl","stsd"])[0]);s?(e[n]={timescale:i,type:s,stsd:a},e[s]=v({timescale:i,id:n},a)):e[n]={timescale:i,type:t,stsd:a}}}}}return At(t,["moov","mvex","trex"]).forEach((t=>{const n=rt(t,4),r=e[n];r&&(r.default={duration:rt(t,12),flags:rt(t,20)})})),e}function lt(t){const e=t.subarray(8),n=e.subarray(86),r=et(e.subarray(4,8));let i,s=r;const A="enca"===r||"encv"===r;if(A){const t=At(e,[r])[0];At(t.subarray("enca"===r?28:78),["sinf"]).forEach((t=>{const e=At(t,["schm"])[0];if(e){const n=et(e.subarray(4,8));if("cbcs"===n||"cenc"===n){const e=At(t,["frma"])[0];e&&(s=et(e))}}}))}const a=s;switch(s){case"avc1":case"avc2":case"avc3":case"avc4":{const t=At(n,["avcC"])[0];t&&t.length>3&&(s+="."+ht(t[1])+ht(t[2])+ht(t[3]),i=ut("avc1"===a?"dva1":"dvav",n));break}case"mp4a":{const t=At(e,[r])[0],n=At(t.subarray(28),["esds"])[0];if(n&&n.length>7){let t=4;if(3!==n[t++])break;t=ct(n,t),t+=2;const e=n[t++];if(128&e&&(t+=2),64&e&&(t+=n[t++]),4!==n[t++])break;t=ct(n,t);const r=n[t++];if(64!==r)break;if(s+="."+ht(r),t+=12,5!==n[t++])break;t=ct(n,t);const i=n[t++];let A=(248&i)>>3;31===A&&(A+=1+((7&i)<<3)+((224&n[t])>>5)),s+="."+A}break}case"hvc1":case"hev1":{const t=At(n,["hvcC"])[0];if(t&&t.length>12){const e=t[1],n=["","A","B","C"][e>>6],r=31&e,i=rt(t,2),A=(32&e)>>5?"H":"L",a=t[12],o=t.subarray(6,12);s+="."+n+r,s+="."+function(t){let e=0;for(let n=0;n<32;n++)e|=(t>>n&1)<<31-n;return e>>>0}(i).toString(16).toUpperCase(),s+="."+A+a;let l="";for(let t=o.length;t--;){const e=o[t];if(e||l){l="."+e.toString(16).toUpperCase()+l}}s+=l}i=ut("hev1"==a?"dvhe":"dvh1",n);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":s=ut(s,n)||s;break;case"vp09":{const t=At(n,["vpcC"])[0];if(t&&t.length>6){const e=t[4],n=t[5],r=t[6]>>4&15;s+="."+dt(e)+"."+dt(n)+"."+dt(r)}break}case"av01":{const t=At(n,["av1C"])[0];if(t&&t.length>2){const e=t[1]>>>5,r=31&t[1],A=t[2]>>>7?"H":"M",a=(64&t[2])>>6,o=(32&t[2])>>5,l=2===e&&a?o?12:10:a?10:8,u=(16&t[2])>>4,c=(8&t[2])>>3,h=(4&t[2])>>2,d=3&t[2],f=1,p=1,g=1,m=0;s+="."+e+"."+dt(r)+A+"."+dt(l)+"."+u+"."+c+h+d+"."+dt(f)+"."+dt(p)+"."+dt(g)+"."+m,i=ut("dav1",n)}break}}return{codec:s,encrypted:A,supplemental:i}}function ut(t,e){const n=At(e,["dvvC"]),r=n.length?n[0]:At(e,["dvcC"])[0];if(r){const e=r[2]>>1&127,n=r[2]<<5&32|r[3]>>3&31;return t+"."+dt(e)+"."+dt(n)}}function ct(t,e){const n=e+5;for(;128&t[e++]&&e<n;);return e}function ht(t){return("0"+t.toString(16).toUpperCase()).slice(-2)}function dt(t){return(t<10?"0":"")+t}function ft(t,e){At(t,["moov","trak"]).forEach((t=>{const n=At(t,["mdia","minf","stbl","stsd"])[0];if(!n)return;const r=n.subarray(8);let i=At(r,["enca"]);const s=i.length>0;s||(i=At(r,["encv"])),i.forEach((t=>{At(s?t.subarray(28):t.subarray(78),["sinf"]).forEach((t=>{const n=pt(t);n&&e(n,s)}))}))}))}function pt(t){const e=At(t,["schm"])[0];if(e){const n=et(e.subarray(4,8));if("cbcs"===n||"cenc"===n){const e=At(t,["schi","tenc"])[0];if(e)return e}}}function gt(t,e){const n=new Uint8Array(t.length+e.length);return n.set(t),n.set(e,t.length),n}function mt(t,e){const n=[],r=e.samples,i=e.timescale,s=e.id;let A=!1;return At(r,["moof"]).map((a=>{const o=a.byteOffset-8;At(a,["traf"]).map((a=>{const l=At(a,["tfdt"]).map((t=>{const e=t[0];let n=rt(t,4);return 1===e&&(n*=Math.pow(2,32),n+=rt(t,8)),n/i}))[0];return void 0!==l&&(t=l),At(a,["tfhd"]).map((l=>{const u=rt(l,4),c=16777215&rt(l,0);let h=0;const d=0!=(16&c);let f=0;const p=0!=(32&c);let g=8;u===s&&(0!=(1&c)&&(g+=8),0!=(2&c)&&(g+=4),0!=(8&c)&&(h=rt(l,g),g+=4),d&&(f=rt(l,g),g+=4),p&&(g+=4),"video"===e.type&&(A=_t(e.codec)),At(a,["trun"]).map((s=>{const a=s[0],l=16777215&rt(s,0),u=0!=(1&l);let c=0;const d=0!=(4&l),p=0!=(256&l);let g=0;const m=0!=(512&l);let _=0;const w=0!=(1024&l),y=0!=(2048&l);let v=0;const B=rt(s,4);let b=8;u&&(c=rt(s,b),b+=4),d&&(b+=4);let E=c+o;for(let o=0;o<B;o++){if(p?(g=rt(s,b),b+=4):g=h,m?(_=rt(s,b),b+=4):_=f,w&&(b+=4),y&&(v=0===a?rt(s,b):st(s,b),b+=4),e.type===V){let e=0;for(;e<_;){const s=rt(r,E);if(E+=4,wt(A,r[E])){yt(r.subarray(E,E+s),A?2:1,t+v/i,n)}E+=s,e+=s+4}}t+=g/i}})))}))}))})),n}function _t(t){if(!t)return!1;const e=t.substring(0,4);return"hvc1"===e||"hev1"===e||"dvh1"===e||"dvhe"===e}function wt(t,e){if(t){const t=e>>1&63;return 39===t||40===t}return 6===(31&e)}function yt(t,e,n,r){const i=vt(t);let s=0;s+=e;let A=0,a=0,o=0;for(;s<i.length;){A=0;do{if(s>=i.length)break;o=i[s++],A+=o}while(255===o);a=0;do{if(s>=i.length)break;o=i[s++],a+=o}while(255===o);const t=i.length-s;let e=s;if(a<t)s+=a;else if(a>t){T.error(`Malformed SEI payload. ${a} is too small, only ${t} bytes left to parse.`);break}if(4===A){if(181===i[e++]){const t=nt(i,e);if(e+=2,49===t){const t=rt(i,e);if(e+=4,1195456820===t){const t=i[e++];if(3===t){const s=i[e++],a=64&s,o=a?2+3*(31&s):0,l=new Uint8Array(o);if(a){l[0]=s;for(let t=1;t<o;t++)l[t]=i[e++]}r.push({type:t,payloadType:A,pts:n,bytes:l})}}}}}else if(5===A&&a>16){const t=[];for(let n=0;n<16;n++){const r=i[e++].toString(16);t.push(1==r.length?"0"+r:r),3!==n&&5!==n&&7!==n&&9!==n||t.push("-")}const s=a-16,o=new Uint8Array(s);for(let t=0;t<s;t++)o[t]=i[e++];r.push({payloadType:A,pts:n,uuid:t.join(""),userData:I(o),userDataBytes:o})}}}function vt(t){const e=t.byteLength,n=[];let r=1;for(;r<e-2;)0===t[r]&&0===t[r+1]&&3===t[r+2]?(n.push(r+2),r+=2):r++;if(0===n.length)return t;const i=e-n.length,s=new Uint8Array(i);let A=0;for(r=0;r<i;A++,r++)A===n[0]&&(A++,n.shift()),s[r]=t[A];return s}function Bt(t,e,n){if(16!==t.byteLength)throw new RangeError("Invalid system id");let r,i,s;r=0,i=new Uint8Array,s=new Uint8Array;const A=new Uint8Array(4);return n.byteLength>0&&new DataView(A.buffer).setUint32(0,n.byteLength,!1),function(t,...e){const n=e.length;let r=8,i=n;for(;i--;)r+=e[i].byteLength;const s=new Uint8Array(r);for(s[0]=r>>24&255,s[1]=r>>16&255,s[2]=r>>8&255,s[3]=255&r,s.set(t,4),i=0,r=8;i<n;i++)s.set(e[i],r),r+=e[i].byteLength;return s}([112,115,115,104],new Uint8Array([0,0,0,0]),t,s,i,A,n)}function bt(t){const e=t.getUint32(0),n=t.byteOffset,r=t.byteLength;if(r<e)return{offset:n,size:r};if(1886614376!==t.getUint32(4))return{offset:n,size:e};const i=t.getUint32(8)>>>24;if(0!==i&&1!==i)return{offset:n,size:e};const s=t.buffer,A=D(new Uint8Array(s,n+12,16));let a=null,o=null,l=0;if(0===i)l=28;else{const i=t.getUint32(28);if(!i||r<32+16*i)return{offset:n,size:e};a=[];for(let t=0;t<i;t++)a.push(new Uint8Array(s,n+32+16*t,16));l=32+16*i}if(!l)return{offset:n,size:e};const u=t.getUint32(l);return e-32<u?{offset:n,size:e}:(o=new Uint8Array(s,n+l+4,u),{version:i,systemId:A,kids:a,data:o,offset:n,size:e})}const Et=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Ct={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 kt(t,e){const n=Ct[e];return!!n&&!!n[t.slice(0,4)]}function Ft(t,e,n=!0){return!t.split(",").some((t=>!Tt(t,e,n)))}function Tt(t,e,n=!0){var r;const i=S(n);return null!=(r=null==i?void 0:i.isTypeSupported(St(t,e)))&&r}function St(t,e){return`${e}/mp4;codecs=${t}`}function xt(t){if(t){const e=t.substring(0,4);return Ct.video[e]}return 2}function It(t){const e=Et();return t.split(",").reduce(((t,n)=>{const r=e&&_t(n)?9:Ct.video[n];return r?(2*r+t)/(t?3:2):(Ct.audio[n]+t)/(t?2:1)}),0)}const Dt={};const Ut=/flac|opus|mp4a\.40\.34/i;function Lt(t,e=!0){return t.replace(Ut,(t=>function(t,e=!0){if(Dt[t])return Dt[t];const n={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[t];for(let i=0;i<n.length;i++){var r;if(Tt(n[i],"audio",e))return Dt[t]=n[i],n[i];if("mp3"===n[i]&&null!=(r=S(e))&&r.isTypeSupported("audio/mpeg"))return""}return t}(t.toLowerCase(),e)))}function Rt(t,e){if(t&&(t.length>4||-1!==["ac-3","ec-3","alac","fLaC","Opus"].indexOf(t))&&(Qt(t,"audio")||Qt(t,"video")))return t;if(e){const n=e.split(",");if(n.length>1){if(t)for(let e=n.length;e--;)if(n[e].substring(0,4)===t.substring(0,4))return n[e];return n[0]}}return e||t}function Qt(t,e){return kt(t,e)&&Tt(t,e)}function Ot(t){if(t.startsWith("av01.")){const e=t.split("."),n=["0","111","01","01","01","0"];for(let t=e.length;t>4&&t<10;t++)e[t]=n[t-4];return e.join(".")}return t}function Pt(t){const e=S(t)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function Mt(t){return t.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const Nt={supported:!1,smooth:!1,powerEfficient:!1},Ht={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function Kt(t,e){return{supported:!1,configurations:e,decodingInfoResults:[Nt],error:t}}function $t(t,e,n,i,s,A){const a=t.videoCodec,o=t.audioCodec?t.audioGroups:null,l=null==A?void 0:A.audioCodec,u=null==A?void 0:A.channels,c=u?parseInt(u):l?1/0:2;let h=null;if(null!=o&&o.length)try{h=1===o.length&&o[0]?e.groups[o[0]].channels:o.reduce(((t,n)=>{if(n){const r=e.groups[n];if(!r)throw new Error(`Audio track group ${n} not found`);Object.keys(r.channels).forEach((e=>{t[e]=(t[e]||0)+r.channels[e]}))}return t}),{2:0})}catch(t){return!0}return void 0!==a&&(a.split(",").some((t=>_t(t)))||t.width>1920&&t.height>1088||t.height>1920&&t.width>1088||t.frameRate>Math.max(i,30)||"SDR"!==t.videoRange&&t.videoRange!==n||t.bitrate>Math.max(s,8e6))||!!h&&r(c)&&Object.keys(h).some((t=>parseInt(t)>c))}function Gt(t,e,n,r={}){const i=t.videoCodec;if(!i&&!t.audioCodec||!n)return Promise.resolve(Ht);const s=[],A=function(t){var e;const n=null==(e=t.videoCodec)?void 0:e.split(","),r=jt(t),i=t.width||640,s=t.height||480,A=t.frameRate||30,a=t.videoRange.toLowerCase();return n?n.map((t=>{const e={contentType:St(Ot(t),"video"),width:i,height:s,bitrate:r,framerate:A};return"sdr"!==a&&(e.transferFunction=a),e})):[]}(t),a=A.length,o=function(t,e,n){var r;const i=null==(r=t.audioCodec)?void 0:r.split(","),s=jt(t);if(i&&t.audioGroups)return t.audioGroups.reduce(((t,r)=>{var A;const a=r?null==(A=e.groups[r])?void 0:A.tracks:null;return a?a.reduce(((t,e)=>{if(e.groupId===r){const r=parseFloat(e.channels||"");i.forEach((e=>{const i={contentType:St(e,"audio"),bitrate:n?Vt(e,s):s};r&&(i.channels=""+r),t.push(i)}))}return t}),t):t}),[]);return[]}(t,e,a>0),l=o.length;for(let t=a||1*l||1;t--;){const e={type:"media-source"};if(a&&(e.video=A[t%a]),l){e.audio=o[t%l];const n=e.audio.bitrate;e.video&&n&&(e.video.bitrate-=n)}s.push(e)}if(i){const t=navigator.userAgent;if(i.split(",").some((t=>_t(t)))&&Et())return Promise.resolve(Kt(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${t})`),s))}return Promise.all(s.map((t=>{const e=function(t){let e="";const{audio:n,video:r}=t;if(r){e+=`${Mt(r.contentType)}_r${r.height}x${r.width}f${Math.ceil(r.framerate)}${r.transferFunction||"sd"}_${Math.ceil(r.bitrate/1e5)}`}if(n){e+=`${r?"_":""}${Mt(n.contentType)}_c${n.channels}`}return e}(t);return r[e]||(r[e]=n.decodingInfo(t))}))).then((t=>({supported:!t.some((t=>!t.supported)),configurations:s,decodingInfoResults:t}))).catch((t=>({supported:!1,configurations:s,decodingInfoResults:[],error:t})))}function Vt(t,e){if(e<=1)return 1;let n=128e3;return"ec-3"===t?n=768e3:"ac-3"===t&&(n=64e4),Math.min(e/2,n)}function jt(t){return 1e3*Math.ceil(Math.max(.9*t.bitrate,t.averageBitrate)/1e3)||1}const Zt=["NONE","TYPE-0","TYPE-1",null];const Wt=["SDR","PQ","HLG"];var zt="",Yt="YES",Xt="v2";function qt(t){const{canSkipUntil:e,canSkipDateRanges:n,age:r}=t;return e&&r<e/2?n?Xt:Yt:zt}class Jt{constructor(t,e,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=t,this.part=e,this.skip=n}addDirectives(t){const e=new self.URL(t);return void 0!==this.msn&&e.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&e.searchParams.set("_HLS_part",this.part.toString()),this.skip&&e.searchParams.set("_HLS_skip",this.skip),e.href}}class te{constructor(t){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=[t.url],this._attrs=[t.attrs],this.bitrate=t.bitrate,t.details&&(this.details=t.details),this.id=t.id||0,this.name=t.name,this.width=t.width||0,this.height=t.height||0,this.frameRate=t.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=t.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=t.audioCodec,this.videoCodec=t.videoCodec,this.codecSet=[t.videoCodec,t.audioCodec].filter((t=>!!t)).map((t=>t.substring(0,4))).join(","),"supplemental"in t){var e;this.supplemental=t.supplemental;const n=null==(e=t.supplemental)?void 0:e.videoCodec;n&&n!==t.videoCodec&&(this.codecSet+=`,${n.substring(0,4)}`)}this.addGroupId("audio",t.attrs.AUDIO),this.addGroupId("text",t.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(t){return ee(this._audioGroups,t)}hasSubtitleGroup(t){return ee(this._subtitleGroups,t)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(t,e){if(e)if("audio"===t){let t=this._audioGroups;t||(t=this._audioGroups=[]),-1===t.indexOf(e)&&t.push(e)}else if("text"===t){let t=this._subtitleGroups;t||(t=this._subtitleGroups=[]),-1===t.indexOf(e)&&t.push(e)}}get urlId(){return 0}set urlId(t){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var t;return null==(t=this.audioGroups)?void 0:t[0]}get textGroupId(){var t;return null==(t=this.subtitleGroups)?void 0:t[0]}addFallback(){}}function ee(t,e){return!(!e||!t)&&-1!==t.indexOf(e)}function ne(t,e){let n=!1,r=[];if(t&&(n="SDR"!==t,r=[t]),e){r=e.allowedVideoRanges||Wt.slice(0);const t="SDR"!==r.join("")&&!e.videoCodec;n=void 0!==e.preferHDR?e.preferHDR:t&&function(){if("function"==typeof matchMedia){const t=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(t.media!==e.media)return!0===t.matches}return!1}(),n||(r=["SDR"])}return{preferHDR:n,allowedVideoRanges:r}}const re=(t,e)=>JSON.stringify(t,(t=>{const e=new WeakSet;return(n,r)=>{if(t&&(r=t(n,r)),"object"==typeof r&&null!==r){if(e.has(r))return;e.add(r)}return r}})(e));function ie(t,e){T.log(`[abr] start candidates with "${t}" ignored because ${e}`)}function se(t){return t.reduce(((t,e)=>{let n=t.groups[e.groupId];n||(n=t.groups[e.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(e);const r=e.channels||"2";return n.channels[r]=(n.channels[r]||0)+1,n.hasDefault=n.hasDefault||e.default,n.hasAutoSelect=n.hasAutoSelect||e.autoselect,n.hasDefault&&(t.hasDefaultAudio=!0),n.hasAutoSelect&&(t.hasAutoSelectAudio=!0),t}),{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Ae(t){if(!t)return t;const{lang:e,assocLang:n,characteristics:r,channels:i,audioCodec:s}=t;return{lang:e,assocLang:n,characteristics:r,channels:i,audioCodec:s}}function ae(t,e,n){if("attrs"in t){const n=e.indexOf(t);if(-1!==n)return n}for(let r=0;r<e.length;r++){if(oe(t,e[r],n))return r}return-1}function oe(t,e,n){const{groupId:r,name:i,lang:s,assocLang:A,default:a}=t,o=t.forced;return(void 0===r||e.groupId===r)&&(void 0===i||e.name===i)&&(void 0===s||function(t,e="--"){if(t.length===e.length)return t===e;return t.startsWith(e)||e.startsWith(t)}(s,e.lang))&&(void 0===s||e.assocLang===A)&&(void 0===a||e.default===a)&&(void 0===o||e.forced===o)&&(!("characteristics"in t)||function(t,e=""){const n=t.split(","),r=e.split(",");return n.length===r.length&&!n.some((t=>-1===r.indexOf(t)))}(t.characteristics||"",e.characteristics))&&(void 0===n||n(t,e))}function le(t,e){const{audioCodec:n,channels:r}=t;return!(void 0!==n&&(e.audioCodec||"").substring(0,4)!==n.substring(0,4)||void 0!==r&&r!==(e.channels||"2"))}function ue(t,e,n){for(let r=e;r>-1;r--)if(n(t[r]))return r;for(let r=e+1;r<t.length;r++)if(n(t[r]))return r;return-1}function ce(t,e){var n;return!!t&&t!==(null==(n=e.loadLevelObj)?void 0:n.uri)}const he=function(t,e){let n=0,r=t.length-1,i=null,s=null;for(;n<=r;){i=(n+r)/2|0,s=t[i];const A=e(s);if(A>0)n=i+1;else{if(!(A<0))return s;r=i-1}}return null};function de(t,e,n=0,r=0,i=.005){let s=null;if(t){s=e[1+t.sn-e[0].sn]||null;const r=t.endDTS-n;r>0&&r<15e-7&&(n+=15e-7),s&&t.level!==s.level&&s.end<=t.end&&(s=e[2+t.sn-e[0].sn]||null)}else 0===n&&0===e[0].start&&(s=e[0]);if(s&&((!t||t.level===s.level)&&0===fe(n,r,s)||function(t,e,n){if(e&&0===e.start&&e.level<t.level&&(e.endPTS||0)>0){const r=e.tagList.reduce(((t,e)=>("INF"===e[0]&&(t+=parseFloat(e[1])),t)),n);return t.start<=r}return!1}(s,t,Math.min(i,r))))return s;const A=he(e,fe.bind(null,n,r));return!A||A===t&&s?s:A}function fe(t=0,e=0,n){if(n.start<=t&&n.start+n.duration>t)return 0;const r=Math.min(e,n.duration+(n.deltaPTS?n.deltaPTS:0));return n.start+n.duration-r<=t?1:n.start-r>t&&n.start?-1:0}function pe(t,e,n){const r=1e3*Math.min(e,n.duration+(n.deltaPTS?n.deltaPTS:0));return(n.endProgramDateTime||0)-r>t}function ge(t,e,n){if(t&&t.startCC<=e&&t.endCC>=e){let r=t.fragments;const{fragmentHint:i}=t;let s;return i&&(r=r.concat(i)),he(r,(t=>t.cc<e?1:t.cc>e?-1:(s=t,t.end<=n?1:t.start>n?-1:0))),s||null}return null}function me(t){switch(t.details){case a.FRAG_LOAD_TIMEOUT:case a.KEY_LOAD_TIMEOUT:case a.LEVEL_LOAD_TIMEOUT:case a.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function _e(t){return t.details.startsWith("key")}function we(t){return _e(t)&&!!t.frag&&!t.frag.decryptdata}function ye(t,e){const n=me(e);return t.default[(n?"timeout":"error")+"Retry"]}function ve(t,e){const n="linear"===t.backoff?1:Math.pow(2,e);return Math.min(n*t.retryDelayMs,t.maxRetryDelayMs)}function Be(t){return v(v({},t),{errorRetry:null,timeoutRetry:null})}function be(t,e,n,r){if(!t)return!1;const i=null==r?void 0:r.code,s=e<t.maxNumRetry&&(function(t){return Ee(t)||!!t&&(t<400||t>499)}(i)||!!n);return t.shouldRetry?t.shouldRetry(t,e,n,r,s):s}function Ee(t){return 0===t&&!1===navigator.onLine}var Ce=0,ke=2,Fe=3,Te=5,Se=0,xe=1,Ie=2,De=4;function Ue(t){const e={action:Ce,flags:Se};return t&&(e.resolved=!0),e}var Le="NOT_LOADED",Re="APPENDING",Qe="PARTIAL",Oe="OK";class Pe{constructor(t){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=t,this._registerListeners()}_registerListeners(){const{hls:t}=this;t&&(t.on(o.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.BUFFER_APPENDED,this.onBufferAppended,this),t.on(o.FRAG_BUFFERED,this.onFragBuffered,this),t.on(o.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){const{hls:t}=this;t&&(t.off(o.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.BUFFER_APPENDED,this.onBufferAppended,this),t.off(o.FRAG_BUFFERED,this.onFragBuffered,this),t.off(o.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(t,e){const n=this.activePartLists[e];if(n)for(let e=n.length;e--;){const r=n[e];if(!r)break;if(r.start<=t&&t<=r.end&&r.loaded)return r}return this.getBufferedFrag(t,e)}getBufferedFrag(t,e){return this.getFragAtPos(t,e,!0)}getFragAtPos(t,e,n){const{fragments:r}=this,i=Object.keys(r);for(let s=i.length;s--;){const A=r[i[s]];if((null==A?void 0:A.body.type)===e&&(!n||A.buffered)){const e=A.body;if(e.start<=t&&t<=e.end)return e}}return null}detectEvictedFragments(t,e,n,r,i){this.timeRanges&&(this.timeRanges[t]=e);const s=(null==r?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach((r=>{const A=this.fragments[r];if(!A)return;if(s>=A.body.sn)return;if(!A.buffered&&(!A.loaded||i))return void(A.body.type===n&&this.removeFragment(A.body));const a=A.range[t];a&&(0!==a.time.length?a.time.some((t=>{const n=!this.isTimeBuffered(t.startPTS,t.endPTS,e);return n&&this.removeFragment(A.body),n})):this.removeFragment(A.body))}))}detectPartialFragments(t){const e=this.timeRanges;if(!e||"initSegment"===t.frag.sn)return;const n=t.frag,r=Ne(n),i=this.fragments[r];if(!i||i.buffered&&n.gap)return;const s=!n.relurl;if(Object.keys(e).forEach((r=>{const A=n.elementaryStreams[r];if(!A)return;const a=e[r],o=s||!0===A.partial;i.range[r]=this.getBufferedTimes(n,t.part,o,a)})),i.loaded=null,Object.keys(i.range).length){i.buffered=!0;(i.body.endList=n.endList||i.body.endList)&&(this.endListFragments[i.body.type]=i),Me(i)||this.removeParts(n.sn-1,n.type)}else this.removeFragment(i.body)}removeParts(t,e){const n=this.activePartLists[e];n&&(this.activePartLists[e]=He(n,(e=>e.fragment.sn>=t)))}fragBuffered(t,e){const n=Ne(t);let r=this.fragments[n];!r&&e&&(r=this.fragments[n]={body:t,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},t.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,r.buffered=!0)}getBufferedTimes(t,e,n,r){const i={time:[],partial:n},s=t.start,A=t.end,a=t.minEndPTS||A,o=t.maxStartPTS||s;for(let t=0;t<r.length;t++){const e=r.start(t)-this.bufferPadding,n=r.end(t)+this.bufferPadding;if(o>=e&&a<=n){i.time.push({startPTS:Math.max(s,r.start(t)),endPTS:Math.min(A,r.end(t))});break}if(s<n&&A>e){const e=Math.max(s,r.start(t)),n=Math.min(A,r.end(t));n>e&&(i.partial=!0,i.time.push({startPTS:e,endPTS:n}))}else if(A<=e)break}return i}getPartialFragment(t){let e,n,r,i=null,s=0;const{bufferPadding:A,fragments:a}=this;return Object.keys(a).forEach((o=>{const l=a[o];l&&Me(l)&&(n=l.body.start-A,r=l.body.end+A,t>=n&&t<=r&&(e=Math.min(t-n,r-t),s<=e&&(i=l.body,s=e)))})),i}isEndListAppended(t){const e=this.endListFragments[t];return void 0!==e&&(e.buffered||Me(e))}getState(t){const e=Ne(t),n=this.fragments[e];return n?n.buffered?Me(n)?Qe:Oe:Re:Le}isTimeBuffered(t,e,n){let r,i;for(let s=0;s<n.length;s++){if(r=n.start(s)-this.bufferPadding,i=n.end(s)+this.bufferPadding,t>=r&&e<=i)return!0;if(e<=r)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(t,e){if("initSegment"===e.frag.sn||e.frag.bitrateTest)return;const n=e.frag,r=e.part?null:e,i=Ne(n);this.fragments[i]={body:n,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(t,e){const{frag:n,part:r,timeRanges:i,type:s}=e;if("initSegment"===n.sn)return;const A=n.type;if(r){let t=this.activePartLists[A];t||(this.activePartLists[A]=t=[]),t.push(r)}this.timeRanges=i;const a=i[s];this.detectEvictedFragments(s,a,A,r)}onFragBuffered(t,e){this.detectPartialFragments(e)}hasFragment(t){const e=Ne(t);return!!this.fragments[e]}hasFragments(t){const{fragments:e}=this,n=Object.keys(e);if(!t)return n.length>0;for(let r=n.length;r--;){const i=e[n[r]];if((null==i?void 0:i.body.type)===t)return!0}return!1}hasParts(t){var e;return!(null==(e=this.activePartLists[t])||!e.length)}removeFragmentsInRange(t,e,n,r,i){r&&!this.hasGaps||Object.keys(this.fragments).forEach((s=>{const A=this.fragments[s];if(!A)return;const a=A.body;a.type!==n||r&&!a.gap||a.start<e&&a.end>t&&(A.buffered||i)&&this.removeFragment(a)}))}removeFragment(t){const e=Ne(t);t.clearElementaryStreamInfo();const n=this.activePartLists[t.type];if(n){const e=t.sn;this.activePartLists[t.type]=He(n,(t=>t.fragment.sn!==e))}delete this.fragments[e],t.endList&&delete this.endListFragments[t.type]}removeAllFragments(){var t;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const e=null==(t=this.hls)||null==(t=t.latestLevelDetails)?void 0:t.partList;e&&e.forEach((t=>t.clearElementaryStreamInfo()))}}function Me(t){var e,n,r;return t.buffered&&!!(t.body.gap||null!=(e=t.range.video)&&e.partial||null!=(n=t.range.audio)&&n.partial||null!=(r=t.range.audiovideo)&&r.partial)}function Ne(t){return`${t.type}_${t.level}_${t.sn}`}function He(t,e){return t.filter((t=>{const n=e(t);return n||t.clearElementaryStreamInfo(),n}))}var Ke=0,$e=1;class Ge{constructor(t,e,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=t,this.aesIV=e,this.aesMode=n}decrypt(t,e){switch(this.aesMode){case Ke:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,t);case $e:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},e,t);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}class Ve{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_(t){const e=new DataView(t),n=new Uint32Array(4);for(let t=0;t<4;t++)n[t]=e.getUint32(4*t);return n}initTable(){const t=this.sBox,e=this.invSBox,n=this.subMix,r=n[0],i=n[1],s=n[2],A=n[3],a=this.invSubMix,o=a[0],l=a[1],u=a[2],c=a[3],h=new Uint32Array(256);let d=0,f=0,p=0;for(p=0;p<256;p++)h[p]=p<128?p<<1:p<<1^283;for(p=0;p<256;p++){let n=f^f<<1^f<<2^f<<3^f<<4;n=n>>>8^255&n^99,t[d]=n,e[n]=d;const a=h[d],p=h[a],g=h[p];let m=257*h[n]^16843008*n;r[d]=m<<24|m>>>8,i[d]=m<<16|m>>>16,s[d]=m<<8|m>>>24,A[d]=m,m=16843009*g^65537*p^257*a^16843008*d,o[n]=m<<24|m>>>8,l[n]=m<<16|m>>>16,u[n]=m<<8|m>>>24,c[n]=m,d?(d=a^h[h[h[g^a]]],f^=h[h[f]]):d=f=1}}expandKey(t){const e=this.uint8ArrayToUint32Array_(t);let n=!0,r=0;for(;r<e.length&&n;)n=e[r]===this.key[r],r++;if(n)return;this.key=e;const i=this.keySize=e.length;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size="+i);const s=this.ksRows=4*(i+6+1);let A,a;const o=this.keySchedule=new Uint32Array(s),l=this.invKeySchedule=new Uint32Array(s),u=this.sBox,c=this.rcon,h=this.invSubMix,d=h[0],f=h[1],p=h[2],g=h[3];let m,_;for(A=0;A<s;A++)A<i?m=o[A]=e[A]:(_=m,A%i==0?(_=_<<8|_>>>24,_=u[_>>>24]<<24|u[_>>>16&255]<<16|u[_>>>8&255]<<8|u[255&_],_^=c[A/i|0]<<24):i>6&&A%i==4&&(_=u[_>>>24]<<24|u[_>>>16&255]<<16|u[_>>>8&255]<<8|u[255&_]),o[A]=m=(o[A-i]^_)>>>0);for(a=0;a<s;a++)A=s-a,_=3&a?o[A]:o[A-4],l[a]=a<4||A<=4?_:d[u[_>>>24]]^f[u[_>>>16&255]]^p[u[_>>>8&255]]^g[u[255&_]],l[a]=l[a]>>>0}networkToHostOrderSwap(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24}decrypt(t,e,n){const r=this.keySize+6,i=this.invKeySchedule,s=this.invSBox,A=this.invSubMix,a=A[0],o=A[1],l=A[2],u=A[3],c=this.uint8ArrayToUint32Array_(n);let h=c[0],d=c[1],f=c[2],p=c[3];const g=new Int32Array(t),m=new Int32Array(g.length);let _,w,y,v,B,b,E,C,k,F,T,S,x,I;const D=this.networkToHostOrderSwap;for(;e<g.length;){for(k=D(g[e]),F=D(g[e+1]),T=D(g[e+2]),S=D(g[e+3]),B=k^i[0],b=S^i[1],E=T^i[2],C=F^i[3],x=4,I=1;I<r;I++)_=a[B>>>24]^o[b>>16&255]^l[E>>8&255]^u[255&C]^i[x],w=a[b>>>24]^o[E>>16&255]^l[C>>8&255]^u[255&B]^i[x+1],y=a[E>>>24]^o[C>>16&255]^l[B>>8&255]^u[255&b]^i[x+2],v=a[C>>>24]^o[B>>16&255]^l[b>>8&255]^u[255&E]^i[x+3],B=_,b=w,E=y,C=v,x+=4;_=s[B>>>24]<<24^s[b>>16&255]<<16^s[E>>8&255]<<8^s[255&C]^i[x],w=s[b>>>24]<<24^s[E>>16&255]<<16^s[C>>8&255]<<8^s[255&B]^i[x+1],y=s[E>>>24]<<24^s[C>>16&255]<<16^s[B>>8&255]<<8^s[255&b]^i[x+2],v=s[C>>>24]<<24^s[B>>16&255]<<16^s[b>>8&255]<<8^s[255&E]^i[x+3],m[e]=D(_^h),m[e+1]=D(v^d),m[e+2]=D(y^f),m[e+3]=D(w^p),h=k,d=F,f=T,p=S,e+=4}return m.buffer}}class je{constructor(t,e,n){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=t,this.key=e,this.aesMode=n}expandKey(){const t=function(t){switch(t){case Ke:return"AES-CBC";case $e:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${t}`)}}(this.aesMode);return this.subtle.importKey("raw",this.key,{name:t},!1,["encrypt","decrypt"])}}class Ze{constructor(t,{removePKCS7Padding:e=!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=t.enableSoftwareAES,this.removePKCS7Padding=e,e)try{const t=self.crypto;t&&(this.subtle=t.subtle||t.webkitSubtle)}catch(t){}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:t,remainderData:e}=this;if(!t||e)return this.reset(),null;const n=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?function(t){const e=t.byteLength,n=e&&new DataView(t.buffer).getUint8(e-1);return n?t.slice(0,e-n):t}(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(t,e,n,r){return this.useSoftware?new Promise(((i,s)=>{const A=ArrayBuffer.isView(t)?t:new Uint8Array(t);this.softwareDecrypt(A,e,n,r);const a=this.flush();a?i(a.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))})):this.webCryptoDecrypt(new Uint8Array(t),e,n,r)}softwareDecrypt(t,e,n,r){const{currentIV:i,currentResult:s,remainderData:A}=this;if(r!==Ke||16!==e.byteLength)return T.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),A&&(t=gt(A,t),this.remainderData=null);const a=this.getValidChunk(t);if(!a.length)return null;i&&(n=i);let o=this.softwareDecrypter;o||(o=this.softwareDecrypter=new Ve),o.expandKey(e);const l=s;return this.currentResult=o.decrypt(a.buffer,0,n),this.currentIV=a.slice(-16).buffer,l||null}webCryptoDecrypt(t,e,n,r){if(this.key!==e||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(t,e,n,r));this.key=e,this.fastAesKey=new je(this.subtle,e,r)}return this.fastAesKey.expandKey().then((e=>{if(!this.subtle)return Promise.reject(new Error("web crypto not initialized"));this.logOnce("WebCrypto AES decrypt");return new Ge(this.subtle,new Uint8Array(n),r).decrypt(t.buffer,e)})).catch((i=>(T.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(t,e,n,r))))}onWebCryptoError(t,e,n,r){const i=this.enableSoftwareAES;if(i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(t,e,n,r);const i=this.flush();if(i)return i.buffer}throw new Error("WebCrypto"+(i?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(t){let e=t;const n=t.length-t.length%16;return n!==t.length&&(e=t.slice(0,n),this.remainderData=t.slice(n)),e}logOnce(t){this.logEnabled&&(T.log(`[decrypter]: ${t}`),this.logEnabled=!1)}}const We=Math.pow(2,17);class ze{constructor(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(t,e){const n=t.url;if(!n)return Promise.reject(new qe({type:A.NETWORK_ERROR,details:a.FRAG_LOAD_ERROR,fatal:!1,frag:t,error:new Error("Fragment does not have a "+(n?"part list":"url")),networkDetails:null}));this.abort();const r=this.config,i=r.fLoader,s=r.loader;return new Promise(((o,l)=>{if(this.loader&&this.loader.destroy(),t.gap){if(t.tagList.some((t=>"GAP"===t[0])))return void l(Xe(t));t.gap=!1}const u=this.loader=i?new i(r):new s(r),c=Ye(t);t.loader=u;const h=Be(r.fragLoadPolicy.default),d={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===t.sn?1/0:We};t.stats=u.stats;const f={onSuccess:(e,n,r,i)=>{this.resetLoader(t,u);let s=e.data;r.resetIV&&t.decryptdata&&(t.decryptdata.iv=new Uint8Array(s.slice(0,16)),s=s.slice(16)),o({frag:t,part:null,payload:s,networkDetails:i})},onError:(e,r,i,s)=>{this.resetLoader(t,u),l(new qe({type:A.NETWORK_ERROR,details:a.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:v({url:n,data:void 0},e),error:new Error(`HTTP Error ${e.code} ${e.text}`),networkDetails:i,stats:s}))},onAbort:(e,n,r)=>{this.resetLoader(t,u),l(new qe({type:A.NETWORK_ERROR,details:a.INTERNAL_ABORTED,fatal:!1,frag:t,error:new Error("Aborted"),networkDetails:r,stats:e}))},onTimeout:(e,n,r)=>{this.resetLoader(t,u),l(new qe({type:A.NETWORK_ERROR,details:a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:r,stats:e}))}};e&&(f.onProgress=(n,r,i,s)=>e({frag:t,part:null,payload:i,networkDetails:s})),u.load(c,d,f)}))}loadPart(t,e,n){this.abort();const r=this.config,i=r.fLoader,s=r.loader;return new Promise(((o,l)=>{if(this.loader&&this.loader.destroy(),t.gap||e.gap)return void l(Xe(t,e));const u=this.loader=i?new i(r):new s(r),c=Ye(t,e);t.loader=u;const h=Be(r.fragLoadPolicy.default),d={loadPolicy:h,timeout:h.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:We};e.stats=u.stats,u.load(c,d,{onSuccess:(r,i,s,A)=>{this.resetLoader(t,u),this.updateStatsFromPart(t,e);const a={frag:t,part:e,payload:r.data,networkDetails:A};n(a),o(a)},onError:(n,r,i,s)=>{this.resetLoader(t,u),l(new qe({type:A.NETWORK_ERROR,details:a.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:v({url:c.url,data:void 0},n),error:new Error(`HTTP Error ${n.code} ${n.text}`),networkDetails:i,stats:s}))},onAbort:(n,r,i)=>{t.stats.aborted=e.stats.aborted,this.resetLoader(t,u),l(new qe({type:A.NETWORK_ERROR,details:a.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,error:new Error("Aborted"),networkDetails:i,stats:n}))},onTimeout:(n,r,i)=>{this.resetLoader(t,u),l(new qe({type:A.NETWORK_ERROR,details:a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:i,stats:n}))}})}))}updateStatsFromPart(t,e){const n=t.stats,r=e.stats,i=r.total;if(n.loaded+=r.loaded,i){const r=Math.round(t.duration/e.duration),s=Math.min(Math.round(n.loaded/i),r),A=(r-s)*Math.round(n.loaded/s);n.total=n.loaded+A}else n.total=Math.max(n.loaded,n.total);const s=n.loading,A=r.loading;s.start?s.first+=A.first-A.start:(s.start=A.start,s.first=A.first),s.end=A.end}resetLoader(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()}}function Ye(t,e=null){const n=e||t,i={frag:t,part:e,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},s=n.byteRangeStartOffset,A=n.byteRangeEndOffset;if(r(s)&&r(A)){var a;let e=s,n=A;if("initSegment"===t.sn&&("AES-128"===(o=null==(a=t.decryptdata)?void 0:a.method)||"AES-256"===o)){const t=A-s;t%16&&(n=A+(16-t%16)),0!==s&&(i.resetIV=!0,e=s-16)}i.rangeStart=e,i.rangeEnd=n}var o;return i}function Xe(t,e){const n=new Error(`GAP ${t.gap?"tag":"attribute"} found`),r={type:A.MEDIA_ERROR,details:a.FRAG_GAP,fatal:!1,frag:t,error:n,networkDetails:null};return e&&(r.part=e),(e||t).stats.aborted=!0,new qe(r)}class qe extends Error{constructor(t){super(t.error.message),this.data=void 0,this.data=t}}class Je extends B{constructor(t,e){super(t,e),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(t){return!this._tickInterval&&(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,t),!0)}clearInterval(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)}clearNextTick(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)}tick(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class tn{constructor(t,e,n,r=0,i=-1,s=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=t,this.sn=e,this.id=n,this.size=r,this.part=i,this.partial=s}}const en={length:0,start:()=>0,end:()=>0};class nn{static isBuffered(t,e){if(t){const n=nn.getBuffered(t);for(let t=n.length;t--;)if(e>=n.start(t)&&e<=n.end(t))return!0}return!1}static bufferedRanges(t){if(t){const e=nn.getBuffered(t);return nn.timeRangesToArray(e)}return[]}static timeRangesToArray(t){const e=[];for(let n=0;n<t.length;n++)e.push({start:t.start(n),end:t.end(n)});return e}static bufferInfo(t,e,n){if(t){const r=nn.bufferedRanges(t);if(r.length)return nn.bufferedInfo(r,e,n)}return{len:0,start:e,end:e,bufferedIndex:-1}}static bufferedInfo(t,e,n){e=Math.max(0,e),t.length>1&&t.sort(((t,e)=>t.start-e.start||e.end-t.end));let r=-1,i=[];if(n)for(let s=0;s<t.length;s++){e>=t[s].start&&e<=t[s].end&&(r=s);const A=i.length;if(A){const e=i[A-1].end;t[s].start-e<n?t[s].end>e&&(i[A-1].end=t[s].end):i.push(t[s])}else i.push(t[s])}else i=t;let s,A=0,a=e,o=e;for(let t=0;t<i.length;t++){const l=i[t].start,u=i[t].end;if(-1===r&&e>=l&&e<=u&&(r=t),e+n>=l&&e<u)a=l,o=u,A=o-e;else if(e+n<l){s=l;break}}return{len:A,start:a||0,end:o||0,nextStart:s,buffered:t,bufferedIndex:r}}static getBuffered(t){try{return t.buffered||en}catch(t){return T.log("failed to get media.buffered",t),en}}}const rn=/\{\$([a-zA-Z0-9-_]+)\}/g;function sn(t){return rn.test(t)}function An(t,e){if(null!==t.variableList||t.hasVariableRefs){const n=t.variableList;return e.replace(rn,(e=>{const r=e.substring(2,e.length-1),i=null==n?void 0:n[r];return void 0===i?(t.playlistParsingError||(t.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`)),e):i}))}return e}function an(t,e,n){let r,i,s=t.variableList;if(s||(t.variableList=s={}),"QUERYPARAM"in e){r=e.QUERYPARAM;try{const t=new self.URL(n).searchParams;if(!t.has(r))throw new Error(`"${r}" does not match any query parameter in URI: "${n}"`);i=t.get(r)}catch(e){t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${e.message}`))}}else r=e.NAME,i=e.VALUE;r in s?t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${r}"`)):s[r]=i||""}function on(t,e,n){const r=e.IMPORT;if(n&&r in n){let e=t.variableList;e||(t.variableList=e={}),e[r]=n[r]}else t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${r}"`))}const ln=/^(\d+)x(\d+)$/,un=/(.+?)=(".*?"|.*?)(?:,|$)/g;class cn{constructor(t,e){"string"==typeof t&&(t=cn.parseAttrList(t,e)),w(this,t)}get clientAttrs(){return Object.keys(this).filter((t=>"X-"===t.substring(0,2)))}decimalInteger(t){const e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e}hexadecimalInteger(t){if(this[t]){let e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;const n=new Uint8Array(e.length/2);for(let t=0;t<e.length/2;t++)n[t]=parseInt(e.slice(2*t,2*t+2),16);return n}return null}hexadecimalIntegerAsNumber(t){const e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e}decimalFloatingPoint(t){return parseFloat(this[t])}optionalFloat(t,e){const n=this[t];return n?parseFloat(n):e}enumeratedString(t){return this[t]}enumeratedStringList(t,e){const n=this[t];return(n?n.split(/[ ,]+/):[]).reduce(((t,e)=>(t[e.toLowerCase()]=!0,t)),e)}bool(t){return"YES"===this[t]}decimalResolution(t){const e=ln.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}}static parseAttrList(t,e){let n;const r={};for(un.lastIndex=0;null!==(n=un.exec(t));){const i=n[1].trim();let s=n[2];const A=0===s.indexOf('"')&&s.lastIndexOf('"')===s.length-1;let a=!1;if(A)s=s.slice(1,-1);else switch(i){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":a=!0}if(e&&(A||a))s=An(e,s);else if(!a&&!A)switch(i){case"CLOSED-CAPTIONS":if("NONE"===s)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":T.warn(`${t}: attribute ${i} is missing quotes`)}r[i]=s}return r}}function hn(t){return"SCTE35-OUT"===t||"SCTE35-IN"===t||"SCTE35-CMD"===t}class dn{constructor(t,e,n=0){var i;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(null==e?void 0:e.tagAnchor)||null,this.tagOrder=null!=(i=null==e?void 0:e.tagOrder)?i:n,e){const n=e.attr;for(const e in n)if(Object.prototype.hasOwnProperty.call(t,e)&&t[e]!==n[e]){T.warn(`DATERANGE tag attribute: "${e}" does not match for tags with ID: "${t.ID}"`),this._badValueForSameId=e;break}t=w(new cn({}),n,t)}if(this.attr=t,e?(this._startDate=e._startDate,this._cue=e._cue,this._endDate=e._endDate,this._dateAtEnd=e._dateAtEnd):this._startDate=new Date(t["START-DATE"]),"END-DATE"in this.attr){const t=(null==e?void 0:e.endDate)||new Date(this.attr["END-DATE"]);r(t.getTime())&&(this._endDate=t)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const t=this._cue;return void 0===t?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):t}get startTime(){const{tagAnchor:t}=this;return null===t||null===t.programDateTime?(T.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${t}`),NaN):t.start+(this.startDate.getTime()-t.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const t=this._endDate||this._dateAtEnd;if(t)return t;const e=this.duration;return null!==e?this._dateAtEnd=new Date(this._startDate.getTime()+1e3*e):null}get duration(){if("DURATION"in this.attr){const t=this.attr.decimalFloatingPoint("DURATION");if(r(t))return t}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"com.apple.hls.interstitial"===this.class}get isValid(){return!!this.id&&!this._badValueForSameId&&r(this.startDate.getTime())&&(null===this.duration||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)}}class fn{constructor(t){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=t}reloaded(t){if(!t)return this.advanced=!0,void(this.updated=!0);const e=this.lastPartSn-t.lastPartSn,n=this.lastPartIndex-t.lastPartIndex;this.updated=this.endSN!==t.endSN||!!n||!!e||!this.live,this.advanced=this.endSN>t.endSN||e>0||0===e&&n>0,this.updated||this.advanced?this.misses=Math.floor(.6*t.misses):this.misses=t.misses+1}hasKey(t){return this.encryptedFragments.some((e=>{let n=e.decryptdata;return n||(e.setKeyFormat(t.keyFormat),n=e.decryptdata),!!n&&t.matches(n)}))}get hasProgramDateTime(){return!!this.fragments.length&&r(this.fragments[this.fragments.length-1].programDateTime)}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||10}get drift(){const t=this.driftEndTime-this.driftStartTime;if(t>0){return 1e3*(this.driftEnd-this.driftStart)/t}return 1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var t;return null!=(t=this.partList)&&t.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 t;return null!=(t=this.partList)&&t.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const t=this.partList;if(t){const e=this.lastPartIndex;if(-1!==e){for(let n=t.length;n--;)if(t[n].index>e)return t[n].index;return e}}return 0}get lastPartSn(){var t;return null!=(t=this.partList)&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const t=this.partEnd-this.fragmentStart;return this.age>Math.max(t,this.totalduration)+this.levelTargetDuration}return!1}}function pn(t,e){return t.length===e.length&&!t.some(((t,n)=>t!==e[n]))}function gn(t,e){return!t&&!e||!(!t||!e)&&pn(t,e)}function mn(t){return"AES-128"===t||"AES-256"===t||"AES-256-CTR"===t}function _n(t){switch(t){case"AES-128":case"AES-256":return Ke;case"AES-256-CTR":return $e;default:throw new Error(`invalid full segment method ${t}`)}}function wn(t){return Uint8Array.from(atob(t),(t=>t.charCodeAt(0)))}function yn(t){return Uint8Array.from(unescape(encodeURIComponent(t)),(t=>t.charCodeAt(0)))}function vn(t){const e=function(t,e,n){const r=t[e];t[e]=t[n],t[n]=r};e(t,0,3),e(t,1,2),e(t,4,5),e(t,6,7)}function Bn(t){const e=t.split(":");let n=null;if("data"===e[0]&&2===e.length){const t=e[1].split(";"),r=t[t.length-1].split(",");if(2===r.length){const e="base64"===r[0],i=r[1];e?(t.splice(-1,1),n=wn(i)):n=function(t){const e=yn(t).subarray(0,16),n=new Uint8Array(16);return n.set(e,16-e.length),n}(i)}}return n}const bn="undefined"!=typeof self?self:void 0;var En={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Cn="org.w3.clearkey",kn="com.apple.streamingkeydelivery",Fn="com.microsoft.playready",Tn="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function Sn(t){switch(t){case kn:return En.FAIRPLAY;case Fn:return En.PLAYREADY;case Tn:return En.WIDEVINE;case Cn:return En.CLEARKEY}}function xn(t){switch(t){case En.FAIRPLAY:return kn;case En.PLAYREADY:return Fn;case En.WIDEVINE:return Tn;case En.CLEARKEY:return Cn}}function In(t){const{drmSystems:e,widevineLicenseUrl:n}=t,r=e?[En.FAIRPLAY,En.WIDEVINE,En.PLAYREADY,En.CLEARKEY].filter((t=>!!e[t])):[];return!r[En.WIDEVINE]&&n&&r.push(En.WIDEVINE),r}const Dn=null!=bn&&null!=(Un=bn.navigator)&&Un.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;var Un;function Ln(t){const e=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),n=String.fromCharCode.apply(null,Array.from(e)),r=n.substring(n.indexOf("<"),n.length),i=(new DOMParser).parseFromString(r,"text/xml").getElementsByTagName("KID")[0];if(i){const t=i.childNodes[0]?i.childNodes[0].nodeValue:i.getAttribute("VALUE");if(t){const e=wn(t).subarray(0,16);return vn(e),e}}return null}let Rn={};class Qn{static clearKeyUriToKeyIdMap(){Rn={}}static setKeyIdForUri(t,e){Rn[t]=e}constructor(t,e,n,r=[1],i=null,s){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=t,this.uri=e,this.keyFormat=n,this.keyFormatVersions=r,this.iv=i,this.encrypted=!!t&&"NONE"!==t,this.isCommonEncryption=this.encrypted&&!mn(t),null!=s&&s.startsWith("0x")&&(this.keyId=new Uint8Array(U(s)))}matches(t){return t.uri===this.uri&&t.method===this.method&&t.encrypted===this.encrypted&&t.keyFormat===this.keyFormat&&pn(t.keyFormatVersions,this.keyFormatVersions)&&gn(t.iv,this.iv)&&gn(t.keyId,this.keyId)}isSupported(){if(this.method){if(mn(this.method)||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case kn:case Tn:case Fn:case Cn:return-1!==["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1}getDecryptData(t,e){if(!this.encrypted||!this.uri)return null;if(mn(this.method)){let e=this.iv;e||("number"!=typeof t&&(T.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),t=0),e=function(t){const e=new Uint8Array(16);for(let n=12;n<16;n++)e[n]=t>>8*(15-n)&255;return e}(t));return new Qn(this.method,this.uri,"identity",this.keyFormatVersions,e)}if(this.keyId){const t=Rn[this.uri];if(t&&!pn(this.keyId,t)&&Qn.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const n=Bn(this.uri);if(n)switch(this.keyFormat){case Tn:if(this.pssh=n,!this.keyId){const t=function(t){const e=[];if(t instanceof ArrayBuffer){const n=t.byteLength;let r=0;for(;r+32<n;){const n=bt(new DataView(t,r));e.push(n),r+=n.size}}return e}(n.buffer);if(t.length){var r;const e=t[0];this.keyId=null!=(r=e.kids)&&r.length?e.kids[0]:null}}this.keyId||(this.keyId=On(e));break;case Fn:{const t=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Bt(t,0,n),this.keyId=Ln(n);break}default:{let t=n.subarray(0,16);if(16!==t.length){const e=new Uint8Array(16);e.set(t,16-t.length),t=e}this.keyId=t;break}}if(!this.keyId||16!==this.keyId.byteLength){let t;t=function(t){const e=null==t?void 0:t[Tn];if(e)return e.keyId;return null}(e),t||(t=On(e),t||(t=Rn[this.uri])),t&&(this.keyId=t,Qn.setKeyIdForUri(this.uri,t))}return this}}function On(t){const e=null==t?void 0:t[Fn];if(e){const t=Bn(e.uri);if(t)return Ln(t)}return null}const Pn=/#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,Mn=/#EXT-X-MEDIA:(.*)/g,Nn=/^#EXT(?:INF|-X-TARGETDURATION):/m,Hn=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),Kn=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 $n{static findGroup(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(r.id===e)return r}}static resolve(t,e){return K.buildAbsoluteURL(e,t,{alwaysNormalize:!0})}static isMediaPlaylist(t){return Nn.test(t)}static parseMasterPlaylist(t,e){const n={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:sn(t)},r=[];if(Pn.lastIndex=0,!t.startsWith("#EXTM3U"))return n.playlistParsingError=new Error("no EXTM3U delimiter"),n;let i;for(;null!=(i=Pn.exec(t));)if(i[1]){var s;const t=new cn(i[1],n),A=An(n,i[2]),a={attrs:t,bitrate:t.decimalInteger("BANDWIDTH")||t.decimalInteger("AVERAGE-BANDWIDTH"),name:t.NAME,url:$n.resolve(A,e)},o=t.decimalResolution("RESOLUTION");o&&(a.width=o.width,a.height=o.height),Wn(t.CODECS,a);const l=t["SUPPLEMENTAL-CODECS"];l&&(a.supplemental={},Wn(l,a.supplemental)),null!=(s=a.unknownCodecs)&&s.length||r.push(a),n.levels.push(a)}else if(i[3]){const t=i[3],r=i[4];switch(t){case"SESSION-DATA":{const t=new cn(r,n),e=t["DATA-ID"];e&&(null===n.sessionData&&(n.sessionData={}),n.sessionData[e]=t);break}case"SESSION-KEY":{const t=jn(r,e,n);t.encrypted&&t.isSupported()?(null===n.sessionKeys&&(n.sessionKeys=[]),n.sessionKeys.push(t)):T.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${r}"`);break}case"DEFINE":an(n,new cn(r,n),e);break;case"CONTENT-STEERING":{const t=new cn(r,n);n.contentSteering={uri:$n.resolve(t["SERVER-URI"],e),pathwayId:t["PATHWAY-ID"]||"."};break}case"START":n.startTimeOffset=Zn(r)}}const A=r.length>0&&r.length<n.levels.length;return n.levels=A?r:n.levels,0===n.levels.length&&(n.playlistParsingError=new Error("no levels found in manifest")),n}static parseMasterPlaylistMedia(t,e,n){let r;const i={},s=n.levels,A={AUDIO:s.map((t=>({id:t.attrs.AUDIO,audioCodec:t.audioCodec}))),SUBTITLES:s.map((t=>({id:t.attrs.SUBTITLES,textCodec:t.textCodec}))),"CLOSED-CAPTIONS":[]};let a=0;for(Mn.lastIndex=0;null!==(r=Mn.exec(t));){const t=new cn(r[1],n),s=t.TYPE;if(s){const n=A[s],r=i[s]||[];i[s]=r;const o=t.LANGUAGE,l=t["ASSOC-LANGUAGE"],u=t.CHANNELS,c=t.CHARACTERISTICS,h=t["INSTREAM-ID"],d={attrs:t,bitrate:0,id:a++,groupId:t["GROUP-ID"]||"",name:t.NAME||o||"",type:s,default:t.bool("DEFAULT"),autoselect:t.bool("AUTOSELECT"),forced:t.bool("FORCED"),lang:o,url:t.URI?$n.resolve(t.URI,e):""};if(l&&(d.assocLang=l),u&&(d.channels=u),c&&(d.characteristics=c),h&&(d.instreamId=h),null!=n&&n.length){const t=$n.findGroup(n,d.groupId)||n[0];zn(d,t,"audioCodec"),zn(d,t,"textCodec")}r.push(d)}}return i}static parseLevelPlaylist(t,e,n,i,s,A){var a;const o={url:e},l=new fn(e),u=l.fragments,c=[];let h,d,f,p,g=null,m=0,_=0,y=0,v=0,B=0,b=null,E=new z(i,o),C=-1,k=!1,F=null;if(Hn.lastIndex=0,l.m3u8=t,l.hasVariableRefs=sn(t),"#EXTM3U"!==(null==(a=Hn.exec(t))?void 0:a[0]))return l.playlistParsingError=new Error("Missing format identifier #EXTM3U"),l;for(;null!==(h=Hn.exec(t));){k&&(k=!1,E=new z(i,o),E.playlistOffset=y,E.setStart(y),E.sn=m,E.cc=v,B&&(E.bitrate=B),E.level=n,g&&(E.initSegment=g,g.rawProgramDateTime&&(E.rawProgramDateTime=g.rawProgramDateTime,g.rawProgramDateTime=null),F&&(E.setByteRange(F),F=null)));const t=h[1];if(t){E.duration=parseFloat(t);const e=(" "+h[2]).slice(1);E.title=e||null,E.tagList.push(e?["INF",t,e]:["INF",t])}else if(h[3]){if(r(E.duration)){E.playlistOffset=y,E.setStart(y),f&&qn(E,f,l),E.sn=m,E.level=n,E.cc=v,u.push(E);const t=(" "+h[3]).slice(1);E.relurl=An(l,t),Yn(E,b,c),b=E,y+=E.duration,m++,_=0,k=!0}}else{if(h=h[0].match(Kn),!h){T.warn("No matches on slow regex match for level playlist!");continue}for(d=1;d<h.length&&void 0===h[d];d++);const t=(" "+h[d]).slice(1),s=(" "+h[d+1]).slice(1),a=h[d+2]?(" "+h[d+2]).slice(1):null;switch(t){case"BYTERANGE":b?E.setByteRange(s,b):E.setByteRange(s);break;case"PROGRAM-DATE-TIME":E.rawProgramDateTime=s,E.tagList.push(["PROGRAM-DATE-TIME",s]),-1===C&&(C=u.length);break;case"PLAYLIST-TYPE":l.type&&Jn(l,t,h),l.type=s.toUpperCase();break;case"MEDIA-SEQUENCE":0!==l.startSN?Jn(l,t,h):u.length>0&&tr(l,t,h),m=l.startSN=parseInt(s);break;case"SKIP":{l.skippedSegments&&Jn(l,t,h);const e=new cn(s,l),n=e.decimalInteger("SKIPPED-SEGMENTS");if(r(n)){l.skippedSegments+=n;for(let t=n;t--;)u.push(null);m+=n}const i=e.enumeratedString("RECENTLY-REMOVED-DATERANGES");i&&(l.recentlyRemovedDateranges=(l.recentlyRemovedDateranges||[]).concat(i.split("\t")));break}case"TARGETDURATION":0!==l.targetduration&&Jn(l,t,h),l.targetduration=Math.max(parseInt(s),1);break;case"VERSION":null!==l.version&&Jn(l,t,h),l.version=parseInt(s);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":l.live||Jn(l,t,h),l.live=!1;break;case"#":(s||a)&&E.tagList.push(a?[s,a]:[s]);break;case"DISCONTINUITY":v++,E.tagList.push(["DIS"]);break;case"GAP":E.gap=!0,E.tagList.push([t]);break;case"BITRATE":E.tagList.push([t,s]),B=1e3*parseInt(s),r(B)?E.bitrate=B:B=0;break;case"DATERANGE":{const t=new cn(s,l),e=new dn(t,l.dateRanges[t.ID],l.dateRangeTagCount);l.dateRangeTagCount++,e.isValid||l.skippedSegments?l.dateRanges[e.id]=e:T.warn(`Ignoring invalid DATERANGE tag: "${s}"`),E.tagList.push(["EXT-X-DATERANGE",s]);break}case"DEFINE":{const t=new cn(s,l);"IMPORT"in t?on(l,t,A):an(l,t,e)}break;case"DISCONTINUITY-SEQUENCE":0!==l.startCC?Jn(l,t,h):u.length>0&&tr(l,t,h),l.startCC=v=parseInt(s);break;case"KEY":{const t=jn(s,e,l);if(t.isSupported()){if("NONE"===t.method){f=void 0;break}f||(f={});const e=f[t.keyFormat];null!=e&&e.matches(t)||(e&&(f=w({},f)),f[t.keyFormat]=t)}else T.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${s}"`);break}case"START":l.startTimeOffset=Zn(s);break;case"MAP":{const t=new cn(s,l);if(E.duration){const e=new z(i,o);Xn(e,t,n,f),g=e,E.initSegment=g,g.rawProgramDateTime&&!E.rawProgramDateTime&&(E.rawProgramDateTime=g.rawProgramDateTime)}else{const e=E.byteRangeEndOffset;if(e){const t=E.byteRangeStartOffset;F=`${e-t}@${t}`}else F=null;Xn(E,t,n,f),g=E,k=!0}g.cc=v;break}case"SERVER-CONTROL":p&&Jn(l,t,h),p=new cn(s),l.canBlockReload=p.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=p.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&p.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=p.optionalFloat("PART-HOLD-BACK",0),l.holdBack=p.optionalFloat("HOLD-BACK",0);break;case"PART-INF":{l.partTarget&&Jn(l,t,h);const e=new cn(s);l.partTarget=e.decimalFloatingPoint("PART-TARGET");break}case"PART":{let t=l.partList;t||(t=l.partList=[]);const e=_>0?t[t.length-1]:void 0,n=_++,r=new cn(s,l),i=new Y(r,E,o,n,e);t.push(i),E.duration+=i.duration;break}case"PRELOAD-HINT":{const t=new cn(s,l);l.preloadHint=t;break}case"RENDITION-REPORT":{const t=new cn(s,l);l.renditionReports=l.renditionReports||[],l.renditionReports.push(t);break}default:T.warn(`line parsed but not handled: ${h}`)}}}b&&!b.relurl?(u.pop(),y-=b.duration,l.partList&&(l.fragmentHint=b)):l.partList&&(Yn(E,b,c),E.cc=v,l.fragmentHint=E,f&&qn(E,f,l)),l.targetduration||(l.playlistParsingError=new Error("Missing Target Duration"));const S=u.length,x=u[0],I=u[S-1];if(y+=l.skippedSegments*l.targetduration,y>0&&S&&I){l.averagetargetduration=y/S;const t=I.sn;l.endSN="initSegment"!==t?t:0,l.live||(I.endList=!0),C>0&&(!function(t,e){let n=t[e];for(let r=e;r--;){const e=t[r];if(!e)return;e.programDateTime=n.programDateTime-1e3*e.duration,n=e}}(u,C),x&&c.unshift(x))}return l.fragmentHint&&(y+=l.fragmentHint.duration),l.totalduration=y,c.length&&l.dateRangeTagCount&&x&&Gn(c,l),l.endCC=v,l}}function Gn(t,e){let n=t.length;if(!n){if(!e.hasProgramDateTime)return;{const r=e.fragments[e.fragments.length-1];t.push(r),n++}}const r=t[n-1],i=e.live?1/0:e.totalduration,s=Object.keys(e.dateRanges);for(let a=s.length;a--;){const o=e.dateRanges[s[a]],l=o.startDate.getTime();o.tagAnchor=r.ref;for(let r=n;r--;){var A;if((null==(A=t[r])?void 0:A.sn)<e.startSN)break;const n=Vn(e,l,t,r,i);if(-1!==n){o.tagAnchor=e.fragments[n].ref;break}}}}function Vn(t,e,n,r,i){const s=n[r];if(s){const a=s.programDateTime;if(e>=a||0===r){var A;if(e<=a+1e3*(((null==(A=n[r+1])?void 0:A.start)||i)-s.start)){const i=n[r].sn-t.startSN;if(i<0)return-1;const s=t.fragments;if(s.length>n.length){for(let A=(n[r+1]||s[s.length-1]).sn-t.startSN;A>i;A--){const t=s[A].programDateTime;if(e>=t&&e<t+1e3*s[A].duration)return A}}return i}}}return-1}function jn(t,e,n){var r,i;const s=new cn(t,n),A=null!=(r=s.METHOD)?r:"",a=s.URI,o=s.hexadecimalInteger("IV"),l=s.KEYFORMATVERSIONS,u=null!=(i=s.KEYFORMAT)?i:"identity";a&&s.IV&&!o&&T.error(`Invalid IV: ${s.IV}`);const c=a?$n.resolve(a,e):"",h=(l||"1").split("/").map(Number).filter(Number.isFinite);return new Qn(A,c,u,h,o,s.KEYID)}function Zn(t){const e=new cn(t).decimalFloatingPoint("TIME-OFFSET");return r(e)?e:null}function Wn(t,e){let n=(t||"").split(/[ ,]+/).filter((t=>t));["video","audio","text"].forEach((t=>{const r=n.filter((e=>kt(e,t)));r.length&&(e[`${t}Codec`]=r.map((t=>t.split("/")[0])).join(","),n=n.filter((t=>-1===r.indexOf(t))))})),e.unknownCodecs=n}function zn(t,e,n){const r=e[n];r&&(t[n]=r)}function Yn(t,e,n){t.rawProgramDateTime?n.push(t):null!=e&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime)}function Xn(t,e,n,r){t.relurl=e.URI,e.BYTERANGE&&t.setByteRange(e.BYTERANGE),t.level=n,t.sn="initSegment",r&&(t.levelkeys=r),t.initSegment=null}function qn(t,e,n){t.levelkeys=e;const{encryptedFragments:r}=n;r.length&&r[r.length-1].levelkeys===e||!Object.keys(e).some((t=>e[t].isCommonEncryption))||r.push(t)}function Jn(t,e,n){t.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${n[0]})`)}function tr(t,e,n){t.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${n[0]})`)}function er(t,e){const n=e.startPTS;if(r(n)){let r,i=0;e.sn>t.sn?(i=n-t.start,r=t):(i=t.start-n,r=e),r.duration!==i&&r.setDuration(i)}else if(e.sn>t.sn){t.cc===e.cc&&t.minEndPTS?e.setStart(t.start+(t.minEndPTS-t.start)):e.setStart(t.start+t.duration)}else e.setStart(Math.max(t.start-e.duration,0))}function nr(t,e,n,i,s,A,a){i-n<=0&&(a.warn("Fragment should have a positive duration",e),i=n+e.duration,A=s+e.duration);let o=n,l=i;const u=e.startPTS,c=e.endPTS;if(r(u)){const h=Math.abs(u-n);t&&h>t.totalduration?a.warn(`media timestamps and playlist times differ by ${h}s for level ${e.level} ${t.url}`):r(e.deltaPTS)?e.deltaPTS=Math.max(h,e.deltaPTS):e.deltaPTS=h,o=Math.max(n,u),n=Math.min(n,u),s=void 0!==e.startDTS?Math.min(s,e.startDTS):s,l=Math.min(i,c),i=Math.max(i,c),A=void 0!==e.endDTS?Math.max(A,e.endDTS):A}const h=n-e.start;0!==e.start&&e.setStart(n),e.setDuration(i-e.start),e.startPTS=n,e.maxStartPTS=o,e.startDTS=s,e.endPTS=i,e.minEndPTS=l,e.endDTS=A;const d=e.sn;if(!t||d<t.startSN||d>t.endSN)return 0;let f;const p=d-t.startSN,g=t.fragments;for(g[p]=e,f=p;f>0;f--)er(g[f],g[f-1]);for(f=p;f<g.length-1;f++)er(g[f],g[f+1]);return t.fragmentHint&&er(g[g.length-1],t.fragmentHint),t.PTSKnown=t.alignedSliding=!0,h}function rr(t,e,n){if(t===e)return;let i=null;const s=t.fragments;for(let t=s.length-1;t>=0;t--){const e=s[t].initSegment;if(e){i=e;break}}let A;t.fragmentHint&&delete t.fragmentHint.endPTS,function(t,e,n){const r=e.skippedSegments,i=Math.max(t.startSN,e.startSN)-e.startSN,s=(t.fragmentHint?1:0)+(r?e.endSN:Math.min(t.endSN,e.endSN))-e.startSN,A=e.startSN-t.startSN,a=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;for(let l=i;l<=s;l++){const i=o[A+l];let s=a[l];if(r&&!s&&i&&(s=e.fragments[l]=i),i&&s){n(i,s,l,a);const r=i.relurl,A=s.relurl;if(r&&hr(r,A))return void(e.playlistParsingError=ir(`media sequence mismatch ${s.sn}:`,t,e,i,s));if(i.cc!==s.cc)return void(e.playlistParsingError=ir(`discontinuity sequence mismatch (${i.cc}!=${s.cc})`,t,e,i,s))}}}(t,e,((t,n,s,a)=>{if((!e.startCC||e.skippedSegments)&&n.cc!==t.cc){const r=t.cc-n.cc;for(let t=s;t<a.length;t++)a[t].cc+=r;e.endCC=a[a.length-1].cc}r(t.startPTS)&&r(t.endPTS)&&(n.setStart(n.startPTS=t.startPTS),n.startDTS=t.startDTS,n.maxStartPTS=t.maxStartPTS,n.endPTS=t.endPTS,n.endDTS=t.endDTS,n.minEndPTS=t.minEndPTS,n.setDuration(t.endPTS-t.startPTS),n.duration&&(A=n),e.PTSKnown=e.alignedSliding=!0),t.hasStreams&&(n.elementaryStreams=t.elementaryStreams),n.loader=t.loader,t.hasStats&&(n.stats=t.stats),t.initSegment&&(n.initSegment=t.initSegment,i=t.initSegment)}));const a=e.fragments,o=e.fragmentHint?a.concat(e.fragmentHint):a;if(i&&o.forEach((t=>{var e;!t||t.initSegment&&t.initSegment.relurl!==(null==(e=i)?void 0:e.relurl)||(t.initSegment=i)})),e.skippedSegments){if(e.deltaUpdateFailed=a.some((t=>!t)),e.deltaUpdateFailed){n.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let t=e.skippedSegments;t--;)a.shift();e.startSN=a[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=function(t,e,n){const{dateRanges:r,recentlyRemovedDateranges:i}=e,s=w({},t);i&&i.forEach((t=>{delete s[t]}));const A=Object.keys(s).length;if(!A)return r;return Object.keys(r).forEach((t=>{const e=s[t],i=new dn(r[t].attr,e);i.isValid?(s[t]=i,e||(i.tagOrder+=A)):n.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${re(r[t].attr)}"`)})),s}(t.dateRanges,e,n));const r=t.fragments.filter((t=>t.rawProgramDateTime));if(t.hasProgramDateTime&&!e.hasProgramDateTime)for(let t=1;t<o.length;t++)null===o[t].programDateTime&&Yn(o[t],o[t-1],r);Gn(r,e)}e.endCC=a[a.length-1].cc}if(!e.startCC){var l;const n=or(t,e.startSN-1);e.startCC=null!=(l=null==n?void 0:n.cc)?l:a[0].cc}!function(t,e,n){if(t&&e){let r=0;for(let i=0,s=t.length;i<=s;i++){const s=t[i],A=e[i+r];s&&A&&s.index===A.index&&s.fragment.sn===A.fragment.sn?n(s,A):r--}}}(t.partList,e.partList,((t,e)=>{e.elementaryStreams=t.elementaryStreams,e.stats=t.stats})),A?nr(e,A,A.startPTS,A.endPTS,A.startDTS,A.endDTS,n):sr(t,e),a.length&&(e.totalduration=e.edge-a[0].start),e.driftStartTime=t.driftStartTime,e.driftStart=t.driftStart;const u=e.advancedDateTime;if(e.advanced&&u){const t=e.edge;e.driftStart||(e.driftStartTime=u,e.driftStart=t),e.driftEndTime=u,e.driftEnd=t}else e.driftEndTime=t.driftEndTime,e.driftEnd=t.driftEnd,e.advancedDateTime=t.advancedDateTime;-1===e.requestScheduled&&(e.requestScheduled=t.requestScheduled)}function ir(t,e,n,r,i){return new Error(`${t} ${i.url}\nPlaylist starting @${e.startSN}\n${e.m3u8}\n\nPlaylist starting @${n.startSN}\n${n.m3u8}`)}function sr(t,e,n=!0){const r=e.startSN+e.skippedSegments-t.startSN,i=t.fragments,s=r>=0;let A=0;if(s&&r<i.length)A=i[r].start;else if(s&&e.startSN===t.endSN+1)A=t.fragmentEnd;else if(s&&n)A=t.fragmentStart+r*e.levelTargetDuration;else{if(e.skippedSegments||0!==e.fragmentStart)return;A=t.fragmentStart}Ar(e,A)}function Ar(t,e){if(e){const n=t.fragments;for(let r=t.skippedSegments;r<n.length;r++)n[r].addStart(e);t.fragmentHint&&t.fragmentHint.addStart(e)}}function ar(t,e=1/0){let n=1e3*t.targetduration;if(t.updated){const r=t.fragments,i=4;if(r.length&&n*i>e){const t=1e3*r[r.length-1].duration;t<n&&(n=t)}}else n/=2;return Math.round(n)}function or(t,e,n){if(!t)return null;let r=t.fragments[e-t.startSN];return r||(r=t.fragmentHint,r&&r.sn===e?r:e<t.startSN&&n&&n.sn===e?n:null)}function lr(t,e,n){return t?ur(t.partList,e,n):null}function ur(t,e,n){if(t)for(let r=t.length;r--;){const i=t[r];if(i.index===n&&i.fragment.sn===e)return i}return null}function cr(t){t.forEach(((t,e)=>{var n;null==(n=t.details)||n.fragments.forEach((t=>{t.level=e,t.initSegment&&(t.initSegment.level=e)}))}))}function hr(t,e){return!(t===e||!e)&&dr(t)!==dr(e)}function dr(t){return t.replace(/\?[^?]*$/,"")}function fr(t,e){for(let r=0,i=t.length;r<i;r++){var n;if((null==(n=t[r])?void 0:n.cc)===e)return t[r]}return null}function pr(t,e){const n=t.start+e;t.startPTS=n,t.setStart(n),t.endPTS=n+t.duration}function gr(t,e){const n=e.fragments;for(let e=0,r=n.length;e<r;e++)pr(n[e],t);e.fragmentHint&&pr(e.fragmentHint,t),e.alignedSliding=!0}function mr(t,e){if(!function(t,e){return!!(t&&e.startCC<t.endCC&&e.endCC>t.startCC)}(e,t))return;const n=Math.min(e.endCC,t.endCC),r=fr(e.fragments,n),i=fr(t.fragments,n);if(!r||!i)return;T.log(`Aligning playlist at start of dicontinuity sequence ${n}`);gr(r.start-i.start,t)}function _r(t,e){if(!t.hasProgramDateTime||!e.hasProgramDateTime)return;const n=t.fragments,r=e.fragments;if(!n.length||!r.length)return;let i,s;const A=Math.min(e.endCC,t.endCC);e.startCC<A&&t.startCC<A&&(i=fr(r,A),s=fr(n,A)),i&&s||(i=r[Math.floor(r.length/2)],s=fr(n,i.cc)||n[Math.floor(n.length/2)]);const a=i.programDateTime,o=s.programDateTime;if(!a||!o)return;gr((o-a)/1e3-(s.start-i.start),t)}function wr(t,e,n){yr(t,e,n),t.addEventListener(e,n)}function yr(t,e,n){t.removeEventListener(e,n)}const vr=function(t){let e="";const n=t.length;for(let r=0;r<n;r++)e+=`[${t.start(r).toFixed(3)}-${t.end(r).toFixed(3)}]`;return e},Br="STOPPED",br="IDLE",Er="KEY_LOADING",Cr="FRAG_LOADING",kr="FRAG_LOADING_WAITING_RETRY",Fr="WAITING_TRACK",Tr="PARSING",Sr="PARSED",xr="ENDED",Ir="ERROR",Dr="WAITING_INIT_PTS",Ur="WAITING_LEVEL";class Lr extends Je{constructor(t,e,n,i,s){super(i,t.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=Br,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:e,media:n,mediaBuffer:i,state:s}=this,A=n?n.currentTime:0,a=nn.bufferInfo(i||n,A,t.maxBufferHole),o=!a.len;if(this.log(`Media seeking to ${r(A)?A.toFixed(3):A}, state: ${s}, ${o?"out of":"in"} buffer`),this.state===xr)this.resetLoadingState();else if(e){const n=t.maxFragLookUpTolerance,r=e.start-n,i=e.start+e.duration+n;if(o||i<a.start||r>a.end){const t=A>i;(A<r||t)&&(t&&e.loader&&(this.log(`Cancelling fragment load for seek (sn: ${e.sn})`),e.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(n){this.fragmentTracker.removeFragmentsInRange(A,1/0,this.playlistType,!0);if(A>this.lastCurrentTime&&(this.lastCurrentTime=A),!this.loadingParts){const t=Math.max(a.end,A),e=this.shouldLoadParts(this.getLevelDetails(),t);e&&(this.log(`LL-Part loading ON after seeking to ${A.toFixed(2)} with buffer @${t.toFixed(2)}`),this.loadingParts=e)}}this.hls.hasEnoughToStart||(this.log(`Setting ${o?"startPosition":"nextLoadPosition"} to ${A} for seek without enough to start`),this.nextLoadPosition=A,o&&(this.startPosition=A)),o&&this.state===br&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=s,this.hls=t,this.fragmentLoader=new ze(t.config),this.keyLoader=n,this.fragmentTracker=e,this.config=t.config,this.decrypter=new Ze(t.config)}registerListeners(){const{hls:t}=this;t.on(o.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(o.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(o.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(o.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(o.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(o.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(o.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(o.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(t){}stopLoad(){if(this.state===Br)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const t=this.fragCurrent;null!=t&&t.loader&&(t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=Br}get startPositionValue(){const{nextLoadPosition:t,startPosition:e}=this;return-1===e&&t?t:e}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(t,e){if(e.live||!this.media)return!1;const n=t.end||0,r=this.config.timelineOffset||0;if(n<=r)return!1;const i=t.buffered;this.config.maxBufferHole&&i&&i.length>1&&(t=nn.bufferedInfo(i,t.start,0));const s=t.nextStart;if(s&&s>r&&s<e.edge)return!1;if(this.media.currentTime<t.start)return!1;const A=e.partList;if(null!=A&&A.length){const t=A[A.length-1];return nn.isBuffered(this.media,t.start+t.duration/2)}const a=e.fragments[e.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(a)}getLevelDetails(){if(this.levels&&null!==this.levelLastLoaded)return this.levelLastLoaded.details}get timelineOffset(){const t=this.config.timelineOffset;var e;return t?(null==(e=this.getLevelDetails())?void 0:e.appliedTimelineOffset)||t:0}onMediaAttached(t,e){const n=this.media=this.mediaBuffer=e.media;wr(n,"seeking",this.onMediaSeeking),wr(n,"ended",this.onMediaEnded);const r=this.config;this.levels&&r.autoStartLoad&&this.state===Br&&this.startLoad(r.startPosition)}onMediaDetaching(t,e){const n=!!e.transferMedia,r=this.media;if(null!==r){if(r.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),yr(r,"seeking",this.onMediaSeeking),yr(r,"ended",this.onMediaEnded),this.keyLoader&&!n&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,n)return this.resetLoadingState(),void this.resetTransmuxer();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(t,e){}onManifestLoaded(t,e){this.startTimeOffset=e.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=Br,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(t,e,n){this.startFragRequested=!0,this._loadFragForPlayback(t,e,n)}_loadFragForPlayback(t,e,n){this._doFragLoad(t,e,n,(t=>{const e=t.frag;if(this.fragContextChanged(e))return this.warn(`${e.type} sn: ${e.sn}${t.part?" part: "+t.part.index:""} of ${this.fragInfo(e,!1,t.part)}) was dropped during download.`),void this.fragmentTracker.removeFragment(e);e.stats.chunkCount++,this._handleFragmentLoadProgress(t)})).then((t=>{if(!t)return;const e=this.state,n=t.frag;this.fragContextChanged(n)?(e===Cr||!this.fragCurrent&&e===Tr)&&(this.fragmentTracker.removeFragment(n),this.state=br):("payload"in t&&(this.log(`Loaded ${n.type} sn: ${n.sn} of ${this.playlistLabel()} ${n.level}`),this.hls.trigger(o.FRAG_LOADED,t)),this._handleFragmentLoadComplete(t))})).catch((e=>{this.state!==Br&&this.state!==Ir&&(this.warn(`Frag error: ${(null==e?void 0:e.message)||e}`),this.resetFragmentLoading(t))}))}clearTrackerIfNeeded(t){var e;const{fragmentTracker:n}=this;if(n.getState(t)===Re){const e=t.type,r=this.getFwdBufferInfo(this.mediaBuffer,e),i=Math.max(t.duration,r?r.len:this.config.maxBufferLength),s=this.backtrackFragment;(1===(s?t.sn-s.sn:0)||this.reduceMaxBufferLength(i,t.duration))&&n.removeFragment(t)}else 0===(null==(e=this.mediaBuffer)?void 0:e.buffered.length)?n.removeAllFragments():n.hasParts(t.type)&&(n.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type}),n.getState(t)===Qe&&n.removeFragment(t))}checkLiveUpdate(t){if(t.updated&&!t.live){const e=t.fragments[t.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type})}t.fragments[0]||(t.deltaUpdateFailed=!0)}waitForLive(t){const e=t.details;return(null==e?void 0:e.live)&&"EVENT"!==e.type&&(this.levelLastLoaded!==t||e.expired)}flushMainBuffer(t,e,n=null){if(!(t-e))return;const r={startOffset:t,endOffset:e,type:n};this.hls.trigger(o.BUFFER_FLUSHING,r)}_loadInitSegment(t,e){this._doFragLoad(t,e).then((t=>{const e=null==t?void 0:t.frag;if(!e||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return t})).then((t=>{const{hls:e}=this,{frag:n,payload:r}=t,i=n.decryptdata;if(r&&r.byteLength>0&&null!=i&&i.key&&i.iv&&mn(i.method)){const s=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),i.key.buffer,i.iv.buffer,_n(i.method)).catch((t=>{throw e.trigger(o.ERROR,{type:A.MEDIA_ERROR,details:a.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:n}),t})).then((r=>{const i=self.performance.now();return e.trigger(o.FRAG_DECRYPTED,{frag:n,payload:r,stats:{tstart:s,tdecrypt:i}}),t.payload=r,this.completeInitSegmentLoad(t)}))}return this.completeInitSegmentLoad(t)})).catch((e=>{this.state!==Br&&this.state!==Ir&&(this.warn(e),this.resetFragmentLoading(t))}))}completeInitSegmentLoad(t){const{levels:e}=this;if(!e)throw new Error("init load aborted, missing levels");const n=t.frag.stats;this.state!==Br&&(this.state=br),t.frag.data=new Uint8Array(t.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}unhandledEncryptionError(t,e){var n,r;const i=t.tracks;if(i&&!e.encrypted&&(null!=(n=i.audio)&&n.encrypted||null!=(r=i.video)&&r.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const t=this.media,n=new Error(`Encrypted track with no key in ${this.fragInfo(e)} (media ${t?"attached mediaKeys: "+t.mediaKeys:"detached"})`);return this.warn(n.message),!t||t.mediaKeys?!1:(this.hls.trigger(o.ERROR,{type:A.KEY_SYSTEM_ERROR,details:a.KEY_SYSTEM_NO_KEYS,fatal:!1,error:n,frag:e}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(t){const{fragCurrent:e}=this;return!t||!e||t.sn!==e.sn||t.level!==e.level}fragBufferedComplete(t,e){const n=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${t.type} sn: ${t.sn}${e?" part: "+e.index:""} of ${this.fragInfo(t,!1,e)} > buffer:${n?vr(nn.getBuffered(n)):"(detached)"})`),W(t)){var r;if(t.type!==p){const e=t.elementaryStreams;if(!Object.keys(e).some((t=>!!e[t])))return void(this.state=br)}const e=null==(r=this.levels)?void 0:r[t.level];null!=e&&e.fragmentError&&(this.log(`Resetting level fragment error count of ${e.fragmentError} on frag buffered`),e.fragmentError=0)}this.state=br}_handleFragmentLoadComplete(t){const{transmuxer:e}=this;if(!e)return;const{frag:n,part:r,partsLoaded:i}=t,s=!i||0===i.length||i.some((t=>!t)),A=new tn(n.level,n.sn,n.stats.chunkCount+1,0,r?r.index:-1,!s);e.flush(A)}_handleFragmentLoadProgress(t){}_doFragLoad(t,e,n=null,i){var s;this.fragCurrent=t;const A=e.details;if(!this.levels||!A)throw new Error(`frag load aborted, missing level${A?"":" detail"}s`);let a=null;if(!t.encrypted||null!=(s=t.decryptdata)&&s.key)t.encrypted||(a=this.keyLoader.loadClear(t,A.encryptedFragments,this.startFragRequested),a&&this.log("[eme] blocking frag load until media-keys acquired"));else if(this.log(`Loading key for ${t.sn} of [${A.startSN}-${A.endSN}], ${this.playlistLabel()} ${t.level}`),this.state=Er,this.fragCurrent=t,a=this.keyLoader.load(t).then((t=>{if(!this.fragContextChanged(t.frag))return this.hls.trigger(o.KEY_LOADED,t),this.state===Er&&(this.state=br),t})),this.hls.trigger(o.KEY_LOADING,{frag:t}),null===this.fragCurrent)return this.log("context changed in KEY_LOADING"),Promise.resolve(null);const l=this.fragPrevious;if(W(t)&&(!l||t.sn!==l.sn)){const n=this.shouldLoadParts(e.details,t.end);n!==this.loadingParts&&(this.log(`LL-Part loading ${n?"ON":"OFF"} loading sn ${null==l?void 0:l.sn}->${t.sn}`),this.loadingParts=n)}if(n=Math.max(t.start,n||0),this.loadingParts&&W(t)){const r=A.partList;if(r&&i){n>A.fragmentEnd&&A.fragmentHint&&(t=A.fragmentHint);const s=this.getNextPart(r,t,n);if(s>-1){const l=r[s];let u;return t=this.fragCurrent=l.fragment,this.log(`Loading ${t.type} sn: ${t.sn} part: ${l.index} (${s}/${r.length-1}) of ${this.fragInfo(t,!1,l)}) cc: ${t.cc} [${A.startSN}-${A.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=l.start+l.duration,this.state=Cr,u=a?a.then((n=>!n||this.fragContextChanged(n.frag)?null:this.doFragPartsLoad(t,l,e,i))).catch((t=>this.handleFragLoadError(t))):this.doFragPartsLoad(t,l,e,i).catch((t=>this.handleFragLoadError(t))),this.hls.trigger(o.FRAG_LOADING,{frag:t,part:l,targetBufferTime:n}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):u}if(!t.url||this.loadedEndOfParts(r,n))return Promise.resolve(null)}}var u;if(W(t)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)} Check buffer at sn: ${t.sn} loaded parts: ${null==(u=A.partList)?void 0:u.filter((t=>t.loaded)).map((t=>`[${t.start}-${t.end}]`))}`),this.loadingParts=!1;else if(!t.url)return Promise.resolve(null);this.log(`Loading ${t.type} sn: ${t.sn} of ${this.fragInfo(t,!1)}) cc: ${t.cc} ${"["+A.startSN+"-"+A.endSN+"]"}, target: ${parseFloat(n.toFixed(3))}`),r(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=Cr;const c=this.config.progressive;let h;return h=c&&a?a.then((e=>!e||this.fragContextChanged(e.frag)?null:this.fragmentLoader.load(t,i))).catch((t=>this.handleFragLoadError(t))):Promise.all([this.fragmentLoader.load(t,c?i:void 0),a]).then((([t])=>(!c&&i&&i(t),t))).catch((t=>this.handleFragLoadError(t))),this.hls.trigger(o.FRAG_LOADING,{frag:t,targetBufferTime:n}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):h}doFragPartsLoad(t,e,n,r){return new Promise(((i,s)=>{var A;const a=[],l=null==(A=n.details)?void 0:A.partList,u=e=>{this.fragmentLoader.loadPart(t,e,r).then((r=>{a[e.index]=r;const s=r.part;this.hls.trigger(o.FRAG_LOADED,r);const A=lr(n.details,t.sn,e.index+1)||ur(l,t.sn,e.index+1);if(!A)return i({frag:t,part:s,partsLoaded:a});u(A)})).catch(s)};u(e)}))}handleFragLoadError(t){if("data"in t){const e=t.data;e.frag&&e.details===a.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):e.frag&&e.type===A.KEY_SYSTEM_ERROR?(e.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(e.frag)):this.hls.trigger(o.ERROR,e)}else this.hls.trigger(o.ERROR,{type:A.OTHER_ERROR,details:a.INTERNAL_EXCEPTION,err:t,error:t,fatal:!0});return null}_handleTransmuxerFlush(t){const e=this.getCurrentContext(t);if(!e||this.state!==Tr)return void(this.fragCurrent||this.state===Br||this.state===Ir||(this.state=br));const{frag:n,part:r,level:i}=e,s=self.performance.now();n.stats.parsing.end=s,r&&(r.stats.parsing.end=s);const A=this.getLevelDetails(),a=A&&n.sn>A.endSN||this.shouldLoadParts(A,n.end);a!==this.loadingParts&&(this.log(`LL-Part loading ${a?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=a),this.updateLevelTiming(n,r,i,t.partial)}shouldLoadParts(t,e){if(this.config.lowLatencyMode){if(!t)return this.loadingParts;if(t.partList){var n;const i=t.partList[0];if(i.fragment.type===p)return!1;if(e>=i.end+((null==(n=t.fragmentHint)?void 0:n.duration)||0)){var r;if((this.hls.hasEnoughToStart?(null==(r=this.media)?void 0:r.currentTime)||this.lastCurrentTime:this.getLoadPosition())>i.start-i.fragment.duration)return!0}}}return!1}getCurrentContext(t){const{levels:e,fragCurrent:n}=this,{level:r,sn:i,part:s}=t;if(null==e||!e[r])return this.warn(`Levels object was unset while buffering fragment ${i} of ${this.playlistLabel()} ${r}. The current chunk will not be buffered.`),null;const A=e[r],a=A.details,o=s>-1?lr(a,i,s):null,l=o?o.fragment:or(a,i,n);return l?(n&&n!==l&&(l.stats=n.stats),{frag:l,part:o,level:A}):null}bufferFragmentData(t,e,n,r,i){if(this.state!==Tr)return;const{data1:s,data2:A}=t;let a=s;if(A&&(a=gt(s,A)),!a.length)return;const l=this.initPTS[e.cc],u=l?-l.baseTime/l.timescale:void 0,c={type:t.type,frag:e,part:n,chunkMeta:r,offset:u,parent:e.type,data:a};if(this.hls.trigger(o.BUFFER_APPENDING,c),t.dropped&&t.independent&&!n){if(i)return;this.flushBufferGap(e)}}flushBufferGap(t){const e=this.media;if(!e)return;if(!nn.isBuffered(e,e.currentTime))return void this.flushMainBuffer(0,t.start);const n=e.currentTime,r=nn.bufferInfo(e,n,0),i=t.duration,s=Math.min(2*this.config.maxFragLookUpTolerance,.25*i),A=Math.max(Math.min(t.start-s,r.end-s),n+s);t.start-A>s&&this.flushMainBuffer(A,t.start)}getFwdBufferInfo(t,e){var n;const i=this.getLoadPosition();if(!r(i))return null;const s=this.lastCurrentTime>i||null!=(n=this.media)&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(t,i,e,s)}getFwdBufferInfoAtPos(t,e,n,r){const i=nn.bufferInfo(t,e,r);if(0===i.len&&void 0!==i.nextStart){const s=this.fragmentTracker.getBufferedFrag(e,n);if(s&&(i.nextStart<=s.end||s.gap)){const n=Math.max(Math.min(i.nextStart,s.end)-e,r);return nn.bufferInfo(t,e,n)}}return i}getMaxBufferLength(t){const{config:e}=this;let n;return n=t?Math.max(8*e.maxBufferSize/t,e.maxBufferLength):e.maxBufferLength,Math.min(n,e.maxMaxBufferLength)}reduceMaxBufferLength(t,e){const n=this.config,r=Math.max(Math.min(t-e,n.maxBufferLength),e),i=Math.max(t-3*e,n.maxMaxBufferLength/2,r);return i>=r&&(n.maxMaxBufferLength=i,this.warn(`Reduce max buffer length to ${i}s`),!0)}getAppendedFrag(t,e=d){const n=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(t,e):null;return n&&"fragment"in n?n.fragment:n}getNextFragment(t,e){const n=e.fragments,r=n.length;if(!r)return null;const{config:i}=this,s=n[0].start,A=i.lowLatencyMode&&!!e.partList;let a=null;if(e.live){const n=i.initialLiveManifestSize;if(r<n)return this.warn(`Not enough fragments to start playback (have: ${r}, need: ${n})`),null;if(!e.PTSKnown&&!this.startFragRequested&&-1===this.startPosition||t<s){var o;A&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),a=this.getInitialLiveFragment(e);const n=this.hls.startPosition,r=this.hls.liveSyncPosition,i=a?(-1!==n&&n>=s?n:r)||a.start:t;this.log(`Setting startPosition to ${i} to match start frag at live edge. mainStart: ${n} liveSyncPosition: ${r} frag.start: ${null==(o=a)?void 0:o.start}`),this.startPosition=this.nextLoadPosition=i}}else t<=s&&(a=n[0]);if(!a){const n=this.loadingParts?e.partEnd:e.fragmentEnd;a=this.getFragmentAtPosition(t,n,e)}let l=this.filterReplacedPrimary(a,e);if(!l&&a){const t=a.sn-e.startSN;l=this.filterReplacedPrimary(n[t+1]||null,e)}return this.mapToInitFragWhenRequired(l)}isLoopLoading(t,e){const n=this.fragmentTracker.getState(t);return(n===Oe||n===Qe&&!!t.gap)&&this.nextLoadPosition>e}getNextFragmentLoopLoading(t,e,n,r,i){let s=null;if(t.gap&&(s=this.getNextFragment(this.nextLoadPosition,e),s&&!s.gap&&n.nextStart)){const t=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,r,0);if(null!==t&&n.len+t.len>=i){const t=s.sn;return this.loopSn!==t&&(this.log(`buffer full after gaps in "${r}" playlist starting at sn: ${t}`),this.loopSn=t),null}}return this.loopSn=void 0,s}get primaryPrefetch(){if(Rr(this.config)){var t;if(null==(t=this.hls.interstitialsManager)||null==(t=t.playingItem)?void 0:t.event)return!0}return!1}filterReplacedPrimary(t,e){if(!t)return t;if(Rr(this.config)&&t.type!==p){const n=this.hls.interstitialsManager,r=null==n?void 0:n.bufferingItem;if(r){const n=r.event;if(n){if(n.appendInPlace||Math.abs(t.start-r.start)>1||0===r.start)return null}else{if(t.end<=r.start&&!1===(null==e?void 0:e.live))return null;if(t.start>r.end&&r.nextEvent&&(r.nextEvent.appendInPlace||t.start-r.end>1))return null}}const i=null==n?void 0:n.playerQueue;if(i)for(let e=i.length;e--;){const n=i[e].interstitial;if(n.appendInPlace&&t.start>=n.startTime&&t.end<=n.resumeTime)return null}}return t}mapToInitFragWhenRequired(t){return null==t||!t.initSegment||t.initSegment.data||this.bitrateTest?t:t.initSegment}getNextPart(t,e,n){let r=-1,i=!1,s=!0;for(let A=0,a=t.length;A<a;A++){const a=t[A];if(s=s&&!a.independent,r>-1&&n<a.start)break;const o=a.loaded;o?r=-1:(i||(a.independent||s)&&a.fragment===e)&&(a.fragment!==e&&this.warn(`Need buffer at ${n} but next unloaded part starts at ${a.start}`),r=A),i=o}return r}loadedEndOfParts(t,e){let n;for(let r=t.length;r--;){if(n=t[r],!n.loaded)return!1;if(e>n.start)return!0}return!1}getInitialLiveFragment(t){const e=t.fragments,n=this.fragPrevious;let i=null;if(n){if(t.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),i=function(t,e,n){if(null===e||!Array.isArray(t)||!t.length||!r(e))return null;if(e<(t[0].programDateTime||0))return null;if(e>=(t[t.length-1].endProgramDateTime||0))return null;for(let r=0;r<t.length;++r){const i=t[r];if(pe(e,n,i))return i}return null}(e,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){const r=n.sn+1;if(r>=t.startSN&&r<=t.endSN){const s=e[r-t.startSN];n.cc===s.cc&&(i=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=ge(t,n.cc,n.end),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const e=this.hls.liveSyncPosition;null!==e&&(i=this.getFragmentAtPosition(e,this.bitrateTest?t.fragmentEnd:t.edge,t))}return i}getFragmentAtPosition(t,e,n){const{config:r}=this;let{fragPrevious:i}=this,{fragments:s,endSN:A}=n;const{fragmentHint:a}=n,{maxFragLookUpTolerance:o}=r,l=n.partList,u=!!(this.loadingParts&&null!=l&&l.length&&a);let c;if(u&&!this.bitrateTest&&l[l.length-1].fragment.sn===a.sn&&(s=s.concat(a),A=a.sn),t<e){var h;c=de(i,s,t,t<this.lastCurrentTime||t>e-o||null!=(h=this.media)&&h.paused||!this.startFragRequested?0:o)}else c=s[s.length-1];if(c){const t=c.sn-n.startSN,e=this.fragmentTracker.getState(c);if((e===Oe||e===Qe&&c.gap)&&(i=c),i&&c.sn===i.sn&&(!u||l[0].fragment.sn>c.sn||!n.live)){if(c.level===i.level){const e=s[t+1];c=c.sn<A&&this.fragmentTracker.getState(e)!==Oe?e:null}}}return c}alignPlaylists(t,e,n){const i=t.fragments.length;if(!i)return this.warn("No fragments in live playlist"),0;const s=t.fragmentStart,A=!e,a=t.alignedSliding&&r(s);if(A||!a&&!s){!function(t,e){t&&(mr(e,t),e.alignedSliding||_r(e,t),e.alignedSliding||e.skippedSegments||sr(t,e,!1))}(n,t);const r=t.fragmentStart;return this.log(`Live playlist sliding: ${r.toFixed(2)} start-sn: ${e?e.startSN:"na"}->${t.startSN} fragments: ${i}`),r}return s}waitForCdnTuneIn(t){return t.live&&t.canBlockReload&&t.partTarget&&t.tuneInGoal>Math.max(t.partHoldBack,3*t.partTarget)}setStartPosition(t,e){let n=this.startPosition;n<e&&(n=-1);const i=this.timelineOffset;if(-1===n){const s=null!==this.startTimeOffset,A=s?this.startTimeOffset:t.startTimeOffset;null!==A&&r(A)?(n=e+A,A<0&&(n+=t.edge),n=Math.min(Math.max(e,n),e+t.totalduration),this.log(`Setting startPosition to ${n} for start time offset ${A} found in ${s?"multivariant":"media"} playlist`),this.startPosition=n):t.live?(n=this.hls.liveSyncPosition||e,this.log(`Setting startPosition to -1 to start at live edge ${n}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=n=0),this.lastCurrentTime=n+i}this.nextLoadPosition=n+i}getLoadPosition(){var t;const{media:e}=this;let n=0;return null!=(t=this.hls)&&t.hasEnoughToStart&&e?n=e.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}handleFragLoadAborted(t,e){this.transmuxer&&t.type===this.playlistType&&W(t)&&t.stats.aborted&&(this.log(`Fragment ${t.sn}${e?" part "+e.index:""} of ${this.playlistLabel()} ${t.level} was aborted`),this.resetFragmentLoading(t))}resetFragmentLoading(t){this.fragCurrent&&(this.fragContextChanged(t)||this.state===kr)||(this.state=br)}onFragmentOrKeyLoadError(t,e){var n;if(e.chunkMeta&&!e.frag){const t=this.getCurrentContext(e.chunkMeta);t&&(e.frag=t.frag)}const r=e.frag;if(!r||r.type!==t||!this.levels)return;var i;if(this.fragContextChanged(r))return void this.warn(`Frag load error must match current frag to retry ${r.url} > ${null==(i=this.fragCurrent)?void 0:i.url}`);const s=e.details===a.FRAG_GAP;s&&this.fragmentTracker.fragBuffered(r,!0);const A=e.errorAction;if(!A)return void(this.state=Ir);const{action:o,flags:l,retryCount:u=0,retryConfig:c}=A,h=!!c,d=h&&o===Te,f=h&&!A.resolved&&l===xe,p=null==(n=this.hls.latestLevelDetails)?void 0:n.live;if(!d&&f&&W(r)&&!r.endList&&p&&!we(e))this.resetFragmentErrors(t),this.treatAsGap(r),A.resolved=!0;else if((d||f)&&u<c.maxNumRetry){var g;const n=Ee(null==(g=e.response)?void 0:g.code),i=ve(c,u);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+i,this.state=kr,A.resolved=!0,n)return this.log("Waiting for connection (offline)"),this.retryDate=1/0,void(e.reason="offline");this.warn(`Fragment ${r.sn} of ${t} ${r.level} errored with ${e.details}, retrying loading ${u+1}/${c.maxNumRetry} in ${i}ms`)}else if(c){if(this.resetFragmentErrors(t),!(u<c.maxNumRetry))return void this.warn(`${e.details} reached or exceeded max retry (${u})`);s||o===Fe||(A.resolved=!0)}else this.state=o===ke?Ur:Ir;this.tickImmediate()}checkRetryDate(){const t=self.performance.now(),e=this.retryDate,n=e===1/0;(!e||t>=e||n&&!Ee(0))&&(n&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=br)}reduceLengthAndFlushBuffer(t){if(this.state===Tr||this.state===Sr){const e=t.frag,n=t.parent,r=this.getFwdBufferInfo(this.mediaBuffer,n),i=r&&r.len>.5;i&&this.reduceMaxBufferLength(r.len,(null==e?void 0:e.duration)||10);const s=!i;return s&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${n} buffer`),e&&(this.fragmentTracker.removeFragment(e),this.nextLoadPosition=e.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(t){t===f&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==Br&&(this.state=br)}afterBufferFlushed(t,e,n){if(!t)return;const r=nn.getBuffered(t);this.fragmentTracker.detectEvictedFragments(e,r,n),this.state===xr&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==Br&&(this.state=br)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const t=this.levelLastLoaded,e=t?t.details:null;null!=e&&e.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(e,e.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(t){this.log(`Loading context changed while buffering sn ${t.sn} of ${this.playlistLabel()} ${-1===t.level?"<removed>":t.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(t=0){this.fragmentTracker.removeFragmentsInRange(t,1/0,this.playlistType,!1,!0)}updateLevelTiming(t,e,n,r){const i=n.details;if(!i)return void this.warn("level.details undefined");var s;if(!Object.keys(t.elementaryStreams).reduce(((e,s)=>{const A=t.elementaryStreams[s];if(A){const a=A.endPTS-A.startPTS;if(a<=0)return this.warn(`Could not parse fragment ${t.sn} ${s} duration reliably (${a})`),e||!1;const l=r?0:nr(i,t,A.startPTS,A.endPTS,A.startDTS,A.endDTS,this);return this.hls.trigger(o.LEVEL_PTS_UPDATED,{details:i,level:n,drift:l,type:s,frag:t,start:A.startPTS,end:A.endPTS}),!0}return e}),!1)&&(0===n.fragmentError&&this.treatAsGap(t,n),null===(null==(s=this.transmuxer)?void 0:s.error))){const e=new Error(`Found no media in fragment ${t.sn} of ${this.playlistLabel()} ${t.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(e.message),this.hls.trigger(o.ERROR,{type:A.MEDIA_ERROR,details:a.FRAG_PARSING_ERROR,fatal:!1,error:e,frag:t,reason:`Found no media in msn ${t.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=Sr,this.log(`Parsed ${t.type} sn: ${t.sn}${e?" part: "+e.index:""} of ${this.fragInfo(t,!1,e)})`),this.hls.trigger(o.FRAG_PARSED,{frag:t,part:e})}playlistLabel(){return this.playlistType===d?"level":"track"}fragInfo(t,e=!0,n){var r,i;return`${this.playlistLabel()} ${t.level} (${n?"part":"frag"}:[${(null!=(r=e&&!n?t.startPTS:(n||t).start)?r:NaN).toFixed(3)}-${(null!=(i=e&&!n?t.endPTS:(n||t).end)?i:NaN).toFixed(3)}]${n&&"main"===t.type?"INDEPENDENT="+(n.independent?"YES":"NO"):""}`}treatAsGap(t,e){e&&e.fragmentError++,t.gap=!0,this.fragmentTracker.removeFragment(t),this.fragmentTracker.fragBuffered(t,!0)}resetTransmuxer(){var t;null==(t=this.transmuxer)||t.reset()}recoverWorkerError(t){"demuxerWorker"===t.event&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(),this.resetLoadingState())}set state(t){const e=this._state;e!==t&&(this._state=t,this.log(`${e}->${t}`))}get state(){return this._state}}function Rr(t){return!!t.interstitialsController&&!1!==t.enableInterstitialPlayback}class Qr{constructor(){this.chunks=[],this.dataLength=0}push(t){this.chunks.push(t),this.dataLength+=t.length}flush(){const{chunks:t,dataLength:e}=this;let n;return t.length?(n=1===t.length?t[0]:function(t,e){const n=new Uint8Array(e);let r=0;for(let e=0;e<t.length;e++){const i=t[e];n.set(i,r),r+=i.length}return n}(t,e),this.reset(),n):new Uint8Array(0)}reset(){this.chunks.length=0,this.dataLength=0}}var Or,Pr={exports:{}};var Mr=(Or||(Or=1,function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,r,s,A){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new i(r,s||t,A),o=n?n+e:e;return t._events[o]?t._events[o].fn?t._events[o]=[t._events[o],a]:t._events[o].push(a):(t._events[o]=a,t._eventsCount++),t}function A(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,A=new Array(s);i<s;i++)A[i]=r[i].fn;return A},a.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},a.prototype.emit=function(t,e,r,i,s,A){var a=n?n+t:t;if(!this._events[a])return!1;var o,l,u=this._events[a],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,i),!0;case 5:return u.fn.call(u.context,e,r,i,s),!0;case 6:return u.fn.call(u.context,e,r,i,s,A),!0}for(l=1,o=new Array(c-1);l<c;l++)o[l-1]=arguments[l];u.fn.apply(u.context,o)}else{var h,d=u.length;for(l=0;l<d;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),c){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;case 4:u[l].fn.call(u[l].context,e,r,i);break;default:if(!o)for(h=1,o=new Array(c-1);h<c;h++)o[h-1]=arguments[h];u[l].fn.apply(u[l].context,o)}}return!0},a.prototype.on=function(t,e,n){return s(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return s(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,r,i){var s=n?n+t:t;if(!this._events[s])return this;if(!e)return A(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||i&&!a.once||r&&a.context!==r||A(this,s);else{for(var o=0,l=[],u=a.length;o<u;o++)(a[o].fn!==e||i&&!a[o].once||r&&a[o].context!==r)&&l.push(a[o]);l.length?this._events[s]=1===l.length?l[0]:l:A(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&A(this,e)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a}(Pr)),Pr.exports),Nr=L(Mr);const Hr="1.6.13",Kr={};function $r(t,e){return e+10<=t.length&&51===t[e]&&68===t[e+1]&&73===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128}function Gr(t,e){return e+10<=t.length&&73===t[e]&&68===t[e+1]&&51===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128}function Vr(t,e){let n=0;return n=(127&t[e])<<21,n|=(127&t[e+1])<<14,n|=(127&t[e+2])<<7,n|=127&t[e+3],n}function jr(t,e){const n=e;let r=0;for(;Gr(t,e);){r+=10;r+=Vr(t,e+6),$r(t,e+10)&&(r+=10),e+=r}if(r>0)return t.subarray(n,n+r)}function Zr(t,e){return 255===t[e]&&240==(246&t[e+1])}function Wr(t,e){return 1&t[e+1]?7:9}function zr(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}function Yr(t,e){return e+1<t.length&&Zr(t,e)}function Xr(t,e){if(Yr(t,e)){const n=Wr(t,e);if(e+n>=t.length)return!1;const r=zr(t,e);if(r<=n)return!1;const i=e+r;return i===t.length||Yr(t,i)}return!1}function qr(t,e,n,r,i){if(!t.samplerate){const s=function(t,e,n,r){const i=e[n+2],s=i>>2&15;if(s>12){const e=new Error(`invalid ADTS sampling index:${s}`);return void t.emit(o.ERROR,o.ERROR,{type:A.MEDIA_ERROR,details:a.FRAG_PARSING_ERROR,fatal:!0,error:e,reason:e.message})}const l=1+(i>>6&3),u=e[n+3]>>6&3|(1&i)<<2,c="mp4a.40."+l,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350][s];let d=s;5!==l&&29!==l||(d-=3);const f=[l<<3|(14&d)>>1,(1&d)<<7|u<<3];return T.log(`manifest codec:${r}, parsed codec:${c}, channels:${u}, rate:${h} (ADTS object type:${l} sampling index:${s})`),{config:f,samplerate:h,channelCount:u,codec:c,parsedCodec:c,manifestCodec:r}}(e,n,r,i);if(!s)return;w(t,s)}}function Jr(t){return 9216e4/t}function ti(t,e,n,r,i){const s=r+i*Jr(t.samplerate),A=function(t,e){const n=Wr(t,e);if(e+n<=t.length){const r=zr(t,e)-n;if(r>0)return{headerLength:n,frameLength:r}}}(e,n);let a;if(A){const{frameLength:r,headerLength:i}=A,o=i+r,l=Math.max(0,n+o-e.length);l?(a=new Uint8Array(o-i),a.set(e.subarray(n+i,e.length),0)):a=e.subarray(n+i,n+o);const u={unit:a,pts:s};return l||t.samples.push(u),{sample:u,length:o,missing:l}}const o=e.length-n;a=new Uint8Array(o),a.set(e.subarray(n,e.length),0);return{sample:{unit:a,pts:s},length:o,missing:-1}}function ei(t,e){return Gr(t,e)&&Vr(t,e+6)+10<=t.length-e}function ni(t,e=0,n=1/0){return function(t,e,n,r){const i=function(t){return t instanceof ArrayBuffer?t:t.buffer}(t);let s=1;"BYTES_PER_ELEMENT"in r&&(s=r.BYTES_PER_ELEMENT);const A=(c=t,c&&c.buffer instanceof ArrayBuffer&&void 0!==c.byteLength&&void 0!==c.byteOffset?t.byteOffset:0),a=(A+t.byteLength)/s,o=(A+e)/s,l=Math.floor(Math.max(0,Math.min(o,a))),u=Math.floor(Math.min(l+Math.max(n,0),a));var c;return new r(i,l,u-l)}(t,e,n,Uint8Array)}function ri(t){const e={key:t.type,description:"",data:"",mimeType:null,pictureType:null};if(t.size<2)return;if(3!==t.data[0])return void console.log("Ignore frame with unrecognized character encoding");const n=t.data.subarray(1).indexOf(0);if(-1===n)return;const r=I(ni(t.data,1,n)),i=t.data[2+n],s=t.data.subarray(3+n).indexOf(0);if(-1===s)return;const A=I(ni(t.data,3+n,s));let a;return a="--\x3e"===r?I(ni(t.data,4+n+s)):function(t){return t instanceof ArrayBuffer?t:0==t.byteOffset&&t.byteLength==t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}(t.data.subarray(4+n+s)),e.mimeType=r,e.pictureType=i,e.description=A,e.data=a,e}function ii(t){return"PRIV"===t.type?function(t){if(t.size<2)return;const e=I(t.data,!0),n=new Uint8Array(t.data.subarray(e.length+1));return{key:t.type,info:e,data:n.buffer}}(t):"W"===t.type[0]?function(t){if("WXXX"===t.type){if(t.size<2)return;let e=1;const n=I(t.data.subarray(e),!0);e+=n.length+1;const r=I(t.data.subarray(e));return{key:t.type,info:n,data:r}}const e=I(t.data);return{key:t.type,info:"",data:e}}(t):"APIC"===t.type?ri(t):function(t){if(t.size<2)return;if("TXXX"===t.type){let e=1;const n=I(t.data.subarray(e),!0);e+=n.length+1;const r=I(t.data.subarray(e));return{key:t.type,info:n,data:r}}const e=I(t.data.subarray(1));return{key:t.type,info:"",data:e}}(t)}function si(t){const e=String.fromCharCode(t[0],t[1],t[2],t[3]),n=Vr(t,4);return{type:e,size:n,data:t.subarray(10,10+n)}}function Ai(t){let e=0;const n=[];for(;Gr(t,e);){const r=Vr(t,e+6);t[e+5]>>6&1&&(e+=10),e+=10;const i=e+r;for(;e+10<i;){const r=si(t.subarray(e)),i=ii(r);i&&n.push(i),e+=r.size+10}$r(t,e)&&(e+=10)}return n}function ai(t){return t&&"PRIV"===t.key&&"com.apple.streaming.transportStreamTimestamp"===t.info}function oi(t){if(8===t.data.byteLength){const e=new Uint8Array(t.data),n=1&e[3];let r=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return r/=45,n&&(r+=47721858.84),Math.round(r)}}function li(t){const e=Ai(t);for(let t=0;t<e.length;t++){const n=e[t];if(ai(n))return oi(n)}}let ui=function(t){return t.audioId3="org.id3",t.dateRange="com.apple.quicktime.HLS",t.emsg="https://aomedia.org/emsg/ID3",t.misbklv="urn:misb:KLV:bin:1910.1",t}({});function ci(t="",e=9e4){return{type:t,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class hi{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(t,e,n,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(t){this.initPTS=t,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(t,e){return!1}appendFrame(t,e,n){}demux(t,e){this.cachedData&&(t=gt(this.cachedData,t),this.cachedData=null);let n,i=jr(t,0),s=i?i.length:0;const A=this._audioTrack,a=this._id3Track,o=i?li(i):void 0,l=t.length;for((null===this.basePTS||0===this.frameIndex&&r(o))&&(this.basePTS=di(o,e,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),i&&i.length>0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:ui.audioId3,duration:Number.POSITIVE_INFINITY});s<l;){if(this.canParse(t,s)){const e=this.appendFrame(A,t,s);e?(this.frameIndex++,this.lastPTS=e.sample.pts,s+=e.length,n=s):s=l}else ei(t,s)?(i=jr(t,s),a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:ui.audioId3,duration:Number.POSITIVE_INFINITY}),s+=i.length,n=s):s++;if(s===l&&n!==l){const e=t.slice(n);this.cachedData?this.cachedData=gt(this.cachedData,e):this.cachedData=e}}return{audioTrack:A,videoTrack:ci(),id3Track:a,textTrack:ci()}}demuxSampleAes(t,e,n){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(t){const e=this.cachedData;return e&&(this.cachedData=null,this.demux(e,0)),{audioTrack:this._audioTrack,videoTrack:ci(),id3Track:this._id3Track,textTrack:ci()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const di=(t,e,n)=>{if(r(t))return 90*t;return 9e4*e+(n?9e4*n.baseTime/n.timescale:0)};let fi=null;const pi=[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],gi=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],mi=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],_i=[0,1,1,4];function wi(t,e,n,r,i){if(n+24>e.length)return;const s=yi(e,n);if(s&&n+s.frameLength<=e.length){const A=r+i*(9e4*s.samplesPerFrame/s.sampleRate),a={unit:e.subarray(n,n+s.frameLength),pts:A,dts:A};return t.config=[],t.channelCount=s.channelCount,t.samplerate=s.sampleRate,t.samples.push(a),{sample:a,length:s.frameLength,missing:0}}}function yi(t,e){const n=t[e+1]>>3&3,r=t[e+1]>>1&3,i=t[e+2]>>4&15,s=t[e+2]>>2&3;if(1!==n&&0!==i&&15!==i&&3!==s){const A=t[e+2]>>1&1,a=t[e+3]>>6,o=1e3*pi[14*(3===n?3-r:3===r?3:4)+i-1],l=gi[3*(3===n?0:2===n?1:2)+s],u=3===a?1:2,c=mi[n][r],h=_i[r],d=8*c*h,f=Math.floor(c*o/l+A)*h;if(null===fi){const t=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);fi=t?parseInt(t[1]):0}return!!fi&&fi<=87&&2===r&&o>=224e3&&0===a&&(t[e+3]=128|t[e+3]),{sampleRate:l,channelCount:u,frameLength:f,samplesPerFrame:d}}}function vi(t,e){return 255===t[e]&&224==(224&t[e+1])&&0!=(6&t[e+1])}function Bi(t,e){return e+1<t.length&&vi(t,e)}function bi(t,e){if(e+1<t.length&&vi(t,e)){const n=4,r=yi(t,e);let i=n;null!=r&&r.frameLength&&(i=r.frameLength);const s=e+i;return s===t.length||Bi(t,s)}return!1}const Ei=(t,e)=>{let n=0,r=5;e+=r;const i=new Uint32Array(1),s=new Uint32Array(1),A=new Uint8Array(1);for(;r>0;){A[0]=t[e];const a=Math.min(r,8),o=8-a;s[0]=4278190080>>>24+o<<o,i[0]=(A[0]&s[0])>>o,n=n?n<<a|i[0]:i[0],e+=1,r-=a}return n};class Ci extends hi{constructor(t){super(),this.observer=void 0,this.observer=t}resetInitSegment(t,e,n,r){super.resetInitSegment(t,e,n,r),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:e,duration:r,inputTimeScale:9e4,dropped:0}}canParse(t,e){return e+64<t.length}appendFrame(t,e,n){const r=ki(t,e,n,this.basePTS,this.frameIndex);if(-1!==r){return{sample:t.samples[t.samples.length-1],length:r,missing:0}}}static probe(t){if(!t)return!1;const e=jr(t,0);if(!e)return!1;const n=e.length;return 11===t[n]&&119===t[n+1]&&void 0!==li(e)&&Ei(t,n)<16}}function ki(t,e,n,r,i){if(n+8>e.length)return-1;if(11!==e[n]||119!==e[n+1])return-1;const s=e[n+4]>>6;if(s>=3)return-1;const A=[48e3,44100,32e3][s],a=63&e[n+4],o=2*[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][3*a+s];if(n+o>e.length)return-1;const l=e[n+6]>>5;let u=0;2===l?u+=2:(1&l&&1!==l&&(u+=2),4&l&&(u+=2));const c=(e[n+6]<<8|e[n+7])>>12-u&1,h=[2,1,2,3,3,4,4,5][l]+c,d=e[n+5]>>3,f=7&e[n+5],p=new Uint8Array([s<<6|d<<1|f>>2,(3&f)<<6|l<<3|c<<2|a>>4,a<<4&224]),g=r+i*(1536/A*9e4),m=e.subarray(n,n+o);return t.config=p,t.channelCount=h,t.samplerate=A,t.samples.push({unit:m,pts:g}),o}const Fi=/\/emsg[-/]ID3/i;function Ti(t,e){return r(t.presentationTime)?t.presentationTime/t.timeScale:e+t.presentationTimeDelta/t.timeScale}class Si{constructor(t,e,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new Ze(e,{removePKCS7Padding:!1})}decryptBuffer(t){return this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer,Ke)}decryptAacSample(t,e,n){const r=t[e].unit;if(r.length<=16)return;const i=r.subarray(16,r.length-r.length%16),s=i.buffer.slice(i.byteOffset,i.byteOffset+i.length);this.decryptBuffer(s).then((i=>{const s=new Uint8Array(i);r.set(s,16),this.decrypter.isSync()||this.decryptAacSamples(t,e+1,n)})).catch(n)}decryptAacSamples(t,e,n){for(;;e++){if(e>=t.length)return void n();if(!(t[e].unit.length<32)&&(this.decryptAacSample(t,e,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(t){const e=16*Math.floor((t.length-48)/160)+16,n=new Int8Array(e);let r=0;for(let e=32;e<t.length-16;e+=160,r+=16)n.set(t.subarray(e,e+16),r);return n}getAvcDecryptedUnit(t,e){const n=new Uint8Array(e);let r=0;for(let e=32;e<t.length-16;e+=160,r+=16)t.set(n.subarray(r,r+16),e);return t}decryptAvcSample(t,e,n,r,i){const s=vt(i.data),A=this.getAvcEncryptedData(s);this.decryptBuffer(A.buffer).then((A=>{i.data=this.getAvcDecryptedUnit(s,A),this.decrypter.isSync()||this.decryptAvcSamples(t,e,n+1,r)})).catch(r)}decryptAvcSamples(t,e,n,r){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;e++,n=0){if(e>=t.length)return void r();const i=t[e].units;for(;!(n>=i.length);n++){const s=i[n];if(!(s.data.length<=48||1!==s.type&&5!==s.type||(this.decryptAvcSample(t,e,n,r,s),this.decrypter.isSync())))return}}}}class xi{constructor(){this.VideoSample=null}createVideoSample(t,e,n){return{key:t,frame:!1,pts:e,dts:n,units:[],length:0}}getLastNalUnit(t){var e;let n,r=this.VideoSample;if(r&&0!==r.units.length||(r=t[t.length-1]),null!=(e=r)&&e.units){const t=r.units;n=t[t.length-1]}return n}pushAccessUnit(t,e){if(t.units.length&&t.frame){if(void 0===t.pts){const n=e.samples,r=n.length;if(!r)return void e.dropped++;{const e=n[r-1];t.pts=e.pts,t.dts=e.dts}}e.samples.push(t)}}parseNALu(t,e,n){const r=e.byteLength;let i=t.naluState||0;const s=i,A=[];let a,o,l,u=0,c=-1,h=0;for(-1===i&&(c=0,h=this.getNALuType(e,0),i=0,u=1);u<r;)if(a=e[u++],i)if(1!==i)if(a)if(1===a){if(o=u-i-1,c>=0){const t={data:e.subarray(c,o),type:h};A.push(t)}else{const n=this.getLastNalUnit(t.samples);n&&(s&&u<=4-s&&n.state&&(n.data=n.data.subarray(0,n.data.byteLength-s)),o>0&&(n.data=gt(n.data,e.subarray(0,o)),n.state=0))}u<r?(l=this.getNALuType(e,u),c=u,h=l,i=0):i=-1}else i=0;else i=3;else i=a?0:2;else i=a?0:1;if(c>=0&&i>=0){const t={data:e.subarray(c,r),type:h,state:i};A.push(t)}if(0===A.length){const n=this.getLastNalUnit(t.samples);n&&(n.data=gt(n.data,e))}return t.naluState=i,A}}class Ii{constructor(t){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const t=this.data,e=this.bytesAvailable,n=t.byteLength-e,r=new Uint8Array(4),i=Math.min(4,e);if(0===i)throw new Error("no bytes available");r.set(t.subarray(n,n+i)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i}skipBits(t){let e;t=Math.min(t,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(e=(t-=this.bitsAvailable)>>3,t-=e<<3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)}readBits(t){let e=Math.min(this.bitsAvailable,t);const n=this.word>>>32-e;if(t>32&&T.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0)this.word<<=e;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return e=t-e,e>0&&this.bitsAvailable?n<<e|this.readBits(e):n}skipLZ(){let t;for(t=0;t<this.bitsAvailable;++t)if(0!=(this.word&2147483648>>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const t=this.skipLZ();return this.readBits(t+1)-1}readEG(){const t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)}readBoolean(){return 1===this.readBits(1)}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class Di extends xi{parsePES(t,e,n,r){const i=this.parseNALu(t,n.data,r);let s,A=this.VideoSample,a=!1;n.data=null,A&&i.length&&!t.audFound&&(this.pushAccessUnit(A,t),A=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),i.forEach((r=>{var i,o;switch(r.type){case 1:{let e=!1;s=!0;const i=r.data;if(a&&i.length>4){const t=this.readSliceType(i);2!==t&&4!==t&&7!==t&&9!==t||(e=!0)}var l;if(e)null!=(l=A)&&l.frame&&!A.key&&(this.pushAccessUnit(A,t),A=this.VideoSample=null);A||(A=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),A.frame=!0,A.key=e;break}case 5:s=!0,null!=(i=A)&&i.frame&&!A.key&&(this.pushAccessUnit(A,t),A=this.VideoSample=null),A||(A=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),A.key=!0,A.frame=!0;break;case 6:s=!0,yt(r.data,1,n.pts,e.samples);break;case 7:{var u,c;s=!0,a=!0;const e=r.data,n=this.readSPS(e);if(!t.sps||t.width!==n.width||t.height!==n.height||(null==(u=t.pixelRatio)?void 0:u[0])!==n.pixelRatio[0]||(null==(c=t.pixelRatio)?void 0:c[1])!==n.pixelRatio[1]){t.width=n.width,t.height=n.height,t.pixelRatio=n.pixelRatio,t.sps=[e];const r=e.subarray(1,4);let i="avc1.";for(let t=0;t<3;t++){let e=r[t].toString(16);e.length<2&&(e="0"+e),i+=e}t.codec=i}break}case 8:s=!0,t.pps=[r.data];break;case 9:s=!0,t.audFound=!0,null!=(o=A)&&o.frame&&(this.pushAccessUnit(A,t),A=null),A||(A=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:s=!0;break;default:s=!1}if(A&&s){A.units.push(r)}})),r&&A&&(this.pushAccessUnit(A,t),this.VideoSample=null)}getNALuType(t,e){return 31&t[e]}readSliceType(t){const e=new Ii(t);return e.readUByte(),e.readUEG(),e.readUEG()}skipScalingList(t,e){let n,r=8,i=8;for(let s=0;s<t;s++)0!==i&&(n=e.readEG(),i=(r+n+256)%256),r=0===i?r:i}readSPS(t){const e=new Ii(t);let n,r,i,s=0,A=0,a=0,o=0;const l=e.readUByte.bind(e),u=e.readBits.bind(e),c=e.readUEG.bind(e),h=e.readBoolean.bind(e),d=e.skipBits.bind(e),f=e.skipEG.bind(e),p=e.skipUEG.bind(e),g=this.skipScalingList.bind(this);l();const m=l();if(u(5),d(3),l(),p(),100===m||110===m||122===m||244===m||44===m||83===m||86===m||118===m||128===m){const t=c();if(3===t&&d(1),p(),p(),d(1),h())for(r=3!==t?8:12,i=0;i<r;i++)h()&&g(i<6?16:64,e)}p();const _=c();if(0===_)c();else if(1===_)for(d(1),f(),f(),n=c(),i=0;i<n;i++)f();p(),d(1);const w=c(),y=c(),v=u(1);0===v&&d(1),d(1),h()&&(s=c(),A=c(),a=c(),o=c());let B=[1,1];if(h()&&h()){switch(l()){case 1:B=[1,1];break;case 2:B=[12,11];break;case 3:B=[10,11];break;case 4:B=[16,11];break;case 5:B=[40,33];break;case 6:B=[24,11];break;case 7:B=[20,11];break;case 8:B=[32,11];break;case 9:B=[80,33];break;case 10:B=[18,11];break;case 11:B=[15,11];break;case 12:B=[64,33];break;case 13:B=[160,99];break;case 14:B=[4,3];break;case 15:B=[3,2];break;case 16:B=[2,1];break;case 255:B=[l()<<8|l(),l()<<8|l()]}}return{width:Math.ceil(16*(w+1)-2*s-2*A),height:(2-v)*(y+1)*16-(v?2:4)*(a+o),pixelRatio:B}}}class Ui extends xi{constructor(...t){super(...t),this.initVPS=null}parsePES(t,e,n,r){const i=this.parseNALu(t,n.data,r);let s,A=this.VideoSample,a=!1;n.data=null,A&&i.length&&!t.audFound&&(this.pushAccessUnit(A,t),A=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),i.forEach((r=>{var i,o;switch(r.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:A||(A=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),A.frame=!0,s=!0;break;case 16:case 17:case 18:case 21:var l;if(s=!0,a)null!=(l=A)&&l.frame&&!A.key&&(this.pushAccessUnit(A,t),A=this.VideoSample=null);A||(A=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),A.key=!0,A.frame=!0;break;case 19:case 20:s=!0,null!=(i=A)&&i.frame&&!A.key&&(this.pushAccessUnit(A,t),A=this.VideoSample=null),A||(A=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),A.key=!0,A.frame=!0;break;case 39:s=!0,yt(r.data,2,n.pts,e.samples);break;case 32:s=!0,t.vps||("object"!=typeof t.params&&(t.params={}),t.params=w(t.params,this.readVPS(r.data)),this.initVPS=r.data),t.vps=[r.data];break;case 33:if(s=!0,a=!0,void 0===t.vps||t.vps[0]===this.initVPS||void 0===t.sps||this.matchSPS(t.sps[0],r.data)||(this.initVPS=t.vps[0],t.sps=t.pps=void 0),!t.sps){const e=this.readSPS(r.data);t.width=e.width,t.height=e.height,t.pixelRatio=e.pixelRatio,t.codec=e.codecString,t.sps=[],"object"!=typeof t.params&&(t.params={});for(const n in e.params)t.params[n]=e.params[n]}this.pushParameterSet(t.sps,r.data,t.vps),A||(A=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),A.key=!0;break;case 34:if(s=!0,"object"==typeof t.params){if(!t.pps){t.pps=[];const e=this.readPPS(r.data);for(const n in e)t.params[n]=e[n]}this.pushParameterSet(t.pps,r.data,t.vps)}break;case 35:s=!0,t.audFound=!0,null!=(o=A)&&o.frame&&(this.pushAccessUnit(A,t),A=null),A||(A=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;default:s=!1}if(A&&s){A.units.push(r)}})),r&&A&&(this.pushAccessUnit(A,t),this.VideoSample=null)}pushParameterSet(t,e,n){(n&&n[0]===this.initVPS||!n&&!t.length)&&t.push(e)}getNALuType(t,e){return(126&t[e])>>>1}ebsp2rbsp(t){const e=new Uint8Array(t.byteLength);let n=0;for(let r=0;r<t.byteLength;r++)r>=2&&3===t[r]&&0===t[r-1]&&0===t[r-2]||(e[n]=t[r],n++);return new Uint8Array(e.buffer,0,n)}pushAccessUnit(t,e){super.pushAccessUnit(t,e),this.initVPS&&(this.initVPS=null)}readVPS(t){const e=new Ii(t);e.readUByte(),e.readUByte(),e.readBits(4),e.skipBits(2),e.readBits(6);return{numTemporalLayers:e.readBits(3)+1,temporalIdNested:e.readBoolean()}}readSPS(t){const e=new Ii(this.ebsp2rbsp(t));e.readUByte(),e.readUByte(),e.readBits(4);const n=e.readBits(3);e.readBoolean();const r=e.readBits(2),i=e.readBoolean(),s=e.readBits(5),A=e.readUByte(),a=e.readUByte(),o=e.readUByte(),l=e.readUByte(),u=e.readUByte(),c=e.readUByte(),h=e.readUByte(),d=e.readUByte(),f=e.readUByte(),p=e.readUByte(),g=e.readUByte(),m=[],_=[];for(let t=0;t<n;t++)m.push(e.readBoolean()),_.push(e.readBoolean());if(n>0)for(let t=n;t<8;t++)e.readBits(2);for(let t=0;t<n;t++)m[t]&&(e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte()),_[t]&&e.readUByte();e.readUEG();const w=e.readUEG();3==w&&e.skipBits(1);const y=e.readUEG(),v=e.readUEG(),B=e.readBoolean();let b=0,E=0,C=0,k=0;B&&(b+=e.readUEG(),E+=e.readUEG(),C+=e.readUEG(),k+=e.readUEG());const F=e.readUEG(),T=e.readUEG(),S=e.readUEG();for(let t=e.readBoolean()?0:n;t<=n;t++)e.skipUEG(),e.skipUEG(),e.skipUEG();e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG();if(e.readBoolean()){if(e.readBoolean())for(let t=0;t<4;t++)for(let n=0;n<(3===t?2:6);n++){if(e.readBoolean()){const n=Math.min(64,1<<4+(t<<1));t>1&&e.readEG();for(let t=0;t<n;t++)e.readEG()}else e.readUEG()}}e.readBoolean(),e.readBoolean();e.readBoolean()&&(e.readUByte(),e.skipUEG(),e.skipUEG(),e.readBoolean());const x=e.readUEG();let I=0;for(let t=0;t<x;t++){let n=!1;if(0!==t&&(n=e.readBoolean()),n){t===x&&e.readUEG(),e.readBoolean(),e.readUEG();let n=0;for(let t=0;t<=I;t++){const t=e.readBoolean();let r=!1;t||(r=e.readBoolean()),(t||r)&&n++}I=n}else{const t=e.readUEG(),n=e.readUEG();I=t+n;for(let n=0;n<t;n++)e.readUEG(),e.readBoolean();for(let t=0;t<n;t++)e.readUEG(),e.readBoolean()}}if(e.readBoolean()){const t=e.readUEG();for(let n=0;n<t;n++){for(let t=0;t<S+4;t++)e.readBits(1);e.readBits(1)}}let D=0,U=1,L=1,R=!0,Q=1,O=0;e.readBoolean(),e.readBoolean();let P=!1;if(e.readBoolean()){if(e.readBoolean()){const t=e.readUByte();t>0&&t<16?(U=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][t-1],L=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][t-1]):255===t&&(U=e.readBits(16),L=e.readBits(16))}e.readBoolean()&&e.readBoolean();if(e.readBoolean()){e.readBits(3),e.readBoolean();e.readBoolean()&&(e.readUByte(),e.readUByte(),e.readUByte())}e.readBoolean()&&(e.readUEG(),e.readUEG()),e.readBoolean(),e.readBoolean(),e.readBoolean(),P=e.readBoolean(),P&&(e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG());if(e.readBoolean()){Q=e.readBits(32),O=e.readBits(32);e.readBoolean()&&e.readUEG();if(e.readBoolean()){const t=e.readBoolean(),r=e.readBoolean();let i=!1;(t||r)&&(i=e.readBoolean(),i&&(e.readUByte(),e.readBits(5),e.readBoolean(),e.readBits(5)),e.readBits(4),e.readBits(4),i&&e.readBits(4),e.readBits(5),e.readBits(5),e.readBits(5));for(let s=0;s<=n;s++){R=e.readBoolean();let n=!1;R||e.readBoolean()?e.readEG():n=e.readBoolean();const s=n?1:e.readUEG()+1;if(t)for(let t=0;t<s;t++)e.readUEG(),e.readUEG(),i&&(e.readUEG(),e.readUEG()),e.skipBits(1);if(r)for(let t=0;t<s;t++)e.readUEG(),e.readUEG(),i&&(e.readUEG(),e.readUEG()),e.skipBits(1)}}}e.readBoolean()&&(e.readBoolean(),e.readBoolean(),e.readBoolean(),D=e.readUEG())}let M=y,N=v;if(B){let t=1,e=1;1===w?t=e=2:2==w&&(t=2),M=y-t*E-t*b,N=v-e*k-e*C}const H=r?["A","B","C"][r]:"",K=A<<24|a<<16|o<<8|l;let $=0;for(let t=0;t<32;t++)$=($|(K>>t&1)<<31-t)>>>0;let G=$.toString(16);1===s&&"2"===G&&(G="6");return{codecString:`hvc1.${H}${s}.${G}.${i?"H":"L"}${g}.B0`,params:{general_tier_flag:i,general_profile_idc:s,general_profile_space:r,general_profile_compatibility_flags:[A,a,o,l],general_constraint_indicator_flags:[u,c,h,d,f,p],general_level_idc:g,bit_depth:F+8,bit_depth_luma_minus8:F,bit_depth_chroma_minus8:T,min_spatial_segmentation_idc:D,chroma_format_idc:w,frame_rate:{fixed:R,fps:O/Q}},width:M,height:N,pixelRatio:[U,L]}}readPPS(t){const e=new Ii(this.ebsp2rbsp(t));e.readUByte(),e.readUByte(),e.skipUEG(),e.skipUEG(),e.skipBits(2),e.skipBits(3),e.skipBits(2),e.skipUEG(),e.skipUEG(),e.skipEG(),e.skipBits(2);e.readBoolean()&&e.skipUEG(),e.skipEG(),e.skipEG(),e.skipBits(4);const n=e.readBoolean(),r=e.readBoolean();let i=1;return r&&n?i=0:r?i=3:n&&(i=2),{parallelismType:i}}matchSPS(t,e){return String.fromCharCode.apply(null,t).substr(3)===String.fromCharCode.apply(null,e).substr(3)}}const Li=188;class Ri{constructor(t,e,n,r){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=t,this.config=e,this.typeSupported=n,this.logger=r,this.videoParser=null}static probe(t,e){const n=Ri.syncOffset(t);return n>0&&e.warn(`MPEG2-TS detected but first sync word found @ offset ${n}`),-1!==n}static syncOffset(t){const e=t.length;let n=Math.min(940,e-Li)+1,r=0;for(;r<n;){let i=!1,s=-1,A=0;for(let a=r;a<e;a+=Li){if(71!==t[a]||e-a!==Li&&71!==t[a+Li]){if(A)return-1;break}if(A++,-1===s&&(s=a,0!==s&&(n=Math.min(s+18612,t.length-Li)+1)),i||(i=0===Qi(t,a)),i&&A>1&&(0===s&&A>2||a+Li>n))return s}r++}return-1}static createTrack(t,e){return{container:"video"===t||"audio"===t?"video/mp2t":void 0,type:t,id:tt[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===t?e:void 0}}resetInitSegment(t,e,n,r){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Ri.createTrack("video"),this._videoTrack.duration=r,this._audioTrack=Ri.createTrack("audio",r),this._id3Track=Ri.createTrack("id3"),this._txtTrack=Ri.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=e,this.videoCodec=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:t,_videoTrack:e,_id3Track:n}=this;t&&(t.pesData=null),e&&(e.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(t,e,n=!1,r=!1){let i;n||(this.sampleAes=null);const s=this._videoTrack,A=this._audioTrack,a=this._id3Track,o=this._txtTrack;let l=s.pid,u=s.pesData,c=A.pid,h=a.pid,d=A.pesData,f=a.pesData,p=null,g=this.pmtParsed,m=this._pmtId,_=t.length;if(this.remainderData&&(_=(t=gt(this.remainderData,t)).length,this.remainderData=null),_<Li&&!r)return this.remainderData=t,{audioTrack:A,videoTrack:s,id3Track:a,textTrack:o};const w=Math.max(0,Ri.syncOffset(t));_-=(_-w)%Li,_<t.byteLength&&!r&&(this.remainderData=new Uint8Array(t.buffer,_,t.buffer.byteLength-_));let y=0;for(let e=w;e<_;e+=Li)if(71===t[e]){const r=!!(64&t[e+1]),_=Qi(t,e);let y;if((48&t[e+3])>>4>1){if(y=e+5+t[e+4],y===e+Li)continue}else y=e+4;switch(_){case l:r&&(u&&(i=Hi(u,this.logger))&&(this.readyVideoParser(s.segmentCodec),null!==this.videoParser&&this.videoParser.parsePES(s,o,i,!1)),u={data:[],size:0}),u&&(u.data.push(t.subarray(y,e+Li)),u.size+=e+Li-y);break;case c:if(r){if(d&&(i=Hi(d,this.logger)))switch(A.segmentCodec){case"aac":this.parseAACPES(A,i);break;case"mp3":this.parseMPEGPES(A,i);break;case"ac3":this.parseAC3PES(A,i)}d={data:[],size:0}}d&&(d.data.push(t.subarray(y,e+Li)),d.size+=e+Li-y);break;case h:r&&(f&&(i=Hi(f,this.logger))&&this.parseID3PES(a,i),f={data:[],size:0}),f&&(f.data.push(t.subarray(y,e+Li)),f.size+=e+Li-y);break;case 0:r&&(y+=t[y]+1),m=this._pmtId=Oi(t,y);break;case m:{r&&(y+=t[y]+1);const i=Pi(t,y,this.typeSupported,n,this.observer,this.logger);l=i.videoPid,l>0&&(s.pid=l,s.segmentCodec=i.segmentVideoCodec),c=i.audioPid,c>0&&(A.pid=c,A.segmentCodec=i.segmentAudioCodec),h=i.id3Pid,h>0&&(a.pid=h),null===p||g||(this.logger.warn(`MPEG-TS PMT found at ${e} after unknown PID '${p}'. Backtracking to sync byte @${w} to parse all TS packets.`),p=null,e=w-188),g=this.pmtParsed=!0;break}case 17:case 8191:break;default:p=_}}else y++;y>0&&Mi(this.observer,new Error(`Found ${y} TS packet/s that do not start with 0x47`),void 0,this.logger),s.pesData=u,A.pesData=d,a.pesData=f;const v={audioTrack:A,videoTrack:s,id3Track:a,textTrack:o};return r&&this.extractRemainingSamples(v),v}flush(){const{remainderData:t}=this;let e;return this.remainderData=null,e=t?this.demux(t,-1,!1,!0):{videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(e),this.sampleAes?this.decrypt(e,this.sampleAes):e}extractRemainingSamples(t){const{audioTrack:e,videoTrack:n,id3Track:r,textTrack:i}=t,s=n.pesData,A=e.pesData,a=r.pesData;let o;if(s&&(o=Hi(s,this.logger))?(this.readyVideoParser(n.segmentCodec),null!==this.videoParser&&(this.videoParser.parsePES(n,i,o,!0),n.pesData=null)):n.pesData=s,A&&(o=Hi(A,this.logger))){switch(e.segmentCodec){case"aac":this.parseAACPES(e,o);break;case"mp3":this.parseMPEGPES(e,o);break;case"ac3":this.parseAC3PES(e,o)}e.pesData=null}else null!=A&&A.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),e.pesData=A;a&&(o=Hi(a,this.logger))?(this.parseID3PES(r,o),r.pesData=null):r.pesData=a}demuxSampleAes(t,e,n){const r=this.demux(t,n,!0,!this.config.progressive),i=this.sampleAes=new Si(this.observer,this.config,e);return this.decrypt(r,i)}readyVideoParser(t){null===this.videoParser&&("avc"===t?this.videoParser=new Di:"hevc"===t&&(this.videoParser=new Ui))}decrypt(t,e){return new Promise((n=>{const{audioTrack:r,videoTrack:i}=t;r.samples&&"aac"===r.segmentCodec?e.decryptAacSamples(r.samples,0,(()=>{i.samples?e.decryptAvcSamples(i.samples,0,0,(()=>{n(t)})):n(t)})):i.samples&&e.decryptAvcSamples(i.samples,0,0,(()=>{n(t)}))}))}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(t,e){let n=0;const r=this.aacOverFlow;let i,s,A,a=e.data;if(r){this.aacOverFlow=null;const e=r.missing,i=r.sample.unit.byteLength;if(-1===e)a=gt(r.sample.unit,a);else{const s=i-e;r.sample.unit.set(a.subarray(0,e),s),t.samples.push(r.sample),n=r.missing}}for(i=n,s=a.length;i<s-1&&!Yr(a,i);i++);if(i!==n){let t;const e=i<s-1;if(t=e?`AAC PES did not start with ADTS header,offset:${i}`:"No ADTS header found in AAC PES",Mi(this.observer,new Error(t),e,this.logger),!e)return}if(qr(t,this.observer,a,i,this.audioCodec),void 0!==e.pts)A=e.pts;else{if(!r)return void this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");{const e=Jr(t.samplerate);A=r.sample.pts+e}}let o,l=0;for(;i<s;){if(o=ti(t,a,i,A,l),i+=o.length,o.missing){this.aacOverFlow=o;break}for(l++;i<s-1&&!Yr(a,i);i++);}}parseMPEGPES(t,e){const n=e.data,r=n.length;let i=0,s=0;const A=e.pts;if(void 0!==A)for(;s<r;)if(Bi(n,s)){const e=wi(t,n,s,A,i);if(!e)break;s+=e.length,i++}else s++;else this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS")}parseAC3PES(t,e){{const n=e.data,r=e.pts;if(void 0===r)return void this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");const i=n.length;let s,A=0,a=0;for(;a<i&&(s=ki(t,n,a,r,A++))>0;)a+=s}}parseID3PES(t,e){if(void 0===e.pts)return void this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");const n=w({},e,{type:this._videoTrack?ui.emsg:ui.audioId3,duration:Number.POSITIVE_INFINITY});t.samples.push(n)}}function Qi(t,e){return((31&t[e+1])<<8)+t[e+2]}function Oi(t,e){return(31&t[e+10])<<8|t[e+11]}function Pi(t,e,n,r,i,s){const A={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},a=e+3+((15&t[e+1])<<8|t[e+2])-4;for(e+=12+((15&t[e+10])<<8|t[e+11]);e<a;){const a=Qi(t,e),o=(15&t[e+3])<<8|t[e+4];switch(t[e]){case 207:if(!r){Ni("ADTS AAC",s);break}case 15:-1===A.audioPid&&(A.audioPid=a);break;case 21:-1===A.id3Pid&&(A.id3Pid=a);break;case 219:if(!r){Ni("H.264",s);break}case 27:-1===A.videoPid&&(A.videoPid=a);break;case 3:case 4:n.mpeg||n.mp3?-1===A.audioPid&&(A.audioPid=a,A.segmentAudioCodec="mp3"):s.log("MPEG audio found, not supported in this browser");break;case 193:if(!r){Ni("AC-3",s);break}case 129:n.ac3?-1===A.audioPid&&(A.audioPid=a,A.segmentAudioCodec="ac3"):s.log("AC-3 audio found, not supported in this browser");break;case 6:if(-1===A.audioPid&&o>0){let r=e+5,i=o;for(;i>2;){if(106===t[r])!0!==n.ac3?s.log("AC-3 audio found, not supported in this browser for now"):(A.audioPid=a,A.segmentAudioCodec="ac3");const e=t[r+1]+2;r+=e,i-=e}}break;case 194:case 135:return Mi(i,new Error("Unsupported EC-3 in M2TS found"),void 0,s),A;case 36:-1===A.videoPid&&(A.videoPid=a,A.segmentVideoCodec="hevc",s.log("HEVC in M2TS found"))}e+=o+5}return A}function Mi(t,e,n,r){r.warn(`parsing error: ${e.message}`),t.emit(o.ERROR,o.ERROR,{type:A.MEDIA_ERROR,details:a.FRAG_PARSING_ERROR,fatal:!1,levelRetry:n,error:e,reason:e.message})}function Ni(t,e){e.log(`${t} with AES-128-CBC encryption found in unencrypted stream`)}function Hi(t,e){let n,r,i,s,A,a=0;const o=t.data;if(!t||0===t.size)return null;for(;o[0].length<19&&o.length>1;)o[0]=gt(o[0],o[1]),o.splice(1,1);n=o[0];if(1===(n[0]<<16)+(n[1]<<8)+n[2]){if(r=(n[4]<<8)+n[5],r&&r>t.size-6)return null;const l=n[7];192&l&&(s=536870912*(14&n[9])+4194304*(255&n[10])+16384*(254&n[11])+128*(255&n[12])+(254&n[13])/2,64&l?(A=536870912*(14&n[14])+4194304*(255&n[15])+16384*(254&n[16])+128*(255&n[17])+(254&n[18])/2,s-A>54e5&&(e.warn(`${Math.round((s-A)/9e4)}s delta between PTS and DTS, align them`),s=A)):A=s),i=n[8];let u=i+9;if(t.size<=u)return null;t.size-=u;const c=new Uint8Array(t.size);for(let t=0,e=o.length;t<e;t++){n=o[t];let e=n.byteLength;if(u){if(u>e){u-=e;continue}n=n.subarray(u),e-=u,u=0}c.set(n,a),a+=e}return r&&(r-=i+3),{data:c,pts:s,dts:A,len:r}}return null}class Ki{static getSilentFrame(t,e){if("mp4a.40.2"===t){if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)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(6===e)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(1===e)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(2===e)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(3===e)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])}}}const $i=Math.pow(2,32)-1;class Gi{static init(){let t;for(t in Gi.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:[]},Gi.types)Gi.types.hasOwnProperty(t)&&(Gi.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);const e=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]);Gi.HDLR_TYPES={video:e,audio:n};const r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i=new Uint8Array([0,0,0,0,0,0,0,0]);Gi.STTS=Gi.STSC=Gi.STCO=i,Gi.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Gi.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Gi.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Gi.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),A=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);Gi.FTYP=Gi.box(Gi.types.ftyp,s,a,s,A),Gi.DINF=Gi.box(Gi.types.dinf,Gi.box(Gi.types.dref,r))}static box(t,...e){let n=8,r=e.length;const i=r;for(;r--;)n+=e[r].byteLength;const s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=255&n,s.set(t,4),r=0,n=8;r<i;r++)s.set(e[r],n),n+=e[r].byteLength;return s}static hdlr(t){return Gi.box(Gi.types.hdlr,Gi.HDLR_TYPES[t])}static mdat(t){return Gi.box(Gi.types.mdat,t)}static mdhd(t,e){e*=t;const n=Math.floor(e/($i+1)),r=Math.floor(e%($i+1));return Gi.box(Gi.types.mdhd,new Uint8Array([1,0,0,0,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,255&t,n>>24,n>>16&255,n>>8&255,255&n,r>>24,r>>16&255,r>>8&255,255&r,85,196,0,0]))}static mdia(t){return Gi.box(Gi.types.mdia,Gi.mdhd(t.timescale||0,t.duration||0),Gi.hdlr(t.type),Gi.minf(t))}static mfhd(t){return Gi.box(Gi.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}static minf(t){return"audio"===t.type?Gi.box(Gi.types.minf,Gi.box(Gi.types.smhd,Gi.SMHD),Gi.DINF,Gi.stbl(t)):Gi.box(Gi.types.minf,Gi.box(Gi.types.vmhd,Gi.VMHD),Gi.DINF,Gi.stbl(t))}static moof(t,e,n){return Gi.box(Gi.types.moof,Gi.mfhd(t),Gi.traf(n,e))}static moov(t){let e=t.length;const n=[];for(;e--;)n[e]=Gi.trak(t[e]);return Gi.box.apply(null,[Gi.types.moov,Gi.mvhd(t[0].timescale||0,t[0].duration||0)].concat(n).concat(Gi.mvex(t)))}static mvex(t){let e=t.length;const n=[];for(;e--;)n[e]=Gi.trex(t[e]);return Gi.box.apply(null,[Gi.types.mvex,...n])}static mvhd(t,e){e*=t;const n=Math.floor(e/($i+1)),r=Math.floor(e%($i+1)),i=new Uint8Array([1,0,0,0,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,255&t,n>>24,n>>16&255,n>>8&255,255&n,r>>24,r>>16&255,r>>8&255,255&r,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 Gi.box(Gi.types.mvhd,i)}static sdtp(t){const e=t.samples||[],n=new Uint8Array(4+e.length);let r,i;for(r=0;r<e.length;r++)i=e[r].flags,n[r+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return Gi.box(Gi.types.sdtp,n)}static stbl(t){return Gi.box(Gi.types.stbl,Gi.stsd(t),Gi.box(Gi.types.stts,Gi.STTS),Gi.box(Gi.types.stsc,Gi.STSC),Gi.box(Gi.types.stsz,Gi.STSZ),Gi.box(Gi.types.stco,Gi.STCO))}static avc1(t){let e,n,r,i=[],s=[];for(e=0;e<t.sps.length;e++)n=t.sps[e],r=n.byteLength,i.push(r>>>8&255),i.push(255&r),i=i.concat(Array.prototype.slice.call(n));for(e=0;e<t.pps.length;e++)n=t.pps[e],r=n.byteLength,s.push(r>>>8&255),s.push(255&r),s=s.concat(Array.prototype.slice.call(n));const A=Gi.box(Gi.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|t.sps.length].concat(i).concat([t.pps.length]).concat(s))),a=t.width,o=t.height,l=t.pixelRatio[0],u=t.pixelRatio[1];return Gi.box(Gi.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,a>>8&255,255&a,o>>8&255,255&o,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]),A,Gi.box(Gi.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Gi.box(Gi.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,255&l,u>>24,u>>16&255,u>>8&255,255&u])))}static esds(t){const e=t.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,...e,6,1,2])}static audioStsd(t){const e=t.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount||0,0,16,0,0,0,0,e>>8&255,255&e,0,0])}static mp4a(t){return Gi.box(Gi.types.mp4a,Gi.audioStsd(t),Gi.box(Gi.types.esds,Gi.esds(t)))}static mp3(t){return Gi.box(Gi.types[".mp3"],Gi.audioStsd(t))}static ac3(t){return Gi.box(Gi.types["ac-3"],Gi.audioStsd(t),Gi.box(Gi.types.dac3,t.config))}static stsd(t){const{segmentCodec:e}=t;if("audio"===t.type){if("aac"===e)return Gi.box(Gi.types.stsd,Gi.STSD,Gi.mp4a(t));if("ac3"===e&&t.config)return Gi.box(Gi.types.stsd,Gi.STSD,Gi.ac3(t));if("mp3"===e&&"mp3"===t.codec)return Gi.box(Gi.types.stsd,Gi.STSD,Gi.mp3(t))}else{if(!t.pps||!t.sps)throw new Error("video track missing pps or sps");if("avc"===e)return Gi.box(Gi.types.stsd,Gi.STSD,Gi.avc1(t));if("hevc"===e&&t.vps)return Gi.box(Gi.types.stsd,Gi.STSD,Gi.hvc1(t))}throw new Error(`unsupported ${t.type} segment codec (${e}/${t.codec})`)}static tkhd(t){const e=t.id,n=(t.duration||0)*(t.timescale||0),r=t.width||0,i=t.height||0,s=Math.floor(n/($i+1)),A=Math.floor(n%($i+1));return Gi.box(Gi.types.tkhd,new Uint8Array([1,0,0,7,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,255&e,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,A>>24,A>>16&255,A>>8&255,255&A,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>8&255,255&r,0,0,i>>8&255,255&i,0,0]))}static traf(t,e){const n=Gi.sdtp(t),r=t.id,i=Math.floor(e/($i+1)),s=Math.floor(e%($i+1));return Gi.box(Gi.types.traf,Gi.box(Gi.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r])),Gi.box(Gi.types.tfdt,new Uint8Array([1,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,s>>24,s>>16&255,s>>8&255,255&s])),Gi.trun(t,n.length+16+20+8+16+8+8),n)}static trak(t){return t.duration=t.duration||4294967295,Gi.box(Gi.types.trak,Gi.tkhd(t),Gi.mdia(t))}static trex(t){const e=t.id;return Gi.box(Gi.types.trex,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(t,e){const n=t.samples||[],r=n.length,i=12+16*r,s=new Uint8Array(i);let A,a,o,l,u,c;for(e+=8+i,s.set(["video"===t.type?1:0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,255&r,e>>>24&255,e>>>16&255,e>>>8&255,255&e],0),A=0;A<r;A++)a=n[A],o=a.duration,l=a.size,u=a.flags,c=a.cts,s.set([o>>>24&255,o>>>16&255,o>>>8&255,255&o,l>>>24&255,l>>>16&255,l>>>8&255,255&l,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,61440&u.degradPrio,15&u.degradPrio,c>>>24&255,c>>>16&255,c>>>8&255,255&c],12+16*A);return Gi.box(Gi.types.trun,s)}static initSegment(t){Gi.types||Gi.init();const e=Gi.moov(t);return gt(Gi.FTYP,e)}static hvc1(t){const e=t.params,n=[t.vps,t.sps,t.pps],r=new Uint8Array([1,e.general_profile_space<<6|(e.general_tier_flag?32:0)|e.general_profile_idc,e.general_profile_compatibility_flags[0],e.general_profile_compatibility_flags[1],e.general_profile_compatibility_flags[2],e.general_profile_compatibility_flags[3],e.general_constraint_indicator_flags[0],e.general_constraint_indicator_flags[1],e.general_constraint_indicator_flags[2],e.general_constraint_indicator_flags[3],e.general_constraint_indicator_flags[4],e.general_constraint_indicator_flags[5],e.general_level_idc,240|e.min_spatial_segmentation_idc>>8,255&e.min_spatial_segmentation_idc,252|e.parallelismType,252|e.chroma_format_idc,248|e.bit_depth_luma_minus8,248|e.bit_depth_chroma_minus8,0,parseInt(e.frame_rate.fps),3|e.temporal_id_nested<<2|e.num_temporal_layers<<3|(e.frame_rate.fixed?64:0),n.length]);let i=r.length;for(let t=0;t<n.length;t+=1){i+=3;for(let e=0;e<n[t].length;e+=1)i+=2+n[t][e].length}const s=new Uint8Array(i);s.set(r,0),i=r.length;const A=n.length-1;for(let t=0;t<n.length;t+=1){s.set(new Uint8Array([32+t|(t===A?128:0),0,n[t].length]),i),i+=3;for(let e=0;e<n[t].length;e+=1)s.set(new Uint8Array([n[t][e].length>>8,255&n[t][e].length]),i),i+=2,s.set(n[t][e],i),i+=n[t][e].length}const a=Gi.box(Gi.types.hvcC,s),o=t.width,l=t.height,u=t.pixelRatio[0],c=t.pixelRatio[1];return Gi.box(Gi.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,o>>8&255,255&o,l>>8&255,255&l,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]),a,Gi.box(Gi.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Gi.box(Gi.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,c>>24,c>>16&255,c>>8&255,255&c])))}}Gi.types=void 0,Gi.HDLR_TYPES=void 0,Gi.STTS=void 0,Gi.STSC=void 0,Gi.STCO=void 0,Gi.STSZ=void 0,Gi.VMHD=void 0,Gi.SMHD=void 0,Gi.STSD=void 0,Gi.FTYP=void 0,Gi.DINF=void 0;function Vi(t,e,n=1,r=!1){const i=t*e*n;return r?Math.round(i):i}function ji(t,e=!1){return Vi(t,1e3,1/9e4,e)}function Zi(t){const{baseTime:e,timescale:n,trackId:r}=t;return`${e/n} (${e}/${n}) trackId: ${r}`}let Wi,zi=null,Yi=null;function Xi(t,e,n,r){return{duration:e,size:n,cts:r,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:t?2:1,isNonSync:t?0:1}}}class qi extends B{constructor(t,e,n,r){if(super("mp4-remuxer",r),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=t,this.config=e,this.typeSupported=n,this.ISGenerated=!1,null===zi){const t=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);zi=t?parseInt(t[1]):0}if(null===Yi){const t=navigator.userAgent.match(/Safari\/(\d+)/i);Yi=t?parseInt(t[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(t){const e=this._initPTS;e&&t&&t.trackId===e.trackId&&t.baseTime===e.baseTime&&t.timescale===e.timescale||this.log(`Reset initPTS: ${e?Zi(e):e} > ${t?Zi(t):t}`),this._initPTS=this._initDTS=t}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(t){let e=!1;const n=t[0].pts,r=t.reduce(((t,r)=>{let i=r.pts,s=i-t;return s<-4294967296&&(e=!0,i=Ji(i,n),s=i-t),s>0?t:i}),n);return e&&this.debug("PTS rollover detected"),r}remux(t,e,n,r,i,s,A,a){let o,l,u,c,h,d,p=i,g=i;const m=t.pid>-1,_=e.pid>-1,w=e.samples.length,y=t.samples.length>0,v=A&&w>0||w>1;if((!m||y)&&(!_||v)||this.ISGenerated||A){if(this.ISGenerated){var B,b,E,C;const t=this.videoTrackConfig;(t&&(e.width!==t.width||e.height!==t.height||(null==(B=e.pixelRatio)?void 0:B[0])!==(null==(b=t.pixelRatio)?void 0:b[0])||(null==(E=e.pixelRatio)?void 0:E[1])!==(null==(C=t.pixelRatio)?void 0:C[1]))||!t&&v||null===this.nextAudioTs&&y)&&this.resetInitSegment()}this.ISGenerated||(u=this.generateIS(t,e,i,s));const n=this.isVideoContiguous;let r,A=-1;if(v&&(A=function(t){for(let e=0;e<t.length;e++)if(t[e].key)return e;return-1}(e.samples),!n&&this.config.forceKeyFrameOnDiscontinuity))if(d=!0,A>0){this.warn(`Dropped ${A} out of ${w} video samples due to a missing keyframe`);const t=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(A),e.dropped+=A,g+=(e.samples[0].pts-t)/e.inputTimeScale,r=g}else-1===A&&(this.warn(`No keyframe found out of ${w} video samples`),d=!1);if(this.ISGenerated){if(y&&v){const n=this.getVideoStartPts(e.samples),r=(Ji(t.samples[0].pts,n)-n)/e.inputTimeScale;p+=Math.max(0,r),g+=Math.max(0,-r)}if(y){if(t.samplerate||(this.warn("regenerate InitSegment as audio detected"),u=this.generateIS(t,e,i,s)),l=this.remuxAudio(t,p,this.isAudioContiguous,s,_||v||a===f?g:void 0),v){const r=l?l.endPTS-l.startPTS:0;e.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),u=this.generateIS(t,e,i,s)),o=this.remuxVideo(e,g,n,r)}}else v&&(o=this.remuxVideo(e,g,n,0));o&&(o.firstKeyFrame=A,o.independent=-1!==A,o.firstKeyFramePTS=r)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(h=ts(n,i,this._initPTS,this._initDTS)),r.samples.length&&(c=es(r,i,this._initPTS))),{audio:l,video:o,initSegment:u,independent:d,text:c,id3:h}}computeInitPts(t,e,n,r){const i=Math.round(n*e);let s=Ji(t,i);if(s<i+e)for(this.log(`Adjusting PTS for rollover in timeline near ${(i-s)/e} ${r}`);s<i+e;)s+=8589934592;return s-i}generateIS(t,e,n,r){const i=t.samples,s=e.samples,A=this.typeSupported,a={},o=this._initPTS;let l,u,c,h=!o||r,d="audio/mp4",f=-1;if(h&&(l=u=1/0),t.config&&i.length){switch(t.timescale=t.samplerate,t.segmentCodec){case"mp3":A.mpeg?(d="audio/mpeg",t.codec=""):A.mp3&&(t.codec="mp3");break;case"ac3":t.codec="ac-3"}a.audio={id:"audio",container:d,codec:t.codec,initSegment:"mp3"===t.segmentCodec&&A.mpeg?new Uint8Array(0):Gi.initSegment([t]),metadata:{channelCount:t.channelCount}},h&&(f=t.id,c=t.inputTimeScale,o&&c===o.timescale?h=!1:l=u=this.computeInitPts(i[0].pts,c,n,"audio"))}if(e.sps&&e.pps&&s.length){if(e.timescale=e.inputTimeScale,a.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:Gi.initSegment([e]),metadata:{width:e.width,height:e.height}},h)if(f=e.id,c=e.inputTimeScale,o&&c===o.timescale)h=!1;else{const t=this.getVideoStartPts(s),e=Ji(s[0].dts,t),r=this.computeInitPts(e,c,n,"video"),i=this.computeInitPts(t,c,n,"video");u=Math.min(u,r),l=Math.min(l,i)}this.videoTrackConfig={width:e.width,height:e.height,pixelRatio:e.pixelRatio}}if(Object.keys(a).length)return this.ISGenerated=!0,h?(o&&this.warn(`Timestamps at playlist time: ${r?"":"~"}${n} ${l/c} != initPTS: ${o.baseTime/o.timescale} (${o.baseTime}/${o.timescale}) trackId: ${o.trackId}`),this.log(`Found initPTS at playlist time: ${n} offset: ${l/c} (${l}/${c}) trackId: ${f}`),this._initPTS={baseTime:l,timescale:c,trackId:f},this._initDTS={baseTime:u,timescale:c,trackId:f}):l=c=void 0,{tracks:a,initPTS:l,timescale:c,trackId:f}}remuxVideo(t,e,n,r){const i=t.inputTimeScale,s=t.samples,l=[],u=s.length,c=this._initPTS,h=c.baseTime*i/c.timescale;let d,f,p=this.nextVideoTs,g=8,m=this.videoSampleDuration,_=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,v=!1;if(!n||null===p){const t=h+e*i,r=s[0].pts-Ji(s[0].dts,s[0].pts);zi&&null!==p&&Math.abs(t-r-(p+h))<15e3?n=!0:p=t-r-h}const B=p+h;for(let t=0;t<u;t++){const e=s[t];e.pts=Ji(e.pts,B),e.dts=Ji(e.dts,B),e.dts<s[t>0?t-1:t].dts&&(v=!0)}v&&s.sort((function(t,e){const n=t.dts-e.dts,r=t.pts-e.pts;return n||r})),d=s[0].dts,f=s[s.length-1].dts;const b=f-d,E=b?Math.round(b/(u-1)):m||t.inputTimeScale/30;if(n){const n=d-B,r=n>E,i=n<-1;if((r||i)&&(r?this.warn(`${(t.segmentCodec||"").toUpperCase()}: ${ji(n,!0)} ms (${n}dts) hole between fragments detected at ${e.toFixed(3)}`):this.warn(`${(t.segmentCodec||"").toUpperCase()}: ${ji(-n,!0)} ms (${n}dts) overlapping between fragments detected at ${e.toFixed(3)}`),!i||B>=s[0].pts||zi)){d=B;const t=s[0].pts-n;if(r)s[0].dts=d,s[0].pts=t;else{let e=!0;for(let r=0;r<s.length&&!(s[r].dts>t&&e);r++){const t=s[r].pts;if(s[r].dts-=n,s[r].pts-=n,r<s.length-1){const n=s[r+1].pts;e=n<=s[r].pts==n<=t}}}this.log(`Video: Initial PTS/DTS adjusted: ${ji(t,!0)}/${ji(d,!0)}, delta: ${ji(n,!0)} ms`)}}d=Math.max(0,d);let C=0,k=0,F=d;for(let t=0;t<u;t++){const e=s[t],n=e.units,r=n.length;let i=0;for(let t=0;t<r;t++)i+=n[t].data.length;k+=i,C+=r,e.length=i,e.dts<F?(e.dts=F,F+=E/4|0||1):F=e.dts,_=Math.min(e.pts,_),y=Math.max(e.pts,y)}f=s[u-1].dts;const T=k+4*C+8;let S;try{S=new Uint8Array(T)}catch(t){return void this.observer.emit(o.ERROR,o.ERROR,{type:A.MUX_ERROR,details:a.REMUX_ALLOC_ERROR,fatal:!1,error:t,bytes:T,reason:`fail allocating video mdat ${T}`})}const x=new DataView(S.buffer);x.setUint32(0,T),S.set(Gi.types.mdat,4);let I=!1,D=Number.POSITIVE_INFINITY,U=Number.POSITIVE_INFINITY,L=Number.NEGATIVE_INFINITY,R=Number.NEGATIVE_INFINITY;for(let t=0;t<u;t++){const e=s[t],n=e.units;let A,a=0;for(let t=0,e=n.length;t<e;t++){const e=n[t],r=e.data,i=e.data.byteLength;x.setUint32(g,i),g+=4,S.set(r,g),g+=i,a+=4+i}if(t<u-1)m=s[t+1].dts-e.dts,A=s[t+1].pts-e.pts;else{const n=this.config,a=t>0?e.dts-s[t-1].dts:E;if(A=t>0?e.pts-s[t-1].pts:E,n.stretchShortVideoTrack&&null!==this.nextAudioTs){const t=Math.floor(n.maxBufferHole*i),s=(r?_+r*i:this.nextAudioTs+h)-e.pts;s>t?(m=s-a,m<0?m=a:I=!0,this.log(`It is approximately ${s/90} ms to the next segment; using duration ${m/90} ms for the last video frame.`)):m=a}else m=a}const o=Math.round(e.pts-e.dts);D=Math.min(D,m),L=Math.max(L,m),U=Math.min(U,A),R=Math.max(R,A),l.push(Xi(e.key,m,a,o))}if(l.length)if(zi){if(zi<70){const t=l[0].flags;t.dependsOn=2,t.isNonSync=0}}else if(Yi&&R-U<L-D&&E/L<.025&&0===l[0].cts){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let t=d;for(let e=0,n=l.length;e<n;e++){const r=t+l[e].duration,i=t+l[e].cts;if(e<n-1){const t=r+l[e+1].cts;l[e].duration=t-i}else l[e].duration=e?l[e-1].duration:E;l[e].cts=0,t=r}}m=I||!m?E:m;const Q=f+m;this.nextVideoTs=p=Q-h,this.videoSampleDuration=m,this.isVideoContiguous=!0;const O={data1:Gi.moof(t.sequenceNumber++,d,w(t,{samples:l})),data2:S,startPTS:(_-h)/i,endPTS:(y+m-h)/i,startDTS:(d-h)/i,endDTS:p/i,type:"video",hasAudio:!1,hasVideo:!0,nb:l.length,dropped:t.dropped};return t.samples=[],t.dropped=0,O}getSamplesPerFrame(t){switch(t.segmentCodec){case"mp3":return 1152;case"ac3":return 1536;default:return 1024}}remuxAudio(t,e,n,r,i){const s=t.inputTimeScale,l=s/(t.samplerate?t.samplerate:s),u=this.getSamplesPerFrame(t),c=u*l,h=this._initPTS,d="mp3"===t.segmentCodec&&this.typeSupported.mpeg,f=[],p=void 0!==i;let g=t.samples,m=d?0:8,_=this.nextAudioTs||-1;const y=h.baseTime*s/h.timescale,v=y+e*s;if(this.isAudioContiguous=n=n||g.length&&_>0&&(r&&Math.abs(v-(_+y))<9e3||Math.abs(Ji(g[0].pts,v)-(_+y))<20*c),g.forEach((function(t){t.pts=Ji(t.pts,v)})),!n||_<0){const t=g.length;if(g=g.filter((t=>t.pts>=0)),t!==g.length&&this.warn(`Removed ${g.length-t} of ${t} samples (initPTS ${y} / ${s})`),!g.length)return;_=0===i?0:r&&!p?Math.max(0,v-y):g[0].pts-y}if("aac"===t.segmentCodec){const e=this.config.maxAudioFramesDrift;for(let n=0,r=_+y;n<g.length;n++){const i=g[n],A=i.pts,a=A-r,o=Math.abs(1e3*a/s);if(a<=-e*c&&p)0===n&&(this.warn(`Audio frame @ ${(A/s).toFixed(3)}s overlaps marker by ${Math.round(1e3*a/s)} ms.`),this.nextAudioTs=_=A-y,r=A);else if(a>=e*c&&o<1e4&&p){let e=Math.round(a/c);for(r=A-e*c;r<0&&e&&c;)e--,r+=c;0===n&&(this.nextAudioTs=_=r-y),this.warn(`Injecting ${e} audio frames @ ${((r-y)/s).toFixed(3)}s due to ${Math.round(1e3*a/s)} ms gap.`);for(let s=0;s<e;s++){let e=Ki.getSilentFrame(t.parsedCodec||t.manifestCodec||t.codec,t.channelCount);e||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),e=i.unit.subarray()),g.splice(n,0,{unit:e,pts:r}),r+=c,n++}}i.pts=r,r+=c}}let B,b=null,E=null,C=0,k=g.length;for(;k--;)C+=g[k].unit.byteLength;for(let e=0,r=g.length;e<r;e++){const r=g[e],i=r.unit;let s=r.pts;if(null!==E){f[e-1].duration=Math.round((s-E)/l)}else{if(n&&"aac"===t.segmentCodec&&(s=_+y),b=s,!(C>0))return;C+=m;try{B=new Uint8Array(C)}catch(t){return void this.observer.emit(o.ERROR,o.ERROR,{type:A.MUX_ERROR,details:a.REMUX_ALLOC_ERROR,fatal:!1,error:t,bytes:C,reason:`fail allocating audio mdat ${C}`})}if(!d){new DataView(B.buffer).setUint32(0,C),B.set(Gi.types.mdat,4)}}B.set(i,m);const c=i.byteLength;m+=c,f.push(Xi(!0,u,c,0)),E=s}const F=f.length;if(!F)return;const T=f[f.length-1];_=E-y,this.nextAudioTs=_+l*T.duration;const S=d?new Uint8Array(0):Gi.moof(t.sequenceNumber++,b/l,w({},t,{samples:f}));t.samples=[];const x=(b-y)/s,I=_/s,D={data1:S,data2:B,startPTS:x,endPTS:I,startDTS:x,endDTS:I,type:"audio",hasAudio:!0,hasVideo:!1,nb:F};return this.isAudioContiguous=!0,D}}function Ji(t,e){let n;if(null===e)return t;for(n=e<t?-8589934592:8589934592;Math.abs(t-e)>4294967296;)t+=n;return t}function ts(t,e,n,r){const i=t.samples.length;if(!i)return;const s=t.inputTimeScale;for(let A=0;A<i;A++){const i=t.samples[A];i.pts=Ji(i.pts-n.baseTime*s/n.timescale,e*s)/s,i.dts=Ji(i.dts-r.baseTime*s/r.timescale,e*s)/s}const A=t.samples;return t.samples=[],{samples:A}}function es(t,e,n){const r=t.samples.length;if(!r)return;const i=t.inputTimeScale;for(let s=0;s<r;s++){const r=t.samples[s];r.pts=Ji(r.pts-n.baseTime*i/n.timescale,e*i)/i}t.samples.sort(((t,e)=>t.pts-e.pts));const s=t.samples;return t.samples=[],{samples:s}}function ns(t,e,n=!1){return void 0!==(null==t?void 0:t.start)?(t.start+(n?t.duration:0))/t.timescale:e}function rs(t,e,n){const r=t.codec;if(r&&r.length>4)return r;if(e===G){if("ec-3"===r||"ac-3"===r||"alac"===r)return r;if("fLaC"===r||"Opus"===r){return Lt(r,!1)}return n.warn(`Unhandled audio codec "${r}" in mp4 MAP`),r||"mp4a"}return n.warn(`Unhandled video codec "${r}" in mp4 MAP`),r||"avc1"}try{Wi=self.performance.now.bind(self.performance)}catch(t){Wi=Date.now}const is=[{demux:class{constructor(t,e){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=e}resetTimeStamp(){}resetInitSegment(t,e,n,r){const i=this.videoTrack=ci("video",1),s=this.audioTrack=ci("audio",1),A=this.txtTrack=ci("text",1);if(this.id3Track=ci("id3",1),this.timeOffset=0,null==t||!t.byteLength)return;const a=ot(t);if(a.video){const{id:t,timescale:e,codec:n,supplemental:r}=a.video;i.id=t,i.timescale=A.timescale=e,i.codec=n,i.supplemental=r}if(a.audio){const{id:t,timescale:e,codec:n}=a.audio;s.id=t,s.timescale=e,s.codec=n}A.id=tt.text,i.sampleDuration=0,i.duration=s.duration=r}resetContiguity(){this.remainderData=null}static probe(t){return function(t){const e=t.byteLength;for(let n=0;n<e;){const r=rt(t,n);if(r>8&&109===t[n+4]&&111===t[n+5]&&111===t[n+6]&&102===t[n+7])return!0;n=r>1?n+r:e}return!1}(t)}demux(t,e){this.timeOffset=e;let n=t;const r=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=gt(this.remainderData,t));const e=function(t){const e={valid:null,remainder:null},n=At(t,["moof"]);if(n.length<2)return e.remainder=t,e;const r=n[n.length-1];return e.valid=t.slice(0,r.byteOffset-8),e.remainder=t.slice(r.byteOffset-8),e}(n);this.remainderData=e.remainder,r.samples=e.valid||new Uint8Array}else r.samples=n;const s=this.extractID3Track(r,e);return i.samples=mt(e,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const t=this.timeOffset,e=this.videoTrack,n=this.txtTrack;e.samples=this.remainderData||new Uint8Array,this.remainderData=null;const r=this.extractID3Track(e,this.timeOffset);return n.samples=mt(t,e),{videoTrack:e,audioTrack:ci(),id3Track:r,textTrack:ci()}}extractID3Track(t,e){const n=this.id3Track;if(t.samples.length){const r=At(t.samples,["emsg"]);r&&r.forEach((t=>{const r=function(t){const e=t[0];let n="",r="",s=0,A=0,a=0,o=0,l=0,u=0;if(0===e){for(;"\0"!==et(t.subarray(u,u+1));)n+=et(t.subarray(u,u+1)),u+=1;for(n+=et(t.subarray(u,u+1)),u+=1;"\0"!==et(t.subarray(u,u+1));)r+=et(t.subarray(u,u+1)),u+=1;r+=et(t.subarray(u,u+1)),u+=1,s=rt(t,12),A=rt(t,16),o=rt(t,20),l=rt(t,24),u=28}else if(1===e){u+=4,s=rt(t,u),u+=4;const e=rt(t,u);u+=4;const A=rt(t,u);for(u+=4,a=2**32*e+A,i(a)||(a=Number.MAX_SAFE_INTEGER,T.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=rt(t,u),u+=4,l=rt(t,u),u+=4;"\0"!==et(t.subarray(u,u+1));)n+=et(t.subarray(u,u+1)),u+=1;for(n+=et(t.subarray(u,u+1)),u+=1;"\0"!==et(t.subarray(u,u+1));)r+=et(t.subarray(u,u+1)),u+=1;r+=et(t.subarray(u,u+1)),u+=1}return{schemeIdUri:n,value:r,timeScale:s,presentationTime:a,presentationTimeDelta:A,eventDuration:o,id:l,payload:t.subarray(u,t.byteLength)}}(t);if(Fi.test(r.schemeIdUri)){const t=Ti(r,e);let i=4294967295===r.eventDuration?Number.POSITIVE_INFINITY:r.eventDuration/r.timeScale;i<=.001&&(i=Number.POSITIVE_INFINITY);const s=r.payload;n.samples.push({data:s,len:s.byteLength,dts:t,pts:t,type:ui.emsg,duration:i})}else if(this.config.enableEmsgKLVMetadata&&r.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const t=Ti(r,e);n.samples.push({data:r.payload,len:r.payload.byteLength,dts:t,pts:t,type:ui.misbklv,duration:Number.POSITIVE_INFINITY})}}))}return n}demuxSampleAes(t,e,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}},remux:class extends B{constructor(t,e,n,r){super("passthrough-remuxer",r),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(t){this.lastEndTime=null;const e=this.initPTS;e&&t&&e.baseTime===t.baseTime&&e.timescale===t.timescale||(this.initPTS=t)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(t,e,n,r){this.audioCodec=e,this.videoCodec=n,this.generateInitSegment(t,r),this.emitInitSegment=!0}generateInitSegment(t,e){let{audioCodec:n,videoCodec:r}=this;if(null==t||!t.byteLength)return this.initTracks=void 0,void(this.initData=void 0);const{audio:i,video:s}=this.initData=ot(t);if(e)!function(t,e){if(!t||!e)return;const n=e.keyId;n&&e.isCommonEncryption&&ft(t,((t,e)=>{const r=t.subarray(8,24);r.some((t=>0!==t))||(T.log(`[eme] Patching keyId in 'enc${e?"a":"v"}>sinf>>tenc' box: ${D(r)} -> ${D(n)}`),t.set(n,8))}))}(t,e);else{const t=i||s;null!=t&&t.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${t.codec}")!`)}i&&(n=rs(i,G,this)),s&&(r=rs(s,V,this));const A={};i&&s?A.audiovideo={container:"video/mp4",codec:n+","+r,supplemental:s.supplemental,encrypted:s.encrypted,initSegment:t,id:"main"}:i?A.audio={container:"audio/mp4",codec:n,encrypted:i.encrypted,initSegment:t,id:"audio"}:s?A.video={container:"video/mp4",codec:r,supplemental:s.supplemental,encrypted:s.encrypted,initSegment:t,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=A}remux(t,e,n,i,s,A){var a,o;let{initPTS:l,lastEndTime:u}=this;const c={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};r(u)||(u=this.lastEndTime=s||0);const h=e.samples;if(!h.length)return c;const d={initPTS:void 0,timescale:void 0,trackId:void 0};let f=this.initData;if(null!=(a=f)&&a.length||(this.generateInitSegment(h),f=this.initData),null==(o=f)||!o.length)return this.warn("Failed to generate initSegment."),c;this.emitInitSegment&&(d.tracks=this.initTracks,this.emitInitSegment=!1);const p=function(t,e,n){const i={},s=At(t,["moof","traf"]);for(let t=0;t<s.length;t++){const A=s[t],a=At(A,["tfhd"])[0],o=rt(a,4),l=e[o];if(!l)continue;i[o]||(i[o]={start:NaN,duration:0,sampleCount:0,timescale:l.timescale,type:l.type});const u=i[o],c=At(A,["tfdt"])[0];if(c){const t=c[0];let e=rt(c,4);1===t&&(e===q?n.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(e*=q+1,e+=rt(c,8))),r(e)&&(!r(u.start)||e<u.start)&&(u.start=e)}const h=l.default,d=rt(a,0)|(null==h?void 0:h.flags);let f=(null==h?void 0:h.duration)||0;8&d&&(f=rt(a,2&d?12:8));const p=At(A,["trun"]);let g=u.start||0,m=0,_=f;for(let t=0;t<p.length;t++){const e=p[t],n=rt(e,4),r=u.sampleCount;u.sampleCount+=n;const i=1&e[3],s=4&e[3],A=1&e[2],a=2&e[2],o=4&e[2],l=8&e[2];let c=8,h=n;for(i&&(c+=4),s&&n&&(1&e[c+1]||void 0!==u.keyFrameIndex||(u.keyFrameIndex=r),c+=4,A?(_=rt(e,c),c+=4):_=f,a&&(c+=4),l&&(c+=4),g+=_,m+=_,h--);h--;)A?(_=rt(e,c),c+=4):_=f,a&&(c+=4),o&&(1&e[c+1]||void 0===u.keyFrameIndex&&(u.keyFrameIndex=u.sampleCount-(h+1),u.keyFrameStart=g),c+=4),l&&(c+=4),g+=_,m+=_;!m&&f&&(m+=f*n)}u.duration+=m}if(!Object.keys(i).some((t=>i[t].duration))){let e=1/0,n=0;const s=At(t,["sidx"]);for(let t=0;t<s.length;t++){const r=at(s[t]);if(null!=r&&r.references){e=Math.min(e,r.earliestPresentationTime/r.timescale);const t=r.references.reduce(((t,e)=>t+e.info.duration||0),0);n=Math.max(n,t+r.earliestPresentationTime/r.timescale)}}n&&r(n)&&Object.keys(i).forEach((t=>{i[t].duration||(i[t].duration=n*i[t].timescale-i[t].start)}))}return i}(h,f,this),g=f.audio?p[f.audio.id]:null,m=f.video?p[f.video.id]:null,_=ns(m,1/0),w=ns(g,1/0),y=ns(m,0,!0),v=ns(g,0,!0);let B=s,b=0;const E=g&&(!m||!l&&w<_||l&&l.trackId===f.audio.id),C=E?g:m;if(C){const t=C.timescale,e=C.start-s*t,n=E?f.audio.id:f.video.id;B=C.start/t,b=E?v-w:y-_,!A&&l||!function(t,e,n,r){if(null===t)return!0;const i=Math.max(r,1),s=e-t.baseTime/t.timescale;return Math.abs(s-n)>i}(l,B,s,b)&&t===l.timescale||(l&&this.warn(`Timestamps at playlist time: ${A?"":"~"}${s} ${e/t} != initPTS: ${l.baseTime/l.timescale} (${l.baseTime}/${l.timescale}) trackId: ${l.trackId}`),this.log(`Found initPTS at playlist time: ${s} offset: ${B-s} (${e}/${t}) trackId: ${n}`),l=null,d.initPTS=e,d.timescale=t,d.trackId=n)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${s}`);l?(d.initPTS=l.baseTime,d.timescale=l.timescale,d.trackId=l.trackId):(d.timescale&&void 0!==d.trackId&&void 0!==d.initPTS||(this.warn("Could not set initPTS"),d.initPTS=B,d.timescale=1,d.trackId=-1),this.initPTS=l={baseTime:d.initPTS,timescale:d.timescale,trackId:d.trackId});const k=B-l.baseTime/l.timescale,F=k+b;b>0?this.lastEndTime=F:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const T=!!f.audio,S=!!f.video;let x="";T&&(x+="audio"),S&&(x+="video");const I={data1:h,startPTS:k,startDTS:k,endPTS:F,endDTS:F,type:x,hasAudio:T,hasVideo:S,nb:1,dropped:0,encrypted:!!f.audio&&f.audio.encrypted||!!f.video&&f.video.encrypted};c.audio=T&&!S?I:void 0,c.video=S?I:void 0;const D=null==m?void 0:m.sampleCount;if(D){const t=m.keyFrameIndex,e=-1!==t;I.nb=D,I.dropped=0===t||this.isVideoContiguous?0:e?t:D,I.independent=e,I.firstKeyFrame=t,e&&m.keyFrameStart&&(I.firstKeyFramePTS=(m.keyFrameStart-l.baseTime)/l.timescale),this.isVideoContiguous||(c.independent=e),this.isVideoContiguous||(this.isVideoContiguous=e),I.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${t}/${D} dropped: ${I.dropped} start: ${I.firstKeyFramePTS||"NA"}`)}return c.initSegment=d,c.id3=ts(n,s,l,l),i.samples.length&&(c.text=es(i,s,l)),c}}},{demux:Ri,remux:qi},{demux:class extends hi{constructor(t,e){super(),this.observer=void 0,this.config=void 0,this.observer=t,this.config=e}resetInitSegment(t,e,n,r){super.resetInitSegment(t,e,n,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:e,duration:r,inputTimeScale:9e4,dropped:0}}static probe(t,e){if(!t)return!1;const n=jr(t,0);let r=(null==n?void 0:n.length)||0;if(bi(t,r))return!1;for(let n=t.length;r<n;r++)if(Xr(t,r))return e.log("ADTS sync word found !"),!0;return!1}canParse(t,e){return function(t,e){return function(t,e){return e+5<t.length}(t,e)&&Zr(t,e)&&zr(t,e)<=t.length-e}(t,e)}appendFrame(t,e,n){qr(t,this.observer,e,n,t.manifestCodec);const r=ti(t,e,n,this.basePTS,this.frameIndex);if(r&&0===r.missing)return r}},remux:qi},{demux:class extends hi{resetInitSegment(t,e,n,r){super.resetInitSegment(t,e,n,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:e,duration:r,inputTimeScale:9e4,dropped:0}}static probe(t){if(!t)return!1;const e=jr(t,0);let n=(null==e?void 0:e.length)||0;if(e&&11===t[n]&&119===t[n+1]&&void 0!==li(e)&&Ei(t,n)<=16)return!1;for(let e=t.length;n<e;n++)if(bi(t,n))return T.log("MPEG Audio sync word found !"),!0;return!1}canParse(t,e){return function(t,e){return vi(t,e)&&4<=t.length-e}(t,e)}appendFrame(t,e,n){if(null!==this.basePTS)return wi(t,e,n,this.basePTS,this.frameIndex)}},remux:qi}];is.splice(2,0,{demux:Ci,remux:qi});class ss{constructor(t,e,n,r,i,s){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=t,this.typeSupported=e,this.config=n,this.id=i,this.logger=s}configure(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()}push(t,e,n,r){const i=n.transmuxing;i.executeStart=Wi();let s=new Uint8Array(t);const{currentTransmuxState:l,transmuxConfig:u}=this;r&&(this.currentTransmuxState=r);const{contiguous:c,discontinuity:h,trackSwitch:d,accurateTimeOffset:f,timeOffset:p,initSegmentChange:g}=r||l,{audioCodec:m,videoCodec:_,defaultInitPts:w,duration:y,initSegmentData:v}=u,B=function(t,e){let n=null;t.byteLength>0&&null!=(null==e?void 0:e.key)&&null!==e.iv&&null!=e.method&&(n=e);return n}(s,e);if(B&&mn(B.method)){const t=this.getDecrypter(),e=_n(B.method);if(!t.isSync())return this.asyncResult=!0,this.decryptionPromise=t.webCryptoDecrypt(s,B.key.buffer,B.iv.buffer,e).then((t=>{const e=this.push(t,null,n);return this.decryptionPromise=null,e})),this.decryptionPromise;{let r=t.softwareDecrypt(s,B.key.buffer,B.iv.buffer,e);if(n.part>-1){const e=t.flush();r=e?e.buffer:e}if(!r)return i.executeEnd=Wi(),As(n);s=new Uint8Array(r)}}const b=this.needsProbing(h,d);if(b){const t=this.configureTransmuxer(s);if(t)return this.logger.warn(`[transmuxer] ${t.message}`),this.observer.emit(o.ERROR,o.ERROR,{type:A.MEDIA_ERROR,details:a.FRAG_PARSING_ERROR,fatal:!1,error:t,reason:t.message}),i.executeEnd=Wi(),As(n)}(h||d||g||b)&&this.resetInitSegment(v,m,_,y,e),(h||g||b)&&this.resetInitialTimestamp(w),c||this.resetContiguity();const E=this.transmux(s,B,p,f,n);this.asyncResult=as(E);const C=this.currentTransmuxState;return C.contiguous=!0,C.discontinuity=!1,C.trackSwitch=!1,i.executeEnd=Wi(),E}flush(t){const e=t.transmuxing;e.executeStart=Wi();const{decrypter:n,currentTransmuxState:r,decryptionPromise:i}=this;if(i)return this.asyncResult=!0,i.then((()=>this.flush(t)));const s=[],{timeOffset:A}=r;if(n){const e=n.flush();e&&s.push(this.push(e.buffer,null,t))}const{demuxer:a,remuxer:o}=this;if(!a||!o){e.executeEnd=Wi();const n=[As(t)];return this.asyncResult?Promise.resolve(n):n}const l=a.flush(A);return as(l)?(this.asyncResult=!0,l.then((e=>(this.flushRemux(s,e,t),s)))):(this.flushRemux(s,l,t),this.asyncResult?Promise.resolve(s):s)}flushRemux(t,e,n){const{audioTrack:r,videoTrack:i,id3Track:s,textTrack:A}=e,{accurateTimeOffset:a,timeOffset:o}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===d?"level":"track"} ${n.level}`);const l=this.remuxer.remux(r,i,s,A,o,a,!0,this.id);t.push({remuxResult:l,chunkMeta:n}),n.transmuxing.executeEnd=Wi()}resetInitialTimestamp(t){const{demuxer:e,remuxer:n}=this;e&&n&&(e.resetTimeStamp(t),n.resetTimeStamp(t))}resetContiguity(){const{demuxer:t,remuxer:e}=this;t&&e&&(t.resetContiguity(),e.resetNextTimestamp())}resetInitSegment(t,e,n,r,i){const{demuxer:s,remuxer:A}=this;s&&A&&(s.resetInitSegment(t,e,n,r),A.resetInitSegment(t,e,n,i))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(t,e,n,r,i){let s;return s=e&&"SAMPLE-AES"===e.method?this.transmuxSampleAes(t,e,n,r,i):this.transmuxUnencrypted(t,n,r,i),s}transmuxUnencrypted(t,e,n,r){const{audioTrack:i,videoTrack:s,id3Track:A,textTrack:a}=this.demuxer.demux(t,e,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(i,s,A,a,e,n,!1,this.id),chunkMeta:r}}transmuxSampleAes(t,e,n,r,i){return this.demuxer.demuxSampleAes(t,e,n).then((t=>({remuxResult:this.remuxer.remux(t.audioTrack,t.videoTrack,t.id3Track,t.textTrack,n,r,!1,this.id),chunkMeta:i})))}configureTransmuxer(t){const{config:e,observer:n,typeSupported:r}=this;let i;for(let e=0,n=is.length;e<n;e++){var s;if(null!=(s=is[e].demux)&&s.probe(t,this.logger)){i=is[e];break}}if(!i)return new Error("Failed to find demuxer by probing fragment data");const A=this.demuxer,a=this.remuxer,o=i.remux,l=i.demux;a&&a instanceof o||(this.remuxer=new o(n,e,r,this.logger)),A&&A instanceof l||(this.demuxer=new l(n,e,r,this.logger),this.probe=l.probe)}needsProbing(t,e){return!this.demuxer||!this.remuxer||t||e}getDecrypter(){let t=this.decrypter;return t||(t=this.decrypter=new Ze(this.config)),t}}const As=t=>({remuxResult:{},chunkMeta:t});function as(t){return"then"in t&&t.then instanceof Function}class os{constructor(t,e,n,r,i){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=t,this.videoCodec=e,this.initSegmentData=n,this.duration=r,this.defaultInitPts=i||null}}class ls{constructor(t,e,n,r,i,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=t,this.contiguous=e,this.accurateTimeOffset=n,this.trackSwitch=r,this.timeOffset=i,this.initSegmentChange=s}}let us=0;class cs{constructor(t,e,n,r){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=us++,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=t=>{const e=t.data,n=this.hls;if(n&&null!=e&&e.event&&e.instanceNo===this.instanceNo)switch(e.event){case"init":{var r;const t=null==(r=this.workerContext)?void 0:r.objectURL;t&&self.URL.revokeObjectURL(t);break}case"transmuxComplete":this.handleTransmuxComplete(e.data);break;case"flush":this.onFlush(e.data);break;case"workerLog":n.logger[e.data.logType]&&n.logger[e.data.logType](e.data.message);break;default:e.data=e.data||{},e.data.frag=this.frag,e.data.part=this.part,e.data.id=this.id,n.trigger(e.event,e.data)}},this.onWorkerError=t=>{if(!this.hls)return;const e=new Error(`${t.message} (${t.filename}:${t.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(o.ERROR,{type:A.OTHER_ERROR,details:a.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:e})};const i=t.config;this.hls=t,this.id=e,this.useWorker=!!i.enableWorker,this.onTransmuxComplete=n,this.onFlush=r;const s=(t,e)=>{(e=e||{}).frag=this.frag||void 0,t===o.ERROR&&(e.parent=this.id,e.part=this.part,this.error=e.error),this.hls.trigger(t,e)};this.observer=new Nr,this.observer.on(o.FRAG_DECRYPTED,s),this.observer.on(o.ERROR,s);const l=Pt(i.preferManagedMediaSource);if(this.useWorker&&"undefined"!=typeof Worker){const n=this.hls.logger;if(i.workerPath||"function"==typeof __HLS_WORKER_BUNDLE__){try{i.workerPath?(n.log(`loading Web Worker ${i.workerPath} for "${e}"`),this.workerContext=function(t){const e=Kr[t];if(e)return e.clientCount++,e;const n=new self.URL(t,self.location.href).href,r={worker:new self.Worker(n),scriptURL:n,clientCount:1};return Kr[t]=r,r}(i.workerPath)):(n.log(`injecting Web Worker for "${e}"`),this.workerContext=function(){const t=Kr[Hr];if(t)return t.clientCount++,t;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"}),n=self.URL.createObjectURL(e),r={worker:new self.Worker(n),objectURL:n,clientCount:1};return Kr[Hr]=r,r}());const{worker:t}=this.workerContext;t.addEventListener("message",this.onWorkerMessage),t.addEventListener("error",this.onWorkerError),t.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:l,id:e,config:re(i)})}catch(r){n.warn(`Error setting up "${e}" Web Worker, fallback to inline`,r),this.terminateWorker(),this.error=null,this.transmuxer=new ss(this.observer,l,i,"",e,t.logger)}return}}this.transmuxer=new ss(this.observer,l,i,"",e,t.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const t=this.instanceNo;this.instanceNo=us++;const e=this.hls.config,n=Pt(e.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:t,typeSupported:n,id:this.id,config:re(e)})}}terminateWorker(){if(this.workerContext){const{worker:t}=this.workerContext;this.workerContext=null,t.removeEventListener("message",this.onWorkerMessage),t.removeEventListener("error",this.onWorkerError),function(t){const e=Kr[t||Hr];if(e&&1==e.clientCount--){const{worker:n,objectURL:r}=e;delete Kr[t||Hr],r&&self.URL.revokeObjectURL(r),n.terminate()}}(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 t=this.observer;t&&t.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(t,e,n,r,i,s,A,a,o,l){var u,c;o.transmuxing.start=self.performance.now();const{instanceNo:h,transmuxer:f}=this,p=s?s.start:i.start,g=i.decryptdata,m=this.frag,_=!(m&&i.cc===m.cc),w=!(m&&o.level===m.level),y=m?o.sn-m.sn:-1,v=this.part?o.part-this.part.index:-1,B=0===y&&o.id>1&&o.id===(null==m?void 0:m.stats.chunkCount),b=!w&&(1===y||0===y&&(1===v||B&&v<=0)),E=self.performance.now();(w||y||0===i.stats.parsing.start)&&(i.stats.parsing.start=E),!s||!v&&b||(s.stats.parsing.start=E);const C=!(m&&(null==(u=i.initSegment)?void 0:u.url)===(null==(c=m.initSegment)?void 0:c.url)),k=new ls(_,b,a,w,p,C);if(!b||_||C){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${i.type} sn: ${o.sn}${o.part>-1?" part: "+o.part:""} ${this.id===d?"level":"track"}: ${o.level} id: ${o.id}\n discontinuity: ${_}\n trackSwitch: ${w}\n contiguous: ${b}\n accurateTimeOffset: ${a}\n timeOffset: ${p}\n initSegmentChange: ${C}`);const t=new os(n,r,e,A,l);this.configureTransmuxer(t)}if(this.frag=i,this.part=s,this.workerContext)this.workerContext.worker.postMessage({instanceNo:h,cmd:"demux",data:t,decryptdata:g,chunkMeta:o,state:k},t instanceof ArrayBuffer?[t]:[]);else if(f){const e=f.push(t,g,o,k);as(e)?e.then((t=>{this.handleTransmuxComplete(t)})).catch((t=>{this.transmuxerError(t,o,"transmuxer-interface push error")})):this.handleTransmuxComplete(e)}}flush(t){t.transmuxing.start=self.performance.now();const{instanceNo:e,transmuxer:n}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:e,cmd:"flush",chunkMeta:t});else if(n){const e=n.flush(t);as(e)?e.then((e=>{this.handleFlushResult(e,t)})).catch((e=>{this.transmuxerError(e,t,"transmuxer-interface flush error")})):this.handleFlushResult(e,t)}}transmuxerError(t,e,n){this.hls&&(this.error=t,this.hls.trigger(o.ERROR,{type:A.MEDIA_ERROR,details:a.FRAG_PARSING_ERROR,chunkMeta:e,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:t,err:t,reason:n}))}handleFlushResult(t,e){t.forEach((t=>{this.handleTransmuxComplete(t)})),this.onFlush(e)}configureTransmuxer(t){const{instanceNo:e,transmuxer:n}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:e,cmd:"configure",config:t}):n&&n.configure(t)}handleTransmuxComplete(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)}}class hs extends B{constructor(t,e){super(e,t.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=t}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){-1!==this.timer&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(t,e,n){const r=null==e?void 0:e.renditionReports;if(r){let i=-1;for(let n=0;n<r.length;n++){const s=r[n];let A;try{A=new self.URL(s.URI,e.url).href}catch(t){this.warn(`Could not construct new URL for Rendition Report: ${t}`),A=s.URI||""}if(A===t){i=n;break}A===t.substring(0,A.length)&&(i=n)}if(-1!==i){const t=r[i],s=parseInt(t["LAST-MSN"])||e.lastPartSn;let A=parseInt(t["LAST-PART"])||e.lastPartIndex;if(this.hls.config.lowLatencyMode){const t=Math.min(e.age-e.partTarget,e.targetduration);A>=0&&t>e.partTarget&&(A+=1)}const a=n&&qt(n);return new Jt(s,A>=0?A:void 0,a)}}}loadPlaylist(t){this.clearTimer()}loadingPlaylist(t,e){this.clearTimer()}shouldLoadPlaylist(t){return this.canLoad&&!!t&&!!t.url&&(!t.details||t.details.live)}getUrlWithDirectives(t,e){if(e)try{return e.addDirectives(t)}catch(t){this.warn(`Could not construct new URL with HLS Delivery Directives: ${t}`)}return t}playlistLoaded(t,e,n){const{details:r,stats:i}=e,s=self.performance.now(),l=i.loading.first?Math.max(0,s-i.loading.first):0;r.advancedDateTime=Date.now()-l;const u=this.hls.config.timelineOffset;if(u!==r.appliedTimelineOffset){const t=Math.max(u||0,0);r.appliedTimelineOffset=t,r.fragments.forEach((e=>{e.setStart(e.playlistOffset+t)}))}if(r.live||null!=n&&n.live){const u="levelInfo"in e?e.levelInfo:e.track;if(r.reloaded(n),n&&r.fragments.length>0){rr(n,r,this);const t=r.playlistParsingError;if(t){this.warn(t);const n=this.hls;if(!n.config.ignorePlaylistParsingErrors){var c;const{networkDetails:s}=e;return void n.trigger(o.ERROR,{type:A.NETWORK_ERROR,details:a.LEVEL_PARSING_ERROR,fatal:!1,url:r.url,error:t,reason:t.message,level:e.level||void 0,parent:null==(c=r.fragments[0])?void 0:c.type,networkDetails:s,stats:i})}r.playlistParsingError=null}}-1===r.requestScheduled&&(r.requestScheduled=i.loading.start);const h=this.hls.mainForwardBufferInfo,d=h?h.end-h.len:0,f=ar(r,1e3*(r.edge-d));if(r.requestScheduled+f<s?r.requestScheduled=s:r.requestScheduled+=f,this.log(`live playlist ${t} ${r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:r.updated?"UPDATED":"MISSED"}`),!this.canLoad||!r.live)return;let p,g,m;if(r.canBlockReload&&r.endSN&&r.advanced){const t=this.hls.config.lowLatencyMode,i=r.lastPartSn,A=r.endSN,a=r.lastPartIndex,o=i===A;-1!==a?o?(g=A+1,m=t?0:a):(g=i,m=t?a+1:r.maxPartIndex):g=A+1;const l=r.age,c=l+r.ageHeader;let h=Math.min(c-r.partTarget,1.5*r.targetduration);if(h>0){if(c>3*r.targetduration)this.log(`Playlist last advanced ${l.toFixed(2)}s ago. Omitting segment and part directives.`),g=void 0,m=void 0;else if(null!=n&&n.tuneInGoal&&c-r.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${h} with playlist age: ${r.age}`),h=0;else{const t=Math.floor(h/r.targetduration);if(g+=t,void 0!==m){m+=Math.round(h%r.targetduration/r.partTarget)}this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${l.toFixed(2)}s goal: ${h} skip sn ${t} to part ${m}`)}r.tuneInGoal=h}if(p=this.getDeliveryDirectives(r,e.deliveryDirectives,g,m),t||!o)return r.requestScheduled=s,void this.loadingPlaylist(u,p)}else(r.canBlockReload||r.canSkipUntil)&&(p=this.getDeliveryDirectives(r,e.deliveryDirectives,g,m));p&&void 0!==g&&r.canBlockReload&&(r.requestScheduled=i.loading.first+Math.max(f-2*l,f/2)),this.scheduleLoading(u,p,r)}else this.clearTimer()}scheduleLoading(t,e,n){const r=n||t.details;if(!r)return void this.loadingPlaylist(t,e);const i=self.performance.now(),s=r.requestScheduled;if(i>=s)return void this.loadingPlaylist(t,e);const A=s-i;this.log(`reload live playlist ${t.name||t.bitrate+"bps"} in ${Math.round(A)} ms`),this.clearTimer(),this.timer=self.setTimeout((()=>this.loadingPlaylist(t,e)),A)}getDeliveryDirectives(t,e,n,r){let i=qt(t);return null!=e&&e.skip&&t.deltaUpdateFailed&&(n=e.msn,r=e.part,i=zt),new Jt(n,r,i)}checkRetry(t){const e=t.details,n=me(t),r=t.errorAction,{action:i,retryCount:s=0,retryConfig:A}=r||{},a=!!r&&!!A&&(i===Te||!r.resolved&&i===ke);if(a){var o;if(s>=A.maxNumRetry)return!1;if(n&&null!=(o=t.context)&&o.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${A.maxNumRetry} after "${e}" without delivery-directives`),this.loadPlaylist();else{const t=ve(A,s);this.clearTimer(),this.timer=self.setTimeout((()=>this.loadPlaylist()),t),this.warn(`Retrying playlist loading ${s+1}/${A.maxNumRetry} after "${e}" in ${t}ms`)}t.levelRetry=!0,r.resolved=!0}return a}}function ds(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!fs(t[n].attrs,e[n].attrs))return!1;return!0}function fs(t,e,n){const r=t["STABLE-RENDITION-ID"];return r&&!n?r===e["STABLE-RENDITION-ID"]:!(n||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some((n=>t[n]!==e[n]))}function ps(t,e){return e.label.toLowerCase()===t.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(t.lang||"").toLowerCase())}class gs{constructor(t){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=t}destroy(){this.tracks=this.queues=null}append(t,e,n){if(null===this.queues||null===this.tracks)return;const r=this.queues[e];r.push(t),1!==r.length||n||this.executeNext(e)}appendBlocker(t){return new Promise((e=>{const n={label:"async-blocker",execute:e,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(n,t)}))}prependBlocker(t){return new Promise((e=>{if(this.queues){const n={label:"async-blocker-prepend",execute:e,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[t].unshift(n)}}))}removeBlockers(){null!==this.queues&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach((t=>{var e;const n=null==(e=t[0])?void 0:e.label;"async-blocker"!==n&&"async-blocker-prepend"!==n||(t[0].execute(),t.splice(0,1))}))}unblockAudio(t){if(null===this.queues)return;this.queues.audio[0]===t&&this.shiftAndExecuteNext("audio")}executeNext(t){if(null===this.queues||null===this.tracks)return;const e=this.queues[t];if(e.length){const r=e[0];try{r.execute()}catch(e){var n;if(r.onError(e),null===this.queues||null===this.tracks)return;const i=null==(n=this.tracks[t])?void 0:n.buffer;null!=i&&i.updating||this.shiftAndExecuteNext(t)}}}shiftAndExecuteNext(t){null!==this.queues&&(this.queues[t].shift(),this.executeNext(t))}current(t){var e;return(null==(e=this.queues)?void 0:e[t][0])||null}toString(){const{queues:t,tracks:e}=this;return null===t||null===e?"<destroyed>":`\n${this.list("video")}\n${this.list("audio")}\n${this.list("audiovideo")}}`}list(t){var e,n;return null!=(e=this.queues)&&e[t]||null!=(n=this.tracks)&&n[t]?`${t}: (${this.listSbInfo(t)}) ${this.listOps(t)}`:""}listSbInfo(t){var e;const n=null==(e=this.tracks)?void 0:e[t],r=null==n?void 0:n.buffer;return r?`SourceBuffer${r.updating?" updating":""}${n.ended?" ended":""}${n.ending?" ending":""}`:"none"}listOps(t){var e;return(null==(e=this.queues)?void 0:e[t].map((t=>t.label)).join(", "))||""}}const ms=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,_s="HlsJsTrackRemovedError";class ws extends Error{constructor(t){super(t),this.name=_s}}function ys(t){const e=t.querySelectorAll("source");[].slice.call(e).forEach((e=>{t.removeChild(e)}))}function vs(t){return"audio"===t?1:0}class Bs{constructor(t){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=t,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(t){this.streamController=t}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:t}=this;t.on(o.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.on(o.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(o.MANIFEST_PARSED,this.onManifestParsed,this),t.on(o.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(o.BUFFER_CODECS,this.onBufferCodecs,this),t.on(o.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:t}=this;t.off(o.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.off(o.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(o.MANIFEST_PARSED,this.onManifestParsed,this),t.off(o.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(o.BUFFER_CODECS,this.onBufferCodecs,this),t.off(o.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(t,e){const n=this.hls.levels[e.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(t,e){this.media=e.media instanceof HTMLVideoElement?e.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(t,e){const n=this.hls;this.restrictedLevels=[],this.firstLevel=e.firstLevel,n.config.capLevelToPlayerSize&&e.video&&this.startCapping()}onLevelsUpdated(t,e){this.timer&&r(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(t,e){this.hls.config.capLevelToPlayerSize&&e.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0)return void(this.clientRect=null);const t=this.hls.levels;if(t.length){const e=this.hls,n=this.getMaxLevel(t.length-1);n!==this.autoLevelCapping&&e.logger.log(`Setting autoLevelCapping to ${n}: ${t[n].height}p@${t[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),e.autoLevelCapping=n,e.autoLevelEnabled&&e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}}getMaxLevel(t){const e=this.hls.levels;if(!e.length)return-1;const n=e.filter(((e,n)=>this.isLevelAllowed(e)&&n<=t));return this.clientRect=null,Bs.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 t=this.media,e={width:0,height:0};if(t){const n=t.getBoundingClientRect();e.width=n.width,e.height=n.height,e.width||e.height||(e.width=n.right-n.left||t.width||0,e.height=n.bottom-n.top||t.height||0)}return this.clientRect=e,e}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let t=1;if(!this.hls.config.ignoreDevicePixelRatio)try{t=self.devicePixelRatio}catch(t){}return Math.min(t,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(t){return!this.restrictedLevels.some((e=>t.bitrate===e.bitrate&&t.width===e.width&&t.height===e.height))}static getMaxLevelByMediaSize(t,e,n){if(null==t||!t.length)return-1;let r=t.length-1;const i=Math.max(e,n);for(let e=0;e<t.length;e+=1){const n=t[e];if((n.width>=i||n.height>=i)&&(s=n,!(A=t[e+1])||s.width!==A.width||s.height!==A.height)){r=e;break}}var s,A;return r}}const bs={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},Es={HLS:"h"};class Cs{constructor(t,e){Array.isArray(t)&&(t=t.map((t=>t instanceof Cs?t:new Cs(t)))),this.value=t,this.params=e}}function ks(t,e,n,r){return new Error(`failed to ${t} "${i=e,Array.isArray(i)?JSON.stringify(i):i instanceof Map?"Map{}":i instanceof Set?"Set{}":"object"==typeof i?JSON.stringify(i):String(i)}" as ${n}`,{cause:r});var i}function Fs(t,e,n){return ks("serialize",t,e,n)}class Ts{constructor(t){this.description=t}}const Ss="Bare Item";function xs(t){if(!1===ArrayBuffer.isView(t))throw Fs(t,"Byte Sequence");return`:${e=t,btoa(String.fromCharCode(...e))}:`;var e}function Is(t){if(function(t){return t<-999999999999999||999999999999999<t}(t))throw Fs(t,"Integer");return t.toString()}function Ds(t,e){if(t<0)return-Ds(-t,e);const n=Math.pow(10,e);if(Math.abs(t*n%1-.5)<Number.EPSILON){const e=Math.floor(t*n);return(e%2==0?e:e+1)/n}return Math.round(t*n)/n}function Us(t){const e=Ds(t,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Fs(t,"Decimal");const n=e.toString();return n.includes(".")?n:`${n}.0`}const Ls=/[\x00-\x1f\x7f]+/;function Rs(t){const e=(n=t).description||n.toString().slice(7,-1);var n;if(!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e))throw Fs(e,"Token");return e}function Qs(t){switch(typeof t){case"number":if(!r(t))throw Fs(t,Ss);return Number.isInteger(t)?Is(t):Us(t);case"string":return function(t){if(Ls.test(t))throw Fs(t,"String");return`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}(t);case"symbol":return Rs(t);case"boolean":return function(t){if("boolean"!=typeof t)throw Fs(t,"Boolean");return t?"?1":"?0"}(t);case"object":if(t instanceof Date)return function(t){return`@${Is(t.getTime()/1e3)}`}(t);if(t instanceof Uint8Array)return xs(t);if(t instanceof Ts)return Rs(t);default:throw Fs(t,Ss)}}function Os(t){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(t))throw Fs(t,"Key");return t}function Ps(t){return null==t?"":Object.entries(t).map((([t,e])=>!0===e?`;${Os(t)}`:`;${Os(t)}=${Qs(e)}`)).join("")}function Ms(t){return t instanceof Cs?`${Qs(t.value)}${Ps(t.params)}`:Qs(t)}function Ns(t,e={whitespace:!0}){if("object"!=typeof t||null==t)throw Fs(t,"Dict");const n=t instanceof Map?t.entries():Object.entries(t),r=(null==e?void 0:e.whitespace)?" ":"";return Array.from(n).map((([t,e])=>{e instanceof Cs==!1&&(e=new Cs(e));let n=Os(t);var r;return!0===e.value?n+=Ps(e.params):(n+="=",Array.isArray(e.value)?n+=`(${(r=e).value.map(Ms).join(" ")})${Ps(r.params)}`:n+=Ms(e)),n})).join(`,${r}`)}function Hs(t,e){return Ns(t,e)}const Ks="CMCD-Object",$s="CMCD-Request",Gs="CMCD-Session",Vs="CMCD-Status",js={br:Ks,ab:Ks,d:Ks,ot:Ks,tb:Ks,tpb:Ks,lb:Ks,tab:Ks,lab:Ks,url:Ks,pb:$s,bl:$s,tbl:$s,dl:$s,ltc:$s,mtp:$s,nor:$s,nrr:$s,rc:$s,sn:$s,sta:$s,su:$s,ttfb:$s,ttfbb:$s,ttlb:$s,cmsdd:$s,cmsds:$s,smrt:$s,df:$s,cs:$s,ts:$s,cid:Gs,pr:Gs,sf:Gs,sid:Gs,st:Gs,v:Gs,msd:Gs,bs:Vs,bsd:Vs,cdn:Vs,rtp:Vs,bg:Vs,pt:Vs,ec:Vs,e:Vs},Zs=$s;function Ws(t,e){const n={};if(!t)return n;const r=Object.keys(t),i=e?(s=e,Object.keys(s).reduce(((t,e)=>{var n;return null===(n=s[e])||void 0===n||n.forEach((n=>t[n]=e)),t}),{})):{};var s;return r.reduce(((e,n)=>{var r;const s=js[n]||i[n]||Zs;return(null!==(r=e[s])&&void 0!==r?r:e[s]={})[n]=t[n],e}),n)}const zs="event";const Ys=t=>Math.round(t),Xs=(t,e)=>Array.isArray(t)?t.map((t=>Xs(t,e))):t instanceof Cs&&"string"==typeof t.value?new Cs(Xs(t.value,e),t.params):(e.baseUrl&&(t=function(t,e){const n=new URL(t),r=new URL(e);if(n.origin!==r.origin)return t;const i=n.pathname.split("/").slice(1),s=r.pathname.split("/").slice(1,-1);for(;i[0]===s[0];)i.shift(),s.shift();for(;s.length;)s.shift(),i.unshift("..");return i.join("/")+n.search+n.hash}(t,e.baseUrl)),1===e.version?encodeURIComponent(t):t),qs=t=>100*Ys(t/100),Js={br:Ys,d:Ys,bl:qs,dl:qs,mtp:qs,nor:(t,e)=>{let n=t;return e.version>=2&&(t instanceof Cs&&"string"==typeof t.value?n=new Cs([t]):"string"==typeof t&&(n=[t])),Xs(n,e)},rtp:qs,tb:Ys},tA="request",eA="response",nA=["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"],rA=["e"],iA=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function sA(t){return iA.test(t)}const AA=["d","dl","nor","ot","rtp","su"];const aA=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];const oA=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function lA(t){return oA.includes(t)||sA(t)}const uA={[eA]:function(t){return nA.includes(t)||AA.includes(t)||aA.includes(t)||sA(t)},[zs]:function(t){return nA.includes(t)||rA.includes(t)||sA(t)},[tA]:function(t){return nA.includes(t)||AA.includes(t)||sA(t)}};function cA(t,e={}){const n={};if(null==t||"object"!=typeof t)return n;const i=e.version||t.v||1,s=e.reportingMode||tA,A=1===i?lA:uA[s];let a=Object.keys(t).filter(A);const o=e.filter;"function"==typeof o&&(a=a.filter(o));const l=s===eA||s===zs;l&&!a.includes("ts")&&a.push("ts"),i>1&&!a.includes("v")&&a.push("v");const u=w({},Js,e.formatters),c={version:i,reportingMode:s,baseUrl:e.baseUrl};return a.sort().forEach((e=>{let s=t[e];const A=u[e];if("function"==typeof A&&(s=A(s,c)),"v"===e){if(1===i)return;s=i}"pr"==e&&1===s||(l&&"ts"===e&&!r(s)&&(s=Date.now()),function(t){return"number"==typeof t?r(t):null!=t&&""!==t&&!1!==t}(s)&&(function(t){return["ot","sf","st","e","sta"].includes(t)}(e)&&"string"==typeof s&&(s=new Ts(s)),n[e]=s))})),n}function hA(t,e,n){return w(t,function(t,e={}){const n={};if(!t)return n;const r=Ws(cA(t,e),null==e?void 0:e.customHeaderMap);return Object.entries(r).reduce(((t,[e,n])=>{const r=Hs(n,{whitespace:!1});return r&&(t[e]=r),t}),n)}(e,n))}function dA(t,e={}){if(!t)return"";const n=function(t,e={}){return t?Hs(cA(t,e),{whitespace:!1}):""}(t,e);return encodeURIComponent(n)}const fA=/CMCD=[^&#]+/;function pA(t,e,n){const r=function(t,e={}){return t?`CMCD=${dA(t,e)}`:""}(e,n);if(!r)return t;if(fA.test(t))return t.replace(fA,r);const i=t.includes("?")?"&":"?";return`${t}${i}${r}`}function gA(t,e,n,r){t&&Object.keys(e).forEach((i=>{const s=t.filter((t=>t.groupId===i)).map((t=>{const s=w({},t);return s.details=void 0,s.attrs=new cn(s.attrs),s.url=s.attrs.URI=mA(t.url,t.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",n),s.groupId=s.attrs["GROUP-ID"]=e[i],s.attrs["PATHWAY-ID"]=r,s}));t.push(...s)}))}function mA(t,e,n,r){const{HOST:i,PARAMS:s,[n]:A}=r;let a;e&&(a=null==A?void 0:A[e],a&&(t=a));const o=new self.URL(t);return i&&!a&&(o.host=i),s&&Object.keys(s).sort().forEach((t=>{t&&o.searchParams.set(t,s[t])})),o.href}class _A extends B{constructor(t){super("eme",t.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=_A.CDMCleanupPromise?[_A.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=t=>{const{initDataType:e,initData:n}=t,r=`"${t.type}" event: init data type: "${e}"`;if(this.debug(r),null!==n){if(!this.keyFormatPromise){let t=Object.keys(this.keySystemAccessPromises);t.length||(t=In(this.config));const e=t.map(xn).filter((t=>!!t));this.keyFormatPromise=this.getKeyFormatPromise(e)}this.keyFormatPromise.then((i=>{const s=Sn(i);if("sinf"!==e||s!==En.FAIRPLAY)return void this.log(`Ignoring "${t.type}" event with init data type: "${e}" for selected key-system ${s}`);let A;try{const t=et(new Uint8Array(n)),e=pt(wn(JSON.parse(t).sinf));if(!e)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");A=new Uint8Array(e.subarray(8,24))}catch(t){return void this.warn(`${r} Failed to parse sinf: ${t}`)}const a=D(A),{keyIdToKeySessionPromise:o,mediaKeySessions:l}=this;let u=o[a];for(let t=0;t<l.length;t++){const r=l[t],i=r.decryptdata;if(!i.keyId)continue;const s=D(i.keyId);if(pn(A,i.keyId)||-1!==i.uri.replace(/-/g,"").indexOf(a)){if(u=o[s],!u)continue;if(i.pssh)break;delete o[s],i.pssh=new Uint8Array(n),i.keyId=A,u=o[a]=u.then((()=>this.generateRequestWithPreferredKeySession(r,e,n,"encrypted-event-key-match"))),u.catch((t=>this.handleError(t)));break}}u||this.handleError(new Error(`Key ID ${a} not encountered in playlist. Key-system sessions ${l.length}.`))})).catch((t=>this.handleError(t)))}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=t,this.config=t.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const t=this.config;t.requestMediaKeySystemAccessFunc=null,t.licenseXhrSetup=t.licenseResponseCallback=void 0,t.drmSystems=t.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(o.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(o.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(o.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(o.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(o.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(o.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(o.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(o.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(o.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(o.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(t){const{drmSystems:e,widevineLicenseUrl:n}=this.config,r=null==e?void 0:e[t];return r?r.licenseUrl:t===En.WIDEVINE&&n?n:void 0}getLicenseServerUrlOrThrow(t){const e=this.getLicenseServerUrl(t);if(void 0===e)throw new Error(`no license server URL configured for key-system "${t}"`);return e}getServerCertificateUrl(t){const{drmSystems:e}=this.config,n=null==e?void 0:e[t];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${t}"]`)}attemptKeySystemAccess(t){const e=this.hls.levels,n=(t,e,n)=>!!t&&n.indexOf(t)===e,r=e.map((t=>t.audioCodec)).filter(n),i=e.map((t=>t.videoCodec)).filter(n);return r.length+i.length===0&&i.push("avc1.42e01e"),new Promise(((e,n)=>{const s=t=>{const o=t.shift();this.getMediaKeysPromise(o,r,i).then((t=>e({keySystem:o,mediaKeys:t}))).catch((e=>{t.length?s(t):n(e instanceof vA?e:new vA({type:A.KEY_SYSTEM_ERROR,details:a.KEY_SYSTEM_NO_ACCESS,error:e,fatal:!0},e.message))}))};s(t)}))}requestMediaKeySystemAccess(t,e){const{requestMediaKeySystemAccessFunc:n}=this.config;if("function"!=typeof n){let t=`Configured requestMediaKeySystemAccess is not a function ${n}`;return null===Dn&&"http:"===self.location.protocol&&(t=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(t))}return n(t,e)}getMediaKeysPromise(t,e,n){var r;const i=function(t,e,n,r){let i;switch(t){case En.FAIRPLAY:i=["cenc","sinf"];break;case En.WIDEVINE:case En.PLAYREADY:i=["cenc"];break;case En.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${t}`)}return function(t,e,n,r){return[{initDataTypes:t,persistentState:r.persistentState||"optional",distinctiveIdentifier:r.distinctiveIdentifier||"optional",sessionTypes:r.sessionTypes||[r.sessionType||"temporary"],audioCapabilities:e.map((t=>({contentType:`audio/mp4; codecs=${t}`,robustness:r.audioRobustness||"",encryptionScheme:r.audioEncryptionScheme||null}))),videoCapabilities:n.map((t=>({contentType:`video/mp4; codecs=${t}`,robustness:r.videoRobustness||"",encryptionScheme:r.videoEncryptionScheme||null})))}]}(i,e,n,r)}(t,e,n,this.config.drmSystemOptions||{});let s=this.keySystemAccessPromises[t],A=null==(r=s)?void 0:r.keySystemAccess;if(!A){this.log(`Requesting encrypted media "${t}" key-system access with config: ${re(i)}`),A=this.requestMediaKeySystemAccess(t,i);const e=s=this.keySystemAccessPromises[t]={keySystemAccess:A};return A.catch((e=>{this.log(`Failed to obtain access to key-system "${t}": ${e}`)})),A.then((n=>{this.log(`Access for key-system "${n.keySystem}" obtained`);const r=this.fetchServerCertificate(t);this.log(`Create media-keys for "${t}"`);const i=e.mediaKeys=n.createMediaKeys().then((n=>(this.log(`Media-keys created for "${t}"`),e.hasMediaKeys=!0,r.then((e=>e?this.setMediaKeysServerCertificate(n,t,e):n)))));return i.catch((e=>{this.error(`Failed to create media-keys for "${t}"}: ${e}`)})),i}))}return A.then((()=>s.mediaKeys))}createMediaKeySessionContext({decryptdata:t,keySystem:e,mediaKeys:n}){this.log(`Creating key-system session "${e}" keyId: ${D(t.keyId||[])} keyUri: ${t.uri}`);const r=n.createSession(),i={decryptdata:t,keySystem:e,mediaKeys:n,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(i),i}renewKeySession(t){const e=t.decryptdata;if(e.pssh){const n=this.createMediaKeySessionContext(t),r=wA(e),i="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(n,i,e.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(t)}updateKeySession(t,e){const n=t.mediaKeysSession;return this.log(`Updating key-session "${n.sessionId}" for keyId ${D(t.decryptdata.keyId||[])}\n } (data length: ${e.byteLength})`),n.update(e)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map((t=>({keySystem:t,hasMediaKeys:this.keySystemAccessPromises[t].hasMediaKeys}))).filter((({hasMediaKeys:t})=>!!t)).map((({keySystem:t})=>xn(t))).filter((t=>!!t))}getKeySystemAccess(t){return this.getKeySystemSelectionPromise(t).then((({keySystem:t,mediaKeys:e})=>this.attemptSetMediaKeys(t,e)))}selectKeySystem(t){return new Promise(((e,n)=>{this.getKeySystemSelectionPromise(t).then((({keySystem:t})=>{const r=xn(t);r?e(r):n(new Error(`Unable to find format for key-system "${t}"`))})).catch(n)}))}selectKeySystemFormat(t){const e=Object.keys(t.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${t.sn} ${t.type}: ${t.level}) key formats ${e.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(e)),this.keyFormatPromise}getKeyFormatPromise(t){const e=In(this.config),n=t.map(Sn).filter((t=>!!t&&-1!==e.indexOf(t)));return this.selectKeySystem(n)}getKeyStatus(t){const{mediaKeySessions:e}=this;for(let n=0;n<e.length;n++){const r=yA(t,e[n]);if(r)return r}}loadKey(t){const e=t.keyInfo.decryptdata,n=wA(e),r=this.bannedKeyIds[n];if(r||"internal-error"===this.getKeyStatus(e)){const n=BA(r||"internal-error",e);return this.handleError(n,t.frag),Promise.reject(n)}const i=`(keyId: ${n} format: "${e.keyFormat}" method: ${e.method} uri: ${e.uri})`;this.log(`Starting session for key ${i}`);const s=this.keyIdToKeySessionPromise[n];if(!s){const r=this.getKeySystemForKeyPromise(e).then((({keySystem:n,mediaKeys:r})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${t.frag.sn} ${t.frag.type}: ${t.frag.level} using key ${i}`),this.attemptSetMediaKeys(n,r).then((()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:n,mediaKeys:r,decryptdata:e}))))))).then((t=>{const n=e.pssh?e.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(t,"cenc",n,"playlist-key")}));return r.catch((e=>this.handleError(e,t.frag))),this.keyIdToKeySessionPromise[n]=r,r}return s.catch((n=>{if(n instanceof vA){const r=v({},n.data);"internal-error"===this.getKeyStatus(e)&&(r.decryptdata=e);const i=new vA(r,n.message);this.handleError(i,t.frag)}})),s}throwIfDestroyed(t="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(t,e){if(this.hls)if(t instanceof vA){e&&(t.data.frag=e);const n=t.data.decryptdata;this.error(`${t.message}${n?` (${D(n.keyId||[])})`:""}`),this.hls.trigger(o.ERROR,t.data)}else this.error(t.message),this.hls.trigger(o.ERROR,{type:A.KEY_SYSTEM_ERROR,details:a.KEY_SYSTEM_NO_KEYS,error:t,fatal:!0})}getKeySystemForKeyPromise(t){const e=wA(t),n=this.keyIdToKeySessionPromise[e];if(!n){const e=Sn(t.keyFormat),n=e?[e]:In(this.config);return this.attemptKeySystemAccess(n)}return n}getKeySystemSelectionPromise(t){if(t.length||(t=In(this.config)),0===t.length)throw new vA({type:A.KEY_SYSTEM_ERROR,details:a.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${re({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(t)}attemptSetMediaKeys(t,e){if(this.mediaKeys===e)return Promise.resolve();const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${t}"`);const r=Promise.all(n).then((()=>{if(!this.media)throw this.mediaKeys=null,new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(e)}));return this.mediaKeys=e,this.setMediaKeysQueue.push(r),r.then((()=>{this.log(`Media-keys set for "${t}"`),n.push(r),this.setMediaKeysQueue=this.setMediaKeysQueue.filter((t=>-1===n.indexOf(t)))}))}generateRequestWithPreferredKeySession(t,e,n,r){var i;const s=null==(i=this.config.drmSystems)||null==(i=i[t.keySystem])?void 0:i.generateRequest;if(s)try{const r=s.call(this.hls,e,n,t);if(!r)throw new Error("Invalid response from configured generateRequest filter");e=r.initDataType,n=r.initData?r.initData:null,t.decryptdata.pssh=n?new Uint8Array(n):null}catch(t){if(this.warn(t.message),this.hls&&this.hls.config.debug)throw t}if(null===n)return this.log(`Skipping key-session request for "${r}" (no initData)`),Promise.resolve(t);const o=wA(t.decryptdata),l=t.decryptdata.uri;this.log(`Generating key-session request for "${r}" keyId: ${o} URI: ${l} (init data type: ${e} length: ${n.byteLength})`);const u=new Nr,c=t._onmessage=e=>{const n=t.mediaKeysSession;if(!n)return void u.emit("error",new Error("invalid state"));const{messageType:r,message:i}=e;this.log(`"${r}" message event for session "${n.sessionId}" message size: ${i.byteLength}`),"license-request"===r||"license-renewal"===r?this.renewLicense(t,i).catch((t=>{u.eventNames().length?u.emit("error",t):this.handleError(t)})):"license-release"===r?t.keySystem===En.FAIRPLAY&&this.updateKeySession(t,yn("acknowledged")).then((()=>this.removeSession(t))).catch((t=>this.handleError(t))):this.warn(`unhandled media key message type "${r}"`)},h=(t,e)=>{let n;e.keyStatus=t,t.startsWith("usable")?u.emit("resolved"):"internal-error"===t||"output-restricted"===t||"output-downscaled"===t?n=BA(t,e.decryptdata):"expired"===t?n=new Error(`key expired (keyId: ${o})`):"released"===t?n=new Error("key released"):"status-pending"===t||this.warn(`unhandled key status change "${t}" (keyId: ${o})`),n&&(u.eventNames().length?u.emit("error",n):this.handleError(n))},d=t._onkeystatuseschange=e=>{if(!t.mediaKeysSession)return void u.emit("error",new Error("invalid state"));const n=this.getKeyStatuses(t);if(!Object.keys(n).some((t=>"status-pending"!==n[t])))return;if("expired"===n[o])return this.log(`Expired key ${re(n)} in key-session "${t.mediaKeysSession.sessionId}"`),void this.renewKeySession(t);let r=n[o];if(r)h(r,t);else{var i;const e=1e3;t.keyStatusTimeouts||(t.keyStatusTimeouts={}),(i=t.keyStatusTimeouts)[o]||(i[o]=self.setTimeout((()=>{if(!t.mediaKeysSession||!this.mediaKeys)return;const n=this.getKeyStatus(t.decryptdata);if(n&&"status-pending"!==n)return this.log(`No status for keyId ${o} in key-session "${t.mediaKeysSession.sessionId}". Using session key-status ${n} from other session.`),h(n,t);this.log(`key status for ${o} in key-session "${t.mediaKeysSession.sessionId}" timed out after ${e}ms`),r="internal-error",h(r,t)}),e)),this.log(`No status for keyId ${o} (${re(n)}).`)}};wr(t.mediaKeysSession,"message",c),wr(t.mediaKeysSession,"keystatuseschange",d);const f=new Promise(((t,e)=>{u.on("error",e),u.on("resolved",t)}));return t.mediaKeysSession.generateRequest(e,n).then((()=>{this.log(`Request generated for key-session "${t.mediaKeysSession.sessionId}" keyId: ${o} URI: ${l}`)})).catch((e=>{throw new vA({type:A.KEY_SYSTEM_ERROR,details:a.KEY_SYSTEM_NO_SESSION,error:e,decryptdata:t.decryptdata,fatal:!1},`Error generating key-session request: ${e}`)})).then((()=>f)).catch((e=>(u.removeAllListeners(),this.removeSession(t).then((()=>{throw e}))))).then((()=>(u.removeAllListeners(),t)))}getKeyStatuses(t){const e={};return t.mediaKeysSession.keyStatuses.forEach(((n,r)=>{if("string"==typeof r&&"object"==typeof n){const t=r;r=n,n=t}const i="buffer"in r?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r);t.keySystem===En.PLAYREADY&&16===i.length&&vn(i);const s=D(i);"internal-error"===n&&(this.bannedKeyIds[s]=n),this.log(`key status change "${n}" for keyStatuses keyId: ${s} key-session "${t.mediaKeysSession.sessionId}"`),e[s]=n})),e}fetchServerCertificate(t){const e=this.config,n=new(0,e.loader)(e),r=this.getServerCertificateUrl(t);return r?(this.log(`Fetching server certificate for "${t}"`),new Promise(((i,s)=>{const o={responseType:"arraybuffer",url:r},l=e.certLoadPolicy.default,u={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},c={onSuccess:(t,e,n,r)=>{i(t.data)},onError:(e,n,i,l)=>{s(new vA({type:A.KEY_SYSTEM_ERROR,details:a.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:i,response:v({url:o.url,data:void 0},e)},`"${t}" certificate request failed (${r}). Status: ${e.code} (${e.text})`))},onTimeout:(e,n,i)=>{s(new vA({type:A.KEY_SYSTEM_ERROR,details:a.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:i,response:{url:o.url,data:void 0}},`"${t}" certificate request timed out (${r})`))},onAbort:(t,e,n)=>{s(new Error("aborted"))}};n.load(o,u,c)}))):Promise.resolve()}setMediaKeysServerCertificate(t,e,n){return new Promise(((r,i)=>{t.setServerCertificate(n).then((i=>{this.log(`setServerCertificate ${i?"success":"not supported by CDM"} (${n.byteLength}) on "${e}"`),r(t)})).catch((t=>{i(new vA({type:A.KEY_SYSTEM_ERROR,details:a.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:t,fatal:!0},t.message))}))}))}renewLicense(t,e){return this.requestLicense(t,new Uint8Array(e)).then((e=>this.updateKeySession(t,new Uint8Array(e)).catch((e=>{throw new vA({type:A.KEY_SYSTEM_ERROR,details:a.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:t.decryptdata,error:e,fatal:!1},e.message)}))))}unpackPlayReadyKeyMessage(t,e){const n=String.fromCharCode.apply(null,new Uint16Array(e.buffer));if(!n.includes("PlayReadyKeyMessage"))return t.setRequestHeader("Content-Type","text/xml; charset=utf-8"),e;const r=(new DOMParser).parseFromString(n,"application/xml"),i=r.querySelectorAll("HttpHeader");if(i.length>0){let e;for(let n=0,r=i.length;n<r;n++){var s,A;e=i[n];const r=null==(s=e.querySelector("name"))?void 0:s.textContent,a=null==(A=e.querySelector("value"))?void 0:A.textContent;r&&a&&t.setRequestHeader(r,a)}}const a=r.querySelector("Challenge"),o=null==a?void 0:a.textContent;if(!o)throw new Error("Cannot find <Challenge> in key message");return yn(atob(o))}setupLicenseXHR(t,e,n,r){const i=this.config.licenseXhrSetup;return i?Promise.resolve().then((()=>{if(!n.decryptdata)throw new Error("Key removed");return i.call(this.hls,t,e,n,r)})).catch((s=>{if(!n.decryptdata)throw s;return t.open("POST",e,!0),i.call(this.hls,t,e,n,r)})).then((n=>{t.readyState||t.open("POST",e,!0);return{xhr:t,licenseChallenge:n||r}})):(t.open("POST",e,!0),Promise.resolve({xhr:t,licenseChallenge:r}))}requestLicense(t,e){const n=this.config.keyLoadPolicy.default;return new Promise(((r,i)=>{const s=this.getLicenseServerUrlOrThrow(t.keySystem);this.log(`Sending license request to URL: ${s}`);const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=()=>{if(!this.hls||!t.mediaKeysSession)return i(new Error("invalid state"));if(4===o.readyState)if(200===o.status){this._requestLicenseFailureCount=0;let e=o.response;this.log(`License received ${e instanceof ArrayBuffer?e.byteLength:e}`);const n=this.config.licenseResponseCallback;if(n)try{e=n.call(this.hls,o,s,t)}catch(t){this.error(t)}r(e)}else{const l=n.errorRetry,u=l?l.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u||o.status>=400&&o.status<500)i(new vA({type:A.KEY_SYSTEM_ERROR,details:a.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:t.decryptdata,fatal:!0,networkDetails:o,response:{url:s,data:void 0,code:o.status,text:o.statusText}},`License Request XHR failed (${s}). Status: ${o.status} (${o.statusText})`));else{const n=u-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${n} attempts left`),this.requestLicense(t,e).then(r,i)}}},t.licenseXhr&&t.licenseXhr.readyState!==XMLHttpRequest.DONE&&t.licenseXhr.abort(),t.licenseXhr=o,this.setupLicenseXHR(o,s,t,e).then((({xhr:e,licenseChallenge:n})=>{t.keySystem==En.PLAYREADY&&(n=this.unpackPlayReadyKeyMessage(e,n)),e.send(n)})).catch(i)}))}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(t,e){if(!this.config.emeEnabled)return;const n=e.media;this.media=n,wr(n,"encrypted",this.onMediaEncrypted),wr(n,"waitingforkey",this.onWaitingForKey)}onMediaDetached(){const t=this.media;t&&(yr(t,"encrypted",this.onMediaEncrypted),yr(t,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var t;if(this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={},!this.mediaKeys&&!this.mediaKeySessions.length)return;const e=this.media,n=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,Qn.clearKeyUriToKeyIdMap();const r=n.length;_A.CDMCleanupPromise=Promise.all(n.map((t=>this.removeSession(t))).concat((null==e||null==(t=e.setMediaKeys(null))?void 0:t.catch((t=>{this.log(`Could not clear media keys: ${t}`),this.hls&&this.hls.trigger(o.ERROR,{type:A.OTHER_ERROR,details:a.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${t}`)})})))||Promise.resolve())).catch((t=>{this.log(`Could not close sessions and clear media keys: ${t}`),this.hls&&this.hls.trigger(o.ERROR,{type:A.OTHER_ERROR,details:a.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${t}`)})})).then((()=>{r&&this.log("finished closing key sessions and clearing media keys")}))}onManifestLoading(){this.keyFormatPromise=null,this.bannedKeyIds={}}onManifestLoaded(t,{sessionKeys:e}){if(e&&this.config.emeEnabled&&!this.keyFormatPromise){const t=e.reduce(((t,e)=>(-1===t.indexOf(e.keyFormat)&&t.push(e.keyFormat),t)),[]);this.log(`Selecting key-system from session-keys ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)}}removeSession(t){const{mediaKeysSession:e,licenseXhr:n,decryptdata:r}=t;if(e){this.log(`Remove licenses and keys and close session "${e.sessionId}" keyId: ${D((null==r?void 0:r.keyId)||[])}`),t._onmessage&&(e.removeEventListener("message",t._onmessage),t._onmessage=void 0),t._onkeystatuseschange&&(e.removeEventListener("keystatuseschange",t._onkeystatuseschange),t._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),t.mediaKeysSession=t.decryptdata=t.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(t);i>-1&&this.mediaKeySessions.splice(i,1);const{keyStatusTimeouts:s}=t;s&&Object.keys(s).forEach((t=>self.clearTimeout(s[t])));const{drmSystemOptions:l}=this.config,u=function(t){var e;return!(!t||"persistent-license"!==t.sessionType&&(null==(e=t.sessionTypes)||!e.some((t=>"persistent-license"===t))))}(l)?new Promise(((t,n)=>{self.setTimeout((()=>n(new Error("MediaKeySession.remove() timeout"))),8e3),e.remove().then(t).catch(n)})):Promise.resolve();return u.catch((t=>{this.log(`Could not remove session: ${t}`),this.hls&&this.hls.trigger(o.ERROR,{type:A.OTHER_ERROR,details:a.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${t}`)})})).then((()=>e.close())).catch((t=>{this.log(`Could not close session: ${t}`),this.hls&&this.hls.trigger(o.ERROR,{type:A.OTHER_ERROR,details:a.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${t}`)})}))}return Promise.resolve()}}function wA(t){if(!t)throw new Error("Could not read keyId of undefined decryptdata");if(null===t.keyId)throw new Error("keyId is null");return D(t.keyId)}function yA(t,e){return t.keyId&&e.mediaKeysSession.keyStatuses.has(t.keyId)?e.mediaKeysSession.keyStatuses.get(t.keyId):t.matches(e.decryptdata)?e.keyStatus:void 0}_A.CDMCleanupPromise=void 0;class vA extends Error{constructor(t,e){super(e),this.data=void 0,t.error||(t.error=new Error(e)),this.data=t,t.err=t.error}}function BA(t,e){const n="output-restricted"===t,r=n?a.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:a.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new vA({type:A.KEY_SYSTEM_ERROR,details:r,fatal:!1,decryptdata:e},n?"HDCP level output restricted":`key status changed to "${t}"`)}function bA(t,e){let n;try{n=new Event("addtrack")}catch(t){n=document.createEvent("Event"),n.initEvent("addtrack",!1,!1)}n.track=t,e.dispatchEvent(n)}function EA(t,e){const n=t.mode;if("disabled"===n&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(e.id))try{if(t.addCue(e),!t.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(n){T.debug(`[texttrack-utils]: ${n}`);try{const n=new self.TextTrackCue(e.startTime,e.endTime,e.text);n.id=e.id,t.addCue(n)}catch(t){T.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${t}`)}}"disabled"===n&&(t.mode=n)}function CA(t,e){const n=t.mode;if("disabled"===n&&(t.mode="hidden"),t.cues)for(let n=t.cues.length;n--;)e&&t.cues[n].removeEventListener("enter",e),t.removeCue(t.cues[n]);"disabled"===n&&(t.mode=n)}function kA(t,e,n,r){const i=t.mode;if("disabled"===i&&(t.mode="hidden"),t.cues&&t.cues.length>0){const i=function(t,e,n){const r=[],i=function(t,e){if(e<=t[0].startTime)return 0;const n=t.length-1;if(e>t[n].endTime)return-1;let r,i=0,s=n;for(;i<=s;)if(r=Math.floor((s+i)/2),e<t[r].startTime)s=r-1;else{if(!(e>t[r].startTime&&i<n))return r;i=r+1}return t[i].startTime-e<e-t[s].startTime?i:s}(t,e);if(i>-1)for(let s=i,A=t.length;s<A;s++){const i=t[s];if(i.startTime>=e&&i.endTime<=n)r.push(i);else if(i.startTime>n)return r}return r}(t.cues,e,n);for(let e=0;e<i.length;e++)r&&!r(i[e])||t.removeCue(i[e])}"disabled"===i&&(t.mode=i)}function FA(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];"subtitles"!==r.kind&&"captions"!==r.kind||!r.label||e.push(t[n])}return e}function TA(t){let e=5381,n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return(e>>>0).toString()}const SA=.025;let xA=function(t){return t[t.Point=0]="Point",t[t.Range=1]="Range",t}({});function IA(t,e,n){return`${t.identifier}-${n+1}-${TA(e)}`}class DA{constructor(t,e){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=e,this.dateRange=t,this.setDateRange(t)}setDateRange(t){this.dateRange=t,this.resumeOffset=t.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=t.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=t.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=t.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var t;this.appendInPlaceStarted=!1,null==(t=this.assetListLoader)||t.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(t){var e;if(t>0&&t>=this.assetList.length)return!0;const n=this.playoutLimit;if(t<=0||isNaN(n))return!1;if(0===n)return!0;return((null==(e=this.assetList[t])?void 0:e.startOffset)||0)>n}findAssetIndex(t){return this.assetList.indexOf(t)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const t=this.dateRange.startTime;if(this.snapOptions.out){const e=this.dateRange.tagAnchor;if(e)return UA(t,e)}return t}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(0===this.startTime||this.snapOptions.out)return!0;const t=this.dateRange.tagAnchor;if(t){const e=this.dateRange.startTime;return e-UA(e,t)<.1}return!1}get resumptionOffset(){const t=this.resumeOffset,e=r(t)?t:this.duration;return this.cumulativeDuration+e}get resumeTime(){const t=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const e=this.resumeAnchor;if(e)return UA(t,e)}return t}get appendInPlace(){return!!this.appendInPlaceStarted||!this.appendInPlaceDisabled&&!(this.cue.once||this.cue.pre||!this.startIsAligned||!(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<SA))}set appendInPlace(t){this.appendInPlaceStarted?this.resetOnResume=!t:this.appendInPlaceDisabled=!t}get timelineStart(){return null!==this._timelineStart?this._timelineStart:this.startTime}set timelineStart(t){this._timelineStart=t}get duration(){const t=this.playoutLimit;let e;return e=null!==this._duration?this._duration:this.dateRange.duration?this.dateRange.duration:this.dateRange.plannedDuration||0,!isNaN(t)&&t<e&&(e=t),e}set duration(t){this._duration=t}get cue(){return this.dateRange.cue}get timelineOccupancy(){return"RANGE"===this.dateRange.attr["X-TIMELINE-OCCUPIES"]?xA.Range:xA.Point}get supplementsPrimary(){return"PRIMARY"===this.dateRange.attr["X-TIMELINE-STYLE"]}get contentMayVary(){return"NO"!==this.dateRange.attr["X-CONTENT-MAY-VARY"]}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||null!==this.assetListResponse}toString(){return`["${(t=this).identifier}" ${t.cue.pre?"<pre>":t.cue.post?"<post>":""}${t.timelineStart.toFixed(2)}-${t.resumeTime.toFixed(2)}]`;var t}}function UA(t,e){return t-e.start<e.duration/2&&!(Math.abs(t-(e.start+e.duration))<SA)?e.start:e.start+e.duration}function LA(t,e,n){const r=new self.URL(t,n);return"data:"!==r.protocol&&r.searchParams.set("_HLS_primary_id",e),r}function RA(t,e){for(;null!=(n=t.assetList[++e])&&n.error;)var n;return e}function QA(t){const e=t.timelineStart,n=t.duration||0;return`["${t.identifier}" ${e.toFixed(2)}-${(e+n).toFixed(2)}]`}class OA{constructor(t,e,n,r){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(o.PLAYOUT_LIMIT_REACHED,{})};const i=this.hls=new t(e);this.interstitial=n,this.assetItem=r;const s=()=>{this.hasDetails=!0};i.once(o.LEVEL_LOADED,s),i.once(o.AUDIO_TRACK_LOADED,s),i.once(o.SUBTITLE_TRACK_LOADED,s),i.on(o.MEDIA_ATTACHING,((t,{media:e})=>{this.removeMediaListeners(),this.mediaAttached=e;this.interstitial.playoutLimit&&(e.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&i.on(o.BUFFER_APPENDED,(()=>{const t=this.bufferedEnd;this.reachedPlayout(t)&&(this._bufferedEosTime=t,i.trigger(o.BUFFERED_TO_END,void 0))})))}))}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const t=this.hls;if(t)if(t.url)t.levels.length&&!t.started&&t.startLoad(-1,!0);else{let e=this.assetItem.uri;try{e=LA(e,t.config.primarySessionId||"").href}catch(t){}t.loadSource(e)}}bufferedInPlaceToEnd(t){var e;if(!this.appendInPlace)return!1;if(null!=(e=this.hls)&&e.bufferedToEnd)return!0;if(!t)return!1;const n=Math.min(this._bufferedEosTime||1/0,this.duration),r=this.timelineOffset,i=nn.bufferInfo(t,r,0);return this.getAssetTime(i.end)>=n-.02}reachedPlayout(t){const e=this.interstitial.playoutLimit;return this.startOffset+t>=e}get destroyed(){var t;return!(null!=(t=this.hls)&&t.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var t;return(null==(t=this.hls)?void 0:t.media)||null}get bufferedEnd(){const t=this.media||this.mediaAttached;if(!t)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const e=nn.bufferInfo(t,t.currentTime,.001);return this.getAssetTime(e.end)}get currentTime(){const t=this.media||this.mediaAttached;return t?this.getAssetTime(t.currentTime):this._currentTime||0}get duration(){const t=this.assetItem.duration;if(!t)return 0;const e=this.interstitial.playoutLimit;if(e){const n=e-this.startOffset;if(n>0&&n<t)return n}return t}get remaining(){const t=this.duration;return t?Math.max(0,t-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var t;return(null==(t=this.hls)?void 0:t.config.timelineOffset)||0}set timelineOffset(t){const e=this.timelineOffset;if(t!==e){const n=t-e;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=t}}}getAssetTime(t){const e=this.timelineOffset,n=this.duration;return Math.min(Math.max(0,t-e),n)}removeMediaListeners(){const t=this.mediaAttached;t&&(this._currentTime=t.currentTime,this.bufferSnapShot(),t.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){var t;this.mediaAttached&&(null!=(t=this.hls)&&t.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd))}destroy(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(t){var e;this.loadSource(),null==(e=this.hls)||e.attachMedia(t)}detachMedia(){var t;this.removeMediaListeners(),this.mediaAttached=null,null==(t=this.hls)||t.detachMedia()}resumeBuffering(){var t;null==(t=this.hls)||t.resumeBuffering()}pauseBuffering(){var t;null==(t=this.hls)||t.pauseBuffering()}transferMedia(){var t;return this.bufferSnapShot(),(null==(t=this.hls)?void 0:t.transferMedia())||null}resetDetails(){const t=this.hls;if(t&&this.hasDetails){t.stopLoad();const e=t=>delete t.details;t.levels.forEach(e),t.allAudioTracks.forEach(e),t.allSubtitleTracks.forEach(e),this.hasDetails=!1}}on(t,e,n){var r;null==(r=this.hls)||r.on(t,e)}once(t,e,n){var r;null==(r=this.hls)||r.once(t,e)}off(t,e,n){var r;null==(r=this.hls)||r.off(t,e)}toString(){var t;return`HlsAssetPlayer: ${QA(this.assetItem)} ${null==(t=this.hls)?void 0:t.sessionId} ${this.appendInPlace?"append-in-place":""}`}}class PA extends B{constructor(t,e){super("interstitials-sched",e),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=t}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach((t=>t.reset())),this.events=this.items=null}resetErrorsInRange(t,e){return this.events?this.events.reduce(((n,r)=>t<=r.startOffset&&e>r.startOffset?(delete r.error,n+1):n),0):0}get duration(){const t=this.items;return t?t[t.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(t){return t&&this.eventMap[t]||null}hasEvent(t){return t in this.eventMap}findItemIndex(t,e){if(t.event)return this.findEventIndex(t.event.identifier);let n=-1;t.nextEvent?n=this.findEventIndex(t.nextEvent.identifier)-1:t.previousEvent&&(n=this.findEventIndex(t.previousEvent.identifier)+1);const r=this.items;if(r)for(r[n]||(void 0===e&&(e=t.start),n=this.findItemIndexAtTime(e));n>=0&&null!=(i=r[n])&&i.event;){var i;n--}return n}findItemIndexAtTime(t,e){const n=this.items;if(n)for(let r=0;r<n.length;r++){let i=n[r];if(e&&"primary"!==e&&(i=i[e]),t===i.start||t>i.start&&t<i.end)return r}return-1}findJumpRestrictedIndex(t,e){const n=this.items;if(n)for(let r=t;r<=e&&n[r];r++){const t=n[r].event;if(null!=t&&t.restrictions.jump&&!t.appendInPlace)return r}return-1}findEventIndex(t){const e=this.items;if(e)for(let r=e.length;r--;){var n;if((null==(n=e[r].event)?void 0:n.identifier)===t)return r}return-1}findAssetIndex(t,e){const n=t.assetList,r=n.length;if(r>1)for(let t=0;t<r;t++){const i=n[t];if(!i.error){const n=i.timelineStart;if(e===n||e>n&&(e<n+(i.duration||0)||t===r-1))return t}}return 0}get assetIdAtEnd(){var t;const e=null==(t=this.items)||null==(t=t[this.length-1])?void 0:t.event;if(e){const t=e.assetList,n=t[t.length-1];if(n)return n.identifier}return null}parseInterstitialDateRanges(t,e){const n=t.main.details,{dateRanges:r}=n,i=this.events,s=this.parseDateRanges(r,{url:n.url},e),A=Object.keys(r),a=i?i.filter((t=>!A.includes(t.identifier))):[];s.length&&s.sort(((t,e)=>{const n=t.cue.pre,r=t.cue.post,i=e.cue.pre,s=e.cue.post;if(n&&!i)return-1;if(i&&!n)return 1;if(r&&!s)return 1;if(s&&!r)return-1;if(!(n||i||r||s)){const n=t.startTime,r=e.startTime;if(n!==r)return n-r}return t.dateRange.tagOrder-e.dateRange.tagOrder})),this.events=s,a.forEach((t=>{this.removeEvent(t)})),this.updateSchedule(t,a)}updateSchedule(t,e=[],n=!1){const r=this.events||[];if(r.length||e.length||this.length<2){const i=this.items,s=this.parseSchedule(r,t);(n||e.length||(null==i?void 0:i.length)!==s.length||s.some(((t,e)=>Math.abs(t.playout.start-i[e].playout.start)>.005||Math.abs(t.playout.end-i[e].playout.end)>.005)))&&(this.items=s,this.onScheduleUpdate(e,i))}}parseDateRanges(t,e,n){const r=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const A=i[s],a=t[A];if(a.isInterstitial){let t=this.eventMap[A];t?t.setDateRange(a):(t=new DA(a,e),this.eventMap[A]=t,!1===n&&(t.appendInPlace=n)),r.push(t)}}return r}parseSchedule(t,e){const n=[],r=e.main.details,i=r.live?1/0:r.edge;let s=0;if((t=t.filter((t=>!(t.error||t.cue.once&&t.hasPlayed)))).length){this.resolveOffsets(t,e);let r=0,a=0;if(t.forEach(((e,A)=>{const o=e.cue.pre,l=e.cue.post,u=t[A-1]||null,c=e.appendInPlace,h=l?i:e.startOffset,d=e.duration,f=e.timelineOccupancy===xA.Range?d:0,p=e.resumptionOffset,g=(null==u?void 0:u.startTime)===h,m=h+e.cumulativeDuration;let _=c?m+d:h+p;if(o||!l&&h<=0){const t=a;a+=f,e.timelineStart=m;const r=s;s+=d,n.push({event:e,start:m,end:_,playout:{start:r,end:s},integrated:{start:t,end:a}})}else{if(!(h<=i))return;{if(!g){const i=h-r;if(i>.033){const o=r,l=a;a+=i;const u=s;s+=i;const c={previousEvent:t[A-1]||null,nextEvent:e,start:o,end:o+i,playout:{start:u,end:s},integrated:{start:l,end:a}};n.push(c)}else i>0&&u&&(u.cumulativeDuration+=i,n[n.length-1].end=h)}l&&(_=m),e.timelineStart=m;const i=a;a+=f;const o=s;s+=d,n.push({event:e,start:m,end:_,playout:{start:o,end:s},integrated:{start:i,end:a}})}}const w=e.resumeTime;r=l||w>i?i:w})),r<i){var A;const t=r,e=a,o=i-r;a+=o;const l=s;s+=o,n.push({previousEvent:(null==(A=n[n.length-1])?void 0:A.event)||null,nextEvent:null,start:r,end:t+o,playout:{start:l,end:s},integrated:{start:e,end:a}})}this.setDurations(i,s,a)}else{const t=0;n.push({previousEvent:null,nextEvent:null,start:t,end:i,playout:{start:t,end:i},integrated:{start:t,end:i}}),this.setDurations(i,i,i)}return n}setDurations(t,e,n){this.durations={primary:t,playout:e,integrated:n}}resolveOffsets(t,e){const n=e.main.details,i=n.live?1/0:n.edge;let s=0,A=-1;t.forEach(((a,o)=>{const l=a.cue.pre,u=a.cue.post,c=l?0:u?i:a.startTime;this.updateAssetDurations(a);if(A===c?a.cumulativeDuration=s:(s=0,A=c),!u&&a.snapOptions.in&&(a.resumeAnchor=de(null,n.fragments,a.startOffset+a.resumptionOffset,0,0)||void 0),a.appendInPlace&&!a.appendInPlaceStarted){this.primaryCanResumeInPlaceAt(a,e)||(a.appendInPlace=!1)}if(!a.appendInPlace&&o+1<t.length){t[o+1].startTime-t[o].resumeTime<.033&&(t[o+1].appendInPlace=!1,t[o+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${a}`))}const h=r(a.resumeOffset)?a.resumeOffset:a.duration;s+=h}))}primaryCanResumeInPlaceAt(t,e){const n=t.resumeTime,r=t.startTime+t.resumptionOffset;if(Math.abs(n-r)>SA)return this.log(`"${t.identifier}" resumption ${n} not aligned with estimated timeline end ${r}`),!1;return!Object.keys(e).some((r=>{const i=e[r].details,s=i.edge;if(n>=s)return this.log(`"${t.identifier}" resumption ${n} past ${r} playlist end ${s}`),!1;const A=de(null,i.fragments,n);if(!A)return this.log(`"${t.identifier}" resumption ${n} does not align with any fragments in ${r} playlist (${i.fragStart}-${i.fragmentEnd})`),!0;const a="audio"===r?.175:0;return!(Math.abs(A.start-n)<SA+a||Math.abs(A.end-n)<SA+a)&&(this.log(`"${t.identifier}" resumption ${n} not aligned with ${r} fragment bounds (${A.start}-${A.end} sn: ${A.sn} cc: ${A.cc})`),!0)}))}updateAssetDurations(t){if(!t.assetListLoaded)return;const e=t.timelineStart;let n=0,r=!1,i=!1;for(let s=0;s<t.assetList.length;s++){const A=t.assetList[s],a=e+n;A.startOffset=n,A.timelineStart=a,r||(r=null===A.duration),i||(i=!!A.error);n+=A.error?0:A.duration||0}t.duration=r&&!i?Math.max(n,t.duration):n}removeEvent(t){t.reset(),delete this.eventMap[t.identifier]}}function MA(t){return`[${t.event?'"'+t.event.identifier+'"':"primary"}: ${t.start.toFixed(2)}-${t.end.toFixed(2)}]`}class NA{constructor(t){this.hls=void 0,this.hls=t}destroy(){this.hls=null}loadAssetList(t,e){const n=t.assetListUrl;let r;try{r=LA(n,this.hls.sessionId,t.baseUrl)}catch(e){const r=this.assignAssetListError(t,a.ASSET_LIST_LOAD_ERROR,e,n);return void this.hls.trigger(o.ERROR,r)}e&&"data:"!==r.protocol&&r.searchParams.set("_HLS_start_offset",""+e);const i=this.hls.config,s=new(0,i.loader)(i),A={responseType:"json",url:r.href},l=i.interstitialAssetListLoadPolicy.default,u={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},c={onSuccess:(e,n,r,i)=>{const s=e.data,A=null==s?void 0:s.ASSETS;if(Array.isArray(A))t.assetListResponse=s,this.hls.trigger(o.ASSET_LIST_LOADED,{event:t,assetListResponse:s,networkDetails:i});else{const e=this.assignAssetListError(t,a.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),r.url,n,i);this.hls.trigger(o.ERROR,e)}},onError:(e,n,r,i)=>{const s=this.assignAssetListError(t,a.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${e.code} ${e.text} (${n.url})`),n.url,i,r);this.hls.trigger(o.ERROR,s)},onTimeout:(e,n,r)=>{const i=this.assignAssetListError(t,a.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${n.url})`),n.url,e,r);this.hls.trigger(o.ERROR,i)}};return s.load(A,u,c),this.hls.trigger(o.ASSET_LIST_LOADING,{event:t}),s}assignAssetListError(t,e,n,r,i,s){return t.error=n,{type:A.NETWORK_ERROR,details:e,fatal:!1,interstitial:t,url:r,error:n,networkDetails:s,stats:i}}}function HA(t){null==t||t.play().catch((()=>{}))}function KA(t,e){return`[${t}] Advancing timeline position to ${e}`}class $A{constructor(t){this.buffered=void 0;const e=(e,n,r)=>{if((n>>>=0)>r-1)throw new DOMException(`Failed to execute '${e}' on 'TimeRanges': The index provided (${n}) is greater than the maximum bound (${r})`);return t[n][e]};this.buffered={get length(){return t.length},end(n){return e("end",n,t.length)},start(n){return e("start",n,t.length)}}}}const GA={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},VA=t=>String.fromCharCode(GA[t]||t),jA=15,ZA=100,WA={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},zA={17:2,18:4,21:6,22:8,23:10,19:13,20:15},YA={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},XA={25:2,26:4,29:6,30:8,31:10,27:13,28:15},qA=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class JA{constructor(){this.time=null,this.verboseLevel=0}log(t,e){if(this.verboseLevel>=t){const n="function"==typeof e?e():e;T.log(`${this.time} [${t}] ${n}`)}}}const ta=function(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].toString(16));return e};class ea{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(t){const e=["foreground","underline","italics","background","flash"];for(let n=0;n<e.length;n++){const r=e[n];t.hasOwnProperty(r)&&(this[r]=t[r])}}isDefault(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash}equals(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash}copy(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class na{constructor(){this.uchar=" ",this.penState=new ea}reset(){this.uchar=" ",this.penState.reset()}setChar(t,e){this.uchar=t,this.penState.copy(e)}setPenState(t){this.penState.copy(t)}equals(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)}copy(t){this.uchar=t.uchar,this.penState.copy(t.penState)}isEmpty(){return" "===this.uchar&&this.penState.isDefault()}}class ra{constructor(t){this.chars=[],this.pos=0,this.currPenState=new ea,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<ZA;t++)this.chars.push(new na);this.logger=t}equals(t){for(let e=0;e<ZA;e++)if(!this.chars[e].equals(t.chars[e]))return!1;return!0}copy(t){for(let e=0;e<ZA;e++)this.chars[e].copy(t.chars[e])}isEmpty(){let t=!0;for(let e=0;e<ZA;e++)if(!this.chars[e].isEmpty()){t=!1;break}return t}setCursor(t){this.pos!==t&&(this.pos=t),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>ZA&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=ZA)}moveCursor(t){const e=this.pos+t;if(t>1)for(let t=this.pos+1;t<e+1;t++)this.chars[t].setPenState(this.currPenState);this.setCursor(e)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(t){t>=144&&this.backSpace();const e=VA(t);this.pos>=ZA?this.logger.log(0,(()=>"Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!")):(this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1))}clearFromPos(t){let e;for(e=t;e<ZA;e++)this.chars[e].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const t=[];let e=!0;for(let n=0;n<ZA;n++){const r=this.chars[n].uchar;" "!==r&&(e=!1),t.push(r)}return e?"":t.join("")}setPenStyles(t){this.currPenState.setStyles(t);this.chars[this.pos].setPenState(this.currPenState)}}class ia{constructor(t){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let e=0;e<jA;e++)this.rows.push(new ra(t));this.logger=t}reset(){for(let t=0;t<jA;t++)this.rows[t].clear();this.currRow=14}equals(t){let e=!0;for(let n=0;n<jA;n++)if(!this.rows[n].equals(t.rows[n])){e=!1;break}return e}copy(t){for(let e=0;e<jA;e++)this.rows[e].copy(t.rows[e])}isEmpty(){let t=!0;for(let e=0;e<jA;e++)if(!this.rows[e].isEmpty()){t=!1;break}return t}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(t){this.rows[this.currRow].insertChar(t)}setPen(t){this.rows[this.currRow].setPenStyles(t)}moveCursor(t){this.rows[this.currRow].moveCursor(t)}setCursor(t){this.logger.log(2,"setCursor: "+t);this.rows[this.currRow].setCursor(t)}setPAC(t){this.logger.log(2,(()=>"pacData = "+re(t)));let e=t.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(let t=0;t<jA;t++)this.rows[t].clear();const t=this.currRow+1-this.nrRollUpRows,n=this.lastOutputScreen;if(n){const r=n.rows[t].cueStartTime,i=this.logger.time;if(null!==r&&null!==i&&r<i)for(let r=0;r<this.nrRollUpRows;r++)this.rows[e-this.nrRollUpRows+r+1].copy(n.rows[t+r])}}this.currRow=e;const n=this.rows[this.currRow];if(null!==t.indent){const e=t.indent,r=Math.max(e-1,0);n.setCursor(t.indent),t.color=n.chars[r].penState.foreground}const r={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(r)}setBkgData(t){this.logger.log(2,(()=>"bkgData = "+re(t))),this.backSpace(),this.setPen(t),this.insertChar(32)}setRollUpRows(t){this.nrRollUpRows=t}rollUp(){if(null===this.nrRollUpRows)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,(()=>this.getDisplayText()));const t=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(t,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),this.logger.log(2,"Rolling up")}getDisplayText(t){t=t||!1;const e=[];let n="",r=-1;for(let n=0;n<jA;n++){const i=this.rows[n].getTextString();i&&(r=n+1,t?e.push("Row "+r+": '"+i+"'"):e.push(i.trim()))}return e.length>0&&(n=t?"["+e.join(" | ")+"]":e.join("\n")),n}getTextAndFormat(){return this.rows}}class sa{constructor(t,e,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=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new ia(n),this.nonDisplayedMemory=new ia(n),this.lastOutputScreen=new ia(n),this.currRollUpRow=this.displayedMemory.rows[14],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[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(t){this.outputFilter=t}setPAC(t){this.writeScreen.setPAC(t)}setBkgData(t){this.writeScreen.setBkgData(t)}setMode(t){t!==this.mode&&(this.mode=t,this.logger.log(2,(()=>"MODE="+t)),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)}insertChars(t){for(let e=0;e<t.length;e++)this.writeScreen.insertChar(t[e]);const e=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,(()=>e+": "+this.writeScreen.getDisplayText(!0))),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(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"),"MODE_TEXT"!==this.mode&&(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(t){this.logger.log(2,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)}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"),"MODE_POP-ON"===this.mode){const t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,(()=>"DISP: "+this.displayedMemory.getDisplayText()))}this.outputDataUpdate(!0)}ccTO(t){this.logger.log(2,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)}ccMIDROW(t){const e={flash:!1};if(e.underline=t%2==1,e.italics=t>=46,e.italics)e.foreground="white";else{const n=Math.floor(t/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];e.foreground=r[n]}this.logger.log(2,"MIDROW: "+re(e)),this.writeScreen.setPen(e)}outputDataUpdate(t=!1){const e=this.logger.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))}}class Aa{constructor(t,e,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory={a:null,b:null},this.logger=void 0;const r=this.logger=new JA;this.channels=[null,new sa(t,e,r),new sa(t+1,n,r)]}getHandler(t){return this.channels[t].getHandler()}setHandler(t,e){this.channels[t].setHandler(e)}addData(t,e){this.logger.time=t;for(let t=0;t<e.length;t+=2){const n=127&e[t],r=127&e[t+1];let i=!1,s=null;if(0===n&&0===r)continue;this.logger.log(3,(()=>"["+ta([e[t],e[t+1]])+"] -> ("+ta([n,r])+")"));const A=this.cmdHistory;if(n>=16&&n<=31){if(oa(n,r,A)){aa(null,null,A),this.logger.log(3,(()=>"Repeated command ("+ta([n,r])+") is dropped"));continue}aa(n,r,this.cmdHistory),i=this.parseCmd(n,r),i||(i=this.parseMidrow(n,r)),i||(i=this.parsePAC(n,r)),i||(i=this.parseBackgroundAttributes(n,r))}else aa(null,null,A);if(!i&&(s=this.parseChars(n,r),s)){const t=this.currentChannel;if(t&&t>0){this.channels[t].insertChars(s)}else this.logger.log(2,"No channel found yet. TEXT-MODE?")}i||s||this.logger.log(2,(()=>"Couldn't parse cleaned data "+ta([n,r])+" orig: "+ta([e[t],e[t+1]])))}}parseCmd(t,e){if(!((20===t||28===t||21===t||29===t)&&e>=32&&e<=47)&&!((23===t||31===t)&&e>=33&&e<=35))return!1;const n=20===t||21===t||23===t?1:2,r=this.channels[n];return 20===t||21===t||28===t||29===t?32===e?r.ccRCL():33===e?r.ccBS():34===e?r.ccAOF():35===e?r.ccAON():36===e?r.ccDER():37===e?r.ccRU(2):38===e?r.ccRU(3):39===e?r.ccRU(4):40===e?r.ccFON():41===e?r.ccRDC():42===e?r.ccTR():43===e?r.ccRTD():44===e?r.ccEDM():45===e?r.ccCR():46===e?r.ccENM():47===e&&r.ccEOC():r.ccTO(e-32),this.currentChannel=n,!0}parseMidrow(t,e){let n=0;if((17===t||25===t)&&e>=32&&e<=47){if(n=17===t?1:2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const r=this.channels[n];return!!r&&(r.ccMIDROW(e),this.logger.log(3,(()=>"MIDROW ("+ta([t,e])+")")),!0)}return!1}parsePAC(t,e){let n;if(!((t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127)&&!((16===t||24===t)&&e>=64&&e<=95))return!1;const r=t<=23?1:2;n=e>=64&&e<=95?1===r?WA[t]:YA[t]:1===r?zA[t]:XA[t];const i=this.channels[r];return!!i&&(i.setPAC(this.interpretPAC(n,e)),this.currentChannel=r,!0)}interpretPAC(t,e){let n;const r={color:null,italics:!1,indent:null,underline:!1,row:t};return n=e>95?e-96:e-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r}parseChars(t,e){let n,r=null,i=null;if(t>=25?(n=2,i=t-8):(n=1,i=t),i>=17&&i<=19){let t;t=17===i?e+80:18===i?e+112:e+144,this.logger.log(2,(()=>"Special char '"+VA(t)+"' in channel "+n)),r=[t]}else t>=32&&t<=127&&(r=0===e?[t]:[t,e]);return r&&this.logger.log(3,(()=>"Char codes = "+ta(r).join(","))),r}parseBackgroundAttributes(t,e){if(!((16===t||24===t)&&e>=32&&e<=47)&&!((23===t||31===t)&&e>=45&&e<=47))return!1;let n;const r={};16===t||24===t?(n=Math.floor((e-32)/2),r.background=qA[n],e%2==1&&(r.background=r.background+"_semi")):45===e?r.background="transparent":(r.foreground="black",47===e&&(r.underline=!0));const i=t<=23?1:2;return this.channels[i].setBkgData(r),!0}reset(){for(let t=0;t<Object.keys(this.channels).length;t++){const e=this.channels[t];e&&e.reset()}aa(null,null,this.cmdHistory)}cueSplitAtTime(t){for(let e=0;e<this.channels.length;e++){const n=this.channels[e];n&&n.cueSplitAtTime(t)}}}function aa(t,e,n){n.a=t,n.b=e}function oa(t,e,n){return n.a===t&&n.b===e}var la=function(){if(null!=bn&&bn.VTTCue)return self.VTTCue;const t=["","lr","rl"],e=["start","middle","end","left","right"];function n(t,e){if("string"!=typeof e)return!1;if(!Array.isArray(t))return!1;const n=e.toLowerCase();return!!~t.indexOf(n)&&n}function r(t){return n(e,t)}function i(t,...e){let n=1;for(;n<arguments.length;n++){const e=arguments[n];for(const n in e)t[n]=e[n]}return t}function s(e,s,A){const a=this,o={enumerable:!0};a.hasBeenReset=!1;let l="",u=!1,c=e,h=s,d=A,f=null,p="",g=!0,m="auto",_="start",w=50,y="middle",v=50,B="middle";Object.defineProperty(a,"id",i({},o,{get:function(){return l},set:function(t){l=""+t}})),Object.defineProperty(a,"pauseOnExit",i({},o,{get:function(){return u},set:function(t){u=!!t}})),Object.defineProperty(a,"startTime",i({},o,{get:function(){return c},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");c=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",i({},o,{get:function(){return h},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");h=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",i({},o,{get:function(){return d},set:function(t){d=""+t,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",i({},o,{get:function(){return f},set:function(t){f=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",i({},o,{get:function(){return p},set:function(e){const r=function(e){return n(t,e)}(e);if(!1===r)throw new SyntaxError("An invalid or illegal string was specified.");p=r,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",i({},o,{get:function(){return g},set:function(t){g=!!t,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",i({},o,{get:function(){return m},set:function(t){if("number"!=typeof t&&"auto"!==t)throw new SyntaxError("An invalid number or illegal string was specified.");m=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",i({},o,{get:function(){return _},set:function(t){const e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");_=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",i({},o,{get:function(){return w},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");w=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",i({},o,{get:function(){return y},set:function(t){const e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");y=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",i({},o,{get:function(){return v},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");v=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",i({},o,{get:function(){return B},set:function(t){const e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");B=e,this.hasBeenReset=!0}})),a.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class ua{decode(t,e){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}function ca(t){function e(t,e,n,r){return 3600*(0|t)+60*(0|e)+(0|n)+parseFloat(r||0)}const n=t.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return n?parseFloat(n[2])>59?e(n[2],n[3],0,n[4]):e(n[1],n[2],n[3],n[4]):null}class ha{constructor(){this.values=Object.create(null)}set(t,e){this.get(t)||""===e||(this.values[t]=e)}get(t,e,n){return n?this.has(t)?this.values[t]:e[n]:this.has(t)?this.values[t]:e}has(t){return t in this.values}alt(t,e,n){for(let r=0;r<n.length;++r)if(e===n[r]){this.set(t,e);break}}integer(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))}percent(t,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){const n=parseFloat(e);if(n>=0&&n<=100)return this.set(t,n),!0}return!1}}function da(t,e,n,r){const i=r?t.split(r):[t];for(const t in i){if("string"!=typeof i[t])continue;const r=i[t].split(n);if(2!==r.length)continue;e(r[0],r[1])}}const fa=new la(0,0,""),pa="middle"===fa.align?"middle":"center";function ga(t,e,n){const r=t;function i(){const e=ca(t);if(null===e)throw new Error("Malformed timestamp: "+r);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function s(){t=t.replace(/^\s+/,"")}if(s(),e.startTime=i(),s(),"--\x3e"!==t.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);t=t.slice(3),s(),e.endTime=i(),s(),function(t,e){const r=new ha;da(t,(function(t,e){let i;switch(t){case"region":for(let i=n.length-1;i>=0;i--)if(n[i].id===e){r.set(t,n[i].region);break}break;case"vertical":r.alt(t,e,["rl","lr"]);break;case"line":i=e.split(","),r.integer(t,i[0]),r.percent(t,i[0])&&r.set("snapToLines",!1),r.alt(t,i[0],["auto"]),2===i.length&&r.alt("lineAlign",i[1],["start",pa,"end"]);break;case"position":i=e.split(","),r.percent(t,i[0]),2===i.length&&r.alt("positionAlign",i[1],["start",pa,"end","line-left","line-right","auto"]);break;case"size":r.percent(t,e);break;case"align":r.alt(t,e,["start",pa,"end","left","right"])}}),/:/,/\s/),e.region=r.get("region",null),e.vertical=r.get("vertical","");let i=r.get("line","auto");"auto"===i&&-1===fa.line&&(i=-1),e.line=i,e.lineAlign=r.get("lineAlign","start"),e.snapToLines=r.get("snapToLines",!0),e.size=r.get("size",100),e.align=r.get("align",pa);let s=r.get("position","auto");"auto"===s&&50===fa.position&&(s="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=s}(t,e)}function ma(t){return t.replace(/<br(?: \/)?>/gi,"\n")}class _a{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new ua,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(t){const e=this;function n(){let t=e.buffer,n=0;for(t=ma(t);n<t.length&&"\r"!==t[n]&&"\n"!==t[n];)++n;const r=t.slice(0,n);return"\r"===t[n]&&++n,"\n"===t[n]&&++n,e.buffer=t.slice(n),r}t&&(e.buffer+=e.decoder.decode(t,{stream:!0}));try{let t="";if("INITIAL"===e.state){if(!/\r\n|\n/.test(e.buffer))return this;t=n();const r=t.match(/^()?WEBVTT([ \t].*)?$/);if(null==r||!r[0])throw new Error("Malformed WebVTT signature.");e.state="HEADER"}let r=!1;for(;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(r?r=!1:t=n(),e.state){case"HEADER":/:/.test(t)?da(t,(function(t,e){}),/:/):t||(e.state="ID");continue;case"NOTE":t||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(t)){e.state="NOTE";break}if(!t)continue;if(e.cue=new la(0,0,""),e.state="CUE",-1===t.indexOf("--\x3e")){e.cue.id=t;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{ga(t,e.cue,e.regionList)}catch(t){e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":{const n=-1!==t.indexOf("--\x3e");if(!t||n&&(r=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(null===e.cue)continue;e.cue.text&&(e.cue.text+="\n"),e.cue.text+=t}continue;case"BADCUE":t||(e.state="ID")}}}catch(t){"CUETEXT"===e.state&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state="INITIAL"===e.state?"BADWEBVTT":"BADCUE"}return this}flush(){const t=this;try{if((t.cue||"HEADER"===t.state)&&(t.buffer+="\n\n",t.parse()),"INITIAL"===t.state||"BADWEBVTT"===t.state)throw new Error("Malformed WebVTT signature.")}catch(e){t.onparsingerror&&t.onparsingerror(e)}return t.onflush&&t.onflush(),this}}const wa=/\r\n|\n\r|\n|\r/g,ya=function(t,e,n=0){return t.slice(n,n+e.length)===e};function va(t,e,n){return TA(t.toString())+TA(e.toString())+TA(n)}function Ba(t,e,n,i,s,A,a){const o=new _a,l=I(new Uint8Array(t)).trim().replace(wa,"\n").split("\n"),u=[],c=e?function(t,e=1){return Vi(t,9e4,1/e)}(e.baseTime,e.timescale):0;let h,d="00:00.000",f=0,p=0,g=!0;o.oncue=function(t){const r=n[i];let A=n.ccOffset;const a=(f-c)/9e4;if(null!=r&&r.new&&(void 0!==p?A=n.ccOffset=r.start:function(t,e,n){let r=t[e],i=t[r.prevCC];if(!i||!i.new&&r.new)return t.ccOffset=t.presentationOffset=r.start,void(r.new=!1);for(;null!=(s=i)&&s.new;){var s;t.ccOffset+=r.start-i.start,r.new=!1,r=i,i=t[r.prevCC]}t.presentationOffset=n}(n,i,a)),a){if(!e)return void(h=new Error("Missing initPTS for VTT MPEGTS"));A=a-n.presentationOffset}const o=t.endTime-t.startTime,l=Ji(9e4*(t.startTime+A-p),9e4*s)/9e4;t.startTime=Math.max(l,0),t.endTime=Math.max(l+o,0);const d=t.text.trim();t.text=decodeURIComponent(encodeURIComponent(d)),t.id||(t.id=va(t.startTime,t.endTime,d)),t.endTime>0&&u.push(t)},o.onparsingerror=function(t){h=t},o.onflush=function(){h?a(h):A(u)},l.forEach((t=>{if(g){if(ya(t,"X-TIMESTAMP-MAP=")){g=!1,t.slice(16).split(",").forEach((t=>{ya(t,"LOCAL:")?d=t.slice(6):ya(t,"MPEGTS:")&&(f=parseInt(t.slice(7)))}));try{p=function(t){let e=parseInt(t.slice(-3));const n=parseInt(t.slice(-6,-4)),i=parseInt(t.slice(-9,-7)),s=t.length>9?parseInt(t.substring(0,t.indexOf(":"))):0;if(!(r(e)&&r(n)&&r(i)&&r(s)))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${t}`);return e+=1e3*n,e+=6e4*i,e+=36e5*s,e}(d)/1e3}catch(t){h=t}return}""===t&&(g=!1)}o.parse(t+"\n")})),o.flush()}const ba="stpp.ttml.im1t",Ea=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Ca=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,ka={left:"start",center:"center",right:"end",start:"start",end:"end"};function Fa(t,e,n,r){const i=At(new Uint8Array(t),["mdat"]);if(0===i.length)return void r(new Error("Could not parse IMSC1 mdat"));const s=i.map((t=>I(t))),A=function(t,e,n=1,r=!1){return Vi(t,e,1/n,r)}(e.baseTime,1,e.timescale);try{s.forEach((t=>n(function(t,e){const n=(new DOMParser).parseFromString(t,"text/xml"),r=n.getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");const i={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(i).reduce(((t,e)=>(t[e]=r.getAttribute(`ttp:${e}`)||i[e],t)),{}),A="preserve"!==r.getAttribute("xml:space"),a=Sa(Ta(r,"styling","style")),o=Sa(Ta(r,"layout","region")),l=Ta(r,"body","[begin]");return[].map.call(l,(t=>{const n=xa(t,A);if(!n||!t.hasAttribute("begin"))return null;const r=Ua(t.getAttribute("begin"),s),i=Ua(t.getAttribute("dur"),s);let l=Ua(t.getAttribute("end"),s);if(null===r)throw Da(t);if(null===l){if(null===i)throw Da(t);l=r+i}const u=new la(r-e,l-e,n);u.id=va(u.startTime,u.endTime,u.text);const c=function(t,e,n){const r="http://www.w3.org/ns/ttml#styling";let i=null;const s=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],A=null!=t&&t.hasAttribute("style")?t.getAttribute("style"):null;A&&n.hasOwnProperty(A)&&(i=n[A]);return s.reduce(((n,s)=>{const A=Ia(e,r,s)||Ia(t,r,s)||Ia(i,r,s);return A&&(n[s]=A),n}),{})}(o[t.getAttribute("region")],a[t.getAttribute("style")],a),{textAlign:h}=c;if(h){const t=ka[h];t&&(u.lineAlign=t),u.align=h}return w(u,c),u})).filter((t=>null!==t))}(t,A))))}catch(t){r(t)}}function Ta(t,e,n){const r=t.getElementsByTagName(e)[0];return r?[].slice.call(r.querySelectorAll(n)):[]}function Sa(t){return t.reduce(((t,e)=>{const n=e.getAttribute("xml:id");return n&&(t[n]=e),t}),{})}function xa(t,e){return[].slice.call(t.childNodes).reduce(((t,n,r)=>{var i;return"br"===n.nodeName&&r?t+"\n":null!=(i=n.childNodes)&&i.length?xa(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent}),"")}function Ia(t,e,n){return t&&t.hasAttributeNS(e,n)?t.getAttributeNS(e,n):null}function Da(t){return new Error(`Could not parse ttml timestamp ${t}`)}function Ua(t,e){if(!t)return null;let n=ca(t);return null===n&&(Ea.test(t)?n=function(t,e){const n=Ea.exec(t),r=(0|n[4])+(0|n[5])/e.subFrameRate;return 3600*(0|n[1])+60*(0|n[2])+(0|n[3])+r/e.frameRate}(t,e):Ca.test(t)&&(n=function(t,e){const n=Ca.exec(t),r=Number(n[1]);switch(n[2]){case"h":return 3600*r;case"m":return 60*r;case"ms":return 1e3*r;case"f":return r/e.frameRate;case"t":return r/e.tickRate}return r}(t,e))),n}class La{constructor(t,e){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=t,this.trackName=e}dispatchCue(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(t,e,n){(null===this.startTime||this.startTime>t)&&(this.startTime=t),this.endTime=e,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}function Ra(t){return t.characteristics&&/transcribes-spoken-dialog/gi.test(t.characteristics)&&/describes-music-and-sound/gi.test(t.characteristics)?"captions":"subtitles"}function Qa(t,e){return!!t&&t.kind===Ra(e)&&ps(e,t)}const Oa=/\s/,Pa={newCue(t,e,n,r){const i=[];let s,A,a,o,l;const u=self.VTTCue||self.TextTrackCue;for(let h=0;h<r.rows.length;h++)if(s=r.rows[h],a=!0,o=0,l="",!s.isEmpty()){var c;for(let t=0;t<s.chars.length;t++)Oa.test(s.chars[t].uchar)&&a?o++:(l+=s.chars[t].uchar,a=!1);s.cueStartTime=e,e===n&&(n+=1e-4),o>=16?o--:o++;const r=ma(l.trim()),d=va(e,n,r);null!=t&&null!=(c=t.cues)&&c.getCueById(d)||(A=new u(e,n,r),A.id=d,A.line=h+1,A.align="left",A.position=10+Math.min(80,10*Math.floor(8*o/32)),i.push(A))}return t&&i.length&&(i.sort(((t,e)=>"auto"===t.line||"auto"===e.line?0:t.line>8&&e.line>8?e.line-t.line:t.line-e.line)),i.forEach((e=>EA(t,e)))),i}};const Ma=/(\d+)-(\d+)\/(\d+)/;class Na{constructor(t){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=t.fetchSetup||Ha,this.controller=new self.AbortController,this.stats=new $}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 t;this.abortInternal(),null!=(t=this.callbacks)&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(t,e,n){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const s=function(t,e){const n={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(w({},t.headers))};t.rangeEnd&&n.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1));return n}(t,this.controller.signal),A="arraybuffer"===t.responseType,a=A?"byteLength":"length",{maxTimeToFirstByteMs:o,maxLoadTimeMs:l}=e.loadPolicy;this.context=t,this.config=e,this.callbacks=n,this.request=this.fetchSetup(t,s),self.clearTimeout(this.requestTimeout),e.timeout=o&&r(o)?o:l,this.requestTimeout=self.setTimeout((()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,t,this.response))}),e.timeout);(as(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then((n=>{var s;this.response=this.loader=n;const a=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),e.timeout=l,this.requestTimeout=self.setTimeout((()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,t,this.response))}),l-(a-i.loading.start)),!n.ok){const{status:t,statusText:e}=n;throw new Ka(e||"fetch, bad network response",t,n)}i.loading.first=a,i.total=function(t){const e=t.get("Content-Range");if(e){const t=function(t){const e=Ma.exec(t);if(e)return parseInt(e[2])-parseInt(e[1])+1}(e);if(r(t))return t}const n=t.get("Content-Length");if(n)return parseInt(n)}(n.headers)||i.total;const o=null==(s=this.callbacks)?void 0:s.onProgress;return o&&r(e.highWaterMark)?this.loadProgressively(n,i,t,e.highWaterMark,o):A?n.arrayBuffer():"json"===t.responseType?n.json():n.text()})).then((n=>{var s,A;const o=this.response;if(!o)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const l=n[a];l&&(i.loaded=i.total=l);const u={url:o.url,data:n,code:o.status},c=null==(s=this.callbacks)?void 0:s.onProgress;c&&!r(e.highWaterMark)&&c(i,t,n,o),null==(A=this.callbacks)||A.onSuccess(u,i,t,o)})).catch((e=>{var n;if(self.clearTimeout(this.requestTimeout),i.aborted)return;const r=e&&e.code||0,s=e?e.message:null;null==(n=this.callbacks)||n.onError({code:r,text:s},t,e?e.details:null,i)}))}getCacheAge(){let t=null;if(this.response){const e=this.response.headers.get("age");t=e?parseFloat(e):null}return t}getResponseHeader(t){return this.response?this.response.headers.get(t):null}loadProgressively(t,e,n,r=0,i){const s=new Qr,A=t.body.getReader(),a=()=>A.read().then((A=>{if(A.done)return s.dataLength&&i(e,n,s.flush().buffer,t),Promise.resolve(new ArrayBuffer(0));const o=A.value,l=o.length;return e.loaded+=l,l<r||s.dataLength?(s.push(o),s.dataLength>=r&&i(e,n,s.flush().buffer,t)):i(e,n,o.buffer,t),a()})).catch((()=>Promise.reject()));return a()}}function Ha(t,e){return new self.Request(t.url,e)}class Ka extends Error{constructor(t,e,n){super(t),this.code=void 0,this.details=void 0,this.code=e,this.details=n}}const $a=/^age:\s*[\d.]+\s*$/im;class Ga{constructor(t){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=t&&t.xhrSetup||null,this.stats=new $,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,4!==t.readyState&&(this.stats.aborted=!0,t.abort()))}abort(){var t;this.abortInternal(),null!=(t=this.callbacks)&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(t,e,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=t,this.config=e,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:t,context:e}=this;if(!t||!e)return;const n=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;const i=this.xhrSetup;i?Promise.resolve().then((()=>{if(this.loader===n&&!this.stats.aborted)return i(n,e.url)})).catch((t=>{if(this.loader===n&&!this.stats.aborted)return n.open("GET",e.url,!0),i(n,e.url)})).then((()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,e,t)})).catch((t=>{var i;null==(i=this.callbacks)||i.onError({code:n.status,text:t.message},e,n,r)})):this.openAndSendXhr(n,e,t)}openAndSendXhr(t,e,n){t.readyState||t.open("GET",e.url,!0);const i=e.headers,{maxTimeToFirstByteMs:s,maxLoadTimeMs:A}=n.loadPolicy;if(i)for(const e in i)t.setRequestHeader(e,i[e]);e.rangeEnd&&t.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=e.responseType,self.clearTimeout(this.requestTimeout),n.timeout=s&&r(s)?s:A,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),t.send()}readystatechange(){const{context:t,loader:e,stats:n}=this;if(!t||!e)return;const r=e.readyState,i=this.config;if(!n.aborted&&r>=2&&(0===n.loading.first&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),i.timeout!==i.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),i.timeout=i.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),4===r)){self.clearTimeout(this.requestTimeout),e.onreadystatechange=null,e.onprogress=null;const r=e.status,o="text"===e.responseType?e.responseText:null;if(r>=200&&r<300){const i=null!=o?o:e.response;if(null!=i){var s,A;n.loading.end=Math.max(self.performance.now(),n.loading.first);const a="arraybuffer"===e.responseType?i.byteLength:i.length;n.loaded=n.total=a,n.bwEstimate=8e3*n.total/(n.loading.end-n.loading.first);const o=null==(s=this.callbacks)?void 0:s.onProgress;o&&o(n,t,i,e);const l={url:e.responseURL,data:i,code:r};return void(null==(A=this.callbacks)||A.onSuccess(l,n,t,e))}}const l=i.loadPolicy.errorRetry;var a;if(be(l,n.retry,!1,{url:t.url,data:void 0,code:r}))this.retry(l);else T.error(`${r} while loading ${t.url}`),null==(a=this.callbacks)||a.onError({code:r,text:e.statusText},t,e,n)}}loadtimeout(){if(!this.config)return;const t=this.config.loadPolicy.timeoutRetry;if(be(t,this.stats.retry,!0))this.retry(t);else{var e;T.warn(`timeout while loading ${null==(e=this.context)?void 0:e.url}`);const t=this.callbacks;t&&(this.abortInternal(),t.onTimeout(this.stats,this.context,this.loader))}}retry(t){const{context:e,stats:n}=this;this.retryDelay=ve(t,n.retry),n.retry++,T.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${null==e?void 0:e.url}, retrying ${n.retry}/${t.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(t){const e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)}getCacheAge(){let t=null;if(this.loader&&$a.test(this.loader.getAllResponseHeaders())){const e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t}getResponseHeader(t){return this.loader&&new RegExp(`^${t}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(t):null}}const Va=v(v({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:6e7,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:Ga,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:class extends B{constructor(t){super("abr",t.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 e;const{fragCurrent:n,partCurrent:i,hls:s}=this,{autoLevelEnabled:A,media:a}=s;if(!n||!a)return;const l=performance.now(),u=i?i.stats:n.stats,c=i?i.duration:n.duration,h=l-u.loading.start,d=s.minAutoLevel,f=n.level,p=this._nextAutoLevel;if(u.aborted||u.loaded&&u.loaded===u.total||f<=d)return this.clearTimer(),void(this._nextAutoLevel=-1);if(!A)return;const g=p>-1&&p!==f,m=!!t||g;if(!m&&(a.paused||!a.playbackRate||!a.readyState))return;const _=s.mainForwardBufferInfo;if(!m&&null===_)return;const w=this.bwEstimator.getEstimateTTFB(),y=Math.abs(a.playbackRate);if(h<=Math.max(w,c/(2*y)*1e3))return;const v=_?_.len/y:0,B=u.loading.first?u.loading.first-u.loading.start:-1,b=u.loaded&&B>-1,E=this.getBwEstimate(),C=s.levels,k=C[f],F=Math.max(u.loaded,Math.round(c*(n.bitrate||k.averageBitrate)/8));let T=b?h-B:h;T<1&&b&&(T=Math.min(h,8*u.loaded/E));const S=b?1e3*u.loaded/T:0,x=w/1e3,I=S?(F-u.loaded)/S:8*F/E+x;if(I<=v)return;const D=S?8*S:E,U=!0===(null==(e=(null==t?void 0:t.details)||this.hls.latestLevelDetails)?void 0:e.live),L=this.hls.config.abrBandWidthUpFactor;let R,Q=Number.POSITIVE_INFINITY;for(R=f-1;R>d;R--){const t=C[R].maxBitrate,e=!C[R].details||U;if(Q=this.getTimeToLoadFrag(x,D,c*t,e),Q<Math.min(v,c+x))break}if(Q>=I)return;if(Q>10*c)return;b?this.bwEstimator.sample(h-Math.min(w,B),u.loaded):this.bwEstimator.sampleTTFB(h);const O=C[R].maxBitrate;this.getBwEstimate()*L>O&&this.resetEstimator(O);const P=this.findBestLevel(O,d,R,0,v,1,1);P>-1&&(R=P),this.warn(`Fragment ${n.sn}${i?" part "+i.index:""} of level ${f} is loading too slowly;\n Fragment duration: ${n.duration.toFixed(3)}\n Time to underbuffer: ${v.toFixed(3)} s\n Estimated load time for current fragment: ${I.toFixed(3)} s\n Estimated load time for down switch fragment: ${Q.toFixed(3)} s\n TTFB estimate: ${0|B} ms\n Current BW estimate: ${r(E)?0|E:"Unknown"} bps\n New BW estimate: ${0|this.getBwEstimate()} bps\n Switching to level ${R} @ ${0|O} bps`),s.nextLoadLevel=s.nextAutoLevel=R,this.clearTimer();const M=()=>{if(this.clearTimer(),this.fragCurrent===n&&this.hls.loadLevel===R&&R>0){const t=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${R>0?"and switching down":""}\n Fragment duration: ${n.duration.toFixed(3)} s\n Time to underbuffer: ${t.toFixed(3)} s`),n.abortRequests(),this.fragCurrent=this.partCurrent=null,R>d){let e=this.findBestLevel(this.hls.levels[d].bitrate,d,R,0,t,1,1);-1===e&&(e=d),this.hls.nextLoadLevel=this.hls.nextAutoLevel=e,this.resetEstimator(this.hls.levels[e].bitrate)}}};g||I>2*Q?M():this.timer=self.setInterval(M,1e3*Q),s.trigger(o.FRAG_LOAD_EMERGENCY_ABORTED,{frag:n,part:i,stats:u})},this.hls=t,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(t){t&&(this.log(`setting initial bwe to ${t}`),this.hls.config.abrEwmaDefaultEstimate=t),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const t=this.hls.config;return new m(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate)}registerListeners(){const{hls:t}=this;t.on(o.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.FRAG_LOADING,this.onFragLoading,this),t.on(o.FRAG_LOADED,this.onFragLoaded,this),t.on(o.FRAG_BUFFERED,this.onFragBuffered,this),t.on(o.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(o.LEVEL_LOADED,this.onLevelLoaded,this),t.on(o.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(o.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),t.on(o.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t&&(t.off(o.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.FRAG_LOADING,this.onFragLoading,this),t.off(o.FRAG_LOADED,this.onFragLoaded,this),t.off(o.FRAG_BUFFERED,this.onFragBuffered,this),t.off(o.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(o.LEVEL_LOADED,this.onLevelLoaded,this),t.off(o.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(o.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),t.off(o.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(t,e){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(t,e){const n=e.frag;if(!this.ignoreFragment(n)){var r;if(!n.bitrateTest)this.fragCurrent=n,this.partCurrent=null!=(r=e.part)?r:null;this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(t,e){this.clearTimer()}onError(t,e){if(!e.fatal)switch(e.details){case a.BUFFER_ADD_CODEC_ERROR:case a.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case a.FRAG_LOAD_TIMEOUT:{const t=e.frag,{fragCurrent:n,partCurrent:r}=this;if(t&&n&&t.sn===n.sn&&t.level===n.level){const e=performance.now(),n=r?r.stats:t.stats,i=e-n.loading.start,s=n.loading.first?n.loading.first-n.loading.start:-1;if(n.loaded&&s>-1){const t=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(i-Math.min(t,s),n.loaded)}else this.bwEstimator.sampleTTFB(i)}break}}}getTimeToLoadFrag(t,e,n,r){return t+n/e+(r?t+this.lastLevelLoadSec:0)}onLevelLoaded(t,e){const n=this.hls.config,{loading:i}=e.stats,s=i.end-i.first;r(s)&&(this.lastLevelLoadSec=s/1e3),e.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(e.levelInfo)}onFragLoaded(t,{frag:e,part:n}){const r=n?n.stats:e.stats;if(e.type===d&&this.bwEstimator.sampleTTFB(r.loading.first-r.loading.start),!this.ignoreFragment(e)){if(this.clearTimer(),e.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const t=n?n.duration:e.duration,i=this.hls.levels[e.level],s=(i.loaded?i.loaded.bytes:0)+r.loaded,A=(i.loaded?i.loaded.duration:0)+t;i.loaded={bytes:s,duration:A},i.realBitrate=Math.round(8*s/A)}if(e.bitrateTest){const t={stats:r,frag:e,part:n,id:e.type};this.onFragBuffered(o.FRAG_BUFFERED,t),e.bitrateTest=!1}else this.lastLoadedFragLevel=e.level}}onFragBuffered(t,e){const{frag:n,part:r}=e,i=null!=r&&r.stats.loaded?r.stats:n.stats;if(i.aborted)return;if(this.ignoreFragment(n))return;const s=i.parsing.end-i.loading.start-Math.min(i.loading.first-i.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,i.loaded),i.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(t){return t.type!==d||"initSegment"===t.sn}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:t,minAutoLevel:e}=this.hls,n=this.getBwEstimate(),r=this.hls.config.maxStarvationDelay,i=this.findBestLevel(n,e,t,0,r,1,1);if(i>-1)return i;const s=this.hls.firstLevel,A=Math.min(Math.max(s,e),t);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${A}`),A}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const t=this.forcedAutoLevel,e=this.bwEstimator.canEstimate(),n=this.lastLoadedFragLevel>-1;if(!(-1===t||e&&n&&this.nextAutoLevelKey!==this.getAutoLevelKey()))return t;const r=e&&n?this.getNextABRAutoLevel():this.firstAutoLevel;if(-1!==t){const e=this.hls.levels;if(e.length>Math.max(t,r)&&e[t].loadError<=e[r].loadError)return t}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:t,partCurrent:e,hls:n}=this;if(n.levels.length<=1)return n.loadLevel;const{maxAutoLevel:r,config:i,minAutoLevel:s}=n,A=e?e.duration:t?t.duration:0,a=this.getBwEstimate(),o=this.getStarvationDelay();let l=i.abrBandWidthFactor,u=i.abrBandWidthUpFactor;if(o){const t=this.findBestLevel(a,s,r,o,0,l,u);if(t>=0)return this.rebufferNotice=-1,t}let c=A?Math.min(A,i.maxStarvationDelay):i.maxStarvationDelay;if(!o){const t=this.bitrateTestDelay;if(t){c=(A?Math.min(A,i.maxLoadingDelay):i.maxLoadingDelay)-t,this.info(`bitrate test took ${Math.round(1e3*t)}ms, set first fragment max fetchDuration to ${Math.round(1e3*c)} ms`),l=u=1}}const h=this.findBestLevel(a,s,r,o,c,l,u);if(this.rebufferNotice!==h&&(this.rebufferNotice=h,this.info(`${o?"rebuffering expected":"buffer is empty"}, optimal quality level ${h}`)),h>-1)return h;const d=n.levels[s],f=n.loadLevelObj;return f&&(null==d?void 0:d.bitrate)<f.bitrate?s:n.loadLevel}getStarvationDelay(){const t=this.hls,e=t.media;if(!e)return 1/0;const n=e&&0!==e.playbackRate?Math.abs(e.playbackRate):1,r=t.mainForwardBufferInfo;return(r?r.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(t,e,n,i,s,A,a){var o;const l=i+s,u=this.lastLoadedFragLevel,c=-1===u?this.hls.firstLevel:u,{fragCurrent:h,partCurrent:d}=this,{levels:f,allAudioTracks:p,loadLevel:g,config:m}=this.hls;if(1===f.length)return 0;const _=f[c],w=!(null==(o=this.hls.latestLevelDetails)||!o.live),y=-1===g||-1===u;let v,B="SDR",b=(null==_?void 0:_.frameRate)||0;const{audioPreference:E,videoPreference:C}=m,k=this.audioTracksByGroup||(this.audioTracksByGroup=se(p));let F=-1;if(y){if(-1!==this.firstSelection)return this.firstSelection;const i=this.codecTiers||(this.codecTiers=function(t,e,n,r){return t.slice(n,r+1).reduce(((t,n,r)=>{if(!n.codecSet)return t;const i=n.audioGroups;let s=t[n.codecSet];s||(t[n.codecSet]=s={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:r,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!i,fragmentError:0}),s.minBitrate=Math.min(s.minBitrate,n.bitrate);const A=Math.min(n.height,n.width);return s.minHeight=Math.min(s.minHeight,A),s.minFramerate=Math.min(s.minFramerate,n.frameRate),s.minIndex=Math.min(s.minIndex,r),s.maxScore=Math.max(s.maxScore,n.score),s.fragmentError+=n.fragmentError,s.videoRanges[n.videoRange]=(s.videoRanges[n.videoRange]||0)+1,i&&i.forEach((t=>{if(!t)return;const n=e.groups[t];n&&(s.hasDefaultAudio=s.hasDefaultAudio||e.hasDefaultAudio?n.hasDefault:n.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(n.channels).forEach((t=>{s.channels[t]=(s.channels[t]||0)+n.channels[t]})))})),t}),{})}(f,k,e,n)),s=function(t,e,n,i,s){const A=Object.keys(t),a=null==i?void 0:i.channels,o=null==i?void 0:i.audioCodec,l=null==s?void 0:s.videoCodec,u=a&&2===parseInt(a);let c=!1,h=!1,d=1/0,f=1/0,p=1/0,g=1/0,m=0,_=[];const{preferHDR:w,allowedVideoRanges:y}=ne(e,s);for(let e=A.length;e--;){const n=t[A[e]];c||(c=n.channels[2]>0),d=Math.min(d,n.minHeight),f=Math.min(f,n.minFramerate),p=Math.min(p,n.minBitrate),y.filter((t=>n.videoRanges[t]>0)).length>0&&(h=!0)}d=r(d)?d:0,f=r(f)?f:0;const v=Math.max(1080,d),B=Math.max(30,f);p=r(p)?p:n,n=Math.max(p,n),h||(e=void 0);const b=A.length>1;return{codecSet:A.reduce(((e,r)=>{const i=t[r];if(r===e)return e;if(_=h?y.filter((t=>i.videoRanges[t]>0)):[],b){if(i.minBitrate>n)return ie(r,`min bitrate of ${i.minBitrate} > current estimate of ${n}`),e;if(!i.hasDefaultAudio)return ie(r,"no renditions with default or auto-select sound found"),e;if(o&&r.indexOf(o.substring(0,4))%5!=0)return ie(r,`audio codec preference "${o}" not found`),e;if(a&&!u){if(!i.channels[a])return ie(r,`no renditions with ${a} channel sound found (channels options: ${Object.keys(i.channels)})`),e}else if((!o||u)&&c&&0===i.channels[2])return ie(r,"no renditions with stereo sound found"),e;if(i.minHeight>v)return ie(r,`min resolution of ${i.minHeight} > maximum of ${v}`),e;if(i.minFramerate>B)return ie(r,`min framerate of ${i.minFramerate} > maximum of ${B}`),e;if(!_.some((t=>i.videoRanges[t]>0)))return ie(r,`no variants with VIDEO-RANGE of ${re(_)} found`),e;if(l&&r.indexOf(l.substring(0,4))%5!=0)return ie(r,`video codec preference "${l}" not found`),e;if(i.maxScore<m)return ie(r,`max score of ${i.maxScore} < selected max of ${m}`),e}return e&&(It(r)>=It(e)||i.fragmentError>t[e].fragmentError)?e:(g=i.minIndex,m=i.maxScore,r)}),void 0),videoRanges:_,preferHDR:w,minFramerate:f,minBitrate:p,minIndex:g}}(i,B,t,E,C),{codecSet:A,videoRanges:a,minFramerate:o,minBitrate:l,minIndex:u,preferHDR:c}=s;F=u,v=A,B=c?a[a.length-1]:a[0],b=o,t=Math.max(t,l),this.log(`picked start tier ${re(s)}`)}else v=null==_?void 0:_.codecSet,B=null==_?void 0:_.videoRange;const T=d?d.duration:h?h.duration:0,S=this.bwEstimator.getEstimateTTFB()/1e3,x=[];for(let o=n;o>=e;o--){var I;const e=f[o],h=o>c;if(!e)continue;if(m.useMediaCapabilities&&!e.supportedResult&&!e.supportedPromise){const n=navigator.mediaCapabilities;"function"==typeof(null==n?void 0:n.decodingInfo)&&$t(e,k,B,b,t,E)?(e.supportedPromise=Gt(e,k,n,this.supportedCache),e.supportedPromise.then((t=>{if(!this.hls)return;e.supportedResult=t;const n=this.hls.levels,r=n.indexOf(e);t.error?this.warn(`MediaCapabilities decodingInfo error: "${t.error}" for level ${r} ${re(t)}`):t.supported?t.decodingInfoResults.some((t=>!1===t.smooth||!1===t.powerEfficient))&&this.log(`MediaCapabilities decodingInfo for level ${r} not smooth or powerEfficient: ${re(t)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${r} ${re(t)}`),r>-1&&n.length>1&&(this.log(`Removing unsupported level ${r}`),this.hls.removeLevel(r),-1===this.hls.loadLevel&&(this.hls.nextLoadLevel=0)))})).catch((t=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${t}`)}))):e.supportedResult=Ht}if((v&&e.codecSet!==v||B&&e.videoRange!==B||h&&b>e.frameRate||!h&&b>0&&b<e.frameRate||null!=(I=e.supportedResult)&&null!=(I=I.decodingInfoResults)&&I.some((t=>!1===t.smooth)))&&(!y||o!==F)){x.push(o);continue}const p=e.details,_=(d?null==p?void 0:p.partTarget:null==p?void 0:p.averagetargetduration)||T;let C;C=h?a*t:A*t;const D=T&&i>=2*T&&0===s?e.averageBitrate:e.maxBitrate,U=this.getTimeToLoadFrag(S,C,D*_,void 0===p);if(C>=D&&(o===u||0===e.loadError&&0===e.fragmentError)&&(U<=S||!r(U)||w&&!this.bitrateTestDelay||U<l)){const t=this.forcedAutoLevel;return o===g||-1!==t&&t===g||(x.length&&this.trace(`Skipped level(s) ${x.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${f[x[0]].codecs}" ${f[x[0]].videoRange}; not compatible with "${v}" ${B}`),this.info(`switch candidate:${c}->${o} adjustedbw(${Math.round(C)})-bitrate=${Math.round(C-D)} ttfb:${S.toFixed(1)} avgDuration:${_.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${U.toFixed(1)} firstSelection:${y} codecSet:${e.codecSet} videoRange:${e.videoRange} hls.loadLevel:${g}`)),y&&(this.firstSelection=o),o}}return-1}set nextAutoLevel(t){const e=this.deriveNextAutoLevel(t);this._nextAutoLevel!==e&&(this.nextAutoLevelKey="",this._nextAutoLevel=e)}deriveNextAutoLevel(t){const{maxAutoLevel:e,minAutoLevel:n}=this.hls;return Math.min(Math.max(t,n),e)}},bufferController:class extends B{constructor(t,e){var n;super("buffer-controller",t.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=t=>{var e;this.hls&&"open"===(null==(e=this.mediaSource)?void 0:e.readyState)&&this.hls.pauseBuffering()},this._onStartStreaming=t=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=t=>{const{media:e,mediaSource:n}=this;t&&this.log("Media source opened"),e&&n&&(n.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(o.MEDIA_ATTACHED,{media:e,mediaSource:n}),null!==this.mediaSource&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:t,_objectUrl:e}=this;t!==e&&this.error(`Media element src was set while attaching MediaSource (${e} > ${t})`)},this.hls=t,this.fragmentTracker=e,this.appendSource=(n=S(t.config.preferManagedMediaSource),"undefined"!=typeof self&&n===self.ManagedMediaSource),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:t}=this;t.on(o.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(o.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(o.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.MANIFEST_PARSED,this.onManifestParsed,this),t.on(o.BUFFER_RESET,this.onBufferReset,this),t.on(o.BUFFER_APPENDING,this.onBufferAppending,this),t.on(o.BUFFER_CODECS,this.onBufferCodecs,this),t.on(o.BUFFER_EOS,this.onBufferEos,this),t.on(o.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(o.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(o.FRAG_PARSED,this.onFragParsed,this),t.on(o.FRAG_CHANGED,this.onFragChanged,this),t.on(o.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(o.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(o.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(o.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.MANIFEST_PARSED,this.onManifestParsed,this),t.off(o.BUFFER_RESET,this.onBufferReset,this),t.off(o.BUFFER_APPENDING,this.onBufferAppending,this),t.off(o.BUFFER_CODECS,this.onBufferCodecs,this),t.off(o.BUFFER_EOS,this.onBufferEos,this),t.off(o.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(o.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(o.FRAG_PARSED,this.onFragParsed,this),t.off(o.FRAG_CHANGED,this.onFragChanged,this),t.off(o.ERROR,this.onError,this)}transferMedia(){const{media:t,mediaSource:e}=this;if(!t)return null;const n={};if(this.operationQueue){const t=this.isUpdating();t||this.operationQueue.removeBlockers();const e=this.isQueued();(t||e)&&this.warn(`Transfering MediaSource with${e?" operations in queue":""}${t?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const r=this.transferData;return!this.sourceBufferCount&&r&&r.mediaSource===e?w(n,r.tracks):this.sourceBuffers.forEach((t=>{const[e]=t;e&&(n[e]=w({},this.tracks[e]),this.removeBuffer(e)),t[0]=t[1]=null})),{media:t,mediaSource:e,tracks:n}}initTracks(){this.sourceBuffers=[[null,null],[null,null]],this.tracks={},this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(t,e){var n;let r=2;(e.audio&&!e.video||!e.altAudio)&&(r=1),this.bufferCodecEventsTotal=r,this.log(`${r} bufferCodec event(s) expected.`),null!=(n=this.transferData)&&n.mediaSource&&this.sourceBufferCount&&r&&this.bufferCreated()}onMediaAttaching(t,e){const n=this.media=e.media;this.transferData=this.overrides=void 0;const r=S(this.appendSource);if(r){const t=!!e.mediaSource;(t||e.overrides)&&(this.transferData=e,this.overrides=e.overrides);const i=this.mediaSource=e.mediaSource||new r;if(this.assignMediaSource(i),t)this._objectUrl=n.src,this.attachTransferred();else{const t=this._objectUrl=self.URL.createObjectURL(i);if(this.appendSource)try{n.removeAttribute("src");const e=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||e&&i instanceof e,ys(n),function(t,e){const n=self.document.createElement("source");n.type="video/mp4",n.src=e,t.appendChild(n)}(n,t),n.load()}catch(e){n.src=t}else n.src=t}n.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(t){var e,n;this.log(`${(null==(e=this.transferData)?void 0:e.mediaSource)===t?"transferred":"created"} media source: ${null==(n=t.constructor)?void 0:n.name}`),t.addEventListener("sourceopen",this._onMediaSourceOpen),t.addEventListener("sourceended",this._onMediaSourceEnded),t.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.addEventListener("startstreaming",this._onStartStreaming),t.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const t=this.media,e=this.transferData;if(!e||!t)return;const n=this.tracks,r=e.tracks,i=r?Object.keys(r):null,s=i?i.length:0,A=()=>{Promise.resolve().then((()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()}))};if(r&&i&&s){if(!this.tracksReady)return this.hls.config.startFragPrefetch=!0,void this.log("attachTransferred: waiting for SourceBuffer track info");if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})\nrequired tracks: ${re(n,((t,e)=>"initSegment"===t?void 0:e))};\ntransfer tracks: ${re(r,((t,e)=>"initSegment"===t?void 0:e))}}`),!x(r,n)){e.mediaSource=null,e.tracks=void 0;const i=t.currentTime,s=this.details,A=Math.max(i,(null==s?void 0:s.fragments[0].start)||0);return A-i>1?void this.log(`attachTransferred: waiting for playback to reach new tracks start time ${i} -> ${A}`):(this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(r)}"->"${Object.keys(n)}") start time: ${A} currentTime: ${i}`),this.onMediaDetaching(o.MEDIA_DETACHING,{}),this.onMediaAttaching(o.MEDIA_ATTACHING,e),void(t.currentTime=A))}this.transferData=void 0,i.forEach((t=>{const e=t,n=r[e];if(n){const t=n.buffer;if(t){const r=this.fragmentTracker,i=n.id;if(r.hasFragments(i)||r.hasParts(i)){const n=nn.getBuffered(t);r.detectEvictedFragments(e,n,i,null,!0)}const s=vs(e),A=[e,t];this.sourceBuffers[s]=A,t.updating&&this.operationQueue&&this.operationQueue.prependBlocker(e),this.trackSourceBuffer(e,n)}}})),A(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),A()}get mediaSourceOpenOrEnded(){var t;const e=null==(t=this.mediaSource)?void 0:t.readyState;return"open"===e||"ended"===e}onMediaDetaching(t,e){const n=!!e.transferMedia;this.transferData=this.overrides=void 0;const{media:r,mediaSource:i,_objectUrl:s}=this;if(i){if(this.log("media source "+(n?"transferring":"detaching")),n)this.sourceBuffers.forEach((([t])=>{t&&this.removeBuffer(t)})),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const t="open"===i.readyState;try{const e=i.sourceBuffers;for(let n=e.length;n--;)t&&e[n].abort(),i.removeSourceBuffer(e[n]);t&&i.endOfStream()}catch(t){this.warn(`onMediaDetaching: ${t.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(i.removeEventListener("startstreaming",this._onStartStreaming),i.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}r&&(r.removeEventListener("emptied",this._onMediaEmptied),n||(s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(r.removeAttribute("src"),this.appendSource&&ys(r),r.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(o.MEDIA_DETACHED,e)}onBufferReset(){this.sourceBuffers.forEach((([t])=>{t&&this.resetBuffer(t)})),this.initTracks()}resetBuffer(t){var e;const n=null==(e=this.tracks[t])?void 0:e.buffer;if(this.removeBuffer(t),n)try{var r;null!=(r=this.mediaSource)&&r.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(e){this.warn(`onBufferReset ${t}`,e)}delete this.tracks[t]}removeBuffer(t){this.removeBufferListeners(t),this.sourceBuffers[vs(t)]=[null,null];const e=this.tracks[t];e&&(e.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new gs(this.tracks)}onBufferCodecs(t,e){var n;const r=this.tracks,i=Object.keys(e);this.log(`BUFFER_CODECS: "${i}" (current SB count ${this.sourceBufferCount})`);const s="audiovideo"in e&&(r.audio||r.video)||r.audiovideo&&("audio"in e||"video"in e),A=!s&&this.sourceBufferCount&&this.media&&i.some((t=>!r[t]));s||A?this.warn(`Unsupported transition between "${Object.keys(r)}" and "${i}" SourceBuffers`):(i.forEach((t=>{var n,i;const s=e[t],{id:A,codec:a,levelCodec:o,container:l,metadata:u,supplemental:c}=s;let h=r[t];const d=null==(n=this.transferData)||null==(n=n.tracks)?void 0:n[t],f=null!=d&&d.buffer?d:h,p=(null==f?void 0:f.pendingCodec)||(null==f?void 0:f.codec),g=null==f?void 0:f.levelCodec;h||(h=r[t]={buffer:void 0,listeners:[],codec:a,supplemental:c,container:l,levelCodec:o,metadata:u,id:A});const m=Rt(p,g),_=null==m?void 0:m.replace(ms,"$1");let w=Rt(a,o);const y=null==(i=w)?void 0:i.replace(ms,"$1");w&&m&&_!==y&&("audio"===t.slice(0,5)&&(w=Lt(w,this.appendSource)),this.log(`switching codec ${p} to ${w}`),w!==(h.pendingCodec||h.codec)&&(h.pendingCodec=w),h.container=l,this.appendChangeType(t,l,w))})),(this.tracksReady||this.sourceBufferCount)&&(e.tracks=this.sourceBufferTracks),this.sourceBufferCount||(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!e.video&&"main"===(null==(n=e.audio)?void 0:n.id)&&(this.log("Main audio-only"),this.bufferCodecEventsTotal=1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks()))}get sourceBufferTracks(){return Object.keys(this.tracks).reduce(((t,e)=>{const n=this.tracks[e];return t[e]={id:n.id,container:n.container,codec:n.codec,levelCodec:n.levelCodec},t}),{})}appendChangeType(t,e,n){const r=`${e};codecs=${n}`,i={label:`change-type=${r}`,execute:()=>{const i=this.tracks[t];if(i){const s=i.buffer;null!=s&&s.changeType&&(this.log(`changing ${t} sourceBuffer type to ${r}`),s.changeType(r),i.codec=n,i.container=e)}this.shiftAndExecuteNext(t)},onStart:()=>{},onComplete:()=>{},onError:e=>{this.warn(`Failed to change ${t} SourceBuffer type`,e)}};this.append(i,t,this.isPending(this.tracks[t]))}blockAudio(t){var e;const n=t.start,r=n+.05*t.duration;if(!0===(null==(e=this.fragmentTracker.getAppendedFrag(n,d))?void 0:e.gap))return;const i={label:"block-audio",execute:()=>{var t;const e=this.tracks.video;(this.lastVideoAppendEnd>r||null!=e&&e.buffer&&nn.isBuffered(e.buffer,r)||!0===(null==(t=this.fragmentTracker.getAppendedFrag(r,d))?void 0:t.gap))&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:t=>{this.warn("Error executing block-audio operation",t)}};this.blockedAudioAppend={op:i,frag:t},this.append(i,"audio",!0)}unblockAudio(){const{blockedAudioAppend:t,operationQueue:e}=this;t&&e&&(this.blockedAudioAppend=null,e.unblockAudio(t.op))}onBufferAppending(t,e){const{tracks:n}=this,{data:i,type:s,parent:l,frag:u,part:c,chunkMeta:h,offset:f}=e,p=h.buffering[s],{sn:g,cc:m}=u,_=self.performance.now();p.start=_;const w=u.stats.buffering,y=c?c.stats.buffering:null;0===w.start&&(w.start=_),y&&0===y.start&&(y.start=_);const v=n.audio;let B=!1;"audio"===s&&"audio/mpeg"===(null==v?void 0:v.container)&&(B=!this.lastMpegAudioChunk||1===h.id||this.lastMpegAudioChunk.sn!==h.sn,this.lastMpegAudioChunk=h);const b=n.video,E=null==b?void 0:b.buffer;if(E&&"initSegment"!==g){const t=c||u,e=this.blockedAudioAppend;if("audio"!==s||"main"===l||this.blockedAudioAppend||b.ending||b.ended){if("video"===s){const n=t.end;if(e){const t=e.frag.start;(n>t||n<this.lastVideoAppendEnd||nn.isBuffered(E,t))&&this.unblockAudio()}this.lastVideoAppendEnd=n}}else{const e=t.start+.05*t.duration,n=E.buffered,r=this.currentOp("video");n.length||r?!r&&!nn.isBuffered(E,e)&&this.lastVideoAppendEnd<e&&this.blockAudio(t):this.blockAudio(t)}}const C=(c||u).start,k={label:`append-${s}`,execute:()=>{var t;p.executeStart=self.performance.now();const e=null==(t=this.tracks[s])?void 0:t.buffer;e&&(B?this.updateTimestampOffset(e,C,.1,s,g,m):void 0!==f&&r(f)&&this.updateTimestampOffset(e,f,1e-6,s,g,m)),this.appendExecutor(i,s)},onStart:()=>{},onComplete:()=>{const t=self.performance.now();p.executeEnd=p.end=t,0===w.first&&(w.first=t),y&&0===y.first&&(y.first=t);const e={};this.sourceBuffers.forEach((([t,n])=>{t&&(e[t]=nn.getBuffered(n))})),this.appendErrors[s]=0,"audio"===s||"video"===s?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(o.BUFFER_APPENDED,{type:s,frag:u,part:c,chunkMeta:h,parent:u.type,timeRanges:e})},onError:t=>{var e;const n={type:A.MEDIA_ERROR,parent:u.type,details:a.BUFFER_APPEND_ERROR,sourceBufferName:s,frag:u,part:c,chunkMeta:h,error:t,err:t,fatal:!1},r=null==(e=this.media)?void 0:e.error;if(t.code===DOMException.QUOTA_EXCEEDED_ERR||"QuotaExceededError"==t.name||"quota"in t)n.details=a.BUFFER_FULL_ERROR;else if(t.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!r)n.errorAction=Ue(!0);else if(t.name===_s&&0===this.sourceBufferCount)n.errorAction=Ue(!0);else{const t=++this.appendErrors[s];this.warn(`Failed ${t}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${s}" sourceBuffer (${r||"no media error"})`),(t>=this.hls.config.appendErrorMaxRetry||r)&&(n.fatal=!0)}this.hls.trigger(o.ERROR,n)}};this.log(`queuing "${s}" append sn: ${g}${c?" p: "+c.index:""} of ${u.type===d?"level":"track"} ${u.level} cc: ${m}`),this.append(k,s,this.isPending(this.tracks[s]))}getFlushOp(t,e,n){return this.log(`queuing "${t}" remove ${e}-${n}`),{label:"remove",execute:()=>{this.removeExecutor(t,e,n)},onStart:()=>{},onComplete:()=>{this.hls.trigger(o.BUFFER_FLUSHED,{type:t})},onError:r=>{this.warn(`Failed to remove ${e}-${n} from "${t}" SourceBuffer`,r)}}}onBufferFlushing(t,e){const{type:n,startOffset:r,endOffset:i}=e;n?this.append(this.getFlushOp(n,r,i),n):this.sourceBuffers.forEach((([t])=>{t&&this.append(this.getFlushOp(t,r,i),t)}))}onFragParsed(t,e){const{frag:n,part:r}=e,i=[],s=r?r.elementaryStreams:n.elementaryStreams;s[j]?i.push("audiovideo"):(s[G]&&i.push("audio"),s[V]&&i.push("video"));0===i.length&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers((()=>{const t=self.performance.now();n.stats.buffering.end=t,r&&(r.stats.buffering.end=t);const e=r?r.stats:n.stats;this.hls.trigger(o.FRAG_BUFFERED,{frag:n,part:r,stats:e,id:n.type})}),i).catch((t=>{this.warn(`Fragment buffered callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)}))}onFragChanged(t,e){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some((([t])=>{if(t){const e=this.tracks[t];if(e)return!e.ended||e.ending}return!1}))}onBufferEos(t,e){var n;this.sourceBuffers.forEach((([t])=>{if(t){const n=this.tracks[t];e.type&&e.type!==t||(n.ending=!0,n.ended||(n.ended=!0,this.log(`${t} buffer reached EOS`)))}}));const r=!1!==(null==(n=this.overrides)?void 0:n.endOfStream);this.sourceBufferCount>0&&!this.sourceBuffers.some((([t])=>{var e;return t&&!(null!=(e=this.tracks[t])&&e.ended)}))?r?(this.log("Queueing EOS"),this.blockUntilOpen((()=>{this.tracksEnded();const{mediaSource:t}=this;t&&"open"===t.readyState?(this.log("Calling mediaSource.endOfStream()"),t.endOfStream(),this.hls.trigger(o.BUFFERED_TO_END,void 0)):t&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${t.readyState}`)}))):(this.tracksEnded(),this.hls.trigger(o.BUFFERED_TO_END,void 0)):"video"===e.type&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach((([t])=>{if(null!==t){const e=this.tracks[t];e&&(e.ending=!1)}}))}onLevelUpdated(t,{details:e}){e.fragments.length&&(this.details=e,this.updateDuration())}updateDuration(){this.blockUntilOpen((()=>{const t=this.getDurationAndRange();t&&this.updateMediaSource(t)}))}onError(t,e){if(e.details===a.BUFFER_APPEND_ERROR&&e.frag){var n;const t=null==(n=e.errorAction)?void 0:n.nextAutoLevel;r(t)&&t!==e.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:t,details:e,media:n}=this;if(!n||null===e)return;if(!this.sourceBufferCount)return;const i=t.config,s=n.currentTime,A=e.levelTargetDuration,a=e.live&&null!==i.liveBackBufferLength?i.liveBackBufferLength:i.backBufferLength;if(r(a)&&a>=0){const t=Math.max(a,A),e=Math.floor(s/A)*A-t;this.flushBackBuffer(s,A,e)}const o=i.frontBufferFlushThreshold;if(r(o)&&o>0){const t=Math.max(i.maxBufferLength,o),e=Math.max(t,A),n=Math.floor(s/A)*A+e;this.flushFrontBuffer(s,A,n)}}flushBackBuffer(t,e,n){this.sourceBuffers.forEach((([t,e])=>{if(e){const i=nn.getBuffered(e);if(i.length>0&&n>i.start(0)){var r;this.hls.trigger(o.BACK_BUFFER_REACHED,{bufferEnd:n});const e=this.tracks[t];if(null!=(r=this.details)&&r.live)this.hls.trigger(o.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(null!=e&&e.ended)return void this.log(`Cannot flush ${t} back buffer while SourceBuffer is in ended state`);this.hls.trigger(o.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:t})}}}))}flushFrontBuffer(t,e,n){this.sourceBuffers.forEach((([e,r])=>{if(r){const i=nn.getBuffered(r),s=i.length;if(s<2)return;const A=i.start(s-1),a=i.end(s-1);if(n>A||t>=A&&t<=a)return;this.hls.trigger(o.BUFFER_FLUSHING,{startOffset:A,endOffset:1/0,type:e})}}))}getDurationAndRange(){var t;const{details:e,mediaSource:n}=this;if(!e||!this.media||"open"!==(null==n?void 0:n.readyState))return null;const i=e.edge;if(e.live&&this.hls.config.liveDurationInfinity){if(e.fragments.length&&n.setLiveSeekableRange){const t=Math.max(0,e.fragmentStart);return{duration:1/0,start:t,end:Math.max(t,i)}}return{duration:1/0}}const s=null==(t=this.overrides)?void 0:t.duration;if(s)return r(s)?{duration:s}:null;const A=this.media.duration;return i>(r(n.duration)?n.duration:0)&&i>A||!r(A)?{duration:i}:null}updateMediaSource({duration:t,start:e,end:n}){const i=this.mediaSource;this.media&&i&&"open"===i.readyState&&(i.duration!==t&&(r(t)&&this.log(`Updating MediaSource duration to ${t.toFixed(3)}`),i.duration=t),void 0!==e&&void 0!==n&&(this.log(`MediaSource duration is set to ${i.duration}. Setting seekable range to ${e}-${n}.`),i.setLiveSeekableRange(e,n)))}get tracksReady(){const t=this.pendingTrackCount;return t>0&&(t>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:t,pendingTrackCount:e,tracks:n}=this;if(this.log(`checkPendingTracks (pending: ${e} codec events expected: ${t}) ${re(n)}`),this.tracksReady){var r;const t=null==(r=this.transferData)?void 0:r.tracks;t&&Object.keys(t).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const t={};this.sourceBuffers.forEach((([e,n])=>{if(e){const r=this.tracks[e];t[e]={buffer:n,container:r.container,codec:r.codec,supplemental:r.supplemental,levelCodec:r.levelCodec,id:r.id,metadata:r.metadata}}})),this.hls.trigger(o.BUFFER_CREATED,{tracks:t}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach((([t])=>{this.executeNext(t)}))}else{const t=new Error("could not create source buffer for media codec(s)");this.hls.trigger(o.ERROR,{type:A.MEDIA_ERROR,details:a.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:t,reason:t.message})}}createSourceBuffers(){const{tracks:t,sourceBuffers:e,mediaSource:n}=this;if(!n)throw new Error("createSourceBuffers called when mediaSource was null");for(const i in t){const s=i,l=t[s];if(this.isPending(l)){const t=this.getTrackCodec(l,s),i=`${l.container};codecs=${t}`;l.codec=t,this.log(`creating sourceBuffer(${i})${this.currentOp(s)?" Queued":""} ${re(l)}`);try{const t=n.addSourceBuffer(i),r=vs(s),A=[s,t];e[r]=A,l.buffer=t}catch(t){var r;return this.error(`error while trying to add sourceBuffer: ${t.message}`),this.shiftAndExecuteNext(s),null==(r=this.operationQueue)||r.removeBlockers(),delete this.tracks[s],void this.hls.trigger(o.ERROR,{type:A.MEDIA_ERROR,details:a.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:t,sourceBufferName:s,mimeType:i,parent:l.id})}this.trackSourceBuffer(s,l)}}this.bufferCreated()}getTrackCodec(t,e){const n=t.supplemental;let r=t.codec;n&&("video"===e||"audiovideo"===e)&&Ft(n,"video")&&(r=function(t,e){const n=[];if(t){const e=t.split(",");for(let t=0;t<e.length;t++)kt(e[t],"video")||n.push(e[t])}return e&&n.push(e),n.join(",")}(r,n));const i=Rt(r,t.levelCodec);return i?"audio"===e.slice(0,5)?Lt(i,this.appendSource):i:""}trackSourceBuffer(t,e){const n=e.buffer;if(!n)return;const r=this.getTrackCodec(e,t);this.tracks[t]={buffer:n,codec:r,container:e.container,levelCodec:e.levelCodec,supplemental:e.supplemental,metadata:e.metadata,id:e.id,listeners:[]},this.removeBufferListeners(t),this.addBufferListener(t,"updatestart",this.onSBUpdateStart),this.addBufferListener(t,"updateend",this.onSBUpdateEnd),this.addBufferListener(t,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(t,"bufferedchange",((t,e)=>{const n=e.removedRanges;null!=n&&n.length&&this.hls.trigger(o.BUFFER_FLUSHED,{type:t})}))}get mediaSrc(){var t,e;const n=(null==(t=this.media)||null==(e=t.querySelector)?void 0:e.call(t,"source"))||this.media;return null==n?void 0:n.src}onSBUpdateStart(t){const e=this.currentOp(t);e&&e.onStart()}onSBUpdateEnd(t){var e;if("closed"===(null==(e=this.mediaSource)?void 0:e.readyState))return void this.resetBuffer(t);const n=this.currentOp(t);n&&(n.onComplete(),this.shiftAndExecuteNext(t))}onSBUpdateError(t,e){var n;const r=new Error(`${t} SourceBuffer error. MediaSource readyState: ${null==(n=this.mediaSource)?void 0:n.readyState}`);this.error(`${r}`,e),this.hls.trigger(o.ERROR,{type:A.MEDIA_ERROR,details:a.BUFFER_APPENDING_ERROR,sourceBufferName:t,error:r,fatal:!1});const i=this.currentOp(t);i&&i.onError(r)}updateTimestampOffset(t,e,n,r,i,s){const A=e-t.timestampOffset;Math.abs(A)>=n&&(this.log(`Updating ${r} SourceBuffer timestampOffset to ${e} (sn: ${i} cc: ${s})`),t.timestampOffset=e)}removeExecutor(t,e,n){const{media:i,mediaSource:s}=this,A=this.tracks[t],a=null==A?void 0:A.buffer;if(!i||!s||!a)return this.warn(`Attempting to remove from the ${t} SourceBuffer, but it does not exist`),void this.shiftAndExecuteNext(t);const o=r(i.duration)?i.duration:1/0,l=r(s.duration)?s.duration:1/0,u=Math.max(0,e),c=Math.min(n,o,l);c>u&&(!A.ending||A.ended)?(A.ended=!1,this.log(`Removing [${u},${c}] from the ${t} SourceBuffer`),a.remove(u,c)):this.shiftAndExecuteNext(t)}appendExecutor(t,e){const n=this.tracks[e],r=null==n?void 0:n.buffer;if(!r)throw new ws(`Attempting to append to the ${e} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,r.appendBuffer(t)}blockUntilOpen(t){if(this.isUpdating()||this.isQueued())this.blockBuffers(t).catch((t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)}));else try{t()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some((([t,e])=>t&&e.updating))}isQueued(){return this.sourceBuffers.some((([t])=>t&&!!this.currentOp(t)))}isPending(t){return!!t&&!t.buffer}blockBuffers(t,e=this.sourceBufferTypes){if(!e.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(t);const{operationQueue:n}=this,r=e.map((t=>this.appendBlocker(t)));return e.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(r).then((e=>{n===this.operationQueue&&(t(),this.stepOperationQueue(this.sourceBufferTypes))}))}stepOperationQueue(t){t.forEach((t=>{var e;const n=null==(e=this.tracks[t])?void 0:e.buffer;n&&!n.updating&&this.shiftAndExecuteNext(t)}))}append(t,e,n){this.operationQueue&&this.operationQueue.append(t,e,n)}appendBlocker(t){if(this.operationQueue)return this.operationQueue.appendBlocker(t)}currentOp(t){return this.operationQueue?this.operationQueue.current(t):null}executeNext(t){t&&this.operationQueue&&this.operationQueue.executeNext(t)}shiftAndExecuteNext(t){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(t)}get pendingTrackCount(){return Object.keys(this.tracks).reduce(((t,e)=>t+(this.isPending(this.tracks[e])?1:0)),0)}get sourceBufferCount(){return this.sourceBuffers.reduce(((t,[e])=>t+(e?1:0)),0)}get sourceBufferTypes(){return this.sourceBuffers.map((([t])=>t)).filter((t=>!!t))}addBufferListener(t,e,n){const r=this.tracks[t];if(!r)return;const i=r.buffer;if(!i)return;const s=n.bind(this,t);r.listeners.push({event:e,listener:s}),i.addEventListener(e,s)}removeBufferListeners(t){const e=this.tracks[t];if(!e)return;const n=e.buffer;n&&(e.listeners.forEach((t=>{n.removeEventListener(t.event,t.listener)})),e.listeners.length=0)}},capLevelController:Bs,errorController:class extends B{constructor(t){super("error-controller",t.logger),this.hls=void 0,this.playlistError=0,this.hls=t,this.registerListeners()}registerListeners(){const t=this.hls;t.on(o.ERROR,this.onError,this),t.on(o.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const t=this.hls;t&&(t.off(o.ERROR,this.onError,this),t.off(o.ERROR,this.onErrorOut,this),t.off(o.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(t){}stopLoad(){this.playlistError=0}getVariantLevelIndex(t){return(null==t?void 0:t.type)===d?t.level:this.getVariantIndex()}getVariantIndex(){var t;const e=this.hls,n=e.currentLevel;return null!=(t=e.loadLevelObj)&&t.details||-1===n?e.loadLevel:n}variantHasKey(t,e){if(t){var n;if(null!=(n=t.details)&&n.hasKey(e))return!0;const r=t.audioGroups;if(r){return this.hls.allAudioTracks.filter((t=>r.indexOf(t.groupId)>=0)).some((t=>{var n;return null==(n=t.details)?void 0:n.hasKey(e)}))}}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(t,e){var n;if(e.fatal)return;const r=this.hls,i=e.context;switch(e.details){case a.FRAG_LOAD_ERROR:case a.FRAG_LOAD_TIMEOUT:case a.KEY_LOAD_ERROR:case a.KEY_LOAD_TIMEOUT:return void(e.errorAction=this.getFragRetryOrSwitchAction(e));case a.FRAG_PARSING_ERROR:if(null!=(n=e.frag)&&n.gap)return void(e.errorAction=Ue());case a.FRAG_GAP:case a.FRAG_DECRYPT_ERROR:return e.errorAction=this.getFragRetryOrSwitchAction(e),void(e.errorAction.action=ke);case a.LEVEL_EMPTY_ERROR:case a.LEVEL_PARSING_ERROR:{var s;const t=e.parent===d?e.level:r.loadLevel;e.details===a.LEVEL_EMPTY_ERROR&&null!=(s=e.context)&&null!=(s=s.levelDetails)&&s.live?e.errorAction=this.getPlaylistRetryOrSwitchAction(e,t):(e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t))}return;case a.LEVEL_LOAD_ERROR:case a.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==i?void 0:i.level)&&(e.errorAction=this.getPlaylistRetryOrSwitchAction(e,i.level)));case a.AUDIO_TRACK_LOAD_ERROR:case a.AUDIO_TRACK_LOAD_TIMEOUT:case a.SUBTITLE_LOAD_ERROR:case a.SUBTITLE_TRACK_LOAD_TIMEOUT:if(i){const t=r.loadLevelObj;if(t&&(i.type===c&&t.hasAudioGroup(i.groupId)||i.type===h&&t.hasSubtitleGroup(i.groupId)))return e.errorAction=this.getPlaylistRetryOrSwitchAction(e,r.loadLevel),e.errorAction.action=ke,void(e.errorAction.flags=xe)}return;case a.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:return void(e.errorAction={action:ke,flags:Ie});case a.KEY_SYSTEM_SESSION_UPDATE_FAILED:case a.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case a.KEY_SYSTEM_NO_SESSION:return void(e.errorAction={action:ke,flags:De});case a.BUFFER_ADD_CODEC_ERROR:case a.REMUX_ALLOC_ERROR:case a.BUFFER_APPEND_ERROR:var o;if(!e.errorAction)e.errorAction=this.getLevelSwitchAction(e,null!=(o=e.level)?o:r.loadLevel);return;case a.INTERNAL_EXCEPTION:case a.BUFFER_APPENDING_ERROR:case a.BUFFER_FULL_ERROR:case a.LEVEL_SWITCH_ERROR:case a.BUFFER_STALLED_ERROR:case a.BUFFER_SEEK_OVER_HOLE:case a.BUFFER_NUDGE_ON_STALL:return void(e.errorAction=Ue())}e.type===A.KEY_SYSTEM_ERROR&&(e.levelRetry=!1,e.errorAction=Ue())}getPlaylistRetryOrSwitchAction(t,e){const n=ye(this.hls.config.playlistLoadPolicy,t),r=this.playlistError++;if(be(n,r,me(t),t.response))return{action:Te,flags:Se,retryConfig:n,retryCount:r};const i=this.getLevelSwitchAction(t,e);return n&&(i.retryConfig=n,i.retryCount=r),i}getFragRetryOrSwitchAction(t){const e=this.hls,n=this.getVariantLevelIndex(t.frag),r=e.levels[n],{fragLoadPolicy:i,keyLoadPolicy:s}=e.config,A=ye(_e(t)?s:i,t),o=e.levels.reduce(((t,e)=>t+e.fragmentError),0);if(r&&(t.details!==a.FRAG_GAP&&r.fragmentError++,!we(t))){if(be(A,o,me(t),t.response))return{action:Te,flags:Se,retryConfig:A,retryCount:o}}const l=this.getLevelSwitchAction(t,n);return A&&(l.retryConfig=A,l.retryCount=o),l}getLevelSwitchAction(t,e){const n=this.hls;null==e&&(e=n.loadLevel);const r=this.hls.levels[e];if(r){var i,s;const e=t.details;r.loadError++,e===a.BUFFER_APPEND_ERROR&&r.fragmentError++;let l=-1;const{levels:u,loadLevel:g,minAutoLevel:m,maxAutoLevel:_}=n;n.autoLevelEnabled||n.config.preserveManualLevelOnError||(n.loadLevel=-1);const w=null==(i=t.frag)?void 0:i.type,y=(w===f&&e===a.FRAG_PARSING_ERROR||"audio"===t.sourceBufferName&&(e===a.BUFFER_ADD_CODEC_ERROR||e===a.BUFFER_APPEND_ERROR))&&u.some((({audioCodec:t})=>r.audioCodec!==t)),v="video"===t.sourceBufferName&&(e===a.BUFFER_ADD_CODEC_ERROR||e===a.BUFFER_APPEND_ERROR)&&u.some((({codecSet:t,audioCodec:e})=>r.codecSet!==t&&r.audioCodec===e)),{type:B,groupId:b}=null!=(s=t.context)?s:{};for(let n=u.length;n--;){const i=(n+g)%u.length;if(i!==g&&i>=m&&i<=_&&0===u[i].loadError){var A,o;const n=u[i];if(e===a.FRAG_GAP&&w===d&&t.frag){const e=u[i].details;if(e){const n=de(t.frag,e.fragments,t.frag.start);if(null!=n&&n.gap)continue}}else{if(B===c&&n.hasAudioGroup(b)||B===h&&n.hasSubtitleGroup(b))continue;if(w===f&&null!=(A=r.audioGroups)&&A.some((t=>n.hasAudioGroup(t)))||w===p&&null!=(o=r.subtitleGroups)&&o.some((t=>n.hasSubtitleGroup(t)))||y&&r.audioCodec===n.audioCodec||v&&r.codecSet===n.codecSet||!y&&r.codecSet!==n.codecSet)continue}l=i;break}}if(l>-1&&n.loadLevel!==l)return t.levelRetry=!0,this.playlistError=0,{action:ke,flags:Se,nextAutoLevel:l}}return{action:ke,flags:xe}}onErrorOut(t,e){var n;switch(null==(n=e.errorAction)?void 0:n.action){case Ce:break;case ke:this.sendAlternateToPenaltyBox(e),e.errorAction.resolved||e.details===a.FRAG_GAP?/MediaSource readyState: ended/.test(e.error.message)&&(this.warn(`MediaSource ended after "${e.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError()):e.fatal=!0}e.fatal&&this.hls.stopLoad()}sendAlternateToPenaltyBox(t){const e=this.hls,n=t.errorAction;if(!n)return;const{flags:r}=n,i=n.nextAutoLevel;switch(r){case Se:this.switchLevel(t,i);break;case Ie:{const r=this.getVariantLevelIndex(t.frag),i=e.levels[r],s=null==i?void 0:i.attrs["HDCP-LEVEL"];if(n.hdcpLevel=s,"NONE"===s)this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(s){e.maxHdcpLevel=Zt[Zt.indexOf(s)-1],n.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${e.maxHdcpLevel}" or lower`);break}}case De:{const e=t.decryptdata;if(e){const r=this.hls.levels,i=r.length;for(let n=i;n--;){var s,A;if(this.variantHasKey(r[n],e))this.log(`Banned key found in level ${n} (${r[n].bitrate}bps) or audio group "${null==(s=r[n].audioGroups)?void 0:s.join(",")}" (${null==(A=t.frag)?void 0:A.type} fragment) ${D(e.keyId||[])}`),r[n].fragmentError++,r[n].loadError++,this.log(`Removing level ${n} with key error (${t.error})`),this.hls.removeLevel(n)}const a=t.frag;if(this.hls.levels.length<i)n.resolved=!0;else if(a&&a.type!==d){const t=a.decryptdata;t&&!e.matches(t)&&(n.resolved=!0)}}break}}n.resolved||this.switchLevel(t,i)}switchLevel(t,e){if(void 0!==e&&t.errorAction&&(this.warn(`switching to level ${e} after ${t.details}`),this.hls.nextAutoLevel=e,t.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,t.details===a.BUFFER_ADD_CODEC_ERROR&&t.mimeType&&"audiovideo"!==t.sourceBufferName)){const e=Mt(t.mimeType),n=this.hls.levels;for(let r=n.length;r--;)n[r][`${t.sourceBufferName}Codec`]===e&&(this.log(`Removing level ${r} for ${t.details} ("${e}" not supported)`),this.hls.removeLevel(r))}}},fpsController:class{constructor(t){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=t,this.registerListeners()}setStreamController(t){this.streamController=t}registerListeners(){this.hls.on(o.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(o.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(o.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(o.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(t,e){const n=this.hls.config;if(n.capLevelOnFPSDrop){const t=e.media instanceof self.HTMLVideoElement?e.media:null;this.media=t,t&&"function"==typeof t.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(t,e,n){const r=performance.now();if(e){if(this.lastTime){const t=r-this.lastTime,i=n-this.lastDroppedFrames,s=e-this.lastDecodedFrames,A=1e3*i/t,a=this.hls;if(a.trigger(o.FPS_DROP,{currentDropped:i,currentDecoded:s,totalDroppedFrames:n}),A>0&&i>a.config.fpsDroppedMonitoringThreshold*s){let t=a.currentLevel;a.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+t),t>0&&(-1===a.autoLevelCapping||a.autoLevelCapping>=t)&&(t-=1,a.trigger(o.FPS_DROP_LEVEL_CAPPING,{level:t,droppedLevel:a.currentLevel}),a.autoLevelCapping=t,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=n,this.lastDecodedFrames=e}}checkFPSInterval(){const t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){const e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)}},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:Dn,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:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},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},{cueHandler:Pa,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:class extends Lr{constructor(t,e,n){super(t,e,n,"subtitle-stream-controller",p),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(o.LEVEL_LOADED,this.onLevelLoaded,this),t.on(o.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(o.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(o.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(o.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(o.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:t}=this;t.off(o.LEVEL_LOADED,this.onLevelLoaded,this),t.off(o.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(o.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(o.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(o.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(o.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(t,e){this.stopLoad(),this.state=br,this.setInterval(500),this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=e?-1:t,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(t,e){this.tracksBuffered=[],super.onMediaDetaching(t,e)}onLevelLoaded(t,e){this.mainDetails=e.details}onSubtitleFragProcessed(t,e){const{frag:n,success:r}=e;if(this.fragContextChanged(n)||(W(n)&&(this.fragPrevious=n),this.state=br),!r)return;const i=this.tracksBuffered[this.currentTrackId];if(!i)return;let s;const A=n.start;for(let t=0;t<i.length;t++)if(A>=i[t].start&&A<=i[t].end){s=i[t];break}const a=n.start+n.duration;s?s.end=a:(s={start:A,end:a},i.push(s)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null),this.media&&this.tick()}onBufferFlushing(t,e){const{startOffset:n,endOffset:r}=e;if(0===n&&r!==Number.POSITIVE_INFINITY){const t=r-1;if(t<=0)return;e.endOffsetSubtitles=Math.max(0,t),this.tracksBuffered.forEach((e=>{for(let n=0;n<e.length;)if(e[n].end<=t)e.shift();else{if(!(e[n].start<t))break;e[n].start=t,n++}})),this.fragmentTracker.removeFragmentsInRange(n,t,p)}}onError(t,e){const n=e.frag;(null==n?void 0:n.type)===p&&(e.details===a.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==Br&&(this.state=br))}onSubtitleTracksUpdated(t,{subtitleTracks:e}){this.levels&&ds(this.levels,e)?this.levels=e.map((t=>new te(t))):(this.tracksBuffered=[],this.levels=e.map((t=>{const e=new te(t);return this.tracksBuffered[e.id]=[],e})),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,p),this.fragPrevious=null,this.mediaBuffer=null)}onSubtitleTrackSwitch(t,e){var n;if(this.currentTrackId=e.id,null==(n=this.levels)||!n.length||-1===this.currentTrackId)return void this.clearInterval();const r=this.levels[this.currentTrackId];null!=r&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.state!==Br&&this.setInterval(500)}onSubtitleTrackLoaded(t,e){var n;const{currentTrackId:r,levels:i}=this,{details:s,id:A}=e;if(!i)return void this.warn(`Subtitle tracks were reset while loading level ${A}`);const a=i[A];if(A>=i.length||!a)return;this.log(`Subtitle track ${A} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(s.live||null!=(n=a.details)&&n.live){if(s.deltaUpdateFailed)return;const t=this.mainDetails;if(!t)return void(this.startFragRequested=!1);const e=t.fragments[0];var u;if(a.details)l=this.alignPlaylists(s,a.details,null==(u=this.levelLastLoaded)?void 0:u.details),0===l&&e&&(l=e.start,Ar(s,l));else s.hasProgramDateTime&&t.hasProgramDateTime?(_r(s,t),l=s.fragmentStart):e&&(l=e.start,Ar(s,l));t&&!this.startFragRequested&&this.setStartPosition(t,l)}if(a.details=s,this.levelLastLoaded=a,A===r&&(this.hls.trigger(o.SUBTITLE_TRACK_UPDATED,{details:s,id:A,groupId:e.groupId}),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===br)){de(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),a.details=void 0)}}_handleFragmentLoadComplete(t){const{frag:e,payload:n}=t,r=e.decryptdata,i=this.hls;if(!this.fragContextChanged(e)&&n&&n.byteLength>0&&null!=r&&r.key&&r.iv&&mn(r.method)){const t=performance.now();this.decrypter.decrypt(new Uint8Array(n),r.key.buffer,r.iv.buffer,_n(r.method)).catch((t=>{throw i.trigger(o.ERROR,{type:A.MEDIA_ERROR,details:a.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t})).then((n=>{const r=performance.now();i.trigger(o.FRAG_DECRYPTED,{frag:e,payload:n,stats:{tstart:t,tdecrypt:r}})})).catch((t=>{this.warn(`${t.name}: ${t.message}`),this.state=br}))}}doTick(){if(this.media){if(this.state===br){const{currentTrackId:t,levels:e}=this,n=null==e?void 0:e[t];if(!n||!e.length||!n.details)return;if(this.waitForLive(n))return;const{config:r}=this,i=this.getLoadPosition(),s=nn.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],i,r.maxBufferHole),{end:A,len:a}=s,o=n.details;if(a>this.hls.maxBufferLength+o.levelTargetDuration)return;const l=o.fragments,u=l.length,c=o.edge;let h=null;const d=this.fragPrevious;if(A<c){const t=r.maxFragLookUpTolerance,e=A>c-t?0:t;h=de(d,l,Math.max(l[0].start,A),e),!h&&d&&d.start<l[0].start&&(h=l[0])}else h=l[u-1];if(h=this.filterReplacedPrimary(h,n.details),!h)return;const f=l[h.sn-o.startSN-1];if(f&&f.cc===h.cc&&this.fragmentTracker.getState(f)===Le&&(h=f),this.fragmentTracker.getState(h)===Le){const t=this.mapToInitFragWhenRequired(h);t&&this.loadFragment(t,n,A)}}}else this.state=br}loadFragment(t,e,n){W(t)?super.loadFragment(t,e,n):this._loadInitSegment(t,e)}get mediaBufferTimeRanges(){return new $A(this.tracksBuffered[this.currentTrackId]||[])}},subtitleTrackController:class extends hs{constructor(t){super(t,"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 e=FA(this.media.textTracks);for(let n=0;n<e.length;n++)if("hidden"===e[n].mode)t=e[n];else if("showing"===e[n].mode){t=e[n];break}const n=this.findTrackForTextTrack(t);this.subtitleTrack!==n&&this.setSubtitleTrack(n)},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(t){this._subtitleDisplay=t,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:t}=this;t.on(o.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(o.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(o.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.MANIFEST_PARSED,this.onManifestParsed,this),t.on(o.LEVEL_LOADING,this.onLevelLoading,this),t.on(o.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(o.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(o.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(o.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(o.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(o.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.MANIFEST_PARSED,this.onManifestParsed,this),t.off(o.LEVEL_LOADING,this.onLevelLoading,this),t.off(o.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(o.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(o.ERROR,this.onError,this)}onMediaAttached(t,e){this.media=e.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(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,t)}onMediaDetaching(t,e){const n=this.media;if(!n)return;const r=!!e.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,r)return;FA(n.textTracks).forEach((t=>{CA(t)}))}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(t,e){this.tracks=e.subtitleTracks}onSubtitleTrackLoaded(t,e){const{id:n,groupId:r,details:i}=e,s=this.tracksInGroup[n];if(!s||s.groupId!==r)return void this.warn(`Subtitle track with id:${n} and group:${r} not found in active group ${null==s?void 0:s.groupId}`);const A=s.details;s.details=e.details,this.log(`Subtitle track ${n} "${s.name}" lang:${s.lang} group:${r} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,e,A)}onLevelLoading(t,e){this.switchLevel(e.level)}onLevelSwitching(t,e){this.switchLevel(e.level)}switchLevel(t){const e=this.hls.levels[t];if(!e)return;const n=e.subtitleGroups||null,r=this.groupIds;let i=this.currentTrack;if(!n||(null==r?void 0:r.length)!==(null==n?void 0:n.length)||null!=n&&n.some((t=>-1===(null==r?void 0:r.indexOf(t))))){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const t=this.tracks.filter((t=>!n||-1!==n.indexOf(t.groupId)));if(t.length)this.selectDefaultTrack&&!t.some((t=>t.default))&&(this.selectDefaultTrack=!1),t.forEach(((t,e)=>{t.id=e}));else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=t;const e=this.hls.config.subtitlePreference;if(!i&&e){this.selectDefaultTrack=!1;const n=ae(e,t);if(n>-1)i=t[n];else{const t=ae(e,this.tracks);i=this.tracks[t]}}let r=this.findTrackId(i);-1===r&&i&&(r=this.findTrackId(null));const s={subtitleTracks:t};this.log(`Updating subtitle tracks, ${t.length} track(s) found in "${null==n?void 0:n.join(",")}" group-id`),this.hls.trigger(o.SUBTITLE_TRACKS_UPDATED,s),-1!==r&&-1===this.trackId&&this.setSubtitleTrack(r)}}findTrackId(t){const e=this.tracksInGroup,n=this.selectDefaultTrack;for(let r=0;r<e.length;r++){const i=e[r];if((!n||i.default)&&(n||t)&&(!t||oe(i,t)))return r}if(t){for(let n=0;n<e.length;n++){const r=e[n];if(fs(t.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return n}for(let n=0;n<e.length;n++){const r=e[n];if(fs(t.attrs,r.attrs,["LANGUAGE"]))return n}}return-1}findTrackForTextTrack(t){if(t){const e=this.tracksInGroup;for(let n=0;n<e.length;n++){if(ps(e[n],t))return n}}return-1}onError(t,e){!e.fatal&&e.context&&(e.context.type!==h||e.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(e.context.groupId)||this.checkRetry(e))}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(t){this.selectDefaultTrack=!1,this.setSubtitleTrack(t)}setSubtitleOption(t){if(this.hls.config.subtitlePreference=t,t){if(-1===t.id)return this.setSubtitleTrack(-1),null;const e=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,e.length){const n=this.currentTrack;if(n&&oe(t,n))return n;const r=ae(t,this.tracksInGroup);if(r>-1){const t=this.tracksInGroup[r];return this.setSubtitleTrack(r),t}if(n)return null;{const n=ae(t,e);if(n>-1)return e[n]}}}return null}loadPlaylist(t){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,t)}loadingPlaylist(t,e){super.loadingPlaylist(t,e);const n=t.id,r=t.groupId,i=this.getUrlWithDirectives(t.url,e),s=t.details,A=null==s?void 0:s.age;this.log(`Loading subtitle ${n} "${t.name}" lang:${t.lang} group:${r}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""}${A&&s.live?" age "+A.toFixed(1)+(s.type?" "+s.type||0:""):""} ${i}`),this.hls.trigger(o.SUBTITLE_TRACK_LOADING,{url:i,id:n,groupId:r,deliveryDirectives:e||null,track:t})}toggleTrackModes(){const{media:t}=this;if(!t)return;const e=FA(t.textTracks),n=this.currentTrack;let r;if(n&&(r=e.filter((t=>ps(n,t)))[0],r||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(e).forEach((t=>{"disabled"!==t.mode&&t!==r&&(t.mode="disabled")})),r){const t=this.subtitleDisplay?"showing":"hidden";r.mode!==t&&(r.mode=t)}}setSubtitleTrack(t){const e=this.tracksInGroup;if(!this.media)return void(this.queuedDefaultTrack=t);if(t<-1||t>=e.length||!r(t))return void this.warn(`Invalid subtitle track id: ${t}`);this.selectDefaultTrack=!1;const n=this.currentTrack,i=e[t]||null;if(this.trackId=t,this.currentTrack=i,this.toggleTrackModes(),!i)return void this.hls.trigger(o.SUBTITLE_TRACK_SWITCH,{id:t});const s=!!i.details&&!i.details.live;if(t===this.trackId&&i===n&&s)return;this.log(`Switching to subtitle-track ${t}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:A,groupId:a="",name:l,type:u,url:c}=i;this.hls.trigger(o.SUBTITLE_TRACK_SWITCH,{id:A,groupId:a,name:l,type:u,url:c});const h=this.switchParams(i.url,null==n?void 0:n.details,i.details);this.loadPlaylist(h)}},timelineController:class{constructor(t){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={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.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}},t.on(o.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(o.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(o.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(o.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(o.FRAG_LOADING,this.onFragLoading,this),t.on(o.FRAG_LOADED,this.onFragLoaded,this),t.on(o.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(o.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(o.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(o.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(o.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:t}=this;t.off(o.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(o.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(o.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(o.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(o.FRAG_LOADING,this.onFragLoading,this),t.off(o.FRAG_LOADED,this.onFragLoaded,this),t.off(o.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(o.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(o.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(o.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(o.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const t=new La(this,"textTrack1"),e=new La(this,"textTrack2"),n=new La(this,"textTrack3"),r=new La(this,"textTrack4");this.cea608Parser1=new Aa(1,t,e),this.cea608Parser2=new Aa(3,n,r)}addCues(t,e,n,r,i){let s=!1;for(let t=i.length;t--;){const r=i[t],o=(A=r[0],a=r[1],l=e,u=n,Math.min(a,u)-Math.max(A,l));if(o>=0&&(r[0]=Math.min(r[0],e),r[1]=Math.max(r[1],n),s=!0,o/(n-e)>.5))return}var A,a,l,u;if(s||i.push([e,n]),this.config.renderTextTracksNatively){const i=this.captionsTracks[t];this.Cues.newCue(i,e,n,r)}else{const i=this.Cues.newCue(null,e,n,r);this.hls.trigger(o.CUES_PARSED,{type:"captions",cues:i,track:t})}}onInitPtsFound(t,{frag:e,id:n,initPTS:r,timescale:i,trackId:s}){const{unparsedVttFrags:A}=this;n===d&&(this.initPTS[e.cc]={baseTime:r,timescale:i,trackId:s}),A.length&&(this.unparsedVttFrags=[],A.forEach((t=>{this.initPTS[t.frag.cc]?this.onFragLoaded(o.FRAG_LOADED,t):this.hls.trigger(o.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t.frag,error:new Error("Subtitle discontinuity domain does not match main")})})))}getExistingTrack(t,e){const{media:n}=this;if(n)for(let r=0;r<n.textTracks.length;r++){const i=n.textTracks[r];if(Qa(i,{name:t,lang:e,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return i}return null}createCaptionsTrack(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)}createNativeTrack(t){if(this.captionsTracks[t])return;const{captionsProperties:e,captionsTracks:n,media:r}=this,{label:i,languageCode:s}=e[t],A=this.getExistingTrack(i,s);if(A)n[t]=A,CA(n[t]),bA(n[t],r);else{const e=this.createTextTrack("captions",i,s);e&&(e[t]=!0,n[t]=e)}}createNonNativeTrack(t){if(this.nonNativeCaptionsTracks[t])return;const e=this.captionsProperties[t];if(!e)return;const n={_id:t,label:e.label,kind:"captions",default:!!e.media&&!!e.media.default,closedCaptions:e.media};this.nonNativeCaptionsTracks[t]=n,this.hls.trigger(o.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[n]})}createTextTrack(t,e,n){const r=this.media;if(r)return r.addTextTrack(t,e,n)}onMediaAttaching(t,e){this.media=e.media,e.mediaSource||this._cleanTracks()}onMediaDetaching(t,e){const n=!!e.transferMedia;if(this.media=null,n)return;const{captionsTracks:r}=this;Object.keys(r).forEach((t=>{CA(r[t]),delete r[t]})),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},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:t}=this;if(!t)return;const e=t.textTracks;if(e)for(let t=0;t<e.length;t++)CA(e[t])}onSubtitleTracksUpdated(t,e){const n=e.subtitleTracks||[],r=n.some((t=>t.textCodec===ba));if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(ds(this.tracks,n))return void(this.tracks=n);if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const t=this.media,e=t?FA(t.textTracks):null;if(this.tracks.forEach(((t,n)=>{let r;if(e){let n=null;for(let r=0;r<e.length;r++)if(e[r]&&Qa(e[r],t)){n=e[r],e[r]=null;break}n&&(r=n)}if(r)CA(r);else{const e=Ra(t);r=this.createTextTrack(e,t.name,t.lang),r&&(r.mode="disabled")}r&&this.textTracks.push(r)})),null!=e&&e.length){const t=e.filter((t=>null!==t)).map((t=>t.label));t.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${t.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const t=this.tracks.map((t=>({label:t.name,kind:t.type.toLowerCase(),default:t.default,subtitleTrack:t})));this.hls.trigger(o.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:t})}}}onManifestLoaded(t,e){this.config.enableCEA708Captions&&e.captions&&e.captions.forEach((t=>{const e=/(?:CC|SERVICE)([1-4])/.exec(t.instreamId);if(!e)return;const n=`textTrack${e[1]}`,r=this.captionsProperties[n];r&&(r.label=t.name,t.lang&&(r.languageCode=t.lang),r.media=t)}))}closedCaptionsForLevel(t){const e=this.hls.levels[t.level];return null==e?void 0:e.attrs["CLOSED-CAPTIONS"]}onFragLoading(t,e){if(this.enabled&&e.frag.type===d){var n,r;const{cea608Parser1:t,cea608Parser2:i,lastSn:s}=this,{cc:A,sn:a}=e.frag,o=null!=(n=null==(r=e.part)?void 0:r.index)?n:-1;t&&i&&(a!==s+1||a===s&&o!==this.lastPartIndex+1||A!==this.lastCc)&&(t.reset(),i.reset()),this.lastCc=A,this.lastSn=a,this.lastPartIndex=o}}onFragLoaded(t,e){const{frag:n,payload:r}=e;if(n.type===p)if(r.byteLength){const t=n.decryptdata,i="stats"in e;if(null==t||!t.encrypted||i){const t=this.tracks[n.level],i=this.vttCCs;i[n.cc]||(i[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),t&&t.textCodec===ba?this._parseIMSC1(n,r):this._parseVTTs(e)}}else this.hls.trigger(o.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(t,e){const n=this.hls;Fa(e,this.initPTS[t.cc],(e=>{this._appendCues(e,t.level),n.trigger(o.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})}),(e=>{n.logger.log(`Failed to parse IMSC1: ${e}`),n.trigger(o.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:e})}))}_parseVTTs(t){var e;const{frag:n,payload:r}=t,{initPTS:i,unparsedVttFrags:s}=this,A=i.length-1;if(!i[n.cc]&&-1===A)return void s.push(t);const a=this.hls;Ba(null!=(e=n.initSegment)&&e.data?gt(n.initSegment.data,new Uint8Array(r)).buffer:r,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,(t=>{this._appendCues(t,n.level),a.trigger(o.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})}),(e=>{const i="Missing initPTS for VTT MPEGTS"===e.message;i?s.push(t):this._fallbackToIMSC1(n,r),a.logger.log(`Failed to parse VTT cue: ${e}`),i&&A>n.cc||a.trigger(o.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:e})}))}_fallbackToIMSC1(t,e){const n=this.tracks[t.level];n.textCodec||Fa(e,this.initPTS[t.cc],(()=>{n.textCodec=ba,this._parseIMSC1(t,e)}),(()=>{n.textCodec="wvtt"}))}_appendCues(t,e){const n=this.hls;if(this.config.renderTextTracksNatively){const n=this.textTracks[e];if(!n||"disabled"===n.mode)return;t.forEach((t=>EA(n,t)))}else{const r=this.tracks[e];if(!r)return;const i=r.default?"default":"subtitles"+e;n.trigger(o.CUES_PARSED,{type:"subtitles",cues:t,track:i})}}onFragDecrypted(t,e){const{frag:n}=e;n.type===p&&this.onFragLoaded(o.FRAG_LOADED,e)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(t,e){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:n,samples:r}=e;if(n.type!==d||"NONE"!==this.closedCaptionsForLevel(n))for(let t=0;t<r.length;t++){const e=r[t].bytes;if(e){this.cea608Parser1||this.initCea608Parsers();const n=this.extractCea608Data(e);this.cea608Parser1.addData(r[t].pts,n[0]),this.cea608Parser2.addData(r[t].pts,n[1])}}}onBufferFlushing(t,{startOffset:e,endOffset:n,endOffsetSubtitles:r,type:i}){const{media:s}=this;if(s&&!(s.currentTime<n)){if(!i||"video"===i){const{captionsTracks:t}=this;Object.keys(t).forEach((r=>kA(t[r],e,n)))}if(this.config.renderTextTracksNatively&&0===e&&void 0!==r){const{textTracks:t}=this;Object.keys(t).forEach((n=>kA(t[n],e,r)))}}}extractCea608Data(t){const e=[[],[]],n=31&t[0];let r=2;for(let i=0;i<n;i++){const n=t[r++],i=127&t[r++],s=127&t[r++];if(0===i&&0===s)continue;if(0!=(4&n)){const t=3&n;0!==t&&1!==t||(e[t].push(i),e[t].push(s))}}return e}},audioStreamController:class extends Lr{constructor(t,e,n){super(t,e,n,"audio-stream-controller",f),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:t}=this;t.on(o.LEVEL_LOADED,this.onLevelLoaded,this),t.on(o.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.on(o.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(o.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(o.BUFFER_RESET,this.onBufferReset,this),t.on(o.BUFFER_CREATED,this.onBufferCreated,this),t.on(o.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(o.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(o.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(o.FRAG_LOADING,this.onFragLoading,this),t.on(o.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:t}=this;t&&(super.unregisterListeners(),t.off(o.LEVEL_LOADED,this.onLevelLoaded,this),t.off(o.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.off(o.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(o.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(o.BUFFER_RESET,this.onBufferReset,this),t.off(o.BUFFER_CREATED,this.onBufferCreated,this),t.off(o.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(o.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(o.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(o.FRAG_LOADING,this.onFragLoading,this),t.off(o.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(t,{frag:e,id:n,initPTS:r,timescale:i,trackId:s}){if(n===d){const t=e.cc,n=this.fragCurrent;if(this.initPTS[t]={baseTime:r,timescale:i,trackId:s},this.log(`InitPTS for cc: ${t} found from main: ${r/i} (${r}/${i}) trackId: ${s}`),this.mainAnchor=e,this.state===Dr){const n=this.waitingData;(!n&&!this.loadingParts||n&&n.frag.cc!==t)&&this.syncWithAnchor(e,null==n?void 0:n.frag)}else!this.hls.hasEnoughToStart&&n&&n.cc!==t?(n.abortRequests(),this.syncWithAnchor(e,n)):this.state===br&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(t,e){var n;const r=(null==(n=this.mainFragLoading)?void 0:n.frag)||null;if(e&&(null==r?void 0:r.cc)===e.cc)return;const i=(r||t).cc,s=ge(this.getLevelDetails(),i,this.getLoadPosition());s&&(this.log(`Syncing with main frag at ${s.start} cc ${s.cc}`),this.startFragRequested=!1,this.nextLoadPosition=s.start,this.resetLoadingState(),this.state===br&&this.doTickIdle())}startLoad(t,e){if(!this.levels)return this.startPosition=t,void(this.state=Br);const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),n>0&&-1===t?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),t=n,this.state=br):this.state=Fr,this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=e?-1:t,this.tick()}doTick(){switch(this.state){case br:this.doTickIdle();break;case Fr:{const{levels:t,trackId:e}=this,n=null==t?void 0:t[e],r=null==n?void 0:n.details;if(r&&!this.waitForLive(n)){if(this.waitForCdnTuneIn(r))break;this.state=Dr}break}case kr:this.checkRetryDate();break;case Dr:{const t=this.waitingData;if(t){const{frag:e,part:n,cache:r,complete:i}=t,s=this.mainAnchor;if(void 0!==this.initPTS[e.cc]){this.waitingData=null,this.state=Cr;const t={frag:e,part:n,payload:r.flush().buffer,networkDetails:null};this._handleFragmentLoadProgress(t),i&&super._handleFragmentLoadComplete(t)}else s&&s.cc!==t.frag.cc&&this.syncWithAnchor(s,t.frag)}else this.state=br}}this.onTickEnd()}resetLoadingState(){const t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:t}=this;null!=t&&t.readyState&&(this.lastCurrentTime=t.currentTime)}doTickIdle(){var t;const{hls:e,levels:n,media:r,trackId:i}=this,s=e.config;if(!this.buffering||!r&&!this.primaryPrefetch&&(this.startFragRequested||!s.startFragPrefetch)||null==n||!n[i])return;const A=n[i],a=A.details;if(!a||this.waitForLive(A)||this.waitForCdnTuneIn(a))return this.state=Fr,void(this.startFragRequested=!1);const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,G,f));const u=this.getFwdBufferInfo(l,f);if(null===u)return;if(!this.switchingTrack&&this._streamEnded(u,a))return e.trigger(o.BUFFER_EOS,{type:"audio"}),void(this.state=xr);const c=u.len,h=e.maxBufferLength,p=a.fragments,g=p[0].start,m=this.getLoadPosition(),_=this.flushing?m:u.end;if(this.switchingTrack&&r){const t=m;a.PTSKnown&&t<g&&(u.end>g||u.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=g+.05)}if(c>=h&&!this.switchingTrack&&_<p[p.length-1].start)return;let w=this.getNextFragment(_,a);if(w&&this.isLoopLoading(w,_)&&(w=this.getNextFragmentLoopLoading(w,a,u,d,h)),!w)return void(this.bufferFlushed=!0);let y=(null==(t=this.mainFragLoading)?void 0:t.frag)||null;if(!this.audioOnly&&this.startFragRequested&&y&&W(w)&&!w.endList&&(!a.live||!this.loadingParts&&_<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(y)===Oe&&(this.mainFragLoading=y=null),y&&W(y))){if(w.start>y.end){const t=this.fragmentTracker.getFragAtPos(_,d);t&&t.end>y.end&&(y=t,this.mainFragLoading={frag:t,targetBufferTime:null})}if(w.start>y.end)return}this.loadFragment(w,A,_)}onMediaDetaching(t,e){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(t,e)}onAudioTracksUpdated(t,{audioTracks:e}){this.resetTransmuxer(),this.levels=e.map((t=>new te(t)))}onAudioTrackSwitching(t,e){const n=!!e.url;this.trackId=e.id;const{fragCurrent:r}=this;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),n?(this.switchingTrack=e,this.flushAudioIfNeeded(e),this.state!==Br&&(this.setInterval(100),this.state=br,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=e,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(t,e){this.mainDetails=e.details;const n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(o.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(t,e){var n;const{levels:r}=this,{details:i,id:s,groupId:A,track:a}=e;if(!r)return void this.warn(`Audio tracks reset while loading track ${s} "${a.name}" of "${A}"`);const l=this.mainDetails;if(!l||i.endCC>l.endCC||l.expired)return this.cachedTrackLoadedData=e,void(this.state!==Br&&(this.state=Fr));this.cachedTrackLoadedData=null,this.log(`Audio track ${s} "${a.name}" of "${A}" loaded [${i.startSN},${i.endSN}]${i.lastPartSn?`[part-${i.lastPartSn}-${i.lastPartIndex}]`:""},duration:${i.totalduration}`);const u=r[s];let c=0;if(i.live||null!=(n=u.details)&&n.live){if(this.checkLiveUpdate(i),i.deltaUpdateFailed)return;var h;if(u.details)c=this.alignPlaylists(i,u.details,null==(h=this.levelLastLoaded)?void 0:h.details);i.alignedSliding||(mr(i,l),i.alignedSliding||_r(i,l),c=i.fragmentStart)}u.details=i,this.levelLastLoaded=u,this.startFragRequested||this.setStartPosition(l,c),this.hls.trigger(o.AUDIO_TRACK_UPDATED,{details:i,id:s,groupId:e.groupId}),this.state!==Fr||this.waitForCdnTuneIn(i)||(this.state=br),this.tick()}_handleFragmentLoadProgress(t){var e;const n=t.frag,{part:r,payload:i}=t,{config:s,trackId:A,levels:a}=this;if(!a)return void this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);const o=a[A];if(!o)return void this.warn("Audio track is undefined on fragment load progress");const l=o.details;if(!l)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(n.start);const u=s.defaultAudioCodec||o.audioCodec||"mp4a.40.2";let c=this.transmuxer;c||(c=this.transmuxer=new cs(this.hls,f,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const h=this.initPTS[n.cc],d=null==(e=n.initSegment)?void 0:e.data;if(void 0!==h){const t=!1,e=r?r.index:-1,s=-1!==e,A=new tn(n.level,n.sn,n.stats.chunkCount,i.byteLength,e,s);c.push(i,d,u,"",n,r,l.totalduration,t,A,h)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${l.startSN} ,${l.endSN}],track ${A}`);const{cache:t}=this.waitingData=this.waitingData||{frag:n,part:r,cache:new Qr,complete:!1};t.push(new Uint8Array(i)),this.state!==Br&&(this.state=Dr)}}_handleFragmentLoadComplete(t){this.waitingData?this.waitingData.complete=!0:super._handleFragmentLoadComplete(t)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(t,e){this.bufferFlushed=this.flushing=!1;const n=e.tracks.audio;n&&(this.mediaBuffer=n.buffer||null)}onFragLoading(t,e){!this.audioOnly&&e.frag.type===d&&W(e.frag)&&(this.mainFragLoading=e,this.state===br&&this.tick())}onFragBuffered(t,e){const{frag:n,part:r}=e;if(n.type===f)if(this.fragContextChanged(n))this.warn(`Fragment ${n.sn}${r?" p: "+r.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);else{if(W(n)){this.fragPrevious=n;const t=this.switchingTrack;t&&(this.bufferedTrack=t,this.switchingTrack=null,this.hls.trigger(o.AUDIO_TRACK_SWITCHED,v({},t)))}this.fragBufferedComplete(n,r),this.media&&this.tick()}else this.audioOnly||n.type!==d||n.elementaryStreams.video||n.elementaryStreams.audiovideo||(this.audioOnly=!0,this.mainFragLoading=null)}onError(t,e){var n;if(e.fatal)this.state=Ir;else switch(e.details){case a.FRAG_GAP:case a.FRAG_PARSING_ERROR:case a.FRAG_DECRYPT_ERROR:case a.FRAG_LOAD_ERROR:case a.FRAG_LOAD_TIMEOUT:case a.KEY_LOAD_ERROR:case a.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(f,e);break;case a.AUDIO_TRACK_LOAD_ERROR:case a.AUDIO_TRACK_LOAD_TIMEOUT:case a.LEVEL_PARSING_ERROR:e.levelRetry||this.state!==Fr||(null==(n=e.context)?void 0:n.type)!==c||(this.state=br);break;case a.BUFFER_ADD_CODEC_ERROR:case a.BUFFER_APPEND_ERROR:if("audio"!==e.parent)return;this.reduceLengthAndFlushBuffer(e)||this.resetLoadingState();break;case a.BUFFER_FULL_ERROR:if("audio"!==e.parent)return;this.reduceLengthAndFlushBuffer(e)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case a.INTERNAL_EXCEPTION:this.recoverWorkerError(e)}}onBufferFlushing(t,{type:e}){e!==V&&(this.flushing=!0)}onBufferFlushed(t,{type:e}){if(e!==V){this.flushing=!1,this.bufferFlushed=!0,this.state===xr&&(this.state=br);const t=this.mediaBuffer||this.media;t&&(this.afterBufferFlushed(t,e,f),this.tick())}}_handleTransmuxComplete(t){var e;const n="audio",{hls:r}=this,{remuxResult:i,chunkMeta:s}=t,A=this.getCurrentContext(s);if(!A)return void this.resetWhenMissingContext(s);const{frag:a,part:l,level:u}=A,{details:c}=u,{audio:h,text:d,id3:f,initSegment:p}=i;if(!this.fragContextChanged(a)&&c){if(this.state=Tr,this.switchingTrack&&h&&this.completeAudioSwitch(this.switchingTrack),null!=p&&p.tracks){const t=a.initSegment||a;if(this.unhandledEncryptionError(p,a))return;this._bufferInitSegment(u,p.tracks,t,s),r.trigger(o.FRAG_PARSING_INIT_SEGMENT,{frag:t,id:n,tracks:p.tracks})}if(h){const{startPTS:t,endPTS:e,startDTS:n,endDTS:r}=h;l&&(l.elementaryStreams[G]={startPTS:t,endPTS:e,startDTS:n,endDTS:r}),a.setElementaryStreamInfo(G,t,e,n,r),this.bufferFragmentData(h,a,l,s)}if(null!=f&&null!=(e=f.samples)&&e.length){const t=w({id:n,frag:a,details:c},f);r.trigger(o.FRAG_PARSING_METADATA,t)}if(d){const t=w({id:n,frag:a,details:c},d);r.trigger(o.FRAG_PARSING_USERDATA,t)}}else this.fragmentTracker.removeFragment(a)}_bufferInitSegment(t,e,n,r){if(this.state!==Tr)return;if(e.video&&delete e.video,e.audiovideo&&delete e.audiovideo,!e.audio)return;const i=e.audio;i.id=f;const s=t.audioCodec;this.log(`Init audio buffer, container:${i.container}, codecs[level/parsed]=[${s}/${i.codec}]`),s&&1===s.split(",").length&&(i.levelCodec=s),this.hls.trigger(o.BUFFER_CODECS,e);const A=i.initSegment;if(null!=A&&A.byteLength){const t={type:"audio",frag:n,part:null,chunkMeta:r,parent:n.type,data:A};this.hls.trigger(o.BUFFER_APPENDING,t)}this.tickImmediate()}loadFragment(t,e,n){const r=this.fragmentTracker.getState(t);var i;if(this.switchingTrack||r===Le||r===Qe)if(W(t))if(null!=(i=e.details)&&i.live&&!this.initPTS[t.cc]){this.log(`Waiting for video PTS in continuity counter ${t.cc} of live stream before loading audio fragment ${t.sn} of level ${this.trackId}`),this.state=Dr;const n=this.mainDetails;n&&n.fragmentStart!==e.details.fragmentStart&&_r(e.details,n)}else super.loadFragment(t,e,n);else this._loadInitSegment(t,e);else this.clearTrackerIfNeeded(t)}flushAudioIfNeeded(t){if(this.media&&this.bufferedTrack){const{name:e,lang:n,assocLang:r,characteristics:i,audioCodec:s,channels:A}=this.bufferedTrack;oe({name:e,lang:n,assocLang:r,characteristics:i,audioCodec:s,channels:A},t,le)||(ce(t.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=t)}}completeAudioSwitch(t){const{hls:e}=this;this.flushAudioIfNeeded(t),this.bufferedTrack=t,this.switchingTrack=null,e.trigger(o.AUDIO_TRACK_SWITCHED,v({},t))}},audioTrackController:class extends hs{constructor(t){super(t,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:t}=this;t.on(o.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.MANIFEST_PARSED,this.onManifestParsed,this),t.on(o.LEVEL_LOADING,this.onLevelLoading,this),t.on(o.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(o.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(o.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(o.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.MANIFEST_PARSED,this.onManifestParsed,this),t.off(o.LEVEL_LOADING,this.onLevelLoading,this),t.off(o.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(o.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(o.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(t,e){this.tracks=e.audioTracks||[]}onAudioTrackLoaded(t,e){const{id:n,groupId:r,details:i}=e,s=this.tracksInGroup[n];if(!s||s.groupId!==r)return void this.warn(`Audio track with id:${n} and group:${r} not found in active group ${null==s?void 0:s.groupId}`);const A=s.details;s.details=e.details,this.log(`Audio track ${n} "${s.name}" lang:${s.lang} group:${r} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,e,A)}onLevelLoading(t,e){this.switchLevel(e.level)}onLevelSwitching(t,e){this.switchLevel(e.level)}switchLevel(t){const e=this.hls.levels[t];if(!e)return;const n=e.audioGroups||null,r=this.groupIds;let i=this.currentTrack;if(!n||(null==r?void 0:r.length)!==(null==n?void 0:n.length)||null!=n&&n.some((t=>-1===(null==r?void 0:r.indexOf(t))))){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const t=this.tracks.filter((t=>!n||-1!==n.indexOf(t.groupId)));if(t.length)this.selectDefaultTrack&&!t.some((t=>t.default))&&(this.selectDefaultTrack=!1),t.forEach(((t,e)=>{t.id=e}));else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=t;const e=this.hls.config.audioPreference;if(!i&&e){const n=ae(e,t,le);if(n>-1)i=t[n];else{const t=ae(e,this.tracks);i=this.tracks[t]}}let r=this.findTrackId(i);-1===r&&i&&(r=this.findTrackId(null));const l={audioTracks:t};this.log(`Updating audio tracks, ${t.length} track(s) found in group(s): ${null==n?void 0:n.join(",")}`),this.hls.trigger(o.AUDIO_TRACKS_UPDATED,l);const u=this.trackId;if(-1!==r&&-1===u)this.setAudioTrack(r);else if(t.length&&-1===u){var s;const e=new Error(`No audio track selected for current audio group-ID(s): ${null==(s=this.groupIds)?void 0:s.join(",")} track count: ${t.length}`);this.warn(e.message),this.hls.trigger(o.ERROR,{type:A.MEDIA_ERROR,details:a.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:e})}}}onError(t,e){!e.fatal&&e.context&&(e.context.type!==c||e.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(e.context.groupId)||this.checkRetry(e))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(t){this.selectDefaultTrack=!1,this.setAudioTrack(t)}setAudioOption(t){const e=this.hls;if(e.config.audioPreference=t,t){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const r=this.currentTrack;if(r&&oe(t,r,le))return r;const i=ae(t,this.tracksInGroup,le);if(i>-1){const t=this.tracksInGroup[i];return this.setAudioTrack(i),t}if(r){let r=e.loadLevel;-1===r&&(r=e.firstAutoLevel);const i=function(t,e,n,r,i){const s=e[r],A=e.reduce(((t,e,n)=>{const r=e.uri;return(t[r]||(t[r]=[])).push(n),t}),{})[s.uri];A.length>1&&(r=Math.max.apply(Math,A));const a=s.videoRange,o=s.frameRate,l=s.codecSet.substring(0,4),u=ue(e,r,(e=>{if(e.videoRange!==a||e.frameRate!==o||e.codecSet.substring(0,4)!==l)return!1;const r=e.audioGroups,s=n.filter((t=>!r||-1!==r.indexOf(t.groupId)));return ae(t,s,i)>-1}));return u>-1?u:ue(e,r,(e=>{const r=e.audioGroups,s=n.filter((t=>!r||-1!==r.indexOf(t.groupId)));return ae(t,s,i)>-1}))}(t,e.levels,n,r,le);if(-1===i)return null;e.nextLoadLevel=i}if(t.channels||t.audioCodec){const e=ae(t,n);if(e>-1)return n[e]}}}return null}setAudioTrack(t){const e=this.tracksInGroup;if(t<0||t>=e.length)return void this.warn(`Invalid audio track id: ${t}`);this.selectDefaultTrack=!1;const n=this.currentTrack,r=e[t],i=r.details&&!r.details.live;if(t===this.trackId&&r===n&&i)return;if(this.log(`Switching to audio-track ${t} "${r.name}" lang:${r.lang} group:${r.groupId} channels:${r.channels}`),this.trackId=t,this.currentTrack=r,this.hls.trigger(o.AUDIO_TRACK_SWITCHING,v({},r)),i)return;const s=this.switchParams(r.url,null==n?void 0:n.details,r.details);this.loadPlaylist(s)}findTrackId(t){const e=this.tracksInGroup;for(let n=0;n<e.length;n++){const r=e[n];if((!this.selectDefaultTrack||r.default)&&(!t||oe(t,r,le)))return n}if(t){const{name:n,lang:r,assocLang:i,characteristics:s,audioCodec:A,channels:a}=t;for(let t=0;t<e.length;t++){if(oe({name:n,lang:r,assocLang:i,characteristics:s,audioCodec:A,channels:a},e[t],le))return t}for(let n=0;n<e.length;n++){const r=e[n];if(fs(t.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return n}for(let n=0;n<e.length;n++){const r=e[n];if(fs(t.attrs,r.attrs,["LANGUAGE"]))return n}}return-1}loadPlaylist(t){super.loadPlaylist();const e=this.currentTrack;this.shouldLoadPlaylist(e)&&ce(e.url,this.hls)&&this.scheduleLoading(e,t)}loadingPlaylist(t,e){super.loadingPlaylist(t,e);const n=t.id,r=t.groupId,i=this.getUrlWithDirectives(t.url,e),s=t.details,A=null==s?void 0:s.age;this.log(`Loading audio-track ${n} "${t.name}" lang:${t.lang} group:${r}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""}${A&&s.live?" age "+A.toFixed(1)+(s.type?" "+s.type||0:""):""} ${i}`),this.hls.trigger(o.AUDIO_TRACK_LOADING,{url:i,id:n,groupId:r,deliveryDirectives:e||null,track:t})}},emeController:_A,cmcdController:class{constructor(t){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=t=>{try{this.apply(t,{ot:bs.MANIFEST,su:!this.initialized})}catch(t){this.hls.logger.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=t=>{try{const{frag:e,part:n}=t,r=this.hls.levels[e.level],i=this.getObjectType(e),s={d:1e3*(n||e).duration,ot:i};i!==bs.VIDEO&&i!==bs.AUDIO&&i!=bs.MUXED||(s.br=r.bitrate/1e3,s.tb=this.getTopBandwidth(i)/1e3,s.bl=this.getBufferLength(i));const A=n?this.getNextPart(n):this.getNextFrag(e);null!=A&&A.url&&A.url!==e.url&&(s.nor=A.url),this.apply(t,s)}catch(t){this.hls.logger.warn("Could not generate segment CMCD data.",t)}},this.hls=t;const e=this.config=t.config,{cmcd:n}=e;null!=n&&(e.pLoader=this.createPlaylistLoader(),e.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||t.sessionId,this.cid=n.contentId,this.useHeaders=!0===n.useHeaders,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const t=this.hls;t.on(o.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(o.MEDIA_DETACHED,this.onMediaDetached,this),t.on(o.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const t=this.hls;t.off(o.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(o.MEDIA_DETACHED,this.onMediaDetached,this),t.off(o.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(t,e){this.media=e.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(t,e){var n,r;this.audioBuffer=null==(n=e.tracks.audio)?void 0:n.buffer,this.videoBuffer=null==(r=e.tracks.video)?void 0:r.buffer}createData(){var t;return{v:1,sf:Es.HLS,sid:this.sid,cid:this.cid,pr:null==(t=this.media)?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(t,e={}){w(e,this.createData());const n=e.ot===bs.INIT||e.ot===bs.VIDEO||e.ot===bs.MUXED;this.starved&&n&&(e.bs=!0,e.su=!0,this.starved=!1),null==e.su&&(e.su=this.buffering);const{includeKeys:r}=this;r&&(e=Object.keys(e).reduce(((t,n)=>(r.includes(n)&&(t[n]=e[n]),t)),{}));const i={baseUrl:t.url};this.useHeaders?(t.headers||(t.headers={}),hA(t.headers,e,i)):t.url=pA(t.url,e,i)}getNextFrag(t){var e;const n=null==(e=this.hls.levels[t.level])?void 0:e.details;if(n){const e=t.sn-n.startSN;return n.fragments[e+1]}}getNextPart(t){var e;const{index:n,fragment:r}=t,i=null==(e=this.hls.levels[r.level])||null==(e=e.details)?void 0:e.partList;if(i){const{sn:t}=r;for(let e=i.length-1;e>=0;e--){const r=i[e];if(r.index===n&&r.fragment.sn===t)return i[e+1]}}}getObjectType(t){const{type:e}=t;return"subtitle"===e?bs.TIMED_TEXT:"initSegment"===t.sn?bs.INIT:"audio"===e?bs.AUDIO:"main"===e?this.hls.audioTracks.length?bs.VIDEO:bs.MUXED:void 0}getTopBandwidth(t){let e,n=0;const r=this.hls;if(t===bs.AUDIO)e=r.audioTracks;else{const t=r.maxAutoLevel,n=t>-1?t+1:r.levels.length;e=r.levels.slice(0,n)}return e.forEach((t=>{t.bitrate>n&&(n=t.bitrate)})),n>0?n:NaN}getBufferLength(t){const e=this.media,n=t===bs.AUDIO?this.audioBuffer:this.videoBuffer;if(!n||!e)return NaN;return 1e3*nn.bufferInfo(n,e.currentTime,this.config.maxBufferHole).len}createPlaylistLoader(){const{pLoader:t}=this.config,e=this.applyPlaylistData,n=t||this.config.loader;return class{constructor(t){this.loader=void 0,this.loader=new n(t)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(t,n,r){e(t),this.loader.load(t,n,r)}}}createFragmentLoader(){const{fLoader:t}=this.config,e=this.applyFragmentData,n=t||this.config.loader;return class{constructor(t){this.loader=void 0,this.loader=new n(t)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(t,n,r){e(t),this.loader.load(t,n,r)}}}},contentSteeringController:class extends B{constructor(t){super("content-steering",t.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=t,this.registerListeners()}registerListeners(){const t=this.hls;t.on(o.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(o.MANIFEST_PARSED,this.onManifestParsed,this),t.on(o.ERROR,this.onError,this)}unregisterListeners(){const t=this.hls;t&&(t.off(o.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(o.MANIFEST_PARSED,this.onManifestParsed,this),t.off(o.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce(((t,e)=>(-1===t.indexOf(e.pathwayId)&&t.push(e.pathwayId),t)),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(t){this.updatePathwayPriority(t)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const t=1e3*this.timeToLoad-(performance.now()-this.updated);if(t>0)return void this.scheduleRefresh(this.uri,t)}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){-1!==this.reloadTimer&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(t){const e=this.levels;e&&(this.levels=e.filter((e=>e!==t)))}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(t,e){const{contentSteering:n}=e;null!==n&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(t,e){this.audioTracks=e.audioTracks,this.subtitleTracks=e.subtitleTracks}onError(t,e){const{errorAction:n}=e;if((null==n?void 0:n.action)===ke&&n.flags===xe){const t=this.levels;let r=this._pathwayPriority,i=this.pathwayId;if(e.context){const{groupId:n,pathwayId:r,type:s}=e.context;n&&t?i=this.getPathwayForGroupId(n,s,i):r&&(i=r)}i in this.penalizedPathways||(this.penalizedPathways[i]=performance.now()),!r&&t&&(r=this.pathways()),r&&r.length>1&&(this.updatePathwayPriority(r),n.resolved=this.pathwayId!==i),e.details!==a.BUFFER_APPEND_ERROR||e.fatal?n.resolved||this.warn(`Could not resolve ${e.details} ("${e.error.message}") with content-steering for Pathway: ${i} levels: ${t?t.length:t} priorities: ${re(r)} penalized: ${re(this.penalizedPathways)}`):n.resolved=!0}}filterParsedLevels(t){this.levels=t;let e=this.getLevelsForPathway(this.pathwayId);if(0===e.length){const n=t[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),e=this.getLevelsForPathway(n),this.pathwayId=n}return e.length!==t.length&&this.log(`Found ${e.length}/${t.length} levels in Pathway "${this.pathwayId}"`),e}getLevelsForPathway(t){return null===this.levels?[]:this.levels.filter((e=>t===e.pathwayId))}updatePathwayPriority(t){let e;this._pathwayPriority=t;const n=this.penalizedPathways,r=performance.now();Object.keys(n).forEach((t=>{r-n[t]>3e5&&delete n[t]}));for(let r=0;r<t.length;r++){const i=t[r];if(i in n)continue;if(i===this.pathwayId)return;const s=this.hls.nextLoadLevel,A=this.hls.levels[s];if(e=this.getLevelsForPathway(i),e.length>0){this.log(`Setting Pathway to "${i}"`),this.pathwayId=i,cr(e),this.hls.trigger(o.LEVELS_UPDATED,{levels:e});const t=this.hls.levels[s];A&&t&&this.levels&&(t.attrs["STABLE-VARIANT-ID"]!==A.attrs["STABLE-VARIANT-ID"]&&t.bitrate!==A.bitrate&&this.log(`Unstable Pathways change from bitrate ${A.bitrate} to ${t.bitrate}`),this.hls.nextLoadLevel=s);break}}}getPathwayForGroupId(t,e,n){const r=this.getLevelsForPathway(n).concat(this.levels||[]);for(let n=0;n<r.length;n++)if(e===c&&r[n].hasAudioGroup(t)||e===h&&r[n].hasSubtitleGroup(t))return r[n].pathwayId;return n}clonePathways(t){const e=this.levels;if(!e)return;const n={},r={};t.forEach((t=>{const{ID:i,"BASE-ID":s,"URI-REPLACEMENT":A}=t;if(e.some((t=>t.pathwayId===i)))return;const a=this.getLevelsForPathway(s).map((t=>{const e=new cn(t.attrs);e["PATHWAY-ID"]=i;const s=e.AUDIO&&`${e.AUDIO}_clone_${i}`,a=e.SUBTITLES&&`${e.SUBTITLES}_clone_${i}`;s&&(n[e.AUDIO]=s,e.AUDIO=s),a&&(r[e.SUBTITLES]=a,e.SUBTITLES=a);const o=mA(t.uri,e["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",A),l=new te({attrs:e,audioCodec:t.audioCodec,bitrate:t.bitrate,height:t.height,name:t.name,url:o,videoCodec:t.videoCodec,width:t.width});if(t.audioGroups)for(let e=1;e<t.audioGroups.length;e++)l.addGroupId("audio",`${t.audioGroups[e]}_clone_${i}`);if(t.subtitleGroups)for(let e=1;e<t.subtitleGroups.length;e++)l.addGroupId("text",`${t.subtitleGroups[e]}_clone_${i}`);return l}));e.push(...a),gA(this.audioTracks,n,A,i),gA(this.subtitleTracks,r,A,i)}))}loadSteeringManifest(t){const e=this.hls.config,n=e.loader;let r;this.loader&&this.loader.destroy(),this.loader=new n(e);try{r=new self.URL(t)}catch(e){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest URI: ${t}`)}if("data:"!==r.protocol){const t=0|(this.hls.bandwidthEstimate||e.abrEwmaDefaultEstimate);r.searchParams.set("_HLS_pathway",this.pathwayId),r.searchParams.set("_HLS_throughput",""+t)}const i={responseType:"json",url:r.href},s=e.steeringManifestLoadPolicy.default,A=s.errorRetry||s.timeoutRetry||{},a={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:A.maxNumRetry||0,retryDelay:A.retryDelayMs||0,maxRetryDelay:A.maxRetryDelayMs||0},l={onSuccess:(t,e,n,i)=>{this.log(`Loaded steering manifest: "${r}"`);const s=t.data;if(1!==(null==s?void 0:s.VERSION))return void this.log(`Steering VERSION ${s.VERSION} not supported!`);this.updated=performance.now(),this.timeToLoad=s.TTL;const{"RELOAD-URI":A,"PATHWAY-CLONES":a,"PATHWAY-PRIORITY":l}=s;if(A)try{this.uri=new self.URL(A,r).href}catch(t){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest RELOAD-URI: ${A}`)}this.scheduleRefresh(this.uri||n.url),a&&this.clonePathways(a);const u={steeringManifest:s,url:r.toString()};this.hls.trigger(o.STEERING_MANIFEST_LOADED,u),l&&this.updatePathwayPriority(l)},onError:(t,e,n,r)=>{if(this.log(`Error loading steering manifest: ${t.code} ${t.text} (${e.url})`),this.stopLoad(),410===t.code)return this.enabled=!1,void this.log(`Steering manifest ${e.url} no longer available`);let i=1e3*this.timeToLoad;if(429!==t.code)this.scheduleRefresh(this.uri||e.url,i);else{const t=this.loader;if("function"==typeof(null==t?void 0:t.getResponseHeader)){const e=t.getResponseHeader("Retry-After");e&&(i=1e3*parseFloat(e))}this.log(`Steering manifest ${e.url} rate limited`)}},onTimeout:(t,e,n)=>{this.log(`Timeout loading steering manifest (${e.url})`),this.scheduleRefresh(this.uri||e.url)}};this.log(`Requesting steering manifest: ${r}`),this.loader.load(i,a,l)}scheduleRefresh(t,e=1e3*this.timeToLoad){this.clearTimeout(),this.reloadTimer=self.setTimeout((()=>{var e;const n=null==(e=this.hls)?void 0:e.media;!n||n.ended?this.scheduleRefresh(t,1e3*this.timeToLoad):this.loadSteeringManifest(t)}),e)}},interstitialsController:class extends B{constructor(t,e){super("interstitials",t.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 t=this.currentTime;if(void 0===t||this.playbackDisabled||!this.schedule)return;const e=t-this.timelinePos;if(Math.abs(e)<1/7056e5)return;const n=e<=-.01;this.timelinePos=t,this.bufferedPos=t;const r=this.playingItem;if(!r)return void this.checkBuffer();if(n){this.schedule.resetErrorsInRange(t,t-e)&&this.updateSchedule(!0)}if(this.checkBuffer(),n&&t<r.start||t>=r.end){var i;const e=this.findItemIndex(r);let s=this.schedule.findItemIndexAtTime(t);if(-1===s&&(s=e+(n?-1:1),this.log(`seeked ${n?"back ":""}to position not covered by schedule ${t} (resolving from ${e} to ${s})`)),!this.isInterstitial(r)&&null!=(i=this.media)&&i.paused&&(this.shouldPlay=!1),!n&&s>e){const t=this.schedule.findJumpRestrictedIndex(e+1,s);if(t>e)return void this.setSchedulePosition(t)}return void this.setSchedulePosition(s)}const s=this.playingAsset;if(!s){if(this.playingLastItem&&this.isInterstitial(r)){const e=r.event.assetList[0];e&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(t,e))}return}const A=s.timelineStart,a=s.duration||0;var o;(n&&t<A||t>=A+a)&&(null!=(o=r.event)&&o.appendInPlace&&(this.clearInterstitial(r.event,r),this.flushFrontBuffer(t)),this.setScheduleToAssetAtTime(t,s))},this.onTimeupdate=()=>{const t=this.currentTime;if(void 0===t||this.playbackDisabled)return;if(!(t>this.timelinePos))return;this.timelinePos=t,t>this.bufferedPos&&this.checkBuffer();const e=this.playingItem;if(!e||this.playingLastItem)return;if(t>=e.end){this.timelinePos=e.end;const t=this.findItemIndex(e);this.setSchedulePosition(t+1)}const n=this.playingAsset;if(!n)return;t>=n.timelineStart+(n.duration||0)&&this.setScheduleToAssetAtTime(t,n)},this.onScheduleUpdate=(t,e)=>{const n=this.schedule;if(!n)return;const r=this.playingItem,i=n.events||[],s=n.items||[],A=n.durations,a=t.map((t=>t.identifier)),l=!(!i.length&&!a.length);(l||e)&&this.log(`INTERSTITIALS_UPDATED (${i.length}): ${i}\nSchedule: ${s.map((t=>MA(t)))} pos: ${this.timelinePos}`),a.length&&this.log(`Removed events ${a}`);let u=null,c=null;r&&(u=this.updateItem(r,this.timelinePos),this.itemsMatch(r,u)?this.playingItem=u:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const h=this.bufferingItem;if(h&&(c=this.updateItem(h,this.bufferedPos),this.itemsMatch(h,c)?this.bufferingItem=c:h.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(h.event,null))),t.forEach((t=>{t.assetList.forEach((t=>{this.clearAssetPlayer(t.identifier,null)}))})),this.playerQueue.forEach((t=>{if(t.interstitial.appendInPlace){const e=t.assetItem.timelineStart,n=t.timelineOffset-e;if(n)try{t.timelineOffset=e}catch(r){Math.abs(n)>SA&&this.warn(`${r} ("${t.assetId}" ${t.timelineOffset}->${e})`)}}})),l||e){if(this.hls.trigger(o.INTERSTITIALS_UPDATED,{events:i.slice(0),schedule:s.slice(0),durations:A,removedIds:a}),this.isInterstitial(r)&&a.includes(r.event.identifier))return this.warn(`Interstitial "${r.event.identifier}" removed while playing`),void this.primaryFallback(r.event);r&&this.trimInPlace(u,r),h&&c!==u&&this.trimInPlace(c,h),this.checkBuffer()}},this.hls=t,this.HlsPlayerClass=e,this.assetListLoader=new NA(t),this.schedule=new PA(this.onScheduleUpdate,t.logger),this.registerListeners()}registerListeners(){const t=this.hls;t&&(t.on(o.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(o.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(o.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(o.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(o.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(o.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),t.on(o.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(o.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),t.on(o.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),t.on(o.ASSET_LIST_LOADED,this.onAssetListLoaded,this),t.on(o.BUFFER_APPENDED,this.onBufferAppended,this),t.on(o.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(o.BUFFERED_TO_END,this.onBufferedToEnd,this),t.on(o.MEDIA_ENDED,this.onMediaEnded,this),t.on(o.ERROR,this.onError,this),t.on(o.DESTROYING,this.onDestroying,this))}unregisterListeners(){const t=this.hls;t&&(t.off(o.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(o.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(o.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(o.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(o.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(o.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),t.off(o.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(o.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),t.off(o.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),t.off(o.ASSET_LIST_LOADED,this.onAssetListLoaded,this),t.off(o.BUFFER_CODECS,this.onBufferCodecs,this),t.off(o.BUFFER_APPENDED,this.onBufferAppended,this),t.off(o.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(o.BUFFERED_TO_END,this.onBufferedToEnd,this),t.off(o.MEDIA_ENDED,this.onMediaEnded,this),t.off(o.ERROR,this.onError,this),t.off(o.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var t;null==(t=this.getBufferingPlayer())||t.resumeBuffering()}pauseBuffering(){var t;null==(t=this.getBufferingPlayer())||t.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 t=this.primaryMedia||this.media;t&&this.removeMediaListeners(t)}removeMediaListeners(t){yr(t,"play",this.onPlay),yr(t,"pause",this.onPause),yr(t,"seeking",this.onSeeking),yr(t,"timeupdate",this.onTimeupdate)}onMediaAttaching(t,e){const n=this.media=e.media;wr(n,"seeking",this.onSeeking),wr(n,"timeupdate",this.onTimeupdate),wr(n,"play",this.onPlay),wr(n,"pause",this.onPause)}onMediaAttached(t,e){const n=this.effectivePlayingItem,r=this.detachedData;if(this.detachedData=null,null===n)this.checkStart();else if(!r){this.clearScheduleState();const t=this.findItemIndex(n);this.setSchedulePosition(t)}}clearScheduleState(){this.log("clear schedule state"),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(t,e){const n=!!e.transferMedia,r=this.media;if(this.media=null,!n&&(r&&this.removeMediaListeners(r),this.detachedData)){const t=this.getBufferingPlayer();t&&(this.log(`Removing schedule state for detachedData and ${t}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,t.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const t=this,e=()=>t.bufferingItem||t.waitingItem,n=e=>e?t.getAssetPlayer(e.identifier):e,r=(e,r,s,A,a)=>{if(e){let o=e[r].start;const l=e.event;if(l){if("playout"===r||l.timelineOccupancy!==xA.Point){const t=n(s);(null==t?void 0:t.interstitial)===l&&(o+=t.assetItem.startOffset+t[a])}}else{o+=("bufferedPos"===A?i():t[A])-e.start}return o}return 0},i=()=>{const e=t.bufferedPos;return e===Number.MAX_VALUE?s("primary"):Math.max(e,0)},s=e=>{var n,r;return null!=(n=t.primaryDetails)&&n.live?t.primaryDetails.edge:(null==(r=t.schedule)?void 0:r.durations[e])||0},A=(e,i)=>{var s,A;const a=t.effectivePlayingItem;if(null!=a&&null!=(s=a.event)&&s.restrictions.skip||!t.schedule)return;t.log(`seek to ${e} "${i}"`);const o=t.effectivePlayingItem,l=t.schedule.findItemIndexAtTime(e,i),u=null==(A=t.schedule.items)?void 0:A[l],c=t.getBufferingPlayer(),h=null==c?void 0:c.interstitial,d=null==h?void 0:h.appendInPlace,f=o&&t.itemsMatch(o,u);if(o&&(d||f)){const s=n(t.playingAsset),A=(null==s?void 0:s.media)||t.primaryMedia;if(A){const n="primary"===i?A.currentTime:r(o,i,t.playingAsset,"timelinePos","currentTime"),a=e-n,l=(d?n:A.currentTime)+a;if(l>=0&&(!s||d||l<=s.duration))return void(A.currentTime=l)}}if(u){let n=e;if("primary"!==i){const t=e-u[i].start;n=u.start+t}const r=!t.isInterstitial(u);if(t.isInterstitial(o)&&!o.event.appendInPlace||!r&&!u.event.appendInPlace){if(o){const s=t.findItemIndex(o);if(l>s){const e=t.schedule.findJumpRestrictedIndex(s+1,l);if(e>s)return void t.setSchedulePosition(e)}let A=0;if(r)t.timelinePos=n,t.checkBuffer();else{const t=u.event.assetList,n=e-(u[i]||u).start;for(let e=t.length;e--;){const r=t[e];if(r.duration&&n>=r.startOffset&&n<r.startOffset+r.duration){A=e;break}}}t.setSchedulePosition(l,A)}}else{const e=t.media||(d?null==c?void 0:c.media:null);e&&(e.currentTime=n)}}},a=()=>{const n=t.effectivePlayingItem;if(t.isInterstitial(n))return n;const r=e();return t.isInterstitial(r)?r:null},o={get bufferedEnd(){const n=e(),i=t.bufferingItem;var s;return i&&i===n&&(r(i,"playout",t.bufferingAsset,"bufferedPos","bufferedEnd")-i.playout.start||(null==(s=t.bufferingAsset)?void 0:s.startOffset))||0},get currentTime(){const e=a(),n=t.effectivePlayingItem;return n&&n===e?r(n,"playout",t.effectivePlayingAsset,"timelinePos","currentTime")-n.playout.start:0},set currentTime(e){const n=a(),r=t.effectivePlayingItem;r&&r===n&&A(e+r.playout.start,"playout")},get duration(){const t=a();return t?t.playout.end-t.playout.start:0},get assetPlayers(){var e;const n=null==(e=a())?void 0:e.event.assetList;return n?n.map((e=>t.getAssetPlayer(e.identifier))):[]},get playingIndex(){var e;const n=null==(e=a())?void 0:e.event;return n&&t.effectivePlayingAsset?n.findAssetIndex(t.effectivePlayingAsset):-1},get scheduleItem(){return a()}};return this.manager={get events(){var e;return(null==(e=t.schedule)||null==(e=e.events)?void 0:e.slice(0))||[]},get schedule(){var e;return(null==(e=t.schedule)||null==(e=e.items)?void 0:e.slice(0))||[]},get interstitialPlayer(){return a()?o:null},get playerQueue(){return t.playerQueue.slice(0)},get bufferingAsset(){return t.bufferingAsset},get bufferingItem(){return e()},get bufferingIndex(){const n=e();return t.findItemIndex(n)},get playingAsset(){return t.effectivePlayingAsset},get playingItem(){return t.effectivePlayingItem},get playingIndex(){const e=t.effectivePlayingItem;return t.findItemIndex(e)},primary:{get bufferedEnd(){return i()},get currentTime(){const e=t.timelinePos;return e>0?e:0},set currentTime(t){A(t,"primary")},get duration(){return s("primary")},get seekableStart(){var e;return(null==(e=t.primaryDetails)?void 0:e.fragmentStart)||0}},integrated:{get bufferedEnd(){return r(e(),"integrated",t.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return r(t.effectivePlayingItem,"integrated",t.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(t){A(t,"integrated")},get duration(){return s("integrated")},get seekableStart(){var e;return((e,n)=>{var r;if(0!==e&&"primary"!==n&&null!=(r=t.schedule)&&r.length){var i;const r=t.schedule.findItemIndexAtTime(e),s=null==(i=t.schedule.items)?void 0:i[r];if(s)return e+(s[n].start-s.start)}return e})((null==(e=t.primaryDetails)?void 0:e.fragmentStart)||0,"integrated")}},skip:()=>{const e=t.effectivePlayingItem,n=null==e?void 0:e.event;if(n&&!n.restrictions.skip){const r=t.findItemIndex(e);if(n.appendInPlace){const t=e.playout.start+e.event.duration;A(t+.001,"playout")}else t.advanceAfterAssetEnded(n,r,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var t;const e=this.playingItem,n=null==(t=this.schedule)?void 0:t.items;return!!(this.playbackStarted&&e&&n)&&this.findItemIndex(e)===n.length-1}get playbackStarted(){return null!==this.effectivePlayingItem}get currentTime(){var t,e;if(null===this.mediaSelection)return;const n=this.waitingItem||this.playingItem;if(this.isInterstitial(n)&&!n.event.appendInPlace)return;let i=this.media;!i&&null!=(t=this.bufferingItem)&&null!=(t=t.event)&&t.appendInPlace&&(i=this.primaryMedia);const s=null==(e=i)?void 0:e.currentTime;return void 0!==s&&r(s)?s:void 0}get primaryMedia(){var t;return this.media||(null==(t=this.detachedData)?void 0:t.media)||null}isInterstitial(t){return!(null==t||!t.event)}retreiveMediaSource(t,e){const n=this.getAssetPlayer(t);n&&this.transferMediaFromPlayer(n,e)}transferMediaFromPlayer(t,e){const n=t.interstitial.appendInPlace,r=t.media;if(n&&r===this.primaryMedia){if(this.bufferingAsset=null,(!e||this.isInterstitial(e)&&!e.event.appendInPlace)&&e&&r)return void(this.detachedData={media:r});const n=t.transferMedia();this.log(`transfer MediaSource from ${t} ${re(n)}`),this.detachedData=n}else e&&r&&(this.shouldPlay||(this.shouldPlay=!r.paused))}transferMediaTo(t,e){var n,r;if(t.media===e)return;let i=null;const s=this.hls,A=t!==s,a=A&&t.interstitial.appendInPlace,o=null==(n=this.detachedData)?void 0:n.mediaSource;let l;if(s.media)a&&(i=s.transferMedia(),this.detachedData=i),l="Primary";else if(o){const t=this.getBufferingPlayer();t?(i=t.transferMedia(),l=`${t}`):l="detached MediaSource"}else l="detached media";if(!i)if(o)i=this.detachedData,this.log(`using detachedData: MediaSource ${re(i)}`);else if(!this.detachedData||s.media===e){const t=this.playerQueue;t.length>1&&t.forEach((t=>{if(A&&t.interstitial.appendInPlace!==a){const e=t.interstitial;this.clearInterstitial(t.interstitial,null),e.appendInPlace=!1,e.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${e}`)}})),this.hls.detachMedia(),this.detachedData={media:e}}const u=i&&"mediaSource"in i&&"closed"!==(null==(r=i.mediaSource)?void 0:r.readyState),c=u&&i?i:e;this.log(`${u?"transfering MediaSource":"attaching media"} to ${A?t:"Primary"} from ${l} (media.currentTime: ${e.currentTime})`);const h=this.schedule;if(c===i&&h){const e=A&&t.assetId===h.assetIdAtEnd;c.overrides={duration:h.duration,endOfStream:!A||e,cueRemoval:!A}}t.attachMedia(c)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const t=this.schedule,e=null==t?void 0:t.events;if(!e||this.playbackDisabled||!this.media)return;-1===this.bufferedPos&&(this.bufferedPos=0);const n=this.timelinePos,r=this.effectivePlayingItem;if(-1===n){const n=this.hls.startPosition;if(this.log(KA("checkStart",n)),this.timelinePos=n,e.length&&e[0].cue.pre){const n=t.findEventIndex(e[0].identifier);this.setSchedulePosition(n)}else if(n>=0||!this.primaryLive){const e=this.timelinePos=n>0?n:0,r=t.findItemIndexAtTime(e);this.setSchedulePosition(r)}}else if(r&&!this.playingItem){const e=t.findItemIndex(r);this.setSchedulePosition(e)}}advanceAssetBuffering(t,e){const n=t.event,r=n.findAssetIndex(e),i=RA(n,r);if(n.isAssetPastPlayoutLimit(i)){if(this.schedule){var s;const e=null==(s=this.schedule.items)?void 0:s[this.findItemIndex(t)+1];e&&this.bufferedToItem(e)}}else this.bufferedToEvent(t,i)}advanceAfterAssetEnded(t,e,n){const r=RA(t,n);if(t.isAssetPastPlayoutLimit(r)){if(this.schedule){const n=this.schedule.items;if(n){const r=e+1;if(r>=n.length)return void this.setSchedulePosition(-1);const i=t.resumeTime;this.timelinePos<i&&(this.log(KA("advanceAfterAssetEnded",i)),this.timelinePos=i,t.appendInPlace&&this.advanceInPlace(i),this.checkBuffer(this.bufferedPos<i)),this.setSchedulePosition(r)}}}else{if(t.appendInPlace){const e=t.assetList[r];e&&this.advanceInPlace(e.timelineStart)}this.setSchedulePosition(e,r)}}setScheduleToAssetAtTime(t,e){const n=this.schedule;if(!n)return;const r=e.parentIdentifier,i=n.getEvent(r);if(i){const e=n.findEventIndex(r),s=n.findAssetIndex(i,t);this.advanceAfterAssetEnded(i,e,s-1)}}setSchedulePosition(t,e){var n;const r=null==(n=this.schedule)?void 0:n.items;if(!r||this.playbackDisabled)return;const i=t>=0?r[t]:null;this.log(`setSchedulePosition ${t}, ${e} (${i?MA(i):i}) pos: ${this.timelinePos}`);const s=this.waitingItem||this.playingItem,A=this.playingLastItem;if(this.isInterstitial(s)){const n=s.event,u=this.playingAsset,c=null==u?void 0:u.identifier,h=c?this.getAssetPlayer(c):null;if(h&&c&&(!this.eventItemsMatch(s,i)||void 0!==e&&c!==n.assetList[e].identifier)){var a;const e=n.findAssetIndex(u);if(this.log(`INTERSTITIAL_ASSET_ENDED ${e+1}/${n.assetList.length} ${QA(u)}`),this.endedAsset=u,this.playingAsset=null,this.hls.trigger(o.INTERSTITIAL_ASSET_ENDED,{asset:u,assetListIndex:e,event:n,schedule:r.slice(0),scheduleIndex:t,player:h}),s!==this.playingItem)return void(this.itemsMatch(s,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(n,this.findItemIndex(this.playingItem),e));this.retreiveMediaSource(c,i),!h.media||null!=(a=this.detachedData)&&a.mediaSource||h.detachMedia()}if(!this.eventItemsMatch(s,i)&&(this.endedItem=s,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${n} ${MA(s)}`),n.hasPlayed=!0,this.hls.trigger(o.INTERSTITIAL_ENDED,{event:n,schedule:r.slice(0),scheduleIndex:t}),n.cue.once)){var l;this.updateSchedule();const t=null==(l=this.schedule)?void 0:l.items;if(i&&t){const n=this.findItemIndex(i);this.advanceSchedule(n,t,e,s,A)}return}}this.advanceSchedule(t,r,e,s,A)}advanceSchedule(t,e,n,r,i){const s=this.schedule;if(!s)return;const A=e[t]||null,a=this.primaryMedia,l=this.playerQueue;if(l.length&&l.forEach((e=>{const n=e.interstitial,r=s.findEventIndex(n.identifier);(r<t||r>t+1)&&this.clearInterstitial(n,A)})),this.isInterstitial(A)){this.timelinePos=Math.min(Math.max(this.timelinePos,A.start),A.end);const i=A.event;if(void 0===n){const e=RA(i,(n=s.findAssetIndex(i,this.timelinePos))-1);if(i.isAssetPastPlayoutLimit(e)||i.appendInPlace&&this.timelinePos===A.end)return void this.advanceAfterAssetEnded(i,t,n);n=e}const l=this.waitingItem;this.assetsBuffered(A,a)||this.setBufferingItem(A);let u=this.preloadAssets(i,n);if(this.eventItemsMatch(A,l||r)||(this.waitingItem=A,this.log(`INTERSTITIAL_STARTED ${MA(A)} ${i.appendInPlace?"append in place":""}`),this.hls.trigger(o.INTERSTITIAL_STARTED,{event:i,schedule:e.slice(0),scheduleIndex:t})),!i.assetListLoaded)return void this.log(`Waiting for ASSET-LIST to complete loading ${i}`);if(i.assetListLoader&&(i.assetListLoader.destroy(),i.assetListLoader=void 0),!a)return void this.log(`Waiting for attachMedia to start Interstitial ${i}`);this.waitingItem=this.endedItem=null,this.playingItem=A;const c=i.assetList[n];if(!c)return void this.advanceAfterAssetEnded(i,t,n||0);if(u||(u=this.getAssetPlayer(c.identifier)),null===u||u.destroyed){const t=i.assetList.length;this.warn(`asset ${n+1}/${t} player destroyed ${i}`),u=this.createAssetPlayer(i,c,n),u.loadSource()}if(!this.eventItemsMatch(A,this.bufferingItem)&&i.appendInPlace&&this.isAssetBuffered(c))return;this.startAssetPlayer(u,n,e,t,a),this.shouldPlay&&HA(u.media)}else A?(this.resumePrimary(A,t,r),this.shouldPlay&&HA(this.hls.media)):i&&this.isInterstitial(r)&&(this.endedItem=null,this.playingItem=r,r.event.appendInPlace||this.attachPrimary(s.durations.primary,null))}get playbackDisabled(){return!1===this.hls.config.enableInterstitialPlayback}get primaryDetails(){var t;return null==(t=this.mediaSelection)?void 0:t.main.details}get primaryLive(){var t;return!(null==(t=this.primaryDetails)||!t.live)}resumePrimary(t,e,n){var r,i;if(this.playingItem=t,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(t),this.log(`resuming ${MA(t)}`),null==(r=this.detachedData)||!r.mediaSource){let n=this.timelinePos;(n<t.start||n>=t.end)&&(n=this.getPrimaryResumption(t,e),this.log(KA("resumePrimary",n)),this.timelinePos=n),this.attachPrimary(n,t)}if(!n)return;const s=null==(i=this.schedule)?void 0:i.items;s&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${MA(t)}`),this.hls.trigger(o.INTERSTITIALS_PRIMARY_RESUMED,{schedule:s.slice(0),scheduleIndex:e}),this.checkBuffer())}getPrimaryResumption(t,e){const n=t.start;if(this.primaryLive){const t=this.primaryDetails;if(0===e)return this.hls.startPosition;if(t&&(n<t.fragmentStart||n>t.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(t){const e=this.getAssetPlayer(t.identifier);if(null!=e&&e.hls)return e.hls.bufferedToEnd;return nn.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=t.timelineStart+(t.duration||0)}attachPrimary(t,e,n){e?this.setBufferingItem(e):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const r=this.primaryMedia;if(!r)return;const i=this.hls;i.media?this.checkBuffer():(this.transferMediaTo(i,r),n&&this.startLoadingPrimaryAt(t,n)),n||(this.log(KA("attachPrimary",t)),this.timelinePos=t,this.startLoadingPrimaryAt(t,n))}startLoadingPrimaryAt(t,e){var n;const r=this.hls;!r.loadingEnabled||!r.media||Math.abs(((null==(n=r.mainForwardBufferInfo)?void 0:n.start)||r.media.currentTime)-t)>.5?r.startLoad(t,e):r.bufferingEnabled||r.resumeBuffering()}onManifestLoading(){var t;this.stopLoad(),null==(t=this.schedule)||t.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(o.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(o.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(t,e){if(-1===e.level||!this.schedule)return;const n=this.hls.levels[e.level];if(!n.details)return;const r=v(v({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=r,this.schedule.parseInterstitialDateRanges(r,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(t,e){const n=this.hls.audioTracks[e.id],r=this.mediaSelection;if(!r)return void(this.altSelection=v(v({},this.altSelection),{},{audio:n}));const i=v(v({},r),{},{audio:n});this.mediaSelection=i}onSubtitleTrackUpdated(t,e){const n=this.hls.subtitleTracks[e.id],r=this.mediaSelection;if(!r)return void(this.altSelection=v(v({},this.altSelection),{},{subtitles:n}));const i=v(v({},r),{},{subtitles:n});this.mediaSelection=i}onAudioTrackSwitching(t,e){const n=Ae(e);this.playerQueue.forEach((({hls:t})=>t&&(t.setAudioOption(e)||t.setAudioOption(n))))}onSubtitleTrackSwitch(t,e){const n=Ae(e);this.playerQueue.forEach((({hls:t})=>t&&(t.setSubtitleOption(e)||-1!==e.id&&t.setSubtitleOption(n))))}onBufferCodecs(t,e){const n=e.tracks;n&&(this.requiredTracks=n)}onBufferAppended(t,e){this.checkBuffer()}onBufferFlushed(t,e){const n=this.playingItem;if(n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)){const t=this.timelinePos;this.bufferedPos=t,this.checkBuffer()}}onBufferedToEnd(t){if(!this.schedule)return;const e=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&e){for(let t=0;t<e.length;t++){const r=e[t];if(r.cue.post){var n;const t=this.schedule.findEventIndex(r.identifier),e=null==(n=this.schedule.items)?void 0:n[t];this.isInterstitial(e)&&this.eventItemsMatch(e,this.bufferingItem)&&this.bufferedToItem(e,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(t){const e=this.playingItem;if(!this.playingLastItem&&e){const t=this.findItemIndex(e);this.setSchedulePosition(t+1)}else this.shouldPlay=!1}updateItem(t,e){var n;const r=null==(n=this.schedule)?void 0:n.items;if(t&&r){return r[this.findItemIndex(t,e)]||null}return null}trimInPlace(t,e){if(this.isInterstitial(t)&&t.event.appendInPlace&&e.end-t.end>.25){t.event.assetList.forEach(((e,n)=>{t.event.isAssetPastPlayoutLimit(n)&&this.clearAssetPlayer(e.identifier,null)}));const n=t.end+.25,r=nn.bufferInfo(this.primaryMedia,n,0);if(r.end>n||(r.nextStart||0)>n){this.log(`trim buffered interstitial ${MA(t)} (was ${MA(e)})`);const r=!0;this.attachPrimary(n,null,r),this.flushFrontBuffer(n)}}}itemsMatch(t,e){return!!e&&(t===e||t.event&&e.event&&this.eventItemsMatch(t,e)||!t.event&&!e.event&&this.findItemIndex(t)===this.findItemIndex(e))}eventItemsMatch(t,e){var n;return!!e&&(t===e||t.event.identifier===(null==(n=e.event)?void 0:n.identifier))}findItemIndex(t,e){return t&&this.schedule?this.schedule.findItemIndex(t,e):-1}updateSchedule(t=!1){var e;const n=this.mediaSelection;n&&(null==(e=this.schedule)||e.updateSchedule(n,[],t))}checkBuffer(t){var e;const n=null==(e=this.schedule)?void 0:e.items;if(!n)return;const r=nn.bufferInfo(this.primaryMedia,this.timelinePos,0);t&&(this.bufferedPos=this.timelinePos),t||(t=r.len<1),this.updateBufferedPos(r.end,n,t)}updateBufferedPos(t,e,n){const r=this.schedule,i=this.bufferingItem;if(this.bufferedPos>t||!r)return;if(1===e.length&&this.itemsMatch(e[0],i))return void(this.bufferedPos=t);const s=this.playingItem,A=this.findItemIndex(s);let a=r.findItemIndexAtTime(t);if(this.bufferedPos<t){var o;const n=this.findItemIndex(i),r=Math.min(n+1,e.length-1),s=e[r];if((-1===a&&i&&t>=i.end||null!=(o=s.event)&&o.appendInPlace&&t+.01>=s.start)&&(a=r),this.isInterstitial(i)){const t=i.event;if(r-A>1&&!1===t.appendInPlace)return;if(0===t.assetList.length&&t.assetListLoader)return}if(this.bufferedPos=t,a>n&&a>A)this.bufferedToItem(s);else{const e=this.primaryDetails;this.primaryLive&&e&&t>e.edge-e.targetduration&&s.start<e.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(s)&&this.preloadAssets(s.event,0)}}else n&&s&&!this.itemsMatch(s,i)&&(a===A?this.bufferedToItem(s):a===A+1&&this.bufferedToItem(e[a]))}assetsBuffered(t,e){return 0!==t.event.assetList.length&&!t.event.assetList.some((t=>{const n=this.getAssetPlayer(t.identifier);return!(null!=n&&n.bufferedInPlaceToEnd(e))}))}setBufferingItem(t){const e=this.bufferingItem,n=this.schedule;if(!this.itemsMatch(t,e)&&n){const{items:r,events:i}=n;if(!r||!i)return e;const s=this.isInterstitial(t),A=this.getBufferingPlayer();this.bufferingItem=t,this.bufferedPos=Math.max(t.start,Math.min(t.end,this.timelinePos));const a=A?A.remaining:e?e.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${MA(t)}`+(e?` (${a.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(s){const e=n.findAssetIndex(t.event,this.bufferedPos);t.event.assetList.forEach(((t,n)=>{const r=this.getAssetPlayer(t.identifier);r&&(n===e&&r.loadSource(),r.resumeBuffering())}))}else this.hls.resumeBuffering(),this.playerQueue.forEach((t=>t.pauseBuffering()));this.hls.trigger(o.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:i.slice(0),schedule:r.slice(0),bufferingIndex:this.findItemIndex(t),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==t&&(this.bufferingItem=t);return e}bufferedToItem(t,e=0){const n=this.setBufferingItem(t);if(!this.playbackDisabled)if(this.isInterstitial(t))this.bufferedToEvent(t,e);else if(null!==n){this.bufferingAsset=null;const e=this.detachedData;if(e)if(e.mediaSource){const e=!0;this.attachPrimary(t.start,t,e)}else this.preloadPrimary(t);else this.preloadPrimary(t)}}preloadPrimary(t){const e=this.findItemIndex(t),n=this.getPrimaryResumption(t,e);this.startLoadingPrimaryAt(n)}bufferedToEvent(t,e){const n=t.event,r=0===n.assetList.length&&!n.assetListLoader,i=n.cue.once;if(r||!i){const t=this.preloadAssets(n,e);if(null!=t&&t.interstitial.appendInPlace){const e=this.primaryMedia;e&&this.bufferAssetPlayer(t,e)}}}preloadAssets(t,e){const n=t.assetUrl,r=t.assetList.length,i=0===r&&!t.assetListLoader,s=t.cue.once;if(i){const i=t.timelineStart;if(t.appendInPlace){var A;const e=this.playingItem;this.isInterstitial(e)||(null==e||null==(A=e.nextEvent)?void 0:A.identifier)!==t.identifier||this.flushFrontBuffer(i+.25)}let s,a=0;if(!this.playingItem&&this.primaryLive&&(a=this.hls.startPosition,-1===a&&(a=this.hls.liveSyncPosition||0)),a&&!t.cue.pre&&!t.cue.post){const t=a-i;t>0&&(s=Math.round(1e3*t)/1e3)}if(this.log(`Load interstitial asset ${e+1}/${n?1:r} ${t}${s?` live-start: ${a} start-offset: ${s}`:""}`),n)return this.createAsset(t,0,0,i,t.duration,n);const o=this.assetListLoader.loadAssetList(t,s);o&&(t.assetListLoader=o)}else if(!s&&r){for(let n=e;n<r;n++){const e=t.assetList[n],r=this.getAssetPlayerQueueIndex(e.identifier);-1!==r&&!this.playerQueue[r].destroyed||e.error||this.createAssetPlayer(t,e,n)}const n=t.assetList[e];if(n){const t=this.getAssetPlayer(n.identifier);return t&&t.loadSource(),t}}return null}flushFrontBuffer(t){const e=this.requiredTracks;if(!e)return;this.log(`Removing front buffer starting at ${t}`);Object.keys(e).forEach((e=>{this.hls.trigger(o.BUFFER_FLUSHING,{startOffset:t,endOffset:1/0,type:e})}))}getAssetPlayerQueueIndex(t){const e=this.playerQueue;for(let n=0;n<e.length;n++)if(t===e[n].assetId)return n;return-1}getAssetPlayer(t){const e=this.getAssetPlayerQueueIndex(t);return this.playerQueue[e]||null}getBufferingPlayer(){const{playerQueue:t,primaryMedia:e}=this;if(e)for(let n=0;n<t.length;n++)if(t[n].media===e)return t[n];return null}createAsset(t,e,n,r,i,s){const A={parentIdentifier:t.identifier,identifier:IA(t,s,e),duration:i,startOffset:n,timelineStart:r,uri:s};return this.createAssetPlayer(t,A,e)}createAssetPlayer(t,e,n){const r=this.hls,i=r.userConfig;let s=i.videoPreference;const l=r.loadLevelObj||r.levels[r.currentLevel];(s||l)&&(s=w({},s),l.videoCodec&&(s.videoCodec=l.videoCodec),l.videoRange&&(s.allowedVideoRanges=[l.videoRange]));const u=r.audioTracks[r.audioTrack],c=r.subtitleTracks[r.subtitleTrack];let h=0;if(this.primaryLive||t.appendInPlace){const t=this.timelinePos-e.timelineStart;if(t>1){const n=e.duration;n&&t<n&&(h=t)}}const d=e.identifier,f=v(v({},i),{},{maxMaxBufferLength:Math.min(180,r.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:r.sessionId,assetPlayerId:d,abrEwmaDefaultEstimate:r.bandwidthEstimate,interstitialsController:void 0,startPosition:h,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:s,audioPreference:u||i.audioPreference,subtitlePreference:c||i.subtitlePreference});t.appendInPlace&&(t.appendInPlaceStarted=!0,e.timelineStart&&(f.timelineOffset=e.timelineStart));const p=f.cmcd;null!=p&&p.sessionId&&p.contentId&&(f.cmcd=w({},p,{contentId:TA(e.uri)})),this.getAssetPlayer(d)&&this.warn(`Duplicate date range identifier ${t} and asset ${d}`);const g=new OA(this.HlsPlayerClass,f,t,e);this.playerQueue.push(g),t.assetList[n]=e;let m=!0;const _=r=>{if(r.live){var i;const e=new Error(`Interstitials MUST be VOD assets ${t}`),r={fatal:!0,type:A.OTHER_ERROR,details:a.INTERSTITIAL_ASSET_ITEM_ERROR,error:e},s=(null==(i=this.schedule)?void 0:i.findEventIndex(t.identifier))||-1;return void this.handleAssetItemError(r,t,s,n,e.message)}const s=r.edge-r.fragmentStart,o=e.duration;(m||null===o||s>o)&&(m=!1,this.log(`Interstitial asset "${d}" duration change ${o} > ${s}`),e.duration=s,this.updateSchedule())};g.on(o.LEVEL_UPDATED,((t,{details:e})=>_(e))),g.on(o.LEVEL_PTS_UPDATED,((t,{details:e})=>_(e))),g.on(o.EVENT_CUE_ENTER,(()=>this.onInterstitialCueEnter()));const y=(t,e)=>{const n=this.getAssetPlayer(d);if(n&&e.tracks){n.off(o.BUFFER_CODECS,y),n.tracks=e.tracks;const t=this.primaryMedia;this.bufferingAsset===n.assetItem&&t&&!n.media&&this.bufferAssetPlayer(n,t)}};g.on(o.BUFFER_CODECS,y);g.on(o.BUFFERED_TO_END,(()=>{var n;const r=this.getAssetPlayer(d);if(this.log(`buffered to end of asset ${r}`),!r||!this.schedule)return;const i=this.schedule.findEventIndex(t.identifier),s=null==(n=this.schedule.items)?void 0:n[i];this.isInterstitial(s)&&this.advanceAssetBuffering(s,e)}));const B=e=>()=>{if(!this.getAssetPlayer(d)||!this.schedule)return;this.shouldPlay=!0;const n=this.schedule.findEventIndex(t.identifier);this.advanceAfterAssetEnded(t,n,e)};return g.once(o.MEDIA_ENDED,B(n)),g.once(o.PLAYOUT_LIMIT_REACHED,B(1/0)),g.on(o.ERROR,((e,r)=>{if(!this.schedule)return;const i=this.getAssetPlayer(d);if(r.details===a.BUFFER_STALLED_ERROR)return null!=i&&i.appendInPlace?void this.handleInPlaceStall(t):(this.onTimeupdate(),void this.checkBuffer(!0));this.handleAssetItemError(r,t,this.schedule.findEventIndex(t.identifier),n,`Asset player error ${r.error} ${t}`)})),g.on(o.DESTROYING,(()=>{if(!this.getAssetPlayer(d)||!this.schedule)return;const e=new Error(`Asset player destroyed unexpectedly ${d}`),r={fatal:!0,type:A.OTHER_ERROR,details:a.INTERSTITIAL_ASSET_ITEM_ERROR,error:e};this.handleAssetItemError(r,t,this.schedule.findEventIndex(t.identifier),n,e.message)})),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${QA(e)}`),this.hls.trigger(o.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:e,assetListIndex:n,event:t,player:g}),g}clearInterstitial(t,e){t.assetList.forEach((t=>{this.clearAssetPlayer(t.identifier,e)})),t.reset()}resetAssetPlayer(t){const e=this.getAssetPlayerQueueIndex(t);if(-1!==e){this.log(`reset asset player "${t}" after error`);const n=this.playerQueue[e];this.transferMediaFromPlayer(n,null),n.resetDetails()}}clearAssetPlayer(t,e){const n=this.getAssetPlayerQueueIndex(t);if(-1!==n){const t=this.playerQueue[n];this.log(`clear ${t} toSegment: ${e?MA(e):e}`),this.transferMediaFromPlayer(t,e),this.playerQueue.splice(n,1),t.destroy()}}emptyPlayerQueue(){let t;for(;t=this.playerQueue.pop();)t.destroy();this.playerQueue=[]}startAssetPlayer(t,e,n,r,i){const{interstitial:s,assetItem:A,assetId:a}=t,l=s.assetList.length,u=this.playingAsset;this.endedAsset=null,this.playingAsset=A,u&&u.identifier===a||(u&&(this.clearAssetPlayer(u.identifier,n[r]),delete u.error),this.log(`INTERSTITIAL_ASSET_STARTED ${e+1}/${l} ${QA(A)}`),this.hls.trigger(o.INTERSTITIAL_ASSET_STARTED,{asset:A,assetListIndex:e,event:s,schedule:n.slice(0),scheduleIndex:r,player:t})),this.bufferAssetPlayer(t,i)}bufferAssetPlayer(t,e){var n,r;if(!this.schedule)return;const{interstitial:i,assetItem:s}=t,o=this.schedule.findEventIndex(i.identifier),l=null==(n=this.schedule.items)?void 0:n[o];if(!l)return;t.loadSource(),this.setBufferingItem(l),this.bufferingAsset=s;const u=this.getBufferingPlayer();if(u===t)return;const c=i.appendInPlace;if(c&&!1===(null==u?void 0:u.interstitial.appendInPlace))return;const h=(null==u?void 0:u.tracks)||(null==(r=this.detachedData)?void 0:r.tracks)||this.requiredTracks;if(c&&s!==this.playingAsset){if(!t.tracks)return void this.log(`Waiting for track info before buffering ${t}`);if(h&&!x(h,t.tracks)){const e=new Error(`Asset ${QA(s)} SourceBuffer tracks ('${Object.keys(t.tracks)}') are not compatible with primary content tracks ('${Object.keys(h)}')`),n={fatal:!0,type:A.OTHER_ERROR,details:a.INTERSTITIAL_ASSET_ITEM_ERROR,error:e},r=i.findAssetIndex(s);return void this.handleAssetItemError(n,i,o,r,e.message)}}this.transferMediaTo(t,e)}handleInPlaceStall(t){const e=this.schedule,n=this.primaryMedia;if(!e||!n)return;const r=n.currentTime,i=e.findAssetIndex(t,r),s=t.assetList[i];if(s){const A=this.getAssetPlayer(s.identifier);if(A){const a=A.currentTime||r-s.timelineStart,o=A.duration-a;if(this.warn(`Stalled at ${a} of ${a+o} in ${A} ${t} (media.currentTime: ${r})`),a&&(o/n.playbackRate<.5||A.bufferedInPlaceToEnd(n))&&A.hls){const n=e.findEventIndex(t.identifier);this.advanceAfterAssetEnded(t,n,i)}}}}advanceInPlace(t){const e=this.primaryMedia;e&&e.currentTime<t&&(e.currentTime=t)}handleAssetItemError(t,e,n,r,i){if(t.details===a.BUFFER_STALLED_ERROR)return;const s=e.assetList[r]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${s?QA(s):s} ${t.error}`),!this.schedule)return;const A=(null==s?void 0:s.identifier)||"",l=this.getAssetPlayerQueueIndex(A),u=this.playerQueue[l]||null,c=this.schedule.items,h=w({},t,{fatal:!1,errorAction:Ue(!0),asset:s,assetListIndex:r,event:e,schedule:c,scheduleIndex:n,player:u});if(this.hls.trigger(o.INTERSTITIAL_ASSET_ERROR,h),!t.fatal)return;const d=this.playingAsset,f=this.bufferingAsset,p=new Error(i);if(s&&(this.clearAssetPlayer(A,null),s.error=p),e.assetList.some((t=>!t.error)))for(let t=r;t<e.assetList.length;t++)this.resetAssetPlayer(e.assetList[t].identifier);else e.error=p;this.updateSchedule(!0),e.error?this.primaryFallback(e):d&&d.identifier===A?this.advanceAfterAssetEnded(e,n,r):f&&f.identifier===A&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,f)}primaryFallback(t){const e=t.timelineStart,n=this.effectivePlayingItem;if(n){this.log(`Fallback to primary from event "${t.identifier}" start: ${e} pos: ${this.timelinePos} playing: ${MA(n)} error: ${t.error}`);let r=this.timelinePos;-1===r&&(r=this.hls.startPosition);const i=this.updateItem(n,r);if(this.itemsMatch(n,i)&&this.clearInterstitial(t,null),t.appendInPlace&&(this.attachPrimary(e,null),this.flushFrontBuffer(e)),!this.schedule)return;const s=this.schedule.findItemIndexAtTime(r);this.setSchedulePosition(s)}else this.checkStart()}onAssetListLoaded(t,e){var n,r;const i=e.event,s=i.identifier,A=e.assetListResponse.ASSETS;if(null==(n=this.schedule)||!n.hasEvent(s))return;const a=i.timelineStart,o=i.duration;let l=0;A.forEach(((t,e)=>{const n=parseFloat(t.DURATION);this.createAsset(i,e,l,a+l,n,t.URI),l+=n})),i.duration=l,this.log(`Loaded asset-list with duration: ${l} (was: ${o}) ${i}`);const u=this.waitingItem,c=(null==u?void 0:u.event.identifier)===s;this.updateSchedule();const h=null==(r=this.bufferingItem)?void 0:r.event;if(c){var d;const t=this.schedule.findEventIndex(s),e=null==(d=this.schedule.items)?void 0:d[t];if(e){if(!this.playingItem&&this.timelinePos>e.end){if(this.schedule.findItemIndexAtTime(this.timelinePos)!==t)return i.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${i}`),this.updateSchedule(!0),void this.primaryFallback(i)}this.setBufferingItem(e)}this.setSchedulePosition(t)}else if((null==h?void 0:h.identifier)===s){const t=i.assetList[0];if(t){const e=this.getAssetPlayer(t.identifier);if(h.appendInPlace){const t=this.primaryMedia;e&&t&&this.bufferAssetPlayer(e,t)}else e&&e.loadSource()}}}onError(t,e){if(this.schedule)switch(e.details){case a.ASSET_LIST_PARSING_ERROR:case a.ASSET_LIST_LOAD_ERROR:case a.ASSET_LIST_LOAD_TIMEOUT:{const t=e.interstitial;t&&(this.updateSchedule(!0),this.primaryFallback(t));break}case a.BUFFER_STALLED_ERROR:{const t=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(t)&&t.event.appendInPlace)return void this.handleInPlaceStall(t.event);this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}});function ja(t){return t&&"object"==typeof t?Array.isArray(t)?t.map(ja):Object.keys(t).reduce(((e,n)=>(e[n]=ja(t[n]),e)),{}):t}function Za(t,e){const n=t.loader;if(n!==Na&&n!==Ga)e.log("[config]: Custom loader detected, cannot enable progressive streaming"),t.progressive=!1;else{(function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1})()&&(t.loader=Na,t.progressive=!0,t.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}}class Wa extends Je{constructor(t,e){super("gap-controller",t.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 t;null!=(t=this.media)&&t.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{var t;this.hls&&(this.ended=(null==(t=this.media)?void 0:t.currentTime)||1,this.hls.trigger(o.MEDIA_ENDED,{stalled:!1}))},this.hls=t,this.fragmentTracker=e,this.registerListeners()}registerListeners(){const{hls:t}=this;t&&(t.on(o.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(o.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(o.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:t}=this;t&&(t.off(o.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(o.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(o.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(t,e){this.setInterval(100),this.mediaSource=e.mediaSource;const n=this.media=e.media;wr(n,"playing",this.onMediaPlaying),wr(n,"waiting",this.onMediaWaiting),wr(n,"ended",this.onMediaEnded)}onMediaDetaching(t,e){this.clearInterval();const{media:n}=this;n&&(yr(n,"playing",this.onMediaPlaying),yr(n,"waiting",this.onMediaWaiting),yr(n,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(t,e){this.buffered=e.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var t;if(null==(t=this.media)||!t.readyState||!this.hasBuffered)return;const e=this.media.currentTime;this.poll(e,this.lastCurrentTime),this.lastCurrentTime=e}poll(t,e){var n,r;const i=null==(n=this.hls)?void 0:n.config;if(!i)return;const s=this.media;if(!s)return;const{seeking:A}=s,a=this.seeking&&!A,l=!this.seeking&&A,u=s.paused&&!A||s.ended||0===s.playbackRate;if(this.seeking=A,t!==e)return e&&(this.ended=0),this.moved=!0,A||(this.nudgeRetry=0,i.nudgeOnVideoHole&&!u&&t>e&&this.nudgeOnVideoHole(t,e)),void(0===this.waiting&&this.stallResolved(t));if(l||a)return void(a&&this.stallResolved(t));if(u)return this.nudgeRetry=0,this.stallResolved(t),void(!this.ended&&s.ended&&this.hls&&(this.ended=t||1,this.hls.trigger(o.MEDIA_ENDED,{stalled:!1})));if(!nn.getBuffered(s).length)return void(this.nudgeRetry=0);const c=nn.bufferInfo(s,t,0),h=c.nextStart||0,d=this.fragmentTracker;if(A&&d&&this.hls){const e=za(this.hls.inFlightFragments,t),n=c.len>2,r=!h||e||h-t>2&&!d.getPartialFragment(t);if(n||r)return;this.moved=!1}const f=null==(r=this.hls)?void 0:r.latestLevelDetails;if(!this.moved&&null!==this.stalled&&d){if(!(c.len>0)&&!h)return;const e=Math.max(h,c.start||0)-t,n=!(null==f||!f.live)?2*f.targetduration:2,r=Xa(t,d);if(e>0&&(e<=n||r))return void(s.paused||this._trySkipBufferHole(r))}const p=i.detectStallWithCurrentTimeMs,g=self.performance.now(),m=this.waiting;let _=this.stalled;if(null===_){if(!(m>0&&g-m<p))return void(this.stalled=g);_=this.stalled=m}const w=g-_;if(!A&&(w>=p||m)&&this.hls){var y;if("ended"===(null==(y=this.mediaSource)?void 0:y.readyState)&&(null==f||!f.live)&&Math.abs(t-((null==f?void 0:f.edge)||0))<1){if(this.ended)return;return this.ended=t||1,void this.hls.trigger(o.MEDIA_ENDED,{stalled:!0})}if(this._reportStall(c),!this.media||!this.hls)return}const v=nn.bufferInfo(s,t,i.maxBufferHole);this._tryFixBufferStall(v,w,t)}stallResolved(t){const e=this.stalled;if(e&&this.hls&&(this.stalled=null,this.stallReported)){const n=self.performance.now()-e;this.log(`playback not stuck anymore @${t}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(o.STALL_RESOLVED,{})}}nudgeOnVideoHole(t,e){var n;const r=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&null!=(n=this.buffered.audio)&&n.length&&r&&r.length>1&&t>r.end(0)){const n=nn.bufferedInfo(nn.timeRangesToArray(this.buffered.audio),t,0);if(n.len>1&&e>=n.start){const n=nn.timeRangesToArray(r),i=nn.bufferedInfo(n,e,0).bufferedIndex;if(i>-1&&i<n.length-1){const e=nn.bufferedInfo(n,t,0).bufferedIndex,r=n[i].end,s=n[i+1].start;if((-1===e||e>i)&&s-r<1&&t-r<2){const n=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${t} hole: ${r} -> ${s} buffered index: ${e}`);this.warn(n.message),this.media.currentTime+=1e-6;let i=Xa(t,this.fragmentTracker);i&&"fragment"in i?i=i.fragment:i||(i=void 0);const l=nn.bufferInfo(this.media,t,0);this.hls.trigger(o.ERROR,{type:A.MEDIA_ERROR,details:a.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:n,reason:n.message,frag:i,buffer:l.len,bufferInfo:l})}}}}}_tryFixBufferStall(t,e,n){var r,i;const{fragmentTracker:s,media:A}=this,a=null==(r=this.hls)?void 0:r.config;if(!A||!s||!a)return;const o=null==(i=this.hls)?void 0:i.latestLevelDetails,l=Xa(n,s);if(l||null!=o&&o.live&&n<o.fragmentStart){if(this._trySkipBufferHole(l)||!this.media)return}const u=t.buffered,c=this.adjacentTraversal(t,n);(u&&u.length>1&&t.len>a.maxBufferHole||t.nextStart&&(t.nextStart-n<a.maxBufferHole||c))&&(e>1e3*a.highBufferWatchdogPeriod||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(t))}adjacentTraversal(t,e){const n=this.fragmentTracker,r=t.nextStart;if(n&&r){const t=n.getFragAtPos(e,d),i=n.getFragAtPos(r,d);if(t&&i)return i.sn-t.sn<2}return!1}_reportStall(t){const{hls:e,media:n,stallReported:r,stalled:i}=this;if(!r&&null!==i&&n&&e){this.stallReported=!0;const r=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${re(t)})`);this.warn(r.message),e.trigger(o.ERROR,{type:A.MEDIA_ERROR,details:a.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:t.len,bufferInfo:t,stalled:{start:i}})}}_trySkipBufferHole(t){var e;const{fragmentTracker:n,media:r}=this,i=null==(e=this.hls)?void 0:e.config;if(!r||!n||!i)return 0;const s=r.currentTime,l=nn.bufferInfo(r,s,0),u=s<l.start?l.start:l.nextStart;if(u&&this.hls){const e=l.len<=i.maxBufferHole,h=l.len>0&&l.len<1&&r.readyState<3,f=u-s;if(f>0&&(e||h)){if(f>i.maxBufferHole){let e=!1;if(0===s){const t=n.getAppendedFrag(0,d);t&&u<t.end&&(e=!0)}if(!e&&t){var c;if(null==(c=this.hls.loadLevelObj)||!c.details)return 0;if(za(this.hls.inFlightFragments,u))return 0;let e=!1,r=t.end;for(;r<u;){const t=Xa(r,n);if(!t){e=!0;break}r+=t.duration}if(e)return 0}}const e=Math.max(u+.05,s+.1);if(this.warn(`skipping hole, adjusting currentTime from ${s} to ${e}`),this.moved=!0,r.currentTime=e,null==t||!t.gap){const n=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${e}`),r={type:A.MEDIA_ERROR,details:a.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:n,reason:n.message,buffer:l.len,bufferInfo:l};t&&("fragment"in t?r.part=t:r.frag=t),this.hls.trigger(o.ERROR,r)}return e}}return 0}_tryNudgeBuffer(t){const{hls:e,media:n,nudgeRetry:r}=this,i=null==e?void 0:e.config;if(!n||!i)return 0;const s=n.currentTime;if(this.nudgeRetry++,r<i.nudgeMaxRetry){const l=s+(r+1)*i.nudgeOffset,u=new Error(`Nudging 'currentTime' from ${s} to ${l}`);this.warn(u.message),n.currentTime=l,e.trigger(o.ERROR,{type:A.MEDIA_ERROR,details:a.BUFFER_NUDGE_ON_STALL,error:u,fatal:!1,buffer:t.len,bufferInfo:t})}else{const n=new Error(`Playhead still not moving while enough data buffered @${s} after ${i.nudgeMaxRetry} nudges`);this.error(n.message),e.trigger(o.ERROR,{type:A.MEDIA_ERROR,details:a.BUFFER_STALLED_ERROR,error:n,fatal:!0,buffer:t.len,bufferInfo:t})}}}function za(t,e){const n=Ya(t.main);if(n&&n.start<=e)return n;const r=Ya(t.audio);return r&&r.start<=e?r:null}function Ya(t){if(!t)return null;switch(t.state){case br:case Br:case xr:case Ir:return null}return t.frag}function Xa(t,e){return e.getAppendedFrag(t,d)||e.getPartialFragment(t)}function qa(){if("undefined"!=typeof self)return self.VTTCue||self.TextTrackCue}function Ja(t,e,n,r,i){let s=new t(e,n,"");try{s.value=r,i&&(s.type=i)}catch(A){s=new t(e,n,re(i?v({type:i},r):r))}return s}const to=(()=>{const t=qa();try{t&&new t(0,Number.POSITIVE_INFINITY,"")}catch(t){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class eo{constructor(t){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(o.EVENT_CUE_ENTER,{})},this.hls=t,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:t}=this;t&&(t.on(o.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(o.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(o.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(o.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(o.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(o.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(o.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:t}=this;t&&(t.off(o.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(o.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(o.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(o.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(o.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(o.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(o.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(t,e){var n;this.media=e.media,!1===(null==(n=e.overrides)?void 0:n.cueRemoval)&&(this.removeCues=!1)}onMediaAttached(){var t;const e=null==(t=this.hls)?void 0:t.latestLevelDetails;e&&this.updateDateRangeCues(e)}onMediaDetaching(t,e){this.media=null;!!e.transferMedia||(this.id3Track&&(this.removeCues&&CA(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(t){const e=this.getID3Track(t.textTracks);return e.mode="hidden",e}getID3Track(t){if(this.media){for(let e=0;e<t.length;e++){const n=t[e];if("metadata"===n.kind&&"id3"===n.label)return bA(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(t,e){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:n,enableID3MetadataCues:r}=this.hls.config;if(!n&&!r)return;const{samples:i}=e;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=qa();if(s)for(let t=0;t<i.length;t++){const e=i[t].type;if(e===ui.emsg&&!n||!r)continue;const A=Ai(i[t].data),a=i[t].pts;let o=a+i[t].duration;o>to&&(o=to);o-a<=0&&(o=a+.25);for(let t=0;t<A.length;t++){const n=A[t];if(!ai(n)){this.updateId3CueEnds(a,e);const t=Ja(s,a,o,n,e);t&&this.id3Track.addCue(t)}}}}updateId3CueEnds(t,e){var n;const r=null==(n=this.id3Track)?void 0:n.cues;if(r)for(let n=r.length;n--;){const i=r[n];i.type===e&&i.startTime<t&&i.endTime===to&&(i.endTime=t)}}onBufferFlushing(t,{startOffset:e,endOffset:n,type:r}){const{id3Track:i,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:A,enableID3MetadataCues:a}}=s;if(i&&(A||a)){let t;t="audio"===r?t=>t.type===ui.audioId3&&a:"video"===r?t=>t.type===ui.emsg&&A:t=>t.type===ui.audioId3&&a||t.type===ui.emsg&&A,kA(i,e,n,t)}}onLevelUpdated(t,{details:e}){this.updateDateRangeCues(e,!0)}onLevelPtsUpdated(t,e){Math.abs(e.drift)>.01&&this.updateDateRangeCues(e.details)}updateDateRangeCues(t,e){if(!this.hls||!this.media)return;const{assetPlayerId:n,timelineOffset:i,enableDateRangeMetadataCues:s,interstitialsController:A}=this.hls.config;if(!s)return;const a=qa();if(n&&i&&!A){const{fragmentStart:e,fragmentEnd:r}=t;let i=this.assetCue;i?(i.startTime=e,i.endTime=r):a&&(i=this.assetCue=Ja(a,e,r,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),i&&(i.id=n,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(i),i.addEventListener("enter",this.onEventCueEnter)))}if(!t.hasProgramDateTime)return;const{id3Track:o}=this,{dateRanges:l}=t,u=Object.keys(l);let c=this.dateRangeCuesAppended;var h;if(o&&e)if(null!=(h=o.cues)&&h.length){const t=Object.keys(c).filter((t=>!u.includes(t)));for(let e=t.length;e--;){var d;const n=t[e],r=null==(d=c[n])?void 0:d.cues;delete c[n],r&&Object.keys(r).forEach((t=>{const e=r[t];if(e){e.removeEventListener("enter",this.onEventCueEnter);try{o.removeCue(e)}catch(t){}}}))}}else c=this.dateRangeCuesAppended={};const f=t.fragments[t.fragments.length-1];if(0!==u.length&&r(null==f?void 0:f.programDateTime)){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let t=0;t<u.length;t++){const e=u[t],n=l[e],r=n.startTime,i=c[e],s=(null==i?void 0:i.cues)||{};let o=(null==i?void 0:i.durationKnown)||!1,h=to;const{duration:d,endDate:f}=n;if(f&&null!==d)h=r+d,o=!0;else if(n.endOnNext&&!o){const t=u.reduce(((t,e)=>{if(e!==n.id){const r=l[e];if(r.class===n.class&&r.startDate>n.startDate&&(!t||n.startDate<t.startDate))return r}return t}),null);t&&(h=t.startTime,o=!0)}const g=Object.keys(n.attr);for(let t=0;t<g.length;t++){const l=g[t];if("ID"===(p=l)||"CLASS"===p||"CUE"===p||"START-DATE"===p||"DURATION"===p||"END-DATE"===p||"END-ON-NEXT"===p)continue;const u=s[l];if(u)!o||null!=i&&i.durationKnown?Math.abs(u.startTime-r)>.01&&(u.startTime=r,u.endTime=h):u.endTime=h;else if(a){let t=n.attr[l];hn(l)&&(t=U(t));const i=Ja(a,r,h,{key:l,data:t},ui.dateRange);i&&(i.id=e,this.id3Track.addCue(i),s[l]=i,A&&("X-ASSET-LIST"!==l&&"X-ASSET-URL"!==l||i.addEventListener("enter",this.onEventCueEnter)))}}c[e]={cues:s,dateRange:n,durationKnown:o}}var p}}}class no{constructor(t){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,e=this.levelDetails;if(!t||!e)return;this.currentTime=t.currentTime;const n=this.computeLatency();if(null===n)return;this._latency=n;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:i}=this.config;if(!r||1===i||!e.live)return;const s=this.targetLatency;if(null===s)return;const A=n-s;if(A<Math.min(this.maxLatency,s+e.targetduration)&&A>.05&&this.forwardBufferLength>1){const e=Math.min(2,Math.max(1,i)),n=Math.round(2/(1+Math.exp(-.75*A-this.edgeStalled))*20)/20,r=Math.min(e,Math.max(1,n));this.changeMediaPlaybackRate(t,r)}else 1!==t.playbackRate&&0!==t.playbackRate&&this.changeMediaPlaybackRate(t,1)},this.hls=t,this.config=t.config,this.registerListeners()}get levelDetails(){var t;return(null==(t=this.hls)?void 0:t.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:t}=this;if(void 0!==t.liveMaxLatencyDuration)return t.liveMaxLatencyDuration;const e=this.levelDetails;return e?t.liveMaxLatencyDurationCount*e.targetduration:0}get targetLatency(){const t=this.levelDetails;if(null===t||null===this.hls)return null;const{holdBack:e,partHoldBack:n,targetduration:r}=t,{liveSyncDuration:i,liveSyncDurationCount:s,lowLatencyMode:A}=this.config,a=this.hls.userConfig;let o=A&&n||e;(this._targetLatencyUpdated||a.liveSyncDuration||a.liveSyncDurationCount||0===o)&&(o=void 0!==i?i:s*r);const l=r;return o+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,l)}set targetLatency(t){this.stallCount=0,this.config.liveSyncDuration=t,this._targetLatencyUpdated=!0}get liveSyncPosition(){const t=this.estimateLiveEdge(),e=this.targetLatency;if(null===t||null===e)return null;const n=this.levelDetails;if(null===n)return null;const r=n.edge,i=t-e-this.edgeStalled,s=r-n.totalduration,A=r-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,i),A)}get drift(){const t=this.levelDetails;return null===t?1:t.drift}get edgeStalled(){const t=this.levelDetails;if(null===t)return 0;const e=3*(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.max(t.age-e,0)}get forwardBufferLength(){const{media:t}=this,e=this.levelDetails;if(!t||!e)return 0;const n=t.buffered.length;return(n?t.buffered.end(n-1):e.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:t}=this;t&&(t.on(o.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(o.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(o.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(o.ERROR,this.onError,this))}unregisterListeners(){const{hls:t}=this;t&&(t.off(o.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(o.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(o.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(o.ERROR,this.onError,this))}onMediaAttached(t,e){this.media=e.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(t,{details:e}){e.advanced&&this.onTimeupdate(),!e.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(t,e){var n;e.details===a.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&null!=(n=this.levelDetails)&&n.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(t,e){var n,r;t.playbackRate!==e&&(null==(n=this.hls)||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${null==(r=this.targetLatency)?void 0:r.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${t.playbackRate} to ${e}`),t.playbackRate=e)}estimateLiveEdge(){const t=this.levelDetails;return null===t?null:t.edge+t.age}computeLatency(){const t=this.estimateLiveEdge();return null===t?null:t-this.currentTime}}class ro extends hs{constructor(t,e){super(t,"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=e,this._registerListeners()}_registerListeners(){const{hls:t}=this;t.on(o.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(o.LEVEL_LOADED,this.onLevelLoaded,this),t.on(o.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(o.FRAG_BUFFERED,this.onFragBuffered,this),t.on(o.ERROR,this.onError,this)}_unregisterListeners(){const{hls:t}=this;t.off(o.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(o.LEVEL_LOADED,this.onLevelLoaded,this),t.off(o.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(o.FRAG_BUFFERED,this.onFragBuffered,this),t.off(o.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(t,e){this.resetLevels()}onManifestLoaded(t,e){const n=this.hls.config.preferManagedMediaSource,r=[],i={},s={};let A=!1,a=!1,o=!1;e.levels.forEach((t=>{const e=t.attrs;let{audioCodec:l,videoCodec:u}=t;l&&(t.audioCodec=l=Lt(l,n)||void 0),u&&(u=t.videoCodec=function(t){const e=t.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(".");n.length>2&&"avc1"===n[0]&&(e[t]=`avc1.${parseInt(n[1]).toString(16)}${("000"+parseInt(n[2]).toString(16)).slice(-4)}`)}return e.join(",")}(u));const{width:c,height:h,unknownCodecs:d}=t,f=(null==d?void 0:d.length)||0;if(A||(A=!(!c||!h)),a||(a=!!u),o||(o=!!l),f||l&&!this.isAudioSupported(l)||u&&!this.isVideoSupported(u))return void this.log(`Some or all CODECS not supported "${e.CODECS}"`);const{CODECS:p,"FRAME-RATE":g,"HDCP-LEVEL":m,"PATHWAY-ID":_,RESOLUTION:w,"VIDEO-RANGE":y}=e,v=`${`${_||"."}-`}${t.bitrate}-${w}-${g}-${p}-${y}-${m}`;if(i[v])if(i[v].uri===t.url||t.attrs["PATHWAY-ID"])i[v].addGroupId("audio",e.AUDIO),i[v].addGroupId("text",e.SUBTITLES);else{const e=s[v]+=1;t.attrs["PATHWAY-ID"]=new Array(e+1).join(".");const n=this.createLevel(t);i[v]=n,r.push(n)}else{const e=this.createLevel(t);i[v]=e,s[v]=1,r.push(e)}})),this.filterAndSortMediaOptions(r,e,A,a,o)}createLevel(t){const e=new te(t),n=t.supplemental;if(null!=n&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){const t=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(t.message),e.supportedResult=Kt(t,[])}return e}isAudioSupported(t){return Ft(t,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(t){return Ft(t,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(t,e,n,r,i){var s;let l=[],u=[],c=t;const h=(null==(s=e.stats)?void 0:s.parsing)||{};if((n||r)&&i&&(c=c.filter((({videoCodec:t,videoRange:e,width:n,height:r})=>{return(!!t||!(!n||!r))&&(!!(i=e)&&Wt.indexOf(i)>-1);var i}))),0===c.length)return Promise.resolve().then((()=>{if(this.hls){let t="no level with compatible codecs found in manifest",n=t;e.levels.length&&(n=`one or more CODECS in variant not supported: ${re(e.levels.map((t=>t.attrs.CODECS)).filter(((t,e,n)=>n.indexOf(t)===e)))}`,this.warn(n),t+=` (${n})`);const r=new Error(t);this.hls.trigger(o.ERROR,{type:A.MEDIA_ERROR,details:a.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:e.url,error:r,reason:n})}})),void(h.end=performance.now());e.audioTracks&&(l=e.audioTracks.filter((t=>!t.audioCodec||this.isAudioSupported(t.audioCodec))),io(l)),e.subtitles&&(u=e.subtitles,io(u));const d=c.slice(0);c.sort(((t,e)=>{if(t.attrs["HDCP-LEVEL"]!==e.attrs["HDCP-LEVEL"])return(t.attrs["HDCP-LEVEL"]||"")>(e.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&t.height!==e.height)return t.height-e.height;if(t.frameRate!==e.frameRate)return t.frameRate-e.frameRate;if(t.videoRange!==e.videoRange)return Wt.indexOf(t.videoRange)-Wt.indexOf(e.videoRange);if(t.videoCodec!==e.videoCodec){const n=xt(t.videoCodec),r=xt(e.videoCodec);if(n!==r)return r-n}if(t.uri===e.uri&&t.codecSet!==e.codecSet){const n=It(t.codecSet),r=It(e.codecSet);if(n!==r)return r-n}return t.averageBitrate!==e.averageBitrate?t.averageBitrate-e.averageBitrate:0}));let f=d[0];if(this.steering&&(c=this.steering.filterParsedLevels(c),c.length!==d.length))for(let t=0;t<d.length;t++)if(d[t].pathwayId===c[0].pathwayId){f=d[t];break}this._levels=c;for(let t=0;t<c.length;t++)if(c[t]===f){var p;this._firstLevel=t;const e=f.bitrate,n=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${c.length} level(s) found, first bitrate: ${e}`),void 0===(null==(p=this.hls.userConfig)?void 0:p.abrEwmaDefaultEstimate)){const t=Math.min(e,this.hls.config.abrEwmaDefaultEstimateMax);t>n&&n===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=t)}break}const g=i&&!r,m=this.hls.config,_=!(!m.audioStreamController||!m.audioTrackController),w={levels:c,audioTracks:l,subtitleTracks:u,sessionData:e.sessionData,sessionKeys:e.sessionKeys,firstLevel:this._firstLevel,stats:e.stats,audio:i,video:r,altAudio:_&&!g&&l.some((t=>!!t.url))};h.end=performance.now(),this.hls.trigger(o.MANIFEST_PARSED,w)}get levels(){return 0===this._levels.length?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(t){const e=this._levels;if(0===e.length)return;if(t<0||t>=e.length){const n=new Error("invalid level idx"),r=t<0;if(this.hls.trigger(o.ERROR,{type:A.OTHER_ERROR,details:a.LEVEL_SWITCH_ERROR,level:t,fatal:r,error:n,reason:n.message}),r)return;t=Math.min(t,e.length-1)}const n=this.currentLevelIndex,r=this.currentLevel,i=r?r.attrs["PATHWAY-ID"]:void 0,s=e[t],l=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=t,this.currentLevel=s,n===t&&r&&i===l)return;this.log(`Switching to level ${t} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${l?" with Pathway "+l:""} from level ${n}${i?" with Pathway "+i:""}`);const u={level:t,attrs:s.attrs,details:s.details,bitrate:s.bitrate,averageBitrate:s.averageBitrate,maxBitrate:s.maxBitrate,realBitrate:s.realBitrate,width:s.width,height:s.height,codecSet:s.codecSet,audioCodec:s.audioCodec,videoCodec:s.videoCodec,audioGroups:s.audioGroups,subtitleGroups:s.subtitleGroups,loaded:s.loaded,loadError:s.loadError,fragmentError:s.fragmentError,name:s.name,id:s.id,uri:s.uri,url:s.url,urlId:0,audioGroupIds:s.audioGroupIds,textGroupIds:s.textGroupIds};this.hls.trigger(o.LEVEL_SWITCHING,u);const c=s.details;if(!c||c.live){const t=this.switchParams(s.uri,null==r?void 0:r.details,c);this.loadPlaylist(t)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}get firstLevel(){return this._firstLevel}set firstLevel(t){this._firstLevel=t}get startLevel(){if(void 0===this._startLevel){const t=this.hls.config.startLevel;return void 0!==t?t:this.hls.firstAutoLevel}return this._startLevel}set startLevel(t){this._startLevel=t}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(t){if(this.steering){const e=this.steering.pathways(),n=t.filter((t=>-1!==e.indexOf(t)));if(t.length<1)return void this.warn(`pathwayPriority ${t} should contain at least one pathway from list: ${e}`);this.steering.pathwayPriority=n}}onError(t,e){!e.fatal&&e.context&&e.context.type===u&&e.context.level===this.level&&this.checkRetry(e)}onFragBuffered(t,{frag:e}){if(void 0!==e&&e.type===d){const t=e.elementaryStreams;if(!Object.keys(t).some((e=>!!t[e])))return;const n=this._levels[e.level];null!=n&&n.loadError&&(this.log(`Resetting level error count of ${n.loadError} on frag buffered`),n.loadError=0)}}onLevelLoaded(t,e){var n;const{level:r,details:i}=e,s=e.levelInfo;var A;if(!s)return this.warn(`Invalid level index ${r}`),void(null!=(A=e.deliveryDirectives)&&A.skip&&(i.deltaUpdateFailed=!0));if(s===this.currentLevel||e.withoutMultiVariant){0===s.fragmentError&&(s.loadError=0);let t=s.details;t===e.details&&t.advanced&&(t=void 0),this.playlistLoaded(r,e,t)}else null!=(n=e.deliveryDirectives)&&n.skip&&(i.deltaUpdateFailed=!0)}loadPlaylist(t){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,t)}loadingPlaylist(t,e){super.loadingPlaylist(t,e);const n=this.getUrlWithDirectives(t.uri,e),r=this.currentLevelIndex,i=t.attrs["PATHWAY-ID"],s=t.details,A=null==s?void 0:s.age;this.log(`Loading level index ${r}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""}${i?" Pathway "+i:""}${A&&s.live?" age "+A.toFixed(1)+(s.type?" "+s.type||0:""):""} ${n}`),this.hls.trigger(o.LEVEL_LOADING,{url:n,level:r,levelInfo:t,pathwayId:t.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}get nextLoadLevel(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}removeLevel(t){var e;if(1===this._levels.length)return;const n=this._levels.filter(((e,n)=>n!==t||(this.steering&&this.steering.removeLevel(e),e===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,e.details&&e.details.fragments.forEach((t=>t.level=-1))),!1)));cr(n),this._levels=n,this.currentLevelIndex>-1&&null!=(e=this.currentLevel)&&e.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const r=n.length-1;this._firstLevel=Math.min(this._firstLevel,r),this._startLevel&&(this._startLevel=Math.min(this._startLevel,r)),this.hls.trigger(o.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(t,{levels:e}){this._levels=e}checkMaxAutoUpdated(){const{autoLevelCapping:t,maxAutoLevel:e,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==e&&(this._maxAutoLevel=e,this.hls.trigger(o.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:t,levels:this.levels,maxAutoLevel:e,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function io(t){const e={};t.forEach((t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++}))}function so(){return self.SourceBuffer||self.WebKitSourceBuffer}function Ao(){if(!S())return!1;const t=so();return!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove}class ao extends Lr{constructor(t,e,n){super(t,e,n,"stream-controller",d),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 t=this.media,e=t?t.currentTime:null;if(null===e||!r(e))return;if(this.log(`Media seeked to ${e.toFixed(3)}`),!this.getBufferedFrag(e))return;const n=this.getFwdBufferInfoAtPos(t,e,d,0);null!==n&&0!==n.len?this.tick():this.warn(`Main forward buffer length at ${e} on "seeked" event ${n?n.len:"empty"})`)},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(o.MANIFEST_PARSED,this.onManifestParsed,this),t.on(o.LEVEL_LOADING,this.onLevelLoading,this),t.on(o.LEVEL_LOADED,this.onLevelLoaded,this),t.on(o.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.on(o.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(o.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(o.BUFFER_CREATED,this.onBufferCreated,this),t.on(o.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(o.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(o.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:t}=this;t.off(o.MANIFEST_PARSED,this.onManifestParsed,this),t.off(o.LEVEL_LOADED,this.onLevelLoaded,this),t.off(o.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.off(o.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(o.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(o.BUFFER_CREATED,this.onBufferCreated,this),t.off(o.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(o.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(o.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(t,e){if(this.levels){const{lastCurrentTime:n,hls:r}=this;if(this.stopLoad(),this.setInterval(100),this.level=-1,!this.startFragRequested){let t=r.startLevel;-1===t&&(r.config.testBandwidth&&this.levels.length>1?(t=0,this.bitrateTest=!0):t=r.firstAutoLevel),r.nextLoadLevel=t,this.level=r.loadLevel,this._hasEnoughToStart=!!e}n>0&&-1===t&&!e&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),t=n),this.state=br,this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=e?-1:t,this.tick()}else this._forceStartLoad=!0,this.state=Br}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Ur:{const{levels:t,level:e}=this,n=null==t?void 0:t[e],r=null==n?void 0:n.details;if(r&&(!r.live||this.levelLastLoaded===n&&!this.waitForLive(n))){if(this.waitForCdnTuneIn(r))break;this.state=br;break}if(this.hls.nextLoadLevel!==this.level){this.state=br;break}break}case kr:this.checkRetryDate()}this.state===br&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var t;super.onTickEnd(),null!=(t=this.media)&&t.readyState&&!1===this.media.seeking&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:t,levelLastLoaded:e,levels:n,media:r}=this;if(null===e||!r&&!this.primaryPrefetch&&(this.startFragRequested||!t.config.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;const i=this.buffering?t.nextLoadLevel:t.loadLevel;if(null==n||!n[i])return;const s=n[i],A=this.getMainFwdBufferInfo();if(null===A)return;const a=this.getLevelDetails();if(a&&this._streamEnded(A,a)){const t={};return 2===this.altAudio&&(t.type="video"),this.hls.trigger(o.BUFFER_EOS,t),void(this.state=xr)}if(!this.buffering)return;t.loadLevel!==i&&-1===t.manualLevel&&this.log(`Adapting to level ${i} from level ${this.level}`),this.level=t.nextLoadLevel=i;const l=s.details;if(!l||this.state===Ur||this.waitForLive(s))return this.level=i,this.state=Ur,void(this.startFragRequested=!1);const u=A.len,c=this.getMaxBufferLength(s.maxBitrate);if(u>=c)return;this.backtrackFragment&&this.backtrackFragment.start>A.end&&(this.backtrackFragment=null);const h=this.backtrackFragment?this.backtrackFragment.start:A.end;let f=this.getNextFragment(h,l);if(this.couldBacktrack&&!this.fragPrevious&&f&&W(f)&&this.fragmentTracker.getState(f)!==Oe){var p;const t=(null!=(p=this.backtrackFragment)?p:f).sn-l.startSN,e=l.fragments[t-1];e&&f.cc===e.cc&&(f=e,this.fragmentTracker.removeFragment(e))}else this.backtrackFragment&&A.len&&(this.backtrackFragment=null);if(f&&this.isLoopLoading(f,h)){if(!f.gap){const t=this.audioOnly&&!this.altAudio?G:V,e=(t===V?this.videoBuffer:this.mediaBuffer)||this.media;e&&this.afterBufferFlushed(e,t,d)}f=this.getNextFragmentLoopLoading(f,l,A,d,c)}f&&(!f.initSegment||f.initSegment.data||this.bitrateTest||(f=f.initSegment),this.loadFragment(f,s,h))}loadFragment(t,e,n){const r=this.fragmentTracker.getState(t);r===Le||r===Qe?W(t)?this.bitrateTest?(this.log(`Fragment ${t.sn} of level ${t.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(t,e)):super.loadFragment(t,e,n):this._loadInitSegment(t,e):this.clearTrackerIfNeeded(t)}getBufferedFrag(t){return this.fragmentTracker.getBufferedFrag(t,d)}followingBufferedFrag(t){return t?this.getBufferedFrag(t.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:t,media:e}=this;if(null!=e&&e.readyState){let n;const r=this.getAppendedFrag(e.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);const i=this.getLevelDetails();if(null!=i&&i.live){const t=this.getMainFwdBufferInfo();if(!t||t.len<2*i.targetduration)return}if(!e.paused&&t){const e=t[this.hls.nextLoadLevel],r=this.fragLastKbps;n=r&&this.fragCurrent?this.fragCurrent.duration*e.maxBitrate/(1e3*r)+1:0}else n=0;const s=this.getBufferedFrag(e.currentTime+n);if(s){const t=this.followingBufferedFrag(s);if(t){this.abortCurrentFrag();const e=t.maxStartPTS?t.maxStartPTS:t.start,n=t.duration,r=Math.max(s.end,e+Math.min(Math.max(n-this.config.maxFragLookUpTolerance,n*(this.couldBacktrack?.5:.125)),n*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(r,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const t=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,t&&(t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.state){case Er:case Cr:case kr:case Tr:case Sr:this.state=br}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(t,e){super.flushMainBuffer(t,e,2===this.altAudio?"video":null)}onMediaAttached(t,e){super.onMediaAttached(t,e);const n=e.media;wr(n,"playing",this.onMediaPlaying),wr(n,"seeked",this.onMediaSeeked)}onMediaDetaching(t,e){const{media:n}=this;n&&(yr(n,"playing",this.onMediaPlaying),yr(n,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(t,e);!!e.transferMedia||(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(o.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(t,e){let n=!1,r=!1;for(let t=0;t<e.levels.length;t++){const i=e.levels[t].audioCodec;i&&(n=n||-1!==i.indexOf("mp4a.40.2"),r=r||-1!==i.indexOf("mp4a.40.5"))}this.audioCodecSwitch=n&&r&&!function(){var t;const e=so();return"function"==typeof(null==e||null==(t=e.prototype)?void 0:t.changeType)}(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1}onLevelLoading(t,e){const{levels:n}=this;if(!n||this.state!==br)return;const r=e.levelInfo;(!r.details||r.details.live&&(this.levelLastLoaded!==r||r.details.expired)||this.waitForCdnTuneIn(r.details))&&(this.state=Ur)}onLevelLoaded(t,e){var n;const{levels:r,startFragRequested:i}=this,s=e.level,A=e.details,a=A.totalduration;if(!r)return void this.warn(`Levels were reset while loading level ${s}`);this.log(`Level ${s} loaded [${A.startSN},${A.endSN}]${A.lastPartSn?`[part-${A.lastPartSn}-${A.lastPartIndex}]`:""}, cc [${A.startCC}, ${A.endCC}] duration:${a}`);const l=e.levelInfo,u=this.fragCurrent;!u||this.state!==Cr&&this.state!==kr||u.level!==e.level&&u.loader&&this.abortCurrentFrag();let c=0;if(A.live||null!=(n=l.details)&&n.live){var h;if(this.checkLiveUpdate(A),A.deltaUpdateFailed)return;c=this.alignPlaylists(A,l.details,null==(h=this.levelLastLoaded)?void 0:h.details)}if(l.details=A,this.levelLastLoaded=l,i||this.setStartPosition(A,c),this.hls.trigger(o.LEVEL_UPDATED,{details:A,level:s}),this.state===Ur){if(this.waitForCdnTuneIn(A))return;this.state=br}i&&A.live&&this.synchronizeToLiveEdge(A),this.tick()}synchronizeToLiveEdge(t){const{config:e,media:n}=this;if(!n)return;const r=this.hls.liveSyncPosition,i=this.getLoadPosition(),s=t.fragmentStart,A=t.edge,a=i>=s-e.maxFragLookUpTolerance&&i<=A;if(null!==r&&n.duration>r&&(i<r||!a)){const s=void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:e.liveMaxLatencyDurationCount*t.targetduration;if((!a&&n.readyState<4||i<A-s)&&(this._hasEnoughToStart||(this.nextLoadPosition=r),n.readyState))if(this.warn(`Playback: ${i.toFixed(3)} is located too far from the end of live sliding playlist: ${A}, reset currentTime to : ${r.toFixed(3)}`),"buffered"===this.config.liveSyncMode){var o;const t=nn.bufferInfo(n,r,0);if(null==(o=t.buffered)||!o.length)return void(n.currentTime=r);if(t.start<=i)return void(n.currentTime=r);const{nextStart:e}=nn.bufferedInfo(t.buffered,i,0);e&&(n.currentTime=e)}else n.currentTime=r}}_handleFragmentLoadProgress(t){var e;const n=t.frag,{part:r,payload:i}=t,{levels:s}=this;if(!s)return void this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);const A=s[n.level];if(!A)return void this.warn(`Level ${n.level} not found on progress`);const a=A.details;if(!a)return this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),void this.fragmentTracker.removeFragment(n);const o=A.videoCodec,l=a.PTSKnown||!a.live,u=null==(e=n.initSegment)?void 0:e.data,c=this._getAudioCodec(A),h=this.transmuxer=this.transmuxer||new cs(this.hls,d,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=r?r.index:-1,p=-1!==f,g=new tn(n.level,n.sn,n.stats.chunkCount,i.byteLength,f,p),m=this.initPTS[n.cc];h.push(i,u,c,o,n,r,a.totalduration,l,g,m)}onAudioTrackSwitching(t,e){const n=this.hls,r=2===this.altAudio;if(ce(e.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(r)return this.fragmentTracker.removeAllFragments(),n.once(o.BUFFER_FLUSHED,(()=>{this.hls&&this.hls.trigger(o.AUDIO_TRACK_SWITCHED,e)})),void n.trigger(o.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});n.trigger(o.AUDIO_TRACK_SWITCHED,e)}}onAudioTrackSwitched(t,e){const n=ce(e.url,this.hls);if(n){const t=this.videoBuffer;t&&this.mediaBuffer!==t&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=t)}this.altAudio=n?2:0,this.tick()}onBufferCreated(t,e){const n=e.tracks;let r,i,s=!1;for(const t in n){const e=n[t];if("main"===e.id){if(i=t,r=e,"video"===t){const e=n[t];e&&(this.videoBuffer=e.buffer)}}else s=!0}s&&r?(this.log(`Alternate track found, use ${i}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(t,e){const{frag:n,part:r}=e,i=n.type===d;if(i){if(this.fragContextChanged(n))return this.warn(`Fragment ${n.sn}${r?" p: "+r.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),void(this.state===Sr&&(this.state=br));const t=r?r.stats:n.stats;this.fragLastKbps=Math.round(8*t.total/(t.buffering.end-t.loading.first)),W(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,r)}const s=this.media;s&&(!this._hasEnoughToStart&&nn.getBuffered(s).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),i&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(t,e){var n;if(e.fatal)this.state=Ir;else switch(e.details){case a.FRAG_GAP:case a.FRAG_PARSING_ERROR:case a.FRAG_DECRYPT_ERROR:case a.FRAG_LOAD_ERROR:case a.FRAG_LOAD_TIMEOUT:case a.KEY_LOAD_ERROR:case a.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(d,e);break;case a.LEVEL_LOAD_ERROR:case a.LEVEL_LOAD_TIMEOUT:case a.LEVEL_PARSING_ERROR:e.levelRetry||this.state!==Ur||(null==(n=e.context)?void 0:n.type)!==u||(this.state=br);break;case a.BUFFER_ADD_CODEC_ERROR:case a.BUFFER_APPEND_ERROR:if("main"!==e.parent)return;this.reduceLengthAndFlushBuffer(e)&&this.resetLoadingState();break;case a.BUFFER_FULL_ERROR:if("main"!==e.parent)return;if(this.reduceLengthAndFlushBuffer(e)){!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}break;case a.INTERNAL_EXCEPTION:this.recoverWorkerError(e)}}onFragLoadEmergencyAborted(){this.state=br,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(t,{type:e}){if(e!==G||!this.altAudio){const t=(e===V?this.videoBuffer:this.mediaBuffer)||this.media;t&&(this.afterBufferFlushed(t,e,d),this.tick())}}onLevelsUpdated(t,e){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,-1===this.level&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=e.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:t}=this;if(!t)return;const e=t.currentTime;let n=this.startPosition;if(n>=0&&e<n){if(t.seeking)return void this.log(`could not seek to ${n}, already seeking at ${e}`);const r=this.timelineOffset;r&&n&&(n+=r);const i=this.getLevelDetails(),s=nn.getBuffered(t),A=s.length?s.start(0):0,a=A-n,o=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||a>0&&(a<o||this.loadingParts&&a<2*((null==i?void 0:i.partTarget)||0)))&&(this.log(`adjusting start position by ${a} to match buffer start`),n+=a,this.startPosition=n),e<n&&(this.log(`seek to target start position ${n} from current time ${e} buffer start ${A}`),t.currentTime=n)}}_getAudioCodec(t){let e=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&e&&(this.log("Swapping audio codec"),e=-1!==e.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),e}_loadBitrateTestFrag(t,e){t.bitrateTest=!0,this._doFragLoad(t,e).then((t=>{const{hls:n}=this,r=null==t?void 0:t.frag;if(!r||this.fragContextChanged(r))return;e.fragmentError=0,this.state=br,this.startFragRequested=!1,this.bitrateTest=!1;const i=r.stats;i.parsing.start=i.parsing.end=i.buffering.start=i.buffering.end=self.performance.now(),n.trigger(o.FRAG_LOADED,t),r.bitrateTest=!1})).catch((e=>{this.state!==Br&&this.state!==Ir&&(this.warn(e),this.resetFragmentLoading(t))}))}_handleTransmuxComplete(t){const e=this.playlistType,{hls:n}=this,{remuxResult:i,chunkMeta:s}=t,A=this.getCurrentContext(s);if(!A)return void this.resetWhenMissingContext(s);const{frag:a,part:l,level:u}=A,{video:c,text:h,id3:d,initSegment:f}=i,{details:p}=u,g=this.altAudio?void 0:i.audio;if(this.fragContextChanged(a))this.fragmentTracker.removeFragment(a);else{if(this.state=Tr,f){const t=f.tracks;if(t){const r=a.initSegment||a;if(this.unhandledEncryptionError(f,a))return;this._bufferInitSegment(u,t,r,s),n.trigger(o.FRAG_PARSING_INIT_SEGMENT,{frag:r,id:e,tracks:t})}const i=f.initPTS,A=f.timescale,l=this.initPTS[a.cc];if(r(i)&&(!l||l.baseTime!==i||l.timescale!==A)){const t=f.trackId;this.initPTS[a.cc]={baseTime:i,timescale:A,trackId:t},n.trigger(o.INIT_PTS_FOUND,{frag:a,id:e,initPTS:i,timescale:A,trackId:t})}}if(c&&p){g&&"audiovideo"===c.type&&this.logMuxedErr(a);const t=p.fragments[a.sn-1-p.startSN],e=a.sn===p.startSN,n=!t||a.cc>t.cc;if(!1!==i.independent){const{startPTS:t,endPTS:r,startDTS:i,endDTS:A}=c;if(l)l.elementaryStreams[c.type]={startPTS:t,endPTS:r,startDTS:i,endDTS:A};else if(c.firstKeyFrame&&c.independent&&1===s.id&&!n&&(this.couldBacktrack=!0),c.dropped&&c.independent){const i=this.getMainFwdBufferInfo(),s=(i?i.end:this.getLoadPosition())+this.config.maxBufferHole,o=c.firstKeyFramePTS?c.firstKeyFramePTS:t;if(!e&&s<o-this.config.maxBufferHole&&!n)return void this.backtrack(a);n&&(a.gap=!0),a.setElementaryStreamInfo(c.type,a.start,r,a.start,A,!0)}else e&&t-(p.appliedTimelineOffset||0)>2&&(a.gap=!0);a.setElementaryStreamInfo(c.type,t,r,i,A),this.backtrackFragment&&(this.backtrackFragment=a),this.bufferFragmentData(c,a,l,s,e||n)}else{if(!e&&!n)return void this.backtrack(a);a.gap=!0}}if(g){const{startPTS:t,endPTS:e,startDTS:n,endDTS:r}=g;l&&(l.elementaryStreams[G]={startPTS:t,endPTS:e,startDTS:n,endDTS:r}),a.setElementaryStreamInfo(G,t,e,n,r),this.bufferFragmentData(g,a,l,s)}if(p&&null!=d&&d.samples.length){const t={id:e,frag:a,details:p,samples:d.samples};n.trigger(o.FRAG_PARSING_METADATA,t)}if(p&&h){const t={id:e,frag:a,details:p,samples:h.samples};n.trigger(o.FRAG_PARSING_USERDATA,t)}}}logMuxedErr(t){this.warn(`${W(t)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${t.url}`)}_bufferInitSegment(t,e,n,r){if(this.state!==Tr)return;this.audioOnly=!!e.audio&&!e.video,this.altAudio&&!this.audioOnly&&(delete e.audio,e.audiovideo&&this.logMuxedErr(n));const{audio:i,video:s,audiovideo:A}=e;if(i){const n=t.audioCodec;let r=Rt(i.codec,n);"mp4a"===r&&(r="mp4a.40.5");const s=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){r&&(r=-1!==r.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5");const t=i.metadata;t&&"channelCount"in t&&1!==(t.channelCount||1)&&-1===s.indexOf("firefox")&&(r="mp4a.40.5")}r&&-1!==r.indexOf("mp4a.40.5")&&-1!==s.indexOf("android")&&"audio/mpeg"!==i.container&&(r="mp4a.40.2",this.log(`Android: force audio codec to ${r}`)),n&&n!==r&&this.log(`Swapping manifest audio codec "${n}" for "${r}"`),i.levelCodec=r,i.id=d,this.log(`Init audio buffer, container:${i.container}, codecs[selected/level/parsed]=[${r||""}/${n||""}/${i.codec}]`),delete e.audiovideo}if(s){s.levelCodec=t.videoCodec,s.id=d;const n=s.codec;if(4===(null==n?void 0:n.length))switch(n){case"hvc1":case"hev1":s.codec="hvc1.1.6.L120.90";break;case"av01":s.codec="av01.0.04M.08";break;case"avc1":s.codec="avc1.42e01e"}this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${t.videoCodec||""}/${n}]${s.codec!==n?" parsed-corrected="+s.codec:""}${s.supplemental?" supplemental="+s.supplemental:""}`),delete e.audiovideo}A&&(this.log(`Init audiovideo buffer, container:${A.container}, codecs[level/parsed]=[${t.codecs}/${A.codec}]`),delete e.video,delete e.audio);const a=Object.keys(e);if(a.length){if(this.hls.trigger(o.BUFFER_CODECS,e),!this.hls)return;a.forEach((t=>{const i=e[t].initSegment;null!=i&&i.byteLength&&this.hls.trigger(o.BUFFER_APPENDING,{type:t,data:i,frag:n,part:null,chunkMeta:r,parent:n.type})}))}this.tickImmediate()}getMainFwdBufferInfo(){const t=this.mediaBuffer&&2===this.altAudio?this.mediaBuffer:this.media;return this.getFwdBufferInfo(t,d)}get maxBufferLength(){const{levels:t,level:e}=this,n=null==t?void 0:t[e];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}backtrack(t){this.couldBacktrack=!0,this.backtrackFragment=t,this.resetTransmuxer(),this.flushBufferGap(t),this.fragmentTracker.removeFragment(t),this.fragPrevious=null,this.nextLoadPosition=t.start,this.state=br}checkFragmentChanged(){const t=this.media;let e=null;if(t&&t.readyState>1&&!1===t.seeking){const n=t.currentTime;if(nn.isBuffered(t,n)?e=this.getAppendedFrag(n):nn.isBuffered(t,n+.1)&&(e=this.getAppendedFrag(n+.1)),e){this.backtrackFragment=null;const t=this.fragPlaying,n=e.level;t&&e.sn===t.sn&&t.level===n||(this.fragPlaying=e,this.hls.trigger(o.FRAG_CHANGED,{frag:e}),t&&t.level===n||this.hls.trigger(o.LEVEL_SWITCHED,{level:n}))}}}get nextLevel(){const t=this.nextBufferedFrag;return t?t.level:-1}get currentFrag(){var t;if(this.fragPlaying)return this.fragPlaying;const e=(null==(t=this.media)?void 0:t.currentTime)||this.lastCurrentTime;return r(e)?this.getAppendedFrag(e):null}get currentProgramDateTime(){var t;const e=(null==(t=this.media)?void 0:t.currentTime)||this.lastCurrentTime;if(r(e)){const t=this.getLevelDetails(),n=this.currentFrag||(t?de(null,t.fragments,e):null);if(n){const t=n.programDateTime;if(null!==t){const r=t+1e3*(e-n.start);return new Date(r)}}}return null}get currentLevel(){const t=this.currentFrag;return t?t.level:-1}get nextBufferedFrag(){const t=this.currentFrag;return t?this.followingBufferedFrag(t):null}get forceStartLoad(){return this._forceStartLoad}}class oo extends B{constructor(t,e){super("key-loader",e),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=t}abort(t){for(const n in this.keyIdToKeyInfo){const r=this.keyIdToKeyInfo[n].loader;if(r){var e;if(t&&t!==(null==(e=r.context)?void 0:e.frag.type))return;r.abort()}}}detach(){for(const t in this.keyIdToKeyInfo){const e=this.keyIdToKeyInfo[t];(e.mediaKeySessionContext||e.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[t]}}destroy(){this.detach();for(const t in this.keyIdToKeyInfo){const e=this.keyIdToKeyInfo[t].loader;e&&e.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(t,e=a.KEY_LOAD_ERROR,n,r,i){return new qe({type:A.NETWORK_ERROR,details:e,fatal:!1,frag:t,response:i,error:n,networkDetails:r})}loadClear(t,e,n){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(e.length)for(let r=0,i=e.length;r<i;r++){const s=e[r];if(t.cc<=s.cc&&(!W(t)||!W(s)||t.sn<s.sn)||!n&&r==i-1)return this.emeController.selectKeySystemFormat(s).then((t=>{if(!this.emeController)return;s.setKeyFormat(t);const e=Sn(t);return e?this.emeController.getKeySystemAccess([e]):void 0}))}if(this.config.requireKeySystemAccessOnStart){const t=In(this.config);if(t.length)return this.emeController.getKeySystemAccess(t)}}return null}load(t){return!t.decryptdata&&t.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(t).then((e=>this.loadInternal(t,e))):this.loadInternal(t)}loadInternal(t,e){var n,r;e&&t.setKeyFormat(e);const i=t.decryptdata;if(!i){const n=new Error(e?`Expected frag.decryptdata to be defined after setting format ${e}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(t,a.KEY_LOAD_ERROR,n))}const s=i.uri;if(!s)return Promise.reject(this.createKeyLoadError(t,a.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));const A=lo(i);let o=this.keyIdToKeyInfo[A];if(null!=(n=o)&&n.decryptdata.key)return i.key=o.decryptdata.key,Promise.resolve({frag:t,keyInfo:o});if(this.emeController&&null!=(r=o)&&r.keyLoadPromise){switch(this.emeController.getKeyStatus(o.decryptdata)){case"usable":case"usable-in-future":return o.keyLoadPromise.then((e=>{const{keyInfo:n}=e;return i.key=n.decryptdata.key,{frag:t,keyInfo:n}}))}}switch(this.log(`${this.keyIdToKeyInfo[A]?"Rel":"L"}oading${i.keyId?" keyId: "+D(i.keyId):""} URI: ${i.uri} from ${t.type} ${t.level}`),o=this.keyIdToKeyInfo[A]={decryptdata:i,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},i.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===i.keyFormat?this.loadKeyHTTP(o,t):this.loadKeyEME(o,t);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(o,t);default:return Promise.reject(this.createKeyLoadError(t,a.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${i.method}"`)))}}loadKeyEME(t,e){const n={frag:e,keyInfo:t};if(this.emeController&&this.config.emeEnabled){var r;if(!t.decryptdata.keyId&&null!=(r=e.initSegment)&&r.data){const n=function(t){const e=[];return ft(t,(t=>e.push(t.subarray(8,24)))),e}(e.initSegment.data);if(n.length){const e=n[0];e.some((t=>0!==t))&&(this.log(`Using keyId found in init segment ${D(e)}`),t.decryptdata.keyId=e,Qn.setKeyIdForUri(t.decryptdata.uri,e))}}const i=this.emeController.loadKey(n);return(t.keyLoadPromise=i.then((e=>(t.mediaKeySessionContext=e,n)))).catch((n=>{throw t.keyLoadPromise=null,"data"in n&&(n.data.frag=e),n}))}return Promise.resolve(n)}loadKeyHTTP(t,e){const n=this.config,r=new(0,n.loader)(n);return e.keyLoader=t.loader=r,t.keyLoadPromise=new Promise(((i,s)=>{const A={keyInfo:t,frag:e,responseType:"arraybuffer",url:t.decryptdata.uri},o=n.keyLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(t,e,n,r)=>{const{frag:A,keyInfo:o}=n,l=lo(o.decryptdata);if(!A.decryptdata||o!==this.keyIdToKeyInfo[l])return s(this.createKeyLoadError(A,a.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),r));o.decryptdata.key=A.decryptdata.key=new Uint8Array(t.data),A.keyLoader=null,o.loader=null,i({frag:A,keyInfo:o})},onError:(t,n,r,i)=>{this.resetLoader(n),s(this.createKeyLoadError(e,a.KEY_LOAD_ERROR,new Error(`HTTP Error ${t.code} loading key ${t.text}`),r,v({url:A.url,data:void 0},t)))},onTimeout:(t,n,r)=>{this.resetLoader(n),s(this.createKeyLoadError(e,a.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),r))},onAbort:(t,n,r)=>{this.resetLoader(n),s(this.createKeyLoadError(e,a.INTERNAL_ABORTED,new Error("key loading aborted"),r))}};r.load(A,l,u)}))}resetLoader(t){const{frag:e,keyInfo:n,url:r}=t,i=n.loader;e.keyLoader===i&&(e.keyLoader=null,n.loader=null);const s=lo(n.decryptdata)||r;delete this.keyIdToKeyInfo[s],i&&i.destroy()}}function lo(t){if(t.keyFormat!==kn){const e=t.keyId;if(e)return D(e)}return t.uri}function uo(t){const{type:e}=t;switch(e){case c:return f;case h:return p;default:return d}}function co(t,e){let n=t.url;return void 0!==n&&0!==n.indexOf("data:")||(n=e.url),n}class ho{constructor(t){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=t,this.registerListeners()}startLoad(t){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:t}=this;t.on(o.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.LEVEL_LOADING,this.onLevelLoading,this),t.on(o.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(o.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),t.on(o.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:t}=this;t.off(o.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.LEVEL_LOADING,this.onLevelLoading,this),t.off(o.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(o.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),t.off(o.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(t){const e=this.hls.config,n=e.pLoader,r=e.loader,i=new(n||r)(e);return this.loaders[t.type]=i,i}getInternalLoader(t){return this.loaders[t.type]}resetInternalLoader(t){this.loaders[t]&&delete this.loaders[t]}destroyInternalLoaders(){for(const t in this.loaders){const e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(t,e){const{url:n}=e;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:l,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(t,e){const{id:n,level:r,pathwayId:i,url:s,deliveryDirectives:A,levelInfo:a}=e;this.load({id:n,level:r,pathwayId:i,responseType:"text",type:u,url:s,deliveryDirectives:A,levelOrTrack:a})}onAudioTrackLoading(t,e){const{id:n,groupId:r,url:i,deliveryDirectives:s,track:A}=e;this.load({id:n,groupId:r,level:null,responseType:"text",type:c,url:i,deliveryDirectives:s,levelOrTrack:A})}onSubtitleTrackLoading(t,e){const{id:n,groupId:r,url:i,deliveryDirectives:s,track:A}=e;this.load({id:n,groupId:r,level:null,responseType:"text",type:h,url:i,deliveryDirectives:s,levelOrTrack:A})}onLevelsUpdated(t,e){const n=this.loaders[u];if(n){const t=n.context;t&&!e.levels.some((e=>e===t.levelOrTrack))&&(n.abort(),delete this.loaders[u])}}load(t){var e;const n=this.hls.config;let i,s=this.getInternalLoader(t);if(s){const e=this.hls.logger,n=s.context;if(n&&n.levelOrTrack===t.levelOrTrack&&(n.url===t.url||n.deliveryDirectives&&!t.deliveryDirectives))return void(n.url===t.url?e.log(`[playlist-loader]: ignore ${t.url} ongoing request`):e.log(`[playlist-loader]: ignore ${t.url} in favor of ${n.url}`));e.log(`[playlist-loader]: aborting previous loader for type: ${t.type}`),s.abort()}if(i=t.type===l?n.manifestLoadPolicy.default:w({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),s=this.createInternalLoader(t),r(null==(e=t.deliveryDirectives)?void 0:e.part)){let e;if(t.type===u&&null!==t.level?e=this.hls.levels[t.level].details:t.type===c&&null!==t.id?e=this.hls.audioTracks[t.id].details:t.type===h&&null!==t.id&&(e=this.hls.subtitleTracks[t.id].details),e){const t=e.partTarget,n=e.targetduration;if(t&&n){const e=1e3*Math.max(3*t,.8*n);i=w({},i,{maxTimeToFirstByteMs:Math.min(e,i.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(e,i.maxTimeToFirstByteMs)})}}}const A=i.errorRetry||i.timeoutRetry||{},a={loadPolicy:i,timeout:i.maxLoadTimeMs,maxRetry:A.maxNumRetry||0,retryDelay:A.retryDelayMs||0,maxRetryDelay:A.maxRetryDelayMs||0},o={onSuccess:(t,e,n,r)=>{const i=this.getInternalLoader(n);this.resetInternalLoader(n.type);const s=t.data;e.parsing.start=performance.now(),$n.isMediaPlaylist(s)||n.type!==l?this.handleTrackOrLevelPlaylist(t,e,n,r||null,i):this.handleMasterPlaylist(t,e,n,r)},onError:(t,e,n,r)=>{this.handleNetworkError(e,n,!1,t,r)},onTimeout:(t,e,n)=>{this.handleNetworkError(e,n,!0,void 0,t)}};s.load(t,a,o)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:t,startPosition:e},forceStartLoad:n}=this.hls;(t||n)&&(this.hls.logger.log(`${t?"auto":"force"} startLoad with configured startPosition ${e}`),this.hls.startLoad(e))}handleMasterPlaylist(t,e,n,r){const i=this.hls,s=t.data,A=co(t,n),a=$n.parseMasterPlaylist(s,A);if(a.playlistParsingError)return e.parsing.end=performance.now(),void this.handleManifestParsingError(t,n,a.playlistParsingError,r,e);const{contentSteering:l,levels:u,sessionData:c,sessionKeys:h,startTimeOffset:d,variableList:f}=a;this.variableList=f,u.forEach((t=>{const{unknownCodecs:e}=t;if(e){const{preferManagedMediaSource:n}=this.hls.config;let{audioCodec:r,videoCodec:i}=t;for(let s=e.length;s--;){const A=e[s];Ft(A,"audio",n)?(t.audioCodec=r=r?`${r},${A}`:A,Ct.audio[r.substring(0,4)]=2,e.splice(s,1)):Ft(A,"video",n)&&(t.videoCodec=i=i?`${i},${A}`:A,Ct.video[i.substring(0,4)]=2,e.splice(s,1))}}}));const{AUDIO:p=[],SUBTITLES:g,"CLOSED-CAPTIONS":m}=$n.parseMasterPlaylistMedia(s,A,a);if(p.length){p.some((t=>!t.url))||!u[0].audioCodec||u[0].attrs.AUDIO||(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),p.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new cn({}),bitrate:0,url:""}))}i.trigger(o.MANIFEST_LOADED,{levels:u,audioTracks:p,subtitles:g,captions:m,contentSteering:l,url:A,stats:e,networkDetails:r,sessionData:c,sessionKeys:h,startTimeOffset:d,variableList:f})}handleTrackOrLevelPlaylist(t,e,n,i,s){const A=this.hls,{id:a,level:u,type:c}=n,h=co(t,n),d=r(u)?u:r(a)?a:0,f=uo(n),p=$n.parseLevelPlaylist(t.data,h,d,f,0,this.variableList);if(c===l){const t={attrs:new cn({}),bitrate:0,details:p,name:"",url:h};p.requestScheduled=e.loading.start+ar(p,0),A.trigger(o.MANIFEST_LOADED,{levels:[t],audioTracks:[],url:h,stats:e,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}e.parsing.end=performance.now(),n.levelDetails=p,this.handlePlaylistLoaded(p,t,e,n,i,s)}handleManifestParsingError(t,e,n,r,i){this.hls.trigger(o.ERROR,{type:A.NETWORK_ERROR,details:a.MANIFEST_PARSING_ERROR,fatal:e.type===l,url:t.url,err:n,error:n,reason:n.message,response:t,context:e,networkDetails:r,stats:i})}handleNetworkError(t,e,n=!1,r,i){let s=`A network ${n?"timeout":"error"+(r?" (status "+r.code+")":"")} occurred while loading ${t.type}`;t.type===u?s+=`: ${t.level} id: ${t.id}`:t.type!==c&&t.type!==h||(s+=` id: ${t.id} group-id: "${t.groupId}"`);const d=new Error(s);this.hls.logger.warn(`[playlist-loader]: ${s}`);let f=a.UNKNOWN,p=!1;const g=this.getInternalLoader(t);switch(t.type){case l:f=n?a.MANIFEST_LOAD_TIMEOUT:a.MANIFEST_LOAD_ERROR,p=!0;break;case u:f=n?a.LEVEL_LOAD_TIMEOUT:a.LEVEL_LOAD_ERROR,p=!1;break;case c:f=n?a.AUDIO_TRACK_LOAD_TIMEOUT:a.AUDIO_TRACK_LOAD_ERROR,p=!1;break;case h:f=n?a.SUBTITLE_TRACK_LOAD_TIMEOUT:a.SUBTITLE_LOAD_ERROR,p=!1}g&&this.resetInternalLoader(t.type);const m={type:A.NETWORK_ERROR,details:f,fatal:p,url:t.url,loader:g,context:t,error:d,networkDetails:e,stats:i};if(r){const n=(null==e?void 0:e.url)||t.url;m.response=v({url:n,data:void 0},r)}this.hls.trigger(o.ERROR,m)}handlePlaylistLoaded(t,e,n,r,i,s){const f=this.hls,{type:p,level:g,levelOrTrack:m,id:_,groupId:w,deliveryDirectives:y}=r,v=co(e,r),B=uo(r);let b="number"==typeof r.level&&B===d?g:void 0;const E=t.playlistParsingError;if(E){if(this.hls.logger.warn(`${E} ${t.url}`),!f.config.ignorePlaylistParsingErrors)return void f.trigger(o.ERROR,{type:A.NETWORK_ERROR,details:a.LEVEL_PARSING_ERROR,fatal:!1,url:v,error:E,reason:E.message,response:e,context:r,level:b,parent:B,networkDetails:i,stats:n});t.playlistParsingError=null}if(t.fragments.length)switch(t.live&&s&&(s.getCacheAge&&(t.ageHeader=s.getCacheAge()||0),s.getCacheAge&&!isNaN(t.ageHeader)||(t.ageHeader=0)),p){case l:case u:if(b)if(m){if(m!==f.levels[b]){const t=f.levels.indexOf(m);t>-1&&(b=t)}}else b=0;f.trigger(o.LEVEL_LOADED,{details:t,levelInfo:m||f.levels[0],level:b||0,id:_||0,stats:n,networkDetails:i,deliveryDirectives:y,withoutMultiVariant:p===l});break;case c:f.trigger(o.AUDIO_TRACK_LOADED,{details:t,track:m,id:_||0,groupId:w||"",stats:n,networkDetails:i,deliveryDirectives:y});break;case h:f.trigger(o.SUBTITLE_TRACK_LOADED,{details:t,track:m,id:_||0,groupId:w||"",stats:n,networkDetails:i,deliveryDirectives:y})}else{const s=t.playlistParsingError=new Error("No Segments found in Playlist");f.trigger(o.ERROR,{type:A.NETWORK_ERROR,details:a.LEVEL_EMPTY_ERROR,fatal:!1,url:v,error:s,reason:s.message,response:e,context:r,level:b,parent:B,networkDetails:i,stats:n})}}}class fo{static get version(){return Hr}static isMSESupported(){return Ao()}static isSupported(){return function(){if(!Ao())return!1;const t=S();return"function"==typeof(null==t?void 0:t.isTypeSupported)&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some((e=>t.isTypeSupported(St(e,"video"))))||["mp4a.40.2","fLaC"].some((e=>t.isTypeSupported(St(e,"audio")))))}()}static getMediaSource(){return S()}static get Events(){return o}static get MetadataSchema(){return ui}static get ErrorTypes(){return A}static get ErrorDetails(){return a}static get DefaultConfig(){return fo.defaultConfig?fo.defaultConfig:Va}static set DefaultConfig(t){fo.defaultConfig=t}constructor(t={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new Nr,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 e=this.logger=function(t,e,n){const r=C();if("object"==typeof console&&!0===t||"object"==typeof t){const i=["debug","log","info","warn","error"];i.forEach((e=>{r[e]=k(e,t,n)}));try{r.log(`Debug logs enabled for "${e}" in hls.js version 1.6.13`)}catch(t){return C()}i.forEach((e=>{F[e]=k(e,t)}))}else w(F,r);return r}(t.debug||!1,"Hls instance",t.assetPlayerId),n=this.config=function(t,e,n){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(void 0!==e.liveMaxLatencyDurationCount&&(void 0===e.liveSyncDurationCount||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==e.liveMaxLatencyDuration&&(void 0===e.liveSyncDuration||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const r=ja(t),i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((t=>{const s=`${"level"===t?"playlist":t}LoadPolicy`,A=void 0===e[s],a=[];i.forEach((n=>{const i=`${t}Loading${n}`,o=e[i];if(void 0!==o&&A){a.push(i);const t=r[s].default;switch(e[s]={default:t},n){case"TimeOut":t.maxLoadTimeMs=o,t.maxTimeToFirstByteMs=o;break;case"MaxRetry":t.errorRetry.maxNumRetry=o,t.timeoutRetry.maxNumRetry=o;break;case"RetryDelay":t.errorRetry.retryDelayMs=o,t.timeoutRetry.retryDelayMs=o;break;case"MaxRetryTimeout":t.errorRetry.maxRetryDelayMs=o,t.timeoutRetry.maxRetryDelayMs=o}}})),a.length&&n.warn(`hls.js config: "${a.join('", "')}" setting(s) are deprecated, use "${s}": ${re(e[s])}`)})),v(v({},r),e)}(fo.DefaultConfig,t,e);this.userConfig=t,n.progressive&&Za(n,e);const{abrController:r,bufferController:i,capLevelController:s,errorController:A,fpsController:a}=n,l=new A(this),u=this.abrController=new r(this),c=new Pe(this),h=n.interstitialsController,d=h?this.interstitialsController=new h(this,fo):null,f=this.bufferController=new i(this,c),p=this.capLevelController=new s(this),g=new a(this),m=new ho(this),_=n.contentSteeringController,y=_?new _(this):null,B=this.levelController=new ro(this,y),b=new eo(this),E=new oo(this.config,this.logger),T=this.streamController=new ao(this,c,E),S=this.gapController=new Wa(this,c);p.setStreamController(T),g.setStreamController(T);const x=[m,B,T];d&&x.splice(1,0,d),y&&x.splice(1,0,y),this.networkControllers=x;const I=[u,f,S,p,g,b,c];this.audioTrackController=this.createController(n.audioTrackController,x);const D=n.audioStreamController;D&&x.push(this.audioStreamController=new D(this,c,E)),this.subtitleTrackController=this.createController(n.subtitleTrackController,x);const U=n.subtitleStreamController;U&&x.push(this.subtititleStreamController=new U(this,c,E)),this.createController(n.timelineController,I),E.emeController=this.emeController=this.createController(n.emeController,I),this.cmcdController=this.createController(n.cmcdController,I),this.latencyController=this.createController(no,I),this.coreComponents=I,x.push(l);const L=l.onErrorOut;"function"==typeof L&&this.on(o.ERROR,L,l),this.on(o.MANIFEST_LOADED,m.onManifestLoaded,m)}createController(t,e){if(t){const n=new t(this);return e&&e.push(n),n}return null}on(t,e,n=this){this._emitter.on(t,e,n)}once(t,e,n=this){this._emitter.once(t,e,n)}removeAllListeners(t){this._emitter.removeAllListeners(t)}off(t,e,n=this,r){this._emitter.off(t,e,n,r)}listeners(t){return this._emitter.listeners(t)}emit(t,e,n){return this._emitter.emit(t,e,n)}trigger(t,e){if(this.config.debug)return this.emit(t,t,e);try{return this.emit(t,t,e)}catch(e){if(this.logger.error("An internal error happened while handling event "+t+'. Error message: "'+e.message+'". Here is a stacktrace:',e),!this.triggeringException){this.triggeringException=!0;const n=t===o.ERROR;this.trigger(o.ERROR,{type:A.OTHER_ERROR,details:a.INTERNAL_EXCEPTION,fatal:n,event:t,error:e}),this.triggeringException=!1}}return!1}listenerCount(t){return this._emitter.listenerCount(t)}destroy(){this.logger.log("destroy"),this.trigger(o.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 t=this.config;t.xhrSetup=t.fetchSetup=void 0,this.userConfig=null}attachMedia(t){if(!t||"media"in t&&!t.media){const e=new Error(`attachMedia failed: invalid argument (${t})`);return void this.trigger(o.ERROR,{type:A.OTHER_ERROR,details:a.ATTACH_MEDIA_ERROR,fatal:!0,error:e})}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const e="media"in t,n=e?t.media:t,r=e?t:{media:n};this._media=n,this.trigger(o.MEDIA_ATTACHING,r)}detachMedia(){this.logger.log("detachMedia"),this.trigger(o.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const t=this.bufferController.transferMedia();return this.trigger(o.MEDIA_DETACHING,{transferMedia:t}),t}loadSource(t){this.stopLoad();const e=this.media,n=this._url,r=this._url=K.buildAbsoluteURL(self.location.href,t,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${r}`),e&&n&&(n!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(e)),this.trigger(o.MANIFEST_LOADING,{url:t})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(t=-1,e){this.logger.log(`startLoad(${t+(e?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(t,e),this.started&&this.networkControllers);n++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let t=0;t<this.networkControllers.length&&(this.networkControllers[t].stopLoad(),!this.started&&this.networkControllers);t++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach((t=>{t.resumeBuffering&&t.resumeBuffering()})))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach((t=>{t.pauseBuffering&&t.pauseBuffering()})))}get inFlightFragments(){const t={[d]:this.streamController.inFlightFrag};return this.audioStreamController&&(t[f]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(t[p]=this.subtititleStreamController.inFlightFrag),t}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const t=this._media,e=null==t?void 0:t.currentTime;this.detachMedia(),t&&(this.attachMedia(t),e&&this.startLoad(e))}removeLevel(t){this.levelController.removeLevel(t)}get sessionId(){let t=this._sessionId;return t||(t=this._sessionId=function(){try{return crypto.randomUUID()}catch(t){try{const t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.slice(e.lastIndexOf("/")+1)}catch(t){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{const n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}}}()),t}get levels(){const t=this.levelController.levels;return t||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(t){this.logger.log(`set currentLevel:${t}`),this.levelController.manualLevel=t,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(t){this.logger.log(`set nextLevel:${t}`),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(t){this.logger.log(`set loadLevel:${t}`),this.levelController.manualLevel=t}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(t){this.levelController.nextLoadLevel=t}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(t){this.logger.log(`set firstLevel:${t}`),this.levelController.firstLevel=t}get startLevel(){const t=this.levelController.startLevel;return-1===t&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:t}set startLevel(t){this.logger.log(`set startLevel:${t}`),-1!==t&&(t=Math.max(t,this.minAutoLevel)),this.levelController.startLevel=t}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(t){const e=!!t;e!==this.config.capLevelToPlayerSize&&(e?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=e)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimate():NaN}set bandwidthEstimate(t){this.abrController.resetEstimator(t)}get abrEwmaDefaultEstimate(){const{bwEstimator:t}=this.abrController;return t?t.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimateTTFB():NaN}set autoLevelCapping(t){this._autoLevelCapping!==t&&(this.logger.log(`set autoLevelCapping:${t}`),this._autoLevelCapping=t,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(t){(function(t){return Zt.indexOf(t)>-1})(t)&&this._maxHdcpLevel!==t&&(this._maxHdcpLevel=t,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return-1===this.levelController.manualLevel}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:t,config:{minAutoBitrate:e}}=this;if(!t)return 0;const n=t.length;for(let r=0;r<n;r++)if(t[r].maxBitrate>=e)return r;return 0}get maxAutoLevel(){const{levels:t,autoLevelCapping:e,maxHdcpLevel:n}=this;let r;if(r=-1===e&&null!=t&&t.length?t.length-1:e,n)for(let e=r;e--;){const r=t[e].attrs["HDCP-LEVEL"];if(r&&r<=n)return e}return r}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(t){this.abrController.nextAutoLevel=t}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(t){var e;return(null==(e=this.audioTrackController)?void 0:e.setAudioOption(t))||null}setSubtitleOption(t){var e;return(null==(e=this.subtitleTrackController)?void 0:e.setSubtitleOption(t))||null}get allAudioTracks(){const t=this.audioTrackController;return t?t.allAudioTracks:[]}get audioTracks(){const t=this.audioTrackController;return t?t.audioTracks:[]}get audioTrack(){const t=this.audioTrackController;return t?t.audioTrack:-1}set audioTrack(t){const e=this.audioTrackController;e&&(e.audioTrack=t)}get allSubtitleTracks(){const t=this.subtitleTrackController;return t?t.allSubtitleTracks:[]}get subtitleTracks(){const t=this.subtitleTrackController;return t?t.subtitleTracks:[]}get subtitleTrack(){const t=this.subtitleTrackController;return t?t.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(t){const e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}get subtitleDisplay(){const t=this.subtitleTrackController;return!!t&&t.subtitleDisplay}set subtitleDisplay(t){const e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(t){this.config.lowLatencyMode=t}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(t){this.latencyController.targetLatency=t}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(t){this.levelController.pathwayPriority=t}get bufferedToEnd(){var t;return!(null==(t=this.bufferController)||!t.bufferedToEnd)}get interstitialsManager(){var t;return(null==(t=this.interstitialsController)?void 0:t.interstitialsManager)||null}getMediaDecodingInfo(t,e=this.allAudioTracks){return Gt(t,se(e),navigator.mediaCapabilities)}}fo.defaultConfig=void 0}}]);