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__Terminal__index.a12a819c...

1 line
559 KiB

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([[5111],{65030:function(e,t,r){"use strict";r.d(t,{Z:function(){return Q}});var i=r(33885),n=r(42978),o=r(75931),s=r(43403),a=r(92310),c=r.n(a),l=r(29301),u=r(76846),h=r(96452),f=r(6089),d=r(80402),_=r(34280),p=r(49658),v=r(59301),g=r(54476),y=r(77900),m=r(8654);function b(e){var t=e.prefixCls,r=e.align,i=e.arrow,n=e.arrowPos,o=i||{},s=o.className,a=o.content,l=n.x,u=void 0===l?0:l,h=n.y,f=void 0===h?0:h,d=v.useRef();if(!r||!r.points)return null;var _={position:"absolute"};if(!1!==r.autoArrow){var p=r.points[0],g=r.points[1],y=p[0],m=p[1],b=g[0],w=g[1];y!==b&&["t","b"].includes(y)?"t"===y?_.top=0:_.bottom=0:_.top=f,m!==w&&["l","r"].includes(m)?"l"===m?_.left=0:_.right=0:_.left=u}return v.createElement("div",{ref:d,className:c()("".concat(t,"-arrow"),s),style:_},a)}function w(e){var t=e.prefixCls,r=e.open,i=e.zIndex,n=e.mask,o=e.motion;return n?v.createElement(y.default,(0,g.Z)({},o,{motionAppear:!0,visible:r,removeOnLeave:!0}),(function(e){var r=e.className;return v.createElement("div",{style:{zIndex:i},className:c()("".concat(t,"-mask"),r)})})):null}var S=v.memo((function(e){return e.children}),(function(e,t){return t.cache}));var C=v.forwardRef((function(e,t){var r=e.popup,o=e.className,s=e.prefixCls,a=e.style,u=e.target,h=e.onVisibleChanged,f=e.open,d=e.keepDom,p=e.fresh,C=e.onClick,k=e.mask,E=e.arrow,x=e.arrowPos,L=e.align,A=e.motion,R=e.maskMotion,M=e.forceRender,T=e.getPopupContainer,D=e.autoDestroy,P=e.portal,O=e.zIndex,X=e.onMouseEnter,F=e.onMouseLeave,K=e.onPointerEnter,I=e.onPointerDownCapture,B=e.ready,H=e.offsetX,j=e.offsetY,U=e.offsetR,N=e.offsetB,W=e.onAlign,z=e.onPrepare,q=e.stretch,Q=e.targetWidth,Z=e.targetHeight,V="function"==typeof r?r():r,G=f||d,Y=(null==T?void 0:T.length)>0,J=v.useState(!T||!Y),$=(0,n.Z)(J,2),ee=$[0],te=$[1];if((0,_.Z)((function(){!ee&&Y&&u&&te(!0)}),[ee,Y,u]),!ee)return null;var re="auto",ie={left:"-1000vw",top:"-1000vh",right:re,bottom:re};if(B||!f){var ne,oe=L.points,se=L.dynamicInset||(null===(ne=L._experimental)||void 0===ne?void 0:ne.dynamicInset),ae=se&&"r"===oe[0][1],ce=se&&"b"===oe[0][0];ae?(ie.right=U,ie.left=re):(ie.left=H,ie.right=re),ce?(ie.bottom=N,ie.top=re):(ie.top=j,ie.bottom=re)}var le={};return q&&(q.includes("height")&&Z?le.height=Z:q.includes("minHeight")&&Z&&(le.minHeight=Z),q.includes("width")&&Q?le.width=Q:q.includes("minWidth")&&Q&&(le.minWidth=Q)),f||(le.pointerEvents="none"),v.createElement(P,{open:M||G,getContainer:T&&function(){return T(u)},autoDestroy:D},v.createElement(w,{prefixCls:s,open:f,zIndex:O,mask:k,motion:R}),v.createElement(l.Z,{onResize:W,disabled:!f},(function(e){return v.createElement(y.default,(0,g.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:M,leavedClassName:"".concat(s,"-hidden")},A,{onAppearPrepare:z,onEnterPrepare:z,visible:f,onVisibleChanged:function(e){var t;null==A||null===(t=A.onVisibleChanged)||void 0===t||t.call(A,e),h(e)}}),(function(r,n){var l=r.className,u=r.style,h=c()(s,l,o);return v.createElement("div",{ref:(0,m.sQ)(e,t,n),className:h,style:(0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)({"--arrow-x":"".concat(x.x||0,"px"),"--arrow-y":"".concat(x.y||0,"px")},ie),le),u),{},{boxSizing:"border-box",zIndex:O},a),onMouseEnter:X,onMouseLeave:F,onPointerEnter:K,onClick:C,onPointerDownCapture:I},E&&v.createElement(b,{prefixCls:s,arrow:E,arrowPos:x,align:L}),v.createElement(S,{cache:!f&&!p},V))}))})))}));var k=v.forwardRef((function(e,t){var r=e.children,i=e.getTriggerDOMNode,n=(0,m.Yr)(r),o=v.useCallback((function(e){(0,m.mH)(t,i?i(e):e)}),[i]),s=(0,m.x1)(o,(0,m.C4)(r));return n?v.cloneElement(r,{ref:s}):r})),E=v.createContext(null);function x(e){return e?Array.isArray(e)?e:[e]:[]}function L(e,t,r,i){return v.useMemo((function(){var n=x(null!=r?r:t),o=x(null!=i?i:t),s=new Set(n),a=new Set(o);return e&&(s.has("hover")&&(s.delete("hover"),s.add("click")),a.has("hover")&&(a.delete("hover"),a.add("click"))),[s,a]}),[e,t,r,i])}var A=r(29194);function R(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return r?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function M(e,t,r,i){for(var n=r.points,o=Object.keys(e),s=0;s<o.length;s+=1){var a,c=o[s];if(R(null===(a=e[c])||void 0===a?void 0:a.points,n,i))return"".concat(t,"-placement-").concat(c)}return""}function T(e,t,r,i){return t||(r?{motionName:"".concat(e,"-").concat(r)}:i?{motionName:i}:null)}function D(e){return e.ownerDocument.defaultView}function P(e){for(var t=[],r=null==e?void 0:e.parentElement,i=["hidden","scroll","clip","auto"];r;){var n=D(r).getComputedStyle(r);[n.overflowX,n.overflowY,n.overflow].some((function(e){return i.includes(e)}))&&t.push(r),r=r.parentElement}return t}function O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isNaN(e)?t:e}function X(e){return O(parseFloat(e),0)}function F(e,t){var r=(0,i.Z)({},e);return(t||[]).forEach((function(e){if(!(e instanceof HTMLBodyElement||e instanceof HTMLHtmlElement)){var t=D(e).getComputedStyle(e),i=t.overflow,n=t.overflowClipMargin,o=t.borderTopWidth,s=t.borderBottomWidth,a=t.borderLeftWidth,c=t.borderRightWidth,l=e.getBoundingClientRect(),u=e.offsetHeight,h=e.clientHeight,f=e.offsetWidth,d=e.clientWidth,_=X(o),p=X(s),v=X(a),g=X(c),y=O(Math.round(l.width/f*1e3)/1e3),m=O(Math.round(l.height/u*1e3)/1e3),b=(f-d-v-g)*y,w=(u-h-_-p)*m,S=_*m,C=p*m,k=v*y,E=g*y,x=0,L=0;if("clip"===i){var A=X(n);x=A*y,L=A*m}var R=l.x+k-x,M=l.y+S-L,T=R+l.width+2*x-k-E-b,P=M+l.height+2*L-S-C-w;r.left=Math.max(r.left,R),r.top=Math.max(r.top,M),r.right=Math.min(r.right,T),r.bottom=Math.min(r.bottom,P)}})),r}function K(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r="".concat(t),i=r.match(/^(.*)\%$/);return i?e*(parseFloat(i[1])/100):parseFloat(r)}function I(e,t){var r=t||[],i=(0,n.Z)(r,2),o=i[0],s=i[1];return[K(e.width,o),K(e.height,s)]}function B(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return[e[0],e[1]]}function H(e,t){var r,i=t[0],n=t[1];return r="t"===i?e.y:"b"===i?e.y+e.height:e.y+e.height/2,{x:"l"===n?e.x:"r"===n?e.x+e.width:e.x+e.width/2,y:r}}function j(e,t){var r={t:"b",b:"t",l:"r",r:"l"};return e.map((function(e,i){return i===t?r[e]||"c":e})).join("")}function U(e,t,r,o,s,a,c){var l=v.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:s[o]||{}}),h=(0,n.Z)(l,2),d=h[0],p=h[1],g=v.useRef(0),y=v.useMemo((function(){return t?P(t):[]}),[t]),m=v.useRef({});e||(m.current={});var b=(0,f.Z)((function(){if(t&&r&&e){var l,h,f,d,_,v=t,g=v.ownerDocument,b=D(v),w=b.getComputedStyle(v).position,S=v.style.left,C=v.style.top,k=v.style.right,E=v.style.bottom,x=v.style.overflow,L=(0,i.Z)((0,i.Z)({},s[o]),a),R=g.createElement("div");if(null===(l=v.parentElement)||void 0===l||l.appendChild(R),R.style.left="".concat(v.offsetLeft,"px"),R.style.top="".concat(v.offsetTop,"px"),R.style.position=w,R.style.height="".concat(v.offsetHeight,"px"),R.style.width="".concat(v.offsetWidth,"px"),v.style.left="0",v.style.top="0",v.style.right="auto",v.style.bottom="auto",v.style.overflow="hidden",Array.isArray(r))_={x:r[0],y:r[1],width:0,height:0};else{var M,T,P=r.getBoundingClientRect();P.x=null!==(M=P.x)&&void 0!==M?M:P.left,P.y=null!==(T=P.y)&&void 0!==T?T:P.top,_={x:P.x,y:P.y,width:P.width,height:P.height}}var X=v.getBoundingClientRect(),K=b.getComputedStyle(v),U=K.height,N=K.width;X.x=null!==(h=X.x)&&void 0!==h?h:X.left,X.y=null!==(f=X.y)&&void 0!==f?f:X.top;var W=g.documentElement,z=W.clientWidth,q=W.clientHeight,Q=W.scrollWidth,Z=W.scrollHeight,V=W.scrollTop,G=W.scrollLeft,Y=X.height,J=X.width,$=_.height,ee=_.width,te={left:0,top:0,right:z,bottom:q},re={left:-G,top:-V,right:Q-G,bottom:Z-V},ie=L.htmlRegion,ne="visible",oe="visibleFirst";"scroll"!==ie&&ie!==oe&&(ie=ne);var se=ie===oe,ae=F(re,y),ce=F(te,y),le=ie===ne?ce:ae,ue=se?ce:le;v.style.left="auto",v.style.top="auto",v.style.right="0",v.style.bottom="0";var he=v.getBoundingClientRect();v.style.left=S,v.style.top=C,v.style.right=k,v.style.bottom=E,v.style.overflow=x,null===(d=v.parentElement)||void 0===d||d.removeChild(R);var fe=O(Math.round(J/parseFloat(N)*1e3)/1e3),de=O(Math.round(Y/parseFloat(U)*1e3)/1e3);if(0===fe||0===de||(0,u.Sh)(r)&&!(0,A.Z)(r))return;var _e=L.offset,pe=L.targetOffset,ve=I(X,_e),ge=(0,n.Z)(ve,2),ye=ge[0],me=ge[1],be=I(_,pe),we=(0,n.Z)(be,2),Se=we[0],Ce=we[1];_.x-=Se,_.y-=Ce;var ke=L.points||[],Ee=(0,n.Z)(ke,2),xe=Ee[0],Le=B(Ee[1]),Ae=B(xe),Re=H(_,Le),Me=H(X,Ae),Te=(0,i.Z)({},L),De=Re.x-Me.x+ye,Pe=Re.y-Me.y+me;function xt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:le,i=X.x+e,n=X.y+t,o=i+J,s=n+Y,a=Math.max(i,r.left),c=Math.max(n,r.top),l=Math.min(o,r.right),u=Math.min(s,r.bottom);return Math.max(0,(l-a)*(u-c))}var Oe,Xe,Fe,Ke,Ie=xt(De,Pe),Be=xt(De,Pe,ce),He=H(_,["t","l"]),je=H(X,["t","l"]),Ue=H(_,["b","r"]),Ne=H(X,["b","r"]),We=L.overflow||{},ze=We.adjustX,qe=We.adjustY,Qe=We.shiftX,Ze=We.shiftY,Ve=function(e){return"boolean"==typeof e?e:e>=0};function Lt(){Oe=X.y+Pe,Xe=Oe+Y,Fe=X.x+De,Ke=Fe+J}Lt();var Ge=Ve(qe),Ye=Ae[0]===Le[0];if(Ge&&"t"===Ae[0]&&(Xe>ue.bottom||m.current.bt)){var Je=Pe;Ye?Je-=Y-$:Je=He.y-Ne.y-me;var $e=xt(De,Je),et=xt(De,Je,ce);$e>Ie||$e===Ie&&(!se||et>=Be)?(m.current.bt=!0,Pe=Je,me=-me,Te.points=[j(Ae,0),j(Le,0)]):m.current.bt=!1}if(Ge&&"b"===Ae[0]&&(Oe<ue.top||m.current.tb)){var tt=Pe;Ye?tt+=Y-$:tt=Ue.y-je.y-me;var rt=xt(De,tt),it=xt(De,tt,ce);rt>Ie||rt===Ie&&(!se||it>=Be)?(m.current.tb=!0,Pe=tt,me=-me,Te.points=[j(Ae,0),j(Le,0)]):m.current.tb=!1}var nt=Ve(ze),ot=Ae[1]===Le[1];if(nt&&"l"===Ae[1]&&(Ke>ue.right||m.current.rl)){var st=De;ot?st-=J-ee:st=He.x-Ne.x-ye;var at=xt(st,Pe),ct=xt(st,Pe,ce);at>Ie||at===Ie&&(!se||ct>=Be)?(m.current.rl=!0,De=st,ye=-ye,Te.points=[j(Ae,1),j(Le,1)]):m.current.rl=!1}if(nt&&"r"===Ae[1]&&(Fe<ue.left||m.current.lr)){var lt=De;ot?lt+=J-ee:lt=Ue.x-je.x-ye;var ut=xt(lt,Pe),ht=xt(lt,Pe,ce);ut>Ie||ut===Ie&&(!se||ht>=Be)?(m.current.lr=!0,De=lt,ye=-ye,Te.points=[j(Ae,1),j(Le,1)]):m.current.lr=!1}Lt();var ft=!0===Qe?0:Qe;"number"==typeof ft&&(Fe<ce.left&&(De-=Fe-ce.left-ye,_.x+ee<ce.left+ft&&(De+=_.x-ce.left+ee-ft)),Ke>ce.right&&(De-=Ke-ce.right-ye,_.x>ce.right-ft&&(De+=_.x-ce.right+ft)));var dt=!0===Ze?0:Ze;"number"==typeof dt&&(Oe<ce.top&&(Pe-=Oe-ce.top-me,_.y+$<ce.top+dt&&(Pe+=_.y-ce.top+$-dt)),Xe>ce.bottom&&(Pe-=Xe-ce.bottom-me,_.y>ce.bottom-dt&&(Pe+=_.y-ce.bottom+dt)));var _t=X.x+De,pt=_t+J,vt=X.y+Pe,gt=vt+Y,yt=_.x,mt=yt+ee,bt=_.y,wt=bt+$,St=(Math.max(_t,yt)+Math.min(pt,mt))/2-_t,Ct=(Math.max(vt,bt)+Math.min(gt,wt))/2-vt;null==c||c(t,Te);var kt=he.right-X.x-(De+X.width),Et=he.bottom-X.y-(Pe+X.height);1===fe&&(De=Math.round(De),kt=Math.round(kt)),1===de&&(Pe=Math.round(Pe),Et=Math.round(Et)),p({ready:!0,offsetX:De/fe,offsetY:Pe/de,offsetR:kt/fe,offsetB:Et/de,arrowX:St/fe,arrowY:Ct/de,scaleX:fe,scaleY:de,align:Te})}})),w=function(){p((function(e){return(0,i.Z)((0,i.Z)({},e),{},{ready:!1})}))};return(0,_.Z)(w,[o]),(0,_.Z)((function(){e||w()}),[e]),[d.ready,d.offsetX,d.offsetY,d.offsetR,d.offsetB,d.arrowX,d.arrowY,d.scaleX,d.scaleY,d.align,function(){g.current+=1;var e=g.current;Promise.resolve().then((function(){g.current===e&&b()}))}]}var N=r(94480);function W(e,t,r,i,n){(0,_.Z)((function(){if(e&&t&&r){var o=r,s=P(t),a=P(o),c=D(o),l=new Set([c].concat((0,N.Z)(s),(0,N.Z)(a)));function u(){i(),n()}return l.forEach((function(e){e.addEventListener("scroll",u,{passive:!0})})),c.addEventListener("resize",u,{passive:!0}),i(),function(){l.forEach((function(e){e.removeEventListener("scroll",u),c.removeEventListener("resize",u)}))}}}),[e,t,r])}r(48736);function z(e,t,r,i,n,o,s,a){var c=v.useRef(e);c.current=e;var l=v.useRef(!1);return v.useEffect((function(){if(t&&i&&(!n||o)){var e=function(){l.current=!1},u=function(e){var t;!c.current||s((null===(t=e.composedPath)||void 0===t||null===(t=t.call(e))||void 0===t?void 0:t[0])||e.target)||l.current||a(!1)},f=D(i);f.addEventListener("pointerdown",e,!0),f.addEventListener("mousedown",u,!0),f.addEventListener("contextmenu",u,!0);var d=(0,h.A)(r);return d&&(d.addEventListener("mousedown",u,!0),d.addEventListener("contextmenu",u,!0)),function(){f.removeEventListener("pointerdown",e,!0),f.removeEventListener("mousedown",u,!0),f.removeEventListener("contextmenu",u,!0),d&&(d.removeEventListener("mousedown",u,!0),d.removeEventListener("contextmenu",u,!0))}}}),[t,r,i,n,o]),function(){l.current=!0}}var q=["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 Q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.Z,t=v.forwardRef((function(t,r){var s=t.prefixCls,a=void 0===s?"rc-trigger-popup":s,g=t.children,y=t.action,m=void 0===y?"hover":y,b=t.showAction,w=t.hideAction,S=t.popupVisible,x=t.defaultPopupVisible,A=t.onPopupVisibleChange,R=t.afterPopupVisibleChange,D=t.mouseEnterDelay,P=t.mouseLeaveDelay,O=void 0===P?.1:P,X=t.focusDelay,F=t.blurDelay,K=t.mask,I=t.maskClosable,B=void 0===I||I,H=t.getPopupContainer,j=t.forceRender,N=t.autoDestroy,Q=t.destroyPopupOnHide,Z=t.popup,V=t.popupClassName,G=t.popupStyle,Y=t.popupPlacement,J=t.builtinPlacements,$=void 0===J?{}:J,ee=t.popupAlign,te=t.zIndex,re=t.stretch,ie=t.getPopupClassNameFromAlign,ne=t.fresh,oe=t.alignPoint,se=t.onPopupClick,ae=t.onPopupAlign,ce=t.arrow,le=t.popupMotion,ue=t.maskMotion,he=t.popupTransitionName,fe=t.popupAnimation,de=t.maskTransitionName,_e=t.maskAnimation,pe=t.className,ve=t.getTriggerDOMNode,ge=(0,o.Z)(t,q),ye=N||Q||!1,me=v.useState(!1),be=(0,n.Z)(me,2),we=be[0],Se=be[1];(0,_.Z)((function(){Se((0,p.Z)())}),[]);var Ce=v.useRef({}),ke=v.useContext(E),Ee=v.useMemo((function(){return{registerSubPopup:function(e,t){Ce.current[e]=t,null==ke||ke.registerSubPopup(e,t)}}}),[ke]),xe=(0,d.Z)(),Le=v.useState(null),Ae=(0,n.Z)(Le,2),Re=Ae[0],Me=Ae[1],Te=v.useRef(null),De=(0,f.Z)((function(e){Te.current=e,(0,u.Sh)(e)&&Re!==e&&Me(e),null==ke||ke.registerSubPopup(xe,e)})),Pe=v.useState(null),Oe=(0,n.Z)(Pe,2),Xe=Oe[0],Fe=Oe[1],Ke=v.useRef(null),Ie=(0,f.Z)((function(e){(0,u.Sh)(e)&&Xe!==e&&(Fe(e),Ke.current=e)})),Be=v.Children.only(g),He=(null==Be?void 0:Be.props)||{},je={},Ue=(0,f.Z)((function(e){var t,r,i=Xe;return(null==i?void 0:i.contains(e))||(null===(t=(0,h.A)(i))||void 0===t?void 0:t.host)===e||e===i||(null==Re?void 0:Re.contains(e))||(null===(r=(0,h.A)(Re))||void 0===r?void 0:r.host)===e||e===Re||Object.values(Ce.current).some((function(t){return(null==t?void 0:t.contains(e))||e===t}))})),Ne=T(a,le,fe,he),We=T(a,ue,_e,de),ze=v.useState(x||!1),qe=(0,n.Z)(ze,2),Qe=qe[0],Ze=qe[1],Ve=null!=S?S:Qe,Ge=(0,f.Z)((function(e){void 0===S&&Ze(e)}));(0,_.Z)((function(){Ze(S||!1)}),[S]);var Ye=v.useRef(Ve);Ye.current=Ve;var Je=v.useRef([]);Je.current=[];var $e=(0,f.Z)((function(e){var t;Ge(e),(null!==(t=Je.current[Je.current.length-1])&&void 0!==t?t:Ve)!==e&&(Je.current.push(e),null==A||A(e))})),et=v.useRef(),tt=function(){clearTimeout(et.current)},rt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;tt(),0===t?$e(e):et.current=setTimeout((function(){$e(e)}),1e3*t)};v.useEffect((function(){return tt}),[]);var it=v.useState(!1),nt=(0,n.Z)(it,2),ot=nt[0],st=nt[1];(0,_.Z)((function(e){e&&!Ve||st(!0)}),[Ve]);var at=v.useState(null),ct=(0,n.Z)(at,2),lt=ct[0],ut=ct[1],ht=v.useState(null),ft=(0,n.Z)(ht,2),dt=ft[0],_t=ft[1],pt=function(e){_t([e.clientX,e.clientY])},vt=U(Ve,Re,oe&&null!==dt?dt:Xe,Y,$,ee,ae),gt=(0,n.Z)(vt,11),yt=gt[0],mt=gt[1],bt=gt[2],wt=gt[3],St=gt[4],Ct=gt[5],kt=gt[6],Et=gt[7],xt=gt[8],Lt=gt[9],At=gt[10],Rt=L(we,m,b,w),Mt=(0,n.Z)(Rt,2),Tt=Mt[0],Dt=Mt[1],Pt=Tt.has("click"),Ot=Dt.has("click")||Dt.has("contextMenu"),Xt=(0,f.Z)((function(){ot||At()}));W(Ve,Xe,Re,Xt,(function(){Ye.current&&oe&&Ot&&rt(!1)})),(0,_.Z)((function(){Xt()}),[dt,Y]),(0,_.Z)((function(){!Ve||null!=$&&$[Y]||Xt()}),[JSON.stringify(ee)]);var Ft=v.useMemo((function(){var e=M($,a,Lt,oe);return c()(e,null==ie?void 0:ie(Lt))}),[Lt,ie,$,a,oe]);v.useImperativeHandle(r,(function(){return{nativeElement:Ke.current,popupElement:Te.current,forceAlign:Xt}}));var Kt=v.useState(0),It=(0,n.Z)(Kt,2),Bt=It[0],Ht=It[1],jt=v.useState(0),Ut=(0,n.Z)(jt,2),Nt=Ut[0],Wt=Ut[1],zt=function(){if(re&&Xe){var e=Xe.getBoundingClientRect();Ht(e.width),Wt(e.height)}};function qt(e,t,r,i){je[e]=function(n){var o;null==i||i(n),rt(t,r);for(var s=arguments.length,a=new Array(s>1?s-1:0),c=1;c<s;c++)a[c-1]=arguments[c];null===(o=He[e])||void 0===o||o.call.apply(o,[He,n].concat(a))}}(0,_.Z)((function(){lt&&(At(),lt(),ut(null))}),[lt]),(Pt||Ot)&&(je.onClick=function(e){var t;Ye.current&&Ot?rt(!1):!Ye.current&&Pt&&(pt(e),rt(!0));for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];null===(t=He.onClick)||void 0===t||t.call.apply(t,[He,e].concat(i))});var Qt,Zt,Vt=z(Ve,Ot,Xe,Re,K,B,Ue,rt),Gt=Tt.has("hover"),Yt=Dt.has("hover");Gt&&(qt("onMouseEnter",!0,D,(function(e){pt(e)})),qt("onPointerEnter",!0,D,(function(e){pt(e)})),Qt=function(e){(Ve||ot)&&null!=Re&&Re.contains(e.target)&&rt(!0,D)},oe&&(je.onMouseMove=function(e){var t;null===(t=He.onMouseMove)||void 0===t||t.call(He,e)})),Yt&&(qt("onMouseLeave",!1,O),qt("onPointerLeave",!1,O),Zt=function(){rt(!1,O)}),Tt.has("focus")&&qt("onFocus",!0,X),Dt.has("focus")&&qt("onBlur",!1,F),Tt.has("contextMenu")&&(je.onContextMenu=function(e){var t;Ye.current&&Dt.has("contextMenu")?rt(!1):(pt(e),rt(!0)),e.preventDefault();for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];null===(t=He.onContextMenu)||void 0===t||t.call.apply(t,[He,e].concat(i))}),pe&&(je.className=c()(He.className,pe));var Jt=v.useRef(!1);Jt.current||(Jt.current=j||Ve||ot);var $t=(0,i.Z)((0,i.Z)({},He),je),er={};["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"].forEach((function(e){ge[e]&&(er[e]=function(){for(var t,r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];null===(t=$t[e])||void 0===t||t.call.apply(t,[$t].concat(i)),ge[e].apply(ge,i)})}));var tr=v.cloneElement(Be,(0,i.Z)((0,i.Z)({},$t),er)),rr={x:Ct,y:kt},ir=ce?(0,i.Z)({},!0!==ce?ce:{}):null;return v.createElement(v.Fragment,null,v.createElement(l.Z,{disabled:!Ve,ref:Ie,onResize:function(){zt(),Xt()}},v.createElement(k,{getTriggerDOMNode:ve},tr)),Jt.current&&v.createElement(E.Provider,{value:Ee},v.createElement(C,{portal:e,ref:De,prefixCls:a,popup:Z,className:c()(V,Ft),style:G,target:Xe,onMouseEnter:Qt,onMouseLeave:Zt,onPointerEnter:Qt,zIndex:te,open:Ve,keepDom:ot,fresh:ne,onClick:se,onPointerDownCapture:Vt,mask:K,motion:Ne,maskMotion:We,onVisibleChanged:function(e){st(!1),At(),null==R||R(e)},onPrepare:function(){return new Promise((function(e){zt(),ut((function(){return e}))}))},forceRender:j,autoDestroy:ye,getPopupContainer:H,align:Lt,arrow:ir,arrowPos:rr,ready:yt,offsetX:mt,offsetY:bt,offsetR:wt,offsetB:St,onAlign:Xt,stretch:re,targetWidth:Bt/Et,targetHeight:Nt/xt})))}));return t}(s.Z)},95042:function(e,t,r){"use strict";r.d(t,{G0:function(){return te},JW:function(){return I},Jd:function(){return D},Kl:function(){return B},L5:function(){return p},MH:function(){return F},MI:function(){return q},Qo:function(){return C},SO:function(){return _},Tf:function(){return m},VT:function(){return M},XO:function(){return f},Xy:function(){return w},Y0:function(){return L},Ye:function(){return J},Yv:function(){return z},ZH:function(){return U},am:function(){return T},bD:function(){return Z},eA:function(){return S},fA:function(){return j},fY:function(){return E},g6:function(){return d},g7:function(){return G},gT:function(){return x},gn:function(){return N},h$:function(){return W},hG:function(){return b},i8:function(){return H},j3:function(){return K},lH:function(){return O},li:function(){return v},n4:function(){return g},pU:function(){return A},qK:function(){return y},sA:function(){return R},sP:function(){return X},t$:function(){return P},wj:function(){return $},zl:function(){return k}});var i=r(7557),n=r.n(i),o=r(41498),s=r.n(o),a=r(82242),c=r.n(a),l=r(67310),u=(0,r(32985).oP)(),h={};function f(e,t){return(0,l.U2)("tasks/".concat(e,".json"),c()(c()({},t),h))}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,l.U2)("myshixuns/".concat(e,"/challenges.json"),c()({},t))}function _(e,t){return(0,l.U2)("myshixuns/".concat(e,"/subject_challenges.json"),t)}function p(e,t,r){return(0,l.U2)("tasks/".concat(e,"/star.json"),{shixun_id:t,star:r})}function v(e,t){return t.path&&(t.path=encodeURIComponent(t.path)),(0,l.U2)("tasks/".concat(e,"/rep_content.json"),c()(c()({},t),h))}function g(e,t){return(0,l.v_)("myshixuns/".concat(e,"/update_file.json"),c()(c()({},t),h))}function y(e,t){return(0,l.U2)("tasks/".concat(e,"/reset_original_code.json"),c()(c()({},t),h))}function m(e,t){return(0,l.v_)("myshixuns/".concat(e,"/reset_repository.json"),t)}function b(e,t){return(0,l.U2)("tasks/".concat(e,"/reset_passed_code.json"),c()(c()({},t),h))}function w(e,t){return(0,l.v_)("tasks/".concat(e,"/game_build.json"),c()(c()({},t),h))}function S(e){return(0,l.ZP)("http://localhost:49352/api/game_build",{method:"post",body:e})}function C(e,t){return(0,l.U2)("tasks/".concat(e,"/game_status.json"),c()(c()({},t),h))}function k(e,t){return(0,l.v_)("tasks/".concat(e,"/choose_build.json"),c()(c()({},t),h))}function E(e){return(0,l.U2)("myshixuns/".concat(e,"/get_remaining_time.json"))}function x(e){return(0,l.U2)("tasks/".concat(e,"/picture_display.json"),h)}function L(e){return(0,l.v_)("tasks/".concat(e,"/plus_or_cancel_praise.json"))}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,l.v_)("myshixuns/".concat(e,"/repository.json"),t)}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,l.U2)("myshixuns/".concat(e,"/start.json"),t)}function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,l.v_)("myshixuns/".concat(e,"/force_delete_pod.json"),t)}function T(e,t){return(0,l.U2)("myshixuns/".concat(e,"/reset_pod.json"),t)}function D(e,t){return(0,l.ZP)("/api/tasks/".concat(e,"/reboot_esc.json"),{method:"post",body:t})}function P(e){return(0,l.U2)("tasks/".concat(e,"/check_test_sets.json"))}function O(e){return(0,l.U2)("tasks/".concat(e,"/get_answer_info.json"))}function X(e){return(0,l.U2)("tasks/".concat(e,"/get_choose_answer.json"))}function F(e){return(0,l.U2)("tasks/".concat(e,"/unlock_choose_answer.json"))}function K(e,t){return(0,l.U2)("tasks/".concat(e,"/unlock_answer.json"),{answer_id:t})}function I(e,t,r,i){return(0,l.v_)("tasks/".concat(e,"/set_games_status.json"),c()({result:t,data:r},i||{}))}function B(e,t){return(0,l.U2)("myshixuns/".concat(e,"/active_pod.json"),t)}function H(e,t){return(0,l.U2)("tasks/".concat(e,"/rank_list.json"),t)}function j(e,t){return(0,l.v_)("tasks/".concat(e,"/close_windows_vnc.json"),{tpi_id:t})}function U(e,t){return(0,l.U2)("tasks/".concat(e,"/commit_files.json"),t)}function N(e,t){return(0,l.U2)("tasks/".concat(e,"/pull_files.json"),t)}function W(e,t){return(0,l.v_)("tasks/".concat(e,"/log_output"),t)}function z(e,t){return(0,l.U2)("tasks/".concat(e,"/stop_log_output.json"),t)}function q(e){return Q.apply(this,arguments)}function Q(){return(Q=s()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.ZP)("/api/myshixuns/".concat(t.id,"/add_file.json"),{method:"post",body:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Z(e){return V.apply(this,arguments)}function V(){return(V=s()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.ZP)("/api/myshixuns/".concat(t.id,"/delete_git_file.json"),{method:"Delete",body:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G(e){return Y.apply(this,arguments)}function Y(){return(Y=s()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.ZP)("/api/myshixuns/".concat(t.id,"/mv_file.json"),{method:"post",body:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function J(e,t){return(0,l.ZP)("/api/shixuns/".concat(e,"/set_start_permanent.json"),{method:"put",body:t})}function $(e){return ee.apply(this,arguments)}function ee(){return(ee=s()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.ZP)("/api/myshixuns/wuying_record.json",{method:"get",params:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function te(e){return re.apply(this,arguments)}function re(){return(re=s()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.ZP)("/api/jupyters/save_with_wuying_tpi.json",{method:"Get",params:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}null!=u&&u.homework_common_id&&(h.homework_common_id=null==u?void 0:u.homework_common_id),null!=u&&u.exercisesId&&(h.exercise_id=null==u?void 0:u.exercisesId),console.log(u,h,"urlParamsAll")},79072:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var i=r(5030),n="ldsRing___mpBZC",o="idsRingWrapper___Of9_n",s=r(37712),a=function(e){var t=e.message,r=e.className,a=e.children,c=e.style,l=void 0===c?{}:c;return(0,s.jsxs)("div",{className:"custom-spinner ".concat(o," ").concat(r),children:[(0,s.jsxs)("div",{className:n,children:[(0,s.jsx)("div",{}),(0,s.jsx)("div",{}),(0,s.jsx)("div",{}),(0,s.jsx)("div",{})]}),t?(0,s.jsx)("p",{style:l,children:t}):null,a,(0,s.jsx)(i.Outlet,{})]})}},56946:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var i=r(82100),n=r.n(i),o=r(29186),s=r.n(o),a=r(80619),c=r.n(a),l=r(47074),u=r.n(l),h=r(59301),f=r(4676),d=function(e){c()(r,e);var t=u()(r);function r(e){var i;n()(this,r),i=t.call(this,e);var o=window.document;return i.node=o.createElement("div"),o.body.appendChild(i.node),i}return s()(r,[{key:"render",value:function(){var e=this.props.children;return(0,f.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),r}(h.Component)},75520:function(e,t,r){"use strict";r.r(t);var i=r(7557),n=r.n(i),o=r(82242),s=r.n(o),a=r(41498),c=r.n(a),l=r(79800),u=r.n(l),h=r(59301),f=r(5030),d=r(60088),_=r(68391),p=(r(75745),r(13326)),v=r(67310),g=r(37712);t.default=(0,f.connect)((function(e){var t=e.classroomList,r=e.loading;return{classroomList:t,globalSetting:e.globalSetting,loading:r.models.classroomList}}))((function(e){e.classroomList,e.globalSetting,e.loading,e.dispatch;var t,r=(0,h.useState)({}),i=u()(r,2),o=i[0],a=i[1],l=(0,h.useState)({}),y=u()(l,2),m=y[0],b=y[1],w=((0,f.useParams)(),(0,f.useSearchParams)()),S=u()(w,1)[0],C="68yrbx3ech4a";switch(S.get("type")){case"windows":C="hvp5tzfof4wl";break;case"vnc":C="m3ifqz82epo9"}(0,h.useEffect)((function(){k()}),[]),(0,h.useEffect)((function(){o.host&&setTimeout((function(){p.Z.publish("create-socket",1)}),500)}),[o]);var k=function(){var e=c()(n()().mark((function e(){var t,r,i,o;return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,v.ZP)("/api/tasks/".concat(S.get("taskId")||C||"68yrbx3ech4a",".json"),{method:"get"});case 2:if(t=e.sent,b(s()({},t)),"terminal"!==S.get("type")){e.next=9;break}return e.next=7,(0,v.ZP)("/api/myshixuns/".concat(null==t||null===(r=t.myshixun)||void 0===r?void 0:r.identifier,"/start.json"),{method:"get",game_id:null==t||null===(i=t.game)||void 0===i?void 0:i.id});case 7:o=e.sent,a(s()({},(null==o?void 0:o.data)||{}));case 9:S.get("type");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,g.jsxs)("section",{style:{position:"fixed",width:"100%",height:"100%",zIndex:22,top:0,right:0,bottom:0,left:0},children:["terminal"===S.get("type")&&(0,g.jsx)(d.Z,{sshConfigData:o,sid:1}),"terminal"!==S.get("type")&&(null==m?void 0:m.challenge)&&(0,g.jsx)(_.Z,{taskId:C,myshixunId:null==m||null===(t=m.myshixun)||void 0===t?void 0:t.identifier,vnc_url:"vnc"===S.get("type"),window_vnc_url:"windows"===S.get("type"),taskData:m})]})}))},68391:function(e,t,r){"use strict";r.d(t,{Z:function(){return F}});var i=r(7557),n=r.n(i),o=r(41498),s=r.n(o),a=r(91232),c=r.n(a),l=r(79800),u=r.n(l),h=r(82242),f=r.n(h),d=r(59301),_=r(62957),p=r(6767),v=r(60242),g=r(79072),y=r(76374),m=r(56946),b=r(5030),w=r(32985),S=r(37568),C=r(99571),k=r(37712),E=S.Z.TextArea,x=function(e){var t=e.onCancel,r=e.onSave,i=e.content,n=(0,d.useState)(i),o=u()(n,2),s=o[0],a=o[1];return(0,d.useEffect)((function(){a(i)}),[i]),(0,k.jsxs)("div",{className:"clipboard-box",children:[(0,k.jsx)("h3",{children:"实验环境剪切板:"}),(0,k.jsx)(E,{value:s,onChange:function(e){a(e.target.value)},className:"clipboard"}),(0,k.jsxs)("p",{children:[" ",(0,k.jsx)("b",{children:" 1.从外部复制内容到实验环境内: "})," 粘贴内容到上面文本框,点击保存,然后在实验环境中进行粘贴。 "]}),(0,k.jsxs)("p",{children:[" ",(0,k.jsx)("b",{children:" 2.获取实验环境中的内容: "})," 请先在环境中复制内容,复制动作完成后内容会显示在上面文本框,然后在上面文本框中再次复制。 "]}),(0,k.jsxs)("div",{className:"btn-action-container",children:[(0,k.jsx)(C.ZP,{type:"ghost",onClick:t,style:{marginRight:10},children:"取消"}),(0,k.jsx)(C.ZP,{type:"primary",onClick:function(){r(s)},children:"保存"})]})]})},L=r(66860),A=r(95042),R=r(62013),M=r(13326),T=r(67310);function D(e){e||(e=window.location.search);var t=e.substr(1),r={};return t.split("&").forEach((function(e){var t=e.split("=");r[t[0]]=decodeURIComponent(t[1])})),r}var P={loading:!0,isLarge:!1,showClipBoardBox:!1,transferContent:"",mes:"实验环境准备中"},O=function(e){return e[e.SET_LOADING=0]="SET_LOADING",e[e.SET_IS_LARGE=1]="SET_IS_LARGE",e[e.SET_MES=2]="SET_MES",e[e.SET_STATE=3]="SET_STATE",e[e.SHOW_CLIPBOARD_BOX=4]="SHOW_CLIPBOARD_BOX",e[e.SET_TRANSFER_CONTENT=5]="SET_TRANSFER_CONTENT",e[e.UPDATE_ALL=6]="UPDATE_ALL",e}(O||{});function X(e,t){switch(t.type){case O.SET_LOADING:return f()(f()({},e),{},{loading:t.payload});case O.SET_IS_LARGE:return f()({},f()(f()({},e),{},{isLarge:t.payload}));case O.SET_MES:return f()(f()({},e),{},{mes:t.payload});case O.SET_STATE:return f()(f()({},e),t.payload);case O.SET_TRANSFER_CONTENT:return f()(f()({},e),{},{transferContent:t.payload});case O.SHOW_CLIPBOARD_BOX:return f()(f()({},e),{},{showClipBoardBox:t.payload});case O.UPDATE_ALL:return f()({loading:e.loading},t.payload);default:throw new Error}}var F=function(e){var t=e.vnc_url,r=e.window_vnc_url,i=e.linux_vnc,o=e.virtual_machine,a=e.taskData,l=e.shixun_environment_id,h=e.tab_type,S=e.instance_startup_type,C=e.index_tab,E=e.tpi_type,F=(0,d.useRef)(),K=(0,d.useRef)(),I=(0,d.useRef)(),B=(0,d.useRef)(),H=(0,d.useRef)(),j=(0,d.useRef)(),U=(0,d.useRef)(),N=(0,d.useRef)(),W=(0,d.useReducer)(X,P),z=u()(W,2),q=z[0],Q=z[1],Z=(0,d.useState)(0),V=u()(Z,2),G=V[0],Y=V[1],J=q.mes,$=q.loading,ee=q.showClipBoardBox,te=q.isLarge,re=q.transferContent,ie=(0,d.useRef)(),ne=(0,d.useRef)(),oe=(0,b.useSearchParams)(),se=u()(oe,1)[0],ae=(0,d.useState)(0),ce=u()(ae,2),le=ce[0],ue=ce[1],he=(0,d.useRef)(),fe=(0,b.useParams)();(0,d.useEffect)((function(){return function(){var e,t;null===(e=K.current)||void 0===e||null===(t=e.disconnect)||void 0===t||t.call(e),clearTimeout(N.current),clearInterval(ie.current)}}),[]),(0,d.useEffect)((function(){ne.current=q.loading}),[q.loading]);var de=function(){var e;2===S?setTimeout((function(){Se()}),1500):void 0!==(null==I||null===(e=I.current)||void 0===e?void 0:e.resizeSession)&&((0,L.vp)()?I.current.resizeSession=!0:setTimeout((function(){}),900))};function _e(){Q({type:O.SHOW_CLIPBOARD_BOX,payload:!1})}function pe(e){return F.current&&(B.current=new y.Z((function(t){var r,i=c()(t);try{for(i.s();!(r=i.n()).done;){var n,o=r.value;if(2===S&&Se(),(o.target.offsetHeight>0||o.target.offsetWidth>0)&&e)e.scaleViewport=!0,null==e||null===(n=e._eventHandlers)||void 0===n||n.windowResize()}}catch(e){i.e(e)}finally{i.f()}})),B.current.observe(F.current)),B.current}(0,d.useEffect)((function(){return document.addEventListener((0,L.gH)(),de),function(){document.removeEventListener((0,L.gH)(),de)}}),[]);var ve=function(){var e=s()(n()().mark((function e(){var t,r,i,c,u,d,p,v;return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c={},"exercises"===se.get("type")?c.exercise_id=se.get("exercisesId"):fe.courseId&&fe.homeworkId&&(c.homework_common_id=fe.homeworkId),e.next=4,(0,A.sA)(null===(t=a.myshixun)||void 0===t?void 0:t.identifier,f()(f()({},fe),{},{taskId:fe.taskId,shixun_environment_id:l,game_id:null==a||null===(r=a.game)||void 0===r?void 0:r.id,tab_type:h},c));case 4:if(null==(u=e.sent)||null===(i=u.data)||void 0===i||null===(i=i.data_list)||void 0===i||!i.length){e.next=8;break}return M.Z.publish("pod-restrict-data",{identifier:null==u||null===(d=u.data)||void 0===d?void 0:d.identifier,data_list:null==u||null===(p=u.data)||void 0===p?void 0:p.data_list}),e.abrupt("return",Promise.reject());case 8:if(-3!==(null==u?void 0:u.status)){e.next=10;break}return e.abrupt("return",new Promise(function(){var e=s()(n()().mark((function e(t,r){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:_.Z.confirm({content:"检测到您已经开启了其他实验环境,请先关闭环境后,再连接",okText:"立即关闭",cancelText:"稍后关闭",onOk:function(){var e=s()(n()().mark((function e(){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(he.current),ue(0),e.next=4,(0,A.fA)(fe.taskId,null==u?void 0:u.message);case 4:return Y(G+1),e.abrupt("return");case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 10:if(-1!==(null==u?void 0:u.status)){e.next=12;break}throw new String(null==u?void 0:u.message);case 12:if(0!==(null==u?void 0:u.status)){e.next=17;break}return o&&((0,w.d8)("PVEAuthCookie",null==u||null===(v=u.data)||void 0===v||null===(v=v.cookie_options)||void 0===v?void 0:v.cookies_value,1),(0,w.d8)("PVELangCookie","zh_CN",1)),M.Z.publish("update-windows-time",null==u?void 0:u.data),M.Z.publish("send-tabs-result-data",f()(f()({},null==u?void 0:u.data),{},{index_tab:C})),e.abrupt("return",u);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function ge(){ue(100),clearTimeout(he.current),setTimeout((function(){Q({type:O.SET_LOADING,payload:!1})}),1300),clearTimeout(ie.current)}var ye=function(){I.current=new R.Z(F.current,U.current,{credentials:{password:j.current},wsProtocols:["binary"],show_dot:!0}),I.current.removeEventListener("disconnect",be),I.current.removeEventListener("connect",ge),I.current.removeEventListener("clipboard",me),window.rfbs2=I.current,B.current=pe(I.current),I.current.viewOnly=fe.view_only||!1,I.current.scaleViewport=fe.scale||!0,I.current.showDotCursor=!0,I.current.resizeSession=!0,I.current.addEventListener("disconnect",be),I.current.addEventListener("connect",ge),I.current.addEventListener("clipboard",me)};function me(e){var t=e.detail.text.replace(/\\u([\dA-Za-z]{4})/g,(function(e,t){return String.fromCharCode(parseInt("0x"+t))}));Q({type:O.SET_TRANSFER_CONTENT,payload:t})}function be(){if(r)Q({type:O.SET_LOADING,payload:!0}),Y(G+1);else{if(clearTimeout(N.current),ne.current)return;N.current=setTimeout((function(){Y(G+1)}),6e3)}setTimeout((function(){var e,t;null===(e=I.current)||void 0===e||null===(t=e.connect)||void 0===t||t.call(e)}),3e3)}function we(){return(we=s()(n()().mark((function e(r){var i,o,s;return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=8;break}return i=r,e.next=4,(0,T.ZP)("/api/tasks/".concat(fe.taskId,"/vnc_paste.json"),{method:"post",body:{content:Base64.encode(i),shixun_environment_id:l}});case 4:0===(null==(o=e.sent)?void 0:o.status)&&(Q({type:O.SET_TRANSFER_CONTENT,payload:r}),p.ZP.success("保存成功!你可以在实验环境中粘贴该内容"),_e()),e.next=12;break;case 8:null===(s=I.current)||void 0===s||s.clipboardPasteFrom(r),Q({type:O.SET_TRANSFER_CONTENT,payload:r}),p.ZP.success("保存成功!你可以在实验环境中粘贴该内容"),_e();case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(){var e;e=Math.min(document.getElementById("task-right-panel").clientWidth/1920,document.getElementById("task-right-panel").clientHeight/1260),H.current.parentElement.className="wh1080p",H.current.parentElement.style.cssText="transform:scale(".concat(e,");transform-origin:center center"),F.current.style.cssText="translate(-50%, -50%) scale("+e+")"}(0,d.useEffect)((function(){if(M.Z.subscribe("reset-linux-windows-vnc-".concat(C),(function(){Y(G+1)})),(r||t||i||o)&&F.current){clearTimeout(he.current),2===S&&Se(),new Promise(s()(n()().mark((function e(){var t,s,c,u,h,f,d,_,p,v,g;return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=D(),e.next=3,ve();case 3:if(s=e.sent,!i&&!o){e.next=11;break}return h=null!=s&&null!==(c=s.data)&&void 0!==c&&null!==(c=c.link_url)&&void 0!==c&&c.includes("?")?"&":"?",H.current.src=(null==s||null===(u=s.data)||void 0===u?void 0:u.link_url)+h+"time="+Date.now(),Q({type:O.SET_LOADING,payload:!1}),e.abrupt("return");case 11:r?(j.current="Edu123",U.current=decodeURIComponent(null==s||null===(f=s.data)||void 0===f?void 0:f.link_url)):(_=new URL(decodeURIComponent(null==s||null===(d=s.data)||void 0===d?void 0:d.link_url)),p=_.protocol,v=_.searchParams,g=_.host,j.current=v.get("password"),U.current="".concat("https:"===p?"wss":"ws","://").concat(g,"/").concat(t.path||"websockify"));case 12:if(2!==S){e.next=15;break}return setTimeout((function(){var e,t,r,i;pe(),H.current.style.cssText=H.current.style.cssText+"width:1920px;height:1080px;position:initial",H.current.src="/rdp.html?".concat(null!=s&&null!==(e=s.data)&&void 0!==e&&e.gpPort?"gpPort="+(null==s||null===(t=s.data)||void 0===t?void 0:t.gpPort)+"&password="+(null==s||null===(r=s.data)||void 0===r?void 0:r.password)+"&":"","tpiId=").concat(null==a||null===(i=a.myshixun)||void 0===i?void 0:i.id,"&envId=").concat(l,"&tpiType=").concat(E),Q({type:O.SET_LOADING,payload:!1})}),5e3),e.abrupt("return");case 15:ye();case 16:case"end":return e.stop()}}),e)}))));var e=M.Z.subscribe("vnc-reset-".concat(C),(function(e){"取消"!==e?(ue(0),Q({type:O.SET_STATE,payload:{loading:!0,mes:e||"实验环境重置中"}})):Q({type:O.SET_LOADING,payload:!1})})),c=M.Z.subscribe("send-ctrl-alt-delete-".concat(C),(function(){var e;null===(e=I.current)||void 0===e||e.sendCtrlAltDel(),p.ZP.success("发送成功")})),u=M.Z.subscribe("show-clipboard-box-".concat(C),(function(){Q({type:O.SHOW_CLIPBOARD_BOX,payload:!0})}));return ue(0),function(){var t,r,i,n;null===(t=I.current)||void 0===t||t.removeEventListener("disconnect",be),null===(r=I.current)||void 0===r||r.removeEventListener("connect",ge),null===(i=I.current)||void 0===i||i.removeEventListener("clipboard",me),e(),c(),u(),F.current&&(null===(n=B.current)||void 0===n||n.unobserve(F.current))}}}),[t,r,i,G,l,h]),(0,d.useEffect)((function(){0==le&&(clearTimeout(he.current),Ce())}),[le]);var Ce=function e(){le>99?le=99:(le+=1,he.current=setTimeout((function(){e()}),1500)),le<100&&ue(le)},ke=(0,d.useMemo)((function(){return $?"none":i||o||r&&2===S?"block":"none"}),[i,$,o,r]);return(0,k.jsxs)(d.Fragment,{children:[te&&(0,k.jsx)("a",{className:"btn-vnc-resize",onClick:function(){Q({type:O.SET_IS_LARGE,payload:!te})},children:(0,k.jsx)("i",{className:"iconfont icon-tuichuquanping"})}),(0,k.jsx)("div",{style:{width:"100%",height:"100%",overflow:"hidden",position:"absolute",display:"block"===ke?"flex":"none",alignItems:"center",justifyContent:"center",zIndex:6},children:(0,k.jsx)("div",{children:(0,k.jsx)("iframe",{style:{position:te?"fixed":"absolute",left:0,top:te?40:0,width:"100%",height:"calc(100% - ".concat(te?"100px":"0px",")")},frameBorder:"0",ref:H,allowFullScreen:!0})})}),(0,k.jsxs)("div",{style:{position:te?"fixed":"absolute",left:0,top:te?40:0,zIndex:5,width:"100%",height:"calc(100% - ".concat(te?"100px":"0px",")")},className:"".concat(r?"vnc-panel-wrapper-windows":"vnc-panel-wrapper"," ").concat(te?"full-screen":""),children:[$?(0,k.jsx)(g.Z,{message:J,style:{color:"#0152d9"},children:(0,k.jsx)("div",{className:"tc",style:{width:500,margin:"0 auto",color:"#FFF"},children:(0,k.jsx)(v.Z,{percent:le,format:function(e){return(0,k.jsxs)("span",{className:"c-white",children:[e,"%"]})}})})}):null,(0,k.jsx)("div",{ref:F,className:"vnc-panel ".concat($?"hidden zIndexf1":"animated fadeIn")})]}),(0,k.jsx)(m.Z,{children:(0,k.jsx)(_.Z,{title:"复制粘贴",centered:!0,maskClosable:!1,open:ee,onCancel:_e,footer:null,children:(0,k.jsx)(x,{onCancel:_e,onSave:function(e){return we.apply(this,arguments)},content:re})})})]})}},60088:function(e,t,r){"use strict";r.d(t,{Z:function(){return k}});var i=r(7557),n=r.n(i),o=r(82242),s=r.n(o),a=r(41498),c=r.n(a),l=r(91232),u=r.n(l),h=r(79800),f=r.n(h),d=r(59301),_=r(24334),p=r(34376),v=(r(17161),"xterm-panel___XA0p9"),g=r(13326),y=r(76374),m=r(95042),b=r(5030),w=r(32985),S=r(62957),C=r(37712),k=function(e){var t=e.itemData,r=void 0===t?{}:t,i=e.game,o=e.myshixun,a=(0,b.useParams)(),l=(0,d.useState)(null),h=f()(l,2),k=h[0],E=h[1],x=(0,d.useState)({}),L=f()(x,2),A=L[0],R=L[1],M=A.link_url,T=A.password,D=A.port,P=(0,d.useRef)(),O=(0,d.useRef)(),X=(0,d.useRef)(!1),F=(0,d.useRef)(!1),K=(0,d.useRef)(!0),I=(0,w.oP)(),B=(0,b.useSearchParams)(),H=f()(B,1)[0],j=r.shixun_environment_id,U=(r.position,r.tab_type),N=r.index_tab,W=r.command_string;function z(e,t,r){var i=r._core._renderService.dimensions.actualCellWidth||9.5,n=r._core._renderService.dimensions.actualCellHeight||18,o=Math.floor(t/n);return[Math.floor(e/i),o]}function q(){return Q.apply(this,arguments)}function Q(){return Q=c()(n()().mark((function e(){var t,r,l,u,h,f;return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l={},"exercises"===H.get("type")?l.exercise_id=H.get("exercisesId"):a.courseId&&a.homeworkId&&(l.homework_common_id=a.homeworkId),e.next=4,(0,m.sA)(null==o?void 0:o.identifier,s()(s()({shixun_environment_id:j,tab_type:U,game_id:i.id},I),l));case 4:if(null==(u=e.sent)||null===(t=u.data)||void 0===t||null===(t=t.data_list)||void 0===t||!t.length){e.next=8;break}return g.Z.publish("pod-restrict-data",{identifier:null==u||null===(h=u.data)||void 0===h?void 0:h.identifier,data_list:null==u||null===(f=u.data)||void 0===f?void 0:f.data_list}),e.abrupt("return");case 8:if(-3!==(null==u?void 0:u.status)){e.next=10;break}return e.abrupt("return",new Promise(function(){var e=c()(n()().mark((function e(t,r){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:S.Z.confirm({content:"检测到您已经开启了其他实验环境,请先关闭环境后,再连接",okText:"立即关闭",cancelText:"稍后关闭",onOk:function(){var e=c()(n()().mark((function e(){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,closeWindowsVnc(a.taskId,null==u?void 0:u.message);case 2:return init(),e.abrupt("return");case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 10:if(200036!==(null==u||null===(r=u.data)||void 0===r?void 0:r.code)){e.next=13;break}return S.Z.confirm({centered:!0,icon:null,width:430,okText:"确定",cancelText:"取消",title:"提示",cancelButtonProps:{style:{display:"none"}},content:(0,C.jsxs)("div",{className:"mb10",children:["由于上次的实验环境未正常关闭,无法再开启新的实验环境,",(0,C.jsx)("br",{}),(0,C.jsx)("span",{style:{color:"#fd4020"},children:"需强制删除旧实验环境再重新开启"})]}),onOk:function(){(0,m.VT)(null==o?void 0:o.identifier,{shixun_environment_id:j,tab_type:U,game_id:i.id}).then((function(e){0==(null==e?void 0:e.status)&&q()}))}}),e.abrupt("return");case 13:0===(null==u?void 0:u.status)&&(g.Z.publish("update-windows-time",null==u?void 0:u.data),g.Z.publish("send-tabs-result-data",s()(s()({},null==u?void 0:u.data),{},{index_tab:N})),R(u.data),setTimeout((function(){return g.Z.publish("create-socket-".concat(N))}),300));case 14:case"end":return e.stop()}}),e)}))),Q.apply(this,arguments)}return(0,d.useEffect)((function(){q()}),[]),(0,d.useEffect)((function(){if(P.current&&M){var e=new p.Terminal({fontSize:16,rendererType:"dom",disableStdin:!0});e.open(P.current),e.onData((function(e){O.current&&1===O.current.readyState&&O.current.send(JSON.stringify({tp:"client",data:e}))})),e.write("Connecting..."),E(e);var t=function(e,t){var r=new y.Z((function(t){var r,i=u()(t);try{for(i.s();!(r=i.n()).done;){var n=r.value;if(n.target.offsetHeight>0||n.target.offsetWidth>0){var o=z(n.target.offsetWidth,n.target.offsetHeight,e),s=f()(o,2),a=s[0],c=s[1];console.log("cols, rows",a,c),g.Z.publish("ssh-xterm-resize-".concat(N),{columns:a,rows:c,width:n.target.offsetWidth,height:n.target.offsetHeight}),e.resize(a,c);var l=_.Base64.decode("IA=="),h=_.Base64.decode("CBtbSw==");e.write(l),e.write(h)}}}catch(e){i.e(e)}finally{i.f()}}));return r.observe(t),r}(e,P.current);return function(){e.dispose(),P.current&&(null==t||t.unobserve(P.current))}}}),[M,P.current]),(0,d.useEffect)((function(){if(k&&M){var e=function e(){var t=new WebSocket(M);O.current=t,t.onopen=function(){var e=k.element.parentElement;if(e){var r=e.offsetWidth,i=e.offsetHeight;console.log("init",{tp:"init",data:s()(s()({},A),{},{secret:T,width:r,height:i,rows:k.rows,columns:k.cols})}),t.send(JSON.stringify({tp:"init",data:s()(s()({},A),{},{secret:T,width:r,height:i,rows:k.rows,columns:k.cols})}))}k.focus()},t.onerror=function(e){console.log("------in socket error----",e,t,M)},t.onmessage=function(e){F.current=!1,X.current||(k.write("\r"),setTimeout((function(){}),1e3)),X.current=!0,console.log("event:",e);var t=_.Base64.decode(e.data.toString()),r=k._core._renderService.dimensions.actualCellWidth||9.5;console.log("data:",t,r,k),k.write(t),null!=W&&W.length?K.current&&(K.current=!1,setTimeout((function(){O.current.send(JSON.stringify({tp:"client",data:(null==W?void 0:W.join("\r"))+"\r"})),k.setOption("disableStdin",!1)}),1e3)):(K.current=!1,k.setOption("disableStdin",!1))};var r=setInterval((function(){var e;O.current&&(null===(e=O.current)||void 0===e||e.send(JSON.stringify({tp:"h"})))}),3e4);t.onclose=function(t){r&&clearInterval(r),console.log(r,"tid",N),F.current||k.write("\r\nconnection closed"),F.current=!0,setTimeout((function(){e()}),1e4)}},t=g.Z.subscribe("create-socket-".concat(N),(function(){e()})),r=g.Z.subscribe("ssh-xterm-resize-".concat(N),(function(e){O.current&&1===O.current.readyState&&O.current.send(JSON.stringify({tp:"resize",data:s()({},e)}))}));return function(){t(),r(),O.current&&(O.current.close(),X.current=!1)}}}),[k,M,D]),(0,C.jsx)("div",{ref:P,className:v,children:M?null:(0,C.jsx)("p",{style:{color:"#fff"},children:"正在连接命令行服务..."})})}},66860:function(e,t,r){"use strict";function i(e){try{e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()}catch(e){console.log(e,":e")}}function n(){window.top.document.webkitExitFullscreen?window.top.document.webkitExitFullscreen():document.exitFullscreen?window.top.document.exitFullscreen():document.msExitFullscreen?window.top.document.msExitFullscreen():document.mozCancelFullScreen&&window.top.document.mozCancelFullScreen()}r.d(t,{BU:function(){return n},Dj:function(){return i},gH:function(){return o},vp:function(){return s}});var o=function(){return document.webkitExitFullscreen?"webkitfullscreenchange":document.exitFullscreen?"fullscreenchange":document.msExitFullscreen?"msfullscreenchange":document.mozCancelFullScreen?"mozfullscreenchange":void 0};function s(){var e=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement;document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",e),window.isFullScreen?window.isFullScreen:null!=e}},17161:function(){},75745:function(){},24334:function(e,t,r){var i,n;n="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:this,e.exports=function(r){"use strict";var n,o=(r=r||{}).Base64,s="2.6.4",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=function(e){for(var t={},r=0,i=e.length;r<i;r++)t[e.charAt(r)]=r;return t}(a),l=String.fromCharCode,u=function(e){if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?l(192|t>>>6)+l(128|63&t):l(224|t>>>12&15)+l(128|t>>>6&63)+l(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return l(240|t>>>18&7)+l(128|t>>>12&63)+l(128|t>>>6&63)+l(128|63&t)},h=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,f=function(e){return e.replace(h,u)},d=function(e){var t=[0,2,1][e.length%3],r=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[a.charAt(r>>>18),a.charAt(r>>>12&63),t>=2?"=":a.charAt(r>>>6&63),t>=1?"=":a.charAt(63&r)].join("")},_=r.btoa&&"function"==typeof r.btoa?function(e){return r.btoa(e)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,d)},p=function(e){return _(f(String(e)))},v=function(e){return e.replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,"")},g=function(e,t){return t?v(p(e)):p(e)},y=function(e){return g(e,!0)};r.Uint8Array&&(n=function(e,t){for(var r="",i=0,n=e.length;i<n;i+=3){var o=e[i],s=e[i+1],c=e[i+2],l=o<<16|s<<8|c;r+=a.charAt(l>>>18)+a.charAt(l>>>12&63)+(void 0!==s?a.charAt(l>>>6&63):"=")+(void 0!==c?a.charAt(63&l):"=")}return t?v(r):r});var m,b=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,w=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return l(55296+(t>>>10))+l(56320+(1023&t));case 3:return l((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return l((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},S=function(e){return e.replace(b,w)},C=function(e){var t=e.length,r=t%4,i=(t>0?c[e.charAt(0)]<<18:0)|(t>1?c[e.charAt(1)]<<12:0)|(t>2?c[e.charAt(2)]<<6:0)|(t>3?c[e.charAt(3)]:0),n=[l(i>>>16),l(i>>>8&255),l(255&i)];return n.length-=[0,0,2,1][r],n.join("")},k=r.atob&&"function"==typeof r.atob?function(e){return r.atob(e)}:function(e){return e.replace(/\S{1,4}/g,C)},E=function(e){return k(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},x=function(e){return S(k(e))},L=function(e){return String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},A=function(e){return x(L(e))};r.Uint8Array&&(m=function(e){return Uint8Array.from(E(L(e)),(function(e){return e.charCodeAt(0)}))});var R=function(){var e=r.Base64;return r.Base64=o,e};if(r.Base64={VERSION:s,atob:E,btoa:_,fromBase64:A,toBase64:g,utob:f,encode:g,encodeURI:y,btou:S,decode:A,noConflict:R,fromUint8Array:n,toUint8Array:m},"function"==typeof Object.defineProperty){var M=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};r.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",M((function(){return A(this)}))),Object.defineProperty(String.prototype,"toBase64",M((function(e){return g(this,e)}))),Object.defineProperty(String.prototype,"toBase64URI",M((function(){return g(this,!0)})))}}return r.Meteor&&(Base64=r.Base64),e.exports?e.exports.Base64=r.Base64:void 0===(i=function(){return r.Base64}.apply(t,[]))||(e.exports=i),{Base64:r.Base64}}(n)},57128:function(e,t,r){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var a=n?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=e[s]}r.default=e,t&&t.set(e,r);return r}(r(50500));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}var s={toBase64Table:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),base64Pad:"=",encode:function(e){for(var t="",r=e.length,i=r%3,n=0;n<r-2;n+=3)t+=this.toBase64Table[e[n]>>2],t+=this.toBase64Table[((3&e[n])<<4)+(e[n+1]>>4)],t+=this.toBase64Table[((15&e[n+1])<<2)+(e[n+2]>>6)],t+=this.toBase64Table[63&e[n+2]];var o=r-i;return 2===i?(t+=this.toBase64Table[e[o]>>2],t+=this.toBase64Table[((3&e[o])<<4)+(e[o+1]>>4)],t+=this.toBase64Table[(15&e[o+1])<<2],t+=this.toBase64Table[64]):1===i&&(t+=this.toBase64Table[e[o]>>2],t+=this.toBase64Table[(3&e[o])<<4],t+=this.toBase64Table[64],t+=this.toBase64Table[64]),t},toBinaryTable:[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1],decode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.indexOf("=")-t;r<0&&(r=e.length-t);for(var i=3*(r>>2)+Math.floor(r%4/1.5),o=new Array(i),s=0,a=0,c=0,l=t;l<e.length;l++){var u=this.toBinaryTable[127&e.charCodeAt(l)],h=e.charAt(l)===this.base64Pad;-1!==u?(a=a<<6|u,(s+=6)>=8&&(s-=8,h||(o[c++]=a>>s&255),a&=(1<<s)-1)):n.Error("Illegal character code "+e.charCodeAt(l)+" at position "+l)}if(s){var f=new Error("Corrupted base64 string");throw f.name="Base64-Error",f}return o}};t.default=s},17852:function(e,t){"use strict";function r(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,i,n;return t=e,(i=[{key:"decodeRect",value:function(e,t,r,i,n,o,s){if(n.rQwait("COPYRECT",4))return!1;var a=n.rQshift16(),c=n.rQshift16();return o.copyImage(a,c,e,t,r,i),!0}}])&&r(t.prototype,i),n&&r(t,n),e}();t.default=i},18330:function(e,t,r){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var a=n?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=e[s]}r.default=e,t&&t.set(e,r);return r}(r(50500));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._tiles=0,this._lastsubencoding=0}var t,r,i;return t=e,(r=[{key:"decodeRect",value:function(e,t,r,i,o,s,a){for(0===this._tiles&&(this._tilesX=Math.ceil(r/16),this._tilesY=Math.ceil(i/16),this._totalTiles=this._tilesX*this._tilesY,this._tiles=this._totalTiles);this._tiles>0;){var c=1;if(o.rQwait("HEXTILE",c))return!1;var l=o.rQ,u=o.rQi,h=l[u];if(h>30)throw new Error("Illegal hextile subencoding (subencoding: "+h+")");var f=this._totalTiles-this._tiles,d=e+f%this._tilesX*16,_=t+16*Math.floor(f/this._tilesX),p=Math.min(16,e+r-d),v=Math.min(16,t+i-_);if(1&h)c+=p*v*4;else if(2&h&&(c+=4),4&h&&(c+=4),8&h){if(c++,o.rQwait("HEXTILE",c))return!1;var g=l[u+c-1];c+=16&h?6*g:2*g}if(o.rQwait("HEXTILE",c))return!1;if(u++,0===h)1&this._lastsubencoding?n.Debug(" Ignoring blank after RAW"):s.fillRect(d,_,p,v,this._background);else if(1&h)s.blitImage(d,_,p,v,l,u),u+=c-1;else{if(2&h&&(this._background=[l[u],l[u+1],l[u+2],l[u+3]],u+=4),4&h&&(this._foreground=[l[u],l[u+1],l[u+2],l[u+3]],u+=4),s.startTile(d,_,p,v,this._background),8&h){var y=l[u];u++;for(var m=0;m<y;m++){var b=void 0;16&h?(b=[l[u],l[u+1],l[u+2],l[u+3]],u+=4):b=this._foreground;var w=l[u],S=w>>4,C=15&w,k=l[++u];u++;var E=1+(k>>4),x=1+(15&k);s.subTile(S,C,E,x,b)}}s.finishTile()}o.rQi=u,this._lastsubencoding=h,this._tiles--}return!0}}])&&s(t.prototype,r),i&&s(t,i),e}();t.default=a},11231:function(e,t){"use strict";function r(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._lines=0}var t,i,n;return t=e,(i=[{key:"decodeRect",value:function(e,t,r,i,n,o,s){0===this._lines&&(this._lines=i);var a=r*(8==s?1:4);if(n.rQwait("RAW",a))return!1;var c=t+(i-this._lines),l=Math.min(this._lines,Math.floor(n.rQlen/a)),u=n.rQ,h=n.rQi;if(8==s){for(var f=r*l,d=new Uint8Array(4*f),_=0;_<f;_++)d[4*_+0]=255*(u[h+_]>>0&3)/3,d[4*_+1]=255*(u[h+_]>>2&3)/3,d[4*_+2]=255*(u[h+_]>>4&3)/3,d[4*_+4]=0;u=d,h=0}return o.blitImage(e,c,r,l,u,h),n.rQskipBytes(l*a),this._lines-=l,!(this._lines>0)}}])&&r(t.prototype,i),n&&r(t,n),e}();t.default=i},57507:function(e,t){"use strict";function r(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._subrects=0}var t,i,n;return t=e,(i=[{key:"decodeRect",value:function(e,t,r,i,n,o,s){if(0===this._subrects){if(n.rQwait("RRE",8))return!1;this._subrects=n.rQshift32();var a=n.rQshiftBytes(4);o.fillRect(e,t,r,i,a)}for(;this._subrects>0;){if(n.rQwait("RRE",12))return!1;var c=n.rQshiftBytes(4),l=n.rQshift16(),u=n.rQshift16(),h=n.rQshift16(),f=n.rQshift16();o.fillRect(e+l,t+u,h,f,c),this._subrects--}return!0}}])&&r(t.prototype,i),n&&r(t,n),e}();t.default=i},21330:function(e,t,r){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r(50500)),s=(n=r(48831))&&n.__esModule?n:{default:n};function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function c(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var l=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ctl=null,this._filter=null,this._numColors=0,this._palette=new Uint8Array(1024),this._len=0,this._zlibs=[];for(var t=0;t<4;t++)this._zlibs[t]=new s.default}var t,r,i;return t=e,(r=[{key:"decodeRect",value:function(e,t,r,i,n,s,a){if(null===this._ctl){if(n.rQwait("TIGHT compression-control",1))return!1;this._ctl=n.rQshift8();for(var c=0;c<4;c++)this._ctl>>c&1&&(this._zlibs[c].reset(),o.Info("Reset zlib stream "+c));this._ctl=this._ctl>>4}var l;if(8===this._ctl)l=this._fillRect(e,t,r,i,n,s,a);else if(9===this._ctl)l=this._jpegRect(e,t,r,i,n,s,a);else if(10===this._ctl)l=this._pngRect(e,t,r,i,n,s,a);else{if(0!=(128&this._ctl))throw new Error("Illegal tight compression received (ctl: "+this._ctl+")");l=this._basicRect(this._ctl,e,t,r,i,n,s,a)}return l&&(this._ctl=null),l}},{key:"_fillRect",value:function(e,t,r,i,n,o,s){if(n.rQwait("TIGHT",3))return!1;var a=n.rQi,c=n.rQ;return o.fillRect(e,t,r,i,[c[a+2],c[a+1],c[a]],!1),n.rQskipBytes(3),!0}},{key:"_jpegRect",value:function(e,t,r,i,n,o,s){var a=this._readData(n);return null!==a&&(o.imageRect(e,t,r,i,"image/jpeg",a),!0)}},{key:"_pngRect",value:function(e,t,r,i,n,o,s){throw new Error("PNG received in standard Tight rect")}},{key:"_basicRect",value:function(e,t,r,i,n,o,s,a){if(null===this._filter)if(4&e){if(o.rQwait("TIGHT",1))return!1;this._filter=o.rQshift8()}else this._filter=0;var c,l=3&e;switch(this._filter){case 0:c=this._copyFilter(l,t,r,i,n,o,s,a);break;case 1:c=this._paletteFilter(l,t,r,i,n,o,s,a);break;case 2:c=this._gradientFilter(l,t,r,i,n,o,s,a);break;default:throw new Error("Illegal tight filter received (ctl: "+this._filter+")")}return c&&(this._filter=null),c}},{key:"_copyFilter",value:function(e,t,r,i,n,o,s,a){var c,l=i*n*3;if(l<12){if(o.rQwait("TIGHT",l))return!1;c=o.rQshiftBytes(l)}else{if(null===(c=this._readData(o)))return!1;this._zlibs[e].setInput(c),c=this._zlibs[e].inflate(l),this._zlibs[e].setInput(null)}return s.blitRgbImage(t,r,i,n,c,0,!1),!0}},{key:"_paletteFilter",value:function(e,t,r,i,n,o,s,a){if(0===this._numColors){if(o.rQwait("TIGHT palette",1))return!1;var c=o.rQpeek8()+1,l=3*c;if(o.rQwait("TIGHT palette",1+l))return!1;this._numColors=c,o.rQskipBytes(1),o.rQshiftTo(this._palette,l)}var u,h=this._numColors<=2?1:8,f=Math.floor((i*h+7)/8)*n;if(f<12){if(o.rQwait("TIGHT",f))return!1;u=o.rQshiftBytes(f)}else{if(null===(u=this._readData(o)))return!1;this._zlibs[e].setInput(u),u=this._zlibs[e].inflate(f),this._zlibs[e].setInput(null)}return 2==this._numColors?this._monoRect(t,r,i,n,u,this._palette,s):this._paletteRect(t,r,i,n,u,this._palette,s),this._numColors=0,!0}},{key:"_monoRect",value:function(e,t,r,i,n,o,s){for(var a=this._getScratchBuffer(r*i*4),c=Math.floor((r+7)/8),l=Math.floor(r/8),u=0;u<i;u++){var h=void 0,f=void 0,d=void 0;for(d=0;d<l;d++)for(var _=7;_>=0;_--)h=4*(u*r+8*d+7-_),f=3*(n[u*c+d]>>_&1),a[h]=o[f],a[h+1]=o[f+1],a[h+2]=o[f+2],a[h+3]=255;for(var p=7;p>=8-r%8;p--)h=4*(u*r+8*d+7-p),f=3*(n[u*c+d]>>p&1),a[h]=o[f],a[h+1]=o[f+1],a[h+2]=o[f+2],a[h+3]=255}s.blitRgbxImage(e,t,r,i,a,0,!1)}},{key:"_paletteRect",value:function(e,t,r,i,n,o,s){for(var a=this._getScratchBuffer(r*i*4),c=r*i*4,l=0,u=0;l<c;l+=4,u++){var h=3*n[u];a[l]=o[h],a[l+1]=o[h+1],a[l+2]=o[h+2],a[l+3]=255}s.blitRgbxImage(e,t,r,i,a,0,!1)}},{key:"_gradientFilter",value:function(e,t,r,i,n,o,s,a){throw new Error("Gradient filter not implemented")}},{key:"_readData",value:function(e){if(0===this._len){if(e.rQwait("TIGHT",3))return null;var t;t=e.rQshift8(),this._len=127&t,128&t&&(t=e.rQshift8(),this._len|=(127&t)<<7,128&t&&(t=e.rQshift8(),this._len|=t<<14))}if(e.rQwait("TIGHT",this._len))return null;var r=e.rQshiftBytes(this._len);return this._len=0,r}},{key:"_getScratchBuffer",value:function(e){return(!this._scratchBuffer||this._scratchBuffer.length<e)&&(this._scratchBuffer=new Uint8Array(e)),this._scratchBuffer}}])&&c(t.prototype,r),i&&c(t,i),e}();t.default=l},91649:function(e,t,r){"use strict";var i;function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=u(e);if(t){var n=u(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return l(this,r)}}function l(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(l,e);var t,r,i,n=c(l);function l(){return o(this,l),n.apply(this,arguments)}return t=l,(r=[{key:"_pngRect",value:function(e,t,r,i,n,o,s){var a=this._readData(n);return null!==a&&(o.imageRect(e,t,r,i,"image/png",a),!0)}},{key:"_basicRect",value:function(e,t,r,i,n,o,s,a){throw new Error("BasicCompression received in TightPNG rect")}}])&&s(t.prototype,r),i&&s(t,i),l}(((i=r(21330))&&i.__esModule?i:{default:i}).default);t.default=h},17834:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,n=r(25805),o=(i=r(27589))&&i.__esModule?i:{default:i};function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.strm=new o.default,this.chunkSize=102400,this.outputBuffer=new Uint8Array(this.chunkSize),this.windowBits=5,(0,n.deflateInit)(this.strm,this.windowBits)}var t,r,i;return t=e,(r=[{key:"deflate",value:function(e){this.strm.input=e,this.strm.avail_in=this.strm.input.length,this.strm.next_in=0,this.strm.output=this.outputBuffer,this.strm.avail_out=this.chunkSize,this.strm.next_out=0;var t=(0,n.deflate)(this.strm,n.Z_FULL_FLUSH),r=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);if(t<0)throw new Error("zlib deflate failed");if(this.strm.avail_in>0){var i=[r],o=r.length;do{if(this.strm.output=new Uint8Array(this.chunkSize),this.strm.next_out=0,this.strm.avail_out=this.chunkSize,(t=(0,n.deflate)(this.strm,n.Z_FULL_FLUSH))<0)throw new Error("zlib deflate failed");var s=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);o+=s.length,i.push(s)}while(this.strm.avail_in>0);for(var a=new Uint8Array(o),c=0,l=0;l<i.length;l++)a.set(i[l],c),c+=i[l].length;r=a}return this.strm.input=null,this.strm.avail_in=0,this.strm.next_in=0,r}}])&&s(t.prototype,r),i&&s(t,i),e}();t.default=a},64966:function(e,t){"use strict";function r(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,n,o,s,a,c,l=[13,16,10,23,0,4,2,27,14,5,20,9,22,18,11,3,25,7,15,6,26,19,12,1,40,51,30,36,46,54,29,39,50,44,32,47,43,48,38,55,33,52,45,41,49,35,28,31],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[(o=(i=65536)|(n=1<<24))|(a=1024),0,0|i,o|(c=(s=4)|a),o|s,i|c,0|s,0|i,0|a,o|a,o|c,0|a,n|c,o|s,0|n,0|s,0|c,n|a,n|a,i|a,i|a,0|o,0|o,n|c,i|s,n|s,n|s,i|s,0,0|c,i|c,0|n,0|i,o|c,0|s,0|o,o|a,0|n,0|n,0|a,o|s,0|i,i|a,n|s,0|a,0|s,n|c,i|c,o|c,i|s,0|o,n|c,n|s,0|c,i|c,o|a,0|c,n|a,n|a,0,i|s,i|a,0,o|s],f=[(o=(i=1<<20)|(n=1<<31))|(c=(s=32)|(a=32768)),n|a,0|a,i|c,0|i,0|s,o|s,n|c,n|s,o|c,o|a,0|n,n|a,0|i,0|s,o|s,i|a,i|s,n|c,0,0|n,0|a,i|c,0|o,i|s,n|s,0,i|a,0|c,o|a,0|o,0|c,0,i|c,o|s,0|i,n|c,0|o,o|a,0|a,0|o,n|a,0|s,o|c,i|c,0|s,0|a,0|n,0|c,o|a,0|i,n|s,i|s,n|c,n|s,i|s,i|a,0,n|a,0|c,0|n,o|s,o|c,i|a],d=[0|(c=(s=8)|(a=512)),(o=(i=1<<17)|(n=1<<27))|a,0,o|s,n|a,0,i|c,n|a,i|s,n|s,n|s,0|i,o|c,i|s,0|o,0|c,0|n,0|s,o|a,0|a,i|a,0|o,o|s,i|c,n|c,i|a,0|i,n|c,0|s,o|c,0|a,0|n,o|a,0|n,i|s,0|c,0|i,o|a,n|a,0,0|a,i|s,o|c,n|a,n|s,0|a,0,o|s,n|c,0|i,0|n,o|c,0|s,i|c,i|a,n|s,0|o,n|c,0|c,0|o,i|c,0|s,o|s,i|a],_=[(o=(i=8192)|(n=1<<23))|(s=1),i|(c=s|(a=128)),i|c,0|a,o|a,n|c,n|s,i|s,0,0|o,0|o,o|c,0|c,0,n|a,n|s,0|s,0|i,0|n,o|s,0|a,0|n,i|s,i|a,n|c,0|s,i|a,n|a,0|i,o|a,o|c,0|c,n|a,n|s,0|o,o|c,0|c,0,0,0|o,i|a,n|a,n|c,0|s,o|s,i|c,i|c,0|a,o|c,0|c,0|s,0|i,n|s,i|s,o|a,n|c,i|s,i|a,0|n,o|s,0|a,0|n,0|i,o|a],p=[0|(s=256),(i=1<<25)|(c=s|(a=1<<19)),i|a,(o=i|(n=1<<30))|s,0|a,0|s,0|n,i|a,n|c,0|a,i|s,n|c,o|s,o|a,0|c,0|n,0|i,n|a,n|a,0,n|s,o|c,o|c,i|s,o|a,n|s,0,0|o,i|c,0|i,0|o,0|c,0|a,o|s,0|s,0|i,0|n,i|a,o|s,n|c,i|s,0|n,o|a,i|c,n|c,0|s,0|i,o|a,o|c,0|c,0|o,o|c,i|a,0,n|a,0|o,0|c,i|s,n|s,0|a,0,n|a,i|c,n|s],v=[(n=1<<29)|(s=16),0|(o=(i=1<<22)|n),0|(a=16384),o|(c=s|a),0|o,0|s,o|c,0|i,n|a,i|c,0|i,n|s,i|s,n|a,0|n,0|c,0,i|s,n|c,0|a,i|a,n|c,0|s,o|s,o|s,0,i|c,o|a,0|c,i|a,o|a,0|n,n|a,0|s,o|s,i|a,o|c,0|i,0|c,n|s,0|i,n|a,0|n,0|c,n|s,o|c,i|a,0|o,i|c,o|a,0,o|s,0|s,0|a,0|o,i|c,0|a,i|s,n|c,0,o|a,0|n,i|s,n|c],g=[0|(i=1<<21),(o=i|(n=1<<26))|(s=2),n|(c=s|(a=2048)),0,0|a,n|c,i|c,o|a,o|c,0|i,0,n|s,0|s,0|n,o|s,0|c,n|a,i|c,i|s,n|a,n|s,0|o,o|a,i|s,0|o,0|a,0|c,o|c,i|a,0|s,0|n,i|a,0|n,i|a,0|i,n|c,n|c,o|s,o|s,0|s,i|s,0|n,n|a,0|i,o|a,0|c,i|c,o|a,0|c,n|s,o|c,0|o,i|a,0,0|s,o|c,0,i|c,0|o,0|a,n|s,n|a,0|a,i|s],y=[(n=1<<28)|(c=(s=64)|(a=4096)),0|a,0|(i=1<<18),(o=i|n)|c,0|n,n|c,0|s,0|n,i|s,0|o,o|c,i|a,o|a,i|c,0|a,0|s,0|o,n|s,n|a,0|c,i|a,i|s,o|s,o|a,0|c,0,0,o|s,n|s,n|a,i|c,0|i,i|c,0|i,o|a,0|a,0|s,o|s,0|a,i|c,n|a,0|s,n|s,0|o,o|s,0|n,0|i,n|c,0,o|c,i|s,n|s,0|o,n|a,n|c,0,o|c,i|a,i|a,0|c,0|c,i|s,0|n,o|a],m=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keys=[];for(var r=[],i=[],n=[],o=0,s=56;o<56;++o,s-=8){var a=7&(s+=s<-5?65:s<-3?31:s<-1?63:27===s?35:0);r[o]=0!=(t[s>>>3]&1<<a)?1:0}for(var c=0;c<16;++c){var h=c<<1,f=h+1;n[h]=n[f]=0;for(var d=28;d<59;d+=28)for(var _=d-28;_<d;++_){var p=_+u[c];i[_]=p<d?r[p]:r[p-28]}for(var v=0;v<24;++v)0!==i[l[v]]&&(n[h]|=1<<23-v),0!==i[l[v+24]]&&(n[f]|=1<<23-v)}for(var g=0,y=0,m=0;g<16;++g){var b=n[y++],w=n[y++];this.keys[m]=(16515072&b)<<6,this.keys[m]|=(4032&b)<<10,this.keys[m]|=(16515072&w)>>>10,this.keys[m]|=(4032&w)>>>6,++m,this.keys[m]=(258048&b)<<12,this.keys[m]|=(63&b)<<16,this.keys[m]|=(258048&w)>>>4,this.keys[m]|=63&w,++m}}var t,i,n;return t=e,i=[{key:"enc8",value:function(e){var t,r,i,n=e.slice(),o=0;t=n[o++]<<24|n[o++]<<16|n[o++]<<8|n[o++],r=n[o++]<<24|n[o++]<<16|n[o++]<<8|n[o++],r^=i=252645135&(t>>>4^r),r^=i=65535&((t^=i<<4)>>>16^r),r^=(i=858993459&(r>>>2^(t^=i<<16)))<<2,r=(r^=(i=16711935&(r>>>8^(t^=i)))<<8)<<1|r>>>31&1,r^=i=2863311530&((t^=i)^r),t=(t^=i)<<1|t>>>31&1;for(var s=0,a=0;s<8;++s){i=r<<28|r>>>4,i^=this.keys[a++];var c=g[63&i];c|=p[i>>>8&63],c|=d[i>>>16&63],c|=h[i>>>24&63],i=r^this.keys[a++],c|=y[63&i],c|=v[i>>>8&63],c|=_[i>>>16&63],i=(t^=c|=f[i>>>24&63])<<28|t>>>4,i^=this.keys[a++],c=g[63&i],c|=p[i>>>8&63],c|=d[i>>>16&63],c|=h[i>>>24&63],i=t^this.keys[a++],c|=y[63&i],c|=v[i>>>8&63],c|=_[i>>>16&63],r^=c|=f[i>>>24&63]}for(r=r<<31|r>>>1,r^=i=2863311530&(t^r),r^=i=16711935&((t=(t^=i)<<31|t>>>1)>>>8^r),r^=i=858993459&((t^=i<<8)>>>2^r),r^=(i=65535&(r>>>16^(t^=i<<2)))<<16,i=[r^=(i=252645135&(r>>>4^(t^=i)))<<4,t^=i],o=0;o<8;o++)n[o]=(i[o>>>2]>>>8*(3-o%4))%256,n[o]<0&&(n[o]+=256);return n}},{key:"encrypt",value:function(e){return this.enc8(e.slice(0,8)).concat(this.enc8(e.slice(8,16)))}}],i&&r(t.prototype,i),n&&r(t,n),e}();t.default=m},22814:function(e,t,r){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r(50500)),s=(n=r(57128))&&n.__esModule?n:{default:n},a=r(41895),c=r(20860);function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function u(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var h=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._drawCtx=null,this._renderQ=[],this._flushing=!1,this._fbWidth=0,this._fbHeight=0,this._prevDrawStyle="",this._tile=null,this._tile16x16=null,this._tileX=0,this._tileY=0,o.Debug(">> Display.constructor"),this._target=t,!this._target)throw new Error("Target must be set");if("string"==typeof this._target)throw new Error("target must be a DOM element");if(!this._target.getContext)throw new Error("no getContext method");if(this._targetCtx=this._target.getContext("2d"),this._viewportLoc={x:0,y:0,w:this._target.width,h:this._target.height},this._backbuffer=document.createElement("canvas"),this._drawCtx=this._backbuffer.getContext("2d"),this._damageBounds={left:0,top:0,right:this._backbuffer.width,bottom:this._backbuffer.height},o.Debug("User Agent: "+navigator.userAgent),!("createImageData"in this._drawCtx))throw new Error("Canvas does not support createImageData");this._tile16x16=this._drawCtx.createImageData(16,16),o.Debug("<< Display.constructor"),this._scale=1,this._clipViewport=!1,this.onflush=function(){}}var t,r,i;return t=e,(r=[{key:"viewportChangePos",value:function(e,t){var r=this._viewportLoc;e=Math.floor(e),t=Math.floor(t),this._clipViewport||(e=-r.w,t=-r.h);var i=r.x+r.w-1,n=r.y+r.h-1;e<0&&r.x+e<0&&(e=-r.x),i+e>=this._fbWidth&&(e-=i+e-this._fbWidth+1),r.y+t<0&&(t=-r.y),n+t>=this._fbHeight&&(t-=n+t-this._fbHeight+1),0===e&&0===t||(o.Debug("viewportChange deltaX: "+e+", deltaY: "+t),r.x+=e,r.y+=t,this._damage(r.x,r.y,r.w,r.h),this.flip())}},{key:"viewportChangeSize",value:function(e,t){this._clipViewport&&void 0!==e&&void 0!==t||(o.Debug("Setting viewport to full display region"),e=this._fbWidth,t=this._fbHeight),e=Math.floor(e),t=Math.floor(t),e>this._fbWidth&&(e=this._fbWidth),t>this._fbHeight&&(t=this._fbHeight);var r=this._viewportLoc;if(r.w!==e||r.h!==t){r.w=e,r.h=t;var i=this._target;i.width=e,i.height=t,this.viewportChangePos(0,0),this._damage(r.x,r.y,r.w,r.h),this.flip(),this._rescale(this._scale)}}},{key:"absX",value:function(e){return 0===this._scale?0:(0,c.toSigned32bit)(e/this._scale+this._viewportLoc.x)}},{key:"absY",value:function(e){return 0===this._scale?0:(0,c.toSigned32bit)(e/this._scale+this._viewportLoc.y)}},{key:"resize",value:function(e,t){this._prevDrawStyle="",this._fbWidth=e,this._fbHeight=t;var r=this._backbuffer;if(r.width!==e||r.height!==t){var i=null;r.width>0&&r.height>0&&(i=this._drawCtx.getImageData(0,0,r.width,r.height)),r.width!==e&&(r.width=e),r.height!==t&&(r.height=t),i&&this._drawCtx.putImageData(i,0,0)}var n=this._viewportLoc;this.viewportChangeSize(n.w,n.h),this.viewportChangePos(0,0)}},{key:"_damage",value:function(e,t,r,i){e<this._damageBounds.left&&(this._damageBounds.left=e),t<this._damageBounds.top&&(this._damageBounds.top=t),e+r>this._damageBounds.right&&(this._damageBounds.right=e+r),t+i>this._damageBounds.bottom&&(this._damageBounds.bottom=t+i)}},{key:"flip",value:function(e){if(0===this._renderQ.length||e){var t=this._damageBounds.left,r=this._damageBounds.top,i=this._damageBounds.right-t,n=this._damageBounds.bottom-r,o=t-this._viewportLoc.x,s=r-this._viewportLoc.y;o<0&&(i+=o,t-=o,o=0),s<0&&(n+=s,r-=s,s=0),o+i>this._viewportLoc.w&&(i=this._viewportLoc.w-o),s+n>this._viewportLoc.h&&(n=this._viewportLoc.h-s),i>0&&n>0&&this._targetCtx.drawImage(this._backbuffer,t,r,i,n,o,s,i,n),this._damageBounds.left=this._damageBounds.top=65535,this._damageBounds.right=this._damageBounds.bottom=0}else this._renderQPush({type:"flip"})}},{key:"pending",value:function(){return this._renderQ.length>0}},{key:"flush",value:function(){0===this._renderQ.length?this.onflush():this._flushing=!0}},{key:"fillRect",value:function(e,t,r,i,n,o){0===this._renderQ.length||o?(this._setFillColor(n),this._drawCtx.fillRect(e,t,r,i),this._damage(e,t,r,i)):this._renderQPush({type:"fill",x:e,y:t,width:r,height:i,color:n})}},{key:"copyImage",value:function(e,t,r,i,n,o,s){0===this._renderQ.length||s?(this._drawCtx.mozImageSmoothingEnabled=!1,this._drawCtx.webkitImageSmoothingEnabled=!1,this._drawCtx.msImageSmoothingEnabled=!1,this._drawCtx.imageSmoothingEnabled=!1,this._drawCtx.drawImage(this._backbuffer,e,t,n,o,r,i,n,o),this._damage(r,i,n,o)):this._renderQPush({type:"copy",oldX:e,oldY:t,x:r,y:i,width:n,height:o})}},{key:"imageRect",value:function(e,t,r,i,n,o){if(0!==r&&0!==i){var a=new Image;a.src="data: "+n+";base64,"+s.default.encode(o),this._renderQPush({type:"img",img:a,x:e,y:t,width:r,height:i})}}},{key:"startTile",value:function(e,t,r,i,n){this._tileX=e,this._tileY=t,this._tile=16===r&&16===i?this._tile16x16:this._drawCtx.createImageData(r,i);for(var o=n[2],s=n[1],a=n[0],c=this._tile.data,l=0;l<r*i*4;l+=4)c[l]=o,c[l+1]=s,c[l+2]=a,c[l+3]=255}},{key:"subTile",value:function(e,t,r,i,n){for(var o=n[2],s=n[1],a=n[0],c=e+r,l=t+i,u=this._tile.data,h=this._tile.width,f=t;f<l;f++)for(var d=e;d<c;d++){var _=4*(d+f*h);u[_]=o,u[_+1]=s,u[_+2]=a,u[_+3]=255}}},{key:"finishTile",value:function(){this._drawCtx.putImageData(this._tile,this._tileX,this._tileY),this._damage(this._tileX,this._tileY,this._tile.width,this._tile.height)}},{key:"blitImage",value:function(e,t,r,i,n,o,s){if(0===this._renderQ.length||s)this._bgrxImageData(e,t,r,i,n,o);else{var a=new Uint8Array(r*i*4);a.set(new Uint8Array(n.buffer,0,a.length)),this._renderQPush({type:"blit",data:a,x:e,y:t,width:r,height:i})}}},{key:"blitRgbImage",value:function(e,t,r,i,n,o,s){if(0===this._renderQ.length||s)this._rgbImageData(e,t,r,i,n,o);else{var a=new Uint8Array(r*i*3);a.set(new Uint8Array(n.buffer,0,a.length)),this._renderQPush({type:"blitRgb",data:a,x:e,y:t,width:r,height:i})}}},{key:"blitRgbxImage",value:function(e,t,r,i,n,o,s){if(0===this._renderQ.length||s)this._rgbxImageData(e,t,r,i,n,o);else{var a=new Uint8Array(r*i*4);a.set(new Uint8Array(n.buffer,0,a.length)),this._renderQPush({type:"blitRgbx",data:a,x:e,y:t,width:r,height:i})}}},{key:"drawImage",value:function(e,t,r){this._drawCtx.drawImage(e,t,r),this._damage(t,r,e.width,e.height)}},{key:"autoscale",value:function(e,t){var r;if(0===e||0===t)r=0;else{var i=this._viewportLoc,n=e/t;r=i.w/i.h>=n?e/i.w:t/i.h}this._rescale(r)}},{key:"_rescale",value:function(e){this._scale=e;var t=this._viewportLoc,r=e*t.w+"px",i=e*t.h+"px";this._target.style.width===r&&this._target.style.height===i||(this._target.style.width=r,this._target.style.height=i)}},{key:"_setFillColor",value:function(e){var t="rgb("+e[2]+","+e[1]+","+e[0]+")";t!==this._prevDrawStyle&&(this._drawCtx.fillStyle=t,this._prevDrawStyle=t)}},{key:"_rgbImageData",value:function(e,t,r,i,n,o){for(var s=this._drawCtx.createImageData(r,i),a=s.data,c=0,l=o;c<r*i*4;c+=4,l+=3)a[c]=n[l],a[c+1]=n[l+1],a[c+2]=n[l+2],a[c+3]=255;this._drawCtx.putImageData(s,e,t),this._damage(e,t,s.width,s.height)}},{key:"_bgrxImageData",value:function(e,t,r,i,n,o){for(var s=this._drawCtx.createImageData(r,i),a=s.data,c=0,l=o;c<r*i*4;c+=4,l+=4)a[c]=n[l+2],a[c+1]=n[l+1],a[c+2]=n[l],a[c+3]=255;this._drawCtx.putImageData(s,e,t),this._damage(e,t,s.width,s.height)}},{key:"_rgbxImageData",value:function(e,t,r,i,n,o){var s;a.supportsImageMetadata?s=new ImageData(new Uint8ClampedArray(n.buffer,n.byteOffset,r*i*4),r,i):(s=this._drawCtx.createImageData(r,i)).data.set(new Uint8ClampedArray(n.buffer,n.byteOffset,r*i*4)),this._drawCtx.putImageData(s,e,t),this._damage(e,t,s.width,s.height)}},{key:"_renderQPush",value:function(e){this._renderQ.push(e),1===this._renderQ.length&&this._scanRenderQ()}},{key:"_resumeRenderQ",value:function(){this.removeEventListener("load",this._noVNCDisplay._resumeRenderQ),this._noVNCDisplay._scanRenderQ()}},{key:"_scanRenderQ",value:function(){for(var e=!0;e&&this._renderQ.length>0;){var t=this._renderQ[0];switch(t.type){case"flip":this.flip(!0);break;case"copy":this.copyImage(t.oldX,t.oldY,t.x,t.y,t.width,t.height,!0);break;case"fill":this.fillRect(t.x,t.y,t.width,t.height,t.color,!0);break;case"blit":this.blitImage(t.x,t.y,t.width,t.height,t.data,0,!0);break;case"blitRgb":this.blitRgbImage(t.x,t.y,t.width,t.height,t.data,0,!0);break;case"blitRgbx":this.blitRgbxImage(t.x,t.y,t.width,t.height,t.data,0,!0);break;case"img":if(t.img.complete&&0!==t.img.width&&0!==t.img.height){if(t.img.width!==t.width||t.img.height!==t.height)return void o.Error("Decoded image has incorrect dimensions. Got "+t.img.width+"x"+t.img.height+". Expected "+t.width+"x"+t.height+".");this.drawImage(t.img,t.x,t.y)}else t.img._noVNCDisplay=this,t.img.addEventListener("load",this._resumeRenderQ),e=!1}e&&this._renderQ.shift()}0===this._renderQ.length&&this._flushing&&(this._flushing=!1,this.onflush())}},{key:"scale",get:function(){return this._scale},set:function(e){this._rescale(e)}},{key:"clipViewport",get:function(){return this._clipViewport},set:function(e){this._clipViewport=e;var t=this._viewportLoc;this.viewportChangeSize(t.w,t.h),this.viewportChangePos(0,0)}},{key:"width",get:function(){return this._fbWidth}},{key:"height",get:function(){return this._fbHeight}}])&&u(t.prototype,r),i&&u(t,i),e}();t.default=h},31729:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodingName=function(e){switch(e){case r.encodingRaw:return"Raw";case r.encodingCopyRect:return"CopyRect";case r.encodingRRE:return"RRE";case r.encodingHextile:return"Hextile";case r.encodingTight:return"Tight";case r.encodingTightPNG:return"TightPNG";default:return"[unknown encoding "+e+"]"}},t.encodings=void 0;var r={encodingRaw:0,encodingCopyRect:1,encodingRRE:2,encodingHextile:5,encodingTight:7,encodingTightPNG:-260,pseudoEncodingQualityLevel9:-23,pseudoEncodingQualityLevel0:-32,pseudoEncodingDesktopSize:-223,pseudoEncodingLastRect:-224,pseudoEncodingCursor:-239,pseudoEncodingQEMUExtendedKeyEvent:-258,pseudoEncodingDesktopName:-307,pseudoEncodingExtendedDesktopSize:-308,pseudoEncodingXvp:-309,pseudoEncodingFence:-312,pseudoEncodingContinuousUpdates:-313,pseudoEncodingCompressLevel9:-247,pseudoEncodingCompressLevel0:-256,pseudoEncodingVMwareCursor:1464686180,pseudoEncodingExtendedClipboard:3231835598};t.encodings=r},48831:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,n=r(95766),o=(i=r(27589))&&i.__esModule?i:{default:i};function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.strm=new o.default,this.chunkSize=102400,this.strm.output=new Uint8Array(this.chunkSize),this.windowBits=5,(0,n.inflateInit)(this.strm,this.windowBits)}var t,r,i;return t=e,(r=[{key:"setInput",value:function(e){e?(this.strm.input=e,this.strm.avail_in=this.strm.input.length,this.strm.next_in=0):(this.strm.input=null,this.strm.avail_in=0,this.strm.next_in=0)}},{key:"inflate",value:function(e){if(e>this.chunkSize&&(this.chunkSize=e,this.strm.output=new Uint8Array(this.chunkSize)),this.strm.next_out=0,this.strm.avail_out=e,(0,n.inflate)(this.strm,0)<0)throw new Error("zlib inflate failed");if(this.strm.next_out!=e)throw new Error("Incomplete zlib block");return new Uint8Array(this.strm.output.buffer,0,this.strm.next_out)}},{key:"reset",value:function(){(0,n.inflateReset)(this.strm)}}])&&s(t.prototype,r),i&&s(t,i),e}();t.default=a},18280:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,n=(i=r(69314))&&i.__esModule?i:{default:i};var o={};function s(e,t){if(void 0===t)throw new Error('Undefined keysym for key "'+e+'"');if(e in o)throw new Error('Duplicate entry for key "'+e+'"');o[e]=[t,t,t,t]}function a(e,t,r){if(void 0===t)throw new Error('Undefined keysym for key "'+e+'"');if(void 0===r)throw new Error('Undefined keysym for key "'+e+'"');if(e in o)throw new Error('Duplicate entry for key "'+e+'"');o[e]=[t,t,r,t]}function c(e,t,r){if(void 0===t)throw new Error('Undefined keysym for key "'+e+'"');if(void 0===r)throw new Error('Undefined keysym for key "'+e+'"');if(e in o)throw new Error('Duplicate entry for key "'+e+'"');o[e]=[t,t,t,r]}a("Alt",n.default.XK_Alt_L,n.default.XK_Alt_R),s("AltGraph",n.default.XK_ISO_Level3_Shift),s("CapsLock",n.default.XK_Caps_Lock),a("Control",n.default.XK_Control_L,n.default.XK_Control_R),a("Meta",n.default.XK_Super_L,n.default.XK_Super_R),s("NumLock",n.default.XK_Num_Lock),s("ScrollLock",n.default.XK_Scroll_Lock),a("Shift",n.default.XK_Shift_L,n.default.XK_Shift_R),c("Enter",n.default.XK_Return,n.default.XK_KP_Enter),s("Tab",n.default.XK_Tab),c(" ",n.default.XK_space,n.default.XK_KP_Space),c("ArrowDown",n.default.XK_Down,n.default.XK_KP_Down),c("ArrowUp",n.default.XK_Up,n.default.XK_KP_Up),c("ArrowLeft",n.default.XK_Left,n.default.XK_KP_Left),c("ArrowRight",n.default.XK_Right,n.default.XK_KP_Right),c("End",n.default.XK_End,n.default.XK_KP_End),c("Home",n.default.XK_Home,n.default.XK_KP_Home),c("PageDown",n.default.XK_Next,n.default.XK_KP_Next),c("PageUp",n.default.XK_Prior,n.default.XK_KP_Prior),s("Backspace",n.default.XK_BackSpace),c("Clear",n.default.XK_Clear,n.default.XK_KP_Begin),s("Copy",n.default.XF86XK_Copy),s("Cut",n.default.XF86XK_Cut),c("Delete",n.default.XK_Delete,n.default.XK_KP_Delete),c("Insert",n.default.XK_Insert,n.default.XK_KP_Insert),s("Paste",n.default.XF86XK_Paste),s("Redo",n.default.XK_Redo),s("Undo",n.default.XK_Undo),s("Cancel",n.default.XK_Cancel),s("ContextMenu",n.default.XK_Menu),s("Escape",n.default.XK_Escape),s("Execute",n.default.XK_Execute),s("Find",n.default.XK_Find),s("Help",n.default.XK_Help),s("Pause",n.default.XK_Pause),s("Select",n.default.XK_Select),s("ZoomIn",n.default.XF86XK_ZoomIn),s("ZoomOut",n.default.XF86XK_ZoomOut),s("BrightnessDown",n.default.XF86XK_MonBrightnessDown),s("BrightnessUp",n.default.XF86XK_MonBrightnessUp),s("Eject",n.default.XF86XK_Eject),s("LogOff",n.default.XF86XK_LogOff),s("Power",n.default.XF86XK_PowerOff),s("PowerOff",n.default.XF86XK_PowerDown),s("PrintScreen",n.default.XK_Print),s("Hibernate",n.default.XF86XK_Hibernate),s("Standby",n.default.XF86XK_Standby),s("WakeUp",n.default.XF86XK_WakeUp),s("AllCandidates",n.default.XK_MultipleCandidate),s("Alphanumeric",n.default.XK_Eisu_Shift),s("CodeInput",n.default.XK_Codeinput),s("Compose",n.default.XK_Multi_key),s("Convert",n.default.XK_Henkan),s("GroupFirst",n.default.XK_ISO_First_Group),s("GroupLast",n.default.XK_ISO_Last_Group),s("GroupNext",n.default.XK_ISO_Next_Group),s("GroupPrevious",n.default.XK_ISO_Prev_Group),s("NonConvert",n.default.XK_Muhenkan),s("PreviousCandidate",n.default.XK_PreviousCandidate),s("SingleCandidate",n.default.XK_SingleCandidate),s("HangulMode",n.default.XK_Hangul),s("HanjaMode",n.default.XK_Hangul_Hanja),s("JunjuaMode",n.default.XK_Hangul_Jeonja),s("Eisu",n.default.XK_Eisu_toggle),s("Hankaku",n.default.XK_Hankaku),s("Hiragana",n.default.XK_Hiragana),s("HiraganaKatakana",n.default.XK_Hiragana_Katakana),s("KanaMode",n.default.XK_Kana_Shift),s("KanjiMode",n.default.XK_Kanji),s("Katakana",n.default.XK_Katakana),s("Romaji",n.default.XK_Romaji),s("Zenkaku",n.default.XK_Zenkaku),s("ZenkakuHanaku",n.default.XK_Zenkaku_Hankaku),s("F1",n.default.XK_F1),s("F2",n.default.XK_F2),s("F3",n.default.XK_F3),s("F4",n.default.XK_F4),s("F5",n.default.XK_F5),s("F6",n.default.XK_F6),s("F7",n.default.XK_F7),s("F8",n.default.XK_F8),s("F9",n.default.XK_F9),s("F10",n.default.XK_F10),s("F11",n.default.XK_F11),s("F12",n.default.XK_F12),s("F13",n.default.XK_F13),s("F14",n.default.XK_F14),s("F15",n.default.XK_F15),s("F16",n.default.XK_F16),s("F17",n.default.XK_F17),s("F18",n.default.XK_F18),s("F19",n.default.XK_F19),s("F20",n.default.XK_F20),s("F21",n.default.XK_F21),s("F22",n.default.XK_F22),s("F23",n.default.XK_F23),s("F24",n.default.XK_F24),s("F25",n.default.XK_F25),s("F26",n.default.XK_F26),s("F27",n.default.XK_F27),s("F28",n.default.XK_F28),s("F29",n.default.XK_F29),s("F30",n.default.XK_F30),s("F31",n.default.XK_F31),s("F32",n.default.XK_F32),s("F33",n.default.XK_F33),s("F34",n.default.XK_F34),s("F35",n.default.XK_F35),s("Close",n.default.XF86XK_Close),s("MailForward",n.default.XF86XK_MailForward),s("MailReply",n.default.XF86XK_Reply),s("MailSend",n.default.XF86XK_Send),s("MediaFastForward",n.default.XF86XK_AudioForward),s("MediaPause",n.default.XF86XK_AudioPause),s("MediaPlay",n.default.XF86XK_AudioPlay),s("MediaRecord",n.default.XF86XK_AudioRecord),s("MediaRewind",n.default.XF86XK_AudioRewind),s("MediaStop",n.default.XF86XK_AudioStop),s("MediaTrackNext",n.default.XF86XK_AudioNext),s("MediaTrackPrevious",n.default.XF86XK_AudioPrev),s("New",n.default.XF86XK_New),s("Open",n.default.XF86XK_Open),s("Print",n.default.XK_Print),s("Save",n.default.XF86XK_Save),s("SpellCheck",n.default.XF86XK_Spell),s("AudioVolumeDown",n.default.XF86XK_AudioLowerVolume),s("AudioVolumeUp",n.default.XF86XK_AudioRaiseVolume),s("AudioVolumeMute",n.default.XF86XK_AudioMute),s("MicrophoneVolumeMute",n.default.XF86XK_AudioMicMute),s("LaunchApplication1",n.default.XF86XK_MyComputer),s("LaunchApplication2",n.default.XF86XK_Calculator),s("LaunchCalendar",n.default.XF86XK_Calendar),s("LaunchMail",n.default.XF86XK_Mail),s("LaunchMediaPlayer",n.default.XF86XK_AudioMedia),s("LaunchMusicPlayer",n.default.XF86XK_Music),s("LaunchPhone",n.default.XF86XK_Phone),s("LaunchScreenSaver",n.default.XF86XK_ScreenSaver),s("LaunchSpreadsheet",n.default.XF86XK_Excel),s("LaunchWebBrowser",n.default.XF86XK_WWW),s("LaunchWebCam",n.default.XF86XK_WebCam),s("LaunchWordProcessor",n.default.XF86XK_Word),s("BrowserBack",n.default.XF86XK_Back),s("BrowserFavorites",n.default.XF86XK_Favorites),s("BrowserForward",n.default.XF86XK_Forward),s("BrowserHome",n.default.XF86XK_HomePage),s("BrowserRefresh",n.default.XF86XK_Refresh),s("BrowserSearch",n.default.XF86XK_Search),s("BrowserStop",n.default.XF86XK_Stop),s("Dimmer",n.default.XF86XK_BrightnessAdjust),s("MediaAudioTrack",n.default.XF86XK_AudioCycleTrack),s("RandomToggle",n.default.XF86XK_AudioRandomPlay),s("SplitScreenToggle",n.default.XF86XK_SplitScreen),s("Subtitle",n.default.XF86XK_Subtitle),s("VideoModeNext",n.default.XF86XK_Next_VMode),c("=",n.default.XK_equal,n.default.XK_KP_Equal),c("+",n.default.XK_plus,n.default.XK_KP_Add),c("-",n.default.XK_minus,n.default.XK_KP_Subtract),c("*",n.default.XK_asterisk,n.default.XK_KP_Multiply),c("/",n.default.XK_slash,n.default.XK_KP_Divide),c(".",n.default.XK_period,n.default.XK_KP_Decimal),c(",",n.default.XK_comma,n.default.XK_KP_Separator),c("0",n.default.XK_0,n.default.XK_KP_0),c("1",n.default.XK_1,n.default.XK_KP_1),c("2",n.default.XK_2,n.default.XK_KP_2),c("3",n.default.XK_3,n.default.XK_KP_3),c("4",n.default.XK_4,n.default.XK_KP_4),c("5",n.default.XK_5,n.default.XK_KP_5),c("6",n.default.XK_6,n.default.XK_KP_6),c("7",n.default.XK_7,n.default.XK_KP_7),c("8",n.default.XK_8,n.default.XK_KP_8),c("9",n.default.XK_9,n.default.XK_KP_9);var l=o;t.default=l},15311:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={Backspace:"Backspace",AltLeft:"Alt",AltRight:"Alt",CapsLock:"CapsLock",ContextMenu:"ContextMenu",ControlLeft:"Control",ControlRight:"Control",Enter:"Enter",MetaLeft:"Meta",MetaRight:"Meta",ShiftLeft:"Shift",ShiftRight:"Shift",Tab:"Tab",Delete:"Delete",End:"End",Help:"Help",Home:"Home",Insert:"Insert",PageDown:"PageDown",PageUp:"PageUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",ArrowUp:"ArrowUp",NumLock:"NumLock",NumpadBackspace:"Backspace",NumpadClear:"Clear",Escape:"Escape",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",F13:"F13",F14:"F14",F15:"F15",F16:"F16",F17:"F17",F18:"F18",F19:"F19",F20:"F20",F21:"F21",F22:"F22",F23:"F23",F24:"F24",F25:"F25",F26:"F26",F27:"F27",F28:"F28",F29:"F29",F30:"F30",F31:"F31",F32:"F32",F33:"F33",F34:"F34",F35:"F35",PrintScreen:"PrintScreen",ScrollLock:"ScrollLock",Pause:"Pause",BrowserBack:"BrowserBack",BrowserFavorites:"BrowserFavorites",BrowserForward:"BrowserForward",BrowserHome:"BrowserHome",BrowserRefresh:"BrowserRefresh",BrowserSearch:"BrowserSearch",BrowserStop:"BrowserStop",Eject:"Eject",LaunchApp1:"LaunchMyComputer",LaunchApp2:"LaunchCalendar",LaunchMail:"LaunchMail",MediaPlayPause:"MediaPlay",MediaStop:"MediaStop",MediaTrackNext:"MediaTrackNext",MediaTrackPrevious:"MediaTrackPrevious",Power:"Power",Sleep:"Sleep",AudioVolumeDown:"AudioVolumeDown",AudioVolumeMute:"AudioVolumeMute",AudioVolumeUp:"AudioVolumeUp",WakeUp:"WakeUp"}},91584:function(e,t){"use strict";function r(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=32,n=64,o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._target=null,this._state=127,this._tracked=[],this._ignored=[],this._waitingRelease=!1,this._releaseStart=0,this._longpressTimeoutId=null,this._twoTouchTimeoutId=null,this._boundEventHandler=this._eventHandler.bind(this)}var t,o,s;return t=e,(o=[{key:"attach",value:function(e){this.detach(),this._target=e,this._target.addEventListener("touchstart",this._boundEventHandler),this._target.addEventListener("touchmove",this._boundEventHandler),this._target.addEventListener("touchend",this._boundEventHandler),this._target.addEventListener("touchcancel",this._boundEventHandler)}},{key:"detach",value:function(){this._target&&(this._stopLongpressTimeout(),this._stopTwoTouchTimeout(),this._target.removeEventListener("touchstart",this._boundEventHandler),this._target.removeEventListener("touchmove",this._boundEventHandler),this._target.removeEventListener("touchend",this._boundEventHandler),this._target.removeEventListener("touchcancel",this._boundEventHandler),this._target=null)}},{key:"_eventHandler",value:function(e){var t;switch(e.stopPropagation(),e.preventDefault(),e.type){case"touchstart":t=this._touchStart;break;case"touchmove":t=this._touchMove;break;case"touchend":case"touchcancel":t=this._touchEnd}for(var r=0;r<e.changedTouches.length;r++){var i=e.changedTouches[r];t.call(this,i.identifier,i.clientX,i.clientY)}}},{key:"_touchStart",value:function(e,t,r){if(this._hasDetectedGesture()||0===this._state)this._ignored.push(e);else{if(this._tracked.length>0&&Date.now()-this._tracked[0].started>250)return this._state=0,void this._ignored.push(e);if(this._waitingRelease)return this._state=0,void this._ignored.push(e);switch(this._tracked.push({id:e,started:Date.now(),active:!0,firstX:t,firstY:r,lastX:t,lastY:r,angle:0}),this._tracked.length){case 1:this._startLongpressTimeout();break;case 2:this._state&=-26,this._stopLongpressTimeout();break;case 3:this._state&=-99;break;default:this._state=0}}}},{key:"_touchMove",value:function(e,t,r){var i=this._tracked.find((function(t){return t.id===e}));if(void 0!==i){i.lastX=t,i.lastY=r;var n=t-i.firstX,o=r-i.firstY;if(i.firstX===i.lastX&&i.firstY===i.lastY||(i.angle=180*Math.atan2(o,n)/Math.PI),!this._hasDetectedGesture()){if(Math.hypot(n,o)<50)return;if(this._state&=-24,this._stopLongpressTimeout(),1!==this._tracked.length&&(this._state&=-9),2!==this._tracked.length&&(this._state&=-97),2===this._tracked.length){var s=this._tracked.find((function(t){return t.id!==e}));if(Math.hypot(s.firstX-s.lastX,s.firstY-s.lastY)>50){var a=Math.abs(i.angle-s.angle);a=Math.abs((a+180)%360-180),this._state&=a>90?-33:-65,this._isTwoTouchTimeoutRunning()&&this._stopTwoTouchTimeout()}else this._isTwoTouchTimeoutRunning()||this._startTwoTouchTimeout()}if(!this._hasDetectedGesture())return;this._pushEvent("gesturestart")}this._pushEvent("gesturemove")}}},{key:"_touchEnd",value:function(e,t,r){if(-1!==this._ignored.indexOf(e))return this._ignored.splice(this._ignored.indexOf(e),1),void(0===this._ignored.length&&0===this._tracked.length&&(this._state=127,this._waitingRelease=!1));if(!this._hasDetectedGesture()&&this._isTwoTouchTimeoutRunning()&&(this._stopTwoTouchTimeout(),this._state=0),!this._hasDetectedGesture()&&(this._state&=-105,this._state&=-17,this._stopLongpressTimeout(),!this._waitingRelease))switch(this._releaseStart=Date.now(),this._waitingRelease=!0,this._tracked.length){case 1:this._state&=-7;break;case 2:this._state&=-6}if(this._waitingRelease)if(Date.now()-this._releaseStart>250&&(this._state=0),this._tracked.some((function(e){return Date.now()-e.started>1e3}))&&(this._state=0),this._tracked.find((function(t){return t.id===e})).active=!1,this._hasDetectedGesture())this._pushEvent("gesturestart");else if(0!==this._state)return;this._hasDetectedGesture()&&this._pushEvent("gestureend");for(var i=0;i<this._tracked.length;i++)this._tracked[i].active&&this._ignored.push(this._tracked[i].id);this._tracked=[],this._state=0,-1!==this._ignored.indexOf(e)&&this._ignored.splice(this._ignored.indexOf(e),1),0===this._ignored.length&&(this._state=127,this._waitingRelease=!1)}},{key:"_hasDetectedGesture",value:function(){return!(0===this._state||this._state&this._state-1||7&this._state&&this._tracked.some((function(e){return e.active})))}},{key:"_startLongpressTimeout",value:function(){var e=this;this._stopLongpressTimeout(),this._longpressTimeoutId=setTimeout((function(){return e._longpressTimeout()}),1e3)}},{key:"_stopLongpressTimeout",value:function(){clearTimeout(this._longpressTimeoutId),this._longpressTimeoutId=null}},{key:"_longpressTimeout",value:function(){if(this._hasDetectedGesture())throw new Error("A longpress gesture failed, conflict with a different gesture");this._state=16,this._pushEvent("gesturestart")}},{key:"_startTwoTouchTimeout",value:function(){var e=this;this._stopTwoTouchTimeout(),this._twoTouchTimeoutId=setTimeout((function(){return e._twoTouchTimeout()}),50)}},{key:"_stopTwoTouchTimeout",value:function(){clearTimeout(this._twoTouchTimeoutId),this._twoTouchTimeoutId=null}},{key:"_isTwoTouchTimeoutRunning",value:function(){return null!==this._twoTouchTimeoutId}},{key:"_twoTouchTimeout",value:function(){if(0===this._tracked.length)throw new Error("A pinch or two drag gesture failed, no tracked touches");var e=this._getAverageMovement(),t=Math.abs(e.x),r=Math.abs(e.y),o=this._getAverageDistance(),s=Math.abs(Math.hypot(o.first.x,o.first.y)-Math.hypot(o.last.x,o.last.y));this._state=r<s&&t<s?n:i,this._pushEvent("gesturestart"),this._pushEvent("gesturemove")}},{key:"_pushEvent",value:function(e){var t={type:this._stateToGesture(this._state)},r=this._getPosition(),o=r.last;switch("gesturestart"===e&&(o=r.first),this._state){case i:case n:o=r.first}if(t.clientX=o.x,t.clientY=o.y,this._state===n){var s=this._getAverageDistance();"gesturestart"===e?(t.magnitudeX=s.first.x,t.magnitudeY=s.first.y):(t.magnitudeX=s.last.x,t.magnitudeY=s.last.y)}else if(this._state===i)if("gesturestart"===e)t.magnitudeX=0,t.magnitudeY=0;else{var a=this._getAverageMovement();t.magnitudeX=a.x,t.magnitudeY=a.y}var c=new CustomEvent(e,{detail:t});this._target.dispatchEvent(c)}},{key:"_stateToGesture",value:function(e){switch(e){case 1:return"onetap";case 2:return"twotap";case 4:return"threetap";case 8:return"drag";case 16:return"longpress";case i:return"twodrag";case n:return"pinch"}throw new Error("Unknown gesture state: "+e)}},{key:"_getPosition",value:function(){if(0===this._tracked.length)throw new Error("Failed to get gesture position, no tracked touches");for(var e=this._tracked.length,t=0,r=0,i=0,n=0,o=0;o<this._tracked.length;o++)t+=this._tracked[o].firstX,r+=this._tracked[o].firstY,i+=this._tracked[o].lastX,n+=this._tracked[o].lastY;return{first:{x:t/e,y:r/e},last:{x:i/e,y:n/e}}}},{key:"_getAverageMovement",value:function(){if(0===this._tracked.length)throw new Error("Failed to get gesture movement, no tracked touches");var e,t;e=t=0;for(var r=this._tracked.length,i=0;i<this._tracked.length;i++)e+=this._tracked[i].lastX-this._tracked[i].firstX,t+=this._tracked[i].lastY-this._tracked[i].firstY;return{x:e/r,y:t/r}}},{key:"_getAverageDistance",value:function(){if(0===this._tracked.length)throw new Error("Failed to get gesture distance, no tracked touches");var e=this._tracked[0],t=this._tracked[this._tracked.length-1];return{first:{x:Math.abs(t.firstX-e.firstX),y:Math.abs(t.firstY-e.firstY)},last:{x:Math.abs(t.lastX-e.lastX),y:Math.abs(t.lastY-e.lastY)}}}}])&&r(t.prototype,o),s&&r(t,s),e}();t.default=o},1606:function(e,t,r){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=h(r(50500)),s=r(79420),a=h(r(50556)),c=(n=r(69314))&&n.__esModule?n:{default:n},l=h(r(41895));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function h(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function f(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var d=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._target=t||null,this._keyDownList={},this._pendingKey=null,this._altGrArmed=!1,this._eventHandlers={keyup:this._handleKeyUp.bind(this),keydown:this._handleKeyDown.bind(this),keypress:this._handleKeyPress.bind(this),blur:this._allKeysUp.bind(this),checkalt:this._checkAlt.bind(this)},this.onkeyevent=function(){}}var t,r,i;return t=e,(r=[{key:"_sendKeyEvent",value:function(e,t,r){if(r)this._keyDownList[t]=e;else{if(!(t in this._keyDownList))return;delete this._keyDownList[t]}o.Debug("onkeyevent "+(r?"down":"up")+", keysym: "+e,", code: "+t),this.onkeyevent(e,t,r)}},{key:"_getKeyCode",value:function(e){var t=a.getKeycode(e);if("Unidentified"!==t)return t;if(e.keyCode&&"keypress"!==e.type&&229!==e.keyCode)return"Platform"+e.keyCode;if(e.keyIdentifier){if("U+"!==e.keyIdentifier.substr(0,2))return e.keyIdentifier;var r=parseInt(e.keyIdentifier.substr(2),16);return"Platform"+String.fromCharCode(r).toUpperCase().charCodeAt()}return"Unidentified"}},{key:"_handleKeyDown",value:function(e){var t=this._getKeyCode(e),r=a.getKeysym(e);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),"AltRight"===t&&e.timeStamp-this._altGrCtrlTime<50?r=c.default.XK_ISO_Level3_Shift:this._sendKeyEvent(c.default.XK_Control_L,"ControlLeft",!0)),"Unidentified"===t)return r&&(this._sendKeyEvent(r,t,!0),this._sendKeyEvent(r,t,!1)),void(0,s.stopEvent)(e);if(l.isMac()||l.isIOS())switch(r){case c.default.XK_Super_L:r=c.default.XK_Alt_L;break;case c.default.XK_Super_R:r=c.default.XK_Super_L;break;case c.default.XK_Alt_L:r=c.default.XK_Mode_switch;break;case c.default.XK_Alt_R:r=c.default.XK_ISO_Level3_Shift}return t in this._keyDownList&&(r=this._keyDownList[t]),(l.isMac()||l.isIOS())&&"CapsLock"===t?(this._sendKeyEvent(c.default.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(c.default.XK_Caps_Lock,"CapsLock",!1),void(0,s.stopEvent)(e)):r||e.key&&!l.isIE()&&!l.isEdge()?(this._pendingKey=null,(0,s.stopEvent)(e),"ControlLeft"===t&&l.isWindows()&&!("ControlLeft"in this._keyDownList)?(this._altGrArmed=!0,this._altGrTimeout=setTimeout(this._handleAltGrTimeout.bind(this),100),void(this._altGrCtrlTime=e.timeStamp)):void this._sendKeyEvent(r,t,!0)):(this._pendingKey=t,void setTimeout(this._handleKeyPressTimeout.bind(this),10,e))}},{key:"_handleKeyPress",value:function(e){if((0,s.stopEvent)(e),null!==this._pendingKey){var t=this._getKeyCode(e),r=a.getKeysym(e);"Unidentified"!==t&&t!=this._pendingKey||(t=this._pendingKey,this._pendingKey=null,r?this._sendKeyEvent(r,t,!0):o.Info("keypress with no keysym:",e))}}},{key:"_handleKeyPressTimeout",value:function(e){if(null!==this._pendingKey){var t,r=this._pendingKey;if(this._pendingKey=null,e.keyCode>=48&&e.keyCode<=57)t=e.keyCode;else if(e.keyCode>=65&&e.keyCode<=90){var i=String.fromCharCode(e.keyCode);t=(i=e.shiftKey?i.toUpperCase():i.toLowerCase()).charCodeAt()}else t=0;this._sendKeyEvent(t,r,!0)}}},{key:"_handleKeyUp",value:function(e){(0,s.stopEvent)(e);var t=this._getKeyCode(e);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(c.default.XK_Control_L,"ControlLeft",!0)),(l.isMac()||l.isIOS())&&"CapsLock"===t)return this._sendKeyEvent(c.default.XK_Caps_Lock,"CapsLock",!0),void this._sendKeyEvent(c.default.XK_Caps_Lock,"CapsLock",!1);this._sendKeyEvent(this._keyDownList[t],t,!1),!l.isWindows()||"ShiftLeft"!==t&&"ShiftRight"!==t||("ShiftRight"in this._keyDownList&&this._sendKeyEvent(this._keyDownList.ShiftRight,"ShiftRight",!1),"ShiftLeft"in this._keyDownList&&this._sendKeyEvent(this._keyDownList.ShiftLeft,"ShiftLeft",!1))}},{key:"_handleAltGrTimeout",value:function(){this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(c.default.XK_Control_L,"ControlLeft",!0)}},{key:"_allKeysUp",value:function(){for(var e in o.Debug(">> Keyboard.allKeysUp"),this._keyDownList)this._sendKeyEvent(this._keyDownList[e],e,!1);o.Debug("<< Keyboard.allKeysUp")}},{key:"_checkAlt",value:function(e){if(!e.skipCheckAlt&&!e.altKey){var t=this._target,r=this._keyDownList;["AltLeft","AltRight"].forEach((function(e){if(e in r){var i=new KeyboardEvent("keyup",{key:r[e],code:e});i.skipCheckAlt=!0,t.dispatchEvent(i)}}))}}},{key:"grab",value:function(){if(this._target.addEventListener("keydown",this._eventHandlers.keydown),this._target.addEventListener("keyup",this._eventHandlers.keyup),this._target.addEventListener("keypress",this._eventHandlers.keypress),window.addEventListener("blur",this._eventHandlers.blur),l.isWindows()&&l.isFirefox()){var e=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach((function(t){return document.addEventListener(t,e,{capture:!0,passive:!0})}))}}},{key:"ungrab",value:function(){if(l.isWindows()&&l.isFirefox()){var e=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach((function(t){return document.removeEventListener(t,e)}))}this._target.removeEventListener("keydown",this._eventHandlers.keydown),this._target.removeEventListener("keyup",this._eventHandlers.keyup),this._target.removeEventListener("keypress",this._eventHandlers.keypress),window.removeEventListener("blur",this._eventHandlers.blur),this._allKeysUp()}}])&&f(t.prototype,r),i&&f(t,i),e}();t.default=d},69314:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={XK_VoidSymbol:16777215,XK_BackSpace:65288,XK_Tab:65289,XK_Linefeed:65290,XK_Clear:65291,XK_Return:65293,XK_Pause:65299,XK_Scroll_Lock:65300,XK_Sys_Req:65301,XK_Escape:65307,XK_Delete:65535,XK_Multi_key:65312,XK_Codeinput:65335,XK_SingleCandidate:65340,XK_MultipleCandidate:65341,XK_PreviousCandidate:65342,XK_Kanji:65313,XK_Muhenkan:65314,XK_Henkan_Mode:65315,XK_Henkan:65315,XK_Romaji:65316,XK_Hiragana:65317,XK_Katakana:65318,XK_Hiragana_Katakana:65319,XK_Zenkaku:65320,XK_Hankaku:65321,XK_Zenkaku_Hankaku:65322,XK_Touroku:65323,XK_Massyo:65324,XK_Kana_Lock:65325,XK_Kana_Shift:65326,XK_Eisu_Shift:65327,XK_Eisu_toggle:65328,XK_Kanji_Bangou:65335,XK_Zen_Koho:65341,XK_Mae_Koho:65342,XK_Home:65360,XK_Left:65361,XK_Up:65362,XK_Right:65363,XK_Down:65364,XK_Prior:65365,XK_Page_Up:65365,XK_Next:65366,XK_Page_Down:65366,XK_End:65367,XK_Begin:65368,XK_Select:65376,XK_Print:65377,XK_Execute:65378,XK_Insert:65379,XK_Undo:65381,XK_Redo:65382,XK_Menu:65383,XK_Find:65384,XK_Cancel:65385,XK_Help:65386,XK_Break:65387,XK_Mode_switch:65406,XK_script_switch:65406,XK_Num_Lock:65407,XK_KP_Space:65408,XK_KP_Tab:65417,XK_KP_Enter:65421,XK_KP_F1:65425,XK_KP_F2:65426,XK_KP_F3:65427,XK_KP_F4:65428,XK_KP_Home:65429,XK_KP_Left:65430,XK_KP_Up:65431,XK_KP_Right:65432,XK_KP_Down:65433,XK_KP_Prior:65434,XK_KP_Page_Up:65434,XK_KP_Next:65435,XK_KP_Page_Down:65435,XK_KP_End:65436,XK_KP_Begin:65437,XK_KP_Insert:65438,XK_KP_Delete:65439,XK_KP_Equal:65469,XK_KP_Multiply:65450,XK_KP_Add:65451,XK_KP_Separator:65452,XK_KP_Subtract:65453,XK_KP_Decimal:65454,XK_KP_Divide:65455,XK_KP_0:65456,XK_KP_1:65457,XK_KP_2:65458,XK_KP_3:65459,XK_KP_4:65460,XK_KP_5:65461,XK_KP_6:65462,XK_KP_7:65463,XK_KP_8:65464,XK_KP_9:65465,XK_F1:65470,XK_F2:65471,XK_F3:65472,XK_F4:65473,XK_F5:65474,XK_F6:65475,XK_F7:65476,XK_F8:65477,XK_F9:65478,XK_F10:65479,XK_F11:65480,XK_L1:65480,XK_F12:65481,XK_L2:65481,XK_F13:65482,XK_L3:65482,XK_F14:65483,XK_L4:65483,XK_F15:65484,XK_L5:65484,XK_F16:65485,XK_L6:65485,XK_F17:65486,XK_L7:65486,XK_F18:65487,XK_L8:65487,XK_F19:65488,XK_L9:65488,XK_F20:65489,XK_L10:65489,XK_F21:65490,XK_R1:65490,XK_F22:65491,XK_R2:65491,XK_F23:65492,XK_R3:65492,XK_F24:65493,XK_R4:65493,XK_F25:65494,XK_R5:65494,XK_F26:65495,XK_R6:65495,XK_F27:65496,XK_R7:65496,XK_F28:65497,XK_R8:65497,XK_F29:65498,XK_R9:65498,XK_F30:65499,XK_R10:65499,XK_F31:65500,XK_R11:65500,XK_F32:65501,XK_R12:65501,XK_F33:65502,XK_R13:65502,XK_F34:65503,XK_R14:65503,XK_F35:65504,XK_R15:65504,XK_Shift_L:65505,XK_Shift_R:65506,XK_Control_L:65507,XK_Control_R:65508,XK_Caps_Lock:65509,XK_Shift_Lock:65510,XK_Meta_L:65511,XK_Meta_R:65512,XK_Alt_L:65513,XK_Alt_R:65514,XK_Super_L:65515,XK_Super_R:65516,XK_Hyper_L:65517,XK_Hyper_R:65518,XK_ISO_Level3_Shift:65027,XK_ISO_Next_Group:65032,XK_ISO_Prev_Group:65034,XK_ISO_First_Group:65036,XK_ISO_Last_Group:65038,XK_space:32,XK_exclam:33,XK_quotedbl:34,XK_numbersign:35,XK_dollar:36,XK_percent:37,XK_ampersand:38,XK_apostrophe:39,XK_quoteright:39,XK_parenleft:40,XK_parenright:41,XK_asterisk:42,XK_plus:43,XK_comma:44,XK_minus:45,XK_period:46,XK_slash:47,XK_0:48,XK_1:49,XK_2:50,XK_3:51,XK_4:52,XK_5:53,XK_6:54,XK_7:55,XK_8:56,XK_9:57,XK_colon:58,XK_semicolon:59,XK_less:60,XK_equal:61,XK_greater:62,XK_question:63,XK_at:64,XK_A:65,XK_B:66,XK_C:67,XK_D:68,XK_E:69,XK_F:70,XK_G:71,XK_H:72,XK_I:73,XK_J:74,XK_K:75,XK_L:76,XK_M:77,XK_N:78,XK_O:79,XK_P:80,XK_Q:81,XK_R:82,XK_S:83,XK_T:84,XK_U:85,XK_V:86,XK_W:87,XK_X:88,XK_Y:89,XK_Z:90,XK_bracketleft:91,XK_backslash:92,XK_bracketright:93,XK_asciicircum:94,XK_underscore:95,XK_grave:96,XK_quoteleft:96,XK_a:97,XK_b:98,XK_c:99,XK_d:100,XK_e:101,XK_f:102,XK_g:103,XK_h:104,XK_i:105,XK_j:106,XK_k:107,XK_l:108,XK_m:109,XK_n:110,XK_o:111,XK_p:112,XK_q:113,XK_r:114,XK_s:115,XK_t:116,XK_u:117,XK_v:118,XK_w:119,XK_x:120,XK_y:121,XK_z:122,XK_braceleft:123,XK_bar:124,XK_braceright:125,XK_asciitilde:126,XK_nobreakspace:160,XK_exclamdown:161,XK_cent:162,XK_sterling:163,XK_currency:164,XK_yen:165,XK_brokenbar:166,XK_section:167,XK_diaeresis:168,XK_copyright:169,XK_ordfeminine:170,XK_guillemotleft:171,XK_notsign:172,XK_hyphen:173,XK_registered:174,XK_macron:175,XK_degree:176,XK_plusminus:177,XK_twosuperior:178,XK_threesuperior:179,XK_acute:180,XK_mu:181,XK_paragraph:182,XK_periodcentered:183,XK_cedilla:184,XK_onesuperior:185,XK_masculine:186,XK_guillemotright:187,XK_onequarter:188,XK_onehalf:189,XK_threequarters:190,XK_questiondown:191,XK_Agrave:192,XK_Aacute:193,XK_Acircumflex:194,XK_Atilde:195,XK_Adiaeresis:196,XK_Aring:197,XK_AE:198,XK_Ccedilla:199,XK_Egrave:200,XK_Eacute:201,XK_Ecircumflex:202,XK_Ediaeresis:203,XK_Igrave:204,XK_Iacute:205,XK_Icircumflex:206,XK_Idiaeresis:207,XK_ETH:208,XK_Eth:208,XK_Ntilde:209,XK_Ograve:210,XK_Oacute:211,XK_Ocircumflex:212,XK_Otilde:213,XK_Odiaeresis:214,XK_multiply:215,XK_Oslash:216,XK_Ooblique:216,XK_Ugrave:217,XK_Uacute:218,XK_Ucircumflex:219,XK_Udiaeresis:220,XK_Yacute:221,XK_THORN:222,XK_Thorn:222,XK_ssharp:223,XK_agrave:224,XK_aacute:225,XK_acircumflex:226,XK_atilde:227,XK_adiaeresis:228,XK_aring:229,XK_ae:230,XK_ccedilla:231,XK_egrave:232,XK_eacute:233,XK_ecircumflex:234,XK_ediaeresis:235,XK_igrave:236,XK_iacute:237,XK_icircumflex:238,XK_idiaeresis:239,XK_eth:240,XK_ntilde:241,XK_ograve:242,XK_oacute:243,XK_ocircumflex:244,XK_otilde:245,XK_odiaeresis:246,XK_division:247,XK_oslash:248,XK_ooblique:248,XK_ugrave:249,XK_uacute:250,XK_ucircumflex:251,XK_udiaeresis:252,XK_yacute:253,XK_thorn:254,XK_ydiaeresis:255,XK_Hangul:65329,XK_Hangul_Hanja:65332,XK_Hangul_Jeonja:65336,XF86XK_ModeLock:269025025,XF86XK_MonBrightnessUp:269025026,XF86XK_MonBrightnessDown:269025027,XF86XK_KbdLightOnOff:269025028,XF86XK_KbdBrightnessUp:269025029,XF86XK_KbdBrightnessDown:269025030,XF86XK_Standby:269025040,XF86XK_AudioLowerVolume:269025041,XF86XK_AudioMute:269025042,XF86XK_AudioRaiseVolume:269025043,XF86XK_AudioPlay:269025044,XF86XK_AudioStop:269025045,XF86XK_AudioPrev:269025046,XF86XK_AudioNext:269025047,XF86XK_HomePage:269025048,XF86XK_Mail:269025049,XF86XK_Start:269025050,XF86XK_Search:269025051,XF86XK_AudioRecord:269025052,XF86XK_Calculator:269025053,XF86XK_Memo:269025054,XF86XK_ToDoList:269025055,XF86XK_Calendar:269025056,XF86XK_PowerDown:269025057,XF86XK_ContrastAdjust:269025058,XF86XK_RockerUp:269025059,XF86XK_RockerDown:269025060,XF86XK_RockerEnter:269025061,XF86XK_Back:269025062,XF86XK_Forward:269025063,XF86XK_Stop:269025064,XF86XK_Refresh:269025065,XF86XK_PowerOff:269025066,XF86XK_WakeUp:269025067,XF86XK_Eject:269025068,XF86XK_ScreenSaver:269025069,XF86XK_WWW:269025070,XF86XK_Sleep:269025071,XF86XK_Favorites:269025072,XF86XK_AudioPause:269025073,XF86XK_AudioMedia:269025074,XF86XK_MyComputer:269025075,XF86XK_VendorHome:269025076,XF86XK_LightBulb:269025077,XF86XK_Shop:269025078,XF86XK_History:269025079,XF86XK_OpenURL:269025080,XF86XK_AddFavorite:269025081,XF86XK_HotLinks:269025082,XF86XK_BrightnessAdjust:269025083,XF86XK_Finance:269025084,XF86XK_Community:269025085,XF86XK_AudioRewind:269025086,XF86XK_BackForward:269025087,XF86XK_Launch0:269025088,XF86XK_Launch1:269025089,XF86XK_Launch2:269025090,XF86XK_Launch3:269025091,XF86XK_Launch4:269025092,XF86XK_Launch5:269025093,XF86XK_Launch6:269025094,XF86XK_Launch7:269025095,XF86XK_Launch8:269025096,XF86XK_Launch9:269025097,XF86XK_LaunchA:269025098,XF86XK_LaunchB:269025099,XF86XK_LaunchC:269025100,XF86XK_LaunchD:269025101,XF86XK_LaunchE:269025102,XF86XK_LaunchF:269025103,XF86XK_ApplicationLeft:269025104,XF86XK_ApplicationRight:269025105,XF86XK_Book:269025106,XF86XK_CD:269025107,XF86XK_Calculater:269025108,XF86XK_Clear:269025109,XF86XK_Close:269025110,XF86XK_Copy:269025111,XF86XK_Cut:269025112,XF86XK_Display:269025113,XF86XK_DOS:269025114,XF86XK_Documents:269025115,XF86XK_Excel:269025116,XF86XK_Explorer:269025117,XF86XK_Game:269025118,XF86XK_Go:269025119,XF86XK_iTouch:269025120,XF86XK_LogOff:269025121,XF86XK_Market:269025122,XF86XK_Meeting:269025123,XF86XK_MenuKB:269025125,XF86XK_MenuPB:269025126,XF86XK_MySites:269025127,XF86XK_New:269025128,XF86XK_News:269025129,XF86XK_OfficeHome:269025130,XF86XK_Open:269025131,XF86XK_Option:269025132,XF86XK_Paste:269025133,XF86XK_Phone:269025134,XF86XK_Q:269025136,XF86XK_Reply:269025138,XF86XK_Reload:269025139,XF86XK_RotateWindows:269025140,XF86XK_RotationPB:269025141,XF86XK_RotationKB:269025142,XF86XK_Save:269025143,XF86XK_ScrollUp:269025144,XF86XK_ScrollDown:269025145,XF86XK_ScrollClick:269025146,XF86XK_Send:269025147,XF86XK_Spell:269025148,XF86XK_SplitScreen:269025149,XF86XK_Support:269025150,XF86XK_TaskPane:269025151,XF86XK_Terminal:269025152,XF86XK_Tools:269025153,XF86XK_Travel:269025154,XF86XK_UserPB:269025156,XF86XK_User1KB:269025157,XF86XK_User2KB:269025158,XF86XK_Video:269025159,XF86XK_WheelButton:269025160,XF86XK_Word:269025161,XF86XK_Xfer:269025162,XF86XK_ZoomIn:269025163,XF86XK_ZoomOut:269025164,XF86XK_Away:269025165,XF86XK_Messenger:269025166,XF86XK_WebCam:269025167,XF86XK_MailForward:269025168,XF86XK_Pictures:269025169,XF86XK_Music:269025170,XF86XK_Battery:269025171,XF86XK_Bluetooth:269025172,XF86XK_WLAN:269025173,XF86XK_UWB:269025174,XF86XK_AudioForward:269025175,XF86XK_AudioRepeat:269025176,XF86XK_AudioRandomPlay:269025177,XF86XK_Subtitle:269025178,XF86XK_AudioCycleTrack:269025179,XF86XK_CycleAngle:269025180,XF86XK_FrameBack:269025181,XF86XK_FrameForward:269025182,XF86XK_Time:269025183,XF86XK_Select:269025184,XF86XK_View:269025185,XF86XK_TopMenu:269025186,XF86XK_Red:269025187,XF86XK_Green:269025188,XF86XK_Yellow:269025189,XF86XK_Blue:269025190,XF86XK_Suspend:269025191,XF86XK_Hibernate:269025192,XF86XK_TouchpadToggle:269025193,XF86XK_TouchpadOn:269025200,XF86XK_TouchpadOff:269025201,XF86XK_AudioMicMute:269025202,XF86XK_Switch_VT_1:269024769,XF86XK_Switch_VT_2:269024770,XF86XK_Switch_VT_3:269024771,XF86XK_Switch_VT_4:269024772,XF86XK_Switch_VT_5:269024773,XF86XK_Switch_VT_6:269024774,XF86XK_Switch_VT_7:269024775,XF86XK_Switch_VT_8:269024776,XF86XK_Switch_VT_9:269024777,XF86XK_Switch_VT_10:269024778,XF86XK_Switch_VT_11:269024779,XF86XK_Switch_VT_12:269024780,XF86XK_Ungrab:269024800,XF86XK_ClearGrab:269024801,XF86XK_Next_VMode:269024802,XF86XK_Prev_VMode:269024803,XF86XK_LogWindowTree:269024804,XF86XK_LogGrabInfo:269024805}},44836:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={256:960,257:992,258:451,259:483,260:417,261:433,262:454,263:486,264:710,265:742,266:709,267:741,268:456,269:488,270:463,271:495,272:464,273:496,274:938,275:954,278:972,279:1004,280:458,281:490,282:460,283:492,284:728,285:760,286:683,287:699,288:725,289:757,290:939,291:955,292:678,293:694,294:673,295:689,296:933,297:949,298:975,299:1007,302:967,303:999,304:681,305:697,308:684,309:700,310:979,311:1011,312:930,313:453,314:485,315:934,316:950,317:421,318:437,321:419,322:435,323:465,324:497,325:977,326:1009,327:466,328:498,330:957,331:959,332:978,333:1010,336:469,337:501,338:5052,339:5053,340:448,341:480,342:931,343:947,344:472,345:504,346:422,347:438,348:734,349:766,350:426,351:442,352:425,353:441,354:478,355:510,356:427,357:443,358:940,359:956,360:989,361:1021,362:990,363:1022,364:733,365:765,366:473,367:505,368:475,369:507,370:985,371:1017,376:5054,377:428,378:444,379:431,380:447,381:430,382:446,402:2294,466:16777681,711:439,728:418,729:511,731:434,733:445,901:1966,902:1953,904:1954,905:1955,906:1956,908:1959,910:1960,911:1963,912:1974,913:1985,914:1986,915:1987,916:1988,917:1989,918:1990,919:1991,920:1992,921:1993,922:1994,923:1995,924:1996,925:1997,926:1998,927:1999,928:2e3,929:2001,931:2002,932:2004,933:2005,934:2006,935:2007,936:2008,937:2009,938:1957,939:1961,940:1969,941:1970,942:1971,943:1972,944:1978,945:2017,946:2018,947:2019,948:2020,949:2021,950:2022,951:2023,952:2024,953:2025,954:2026,955:2027,956:2028,957:2029,958:2030,959:2031,960:2032,961:2033,962:2035,963:2034,964:2036,965:2037,966:2038,967:2039,968:2040,969:2041,970:1973,971:1977,972:1975,973:1976,974:1979,1025:1715,1026:1713,1027:1714,1028:1716,1029:1717,1030:1718,1031:1719,1032:1720,1033:1721,1034:1722,1035:1723,1036:1724,1038:1726,1039:1727,1040:1761,1041:1762,1042:1783,1043:1767,1044:1764,1045:1765,1046:1782,1047:1786,1048:1769,1049:1770,1050:1771,1051:1772,1052:1773,1053:1774,1054:1775,1055:1776,1056:1778,1057:1779,1058:1780,1059:1781,1060:1766,1061:1768,1062:1763,1063:1790,1064:1787,1065:1789,1066:1791,1067:1785,1068:1784,1069:1788,1070:1760,1071:1777,1072:1729,1073:1730,1074:1751,1075:1735,1076:1732,1077:1733,1078:1750,1079:1754,1080:1737,1081:1738,1082:1739,1083:1740,1084:1741,1085:1742,1086:1743,1087:1744,1088:1746,1089:1747,1090:1748,1091:1749,1092:1734,1093:1736,1094:1731,1095:1758,1096:1755,1097:1757,1098:1759,1099:1753,1100:1752,1101:1756,1102:1728,1103:1745,1105:1699,1106:1697,1107:1698,1108:1700,1109:1701,1110:1702,1111:1703,1112:1704,1113:1705,1114:1706,1115:1707,1116:1708,1118:1710,1119:1711,1168:1725,1169:1709,1488:3296,1489:3297,1490:3298,1491:3299,1492:3300,1493:3301,1494:3302,1495:3303,1496:3304,1497:3305,1498:3306,1499:3307,1500:3308,1501:3309,1502:3310,1503:3311,1504:3312,1505:3313,1506:3314,1507:3315,1508:3316,1509:3317,1510:3318,1511:3319,1512:3320,1513:3321,1514:3322,1548:1452,1563:1467,1567:1471,1569:1473,1570:1474,1571:1475,1572:1476,1573:1477,1574:1478,1575:1479,1576:1480,1577:1481,1578:1482,1579:1483,1580:1484,1581:1485,1582:1486,1583:1487,1584:1488,1585:1489,1586:1490,1587:1491,1588:1492,1589:1493,1590:1494,1591:1495,1592:1496,1593:1497,1594:1498,1600:1504,1601:1505,1602:1506,1603:1507,1604:1508,1605:1509,1606:1510,1607:1511,1608:1512,1609:1513,1610:1514,1611:1515,1612:1516,1613:1517,1614:1518,1615:1519,1616:1520,1617:1521,1618:1522,3585:3489,3586:3490,3587:3491,3588:3492,3589:3493,3590:3494,3591:3495,3592:3496,3593:3497,3594:3498,3595:3499,3596:3500,3597:3501,3598:3502,3599:3503,3600:3504,3601:3505,3602:3506,3603:3507,3604:3508,3605:3509,3606:3510,3607:3511,3608:3512,3609:3513,3610:3514,3611:3515,3612:3516,3613:3517,3614:3518,3615:3519,3616:3520,3617:3521,3618:3522,3619:3523,3620:3524,3621:3525,3622:3526,3623:3527,3624:3528,3625:3529,3626:3530,3627:3531,3628:3532,3629:3533,3630:3534,3631:3535,3632:3536,3633:3537,3634:3538,3635:3539,3636:3540,3637:3541,3638:3542,3639:3543,3640:3544,3641:3545,3642:3546,3647:3551,3648:3552,3649:3553,3650:3554,3651:3555,3652:3556,3653:3557,3654:3558,3655:3559,3656:3560,3657:3561,3658:3562,3659:3563,3660:3564,3661:3565,3664:3568,3665:3569,3666:3570,3667:3571,3668:3572,3669:3573,3670:3574,3671:3575,3672:3576,3673:3577,8194:2722,8195:2721,8196:2723,8197:2724,8199:2725,8200:2726,8201:2727,8202:2728,8210:2747,8211:2730,8212:2729,8213:1967,8215:3295,8216:2768,8217:2769,8218:2813,8220:2770,8221:2771,8222:2814,8224:2801,8225:2802,8226:2790,8229:2735,8230:2734,8240:2773,8242:2774,8243:2775,8248:2812,8254:1150,8361:3839,8364:8364,8453:2744,8470:1712,8471:2811,8478:2772,8482:2761,8531:2736,8532:2737,8533:2738,8534:2739,8535:2740,8536:2741,8537:2742,8538:2743,8539:2755,8540:2756,8541:2757,8542:2758,8592:2299,8593:2300,8594:2301,8595:2302,8658:2254,8660:2253,8706:2287,8711:2245,8728:3018,8730:2262,8733:2241,8734:2242,8743:2270,8744:2271,8745:2268,8746:2269,8747:2239,8756:2240,8764:2248,8771:2249,8773:16785992,8800:2237,8801:2255,8804:2236,8805:2238,8834:2266,8835:2267,8866:3068,8867:3036,8868:3010,8869:3022,8968:3027,8970:3012,8981:2810,8992:2212,8993:2213,9109:3020,9115:2219,9117:2220,9118:2221,9120:2222,9121:2215,9123:2216,9124:2217,9126:2218,9128:2223,9132:2224,9143:2209,9146:2543,9147:2544,9148:2546,9149:2547,9225:2530,9226:2533,9227:2537,9228:2531,9229:2532,9251:2732,9252:2536,9472:2211,9474:2214,9484:2210,9488:2539,9492:2541,9496:2538,9500:2548,9508:2549,9516:2551,9524:2550,9532:2542,9618:2529,9642:2791,9643:2785,9644:2779,9645:2786,9646:2783,9647:2767,9650:2792,9651:2787,9654:2781,9655:2765,9660:2793,9661:2788,9664:2780,9665:2764,9670:2528,9675:2766,9679:2782,9702:2784,9734:2789,9742:2809,9747:2762,9756:2794,9758:2795,9792:2808,9794:2807,9827:2796,9829:2798,9830:2797,9837:2806,9839:2805,10003:2803,10007:2804,10013:2777,10016:2800,10216:2748,10217:2750,12289:1188,12290:1185,12300:1186,12301:1187,12443:1246,12444:1247,12449:1191,12450:1201,12451:1192,12452:1202,12453:1193,12454:1203,12455:1194,12456:1204,12457:1195,12458:1205,12459:1206,12461:1207,12463:1208,12465:1209,12467:1210,12469:1211,12471:1212,12473:1213,12475:1214,12477:1215,12479:1216,12481:1217,12483:1199,12484:1218,12486:1219,12488:1220,12490:1221,12491:1222,12492:1223,12493:1224,12494:1225,12495:1226,12498:1227,12501:1228,12504:1229,12507:1230,12510:1231,12511:1232,12512:1233,12513:1234,12514:1235,12515:1196,12516:1236,12517:1197,12518:1237,12519:1198,12520:1238,12521:1239,12522:1240,12523:1241,12524:1242,12525:1243,12527:1244,12530:1190,12531:1245,12539:1189,12540:1200},i={lookup:function(e){if(e>=32&&e<=255)return e;var t=r[e];return void 0!==t?t:16777216|e}};t.default=i},50556:function(e,t,r){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.getKeycode=f,t.getKey=d,t.getKeysym=function(e){var t=d(e);if("Unidentified"===t)return null;if(t in c.default){var r=e.location;if("Meta"===t&&0===r&&(r=2),"Clear"===t&&3===r)"NumLock"===f(e)&&(r=0);if((void 0===r||r>3)&&(r=0),"Meta"===t){var i=f(e);if("AltLeft"===i)return n.default.XK_Meta_L;if("AltRight"===i)return n.default.XK_Meta_R}if("Clear"===t)if("NumLock"===f(e))return n.default.XK_Num_Lock;return c.default[t][r]}if(1!==t.length)return null;var s=t.charCodeAt();if(s)return o.default.lookup(s);return null};var n=h(r(69314)),o=h(r(44836)),s=h(r(88193)),a=h(r(15311)),c=h(r(18280)),l=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r(41895));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function h(e){return e&&e.__esModule?e:{default:e}}function f(e){if(e.code){switch(e.code){case"OSLeft":return"MetaLeft";case"OSRight":return"MetaRight"}return e.code}if("keypress"!==e.type&&e.keyCode in s.default){var t=s.default[e.keyCode];if(l.isMac()&&"ContextMenu"===t&&(t="MetaRight"),2===e.location)switch(t){case"ShiftLeft":return"ShiftRight";case"ControlLeft":return"ControlRight";case"AltLeft":return"AltRight"}if(3===e.location)switch(t){case"Delete":return"NumpadDecimal";case"Insert":return"Numpad0";case"End":return"Numpad1";case"ArrowDown":return"Numpad2";case"PageDown":return"Numpad3";case"ArrowLeft":return"Numpad4";case"ArrowRight":return"Numpad6";case"Home":return"Numpad7";case"ArrowUp":return"Numpad8";case"PageUp":return"Numpad9";case"Enter":return"NumpadEnter"}return t}return"Unidentified"}function d(e){if(void 0!==e.key){switch(e.key){case"Spacebar":return" ";case"Esc":return"Escape";case"Scroll":return"ScrollLock";case"Win":return"Meta";case"Apps":return"ContextMenu";case"Up":return"ArrowUp";case"Left":return"ArrowLeft";case"Right":return"ArrowRight";case"Down":return"ArrowDown";case"Del":return"Delete";case"Divide":return"/";case"Multiply":return"*";case"Subtract":return"-";case"Add":return"+";case"Decimal":return e.char}switch(e.key){case"OS":return"Meta";case"LaunchMyComputer":return"LaunchApplication1";case"LaunchCalculator":return"LaunchApplication2"}switch(e.key){case"UIKeyInputUpArrow":return"ArrowUp";case"UIKeyInputDownArrow":return"ArrowDown";case"UIKeyInputLeftArrow":return"ArrowLeft";case"UIKeyInputRightArrow":return"ArrowRight";case"UIKeyInputEscape":return"Escape"}if("\0"===e.key&&"NumpadDecimal"===e.code)return"Delete";if(!l.isIE()&&!l.isEdge())return e.key;if(1!==e.key.length&&"Unidentified"!==e.key)return e.key}var t=f(e);return t in a.default?a.default[t]:e.charCode?String.fromCharCode(e.charCode):"Unidentified"}},88193:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={8:"Backspace",9:"Tab",10:"NumpadClear",12:"Numpad5",13:"Enter",16:"ShiftLeft",17:"ControlLeft",18:"AltLeft",19:"Pause",20:"CapsLock",21:"Lang1",25:"Lang2",27:"Escape",28:"Convert",29:"NonConvert",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",41:"Select",44:"PrintScreen",45:"Insert",46:"Delete",47:"Help",48:"Digit0",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",91:"MetaLeft",92:"MetaRight",93:"ContextMenu",95:"Sleep",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",106:"NumpadMultiply",107:"NumpadAdd",108:"NumpadDecimal",109:"NumpadSubtract",110:"NumpadDecimal",111:"NumpadDivide",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",124:"F13",125:"F14",126:"F15",127:"F16",128:"F17",129:"F18",130:"F19",131:"F20",132:"F21",133:"F22",134:"F23",135:"F24",144:"NumLock",145:"ScrollLock",166:"BrowserBack",167:"BrowserForward",168:"BrowserRefresh",169:"BrowserStop",170:"BrowserSearch",171:"BrowserFavorites",172:"BrowserHome",173:"AudioVolumeMute",174:"AudioVolumeDown",175:"AudioVolumeUp",176:"MediaTrackNext",177:"MediaTrackPrevious",178:"MediaStop",179:"MediaPlayPause",180:"LaunchMail",181:"MediaSelect",182:"LaunchApp1",183:"LaunchApp2",225:"AltRight"}},87619:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={Again:57349,AltLeft:56,AltRight:57400,ArrowDown:57424,ArrowLeft:57419,ArrowRight:57421,ArrowUp:57416,AudioVolumeDown:57390,AudioVolumeMute:57376,AudioVolumeUp:57392,Backquote:41,Backslash:43,Backspace:14,BracketLeft:26,BracketRight:27,BrowserBack:57450,BrowserFavorites:57446,BrowserForward:57449,BrowserHome:57394,BrowserRefresh:57447,BrowserSearch:57445,BrowserStop:57448,CapsLock:58,Comma:51,ContextMenu:57437,ControlLeft:29,ControlRight:57373,Convert:121,Copy:57464,Cut:57404,Delete:57427,Digit0:11,Digit1:2,Digit2:3,Digit3:4,Digit4:5,Digit5:6,Digit6:7,Digit7:8,Digit8:9,Digit9:10,Eject:57469,End:57423,Enter:28,Equal:13,Escape:1,F1:59,F10:68,F11:87,F12:88,F13:93,F14:94,F15:95,F16:85,F17:57347,F18:57463,F19:57348,F2:60,F20:90,F21:116,F22:57465,F23:109,F24:111,F3:61,F4:62,F5:63,F6:64,F7:65,F8:66,F9:67,Find:57409,Help:57461,Hiragana:119,Home:57415,Insert:57426,IntlBackslash:86,IntlRo:115,IntlYen:125,KanaMode:112,Katakana:120,KeyA:30,KeyB:48,KeyC:46,KeyD:32,KeyE:18,KeyF:33,KeyG:34,KeyH:35,KeyI:23,KeyJ:36,KeyK:37,KeyL:38,KeyM:50,KeyN:49,KeyO:24,KeyP:25,KeyQ:16,KeyR:19,KeyS:31,KeyT:20,KeyU:22,KeyV:47,KeyW:17,KeyX:45,KeyY:21,KeyZ:44,Lang3:120,Lang4:119,Lang5:118,LaunchApp1:57451,LaunchApp2:57377,LaunchMail:57452,MediaPlayPause:57378,MediaSelect:57453,MediaStop:57380,MediaTrackNext:57369,MediaTrackPrevious:57360,MetaLeft:57435,MetaRight:57436,Minus:12,NonConvert:123,NumLock:69,Numpad0:82,Numpad1:79,Numpad2:80,Numpad3:81,Numpad4:75,Numpad5:76,Numpad6:77,Numpad7:71,Numpad8:72,Numpad9:73,NumpadAdd:78,NumpadComma:126,NumpadDecimal:83,NumpadDivide:57397,NumpadEnter:57372,NumpadEqual:89,NumpadMultiply:55,NumpadParenLeft:57462,NumpadParenRight:57467,NumpadSubtract:74,Open:100,PageDown:57425,PageUp:57417,Paste:101,Pause:57414,Period:52,Power:57438,PrintScreen:84,Props:57350,Quote:40,ScrollLock:70,Semicolon:39,ShiftLeft:42,ShiftRight:54,Slash:53,Sleep:57439,Space:57,Suspend:57381,Tab:15,Undo:57351,WakeUp:57443}},62013:function(e,t,r){"use strict";t.Z=void 0;var i=r(20860),n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==R(e)&&"function"!=typeof e)return{default:e};var t=A();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r(50500)),o=r(31516),s=r(41895),a=r(92742),c=r(79420),l=L(r(5004)),u=L(r(22814)),h=L(r(48831)),f=L(r(17834)),d=L(r(1606)),_=L(r(91584)),p=L(r(54641)),v=L(r(16327)),g=L(r(64966)),y=L(r(69314)),m=L(r(87619)),b=r(31729);r(21882);var w=L(r(11231)),S=L(r(17852)),C=L(r(57507)),k=L(r(18330)),E=L(r(21330)),x=L(r(91649));function L(e){return e&&e.__esModule?e:{default:e}}function A(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return A=function(){return e},e}function R(e){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R(e)}function M(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function T(e,t){return T=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},T(e,t)}function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=X(e);if(t){var n=X(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return P(this,r)}}function P(e,t){return!t||"object"!==R(t)&&"function"!=typeof t?O(e):t}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function X(e){return X=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},X(e)}var F=50,K=1<<24,I=1<<25,B=1<<26,H=1<<27,j=1<<28,U=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&T(e,t)}(L,e);var t,r,l,f=D(L);function L(e,t,r){var i;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,L),!e)throw new Error("Must specify target");if(!t)throw new Error("Must specify URL");(i=f.call(this))._target=e,i._url=t,r=r||{},i._rfbCredentials=r.credentials||{},i._shared=!("shared"in r)||!!r.shared,i._repeaterID=r.repeaterID||"",i._wsProtocols=r.wsProtocols||[],i._rfbConnectionState="",i._rfbInitState="",i._rfbAuthScheme=-1,i._rfbCleanDisconnect=!0,i._rfbVersion=0,i._rfbMaxVersion=3.8,i._rfbTightVNC=!1,i._rfbVeNCryptState=0,i._rfbXvpVer=0,i._fbWidth=0,i._fbHeight=0,i._fbName="",i._capabilities={power:!1},i._supportsFence=!1,i._supportsContinuousUpdates=!1,i._enabledContinuousUpdates=!1,i._supportsSetDesktopSize=!1,i._screenID=0,i._screenFlags=0,i._qemuExtKeyEventSupported=!1,i._clipboardText=null,i._clipboardServerCapabilitiesActions={},i._clipboardServerCapabilitiesFormats={},i._sock=null,i._display=null,i._flushing=!1,i._keyboard=null,i._gestures=null,i._disconnTimer=null,i._resizeTimeout=null,i._mouseMoveTimer=null,i._decoders={},i._FBU={rects:0,x:0,y:0,width:0,height:0,encoding:null},i._mousePos={},i._mouseButtonMask=0,i._mouseLastMoveTime=0,i._viewportDragging=!1,i._viewportDragPos={},i._viewportHasMoved=!1,i._accumulatedWheelDeltaX=0,i._accumulatedWheelDeltaY=0,i._gestureLastTapTime=null,i._gestureFirstDoubleTapEv=null,i._gestureLastMagnitudeX=0,i._gestureLastMagnitudeY=0,i._eventHandlers={focusCanvas:i._focusCanvas.bind(O(i)),windowResize:i._windowResize.bind(O(i)),handleMouse:i._handleMouse.bind(O(i)),handleWheel:i._handleWheel.bind(O(i)),handleGesture:i._handleGesture.bind(O(i))},n.Debug(">> RFB.constructor"),i._screen=document.createElement("div"),i._screen.style.display="flex",i._screen.style.width="100%",i._screen.style.height="100%",i._screen.style.overflow="auto",i._screen.style.background="rgb(40, 40, 40)",i._canvas=document.createElement("canvas"),i._canvas.style.margin="auto",i._canvas.style.outline="none",i._canvas.style.flexShrink="0",i._canvas.width=0,i._canvas.height=0,i._canvas.tabIndex=-1,i._screen.appendChild(i._canvas),i._cursor=new p.default,i._cursorImage=L.cursors.none,i._decoders[b.encodings.encodingRaw]=new w.default,i._decoders[b.encodings.encodingCopyRect]=new S.default,i._decoders[b.encodings.encodingRRE]=new C.default,i._decoders[b.encodings.encodingHextile]=new k.default,i._decoders[b.encodings.encodingTight]=new E.default,i._decoders[b.encodings.encodingTightPNG]=new x.default;try{i._display=new u.default(i._canvas)}catch(e){throw n.Error("Display exception: "+e),e}return i._display.onflush=i._onFlush.bind(O(i)),i._keyboard=new d.default(i._canvas),i._keyboard.onkeyevent=i._handleKeyEvent.bind(O(i)),i._gestures=new _.default,i._sock=new v.default,i._sock.on("message",(function(){i._handleMessage()})),i._sock.on("open",(function(){"connecting"===i._rfbConnectionState&&""===i._rfbInitState?(i._rfbInitState="ProtocolVersion",n.Debug("Starting VNC handshake")):i._fail("Unexpected server connection while "+i._rfbConnectionState)})),i._sock.on("close",(function(e){n.Debug("WebSocket on-close event");var t="";switch(e.code&&(t="(code: "+e.code,e.reason&&(t+=", reason: "+e.reason),t+=")"),i._rfbConnectionState){case"connecting":i._fail("Connection closed "+t);break;case"connected":i._updateConnectionState("disconnecting"),i._updateConnectionState("disconnected");break;case"disconnecting":i._updateConnectionState("disconnected");break;case"disconnected":i._fail("Unexpected server disconnect when already disconnected "+t);break;default:i._fail("Unexpected server disconnect before connecting "+t)}i._sock.off("close")})),i._sock.on("error",(function(e){return n.Warn("WebSocket on-error event")})),setTimeout(i._updateConnectionState.bind(O(i),"connecting")),n.Debug("<< RFB.constructor"),i.dragViewport=!1,i.focusOnClick=!0,i._viewOnly=!1,i._clipViewport=!1,i._scaleViewport=!1,i._resizeSession=!1,i._showDotCursor=!1,void 0!==r.showDotCursor&&(n.Warn("Specifying showDotCursor as a RFB constructor argument is deprecated"),i._showDotCursor=r.showDotCursor),i._qualityLevel=6,i._compressionLevel=2,i}return t=L,l=[{key:"genDES",value:function(e,t){var r=e.split("").map((function(e){return e.charCodeAt(0)}));return new g.default(r).encrypt(t)}}],(r=[{key:"disconnect",value:function(){this._updateConnectionState("disconnecting"),this._sock.off("error"),this._sock.off("message"),this._sock.off("open")}},{key:"sendCredentials",value:function(e){this._rfbCredentials=e,setTimeout(this._initMsg.bind(this),0)}},{key:"sendCtrlAltDel",value:function(){"connected"!==this._rfbConnectionState||this._viewOnly||(n.Info("Sending Ctrl-Alt-Del"),this.sendKey(y.default.XK_Control_L,"ControlLeft",!0),this.sendKey(y.default.XK_Alt_L,"AltLeft",!0),this.sendKey(y.default.XK_Delete,"Delete",!0),this.sendKey(y.default.XK_Delete,"Delete",!1),this.sendKey(y.default.XK_Alt_L,"AltLeft",!1),this.sendKey(y.default.XK_Control_L,"ControlLeft",!1))}},{key:"machineShutdown",value:function(){this._xvpOp(1,2)}},{key:"machineReboot",value:function(){this._xvpOp(1,3)}},{key:"machineReset",value:function(){this._xvpOp(1,4)}},{key:"sendKey",value:function(e,t,r){if("connected"===this._rfbConnectionState&&!this._viewOnly){if(void 0===r)return this.sendKey(e,t,!0),void this.sendKey(e,t,!1);var i=m.default[t];if(this._qemuExtKeyEventSupported&&i)e=e||0,n.Info("Sending key ("+(r?"down":"up")+"): keysym "+e+", scancode "+i),L.messages.QEMUExtendedKeyEvent(this._sock,e,r,i);else{if(!e)return;n.Info("Sending keysym ("+(r?"down":"up")+"): "+e),L.messages.keyEvent(this._sock,e,r?1:0)}}}},{key:"focus",value:function(){this._canvas.focus()}},{key:"blur",value:function(){this._canvas.blur()}},{key:"clipboardPasteFrom",value:function(e){if("connected"===this._rfbConnectionState&&!this._viewOnly)if(this._clipboardServerCapabilitiesFormats[1]&&this._clipboardServerCapabilitiesActions[134217728])this._clipboardText=e,L.messages.extendedClipboardNotify(this._sock,[1]);else{for(var t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);L.messages.clientCutText(this._sock,t)}}},{key:"_connect",value:function(){n.Debug(">> RFB.connect"),n.Info("connecting to "+this._url);try{this._sock.open(this._url,this._wsProtocols)}catch(e){"SyntaxError"===e.name?this._fail("Invalid host or port ("+e+")"):this._fail("Error when opening socket ("+e+")")}this._target.appendChild(this._screen),this._gestures.attach(this._canvas),this._cursor.attach(this._canvas),this._refreshCursor(),window.addEventListener("resize",this._eventHandlers.windowResize),this._canvas.addEventListener("mousedown",this._eventHandlers.focusCanvas),this._canvas.addEventListener("mousedown",this._eventHandlers.handleMouse),this._canvas.addEventListener("mouseup",this._eventHandlers.handleMouse),this._canvas.addEventListener("mousemove",this._eventHandlers.handleMouse),this._canvas.addEventListener("click",this._eventHandlers.handleMouse),this._canvas.addEventListener("contextmenu",this._eventHandlers.handleMouse),this._canvas.addEventListener("wheel",this._eventHandlers.handleWheel),this._canvas.addEventListener("gesturestart",this._eventHandlers.handleGesture),this._canvas.addEventListener("gesturemove",this._eventHandlers.handleGesture),this._canvas.addEventListener("gestureend",this._eventHandlers.handleGesture),n.Debug("<< RFB.connect")}},{key:"_disconnect",value:function(){n.Debug(">> RFB.disconnect"),this._cursor.detach(),this._canvas.removeEventListener("gesturestart",this._eventHandlers.handleGesture),this._canvas.removeEventListener("gesturemove",this._eventHandlers.handleGesture),this._canvas.removeEventListener("gestureend",this._eventHandlers.handleGesture),this._canvas.removeEventListener("wheel",this._eventHandlers.handleWheel),this._canvas.removeEventListener("mousedown",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mouseup",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mousemove",this._eventHandlers.handleMouse),this._canvas.removeEventListener("click",this._eventHandlers.handleMouse),this._canvas.removeEventListener("contextmenu",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mousedown",this._eventHandlers.focusCanvas),this._canvas.removeEventListener("touchstart",this._eventHandlers.focusCanvas),window.removeEventListener("resize",this._eventHandlers.windowResize),this._keyboard.ungrab(),this._gestures.detach(),this._sock.close();try{this._target.removeChild(this._screen)}catch(e){if("NotFoundError"!==e.name)throw e}clearTimeout(this._resizeTimeout),clearTimeout(this._mouseMoveTimer),n.Debug("<< RFB.disconnect")}},{key:"_focusCanvas",value:function(e){this.focusOnClick&&this.focus()}},{key:"_setDesktopName",value:function(e){this._fbName=e,this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:this._fbName}}))}},{key:"_windowResize",value:function(e){var t=this;window.requestAnimationFrame((function(){t._updateClip(),t._updateScale()})),this._resizeSession&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(this._requestRemoteResize.bind(this),500))}},{key:"_updateClip",value:function(){var e=this._display.clipViewport,t=this._clipViewport;if(this._scaleViewport&&(t=!1),e!==t&&(this._display.clipViewport=t),t){var r=this._screenSize();this._display.viewportChangeSize(r.w,r.h),this._fixScrollbars()}}},{key:"_updateScale",value:function(){if(this._scaleViewport){var e=this._screenSize();this._display.autoscale(e.w,e.h)}else this._display.scale=1;this._fixScrollbars()}},{key:"_requestRemoteResize",value:function(){if(clearTimeout(this._resizeTimeout),this._resizeTimeout=null,this._resizeSession&&!this._viewOnly&&this._supportsSetDesktopSize){var e=this._screenSize();L.messages.setDesktopSize(this._sock,Math.floor(e.w),Math.floor(e.h),this._screenID,this._screenFlags),n.Debug("Requested new desktop size: "+e.w+"x"+e.h)}}},{key:"_screenSize",value:function(){var e=this._screen.getBoundingClientRect();return{w:e.width,h:e.height}}},{key:"_fixScrollbars",value:function(){var e=this._screen.style.overflow;this._screen.style.overflow="hidden",this._screen.getBoundingClientRect(),this._screen.style.overflow=e}},{key:"_updateConnectionState",value:function(e){var t=this,r=this._rfbConnectionState;if(e!==r)if("disconnected"!==r){switch(e){case"connected":if("connecting"!==r)return void n.Error("Bad transition to connected state, previous connection state: "+r);break;case"disconnected":if("disconnecting"!==r)return void n.Error("Bad transition to disconnected state, previous connection state: "+r);break;case"connecting":if(""!==r)return void n.Error("Bad transition to connecting state, previous connection state: "+r);break;case"disconnecting":if("connected"!==r&&"connecting"!==r)return void n.Error("Bad transition to disconnecting state, previous connection state: "+r);break;default:return void n.Error("Unknown connection state: "+e)}switch(this._rfbConnectionState=e,n.Debug("New state '"+e+"', was '"+r+"'."),this._disconnTimer&&"disconnecting"!==e&&(n.Debug("Clearing disconnect timer"),clearTimeout(this._disconnTimer),this._disconnTimer=null,this._sock.off("close")),e){case"connecting":this._connect();break;case"connected":this.dispatchEvent(new CustomEvent("connect",{detail:{}}));break;case"disconnecting":this._disconnect(),this._disconnTimer=setTimeout((function(){n.Error("Disconnection timed out."),t._updateConnectionState("disconnected")}),3e3);break;case"disconnected":this.dispatchEvent(new CustomEvent("disconnect",{detail:{clean:this._rfbCleanDisconnect}}))}}else n.Error("Tried changing state of a disconnected RFB object");else n.Debug("Already in state '"+e+"', ignoring")}},{key:"_fail",value:function(e){switch(this._rfbConnectionState){case"disconnecting":n.Error("Failed when disconnecting: "+e);break;case"connected":n.Error("Failed while connected: "+e);break;case"connecting":n.Error("Failed when connecting: "+e);break;default:n.Error("RFB failure: "+e)}return this._rfbCleanDisconnect=!1,this._updateConnectionState("disconnecting"),this._updateConnectionState("disconnected"),!1}},{key:"_setCapability",value:function(e,t){this._capabilities[e]=t,this.dispatchEvent(new CustomEvent("capabilities",{detail:{capabilities:this._capabilities}}))}},{key:"_handleMessage",value:function(){if(0!==this._sock.rQlen)switch(this._rfbConnectionState){case"disconnected":n.Error("Got data while disconnected");break;case"connected":for(;!this._flushing&&this._normalMsg()&&0!==this._sock.rQlen;);break;default:this._initMsg()}else n.Warn("handleMessage called on an empty receive queue")}},{key:"_handleKeyEvent",value:function(e,t,r){this.sendKey(e,t,r)}},{key:"_handleMouse",value:function(e){if(("click"!==e.type||e.target===this._canvas)&&(e.stopPropagation(),e.preventDefault(),"click"!==e.type&&"contextmenu"!==e.type)){var t=(0,a.clientToElement)(e.clientX,e.clientY,this._canvas);switch(e.type){case"mousedown":(0,c.setCapture)(this._canvas),this._handleMouseButton(t.x,t.y,!0,1<<e.button);break;case"mouseup":this._handleMouseButton(t.x,t.y,!1,1<<e.button);break;case"mousemove":this._handleMouseMove(t.x,t.y)}}}},{key:"_handleMouseButton",value:function(e,t,r,i){if(this.dragViewport){if(r&&!this._viewportDragging)return this._viewportDragging=!0,this._viewportDragPos={x:e,y:t},void(this._viewportHasMoved=!1);if(this._viewportDragging=!1,this._viewportHasMoved)return;this._sendMouse(e,t,i)}null!==this._mouseMoveTimer&&(clearTimeout(this._mouseMoveTimer),this._mouseMoveTimer=null,this._sendMouse(e,t,this._mouseButtonMask)),r?this._mouseButtonMask|=i:this._mouseButtonMask&=~i,this._sendMouse(e,t,this._mouseButtonMask)}},{key:"_handleMouseMove",value:function(e,t){var r=this;if(this._viewportDragging){var i=this._viewportDragPos.x-e,n=this._viewportDragPos.y-t;(this._viewportHasMoved||Math.abs(i)>s.dragThreshold||Math.abs(n)>s.dragThreshold)&&(this._viewportHasMoved=!0,this._viewportDragPos={x:e,y:t},this._display.viewportChangePos(i,n))}else if(this._mousePos={x:e,y:t},null==this._mouseMoveTimer){var o=Date.now()-this._mouseLastMoveTime;o>17?(this._sendMouse(e,t,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()):this._mouseMoveTimer=setTimeout((function(){r._handleDelayedMouseMove()}),17-o)}}},{key:"_handleDelayedMouseMove",value:function(){this._mouseMoveTimer=null,this._sendMouse(this._mousePos.x,this._mousePos.y,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()}},{key:"_sendMouse",value:function(e,t,r){"connected"===this._rfbConnectionState&&(this._viewOnly||L.messages.pointerEvent(this._sock,this._display.absX(e),this._display.absY(t),r))}},{key:"_handleWheel",value:function(e){if("connected"===this._rfbConnectionState&&!this._viewOnly){e.stopPropagation(),e.preventDefault();var t=(0,a.clientToElement)(e.clientX,e.clientY,this._canvas),r=e.deltaX,i=e.deltaY;0!==e.deltaMode&&(r*=19,i*=19),this._accumulatedWheelDeltaX+=r,this._accumulatedWheelDeltaY+=i,Math.abs(this._accumulatedWheelDeltaX)>=50&&(this._accumulatedWheelDeltaX<0?(this._handleMouseButton(t.x,t.y,!0,32),this._handleMouseButton(t.x,t.y,!1,32)):this._accumulatedWheelDeltaX>0&&(this._handleMouseButton(t.x,t.y,!0,64),this._handleMouseButton(t.x,t.y,!1,64)),this._accumulatedWheelDeltaX=0),Math.abs(this._accumulatedWheelDeltaY)>=50&&(this._accumulatedWheelDeltaY<0?(this._handleMouseButton(t.x,t.y,!0,8),this._handleMouseButton(t.x,t.y,!1,8)):this._accumulatedWheelDeltaY>0&&(this._handleMouseButton(t.x,t.y,!0,16),this._handleMouseButton(t.x,t.y,!1,16)),this._accumulatedWheelDeltaY=0)}}},{key:"_fakeMouseMove",value:function(e,t,r){this._handleMouseMove(t,r),this._cursor.move(e.detail.clientX,e.detail.clientY)}},{key:"_handleTapEvent",value:function(e,t){var r=(0,a.clientToElement)(e.detail.clientX,e.detail.clientY,this._canvas);if(null!==this._gestureLastTapTime&&Date.now()-this._gestureLastTapTime<1e3&&this._gestureFirstDoubleTapEv.detail.type===e.detail.type){var i=this._gestureFirstDoubleTapEv.detail.clientX-e.detail.clientX,n=this._gestureFirstDoubleTapEv.detail.clientY-e.detail.clientY;Math.hypot(i,n)<50?r=(0,a.clientToElement)(this._gestureFirstDoubleTapEv.detail.clientX,this._gestureFirstDoubleTapEv.detail.clientY,this._canvas):this._gestureFirstDoubleTapEv=e}else this._gestureFirstDoubleTapEv=e;this._gestureLastTapTime=Date.now(),this._fakeMouseMove(this._gestureFirstDoubleTapEv,r.x,r.y),this._handleMouseButton(r.x,r.y,!0,t),this._handleMouseButton(r.x,r.y,!1,t)}},{key:"_handleGesture",value:function(e){var t,r=(0,a.clientToElement)(e.detail.clientX,e.detail.clientY,this._canvas);switch(e.type){case"gesturestart":switch(e.detail.type){case"onetap":this._handleTapEvent(e,1);break;case"twotap":this._handleTapEvent(e,4);break;case"threetap":this._handleTapEvent(e,2);break;case"drag":this._fakeMouseMove(e,r.x,r.y),this._handleMouseButton(r.x,r.y,!0,1);break;case"longpress":this._fakeMouseMove(e,r.x,r.y),this._handleMouseButton(r.x,r.y,!0,4);break;case"twodrag":this._gestureLastMagnitudeX=e.detail.magnitudeX,this._gestureLastMagnitudeY=e.detail.magnitudeY,this._fakeMouseMove(e,r.x,r.y);break;case"pinch":this._gestureLastMagnitudeX=Math.hypot(e.detail.magnitudeX,e.detail.magnitudeY),this._fakeMouseMove(e,r.x,r.y)}break;case"gesturemove":switch(e.detail.type){case"onetap":case"twotap":case"threetap":break;case"drag":case"longpress":this._fakeMouseMove(e,r.x,r.y);break;case"twodrag":for(this._fakeMouseMove(e,r.x,r.y);e.detail.magnitudeY-this._gestureLastMagnitudeY>F;)this._handleMouseButton(r.x,r.y,!0,8),this._handleMouseButton(r.x,r.y,!1,8),this._gestureLastMagnitudeY+=F;for(;e.detail.magnitudeY-this._gestureLastMagnitudeY<-50;)this._handleMouseButton(r.x,r.y,!0,16),this._handleMouseButton(r.x,r.y,!1,16),this._gestureLastMagnitudeY-=F;for(;e.detail.magnitudeX-this._gestureLastMagnitudeX>F;)this._handleMouseButton(r.x,r.y,!0,32),this._handleMouseButton(r.x,r.y,!1,32),this._gestureLastMagnitudeX+=F;for(;e.detail.magnitudeX-this._gestureLastMagnitudeX<-50;)this._handleMouseButton(r.x,r.y,!0,64),this._handleMouseButton(r.x,r.y,!1,64),this._gestureLastMagnitudeX-=F;break;case"pinch":if(this._fakeMouseMove(e,r.x,r.y),t=Math.hypot(e.detail.magnitudeX,e.detail.magnitudeY),Math.abs(t-this._gestureLastMagnitudeX)>75){for(this._handleKeyEvent(y.default.XK_Control_L,"ControlLeft",!0);t-this._gestureLastMagnitudeX>75;)this._handleMouseButton(r.x,r.y,!0,8),this._handleMouseButton(r.x,r.y,!1,8),this._gestureLastMagnitudeX+=75;for(;t-this._gestureLastMagnitudeX<-75;)this._handleMouseButton(r.x,r.y,!0,16),this._handleMouseButton(r.x,r.y,!1,16),this._gestureLastMagnitudeX-=75}this._handleKeyEvent(y.default.XK_Control_L,"ControlLeft",!1)}break;case"gestureend":switch(e.detail.type){case"onetap":case"twotap":case"threetap":case"pinch":case"twodrag":break;case"drag":this._fakeMouseMove(e,r.x,r.y),this._handleMouseButton(r.x,r.y,!1,1);break;case"longpress":this._fakeMouseMove(e,r.x,r.y),this._handleMouseButton(r.x,r.y,!1,4)}}}},{key:"_negotiateProtocolVersion",value:function(){if(this._sock.rQwait("version",12))return!1;var e=this._sock.rQshiftStr(12).substr(4,7);n.Info("Server ProtocolVersion: "+e);var t=0;switch(e){case"000.000":t=1;break;case"003.003":case"003.006":case"003.889":this._rfbVersion=3.3;break;case"003.007":this._rfbVersion=3.7;break;case"003.008":case"004.000":case"004.001":case"005.000":this._rfbVersion=3.8;break;default:return this._fail("Invalid server version "+e)}if(t){for(var r="ID:"+this._repeaterID;r.length<250;)r+="\0";return this._sock.sendString(r),!0}this._rfbVersion>this._rfbMaxVersion&&(this._rfbVersion=this._rfbMaxVersion);var i="00"+parseInt(this._rfbVersion,10)+".00"+10*this._rfbVersion%10;this._sock.sendString("RFB "+i+"\n"),n.Debug("Sent ProtocolVersion: "+i),this._rfbInitState="Security"}},{key:"_negotiateSecurity",value:function(){function e(e,t){for(var r=0;r<t.length;r++)if(t[r]===e)return!0;return!1}if(this._rfbVersion>=3.7){var t=this._sock.rQshift8();if(this._sock.rQwait("security type",t,1))return!1;if(0===t)return this._rfbInitState="SecurityReason",this._securityContext="no security types",this._securityStatus=1,this._initMsg();var r=this._sock.rQshiftBytes(t);if(n.Debug("Server security types: "+r),e(1,r))this._rfbAuthScheme=1;else if(e(22,r))this._rfbAuthScheme=22;else if(e(16,r))this._rfbAuthScheme=16;else if(e(2,r))this._rfbAuthScheme=2;else{if(!e(19,r))return this._fail("Unsupported security types (types: "+r+")");this._rfbAuthScheme=19}this._sock.send([this._rfbAuthScheme])}else{if(this._sock.rQwait("security scheme",4))return!1;if(this._rfbAuthScheme=this._sock.rQshift32(),0==this._rfbAuthScheme)return this._rfbInitState="SecurityReason",this._securityContext="authentication scheme",this._securityStatus=1,this._initMsg()}return this._rfbInitState="Authentication",n.Debug("Authenticating using scheme: "+this._rfbAuthScheme),this._initMsg()}},{key:"_handleSecurityReason",value:function(){if(this._sock.rQwait("reason length",4))return!1;var e=this._sock.rQshift32(),t="";if(e>0){if(this._sock.rQwait("reason",e,4))return!1;t=this._sock.rQshiftStr(e)}return""!==t?(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus,reason:t}})),this._fail("Security negotiation failed on "+this._securityContext+" (reason: "+t+")")):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus}})),this._fail("Security negotiation failed on "+this._securityContext))}},{key:"_negotiateXvpAuth",value:function(){if(void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password||void 0===this._rfbCredentials.target)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password","target"]}})),!1;var e=String.fromCharCode(this._rfbCredentials.username.length)+String.fromCharCode(this._rfbCredentials.target.length)+this._rfbCredentials.username+this._rfbCredentials.target;return this._sock.sendString(e),this._rfbAuthScheme=2,this._negotiateAuthentication()}},{key:"_negotiateVeNCryptAuth",value:function(){if(0==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt version",2))return!1;var e=this._sock.rQshift8(),t=this._sock.rQshift8();if(0!=e||2!=t)return this._fail("Unsupported VeNCrypt version "+e+"."+t);this._sock.send([0,2]),this._rfbVeNCryptState=1}if(1==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt ack",1))return!1;var r=this._sock.rQshift8();if(0!=r)return this._fail("VeNCrypt failure "+r);this._rfbVeNCryptState=2}if(2==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt subtypes length",1))return!1;var i=this._sock.rQshift8();if(i<1)return this._fail("VeNCrypt subtypes empty");this._rfbVeNCryptSubtypesLength=i,this._rfbVeNCryptState=3}if(3==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt subtypes",4*this._rfbVeNCryptSubtypesLength))return!1;for(var n=[],s=0;s<this._rfbVeNCryptSubtypesLength;s++)n.push(this._sock.rQshift32());if(-1==n.indexOf(256))return this._fail("VeNCrypt Plain subtype not offered by server");this._sock.send([0,0,1,0]),this._rfbVeNCryptState=4}if(4==this._rfbVeNCryptState){if(!this._rfbCredentials.username||!this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1;var a=(0,o.encodeUTF8)(this._rfbCredentials.username),c=(0,o.encodeUTF8)(this._rfbCredentials.password);return this._sock.send([0,0,0,a.length]),this._sock.send([0,0,0,c.length]),this._sock.sendString(a),this._sock.sendString(c),this._rfbInitState="SecurityResult",!0}}},{key:"_negotiateStdVNCAuth",value:function(){if(this._sock.rQwait("auth challenge",16))return!1;if(void 0===this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["password"]}})),!1;var e=Array.prototype.slice.call(this._sock.rQshiftBytes(16)),t=L.genDES(this._rfbCredentials.password,e);return this._sock.send(t),this._rfbInitState="SecurityResult",!0}},{key:"_negotiateTightUnixAuth",value:function(){return void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password?(this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1):(this._sock.send([0,0,0,this._rfbCredentials.username.length]),this._sock.send([0,0,0,this._rfbCredentials.password.length]),this._sock.sendString(this._rfbCredentials.username),this._sock.sendString(this._rfbCredentials.password),this._rfbInitState="SecurityResult",!0)}},{key:"_negotiateTightTunnels",value:function(e){for(var t={vendor:"TGHT",signature:"NOTUNNEL"},r={},i=0;i<e;i++){var o=this._sock.rQshift32(),s=this._sock.rQshiftStr(4),a=this._sock.rQshiftStr(8);r[o]={vendor:s,signature:a}}return n.Debug("Server Tight tunnel types: "+r),r[1]&&"SICR"===r[1].vendor&&"SCHANNEL"===r[1].signature&&(n.Debug("Detected Siemens server. Assuming NOTUNNEL support."),r[0]={vendor:"TGHT",signature:"NOTUNNEL"}),r[0]?r[0].vendor!=t.vendor||r[0].signature!=t.signature?this._fail("Client's tunnel type had the incorrect vendor or signature"):(n.Debug("Selected tunnel type: "+t),this._sock.send([0,0,0,0]),!1):this._fail("Server wanted tunnels, but doesn't support the notunnel type")}},{key:"_negotiateTightAuth",value:function(){if(!this._rfbTightVNC){if(this._sock.rQwait("num tunnels",4))return!1;var e=this._sock.rQshift32();if(e>0&&this._sock.rQwait("tunnel capabilities",16*e,4))return!1;if(this._rfbTightVNC=!0,e>0)return this._negotiateTightTunnels(e),!1}if(this._sock.rQwait("sub auth count",4))return!1;var t=this._sock.rQshift32();if(0===t)return this._rfbInitState="SecurityResult",!0;if(this._sock.rQwait("sub auth capabilities",16*t,4))return!1;for(var r={STDVNOAUTH__:1,STDVVNCAUTH_:2,TGHTULGNAUTH:129},i=[],o=0;o<t;o++){this._sock.rQshift32();var s=this._sock.rQshiftStr(12);i.push(s)}for(var a in n.Debug("Server Tight authentication types: "+i),r)if(-1!=i.indexOf(a))switch(this._sock.send([0,0,0,r[a]]),n.Debug("Selected authentication type: "+a),a){case"STDVNOAUTH__":return this._rfbInitState="SecurityResult",!0;case"STDVVNCAUTH_":return this._rfbAuthScheme=2,this._initMsg();case"TGHTULGNAUTH":return this._rfbAuthScheme=129,this._initMsg();default:return this._fail("Unsupported tiny auth scheme (scheme: "+a+")")}return this._fail("No supported sub-auth types!")}},{key:"_negotiateAuthentication",value:function(){switch(this._rfbAuthScheme){case 1:return this._rfbVersion>=3.8?(this._rfbInitState="SecurityResult",!0):(this._rfbInitState="ClientInitialisation",this._initMsg());case 22:return this._negotiateXvpAuth();case 2:return this._negotiateStdVNCAuth();case 16:return this._negotiateTightAuth();case 19:return this._negotiateVeNCryptAuth();case 129:return this._negotiateTightUnixAuth();default:return this._fail("Unsupported auth scheme (scheme: "+this._rfbAuthScheme+")")}}},{key:"_handleSecurityResult",value:function(){if(this._sock.rQwait("VNC auth response ",4))return!1;var e=this._sock.rQshift32();return 0===e?(this._rfbInitState="ClientInitialisation",n.Debug("Authentication OK"),this._initMsg()):this._rfbVersion>=3.8?(this._rfbInitState="SecurityReason",this._securityContext="security result",this._securityStatus=e,this._initMsg()):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:e}})),this._fail("Security handshake failed"))}},{key:"_negotiateServerInit",value:function(){if(this._sock.rQwait("server initialization",24))return!1;var e=this._sock.rQshift16(),t=this._sock.rQshift16(),r=this._sock.rQshift8(),i=this._sock.rQshift8(),s=this._sock.rQshift8(),a=this._sock.rQshift8(),c=this._sock.rQshift16(),l=this._sock.rQshift16(),u=this._sock.rQshift16(),h=this._sock.rQshift8(),f=this._sock.rQshift8(),d=this._sock.rQshift8();this._sock.rQskipBytes(3);var _=this._sock.rQshift32();if(this._sock.rQwait("server init name",_,24))return!1;var p=this._sock.rQshiftStr(_);if(p=(0,o.decodeUTF8)(p,!0),this._rfbTightVNC){if(this._sock.rQwait("TightVNC extended server init header",8,24+_))return!1;var v=this._sock.rQshift16(),g=this._sock.rQshift16(),y=this._sock.rQshift16();this._sock.rQskipBytes(2);var m=16*(v+g+y);if(this._sock.rQwait("TightVNC extended server init header",m,32+_))return!1;this._sock.rQskipBytes(16*v),this._sock.rQskipBytes(16*g),this._sock.rQskipBytes(16*y)}return n.Info("Screen: "+e+"x"+t+", bpp: "+r+", depth: "+i+", bigEndian: "+s+", trueColor: "+a+", redMax: "+c+", greenMax: "+l+", blueMax: "+u+", redShift: "+h+", greenShift: "+f+", blueShift: "+d),this._setDesktopName(p),this._resize(e,t),this._viewOnly||this._keyboard.grab(),this._fbDepth=24,"Intel(r) AMT KVM"===this._fbName&&(n.Warn("Intel AMT KVM only supports 8/16 bit depths. Using low color mode."),this._fbDepth=8),L.messages.pixelFormat(this._sock,this._fbDepth,!0),this._sendEncodings(),L.messages.fbUpdateRequest(this._sock,!1,0,0,this._fbWidth,this._fbHeight),this._updateConnectionState("connected"),!0}},{key:"_sendEncodings",value:function(){var e=[];e.push(b.encodings.encodingCopyRect),24==this._fbDepth&&(e.push(b.encodings.encodingTight),e.push(b.encodings.encodingTightPNG),e.push(b.encodings.encodingHextile),e.push(b.encodings.encodingRRE)),e.push(b.encodings.encodingRaw),e.push(b.encodings.pseudoEncodingQualityLevel0+this._qualityLevel),e.push(b.encodings.pseudoEncodingCompressLevel0+this._compressionLevel),e.push(b.encodings.pseudoEncodingDesktopSize),e.push(b.encodings.pseudoEncodingLastRect),e.push(b.encodings.pseudoEncodingQEMUExtendedKeyEvent),e.push(b.encodings.pseudoEncodingExtendedDesktopSize),e.push(b.encodings.pseudoEncodingXvp),e.push(b.encodings.pseudoEncodingFence),e.push(b.encodings.pseudoEncodingContinuousUpdates),e.push(b.encodings.pseudoEncodingDesktopName),e.push(b.encodings.pseudoEncodingExtendedClipboard),24==this._fbDepth&&(e.push(b.encodings.pseudoEncodingVMwareCursor),e.push(b.encodings.pseudoEncodingCursor)),L.messages.clientEncodings(this._sock,e)}},{key:"_initMsg",value:function(){switch(this._rfbInitState){case"ProtocolVersion":return this._negotiateProtocolVersion();case"Security":return this._negotiateSecurity();case"Authentication":return this._negotiateAuthentication();case"SecurityResult":return this._handleSecurityResult();case"SecurityReason":return this._handleSecurityReason();case"ClientInitialisation":return this._sock.send([this._shared?1:0]),this._rfbInitState="ServerInitialisation",!0;case"ServerInitialisation":return this._negotiateServerInit();default:return this._fail("Unknown init state (state: "+this._rfbInitState+")")}}},{key:"_handleSetColourMapMsg",value:function(){return n.Debug("SetColorMapEntries"),this._fail("Unexpected SetColorMapEntries message")}},{key:"_handleServerCutText",value:function(){if(n.Debug("ServerCutText"),this._sock.rQwait("ServerCutText header",7,1))return!1;this._sock.rQskipBytes(3);var e=this._sock.rQshift32();if(e=(0,i.toSigned32bit)(e),this._sock.rQwait("ServerCutText content",Math.abs(e),8))return!1;if(e>=0){var t=this._sock.rQshiftStr(e);if(this._viewOnly)return!0;this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:t}}))}else{e=Math.abs(e);var r=this._sock.rQshift32(),s=65535&r,a=4278190080&r;if(a&K){this._clipboardServerCapabilitiesFormats={},this._clipboardServerCapabilitiesActions={};for(var c=0;c<=15;c++){var l=1<<c;s&l&&(this._clipboardServerCapabilitiesFormats[l]=!0,this._sock.rQshift32())}for(var u=24;u<=31;u++){var f=1<<u;this._clipboardServerCapabilitiesActions[f]=!!(a&f)}var d=[K,I,B,H,j];L.messages.extendedClipboardCaps(this._sock,d,{extendedClipboardFormatText:0})}else if(a===I){if(this._viewOnly)return!0;null!=this._clipboardText&&this._clipboardServerCapabilitiesActions[268435456]&&1&s&&L.messages.extendedClipboardProvide(this._sock,[1],[this._clipboardText])}else if(a===B){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[134217728]&&(null!=this._clipboardText?L.messages.extendedClipboardNotify(this._sock,[1]):L.messages.extendedClipboardNotify(this._sock,[]))}else if(a===H){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[33554432]&&1&s&&L.messages.extendedClipboardRequest(this._sock,[1])}else{if(a!==j)return this._fail("Unexpected action in extended clipboard message: "+a);if(this._viewOnly)return!0;if(!(1&s))return!0;this._clipboardText=null;var _=this._sock.rQshiftBytes(e-4),p=new h.default,v=null;p.setInput(_);for(var g=0;g<=15;g++){var y=1<<g;if(s&y){var m=0,b=p.inflate(4);m|=b[0]<<24,m|=b[1]<<16,m|=b[2]<<8,m|=b[3];var w=p.inflate(m);1===y&&(v=w)}}if(p.setInput(null),null!==v){for(var S="",C=0;C<v.length;C++)S+=String.fromCharCode(v[C]);v=S,(v=(0,o.decodeUTF8)(v)).length>0&&"\0"===v.charAt(v.length-1)&&(v=v.slice(0,-1)),v=v.replace("\r\n","\n"),this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:v}}))}}}return!0}},{key:"_handleServerFenceMsg",value:function(){if(this._sock.rQwait("ServerFence header",8,1))return!1;this._sock.rQskipBytes(3);var e=this._sock.rQshift32(),t=this._sock.rQshift8();if(this._sock.rQwait("ServerFence payload",t,9))return!1;t>64&&(n.Warn("Bad payload length ("+t+") in fence response"),t=64);var r=this._sock.rQshiftStr(t);return this._supportsFence=!0,e&1<<31?(e&=3,L.messages.clientFence(this._sock,e,r),!0):this._fail("Unexpected fence response")}},{key:"_handleXvpMsg",value:function(){if(this._sock.rQwait("XVP version and message",3,1))return!1;this._sock.rQskipBytes(1);var e=this._sock.rQshift8(),t=this._sock.rQshift8();switch(t){case 0:n.Error("XVP Operation Failed");break;case 1:this._rfbXvpVer=e,n.Info("XVP extensions enabled (version "+this._rfbXvpVer+")"),this._setCapability("power",!0);break;default:this._fail("Illegal server XVP message (msg: "+t+")")}return!0}},{key:"_normalMsg",value:function(){var e,t,r;switch(e=this._FBU.rects>0?0:this._sock.rQshift8()){case 0:return(r=this._framebufferUpdate())&&!this._enabledContinuousUpdates&&L.messages.fbUpdateRequest(this._sock,!0,0,0,this._fbWidth,this._fbHeight),r;case 1:return this._handleSetColourMapMsg();case 2:return n.Debug("Bell"),this.dispatchEvent(new CustomEvent("bell",{detail:{}})),!0;case 3:return this._handleServerCutText();case 150:return t=!this._supportsContinuousUpdates,this._supportsContinuousUpdates=!0,this._enabledContinuousUpdates=!1,t&&(this._enabledContinuousUpdates=!0,this._updateContinuousUpdates(),n.Info("Enabling continuous updates.")),!0;case 248:return this._handleServerFenceMsg();case 250:return this._handleXvpMsg();default:return this._fail("Unexpected server message (type "+e+")"),n.Debug("sock.rQslice(0, 30): "+this._sock.rQslice(0,30)),!0}}},{key:"_onFlush",value:function(){this._flushing=!1,this._sock.rQlen>0&&this._handleMessage()}},{key:"_framebufferUpdate",value:function(){if(0===this._FBU.rects){if(this._sock.rQwait("FBU header",3,1))return!1;if(this._sock.rQskipBytes(1),this._FBU.rects=this._sock.rQshift16(),this._display.pending())return this._flushing=!0,this._display.flush(),!1}for(;this._FBU.rects>0;){if(null===this._FBU.encoding){if(this._sock.rQwait("rect header",12))return!1;var e=this._sock.rQshiftBytes(12);this._FBU.x=(e[0]<<8)+e[1],this._FBU.y=(e[2]<<8)+e[3],this._FBU.width=(e[4]<<8)+e[5],this._FBU.height=(e[6]<<8)+e[7],this._FBU.encoding=parseInt((e[8]<<24)+(e[9]<<16)+(e[10]<<8)+e[11],10)}if(!this._handleRect())return!1;this._FBU.rects--,this._FBU.encoding=null}return this._display.flip(),!0}},{key:"_handleRect",value:function(){switch(this._FBU.encoding){case b.encodings.pseudoEncodingLastRect:return this._FBU.rects=1,!0;case b.encodings.pseudoEncodingVMwareCursor:return this._handleVMwareCursor();case b.encodings.pseudoEncodingCursor:return this._handleCursor();case b.encodings.pseudoEncodingQEMUExtendedKeyEvent:try{void 0!==document.createEvent("keyboardEvent").code&&(this._qemuExtKeyEventSupported=!0)}catch(e){}return!0;case b.encodings.pseudoEncodingDesktopName:return this._handleDesktopName();case b.encodings.pseudoEncodingDesktopSize:return this._resize(this._FBU.width,this._FBU.height),!0;case b.encodings.pseudoEncodingExtendedDesktopSize:return this._handleExtendedDesktopSize();default:return this._handleDataRect()}}},{key:"_handleVMwareCursor",value:function(){var e=this._FBU.x,t=this._FBU.y,r=this._FBU.width,i=this._FBU.height;if(this._sock.rQwait("VMware cursor encoding",1))return!1;var o,s=this._sock.rQshift8();if(this._sock.rQshift8(),0==s){var a=-256;if(o=new Array(r*i*4),this._sock.rQwait("VMware cursor classic encoding",r*i*4*2,2))return!1;for(var c=new Array(r*i),l=0;l<r*i;l++)c[l]=this._sock.rQshift32();for(var u=new Array(r*i),h=0;h<r*i;h++)u[h]=this._sock.rQshift32();for(var f=0;f<r*i;f++)if(0==c[f]){var d=u[f],_=d>>8&255,p=d>>16&255,v=d>>24&255;o[4*f]=_,o[4*f+1]=p,o[4*f+2]=v,o[4*f+3]=255}else(c[f]&a)==a?0==u[f]?(o[4*f]=0,o[4*f+1]=0,o[4*f+2]=0,o[4*f+3]=0):(u[f],o[4*f]=0,o[4*f+1]=0,o[4*f+2]=0,o[4*f+3]=255):(o[4*f]=0,o[4*f+1]=0,o[4*f+2]=0,o[4*f+3]=255)}else{if(1!=s)return n.Warn("The given cursor type is not supported: "+s+" given."),!1;if(this._sock.rQwait("VMware cursor alpha encoding",r*i*4,2))return!1;o=new Array(r*i*4);for(var g=0;g<r*i;g++){var y=this._sock.rQshift32();o[4*g]=y>>24&255,o[4*g+1]=y>>16&255,o[4*g+2]=y>>8&255,o[4*g+3]=255&y}}return this._updateCursor(o,e,t,r,i),!0}},{key:"_handleCursor",value:function(){var e=this._FBU.x,t=this._FBU.y,r=this._FBU.width,i=this._FBU.height,n=r*i*4,o=Math.ceil(r/8)*i,s=n+o;if(this._sock.rQwait("cursor encoding",s))return!1;for(var a=this._sock.rQshiftBytes(n),c=this._sock.rQshiftBytes(o),l=new Uint8Array(r*i*4),u=0,h=0;h<i;h++)for(var f=0;f<r;f++){var d=c[h*Math.ceil(r/8)+Math.floor(f/8)]<<f%8&128?255:0;l[u]=a[u+2],l[u+1]=a[u+1],l[u+2]=a[u],l[u+3]=d,u+=4}return this._updateCursor(l,e,t,r,i),!0}},{key:"_handleDesktopName",value:function(){if(this._sock.rQwait("DesktopName",4))return!1;var e=this._sock.rQshift32();if(this._sock.rQwait("DesktopName",e,4))return!1;var t=this._sock.rQshiftStr(e);return t=(0,o.decodeUTF8)(t,!0),this._setDesktopName(t),!0}},{key:"_handleExtendedDesktopSize",value:function(){if(this._sock.rQwait("ExtendedDesktopSize",4))return!1;var e=this._sock.rQpeek8(),t=4+16*e;if(this._sock.rQwait("ExtendedDesktopSize",t))return!1;var r=!this._supportsSetDesktopSize;this._supportsSetDesktopSize=!0,r&&this._requestRemoteResize(),this._sock.rQskipBytes(1),this._sock.rQskipBytes(3);for(var i=0;i<e;i+=1)0===i?(this._screenID=this._sock.rQshiftBytes(4),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._sock.rQskipBytes(2),this._screenFlags=this._sock.rQshiftBytes(4)):this._sock.rQskipBytes(16);if(1===this._FBU.x&&0!==this._FBU.y){var o="";switch(this._FBU.y){case 1:o="Resize is administratively prohibited";break;case 2:o="Out of resources";break;case 3:o="Invalid screen layout";break;default:o="Unknown reason"}n.Warn("Server did not accept the resize request: "+o)}else this._resize(this._FBU.width,this._FBU.height);return!0}},{key:"_handleDataRect",value:function(){var e=this._decoders[this._FBU.encoding];if(!e)return this._fail("Unsupported encoding (encoding: "+this._FBU.encoding+")"),!1;try{return e.decodeRect(this._FBU.x,this._FBU.y,this._FBU.width,this._FBU.height,this._sock,this._display,this._fbDepth)}catch(e){return this._fail("Error decoding rect: "+e),!1}}},{key:"_updateContinuousUpdates",value:function(){this._enabledContinuousUpdates&&L.messages.enableContinuousUpdates(this._sock,!0,0,0,this._fbWidth,this._fbHeight)}},{key:"_resize",value:function(e,t){this._fbWidth=e,this._fbHeight=t,this._display.resize(this._fbWidth,this._fbHeight),this._updateClip(),this._updateScale(),this._updateContinuousUpdates()}},{key:"_xvpOp",value:function(e,t){this._rfbXvpVer<e||(n.Info("Sending XVP operation "+t+" (version "+e+")"),L.messages.xvpOp(this._sock,e,t))}},{key:"_updateCursor",value:function(e,t,r,i,n){this._cursorImage={rgbaPixels:e,hotx:t,hoty:r,w:i,h:n},this._refreshCursor()}},{key:"_shouldShowDotCursor",value:function(){if(!this._showDotCursor)return!1;for(var e=3;e<this._cursorImage.rgbaPixels.length;e+=4)if(this._cursorImage.rgbaPixels[e])return!1;return!0}},{key:"_refreshCursor",value:function(){if("connecting"===this._rfbConnectionState||"connected"===this._rfbConnectionState){var e=this._shouldShowDotCursor()?L.cursors.dot:this._cursorImage;this._cursor.change(e.rgbaPixels,e.hotx,e.hoty,e.w,e.h)}}},{key:"viewOnly",get:function(){return this._viewOnly},set:function(e){this._viewOnly=e,"connecting"!==this._rfbConnectionState&&"connected"!==this._rfbConnectionState||(e?this._keyboard.ungrab():this._keyboard.grab())}},{key:"capabilities",get:function(){return this._capabilities}},{key:"touchButton",get:function(){return 0},set:function(e){n.Warn("Using old API!")}},{key:"clipViewport",get:function(){return this._clipViewport},set:function(e){this._clipViewport=e,this._updateClip()}},{key:"scaleViewport",get:function(){return this._scaleViewport},set:function(e){this._scaleViewport=e,e&&this._clipViewport&&this._updateClip(),this._updateScale(),!e&&this._clipViewport&&this._updateClip()}},{key:"resizeSession",get:function(){return this._resizeSession},set:function(e){this._resizeSession=e,e&&this._requestRemoteResize()}},{key:"showDotCursor",get:function(){return this._showDotCursor},set:function(e){this._showDotCursor=e,this._refreshCursor()}},{key:"background",get:function(){return this._screen.style.background},set:function(e){this._screen.style.background=e}},{key:"qualityLevel",get:function(){return this._qualityLevel},set:function(e){!Number.isInteger(e)||e<0||e>9?n.Error("qualityLevel must be an integer between 0 and 9"):this._qualityLevel!==e&&(this._qualityLevel=e,"connected"===this._rfbConnectionState&&this._sendEncodings())}},{key:"compressionLevel",get:function(){return this._compressionLevel},set:function(e){!Number.isInteger(e)||e<0||e>9?n.Error("compressionLevel must be an integer between 0 and 9"):this._compressionLevel!==e&&(this._compressionLevel=e,"connected"===this._rfbConnectionState&&this._sendEncodings())}}])&&M(t.prototype,r),l&&M(t,l),L}(l.default);t.Z=U,U.messages={keyEvent:function(e,t,r){var i=e._sQ,n=e._sQlen;i[n]=4,i[n+1]=r,i[n+2]=0,i[n+3]=0,i[n+4]=t>>24,i[n+5]=t>>16,i[n+6]=t>>8,i[n+7]=t,e._sQlen+=8,e.flush()},QEMUExtendedKeyEvent:function(e,t,r,i){var n=e._sQ,o=e._sQlen;n[o]=255,n[o+1]=0,n[o+2]=r>>8,n[o+3]=r,n[o+4]=t>>24,n[o+5]=t>>16,n[o+6]=t>>8,n[o+7]=t;var s,a,c=(s=i,a=255&i,224==i>>8&&a<127?128|a:s);n[o+8]=c>>24,n[o+9]=c>>16,n[o+10]=c>>8,n[o+11]=c,e._sQlen+=12,e.flush()},pointerEvent:function(e,t,r,i){var n=e._sQ,o=e._sQlen;n[o]=5,n[o+1]=i,n[o+2]=t>>8,n[o+3]=t,n[o+4]=r>>8,n[o+5]=r,e._sQlen+=6,e.flush()},_buildExtendedClipboardFlags:function(e,t){for(var r=new Uint8Array(4),i=0,n=0,o=0;o<e.length;o++)n|=e[o];for(var s=0;s<t.length;s++)i|=t[s];return r[0]=n>>24,r[1]=0,r[2]=0,r[3]=i,r},extendedClipboardProvide:function(e,t,r){for(var i=new f.default,n=[],s=0;s<t.length;s++){if(1!=t[s])throw new Error("Unsupported extended clipboard format for Provide message.");r[s]=r[s].replace(/\r\n|\r|\n/gm,"\r\n");var a=(0,o.encodeUTF8)(r[s]+"\0");n.push(a.length>>24&255,a.length>>16&255,a.length>>8&255,255&a.length);for(var c=0;c<a.length;c++)n.push(a.charCodeAt(c))}var l=i.deflate(new Uint8Array(n)),u=new Uint8Array(4+l.length);u.set(U.messages._buildExtendedClipboardFlags([j],t)),u.set(l,4),U.messages.clientCutText(e,u,!0)},extendedClipboardNotify:function(e,t){var r=U.messages._buildExtendedClipboardFlags([H],t);U.messages.clientCutText(e,r,!0)},extendedClipboardRequest:function(e,t){var r=U.messages._buildExtendedClipboardFlags([I],t);U.messages.clientCutText(e,r,!0)},extendedClipboardCaps:function(e,t,r){var i=Object.keys(r),n=new Uint8Array(4+4*i.length);i.map((function(e){return parseInt(e)})),i.sort((function(e,t){return e-t})),n.set(U.messages._buildExtendedClipboardFlags(t,[]));for(var o=4,s=0;s<i.length;s++)n[o]=r[i[s]]>>24,n[o+1]=r[i[s]]>>16,n[o+2]=r[i[s]]>>8,n[o+3]=r[i[s]]>>0,o+=4,n[3]|=1<<i[s];U.messages.clientCutText(e,n,!0)},clientCutText:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e._sQ,s=e._sQlen;o[s]=6,o[s+1]=0,o[s+2]=0,o[s+3]=0,r=n?(0,i.toUnsigned32bit)(-t.length):t.length,o[s+4]=r>>24,o[s+5]=r>>16,o[s+6]=r>>8,o[s+7]=r,e._sQlen+=8;for(var a=0,c=t.length;c>0;){for(var l=Math.min(c,e._sQbufferSize-e._sQlen),u=0;u<l;u++)o[e._sQlen+u]=t[a+u];e._sQlen+=l,e.flush(),c-=l,a+=l}},setDesktopSize:function(e,t,r,i,n){var o=e._sQ,s=e._sQlen;o[s]=251,o[s+1]=0,o[s+2]=t>>8,o[s+3]=t,o[s+4]=r>>8,o[s+5]=r,o[s+6]=1,o[s+7]=0,o[s+8]=i>>24,o[s+9]=i>>16,o[s+10]=i>>8,o[s+11]=i,o[s+12]=0,o[s+13]=0,o[s+14]=0,o[s+15]=0,o[s+16]=t>>8,o[s+17]=t,o[s+18]=r>>8,o[s+19]=r,o[s+20]=n>>24,o[s+21]=n>>16,o[s+22]=n>>8,o[s+23]=n,e._sQlen+=24,e.flush()},clientFence:function(e,t,r){var i=e._sQ,n=e._sQlen;i[n]=248,i[n+1]=0,i[n+2]=0,i[n+3]=0,i[n+4]=t>>24,i[n+5]=t>>16,i[n+6]=t>>8,i[n+7]=t;var o=r.length;i[n+8]=o;for(var s=0;s<o;s++)i[n+9+s]=r.charCodeAt(s);e._sQlen+=9+o,e.flush()},enableContinuousUpdates:function(e,t,r,i,n,o){var s=e._sQ,a=e._sQlen;s[a]=150,s[a+1]=t,s[a+2]=r>>8,s[a+3]=r,s[a+4]=i>>8,s[a+5]=i,s[a+6]=n>>8,s[a+7]=n,s[a+8]=o>>8,s[a+9]=o,e._sQlen+=10,e.flush()},pixelFormat:function(e,t,r){var i,n=e._sQ,o=e._sQlen;i=t>16?32:t>8?16:8;var s=Math.floor(t/3);n[o]=0,n[o+1]=0,n[o+2]=0,n[o+3]=0,n[o+4]=i,n[o+5]=t,n[o+6]=0,n[o+7]=r?1:0,n[o+8]=0,n[o+9]=(1<<s)-1,n[o+10]=0,n[o+11]=(1<<s)-1,n[o+12]=0,n[o+13]=(1<<s)-1,n[o+14]=2*s,n[o+15]=1*s,n[o+16]=0*s,n[o+17]=0,n[o+18]=0,n[o+19]=0,e._sQlen+=20,e.flush()},clientEncodings:function(e,t){var r=e._sQ,i=e._sQlen;r[i]=2,r[i+1]=0,r[i+2]=t.length>>8,r[i+3]=t.length;for(var n=i+4,o=0;o<t.length;o++){var s=t[o];r[n]=s>>24,r[n+1]=s>>16,r[n+2]=s>>8,r[n+3]=s,n+=4}e._sQlen+=n-i,e.flush()},fbUpdateRequest:function(e,t,r,i,n,o){var s=e._sQ,a=e._sQlen;void 0===r&&(r=0),void 0===i&&(i=0),s[a]=3,s[a+1]=t?1:0,s[a+2]=r>>8&255,s[a+3]=255&r,s[a+4]=i>>8&255,s[a+5]=255&i,s[a+6]=n>>8&255,s[a+7]=255&n,s[a+8]=o>>8&255,s[a+9]=255&o,e._sQlen+=10,e.flush()},xvpOp:function(e,t,r){var i=e._sQ,n=e._sQlen;i[n]=250,i[n+1]=0,i[n+2]=t,i[n+3]=r,e._sQlen+=4,e.flush()}},U.cursors={none:{rgbaPixels:new Uint8Array,w:0,h:0,hotx:0,hoty:0},dot:{rgbaPixels:new Uint8Array([255,255,255,255,0,0,0,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,255,255,255,255,255]),w:3,h:3,hotx:1,hoty:1}}},41895:function(e,t,r){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isMac=function(){return navigator&&!!/mac/i.exec(navigator.platform)},t.isWindows=function(){return navigator&&!!/win/i.exec(navigator.platform)},t.isIOS=function(){return navigator&&(!!/ipad/i.exec(navigator.platform)||!!/iphone/i.exec(navigator.platform)||!!/ipod/i.exec(navigator.platform))},t.isSafari=function(){return navigator&&-1!==navigator.userAgent.indexOf("Safari")&&-1===navigator.userAgent.indexOf("Chrome")},t.isIE=function(){return navigator&&!!/trident/i.exec(navigator.userAgent)},t.isEdge=function(){return navigator&&!!/edge/i.exec(navigator.userAgent)},t.isFirefox=function(){return navigator&&!!/firefox/i.exec(navigator.userAgent)},t.hasScrollbarGutter=t.supportsImageMetadata=t.supportsCursorURIs=t.dragThreshold=t.isTouchDevice=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var a=n?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=e[s]}r.default=e,t&&t.set(e,r);return r}(r(50500));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}t.isTouchDevice=!1,window.addEventListener("touchstart",(function(){}),!1);var s=10*(window.devicePixelRatio||1);t.dragThreshold=s;var a=!1;try{var c=document.createElement("canvas");c.style.cursor='url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default',0===c.style.cursor.indexOf("url")?(n.Info("Data URI scheme cursor supported"),a=!0):n.Warn("Data URI scheme cursor not supported")}catch(e){n.Error("Data URI scheme cursor test exception: "+e)}var l=a;t.supportsCursorURIs=l;var u=!1;try{new ImageData(new Uint8ClampedArray(4),1,1),u=!0}catch(e){}var h=u;t.supportsImageMetadata=h;var f=!0;try{var d=document.createElement("div");d.style.visibility="hidden",d.style.overflow="scroll",document.body.appendChild(d);var _=document.createElement("div");d.appendChild(_);var p=d.offsetWidth-_.offsetWidth;d.parentNode.removeChild(d),f=0!=p}catch(e){n.Error("Scrollbar test exception: "+e)}var v=f;t.hasScrollbarGutter=v},54641:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(41895);function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var o=!i.supportsCursorURIs||i.isTouchDevice,s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._target=null,this._canvas=document.createElement("canvas"),o&&(this._canvas.style.position="fixed",this._canvas.style.zIndex="65535",this._canvas.style.pointerEvents="none",this._canvas.style.visibility="hidden"),this._position={x:0,y:0},this._hotSpot={x:0,y:0},this._eventHandlers={mouseover:this._handleMouseOver.bind(this),mouseleave:this._handleMouseLeave.bind(this),mousemove:this._handleMouseMove.bind(this),mouseup:this._handleMouseUp.bind(this)}}var t,r,i;return t=e,(r=[{key:"attach",value:function(e){if(this._target&&this.detach(),this._target=e,o){document.body.appendChild(this._canvas);var t={capture:!0,passive:!0};this._target.addEventListener("mouseover",this._eventHandlers.mouseover,t),this._target.addEventListener("mouseleave",this._eventHandlers.mouseleave,t),this._target.addEventListener("mousemove",this._eventHandlers.mousemove,t),this._target.addEventListener("mouseup",this._eventHandlers.mouseup,t)}this.clear()}},{key:"detach",value:function(){if(this._target){if(o){var e={capture:!0,passive:!0};this._target.removeEventListener("mouseover",this._eventHandlers.mouseover,e),this._target.removeEventListener("mouseleave",this._eventHandlers.mouseleave,e),this._target.removeEventListener("mousemove",this._eventHandlers.mousemove,e),this._target.removeEventListener("mouseup",this._eventHandlers.mouseup,e),document.body.removeChild(this._canvas)}this._target=null}}},{key:"change",value:function(e,t,r,i,n){if(0!==i&&0!==n){this._position.x=this._position.x+this._hotSpot.x-t,this._position.y=this._position.y+this._hotSpot.y-r,this._hotSpot.x=t,this._hotSpot.y=r;var s,a=this._canvas.getContext("2d");this._canvas.width=i,this._canvas.height=n;try{s=new ImageData(new Uint8ClampedArray(e),i,n)}catch(t){(s=a.createImageData(i,n)).data.set(new Uint8ClampedArray(e))}if(a.clearRect(0,0,i,n),a.putImageData(s,0,0),o)this._updatePosition();else{var c=this._canvas.toDataURL();this._target.style.cursor="url("+c+")"+t+" "+r+", default"}}else this.clear()}},{key:"clear",value:function(){this._target.style.cursor="none",this._canvas.width=0,this._canvas.height=0,this._position.x=this._position.x+this._hotSpot.x,this._position.y=this._position.y+this._hotSpot.y,this._hotSpot.x=0,this._hotSpot.y=0}},{key:"move",value:function(e,t){if(o){window.visualViewport?(this._position.x=e+window.visualViewport.offsetLeft,this._position.y=t+window.visualViewport.offsetTop):(this._position.x=e,this._position.y=t),this._updatePosition();var r=document.elementFromPoint(e,t);this._updateVisibility(r)}}},{key:"_handleMouseOver",value:function(e){this._handleMouseMove(e)}},{key:"_handleMouseLeave",value:function(e){this._updateVisibility(e.relatedTarget)}},{key:"_handleMouseMove",value:function(e){this._updateVisibility(e.target),this._position.x=e.clientX-this._hotSpot.x,this._position.y=e.clientY-this._hotSpot.y,this._updatePosition()}},{key:"_handleMouseUp",value:function(e){var t=this,r=document.elementFromPoint(e.clientX,e.clientY);this._updateVisibility(r),this._captureIsActive()&&window.setTimeout((function(){t._target&&(r=document.elementFromPoint(e.clientX,e.clientY),t._updateVisibility(r))}),0)}},{key:"_showCursor",value:function(){"hidden"===this._canvas.style.visibility&&(this._canvas.style.visibility="")}},{key:"_hideCursor",value:function(){"hidden"!==this._canvas.style.visibility&&(this._canvas.style.visibility="hidden")}},{key:"_shouldShowCursor",value:function(e){return!!e&&(e===this._target||!!this._target.contains(e)&&"none"===window.getComputedStyle(e).cursor)}},{key:"_updateVisibility",value:function(e){this._captureIsActive()&&(e=document.captureElement),this._shouldShowCursor(e)?this._showCursor():this._hideCursor()}},{key:"_updatePosition",value:function(){this._canvas.style.left=this._position.x+"px",this._canvas.style.top=this._position.y+"px"}},{key:"_captureIsActive",value:function(){return document.captureElement&&document.documentElement.contains(document.captureElement)}}])&&n(t.prototype,r),i&&n(t,i),e}();t.default=s},92742:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clientToElement=function(e,t,r){var i=r.getBoundingClientRect(),n={x:0,y:0};e<i.left?n.x=0:e>=i.right?n.x=i.width-1:n.x=e-i.left;t<i.top?n.y=0:t>=i.bottom?n.y=i.height-1:n.y=t-i.top;return n}},79420:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPointerEvent=function(e){return e.changedTouches?e.changedTouches[0]:e.touches?e.touches[0]:e},t.stopEvent=function(e){e.stopPropagation(),e.preventDefault()},t.setCapture=function(e){if(e.setCapture)e.setCapture(),document.captureElement=e,e.addEventListener("mouseup",a);else{a();var t=document.getElementById("noVNC_mouse_capture_elem");null===t&&((t=document.createElement("div")).id="noVNC_mouse_capture_elem",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.width="100%",t.style.height="100%",t.style.zIndex=1e4,t.style.display="none",document.body.appendChild(t),t.addEventListener("contextmenu",n),t.addEventListener("mousemove",n),t.addEventListener("mouseup",n)),document.captureElement=e,s.observe(e,{attributes:!0}),o(),t.style.display="",window.addEventListener("mousemove",n),window.addEventListener("mouseup",n)}},t.releaseCapture=a;var r=!1,i=null;function n(e){if(!r){var t=new e.constructor(e.type,e);r=!0,document.captureElement?document.captureElement.dispatchEvent(t):i.dispatchEvent(t),r=!1,e.stopPropagation(),t.defaultPrevented&&e.preventDefault(),"mouseup"===e.type&&a()}}function o(){document.getElementById("noVNC_mouse_capture_elem").style.cursor=window.getComputedStyle(document.captureElement).cursor}document.captureElement=null;var s=new MutationObserver(o);function a(){if(document.releaseCapture)document.releaseCapture(),document.captureElement=null;else{if(!document.captureElement)return;i=document.captureElement,document.captureElement=null,s.disconnect(),document.getElementById("noVNC_mouse_capture_elem").style.display="none",window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",n)}}},5004:function(e,t){"use strict";function r(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._listeners=new Map}var t,i,n;return t=e,(i=[{key:"addEventListener",value:function(e,t){this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t)}},{key:"removeEventListener",value:function(e,t){this._listeners.has(e)&&this._listeners.get(e).delete(t)}},{key:"dispatchEvent",value:function(e){var t=this;return!this._listeners.has(e.type)||(this._listeners.get(e.type).forEach((function(r){return r.call(t,e)})),!e.defaultPrevented)}}])&&r(t.prototype,i),n&&r(t,n),e}();t.default=i},20860:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toUnsigned32bit=function(e){return e>>>0},t.toSigned32bit=function(e){return 0|e}},50500:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initLogging=a,t.getLogging=function(){return r},t.Error=t.Warn=t.Info=t.Debug=void 0;var r="warn",i=function(){};t.Debug=i;var n=function(){};t.Info=n;var o=function(){};t.Warn=o;var s=function(){};function a(e){if(void 0===e?e=r:r=e,t.Debug=i=t.Info=n=t.Warn=o=t.Error=s=function(){},void 0!==window.console)switch(e){case"debug":t.Debug=i=console.debug.bind(window.console);case"info":t.Info=n=console.info.bind(window.console);case"warn":t.Warn=o=console.warn.bind(window.console);case"error":t.Error=s=console.error.bind(window.console);case"none":break;default:throw new window.Error("invalid logging type '"+e+"'")}}t.Error=s,a()},21882:function(){"use strict";"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])}return r},writable:!0,configurable:!0}),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var r=document.createEvent("CustomEvent");return r.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r}e.prototype=window.Event.prototype,"function"!=typeof window.CustomEvent&&(window.CustomEvent=e)}(),Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}},31516:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeUTF8=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{return decodeURIComponent(escape(e))}catch(r){if(r instanceof URIError&&t)return e;throw r}},t.encodeUTF8=function(e){return unescape(encodeURIComponent(e))}},35986:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shrinkBuf=function(e,t){if(e.length===t)return e;if(e.subarray)return e.subarray(0,t);return e.length=t,e},t.arraySet=function(e,t,r,i,n){if(t.subarray&&e.subarray)return void e.set(t.subarray(r,r+i),n);for(var o=0;o<i;o++)e[n+o]=t[r+o]},t.flattenChunks=function(e){var t,r,i,n,o,s;for(i=0,t=0,r=e.length;t<r;t++)i+=e[t].length;for(s=new Uint8Array(i),n=0,t=0,r=e.length;t<r;t++)o=e[t],s.set(o,n),n+=o.length;return s},t.Buf32=t.Buf16=t.Buf8=void 0;var r=Uint8Array;t.Buf8=r;var i=Uint16Array;t.Buf16=i;var n=Int32Array;t.Buf32=n},97580:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,i){var n=65535&e|0,o=e>>>16&65535|0,s=0;for(;0!==r;){r-=s=r>2e3?2e3:r;do{o=o+(n=n+t[i++]|0)|0}while(--s);n%=65521,o%=65521}return n|o<<16|0}},1217:function(e,t){"use strict";function r(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;r()},25805:function(e,t,r){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.deflateInit=function(e,t){return O(e,t,8,15,8,0)},t.deflateInit2=O,t.deflateReset=P,t.deflateResetKeep=D,t.deflateSetHeader=function(e,t){if(!e||!e.state)return f;if(2!==e.state.wrap)return f;return e.state.gzhead=t,0},t.deflate=function(e,t){var r,i,n,s;if(!e||!e.state||t>5||t<0)return e?m(e,f):f;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===y&&4!==t)return m(e,0===e.avail_out?-5:f);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,k(i,31),k(i,139),k(i,8),i.gzhead?(k(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),k(i,255&i.gzhead.time),k(i,i.gzhead.time>>8&255),k(i,i.gzhead.time>>16&255),k(i,i.gzhead.time>>24&255),k(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),k(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(k(i,255&i.gzhead.extra.length),k(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=(0,a.default)(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(k(i,0),k(i,0),k(i,0),k(i,0),k(i,0),k(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),k(i,3),i.status=g);else{var c=8+(i.w_bits-8<<4)<<8;c|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(c|=32),c+=31-c%31,i.status=g,E(i,c),0!==i.strstart&&(E(i,e.adler>>>16),E(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(e.adler=(0,a.default)(e.adler,i.pending_buf,i.pending-n,n)),S(e),n=i.pending,i.pending!==i.pending_buf_size));)k(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=(0,a.default)(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=(0,a.default)(e.adler,i.pending_buf,i.pending-n,n)),S(e),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,k(i,s)}while(0!==s);i.gzhead.hcrc&&i.pending>n&&(e.adler=(0,a.default)(e.adler,i.pending_buf,i.pending-n,n)),0===s&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=(0,a.default)(e.adler,i.pending_buf,i.pending-n,n)),S(e),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,k(i,s)}while(0!==s);i.gzhead.hcrc&&i.pending>n&&(e.adler=(0,a.default)(e.adler,i.pending_buf,i.pending-n,n)),0===s&&(i.status=v)}else i.status=v;i.status===v&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&S(e),i.pending+2<=i.pending_buf_size&&(k(i,255&e.adler),k(i,e.adler>>8&255),e.adler=0,i.status=g)):i.status=g);if(0!==i.pending){if(S(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&b(t)<=b(r)&&4!==t)return m(e,-5);if(i.status===y&&0!==e.avail_in)return m(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&i.status!==y){var l=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(L(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(C(e,!1),0===e.strm.avail_out))return 1}if(e.insert=0,4===t)return C(e,!0),0===e.strm.avail_out?3:4;if(e.last_lit&&(C(e,!1),0===e.strm.avail_out))return 1;return 2}(i,t):3===i.strategy?function(e,t){for(var r,i,n,s,a=e.window;;){if(e.lookahead<=_){if(L(e),e.lookahead<=_&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=a[n=e.strstart-1])===a[++n]&&i===a[++n]&&i===a[++n]){s=e.strstart+_;do{}while(i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&n<s);e.match_length=_-(s-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(C(e,!1),0===e.strm.avail_out))return 1}if(e.insert=0,4===t)return C(e,!0),0===e.strm.avail_out?3:4;if(e.last_lit&&(C(e,!1),0===e.strm.avail_out))return 1;return 2}(i,t):d[i.level].func(i,t);if(3!==l&&4!==l||(i.status=y),1===l||3===l)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===l&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(w(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),S(e),0===e.avail_out))return i.last_flush=-1,0}if(4!==t)return 0;if(i.wrap<=0)return 1;2===i.wrap?(k(i,255&e.adler),k(i,e.adler>>8&255),k(i,e.adler>>16&255),k(i,e.adler>>24&255),k(i,255&e.total_in),k(i,e.total_in>>8&255),k(i,e.total_in>>16&255),k(i,e.total_in>>24&255)):(E(i,e.adler>>>16),E(i,65535&e.adler));S(e),i.wrap>0&&(i.wrap=-i.wrap);return 0!==i.pending?0:1},t.deflateEnd=function(e){var t;if(!e||!e.state)return f;if(42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==v&&t!==g&&t!==y)return m(e,f);return e.state=null,t===g?m(e,-3):0},t.deflateSetDictionary=function(e,t){var r,i,o,a,c,l,u,h,d=t.length;if(!e||!e.state)return f;if(r=e.state,2===(a=r.wrap)||1===a&&42!==r.status||r.lookahead)return f;1===a&&(e.adler=(0,s.default)(e.adler,t,d,0));r.wrap=0,d>=r.w_size&&(0===a&&(w(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new n.Buf8(r.w_size),n.arraySet(h,t,d-r.w_size,r.w_size,0),t=h,d=r.w_size);c=e.avail_in,l=e.next_in,u=e.input,e.avail_in=d,e.next_in=0,e.input=t,L(r);for(;r.lookahead>=3;){i=r.strstart,o=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[i+3-1])&r.hash_mask,r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++}while(--o);r.strstart=i,r.lookahead=2,L(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,e.next_in=l,e.input=u,e.avail_in=c,r.wrap=a,0},t.deflateInfo=t.Z_DEFLATED=t.Z_UNKNOWN=t.Z_DEFAULT_STRATEGY=t.Z_FIXED=t.Z_RLE=t.Z_HUFFMAN_ONLY=t.Z_FILTERED=t.Z_DEFAULT_COMPRESSION=t.Z_BUF_ERROR=t.Z_DATA_ERROR=t.Z_STREAM_ERROR=t.Z_STREAM_END=t.Z_OK=t.Z_BLOCK=t.Z_FINISH=t.Z_FULL_FLUSH=t.Z_PARTIAL_FLUSH=t.Z_NO_FLUSH=void 0;var n=h(r(35986)),o=h(r(55796)),s=l(r(97580)),a=l(r(1217)),c=l(r(70892));function l(e){return e&&e.__esModule?e:{default:e}}function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function h(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}t.Z_NO_FLUSH=0;t.Z_PARTIAL_FLUSH=1;t.Z_FULL_FLUSH=3;t.Z_FINISH=4;t.Z_BLOCK=5;t.Z_OK=0;t.Z_STREAM_END=1;var f=-2;t.Z_STREAM_ERROR=f;t.Z_DATA_ERROR=-3;t.Z_BUF_ERROR=-5;t.Z_DEFAULT_COMPRESSION=-1;t.Z_FILTERED=1;t.Z_HUFFMAN_ONLY=2;t.Z_RLE=3;t.Z_FIXED=4;t.Z_DEFAULT_STRATEGY=0;t.Z_UNKNOWN=2;t.Z_DEFLATED=8;var d,_=258,p=262,v=103,g=113,y=666;function m(e,t){return e.msg=c.default[t],t}function b(e){return(e<<1)-(e>4?9:0)}function w(e){for(var t=e.length;--t>=0;)e[t]=0}function S(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(n.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function C(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,S(e.strm)}function k(e,t){e.pending_buf[e.pending++]=t}function E(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function x(e,t){var r,i,n=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,c=e.strstart>e.w_size-p?e.strstart-(e.w_size-p):0,l=e.window,u=e.w_mask,h=e.prev,f=e.strstart+_,d=l[o+s-1],v=l[o+s];e.prev_length>=e.good_match&&(n>>=2),a>e.lookahead&&(a=e.lookahead);do{if(l[(r=t)+s]===v&&l[r+s-1]===d&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&o<f);if(i=_-(f-o),o=f-_,i>s){if(e.match_start=t,s=i,i>=a)break;d=l[o+s-1],v=l[o+s]}}}while((t=h[t&u])>c&&0!=--n);return s<=e.lookahead?s:e.lookahead}function L(e){var t,r,i,o,c,l,u,h,f,d,_=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=_+(_-p)){n.arraySet(e.window,e.window,_,_,0),e.match_start-=_,e.strstart-=_,e.block_start-=_,t=r=e.hash_size;do{i=e.head[--t],e.head[t]=i>=_?i-_:0}while(--r);t=r=_;do{i=e.prev[--t],e.prev[t]=i>=_?i-_:0}while(--r);o+=_}if(0===e.strm.avail_in)break;if(l=e.strm,u=e.window,h=e.strstart+e.lookahead,f=o,d=void 0,(d=l.avail_in)>f&&(d=f),r=0===d?0:(l.avail_in-=d,n.arraySet(u,l.input,l.next_in,d,h),1===l.state.wrap?l.adler=(0,s.default)(l.adler,u,d,h):2===l.state.wrap&&(l.adler=(0,a.default)(l.adler,u,d,h)),l.next_in+=d,l.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=3)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<<e.hash_shift^e.window[c+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[c+3-1])&e.hash_mask,e.prev[c&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=c,c++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<p&&0!==e.strm.avail_in)}function A(e,t){for(var r,i;;){if(e.lookahead<p){if(L(e),e.lookahead<p&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-p&&(e.match_length=x(e,r)),e.match_length>=3)if(i=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else i=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(C(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(C(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(C(e,!1),0===e.strm.avail_out)?1:2}function R(e,t){for(var r,i,n;;){if(e.lookahead<p){if(L(e),e.lookahead<p&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-p&&(e.match_length=x(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,i=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,i&&(C(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((i=o._tr_tally(e,0,e.window[e.strstart-1]))&&C(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(C(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(C(e,!1),0===e.strm.avail_out)?1:2}function M(e,t,r,i,n){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=i,this.func=n}function T(){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=8,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 n.Buf16(1146),this.dyn_dtree=new n.Buf16(122),this.bl_tree=new n.Buf16(78),w(this.dyn_ltree),w(this.dyn_dtree),w(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(16),this.heap=new n.Buf16(573),w(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(573),w(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function D(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:g,e.adler=2===t.wrap?0:1,t.last_flush=0,o._tr_init(t),0):m(e,f)}function P(e){var t,r=D(e);return 0===r&&((t=e.state).window_size=2*t.w_size,w(t.head),t.max_lazy_match=d[t.level].max_lazy,t.good_match=d[t.level].good_length,t.nice_match=d[t.level].nice_length,t.max_chain_length=d[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),r}function O(e,t,r,i,o,s){if(!e)return f;var a=1;if(-1===t&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),o<1||o>9||8!==r||i<8||i>15||t<0||t>9||s<0||s>4)return m(e,f);8===i&&(i=9);var c=new T;return e.state=c,c.strm=e,c.wrap=a,c.gzhead=null,c.w_bits=i,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=o+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+3-1)/3),c.window=new n.Buf8(2*c.w_size),c.head=new n.Buf16(c.hash_size),c.prev=new n.Buf16(c.w_size),c.lit_bufsize=1<<o+6,c.pending_buf_size=4*c.lit_bufsize,c.pending_buf=new n.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=t,c.strategy=s,c.method=r,P(e)}d=[new M(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(L(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,C(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-p&&(C(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(C(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(C(e,!1),e.strm.avail_out),1)})),new M(4,4,8,4,A),new M(4,5,16,8,A),new M(4,6,32,32,A),new M(4,4,16,16,R),new M(8,16,32,32,R),new M(8,16,128,128,R),new M(8,32,128,256,R),new M(32,128,258,1024,R),new M(32,258,258,4096,R)];t.deflateInfo="pako deflate (from Nodeca project)"},16071:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r,i,n,o,s,a,c,l,u,h,f,d,_,p,v,g,y,m,b,w,S,C,k,E,x;r=e.state,i=e.next_in,E=e.input,n=i+(e.avail_in-5),o=e.next_out,x=e.output,s=o-(t-e.avail_out),a=o+(e.avail_out-257),c=r.dmax,l=r.wsize,u=r.whave,h=r.wnext,f=r.window,d=r.hold,_=r.bits,p=r.lencode,v=r.distcode,g=(1<<r.lenbits)-1,y=(1<<r.distbits)-1;e:do{_<15&&(d+=E[i++]<<_,_+=8,d+=E[i++]<<_,_+=8),m=p[d&g];t:for(;;){if(d>>>=b=m>>>24,_-=b,0===(b=m>>>16&255))x[o++]=65535&m;else{if(!(16&b)){if(0==(64&b)){m=p[(65535&m)+(d&(1<<b)-1)];continue t}if(32&b){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&m,(b&=15)&&(_<b&&(d+=E[i++]<<_,_+=8),w+=d&(1<<b)-1,d>>>=b,_-=b),_<15&&(d+=E[i++]<<_,_+=8,d+=E[i++]<<_,_+=8),m=v[d&y];r:for(;;){if(d>>>=b=m>>>24,_-=b,!(16&(b=m>>>16&255))){if(0==(64&b)){m=v[(65535&m)+(d&(1<<b)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(S=65535&m,_<(b&=15)&&(d+=E[i++]<<_,(_+=8)<b&&(d+=E[i++]<<_,_+=8)),(S+=d&(1<<b)-1)>c){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=b,_-=b,S>(b=o-s)){if((b=S-b)>u&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(C=0,k=f,0===h){if(C+=l-b,b<w){w-=b;do{x[o++]=f[C++]}while(--b);C=o-S,k=x}}else if(h<b){if(C+=l+h-b,(b-=h)<w){w-=b;do{x[o++]=f[C++]}while(--b);if(C=0,h<w){w-=b=h;do{x[o++]=f[C++]}while(--b);C=o-S,k=x}}}else if(C+=h-b,b<w){w-=b;do{x[o++]=f[C++]}while(--b);C=o-S,k=x}for(;w>2;)x[o++]=k[C++],x[o++]=k[C++],x[o++]=k[C++],w-=3;w&&(x[o++]=k[C++],w>1&&(x[o++]=k[C++]))}else{C=o-S;do{x[o++]=x[C++],x[o++]=x[C++],x[o++]=x[C++],w-=3}while(w>2);w&&(x[o++]=x[C++],w>1&&(x[o++]=x[C++]))}break}}break}}while(i<n&&o<a);return i-=w=_>>3,d&=(1<<(_-=w<<3))-1,e.next_in=i,e.next_out=o,e.avail_in=i<n?n-i+5:5-(i-n),e.avail_out=o<a?a-o+257:257-(o-a),r.hold=d,void(r.bits=_)}},95766:function(e,t,r){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.inflateReset=g,t.inflateReset2=y,t.inflateResetKeep=v,t.inflateInit=function(e){return m(e,15)},t.inflateInit2=m,t.inflate=function(e,t){var r,i,l,u,p,v,g,y,m,b,w,S,E,x,L,A,R,M,T,D,P,O,X,F,K=0,I=new n.Buf8(4),B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return h;(r=e.state).mode===f&&(r.mode=13);p=e.next_out,l=e.output,g=e.avail_out,u=e.next_in,i=e.input,v=e.avail_in,y=r.hold,m=r.bits,b=v,w=g,O=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;m<16;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}if(2&r.wrap&&35615===y){r.check=0,I[0]=255&y,I[1]=y>>>8&255,r.check=(0,s.default)(r.check,I,2,0),y=0,m=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&y)<<8)+(y>>8))%31){e.msg="incorrect header check",r.mode=d;break}if(8!=(15&y)){e.msg="unknown compression method",r.mode=d;break}if(m-=4,P=8+(15&(y>>>=4)),0===r.wbits)r.wbits=P;else if(P>r.wbits){e.msg="invalid window size",r.mode=d;break}r.dmax=1<<P,e.adler=r.check=1,r.mode=512&y?10:f,y=0,m=0;break;case 2:for(;m<16;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}if(r.flags=y,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=d;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=d;break}r.head&&(r.head.text=y>>8&1),512&r.flags&&(I[0]=255&y,I[1]=y>>>8&255,r.check=(0,s.default)(r.check,I,2,0)),y=0,m=0,r.mode=3;case 3:for(;m<32;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}r.head&&(r.head.time=y),512&r.flags&&(I[0]=255&y,I[1]=y>>>8&255,I[2]=y>>>16&255,I[3]=y>>>24&255,r.check=(0,s.default)(r.check,I,4,0)),y=0,m=0,r.mode=4;case 4:for(;m<16;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}r.head&&(r.head.xflags=255&y,r.head.os=y>>8),512&r.flags&&(I[0]=255&y,I[1]=y>>>8&255,r.check=(0,s.default)(r.check,I,2,0)),y=0,m=0,r.mode=5;case 5:if(1024&r.flags){for(;m<16;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}r.length=y,r.head&&(r.head.extra_len=y),512&r.flags&&(I[0]=255&y,I[1]=y>>>8&255,r.check=(0,s.default)(r.check,I,2,0)),y=0,m=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((S=r.length)>v&&(S=v),S&&(r.head&&(P=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,i,u,S,P)),512&r.flags&&(r.check=(0,s.default)(r.check,i,S,u)),v-=S,u+=S,r.length-=S),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===v)break e;S=0;do{P=i[u+S++],r.head&&P&&r.length<65536&&(r.head.name+=String.fromCharCode(P))}while(P&&S<v);if(512&r.flags&&(r.check=(0,s.default)(r.check,i,S,u)),v-=S,u+=S,P)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===v)break e;S=0;do{P=i[u+S++],r.head&&P&&r.length<65536&&(r.head.comment+=String.fromCharCode(P))}while(P&&S<v);if(512&r.flags&&(r.check=(0,s.default)(r.check,i,S,u)),v-=S,u+=S,P)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;m<16;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}if(y!==(65535&r.check)){e.msg="header crc mismatch",r.mode=d;break}y=0,m=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=f;break;case 10:for(;m<32;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}e.adler=r.check=_(y),y=0,m=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=p,e.avail_out=g,e.next_in=u,e.avail_in=v,r.hold=y,r.bits=m,2;e.adler=r.check=1,r.mode=f;case f:if(5===t||6===t)break e;case 13:if(r.last){y>>>=7&m,m-=7&m,r.mode=27;break}for(;m<3;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}switch(r.last=1&y,m-=1,3&(y>>>=1)){case 0:r.mode=14;break;case 1:if(C(r),r.mode=20,6===t){y>>>=2,m-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=d}y>>>=2,m-=2;break;case 14:for(y>>>=7&m,m-=7&m;m<32;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}if((65535&y)!=(y>>>16^65535)){e.msg="invalid stored block lengths",r.mode=d;break}if(r.length=65535&y,y=0,m=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(S=r.length){if(S>v&&(S=v),S>g&&(S=g),0===S)break e;n.arraySet(l,i,u,S,p),v-=S,u+=S,g-=S,p+=S,r.length-=S;break}r.mode=f;break;case 17:for(;m<14;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}if(r.nlen=257+(31&y),y>>>=5,m-=5,r.ndist=1+(31&y),y>>>=5,m-=5,r.ncode=4+(15&y),y>>>=4,m-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=d;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;m<3;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}r.lens[B[r.have++]]=7&y,y>>>=3,m-=3}for(;r.have<19;)r.lens[B[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,X={bits:r.lenbits},O=(0,c.default)(0,r.lens,0,19,r.lencode,0,r.work,X),r.lenbits=X.bits,O){e.msg="invalid code lengths set",r.mode=d;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;A=(K=r.lencode[y&(1<<r.lenbits)-1])>>>16&255,R=65535&K,!((L=K>>>24)<=m);){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}if(R<16)y>>>=L,m-=L,r.lens[r.have++]=R;else{if(16===R){for(F=L+2;m<F;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}if(y>>>=L,m-=L,0===r.have){e.msg="invalid bit length repeat",r.mode=d;break}P=r.lens[r.have-1],S=3+(3&y),y>>>=2,m-=2}else if(17===R){for(F=L+3;m<F;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}m-=L,P=0,S=3+(7&(y>>>=L)),y>>>=3,m-=3}else{for(F=L+7;m<F;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}m-=L,P=0,S=11+(127&(y>>>=L)),y>>>=7,m-=7}if(r.have+S>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=d;break}for(;S--;)r.lens[r.have++]=P}}if(r.mode===d)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=d;break}if(r.lenbits=9,X={bits:r.lenbits},O=(0,c.default)(1,r.lens,0,r.nlen,r.lencode,0,r.work,X),r.lenbits=X.bits,O){e.msg="invalid literal/lengths set",r.mode=d;break}if(r.distbits=6,r.distcode=r.distdyn,X={bits:r.distbits},O=(0,c.default)(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,X),r.distbits=X.bits,O){e.msg="invalid distances set",r.mode=d;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(v>=6&&g>=258){e.next_out=p,e.avail_out=g,e.next_in=u,e.avail_in=v,r.hold=y,r.bits=m,(0,a.default)(e,w),p=e.next_out,l=e.output,g=e.avail_out,u=e.next_in,i=e.input,v=e.avail_in,y=r.hold,m=r.bits,r.mode===f&&(r.back=-1);break}for(r.back=0;A=(K=r.lencode[y&(1<<r.lenbits)-1])>>>16&255,R=65535&K,!((L=K>>>24)<=m);){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}if(A&&0==(240&A)){for(M=L,T=A,D=R;A=(K=r.lencode[D+((y&(1<<M+T)-1)>>M)])>>>16&255,R=65535&K,!(M+(L=K>>>24)<=m);){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}y>>>=M,m-=M,r.back+=M}if(y>>>=L,m-=L,r.back+=L,r.length=R,0===A){r.mode=26;break}if(32&A){r.back=-1,r.mode=f;break}if(64&A){e.msg="invalid literal/length code",r.mode=d;break}r.extra=15&A,r.mode=22;case 22:if(r.extra){for(F=r.extra;m<F;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}r.length+=y&(1<<r.extra)-1,y>>>=r.extra,m-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;A=(K=r.distcode[y&(1<<r.distbits)-1])>>>16&255,R=65535&K,!((L=K>>>24)<=m);){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}if(0==(240&A)){for(M=L,T=A,D=R;A=(K=r.distcode[D+((y&(1<<M+T)-1)>>M)])>>>16&255,R=65535&K,!(M+(L=K>>>24)<=m);){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}y>>>=M,m-=M,r.back+=M}if(y>>>=L,m-=L,r.back+=L,64&A){e.msg="invalid distance code",r.mode=d;break}r.offset=R,r.extra=15&A,r.mode=24;case 24:if(r.extra){for(F=r.extra;m<F;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}r.offset+=y&(1<<r.extra)-1,y>>>=r.extra,m-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=d;break}r.mode=25;case 25:if(0===g)break e;if(S=w-g,r.offset>S){if((S=r.offset-S)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=d;break}S>r.wnext?(S-=r.wnext,E=r.wsize-S):E=r.wnext-S,S>r.length&&(S=r.length),x=r.window}else x=l,E=p-r.offset,S=r.length;S>g&&(S=g),g-=S,r.length-=S;do{l[p++]=x[E++]}while(--S);0===r.length&&(r.mode=21);break;case 26:if(0===g)break e;l[p++]=r.length,g--,r.mode=21;break;case 27:if(r.wrap){for(;m<32;){if(0===v)break e;v--,y|=i[u++]<<m,m+=8}if(w-=g,e.total_out+=w,r.total+=w,w&&(e.adler=r.check=r.flags?(0,s.default)(r.check,l,w,p-w):(0,o.default)(r.check,l,w,p-w)),w=g,(r.flags?y:_(y))!==r.check){e.msg="incorrect data check",r.mode=d;break}y=0,m=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;m<32;){if(0===v)break e;v--,y+=i[u++]<<m,m+=8}if(y!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=d;break}y=0,m=0}r.mode=29;case 29:O=1;break e;case d:O=-3;break e;case 31:return-4;default:return h}if(e.next_out=p,e.avail_out=g,e.next_in=u,e.avail_in=v,r.hold=y,r.bits=m,(r.wsize||w!==e.avail_out&&r.mode<d&&(r.mode<27||4!==t))&&k(e,e.output,e.next_out,w-e.avail_out))return r.mode=31,-4;b-=e.avail_in,w-=e.avail_out,e.total_in+=b,e.total_out+=w,r.total+=w,r.wrap&&w&&(e.adler=r.check=r.flags?(0,s.default)(r.check,l,w,e.next_out-w):(0,o.default)(r.check,l,w,e.next_out-w));e.data_type=r.bits+(r.last?64:0)+(r.mode===f?128:0)+(20===r.mode||15===r.mode?256:0),(0===b&&0===w||4===t)&&0===O&&(O=-5);return O},t.inflateEnd=function(e){if(!e||!e.state)return h;var t=e.state;t.window&&(t.window=null);return e.state=null,0},t.inflateGetHeader=function(e,t){var r;if(!e||!e.state)return h;if(0==(2&(r=e.state).wrap))return h;return r.head=t,t.done=!1,0},t.inflateSetDictionary=function(e,t){var r,i,n=t.length;if(!e||!e.state)return h;if(0!==(r=e.state).wrap&&11!==r.mode)return h;if(11===r.mode&&(i=1,(i=(0,o.default)(i,t,n,0))!==r.check))return-3;if(k(e,t,n,n))return r.mode=31,-4;return r.havedict=1,0},t.inflateInfo=t.Z_DEFLATED=t.Z_BUF_ERROR=t.Z_MEM_ERROR=t.Z_DATA_ERROR=t.Z_STREAM_ERROR=t.Z_NEED_DICT=t.Z_STREAM_END=t.Z_OK=t.Z_TREES=t.Z_BLOCK=t.Z_FINISH=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r(35986)),o=l(r(97580)),s=l(r(1217)),a=l(r(16071)),c=l(r(63093));function l(e){return e&&e.__esModule?e:{default:e}}function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}t.Z_FINISH=4;t.Z_BLOCK=5;t.Z_TREES=6;t.Z_OK=0;t.Z_STREAM_END=1;t.Z_NEED_DICT=2;var h=-2;t.Z_STREAM_ERROR=h;t.Z_DATA_ERROR=-3;t.Z_MEM_ERROR=-4;t.Z_BUF_ERROR=-5;t.Z_DEFLATED=8;var f=12,d=30;function _(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function p(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function v(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):h}function g(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,v(e)):h}function y(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?h:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,g(e))):h}function m(e,t){var r,i;return e?(i=new p,e.state=i,i.window=null,0!==(r=y(e,t))&&(e.state=null),r):h}var b,w,S=!0;function C(e){if(S){var t;for(b=new n.Buf32(512),w=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for((0,c.default)(1,e.lens,0,288,b,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;(0,c.default)(2,e.lens,0,32,w,0,e.work,{bits:5}),S=!1}e.lencode=b,e.lenbits=9,e.distcode=w,e.distbits=5}function k(e,t,r,i){var o,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new n.Buf8(s.wsize)),i>=s.wsize?(n.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>i&&(o=i),n.arraySet(s.window,t,r-i,o,s.wnext),(i-=o)?(n.arraySet(s.window,t,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}t.inflateInfo="pako inflate (from Nodeca project)"},63093:function(e,t,r){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,i,o,h,f,d){var _,p,v,g,y,m,b,w,S,C=d.bits,k=0,E=0,x=0,L=0,A=0,R=0,M=0,T=0,D=0,P=0,O=null,X=0,F=new n.Buf16(16),K=new n.Buf16(16),I=null,B=0;for(k=0;k<=s;k++)F[k]=0;for(E=0;E<i;E++)F[t[r+E]]++;for(A=C,L=s;L>=1&&0===F[L];L--);A>L&&(A=L);if(0===L)return o[h++]=20971520,o[h++]=20971520,d.bits=1,0;for(x=1;x<L&&0===F[x];x++);A<x&&(A=x);for(T=1,k=1;k<=s;k++)if(T<<=1,(T-=F[k])<0)return-1;if(T>0&&(0===e||1!==L))return-1;for(K[1]=0,k=1;k<s;k++)K[k+1]=K[k]+F[k];for(E=0;E<i;E++)0!==t[r+E]&&(f[K[t[r+E]]++]=E);0===e?(O=I=f,m=19):1===e?(O=a,X-=257,I=c,B-=257,m=256):(O=l,I=u,m=-1);if(P=0,E=0,k=x,y=h,R=A,M=0,v=-1,g=(D=1<<A)-1,1===e&&D>852||2===e&&D>592)return 1;for(;;){b=k-M,f[E]<m?(w=0,S=f[E]):f[E]>m?(w=I[B+f[E]],S=O[X+f[E]]):(w=96,S=0),_=1<<k-M,x=p=1<<R;do{o[y+(P>>M)+(p-=_)]=b<<24|w<<16|S|0}while(0!==p);for(_=1<<k-1;P&_;)_>>=1;if(0!==_?(P&=_-1,P+=_):P=0,E++,0==--F[k]){if(k===L)break;k=t[r+f[E]]}if(k>A&&(P&g)!==v){for(0===M&&(M=A),y+=x,T=1<<(R=k-M);R+M<L&&!((T-=F[R+M])<=0);)R++,T<<=1;if(D+=1<<R,1===e&&D>852||2===e&&D>592)return 1;o[v=P&g]=A<<24|R<<16|y-h|0}}0!==P&&(o[y+P]=k-M<<24|64<<16|0);return d.bits=A,0};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var a=n?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=e[s]}r.default=e,t&&t.set(e,r);return r}(r(35986));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}var s=15,a=[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],c=[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],l=[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],u=[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]},70892:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={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"}},55796:function(e,t,r){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t._tr_init=function(e){H||(!function(){var e,t,r,i,n,o=new Array(16);for(r=0,i=0;i<28;i++)for(m[i]=r,e=0;e<1<<h[i];e++)y[r++]=i;for(y[r-1]=i,n=0,i=0;i<16;i++)for(C[i]=n,e=0;e<1<<f[i];e++)g[n++]=i;for(n>>=7;i<l;i++)for(C[i]=n<<7,e=0;e<1<<f[i]-7;e++)g[256+n++]=i;for(t=0;t<=u;t++)o[t]=0;e=0;for(;e<=143;)p[2*e+1]=8,e++,o[8]++;for(;e<=255;)p[2*e+1]=9,e++,o[9]++;for(;e<=279;)p[2*e+1]=7,e++,o[7]++;for(;e<=287;)p[2*e+1]=8,e++,o[8]++;for(T(p,287,o),e=0;e<l;e++)v[2*e+1]=5,v[2*e]=M(e,5);b=new k(p,h,257,c,u),w=new k(v,f,0,l,u),S=new k(new Array(0),d,0,19,7)}(),H=!0);e.l_desc=new E(e.dyn_ltree,b),e.d_desc=new E(e.dyn_dtree,w),e.bl_desc=new E(e.bl_tree,S),e.bi_buf=0,e.bi_valid=0,D(e)},t._tr_stored_block=j,t._tr_flush_block=function(e,t,r,i){var n,o,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<a;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),K(e,e.l_desc),K(e,e.d_desc),s=function(e){var t;for(I(e,e.dyn_ltree,e.l_desc.max_code),I(e,e.dyn_dtree,e.d_desc.max_code),K(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*_[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),n=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=n&&(n=o)):n=o=r+5;r+4<=n&&-1!==t?j(e,t,r,i):4===e.strategy||o===n?(A(e,2+(i?1:0),3),F(e,p,v)):(A(e,4+(i?1:0),3),function(e,t,r,i){var n;for(A(e,t-257,5),A(e,r-1,5),A(e,i-4,4),n=0;n<i;n++)A(e,e.bl_tree[2*_[n]+1],3);B(e,e.dyn_ltree,t-1),B(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),F(e,e.dyn_ltree,e.dyn_dtree));D(e),i&&P(e)},t._tr_tally=function(e,t,r){e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(y[r]+a+1)]++,e.dyn_dtree[2*x(t)]++);return e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){A(e,2,3),R(e,256,p),function(e){16===e.bi_valid?(L(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var a=n?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=e[s]}r.default=e,t&&t.set(e,r);return r}(r(35986));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function s(e){for(var t=e.length;--t>=0;)e[t]=0}var a=256,c=286,l=30,u=15,h=[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=[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],d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],_=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],p=new Array(576);s(p);var v=new Array(60);s(v);var g=new Array(512);s(g);var y=new Array(256);s(y);var m=new Array(29);s(m);var b,w,S,C=new Array(l);function k(e,t,r,i,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=e&&e.length}function E(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function x(e){return e<256?g[e]:g[256+(e>>>7)]}function L(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function A(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,L(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function R(e,t,r){A(e,r[2*t],r[2*t+1])}function M(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function T(e,t,r){var i,n,o=new Array(16),s=0;for(i=1;i<=u;i++)o[i]=s=s+r[i-1]<<1;for(n=0;n<=t;n++){var a=e[2*n+1];0!==a&&(e[2*n]=M(o[a]++,a))}}function D(e){var t;for(t=0;t<c;t++)e.dyn_ltree[2*t]=0;for(t=0;t<l;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function P(e){e.bi_valid>8?L(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function O(e,t,r,i){var n=2*t,o=2*r;return e[n]<e[o]||e[n]===e[o]&&i[t]<=i[r]}function X(e,t,r){for(var i=e.heap[r],n=r<<1;n<=e.heap_len&&(n<e.heap_len&&O(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!O(t,i,e.heap[n],e.depth));)e.heap[r]=e.heap[n],r=n,n<<=1;e.heap[r]=i}function F(e,t,r){var i,n,o,s,c=0;if(0!==e.last_lit)do{i=e.pending_buf[e.d_buf+2*c]<<8|e.pending_buf[e.d_buf+2*c+1],n=e.pending_buf[e.l_buf+c],c++,0===i?R(e,n,t):(R(e,(o=y[n])+a+1,t),0!==(s=h[o])&&A(e,n-=m[o],s),R(e,o=x(--i),r),0!==(s=f[o])&&A(e,i-=C[o],s))}while(c<e.last_lit);R(e,256,t)}function K(e,t){var r,i,n,o=t.dyn_tree,s=t.stat_desc.static_tree,a=t.stat_desc.has_stree,c=t.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<c;r++)0!==o[2*r]?(e.heap[++e.heap_len]=l=r,e.depth[r]=0):o[2*r+1]=0;for(;e.heap_len<2;)o[2*(n=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[n]=0,e.opt_len--,a&&(e.static_len-=s[2*n+1]);for(t.max_code=l,r=e.heap_len>>1;r>=1;r--)X(e,o,r);n=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],X(e,o,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,o[2*n]=o[2*r]+o[2*i],e.depth[n]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,o[2*r+1]=o[2*i+1]=n,e.heap[1]=n++,X(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,n,o,s,a,c=t.dyn_tree,l=t.max_code,h=t.stat_desc.static_tree,f=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,_=t.stat_desc.extra_base,p=t.stat_desc.max_length,v=0;for(o=0;o<=u;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(o=c[2*c[2*(i=e.heap[r])+1]+1]+1)>p&&(o=p,v++),c[2*i+1]=o,i>l||(e.bl_count[o]++,s=0,i>=_&&(s=d[i-_]),a=c[2*i],e.opt_len+=a*(o+s),f&&(e.static_len+=a*(h[2*i+1]+s)));if(0!==v){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,v-=2}while(v>0);for(o=p;0!==o;o--)for(i=e.bl_count[o];0!==i;)(n=e.heap[--r])>l||(c[2*n+1]!==o&&(e.opt_len+=(o-c[2*n+1])*c[2*n],c[2*n+1]=o),i--)}}(e,t),T(o,l,e.bl_count)}function I(e,t,r){var i,n,o=-1,s=t[1],a=0,c=7,l=4;for(0===s&&(c=138,l=3),t[2*(r+1)+1]=65535,i=0;i<=r;i++)n=s,s=t[2*(i+1)+1],++a<c&&n===s||(a<l?e.bl_tree[2*n]+=a:0!==n?(n!==o&&e.bl_tree[2*n]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,o=n,0===s?(c=138,l=3):n===s?(c=6,l=3):(c=7,l=4))}function B(e,t,r){var i,n,o=-1,s=t[1],a=0,c=7,l=4;for(0===s&&(c=138,l=3),i=0;i<=r;i++)if(n=s,s=t[2*(i+1)+1],!(++a<c&&n===s)){if(a<l)do{R(e,n,e.bl_tree)}while(0!=--a);else 0!==n?(n!==o&&(R(e,n,e.bl_tree),a--),R(e,16,e.bl_tree),A(e,a-3,2)):a<=10?(R(e,17,e.bl_tree),A(e,a-3,3)):(R(e,18,e.bl_tree),A(e,a-11,7));a=0,o=n,0===s?(c=138,l=3):n===s?(c=6,l=3):(c=7,l=4)}}s(C);var H=!1;function j(e,t,r,i){A(e,0+(i?1:0),3),function(e,t,r,i){P(e),i&&(L(e,r),L(e,~r)),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}},27589:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=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}},16327:function(e,t,r){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var a=n?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=e[s]}r.default=e,t&&t.set(e,r);return r}(r(50500));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var a=41943040,c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._websocket=null,this._rQi=0,this._rQlen=0,this._rQbufferSize=4194304,this._rQ=null,this._sQbufferSize=10240,this._sQlen=0,this._sQ=null,this._eventHandlers={message:function(){},open:function(){},close:function(){},error:function(){}}}var t,r,i;return t=e,r=[{key:"rQpeek8",value:function(){return this._rQ[this._rQi]}},{key:"rQskipBytes",value:function(e){this._rQi+=e}},{key:"rQshift8",value:function(){return this._rQshift(1)}},{key:"rQshift16",value:function(){return this._rQshift(2)}},{key:"rQshift32",value:function(){return this._rQshift(4)}},{key:"_rQshift",value:function(e){for(var t=0,r=e-1;r>=0;r--)t+=this._rQ[this._rQi++]<<8*r;return t}},{key:"rQshiftStr",value:function(e){void 0===e&&(e=this.rQlen);for(var t="",r=0;r<e;r+=4096){var i=this.rQshiftBytes(Math.min(4096,e-r));t+=String.fromCharCode.apply(null,i)}return t}},{key:"rQshiftBytes",value:function(e){return void 0===e&&(e=this.rQlen),this._rQi+=e,new Uint8Array(this._rQ.buffer,this._rQi-e,e)}},{key:"rQshiftTo",value:function(e,t){void 0===t&&(t=this.rQlen),e.set(new Uint8Array(this._rQ.buffer,this._rQi,t)),this._rQi+=t}},{key:"rQslice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.rQlen;return new Uint8Array(this._rQ.buffer,this._rQi+e,t-e)}},{key:"rQwait",value:function(e,t,r){if(this.rQlen<t){if(r){if(this._rQi<r)throw new Error("rQwait cannot backup "+r+" bytes");this._rQi-=r}return!0}return!1}},{key:"flush",value:function(){this._sQlen>0&&this._websocket.readyState===WebSocket.OPEN&&(this._websocket.send(this._encodeMessage()),this._sQlen=0)}},{key:"send",value:function(e){this._sQ.set(e,this._sQlen),this._sQlen+=e.length,this.flush()}},{key:"sendString",value:function(e){this.send(e.split("").map((function(e){return e.charCodeAt(0)})))}},{key:"off",value:function(e){this._eventHandlers[e]=function(){}}},{key:"on",value:function(e,t){this._eventHandlers[e]=t}},{key:"_allocateBuffers",value:function(){this._rQ=new Uint8Array(this._rQbufferSize),this._sQ=new Uint8Array(this._sQbufferSize)}},{key:"init",value:function(){this._allocateBuffers(),this._rQi=0,this._websocket=null}},{key:"open",value:function(e,t){var r=this;this.init(),this._websocket=new WebSocket(e,t),this._websocket.binaryType="arraybuffer",this._websocket.onmessage=this._recvMessage.bind(this),this._websocket.onopen=function(){n.Debug(">> WebSock.onopen"),r._websocket.protocol&&n.Info("Server choose sub-protocol: "+r._websocket.protocol),r._eventHandlers.open(),n.Debug("<< WebSock.onopen")},this._websocket.onclose=function(e){n.Debug(">> WebSock.onclose"),r._eventHandlers.close(e),n.Debug("<< WebSock.onclose")},this._websocket.onerror=function(e){n.Debug(">> WebSock.onerror: "+e),r._eventHandlers.error(e),n.Debug("<< WebSock.onerror: "+e)}}},{key:"close",value:function(){this._websocket&&(this._websocket.readyState!==WebSocket.OPEN&&this._websocket.readyState!==WebSocket.CONNECTING||(n.Info("Closing WebSocket connection"),this._websocket.close()),this._websocket.onmessage=function(){})}},{key:"_encodeMessage",value:function(){return new Uint8Array(this._sQ.buffer,0,this._sQlen)}},{key:"_expandCompactRQ",value:function(e){var t=8*(this._rQlen-this._rQi+e),r=this._rQbufferSize<t;if(r&&(this._rQbufferSize=Math.max(2*this._rQbufferSize,t)),this._rQbufferSize>a&&(this._rQbufferSize=a,this._rQbufferSize-this.rQlen<e))throw new Error("Receive Queue buffer exceeded "+a+" bytes, and the new message could not fit");if(r){var i=this._rQ.buffer;this._rQ=new Uint8Array(this._rQbufferSize),this._rQ.set(new Uint8Array(i,this._rQi,this._rQlen-this._rQi))}else this._rQ.set(new Uint8Array(this._rQ.buffer,this._rQi,this._rQlen-this._rQi));this._rQlen=this._rQlen-this._rQi,this._rQi=0}},{key:"_DecodeMessage",value:function(e){var t=new Uint8Array(e);t.length>this._rQbufferSize-this._rQlen&&this._expandCompactRQ(t.length),this._rQ.set(t,this._rQlen),this._rQlen+=t.length}},{key:"_recvMessage",value:function(e){this._DecodeMessage(e.data),this.rQlen>0?(this._eventHandlers.message(),this._rQlen==this._rQi&&(this._rQlen=0,this._rQi=0)):n.Debug("Ignoring empty message")}},{key:"sQ",get:function(){return this._sQ}},{key:"rQ",get:function(){return this._rQ}},{key:"rQi",get:function(){return this._rQi},set:function(e){this._rQi=e}},{key:"rQlen",get:function(){return this._rQlen-this._rQi}}],r&&s(t.prototype,r),i&&s(t,i),e}();t.default=c},66003:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var i=r(75931),n=r(33885),o=r(76190),s=r(59301),a=["show"];function c(e,t){return s.useMemo((function(){var r={};t&&(r.show="object"===(0,o.Z)(t)&&t.formatter?t.formatter:!!t);var s=r=(0,n.Z)((0,n.Z)({},r),e),c=s.show,l=(0,i.Z)(s,a);return(0,n.Z)((0,n.Z)({},l),{},{show:!!c,showFormatter:"function"==typeof c?c:void 0,strategy:l.strategy||function(e){return e.length}})}),[e,t])}},36901:function(e,t,r){"use strict";r.r(t),r.d(t,{BaseInput:function(){return h},default:function(){return m}});var i=r(33885),n=r(54476),o=r(20068),s=r(76190),a=r(92310),c=r.n(a),l=r(59301),u=r(30292),h=l.forwardRef((function(e,t){var r,a,h,f=e.inputElement,d=e.children,_=e.prefixCls,p=e.prefix,v=e.suffix,g=e.addonBefore,y=e.addonAfter,m=e.className,b=e.style,w=e.disabled,S=e.readOnly,C=e.focused,k=e.triggerFocus,E=e.allowClear,x=e.value,L=e.handleReset,A=e.hidden,R=e.classes,M=e.classNames,T=e.dataAttrs,D=e.styles,P=e.components,O=e.onClear,X=null!=d?d:f,F=(null==P?void 0:P.affixWrapper)||"span",K=(null==P?void 0:P.groupWrapper)||"span",I=(null==P?void 0:P.wrapper)||"span",B=(null==P?void 0:P.groupAddon)||"span",H=(0,l.useRef)(null),j=(0,u.X3)(e),U=(0,l.cloneElement)(X,{value:x,className:c()(null===(r=X.props)||void 0===r?void 0:r.className,!j&&(null==M?void 0:M.variant))||null}),N=(0,l.useRef)(null);if(l.useImperativeHandle(t,(function(){return{nativeElement:N.current||H.current}})),j){var W=null;if(E){var z=!w&&!S&&x,q="".concat(_,"-clear-icon"),Q="object"===(0,s.Z)(E)&&null!=E&&E.clearIcon?E.clearIcon:"✖";W=l.createElement("button",{type:"button",tabIndex:-1,onClick:function(e){null==L||L(e),null==O||O()},onMouseDown:function(e){return e.preventDefault()},className:c()(q,(0,o.Z)((0,o.Z)({},"".concat(q,"-hidden"),!z),"".concat(q,"-has-suffix"),!!v))},Q)}var Z="".concat(_,"-affix-wrapper"),V=c()(Z,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat(_,"-disabled"),w),"".concat(Z,"-disabled"),w),"".concat(Z,"-focused"),C),"".concat(Z,"-readonly"),S),"".concat(Z,"-input-with-clear-btn"),v&&E&&x),null==R?void 0:R.affixWrapper,null==M?void 0:M.affixWrapper,null==M?void 0:M.variant),G=(v||E)&&l.createElement("span",{className:c()("".concat(_,"-suffix"),null==M?void 0:M.suffix),style:null==D?void 0:D.suffix},W,v);U=l.createElement(F,(0,n.Z)({className:V,style:null==D?void 0:D.affixWrapper,onClick:function(e){var t;null!==(t=H.current)&&void 0!==t&&t.contains(e.target)&&(null==k||k())}},null==T?void 0:T.affixWrapper,{ref:H}),p&&l.createElement("span",{className:c()("".concat(_,"-prefix"),null==M?void 0:M.prefix),style:null==D?void 0:D.prefix},p),U,G)}if((0,u.He)(e)){var Y="".concat(_,"-group"),J="".concat(Y,"-addon"),$="".concat(Y,"-wrapper"),ee=c()("".concat(_,"-wrapper"),Y,null==R?void 0:R.wrapper,null==M?void 0:M.wrapper),te=c()($,(0,o.Z)({},"".concat($,"-disabled"),w),null==R?void 0:R.group,null==M?void 0:M.groupWrapper);U=l.createElement(K,{className:te,ref:N},l.createElement(I,{className:ee},g&&l.createElement(B,{className:J},g),U,y&&l.createElement(B,{className:J},y)))}return l.cloneElement(U,{className:c()(null===(a=U.props)||void 0===a?void 0:a.className,m)||null,style:(0,i.Z)((0,i.Z)({},null===(h=U.props)||void 0===h?void 0:h.style),b),hidden:A})})),f=r(94480),d=r(42978),_=r(75931),p=r(18929),v=r(2738),g=r(66003),y=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],m=(0,l.forwardRef)((function(e,t){var r=e.autoComplete,s=e.onChange,a=e.onFocus,m=e.onBlur,b=e.onPressEnter,w=e.onKeyDown,S=e.onKeyUp,C=e.prefixCls,k=void 0===C?"rc-input":C,E=e.disabled,x=e.htmlSize,L=e.className,A=e.maxLength,R=e.suffix,M=e.showCount,T=e.count,D=e.type,P=void 0===D?"text":D,O=e.classes,X=e.classNames,F=e.styles,K=e.onCompositionStart,I=e.onCompositionEnd,B=(0,_.Z)(e,y),H=(0,l.useState)(!1),j=(0,d.Z)(H,2),U=j[0],N=j[1],W=(0,l.useRef)(!1),z=(0,l.useRef)(!1),q=(0,l.useRef)(null),Q=(0,l.useRef)(null),Z=function(e){q.current&&(0,u.nH)(q.current,e)},V=(0,p.Z)(e.defaultValue,{value:e.value}),G=(0,d.Z)(V,2),Y=G[0],J=G[1],$=null==Y?"":String(Y),ee=(0,l.useState)(null),te=(0,d.Z)(ee,2),re=te[0],ie=te[1],ne=(0,g.Z)(T,M),oe=ne.max||A,se=ne.strategy($),ae=!!oe&&se>oe;(0,l.useImperativeHandle)(t,(function(){var e;return{focus:Z,blur:function(){var e;null===(e=q.current)||void 0===e||e.blur()},setSelectionRange:function(e,t,r){var i;null===(i=q.current)||void 0===i||i.setSelectionRange(e,t,r)},select:function(){var e;null===(e=q.current)||void 0===e||e.select()},input:q.current,nativeElement:(null===(e=Q.current)||void 0===e?void 0:e.nativeElement)||q.current}})),(0,l.useEffect)((function(){z.current&&(z.current=!1),N((function(e){return(!e||!E)&&e}))}),[E]);var ce=function(e,t,r){var i,n,o=t;if(!W.current&&ne.exceedFormatter&&ne.max&&ne.strategy(t)>ne.max)t!==(o=ne.exceedFormatter(t,{max:ne.max}))&&ie([(null===(i=q.current)||void 0===i?void 0:i.selectionStart)||0,(null===(n=q.current)||void 0===n?void 0:n.selectionEnd)||0]);else if("compositionEnd"===r.source)return;J(o),q.current&&(0,u.rJ)(q.current,e,s,o)};(0,l.useEffect)((function(){var e;re&&(null===(e=q.current)||void 0===e||e.setSelectionRange.apply(e,(0,f.Z)(re)))}),[re]);var le,ue=function(e){ce(e,e.target.value,{source:"change"})},he=function(e){W.current=!1,ce(e,e.currentTarget.value,{source:"compositionEnd"}),null==I||I(e)},fe=function(e){b&&"Enter"===e.key&&!z.current&&(z.current=!0,b(e)),null==w||w(e)},de=function(e){"Enter"===e.key&&(z.current=!1),null==S||S(e)},_e=function(e){N(!0),null==a||a(e)},pe=function(e){z.current&&(z.current=!1),N(!1),null==m||m(e)},ve=ae&&"".concat(k,"-out-of-range");return l.createElement(h,(0,n.Z)({},B,{prefixCls:k,className:c()(L,ve),handleReset:function(e){J(""),Z(),q.current&&(0,u.rJ)(q.current,e,s)},value:$,focused:U,triggerFocus:Z,suffix:function(){var e=Number(oe)>0;if(R||ne.show){var t=ne.showFormatter?ne.showFormatter({value:$,count:se,maxLength:oe}):"".concat(se).concat(e?" / ".concat(oe):"");return l.createElement(l.Fragment,null,ne.show&&l.createElement("span",{className:c()("".concat(k,"-show-count-suffix"),(0,o.Z)({},"".concat(k,"-show-count-has-suffix"),!!R),null==X?void 0:X.count),style:(0,i.Z)({},null==F?void 0:F.count)},t),R)}return null}(),disabled:E,classes:O,classNames:X,styles:F}),(le=(0,v.Z)(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]),l.createElement("input",(0,n.Z)({autoComplete:r},le,{onChange:ue,onFocus:_e,onBlur:pe,onKeyDown:fe,onKeyUp:de,className:c()(k,(0,o.Z)({},"".concat(k,"-disabled"),E),null==X?void 0:X.input),style:null==F?void 0:F.input,ref:q,size:x,type:P,onCompositionStart:function(e){W.current=!0,null==K||K(e)},onCompositionEnd:he}))))}))},30292:function(e,t,r){"use strict";function i(e){return!(!e.addonBefore&&!e.addonAfter)}function n(e){return!!(e.prefix||e.suffix||e.allowClear)}function o(e,t,r){var i=t.cloneNode(!0),n=Object.create(e,{target:{value:i},currentTarget:{value:i}});return i.value=r,"number"==typeof t.selectionStart&&"number"==typeof t.selectionEnd&&(i.selectionStart=t.selectionStart,i.selectionEnd=t.selectionEnd),i.setSelectionRange=function(){t.setSelectionRange.apply(t,arguments)},n}function s(e,t,r,i){if(r){var n=t;"click"!==t.type?"file"===e.type||void 0===i?r(n):r(n=o(t,e,i)):r(n=o(t,e,""))}}function a(e,t){if(e){e.focus(t);var r=(t||{}).cursor;if(r){var i=e.value.length;switch(r){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(i,i);break;default:e.setSelectionRange(0,i)}}}}r.d(t,{He:function(){return i},X3:function(){return n},nH:function(){return a},rJ:function(){return s}})},25930:function(e,t,r){"use strict";r.d(t,{Cd:function(){return k}});var i=r(54476),n=r(33885),o=r(75931),s=r(59301),a=r(92310),c=r.n(a),l={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},u=function(){var e=(0,s.useRef)([]),t=(0,s.useRef)(null);return(0,s.useEffect)((function(){var r=Date.now(),i=!1;e.current.forEach((function(e){if(e){i=!0;var n=e.style;n.transitionDuration=".3s, .3s, .3s, .06s",t.current&&r-t.current<100&&(n.transitionDuration="0s, 0s")}})),i&&(t.current=Date.now())})),e.current};var h=r(76190),f=r(42978),d=r(47273),_=0,p=(0,d.Z)();var v=function(e){var t=s.useState(),r=(0,f.Z)(t,2),i=r[0],n=r[1];return s.useEffect((function(){var e;n("rc_progress_".concat((p?(e=_,_+=1):e="TEST_OR_SSR",e)))}),[]),e||i},g=function(e){var t=e.bg,r=e.children;return s.createElement("div",{style:{width:"100%",height:"100%",background:t}},r)};function y(e,t){return Object.keys(e).map((function(r){var i=parseFloat(r),n="".concat(Math.floor(i*t),"%");return"".concat(e[r]," ").concat(n)}))}var m=s.forwardRef((function(e,t){var r=e.prefixCls,i=e.color,n=e.gradientId,o=e.radius,a=e.style,c=e.ptg,l=e.strokeLinecap,u=e.strokeWidth,f=e.size,d=e.gapDegree,_=i&&"object"===(0,h.Z)(i),p=_?"#FFF":void 0,v=f/2,m=s.createElement("circle",{className:"".concat(r,"-circle-path"),r:o,cx:v,cy:v,stroke:p,strokeLinecap:l,strokeWidth:u,opacity:0===c?0:1,style:a,ref:t});if(!_)return m;var b="".concat(n,"-conic"),w=d?"".concat(180+d/2,"deg"):"0deg",S=y(i,(360-d)/360),C=y(i,1),k="conic-gradient(from ".concat(w,", ").concat(S.join(", "),")"),E="linear-gradient(to ".concat(d?"bottom":"top",", ").concat(C.join(", "),")");return s.createElement(s.Fragment,null,s.createElement("mask",{id:b},m),s.createElement("foreignObject",{x:0,y:0,width:f,height:f,mask:"url(#".concat(b,")")},s.createElement(g,{bg:E},s.createElement(g,{bg:k}))))})),b=100,w=function(e,t,r,i,n,o,s,a,c,l){var u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,h=r/100*360*((360-o)/360),f=0===o?0:{bottom:0,top:180,left:90,right:-90}[s],d=(100-i)/100*t;"round"===c&&100!==i&&(d+=l/2)>=t&&(d=t-.01);var _=50;return{stroke:"string"==typeof a?a:void 0,strokeDasharray:"".concat(t,"px ").concat(e),strokeDashoffset:d+u,transform:"rotate(".concat(n+h+f,"deg)"),transformOrigin:"".concat(_,"px ").concat(_,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},S=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function C(e){var t=null!=e?e:[];return Array.isArray(t)?t:[t]}var k=function(e){var t,r,a,f=(0,n.Z)((0,n.Z)({},l),e),d=f.id,_=f.prefixCls,p=f.steps,g=f.strokeWidth,y=f.trailWidth,k=f.gapDegree,E=void 0===k?0:k,x=f.gapPosition,L=f.trailColor,A=f.strokeLinecap,R=f.style,M=f.className,T=f.strokeColor,D=f.percent,P=(0,o.Z)(f,S),O=v(d),X="".concat(O,"-gradient"),F=50-g/2,K=2*Math.PI*F,I=E>0?90+E/2:-90,B=K*((360-E)/360),H="object"===(0,h.Z)(p)?p:{count:p,gap:2},j=H.count,U=H.gap,N=C(D),W=C(T),z=W.find((function(e){return e&&"object"===(0,h.Z)(e)})),q=z&&"object"===(0,h.Z)(z)?"butt":A,Q=w(K,B,0,100,I,E,x,L,q,g),Z=u();return s.createElement("svg",(0,i.Z)({className:c()("".concat(_,"-circle"),M),viewBox:"0 0 ".concat(b," ").concat(b),style:R,id:d,role:"presentation"},P),!j&&s.createElement("circle",{className:"".concat(_,"-circle-trail"),r:F,cx:50,cy:50,stroke:L,strokeLinecap:q,strokeWidth:y||g,style:Q}),j?(t=Math.round(j*(N[0]/100)),r=100/j,a=0,new Array(j).fill(null).map((function(e,i){var n=i<=t-1?W[0]:L,o=n&&"object"===(0,h.Z)(n)?"url(#".concat(X,")"):void 0,c=w(K,B,a,r,I,E,x,n,"butt",g,U);return a+=100*(B-c.strokeDashoffset+U)/B,s.createElement("circle",{key:i,className:"".concat(_,"-circle-path"),r:F,cx:50,cy:50,stroke:o,strokeWidth:g,opacity:1,style:c,ref:function(e){Z[i]=e}})}))):function(){var e=0;return N.map((function(t,r){var i=W[r]||W[W.length-1],n=w(K,B,e,t,I,E,x,i,q,g);return e+=t,s.createElement(m,{key:r,color:i,ptg:t,radius:F,prefixCls:_,gradientId:X,style:n,strokeLinecap:q,strokeWidth:g,gapDegree:E,ref:function(e){Z[r]=e},size:b})})).reverse()}())}},29301:function(e,t,r){"use strict";r.d(t,{Z:function(){return C}});var i=r(54476),n=r(59301),o=r(11592),s=(r(48736),r(33885)),a=r(76190),c=r(76846),l=r(8654),u=n.createContext(null);var h=r(76374),f=new Map;var d=new h.Z((function(e){e.forEach((function(e){var t,r=e.target;null===(t=f.get(r))||void 0===t||t.forEach((function(e){return e(r)}))}))}));var _=r(67732),p=r(83652),v=r(42403),g=r(158),y=function(e){(0,v.Z)(r,e);var t=(0,g.Z)(r);function r(){return(0,_.Z)(this,r),t.apply(this,arguments)}return(0,p.Z)(r,[{key:"render",value:function(){return this.props.children}}]),r}(n.Component);function m(e,t){var r=e.children,i=e.disabled,o=n.useRef(null),h=n.useRef(null),_=n.useContext(u),p="function"==typeof r,v=p?r(o):r,g=n.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),m=!p&&n.isValidElement(v)&&(0,l.Yr)(v),b=m?(0,l.C4)(v):null,w=(0,l.x1)(b,o),S=function(){var e;return(0,c.ZP)(o.current)||(o.current&&"object"===(0,a.Z)(o.current)?(0,c.ZP)(null===(e=o.current)||void 0===e?void 0:e.nativeElement):null)||(0,c.ZP)(h.current)};n.useImperativeHandle(t,(function(){return S()}));var C=n.useRef(e);C.current=e;var k=n.useCallback((function(e){var t=C.current,r=t.onResize,i=t.data,n=e.getBoundingClientRect(),o=n.width,a=n.height,c=e.offsetWidth,l=e.offsetHeight,u=Math.floor(o),h=Math.floor(a);if(g.current.width!==u||g.current.height!==h||g.current.offsetWidth!==c||g.current.offsetHeight!==l){var f={width:u,height:h,offsetWidth:c,offsetHeight:l};g.current=f;var d=c===Math.round(o)?o:c,p=l===Math.round(a)?a:l,v=(0,s.Z)((0,s.Z)({},f),{},{offsetWidth:d,offsetHeight:p});null==_||_(v,e,i),r&&Promise.resolve().then((function(){r(v,e)}))}}),[]);return n.useEffect((function(){var e,t,r=S();return r&&!i&&(e=r,t=k,f.has(e)||(f.set(e,new Set),d.observe(e)),f.get(e).add(t)),function(){return function(e,t){f.has(e)&&(f.get(e).delete(t),f.get(e).size||(d.unobserve(e),f.delete(e)))}(r,k)}}),[o.current,i]),n.createElement(y,{ref:h},m?n.cloneElement(v,{ref:w}):v)}var b=n.forwardRef(m);function w(e,t){var r=e.children;return("function"==typeof r?[r]:(0,o.Z)(r)).map((function(r,o){var s=(null==r?void 0:r.key)||"".concat("rc-observer-key","-").concat(o);return n.createElement(b,(0,i.Z)({},e,{key:s,ref:0===o?t:void 0}),r)}))}var S=n.forwardRef(w);S.Collection=function(e){var t=e.children,r=e.onBatchResize,i=n.useRef(0),o=n.useRef([]),s=n.useContext(u),a=n.useCallback((function(e,t,n){i.current+=1;var a=i.current;o.current.push({size:e,element:t,data:n}),Promise.resolve().then((function(){a===i.current&&(null==r||r(o.current),o.current=[])})),null==s||s(e,t,n)}),[r,s]);return n.createElement(u.Provider,{value:a},t)};var C=S},22711:function(e,t,r){"use strict";r.r(t),r.d(t,{ResizableTextArea:function(){return L},default:function(){return R}});var i,n=r(54476),o=r(20068),s=r(33885),a=r(94480),c=r(42978),l=r(75931),u=r(92310),h=r.n(u),f=r(36901),d=r(66003),_=r(30292),p=r(18929),v=r(59301),g=r(76190),y=r(29301),m=r(34280),b=r(16089),w="\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n",S=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],C={};function k(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&C[r])return C[r];var i=window.getComputedStyle(e),n=i.getPropertyValue("box-sizing")||i.getPropertyValue("-moz-box-sizing")||i.getPropertyValue("-webkit-box-sizing"),o=parseFloat(i.getPropertyValue("padding-bottom"))+parseFloat(i.getPropertyValue("padding-top")),s=parseFloat(i.getPropertyValue("border-bottom-width"))+parseFloat(i.getPropertyValue("border-top-width")),a=S.map((function(e){return"".concat(e,":").concat(i.getPropertyValue(e))})).join(";"),c={sizingStyle:a,paddingSize:o,borderSize:s,boxSizing:n};return t&&r&&(C[r]=c),c}var E=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],x=v.forwardRef((function(e,t){var r=e,a=r.prefixCls,u=r.defaultValue,f=r.value,d=r.autoSize,_=r.onResize,S=r.className,C=r.style,x=r.disabled,L=r.onChange,A=(r.onInternalAutoSize,(0,l.Z)(r,E)),R=(0,p.Z)(u,{value:f,postState:function(e){return null!=e?e:""}}),M=(0,c.Z)(R,2),T=M[0],D=M[1],P=v.useRef();v.useImperativeHandle(t,(function(){return{textArea:P.current}}));var O=v.useMemo((function(){return d&&"object"===(0,g.Z)(d)?[d.minRows,d.maxRows]:[]}),[d]),X=(0,c.Z)(O,2),F=X[0],K=X[1],I=!!d,B=v.useState(2),H=(0,c.Z)(B,2),j=H[0],U=H[1],N=v.useState(),W=(0,c.Z)(N,2),z=W[0],q=W[1],Q=function(){U(0)};(0,m.Z)((function(){I&&Q()}),[f,F,K,I]),(0,m.Z)((function(){if(0===j)U(1);else if(1===j){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;i||((i=document.createElement("textarea")).setAttribute("tab-index","-1"),i.setAttribute("aria-hidden","true"),i.setAttribute("name","hiddenTextarea"),document.body.appendChild(i)),e.getAttribute("wrap")?i.setAttribute("wrap",e.getAttribute("wrap")):i.removeAttribute("wrap");var o=k(e,t),s=o.paddingSize,a=o.borderSize,c=o.boxSizing,l=o.sizingStyle;i.setAttribute("style","".concat(l,";").concat(w)),i.value=e.value||e.placeholder||"";var u,h=void 0,f=void 0,d=i.scrollHeight;if("border-box"===c?d+=a:"content-box"===c&&(d-=s),null!==r||null!==n){i.value=" ";var _=i.scrollHeight-s;null!==r&&(h=_*r,"border-box"===c&&(h=h+s+a),d=Math.max(h,d)),null!==n&&(f=_*n,"border-box"===c&&(f=f+s+a),u=d>f?"":"hidden",d=Math.min(f,d))}var p={height:d,overflowY:u,resize:"none"};return h&&(p.minHeight=h),f&&(p.maxHeight=f),p}(P.current,!1,F,K);U(2),q(e)}else!function(){try{if(document.activeElement===P.current){var e=P.current,t=e.selectionStart,r=e.selectionEnd,i=e.scrollTop;P.current.setSelectionRange(t,r),P.current.scrollTop=i}}catch(e){}}()}),[j]);var Z=v.useRef(),V=function(){b.Z.cancel(Z.current)};v.useEffect((function(){return V}),[]);var G=I?z:null,Y=(0,s.Z)((0,s.Z)({},C),G);return 0!==j&&1!==j||(Y.overflowY="hidden",Y.overflowX="hidden"),v.createElement(y.Z,{onResize:function(e){2===j&&(null==_||_(e),d&&(V(),Z.current=(0,b.Z)((function(){Q()}))))},disabled:!(d||_)},v.createElement("textarea",(0,n.Z)({},A,{ref:P,style:Y,className:h()(a,S,(0,o.Z)({},"".concat(a,"-disabled"),x)),disabled:x,value:T,onChange:function(e){D(e.target.value),null==L||L(e)}})))})),L=x,A=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],R=v.forwardRef((function(e,t){var r,i=e.defaultValue,u=e.value,g=e.onFocus,y=e.onBlur,m=e.onChange,b=e.allowClear,w=e.maxLength,S=e.onCompositionStart,C=e.onCompositionEnd,k=e.suffix,E=e.prefixCls,x=void 0===E?"rc-textarea":E,R=e.showCount,M=e.count,T=e.className,D=e.style,P=e.disabled,O=e.hidden,X=e.classNames,F=e.styles,K=e.onResize,I=e.onClear,B=e.onPressEnter,H=e.readOnly,j=e.autoSize,U=e.onKeyDown,N=(0,l.Z)(e,A),W=(0,p.Z)(i,{value:u,defaultValue:i}),z=(0,c.Z)(W,2),q=z[0],Q=z[1],Z=null==q?"":String(q),V=v.useState(!1),G=(0,c.Z)(V,2),Y=G[0],J=G[1],$=v.useRef(!1),ee=v.useState(null),te=(0,c.Z)(ee,2),re=te[0],ie=te[1],ne=(0,v.useRef)(null),oe=(0,v.useRef)(null),se=function(){var e;return null===(e=oe.current)||void 0===e?void 0:e.textArea},ae=function(){se().focus()};(0,v.useImperativeHandle)(t,(function(){var e;return{resizableTextArea:oe.current,focus:ae,blur:function(){se().blur()},nativeElement:(null===(e=ne.current)||void 0===e?void 0:e.nativeElement)||se()}})),(0,v.useEffect)((function(){J((function(e){return!P&&e}))}),[P]);var ce=v.useState(null),le=(0,c.Z)(ce,2),ue=le[0],he=le[1];v.useEffect((function(){var e;ue&&(e=se()).setSelectionRange.apply(e,(0,a.Z)(ue))}),[ue]);var fe,de=(0,d.Z)(M,R),_e=null!==(r=de.max)&&void 0!==r?r:w,pe=Number(_e)>0,ve=de.strategy(Z),ge=!!_e&&ve>_e,ye=function(e,t){var r=t;!$.current&&de.exceedFormatter&&de.max&&de.strategy(t)>de.max&&t!==(r=de.exceedFormatter(t,{max:de.max}))&&he([se().selectionStart||0,se().selectionEnd||0]),Q(r),(0,_.rJ)(e.currentTarget,e,m,r)},me=k;de.show&&(fe=de.showFormatter?de.showFormatter({value:Z,count:ve,maxLength:_e}):"".concat(ve).concat(pe?" / ".concat(_e):""),me=v.createElement(v.Fragment,null,me,v.createElement("span",{className:h()("".concat(x,"-data-count"),null==X?void 0:X.count),style:null==F?void 0:F.count},fe)));var be=!j&&!R&&!b;return v.createElement(f.BaseInput,{ref:ne,value:Z,allowClear:b,handleReset:function(e){Q(""),ae(),(0,_.rJ)(se(),e,m)},suffix:me,prefixCls:x,classNames:(0,s.Z)((0,s.Z)({},X),{},{affixWrapper:h()(null==X?void 0:X.affixWrapper,(0,o.Z)((0,o.Z)({},"".concat(x,"-show-count"),R),"".concat(x,"-textarea-allow-clear"),b))}),disabled:P,focused:Y,className:h()(T,ge&&"".concat(x,"-out-of-range")),style:(0,s.Z)((0,s.Z)({},D),re&&!be?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof fe?fe:void 0}},hidden:O,readOnly:H,onClear:I},v.createElement(L,(0,n.Z)({},N,{autoSize:j,maxLength:w,onKeyDown:function(e){"Enter"===e.key&&B&&B(e),null==U||U(e)},onChange:function(e){ye(e,e.target.value)},onFocus:function(e){J(!0),null==g||g(e)},onBlur:function(e){J(!1),null==y||y(e)},onCompositionStart:function(e){$.current=!0,null==S||S(e)},onCompositionEnd:function(e){$.current=!1,ye(e,e.currentTarget.value),null==C||C(e)},className:h()(null==X?void 0:X.textarea),style:(0,s.Z)((0,s.Z)({},null==F?void 0:F.textarea),{},{resize:null==D?void 0:D.resize}),disabled:P,prefixCls:x,onResize:function(e){var t;null==K||K(e),null!==(t=se())&&void 0!==t&&t.style.height&&ie(!0)},ref:oe,readOnly:H})))}))},29125:function(e,t,r){"use strict";r.d(t,{G:function(){return s},Z:function(){return y}});var i=r(92310),n=r.n(i),o=r(59301);function s(e){var t=e.children,r=e.prefixCls,i=e.id,s=e.overlayInnerStyle,a=e.bodyClassName,c=e.className,l=e.style;return o.createElement("div",{className:n()("".concat(r,"-content"),c),style:l},o.createElement("div",{className:n()("".concat(r,"-inner"),a),id:i,role:"tooltip",style:s},"function"==typeof t?t():t))}var a=r(54476),c=r(33885),l=r(75931),u=r(65030),h={shiftX:64,adjustY:1},f={adjustX:1,shiftY:!0},d=[0,0],_={left:{points:["cr","cl"],overflow:f,offset:[-4,0],targetOffset:d},right:{points:["cl","cr"],overflow:f,offset:[4,0],targetOffset:d},top:{points:["bc","tc"],overflow:h,offset:[0,-4],targetOffset:d},bottom:{points:["tc","bc"],overflow:h,offset:[0,4],targetOffset:d},topLeft:{points:["bl","tl"],overflow:h,offset:[0,-4],targetOffset:d},leftTop:{points:["tr","tl"],overflow:f,offset:[-4,0],targetOffset:d},topRight:{points:["br","tr"],overflow:h,offset:[0,-4],targetOffset:d},rightTop:{points:["tl","tr"],overflow:f,offset:[4,0],targetOffset:d},bottomRight:{points:["tr","br"],overflow:h,offset:[0,4],targetOffset:d},rightBottom:{points:["bl","br"],overflow:f,offset:[4,0],targetOffset:d},bottomLeft:{points:["tl","bl"],overflow:h,offset:[0,4],targetOffset:d},leftBottom:{points:["br","bl"],overflow:f,offset:[-4,0],targetOffset:d}},p=r(80402),v=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],g=function(e,t){var r=e.overlayClassName,i=e.trigger,h=void 0===i?["hover"]:i,f=e.mouseEnterDelay,d=void 0===f?0:f,g=e.mouseLeaveDelay,y=void 0===g?.1:g,m=e.overlayStyle,b=e.prefixCls,w=void 0===b?"rc-tooltip":b,S=e.children,C=e.onVisibleChange,k=e.afterVisibleChange,E=e.transitionName,x=e.animation,L=e.motion,A=e.placement,R=void 0===A?"right":A,M=e.align,T=void 0===M?{}:M,D=e.destroyTooltipOnHide,P=void 0!==D&&D,O=e.defaultVisible,X=e.getTooltipContainer,F=e.overlayInnerStyle,K=(e.arrowContent,e.overlay),I=e.id,B=e.showArrow,H=void 0===B||B,j=e.classNames,U=e.styles,N=(0,l.Z)(e,v),W=(0,p.Z)(I),z=(0,o.useRef)(null);(0,o.useImperativeHandle)(t,(function(){return z.current}));var q=(0,c.Z)({},N);"visible"in e&&(q.popupVisible=e.visible);var Q,Z,V;return o.createElement(u.Z,(0,a.Z)({popupClassName:n()(r,null==j?void 0:j.root),prefixCls:w,popup:function(){return o.createElement(s,{key:"content",prefixCls:w,id:W,bodyClassName:null==j?void 0:j.body,overlayInnerStyle:(0,c.Z)((0,c.Z)({},F),null==U?void 0:U.body)},K)},action:h,builtinPlacements:_,popupPlacement:R,ref:z,popupAlign:T,getPopupContainer:X,onPopupVisibleChange:C,afterPopupVisibleChange:k,popupTransitionName:E,popupAnimation:x,popupMotion:L,defaultPopupVisible:O,autoDestroy:P,mouseLeaveDelay:y,popupStyle:(0,c.Z)((0,c.Z)({},m),null==U?void 0:U.root),mouseEnterDelay:d,arrow:H},q),(Q=o.Children.only(S),Z=(null==Q?void 0:Q.props)||{},V=(0,c.Z)((0,c.Z)({},Z),{},{"aria-describedby":K?W:null}),o.cloneElement(S,V)))},y=(0,o.forwardRef)(g)},49658:function(e,t){"use strict";t.Z=function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=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(e)||/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==e?void 0:e.substr(0,4))}},76374:function(e,t,r){"use strict";var i=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var r=-1;return e.some((function(e,i){return e[0]===t&&(r=i,!0)})),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var r=e(this.__entries__,t),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(t,r){var i=e(this.__entries__,t);~i?this.__entries__[i][1]=r:this.__entries__.push([t,r])},t.prototype.delete=function(t){var r=this.__entries__,i=e(r,t);~i&&r.splice(i,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var r=0,i=this.__entries__;r<i.length;r++){var n=i[r];e.call(t,n[1],n[0])}},t}()}(),n="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,o=void 0!==r.g&&r.g.Math===Math?r.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),s="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(o):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var a=["top","right","bottom","left","width","height","size","weight"],c="undefined"!=typeof MutationObserver,l=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var r=!1,i=!1,n=0;function o(){r&&(r=!1,e()),i&&c()}function a(){s(o)}function c(){var e=Date.now();if(r){if(e-n<2)return;i=!0}else r=!0,i=!1,setTimeout(a,t);n=e}return c}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,r=t.indexOf(e);~r&&t.splice(r,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){n&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),c?(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)},e.prototype.disconnect_=function(){n&&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)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=void 0===t?"":t;a.some((function(e){return!!~r.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),u=function(e,t){for(var r=0,i=Object.keys(t);r<i.length;r++){var n=i[r];Object.defineProperty(e,n,{value:t[n],enumerable:!1,writable:!1,configurable:!0})}return e},h=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||o},f=y(0,0,0,0);function d(e){return parseFloat(e)||0}function _(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce((function(t,r){return t+d(e["border-"+r+"-width"])}),0)}function p(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return f;var i=h(e).getComputedStyle(e),n=function(e){for(var t={},r=0,i=["top","right","bottom","left"];r<i.length;r++){var n=i[r],o=e["padding-"+n];t[n]=d(o)}return t}(i),o=n.left+n.right,s=n.top+n.bottom,a=d(i.width),c=d(i.height);if("border-box"===i.boxSizing&&(Math.round(a+o)!==t&&(a-=_(i,"left","right")+o),Math.round(c+s)!==r&&(c-=_(i,"top","bottom")+s)),!function(e){return e===h(e).document.documentElement}(e)){var l=Math.round(a+o)-t,u=Math.round(c+s)-r;1!==Math.abs(l)&&(a-=l),1!==Math.abs(u)&&(c-=u)}return y(n.left,n.top,a,c)}var v="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof h(e).SVGGraphicsElement}:function(e){return e instanceof h(e).SVGElement&&"function"==typeof e.getBBox};function g(e){return n?v(e)?function(e){var t=e.getBBox();return y(0,0,t.width,t.height)}(e):p(e):f}function y(e,t,r,i){return{x:e,y:t,width:r,height:i}}var m=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=y(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=g(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),b=function(e,t){var r,i,n,o,s,a,c,l=(i=(r=t).x,n=r.y,o=r.width,s=r.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,c=Object.create(a.prototype),u(c,{x:i,y:n,width:o,height:s,top:n,right:i+o,bottom:s+n,left:i}),c);u(this,{target:e,contentRect:l})},w=function(){function e(e,t,r){if(this.activeObservations_=[],this.observations_=new i,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof h(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new m(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof h(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new b(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),S="undefined"!=typeof WeakMap?new WeakMap:new i,C=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=l.getInstance(),i=new w(t,r,this);S.set(this,i)};["observe","unobserve","disconnect"].forEach((function(e){C.prototype[e]=function(){var t;return(t=S.get(this))[e].apply(t,arguments)}}));var k=void 0!==o.ResizeObserver?o.ResizeObserver:C;t.Z=k},34376:function(e){window,e.exports=function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=34)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0;var i=function(){function e(){this._listeners=[],this._disposed=!1}return Object.defineProperty(e.prototype,"event",{get:function(){var e=this;return this._event||(this._event=function(t){return e._listeners.push(t),{dispose:function(){if(!e._disposed)for(var r=0;r<e._listeners.length;r++)if(e._listeners[r]===t)return void e._listeners.splice(r,1)}}}),this._event},enumerable:!1,configurable:!0}),e.prototype.fire=function(e,t){for(var r=[],i=0;i<this._listeners.length;i++)r.push(this._listeners[i]);for(i=0;i<r.length;i++)r[i].call(void 0,e,t)},e.prototype.dispose=function(){this._listeners&&(this._listeners.length=0),this._disposed=!0},e}();t.EventEmitter=i,t.forwardEvent=function(e,t){return e((function(e){return t.fire(e)}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IUnicodeService=t.IOptionsService=t.ILogService=t.IInstantiationService=t.IDirtyRowService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;var i=r(14);t.IBufferService=i.createDecorator("BufferService"),t.ICoreMouseService=i.createDecorator("CoreMouseService"),t.ICoreService=i.createDecorator("CoreService"),t.ICharsetService=i.createDecorator("CharsetService"),t.IDirtyRowService=i.createDecorator("DirtyRowService"),t.IInstantiationService=i.createDecorator("InstantiationService"),t.ILogService=i.createDecorator("LogService"),t.IOptionsService=i.createDecorator("OptionsService"),t.IUnicodeService=i.createDecorator("UnicodeService")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.Disposable=void 0;var i=function(){function e(){this._disposables=[],this._isDisposed=!1}return e.prototype.dispose=function(){this._isDisposed=!0;for(var e=0,t=this._disposables;e<t.length;e++)t[e].dispose();this._disposables.length=0},e.prototype.register=function(e){return this._disposables.push(e),e},e.prototype.unregister=function(e){var t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)},e}();function n(e){for(var t=0,r=e;t<r.length;t++)r[t].dispose();e.length=0}t.Disposable=i,t.disposeArray=n,t.getDisposeArrayDisposable=function(e){return{dispose:function(){return n(e)}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=256,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;var o=r(8),s=r(3),a=r(6),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.content=0,t.fg=0,t.bg=0,t.extended=new a.ExtendedAttrs,t.combinedData="",t}return n(t,e),t.fromCharData=function(e){var r=new t;return r.setFromCharData(e),r},t.prototype.isCombined=function(){return 2097152&this.content},t.prototype.getWidth=function(){return this.content>>22},t.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?o.stringFromCodePoint(2097151&this.content):""},t.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},t.prototype.setFromCharData=function(e){this.fg=e[s.CHAR_DATA_ATTR_INDEX],this.bg=0;var t=!1;if(e[s.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[s.CHAR_DATA_CHAR_INDEX].length){var r=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){var i=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=i&&i<=57343?this.content=1024*(r-55296)+i-56320+65536|e[s.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[s.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[s.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[s.CHAR_DATA_WIDTH_INDEX]<<22)},t.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},t}(a.AttributeData);t.CellData=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ISoundService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;var i=r(14);t.ICharSizeService=i.createDecorator("CharSizeService"),t.ICoreBrowserService=i.createDecorator("CoreBrowserService"),t.IMouseService=i.createDecorator("MouseService"),t.IRenderService=i.createDecorator("RenderService"),t.ISelectionService=i.createDecorator("SelectionService"),t.ISoundService=i.createDecorator("SoundService")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;var i=function(){function e(){this.fg=0,this.bg=0,this.extended=new n}return e.toColorRGB=function(e){return[e>>>16&255,e>>>8&255,255&e]},e.fromColorRGB=function(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},e.prototype.clone=function(){var t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t},e.prototype.isInverse=function(){return 67108864&this.fg},e.prototype.isBold=function(){return 134217728&this.fg},e.prototype.isUnderline=function(){return 268435456&this.fg},e.prototype.isBlink=function(){return 536870912&this.fg},e.prototype.isInvisible=function(){return 1073741824&this.fg},e.prototype.isItalic=function(){return 67108864&this.bg},e.prototype.isDim=function(){return 134217728&this.bg},e.prototype.getFgColorMode=function(){return 50331648&this.fg},e.prototype.getBgColorMode=function(){return 50331648&this.bg},e.prototype.isFgRGB=function(){return 50331648==(50331648&this.fg)},e.prototype.isBgRGB=function(){return 50331648==(50331648&this.bg)},e.prototype.isFgPalette=function(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)},e.prototype.isBgPalette=function(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)},e.prototype.isFgDefault=function(){return 0==(50331648&this.fg)},e.prototype.isBgDefault=function(){return 0==(50331648&this.bg)},e.prototype.isAttributeDefault=function(){return 0===this.fg&&0===this.bg},e.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},e.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},e.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},e.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},e.prototype.getUnderlineColor=function(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()},e.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},e.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()},e.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()},e.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()},e.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},e}();t.AttributeData=i;var n=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=-1),this.underlineStyle=e,this.underlineColor=t}return e.prototype.clone=function(){return new e(this.underlineStyle,this.underlineColor)},e.prototype.isEmpty=function(){return 0===this.underlineStyle},e}();t.ExtendedAttrs=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,r,i){e.addEventListener(t,r,i);var n=!1;return{dispose:function(){n||(n=!0,e.removeEventListener(t,r,i))}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=e.length);for(var i="",n=t;n<r;++n){var o=e[n];o>65535?(o-=65536,i+=String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):i+=String.fromCharCode(o)}return i};var i=function(){function e(){this._interim=0}return e.prototype.clear=function(){this._interim=0},e.prototype.decode=function(e,t){var r=e.length;if(!r)return 0;var i=0,n=0;this._interim&&(56320<=(a=e.charCodeAt(n++))&&a<=57343?t[i++]=1024*(this._interim-55296)+a-56320+65536:(t[i++]=this._interim,t[i++]=a),this._interim=0);for(var o=n;o<r;++o){var s=e.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=r)return this._interim=s,i;var a;56320<=(a=e.charCodeAt(o))&&a<=57343?t[i++]=1024*(s-55296)+a-56320+65536:(t[i++]=s,t[i++]=a)}else t[i++]=s}return i},e}();t.StringToUtf32=i;var n=function(){function e(){this.interim=new Uint8Array(3)}return e.prototype.clear=function(){this.interim.fill(0)},e.prototype.decode=function(e,t){var r=e.length;if(!r)return 0;var i,n,o,s,a=0,c=0,l=0;if(this.interim[0]){var u=!1,h=this.interim[0];h&=192==(224&h)?31:224==(240&h)?15:7;for(var f=0,d=void 0;(d=63&this.interim[++f])&&f<4;)h<<=6,h|=d;for(var _=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,p=_-f;l<p;){if(l>=r)return 0;if(128!=(192&(d=e[l++]))){l--,u=!0;break}this.interim[f++]=d,h<<=6,h|=63&d}u||(2===_?h<128?l--:t[a++]=h:3===_?h<2048||h>=55296&&h<=57343||(t[a++]=h):h<65536||h>1114111||(t[a++]=h)),this.interim.fill(0)}for(var v=r-4,g=l;g<r;){for(;!(!(g<v)||128&(i=e[g])||128&(n=e[g+1])||128&(o=e[g+2])||128&(s=e[g+3]));)t[a++]=i,t[a++]=n,t[a++]=o,t[a++]=s,g+=4;if((i=e[g++])<128)t[a++]=i;else if(192==(224&i)){if(g>=r)return this.interim[0]=i,a;if(128!=(192&(n=e[g++]))){g--;continue}if((c=(31&i)<<6|63&n)<128){g--;continue}t[a++]=c}else if(224==(240&i)){if(g>=r)return this.interim[0]=i,a;if(128!=(192&(n=e[g++]))){g--;continue}if(g>=r)return this.interim[0]=i,this.interim[1]=n,a;if(128!=(192&(o=e[g++]))){g--;continue}if((c=(15&i)<<12|(63&n)<<6|63&o)<2048||c>=55296&&c<=57343)continue;t[a++]=c}else if(240==(248&i)){if(g>=r)return this.interim[0]=i,a;if(128!=(192&(n=e[g++]))){g--;continue}if(g>=r)return this.interim[0]=i,this.interim[1]=n,a;if(128!=(192&(o=e[g++]))){g--;continue}if(g>=r)return this.interim[0]=i,this.interim[1]=n,this.interim[2]=o,a;if(128!=(192&(s=e[g++]))){g--;continue}if((c=(7&i)<<18|(63&n)<<12|(63&o)<<6|63&s)<65536||c>1114111)continue;t[a++]=c}}return a},e}();t.Utf8ToUtf32=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CHAR_ATLAS_CELL_SPACING=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0,t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.CHAR_ATLAS_CELL_SPACING=1},function(e,t,r){"use strict";var i,n,o,s;function a(e){var t=e.toString(16);return t.length<2?"0"+t:t}function c(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=void 0,function(e){e.toCss=function(e,t,r,i){return void 0!==i?"#"+a(e)+a(t)+a(r)+a(i):"#"+a(e)+a(t)+a(r)},e.toRgba=function(e,t,r,i){return void 0===i&&(i=255),(e<<24|t<<16|r<<8|i)>>>0}}(i=t.channels||(t.channels={})),(n=t.color||(t.color={})).blend=function(e,t){var r=(255&t.rgba)/255;if(1===r)return{css:t.css,rgba:t.rgba};var n=t.rgba>>24&255,o=t.rgba>>16&255,s=t.rgba>>8&255,a=e.rgba>>24&255,c=e.rgba>>16&255,l=e.rgba>>8&255,u=a+Math.round((n-a)*r),h=c+Math.round((o-c)*r),f=l+Math.round((s-l)*r);return{css:i.toCss(u,h,f),rgba:i.toRgba(u,h,f)}},n.isOpaque=function(e){return 255==(255&e.rgba)},n.ensureContrastRatio=function(e,t,r){var i=s.ensureContrastRatio(e.rgba,t.rgba,r);if(i)return s.toColor(i>>24&255,i>>16&255,i>>8&255)},n.opaque=function(e){var t=(255|e.rgba)>>>0,r=s.toChannels(t),n=r[0],o=r[1],a=r[2];return{css:i.toCss(n,o,a),rgba:t}},n.opacity=function(e,t){var r=Math.round(255*t),n=s.toChannels(e.rgba),o=n[0],a=n[1],c=n[2];return{css:i.toCss(o,a,c,r),rgba:i.toRgba(o,a,c,r)}},(t.css||(t.css={})).toColor=function(e){switch(e.length){case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(e){function t(e,t,r){var i=e/255,n=t/255,o=r/255;return.2126*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(o=t.rgb||(t.rgb={})),function(e){function t(e,t,r){for(var i=e>>24&255,n=e>>16&255,s=e>>8&255,a=t>>24&255,l=t>>16&255,u=t>>8&255,h=c(o.relativeLuminance2(a,u,l),o.relativeLuminance2(i,n,s));h<r&&(a>0||l>0||u>0);)a-=Math.max(0,Math.ceil(.1*a)),l-=Math.max(0,Math.ceil(.1*l)),u-=Math.max(0,Math.ceil(.1*u)),h=c(o.relativeLuminance2(a,u,l),o.relativeLuminance2(i,n,s));return(a<<24|l<<16|u<<8|255)>>>0}function r(e,t,r){for(var i=e>>24&255,n=e>>16&255,s=e>>8&255,a=t>>24&255,l=t>>16&255,u=t>>8&255,h=c(o.relativeLuminance2(a,u,l),o.relativeLuminance2(i,n,s));h<r&&(a<255||l<255||u<255);)a=Math.min(255,a+Math.ceil(.1*(255-a))),l=Math.min(255,l+Math.ceil(.1*(255-l))),u=Math.min(255,u+Math.ceil(.1*(255-u))),h=c(o.relativeLuminance2(a,u,l),o.relativeLuminance2(i,n,s));return(a<<24|l<<16|u<<8|255)>>>0}e.ensureContrastRatio=function(e,i,n){var s=o.relativeLuminance(e>>8),a=o.relativeLuminance(i>>8);if(c(s,a)<n)return a<s?t(e,i,n):r(e,i,n)},e.reduceLuminance=t,e.increaseLuminance=r,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},e.toColor=function(e,t,r){return{css:i.toCss(e,t,r),rgba:i.toRgba(e,t,r)}}}(s=t.rgba||(t.rgba={})),t.toPaddedHex=a,t.contrastRatio=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.isSafari=t.isFirefox=void 0;var i="undefined"==typeof navigator,n=i?"node":navigator.userAgent,o=i?"node":navigator.platform;function s(e,t){return e.indexOf(t)>=0}t.isFirefox=!!~n.indexOf("Firefox"),t.isSafari=/^((?!chrome|android).)*safari/i.test(n),t.isMac=s(["Macintosh","MacIntel","MacPPC","Mac68K"],o),t.isIpad="iPad"===o,t.isIphone="iPhone"===o,t.isWindows=s(["Windows","Win16","Win32","WinCE"],o),t.isLinux=o.indexOf("Linux")>=0},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.C1=t.C0=void 0,function(e){e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="",e.BS="\b",e.HT="\t",e.LF="\n",e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""}(t.C0||(t.C0={})),function(e){e.PAD="€",e.HOP="",e.BPH="‚",e.NBH="ƒ",e.IND="„",e.NEL="…",e.SSA="†",e.ESA="‡",e.HTS="ˆ",e.HTJ="‰",e.VTS="Š",e.PLD="‹",e.PLU="Œ",e.RI="",e.SS2="Ž",e.SS3="",e.DCS="",e.PU1="‘",e.PU2="’",e.STS="“",e.CCH="”",e.MW="•",e.SPA="–",e.EPA="—",e.SOS="˜",e.SGCI="™",e.SCI="š",e.CSI="›",e.ST="œ",e.OSC="",e.PM="ž",e.APC="Ÿ"}(t.C1||(t.C1={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;var i=r(3),n=r(9),o=r(25),s=r(6),a=r(28),c=r(10),l=r(17),u=function(){function e(e,t,r,i,n,o,s,a){this._container=e,this._alpha=i,this._colors=n,this._rendererId=o,this._bufferService=s,this._optionsService=a,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+t+"-layer"),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return e.prototype.dispose=function(){var e;l.removeElementFromParent(this._canvas),null===(e=this._charAtlas)||void 0===e||e.dispose()},e.prototype._initCanvas=function(){this._ctx=a.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},e.prototype.onOptionsChanged=function(){},e.prototype.onBlur=function(){},e.prototype.onFocus=function(){},e.prototype.onCursorMove=function(){},e.prototype.onGridChanged=function(e,t){},e.prototype.onSelectionChanged=function(e,t,r){void 0===r&&(r=!1)},e.prototype.setColors=function(e){this._refreshCharAtlas(e)},e.prototype._setTransparency=function(e){if(e!==this._alpha){var t=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,t),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},e.prototype._refreshCharAtlas=function(e){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=o.acquireCharAtlas(this._optionsService.options,this._rendererId,e,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},e.prototype.resize=function(e){this._scaledCellWidth=e.scaledCellWidth,this._scaledCellHeight=e.scaledCellHeight,this._scaledCharWidth=e.scaledCharWidth,this._scaledCharHeight=e.scaledCharHeight,this._scaledCharLeft=e.scaledCharLeft,this._scaledCharTop=e.scaledCharTop,this._canvas.width=e.scaledCanvasWidth,this._canvas.height=e.scaledCanvasHeight,this._canvas.style.width=e.canvasWidth+"px",this._canvas.style.height=e.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},e.prototype._fillCells=function(e,t,r,i){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,i*this._scaledCellHeight)},e.prototype._fillBottomLineAtCells=function(e,t,r){void 0===r&&(r=1),this._ctx.fillRect(e*this._scaledCellWidth,(t+1)*this._scaledCellHeight-window.devicePixelRatio-1,r*this._scaledCellWidth,window.devicePixelRatio)},e.prototype._fillLeftLineAtCell=function(e,t,r){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,window.devicePixelRatio*r,this._scaledCellHeight)},e.prototype._strokeRectAtCell=function(e,t,r,i){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(e*this._scaledCellWidth+window.devicePixelRatio/2,t*this._scaledCellHeight+window.devicePixelRatio/2,r*this._scaledCellWidth-window.devicePixelRatio,i*this._scaledCellHeight-window.devicePixelRatio)},e.prototype._clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},e.prototype._clearCells=function(e,t,r,i){this._alpha?this._ctx.clearRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,i*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,i*this._scaledCellHeight))},e.prototype._fillCharTrueColor=function(e,t,r){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(r),this._ctx.fillText(e.getChars(),t*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},e.prototype._drawChars=function(e,t,r){var o,s,a=this._getContrastColor(e);a||e.isFgRGB()||e.isBgRGB()?this._drawUncachedChars(e,t,r,a):(e.isInverse()?(o=e.isBgDefault()?n.INVERTED_DEFAULT_COLOR:e.getBgColor(),s=e.isFgDefault()?n.INVERTED_DEFAULT_COLOR:e.getFgColor()):(s=e.isBgDefault()?i.DEFAULT_COLOR:e.getBgColor(),o=e.isFgDefault()?i.DEFAULT_COLOR:e.getFgColor()),o+=this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&o<8?8:0,this._currentGlyphIdentifier.chars=e.getChars()||i.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=e.getCode()||i.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=s,this._currentGlyphIdentifier.fg=o,this._currentGlyphIdentifier.bold=!!e.isBold(),this._currentGlyphIdentifier.dim=!!e.isDim(),this._currentGlyphIdentifier.italic=!!e.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,t*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(e,t,r))},e.prototype._drawUncachedChars=function(e,t,r,i){if(this._ctx.save(),this._ctx.font=this._getFont(!!e.isBold(),!!e.isItalic()),this._ctx.textBaseline="middle",e.isInverse())if(i)this._ctx.fillStyle=i.css;else if(e.isBgDefault())this._ctx.fillStyle=c.color.opaque(this._colors.background).css;else if(e.isBgRGB())this._ctx.fillStyle="rgb("+s.AttributeData.toColorRGB(e.getBgColor()).join(",")+")";else{var o=e.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&o<8&&(o+=8),this._ctx.fillStyle=this._colors.ansi[o].css}else if(i)this._ctx.fillStyle=i.css;else if(e.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(e.isFgRGB())this._ctx.fillStyle="rgb("+s.AttributeData.toColorRGB(e.getFgColor()).join(",")+")";else{var a=e.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&a<8&&(a+=8),this._ctx.fillStyle=this._colors.ansi[a].css}this._clipRow(r),e.isDim()&&(this._ctx.globalAlpha=n.DIM_OPACITY),this._ctx.fillText(e.getChars(),t*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},e.prototype._clipRow=function(e){this._ctx.beginPath(),this._ctx.rect(0,e*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},e.prototype._getFont=function(e,t){return(t?"italic":"")+" "+(e?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},e.prototype._getContrastColor=function(e){if(1!==this._optionsService.options.minimumContrastRatio){var t=this._colors.contrastCache.getColor(e.bg,e.fg);if(void 0!==t)return t||void 0;var r=e.getFgColor(),i=e.getFgColorMode(),n=e.getBgColor(),o=e.getBgColorMode(),s=!!e.isInverse(),a=!!e.isInverse();if(s){var l=r;r=n,n=l;var u=i;i=o,o=u}var h=this._resolveBackgroundRgba(o,n,s),f=this._resolveForegroundRgba(i,r,s,a),d=c.rgba.ensureContrastRatio(h,f,this._optionsService.options.minimumContrastRatio);if(d){var _={css:c.channels.toCss(d>>24&255,d>>16&255,d>>8&255),rgba:d};return this._colors.contrastCache.setColor(e.bg,e.fg,_),_}this._colors.contrastCache.setColor(e.bg,e.fg,null)}},e.prototype._resolveBackgroundRgba=function(e,t,r){switch(e){case 16777216:case 33554432:return this._colors.ansi[t].rgba;case 50331648:return t<<8;default:return r?this._colors.foreground.rgba:this._colors.background.rgba}},e.prototype._resolveForegroundRgba=function(e,t,r,i){switch(e){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&i&&t<8&&(t+=8),this._colors.ansi[t].rgba;case 50331648:return t<<8;default:return r?this._colors.background.rgba:this._colors.foreground.rgba}},e}();t.BaseRenderLayer=u},function(e,t,r){"use strict";function i(e,t,r){t.di$target===t?t.di$dependencies.push({id:e,index:r}):(t.di$dependencies=[{id:e,index:r}],t.di$target=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0,t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e.di$dependencies||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);var r=function(e,t,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");i(r,e,n)};return r.toString=function(){return e},t.serviceRegistry.set(e,r),r}},function(e,t,r){"use strict";function i(e,t,r,i){if(void 0===r&&(r=0),void 0===i&&(i=e.length),r>=e.length)return e;r=(e.length+r)%e.length,i=i>=e.length?e.length:(e.length+i)%e.length;for(var n=r;n<i;++n)e[n]=t;return e}Object.defineProperty(t,"__esModule",{value:!0}),t.concat=t.fillFallback=t.fill=void 0,t.fill=function(e,t,r,n){return e.fill?e.fill(t,r,n):i(e,t,r,n)},t.fillFallback=i,t.concat=function(e,t){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;var i=r(8),n=r(3),o=r(4),s=r(6);t.DEFAULT_ATTR_DATA=Object.freeze(new s.AttributeData);var a=function(){function e(e,t,r){void 0===r&&(r=!1),this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);for(var i=t||o.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]),s=0;s<e;++s)this.setCell(s,i);this.length=e}return e.prototype.get=function(e){var t=this._data[3*e+0],r=2097151&t;return[this._data[3*e+1],2097152&t?this._combined[e]:r?i.stringFromCodePoint(r):"",t>>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):r]},e.prototype.set=function(e,t){this._data[3*e+1]=t[n.CHAR_DATA_ATTR_INDEX],t[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[n.CHAR_DATA_WIDTH_INDEX]<<22},e.prototype.getWidth=function(e){return this._data[3*e+0]>>22},e.prototype.hasWidth=function(e){return 12582912&this._data[3*e+0]},e.prototype.getFg=function(e){return this._data[3*e+1]},e.prototype.getBg=function(e){return this._data[3*e+2]},e.prototype.hasContent=function(e){return 4194303&this._data[3*e+0]},e.prototype.getCodePoint=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t},e.prototype.isCombined=function(e){return 2097152&this._data[3*e+0]},e.prototype.getString=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?i.stringFromCodePoint(2097151&t):""},e.prototype.loadCell=function(e,t){var r=3*e;return t.content=this._data[r+0],t.fg=this._data[r+1],t.bg=this._data[r+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t},e.prototype.setCell=function(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg},e.prototype.setCellFromCodePoint=function(e,t,r,i,n,o){268435456&n&&(this._extendedAttrs[e]=o),this._data[3*e+0]=t|r<<22,this._data[3*e+1]=i,this._data[3*e+2]=n},e.prototype.addCodepointToCell=function(e,t){var r=this._data[3*e+0];2097152&r?this._combined[e]+=i.stringFromCodePoint(t):(2097151&r?(this._combined[e]=i.stringFromCodePoint(2097151&r)+i.stringFromCodePoint(t),r&=-2097152,r|=2097152):r=t|1<<22,this._data[3*e+0]=r)},e.prototype.insertCells=function(e,t,r,i){if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==i?void 0:i.fg)||0,(null==i?void 0:i.bg)||0,(null==i?void 0:i.extended)||new s.ExtendedAttrs),t<this.length-e){for(var n=new o.CellData,a=this.length-e-t-1;a>=0;--a)this.setCell(e+t+a,this.loadCell(e+a,n));for(a=0;a<t;++a)this.setCell(e+a,r)}else for(a=e;a<this.length;++a)this.setCell(a,r);2===this.getWidth(this.length-1)&&this.setCellFromCodePoint(this.length-1,0,1,(null==i?void 0:i.fg)||0,(null==i?void 0:i.bg)||0,(null==i?void 0:i.extended)||new s.ExtendedAttrs)},e.prototype.deleteCells=function(e,t,r,i){if(e%=this.length,t<this.length-e){for(var n=new o.CellData,a=0;a<this.length-e-t;++a)this.setCell(e+a,this.loadCell(e+t+a,n));for(a=this.length-t;a<this.length;++a)this.setCell(a,r)}else for(a=e;a<this.length;++a)this.setCell(a,r);e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==i?void 0:i.fg)||0,(null==i?void 0:i.bg)||0,(null==i?void 0:i.extended)||new s.ExtendedAttrs),0!==this.getWidth(e)||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,(null==i?void 0:i.fg)||0,(null==i?void 0:i.bg)||0,(null==i?void 0:i.extended)||new s.ExtendedAttrs)},e.prototype.replaceCells=function(e,t,r,i){for(e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==i?void 0:i.fg)||0,(null==i?void 0:i.bg)||0,(null==i?void 0:i.extended)||new s.ExtendedAttrs),t<this.length&&2===this.getWidth(t-1)&&this.setCellFromCodePoint(t,0,1,(null==i?void 0:i.fg)||0,(null==i?void 0:i.bg)||0,(null==i?void 0:i.extended)||new s.ExtendedAttrs);e<t&&e<this.length;)this.setCell(e++,r)},e.prototype.resize=function(e,t){if(e!==this.length){if(e>this.length){var r=new Uint32Array(3*e);this.length&&(3*e<this._data.length?r.set(this._data.subarray(0,3*e)):r.set(this._data)),this._data=r;for(var i=this.length;i<e;++i)this.setCell(i,t)}else if(e){(r=new Uint32Array(3*e)).set(this._data.subarray(0,3*e)),this._data=r;var n=Object.keys(this._combined);for(i=0;i<n.length;i++){var o=parseInt(n[i],10);o>=e&&delete this._combined[o]}}else this._data=new Uint32Array(0),this._combined={};this.length=e}},e.prototype.fill=function(e){this._combined={},this._extendedAttrs={};for(var t=0;t<this.length;++t)this.setCell(t,e)},e.prototype.copyFrom=function(e){for(var t in this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={},e._combined)this._combined[t]=e._combined[t];for(var t in this._extendedAttrs={},e._extendedAttrs)this._extendedAttrs[t]=e._extendedAttrs[t];this.isWrapped=e.isWrapped},e.prototype.clone=function(){var t=new e(0);for(var r in t._data=new Uint32Array(this._data),t.length=this.length,this._combined)t._combined[r]=this._combined[r];for(var r in this._extendedAttrs)t._extendedAttrs[r]=this._extendedAttrs[r];return t.isWrapped=this.isWrapped,t},e.prototype.getTrimmedLength=function(){for(var e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0},e.prototype.copyCellsFrom=function(e,t,r,i,n){var o=e._data;if(n)for(var s=i-1;s>=0;s--)for(var a=0;a<3;a++)this._data[3*(r+s)+a]=o[3*(t+s)+a];else for(s=0;s<i;s++)for(a=0;a<3;a++)this._data[3*(r+s)+a]=o[3*(t+s)+a];var c=Object.keys(e._combined);for(a=0;a<c.length;a++){var l=parseInt(c[a],10);l>=t&&(this._combined[l-t+r]=e._combined[l])}},e.prototype.translateToString=function(e,t,r){void 0===e&&(e=!1),void 0===t&&(t=0),void 0===r&&(r=this.length),e&&(r=Math.min(r,this.getTrimmedLength()));for(var o="";t<r;){var s=this._data[3*t+0],a=2097151&s;o+=2097152&s?this._combined[t]:a?i.stringFromCodePoint(a):n.WHITESPACE_CELL_CHAR,t+=s>>22||1}return o},e}();t.BufferLine=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeElementFromParent=void 0,t.removeElementFromParent=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var i=0,n=t;i<n.length;i++){var o=n[i];null===(e=null==o?void 0:o.parentElement)||void 0===e||e.removeChild(o)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;var o,s=r(12),a=r(20),c=r(39),l=r(2),u=r(15),h=r(8),f=r(16),d=r(0),_=r(3),p=r(4),v=r(6),g=r(22),y=r(24),m={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function b(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}!function(e){e[e.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",e[e.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(o=t.WindowsOptionsReportType||(t.WindowsOptionsReportType={}));var w=function(){function e(e,t,r,i){this._bufferService=e,this._coreService=t,this._logService=r,this._optionsService=i,this._data=new Uint32Array(0)}return e.prototype.hook=function(e){this._data=new Uint32Array(0)},e.prototype.put=function(e,t,r){this._data=u.concat(this._data,e.subarray(t,r))},e.prototype.unhook=function(e){if(e){var t=h.utf32ToString(this._data);switch(this._data=new Uint32Array(0),t){case'"q':return this._coreService.triggerDataEvent(s.C0.ESC+'P1$r0"q'+s.C0.ESC+"\\");case'"p':return this._coreService.triggerDataEvent(s.C0.ESC+'P1$r61;1"p'+s.C0.ESC+"\\");case"r":var r=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";return this._coreService.triggerDataEvent(s.C0.ESC+"P1$r"+r+s.C0.ESC+"\\");case"m":return this._coreService.triggerDataEvent(s.C0.ESC+"P1$r0m"+s.C0.ESC+"\\");case" q":var i={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return i-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(s.C0.ESC+"P1$r"+i+" q"+s.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",t),this._coreService.triggerDataEvent(s.C0.ESC+"P0$r"+s.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},e}(),S=function(e){function t(t,r,i,n,o,l,u,_,v){void 0===v&&(v=new c.EscapeSequenceParser);var y=e.call(this)||this;y._bufferService=t,y._charsetService=r,y._coreService=i,y._dirtyRowService=n,y._logService=o,y._optionsService=l,y._coreMouseService=u,y._unicodeService=_,y._parser=v,y._parseBuffer=new Uint32Array(4096),y._stringDecoder=new h.StringToUtf32,y._utf8Decoder=new h.Utf8ToUtf32,y._workCell=new p.CellData,y._windowTitle="",y._iconName="",y._windowTitleStack=[],y._iconNameStack=[],y._curAttrData=f.DEFAULT_ATTR_DATA.clone(),y._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone(),y._onRequestBell=new d.EventEmitter,y._onRequestRefreshRows=new d.EventEmitter,y._onRequestReset=new d.EventEmitter,y._onRequestScroll=new d.EventEmitter,y._onRequestSyncScrollBar=new d.EventEmitter,y._onRequestWindowsOptionsReport=new d.EventEmitter,y._onA11yChar=new d.EventEmitter,y._onA11yTab=new d.EventEmitter,y._onCursorMove=new d.EventEmitter,y._onLineFeed=new d.EventEmitter,y._onScroll=new d.EventEmitter,y._onTitleChange=new d.EventEmitter,y.register(y._parser),y._parser.setCsiHandlerFallback((function(e,t){y._logService.debug("Unknown CSI code: ",{identifier:y._parser.identToString(e),params:t.toArray()})})),y._parser.setEscHandlerFallback((function(e){y._logService.debug("Unknown ESC code: ",{identifier:y._parser.identToString(e)})})),y._parser.setExecuteHandlerFallback((function(e){y._logService.debug("Unknown EXECUTE code: ",{code:e})})),y._parser.setOscHandlerFallback((function(e,t,r){y._logService.debug("Unknown OSC code: ",{identifier:e,action:t,data:r})})),y._parser.setDcsHandlerFallback((function(e,t,r){"HOOK"===t&&(r=r.toArray()),y._logService.debug("Unknown DCS code: ",{identifier:y._parser.identToString(e),action:t,payload:r})})),y._parser.setPrintHandler((function(e,t,r){return y.print(e,t,r)})),y._parser.setCsiHandler({final:"@"},(function(e){return y.insertChars(e)})),y._parser.setCsiHandler({intermediates:" ",final:"@"},(function(e){return y.scrollLeft(e)})),y._parser.setCsiHandler({final:"A"},(function(e){return y.cursorUp(e)})),y._parser.setCsiHandler({intermediates:" ",final:"A"},(function(e){return y.scrollRight(e)})),y._parser.setCsiHandler({final:"B"},(function(e){return y.cursorDown(e)})),y._parser.setCsiHandler({final:"C"},(function(e){return y.cursorForward(e)})),y._parser.setCsiHandler({final:"D"},(function(e){return y.cursorBackward(e)})),y._parser.setCsiHandler({final:"E"},(function(e){return y.cursorNextLine(e)})),y._parser.setCsiHandler({final:"F"},(function(e){return y.cursorPrecedingLine(e)})),y._parser.setCsiHandler({final:"G"},(function(e){return y.cursorCharAbsolute(e)})),y._parser.setCsiHandler({final:"H"},(function(e){return y.cursorPosition(e)})),y._parser.setCsiHandler({final:"I"},(function(e){return y.cursorForwardTab(e)})),y._parser.setCsiHandler({final:"J"},(function(e){return y.eraseInDisplay(e)})),y._parser.setCsiHandler({prefix:"?",final:"J"},(function(e){return y.eraseInDisplay(e)})),y._parser.setCsiHandler({final:"K"},(function(e){return y.eraseInLine(e)})),y._parser.setCsiHandler({prefix:"?",final:"K"},(function(e){return y.eraseInLine(e)})),y._parser.setCsiHandler({final:"L"},(function(e){return y.insertLines(e)})),y._parser.setCsiHandler({final:"M"},(function(e){return y.deleteLines(e)})),y._parser.setCsiHandler({final:"P"},(function(e){return y.deleteChars(e)})),y._parser.setCsiHandler({final:"S"},(function(e){return y.scrollUp(e)})),y._parser.setCsiHandler({final:"T"},(function(e){return y.scrollDown(e)})),y._parser.setCsiHandler({final:"X"},(function(e){return y.eraseChars(e)})),y._parser.setCsiHandler({final:"Z"},(function(e){return y.cursorBackwardTab(e)})),y._parser.setCsiHandler({final:"`"},(function(e){return y.charPosAbsolute(e)})),y._parser.setCsiHandler({final:"a"},(function(e){return y.hPositionRelative(e)})),y._parser.setCsiHandler({final:"b"},(function(e){return y.repeatPrecedingCharacter(e)})),y._parser.setCsiHandler({final:"c"},(function(e){return y.sendDeviceAttributesPrimary(e)})),y._parser.setCsiHandler({prefix:">",final:"c"},(function(e){return y.sendDeviceAttributesSecondary(e)})),y._parser.setCsiHandler({final:"d"},(function(e){return y.linePosAbsolute(e)})),y._parser.setCsiHandler({final:"e"},(function(e){return y.vPositionRelative(e)})),y._parser.setCsiHandler({final:"f"},(function(e){return y.hVPosition(e)})),y._parser.setCsiHandler({final:"g"},(function(e){return y.tabClear(e)})),y._parser.setCsiHandler({final:"h"},(function(e){return y.setMode(e)})),y._parser.setCsiHandler({prefix:"?",final:"h"},(function(e){return y.setModePrivate(e)})),y._parser.setCsiHandler({final:"l"},(function(e){return y.resetMode(e)})),y._parser.setCsiHandler({prefix:"?",final:"l"},(function(e){return y.resetModePrivate(e)})),y._parser.setCsiHandler({final:"m"},(function(e){return y.charAttributes(e)})),y._parser.setCsiHandler({final:"n"},(function(e){return y.deviceStatus(e)})),y._parser.setCsiHandler({prefix:"?",final:"n"},(function(e){return y.deviceStatusPrivate(e)})),y._parser.setCsiHandler({intermediates:"!",final:"p"},(function(e){return y.softReset(e)})),y._parser.setCsiHandler({intermediates:" ",final:"q"},(function(e){return y.setCursorStyle(e)})),y._parser.setCsiHandler({final:"r"},(function(e){return y.setScrollRegion(e)})),y._parser.setCsiHandler({final:"s"},(function(e){return y.saveCursor(e)})),y._parser.setCsiHandler({final:"t"},(function(e){return y.windowOptions(e)})),y._parser.setCsiHandler({final:"u"},(function(e){return y.restoreCursor(e)})),y._parser.setCsiHandler({intermediates:"'",final:"}"},(function(e){return y.insertColumns(e)})),y._parser.setCsiHandler({intermediates:"'",final:"~"},(function(e){return y.deleteColumns(e)})),y._parser.setExecuteHandler(s.C0.BEL,(function(){return y.bell()})),y._parser.setExecuteHandler(s.C0.LF,(function(){return y.lineFeed()})),y._parser.setExecuteHandler(s.C0.VT,(function(){return y.lineFeed()})),y._parser.setExecuteHandler(s.C0.FF,(function(){return y.lineFeed()})),y._parser.setExecuteHandler(s.C0.CR,(function(){return y.carriageReturn()})),y._parser.setExecuteHandler(s.C0.BS,(function(){return y.backspace()})),y._parser.setExecuteHandler(s.C0.HT,(function(){return y.tab()})),y._parser.setExecuteHandler(s.C0.SO,(function(){return y.shiftOut()})),y._parser.setExecuteHandler(s.C0.SI,(function(){return y.shiftIn()})),y._parser.setExecuteHandler(s.C1.IND,(function(){return y.index()})),y._parser.setExecuteHandler(s.C1.NEL,(function(){return y.nextLine()})),y._parser.setExecuteHandler(s.C1.HTS,(function(){return y.tabSet()})),y._parser.setOscHandler(0,new g.OscHandler((function(e){y.setTitle(e),y.setIconName(e)}))),y._parser.setOscHandler(1,new g.OscHandler((function(e){return y.setIconName(e)}))),y._parser.setOscHandler(2,new g.OscHandler((function(e){return y.setTitle(e)}))),y._parser.setEscHandler({final:"7"},(function(){return y.saveCursor()})),y._parser.setEscHandler({final:"8"},(function(){return y.restoreCursor()})),y._parser.setEscHandler({final:"D"},(function(){return y.index()})),y._parser.setEscHandler({final:"E"},(function(){return y.nextLine()})),y._parser.setEscHandler({final:"H"},(function(){return y.tabSet()})),y._parser.setEscHandler({final:"M"},(function(){return y.reverseIndex()})),y._parser.setEscHandler({final:"="},(function(){return y.keypadApplicationMode()})),y._parser.setEscHandler({final:">"},(function(){return y.keypadNumericMode()})),y._parser.setEscHandler({final:"c"},(function(){return y.fullReset()})),y._parser.setEscHandler({final:"n"},(function(){return y.setgLevel(2)})),y._parser.setEscHandler({final:"o"},(function(){return y.setgLevel(3)})),y._parser.setEscHandler({final:"|"},(function(){return y.setgLevel(3)})),y._parser.setEscHandler({final:"}"},(function(){return y.setgLevel(2)})),y._parser.setEscHandler({final:"~"},(function(){return y.setgLevel(1)})),y._parser.setEscHandler({intermediates:"%",final:"@"},(function(){return y.selectDefaultCharset()})),y._parser.setEscHandler({intermediates:"%",final:"G"},(function(){return y.selectDefaultCharset()}));var m=function(e){b._parser.setEscHandler({intermediates:"(",final:e},(function(){return y.selectCharset("("+e)})),b._parser.setEscHandler({intermediates:")",final:e},(function(){return y.selectCharset(")"+e)})),b._parser.setEscHandler({intermediates:"*",final:e},(function(){return y.selectCharset("*"+e)})),b._parser.setEscHandler({intermediates:"+",final:e},(function(){return y.selectCharset("+"+e)})),b._parser.setEscHandler({intermediates:"-",final:e},(function(){return y.selectCharset("-"+e)})),b._parser.setEscHandler({intermediates:".",final:e},(function(){return y.selectCharset("."+e)})),b._parser.setEscHandler({intermediates:"/",final:e},(function(){return y.selectCharset("/"+e)}))},b=this;for(var S in a.CHARSETS)m(S);return y._parser.setEscHandler({intermediates:"#",final:"8"},(function(){return y.screenAlignmentPattern()})),y._parser.setErrorHandler((function(e){return y._logService.error("Parsing error: ",e),e})),y._parser.setDcsHandler({intermediates:"$",final:"q"},new w(y._bufferService,y._coreService,y._logService,y._optionsService)),y}return n(t,e),Object.defineProperty(t.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestScroll",{get:function(){return this._onRequestScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.parse=function(e){var t=this._bufferService.buffer,r=t.x,i=t.y;if(this._logService.debug("parsing data",e),this._parseBuffer.length<e.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(e.length,131072))),this._dirtyRowService.clearRange(),e.length>131072)for(var n=0;n<e.length;n+=131072){var o=n+131072<e.length?n+131072:e.length,s="string"==typeof e?this._stringDecoder.decode(e.substring(n,o),this._parseBuffer):this._utf8Decoder.decode(e.subarray(n,o),this._parseBuffer);this._parser.parse(this._parseBuffer,s)}else s="string"==typeof e?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer),this._parser.parse(this._parseBuffer,s);(t=this._bufferService.buffer).x===r&&t.y===i||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)},t.prototype.print=function(e,t,r){var i,n,o=this._bufferService.buffer,s=this._charsetService.charset,a=this._optionsService.options.screenReaderMode,c=this._bufferService.cols,l=this._coreService.decPrivateModes.wraparound,u=this._coreService.modes.insertMode,f=this._curAttrData,d=o.lines.get(o.ybase+o.y);this._dirtyRowService.markDirty(o.y),o.x&&r-t>0&&2===d.getWidth(o.x-1)&&d.setCellFromCodePoint(o.x-1,0,1,f.fg,f.bg,f.extended);for(var p=t;p<r;++p){if(i=e[p],n=this._unicodeService.wcwidth(i),i<127&&s){var v=s[String.fromCharCode(i)];v&&(i=v.charCodeAt(0))}if(a&&this._onA11yChar.fire(h.stringFromCodePoint(i)),n||!o.x){if(o.x+n-1>=c)if(l){for(;o.x<c;)d.setCellFromCodePoint(o.x++,0,1,f.fg,f.bg,f.extended);o.x=0,o.y++,o.y===o.scrollBottom+1?(o.y--,this._onRequestScroll.fire(this._eraseAttrData(),!0)):(o.y>=this._bufferService.rows&&(o.y=this._bufferService.rows-1),o.lines.get(o.ybase+o.y).isWrapped=!0),d=o.lines.get(o.ybase+o.y)}else if(o.x=c-1,2===n)continue;if(u&&(d.insertCells(o.x,n,o.getNullCell(f),f),2===d.getWidth(c-1)&&d.setCellFromCodePoint(c-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,f.fg,f.bg,f.extended)),d.setCellFromCodePoint(o.x++,i,n,f.fg,f.bg,f.extended),n>0)for(;--n;)d.setCellFromCodePoint(o.x++,0,0,f.fg,f.bg,f.extended)}else d.getWidth(o.x-1)?d.addCodepointToCell(o.x-1,i):d.addCodepointToCell(o.x-2,i)}r-t>0&&(d.loadCell(o.x-1,this._workCell),2===this._workCell.getWidth()||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),o.x<c&&r-t>0&&0===d.getWidth(o.x)&&!d.hasContent(o.x)&&d.setCellFromCodePoint(o.x,0,1,f.fg,f.bg,f.extended),this._dirtyRowService.markDirty(o.y)},t.prototype.addCsiHandler=function(e,t){var r=this;return"t"!==e.final||e.prefix||e.intermediates?this._parser.addCsiHandler(e,t):this._parser.addCsiHandler(e,(function(e){return!b(e.params[0],r._optionsService.options.windowOptions)||t(e)}))},t.prototype.addDcsHandler=function(e,t){return this._parser.addDcsHandler(e,new y.DcsHandler(t))},t.prototype.addEscHandler=function(e,t){return this._parser.addEscHandler(e,t)},t.prototype.addOscHandler=function(e,t){return this._parser.addOscHandler(e,new g.OscHandler(t))},t.prototype.bell=function(){this._onRequestBell.fire()},t.prototype.lineFeed=function(){var e=this._bufferService.buffer;this._dirtyRowService.markDirty(e.y),this._optionsService.options.convertEol&&(e.x=0),e.y++,e.y===e.scrollBottom+1?(e.y--,this._onRequestScroll.fire(this._eraseAttrData())):e.y>=this._bufferService.rows&&(e.y=this._bufferService.rows-1),e.x>=this._bufferService.cols&&e.x--,this._dirtyRowService.markDirty(e.y),this._onLineFeed.fire()},t.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},t.prototype.backspace=function(){var e,t=this._bufferService.buffer;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),void(t.x>0&&t.x--);if(this._restrictCursor(this._bufferService.cols),t.x>0)t.x--;else if(0===t.x&&t.y>t.scrollTop&&t.y<=t.scrollBottom&&(null===(e=t.lines.get(t.ybase+t.y))||void 0===e?void 0:e.isWrapped)){t.lines.get(t.ybase+t.y).isWrapped=!1,t.y--,t.x=this._bufferService.cols-1;var r=t.lines.get(t.ybase+t.y);r.hasWidth(t.x)&&!r.hasContent(t.x)&&t.x--}this._restrictCursor()},t.prototype.tab=function(){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){var e=this._bufferService.buffer.x;this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-e)}},t.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},t.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},t.prototype._restrictCursor=function(e){void 0===e&&(e=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min(e,Math.max(0,this._bufferService.buffer.x)),this._bufferService.buffer.y=this._coreService.decPrivateModes.origin?Math.min(this._bufferService.buffer.scrollBottom,Math.max(this._bufferService.buffer.scrollTop,this._bufferService.buffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._bufferService.buffer.y)),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},t.prototype._setCursor=function(e,t){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=e,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+t):(this._bufferService.buffer.x=e,this._bufferService.buffer.y=t),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},t.prototype._moveCursor=function(e,t){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+e,this._bufferService.buffer.y+t)},t.prototype.cursorUp=function(e){var t=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1))},t.prototype.cursorDown=function(e){var t=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1)},t.prototype.cursorForward=function(e){this._moveCursor(e.params[0]||1,0)},t.prototype.cursorBackward=function(e){this._moveCursor(-(e.params[0]||1),0)},t.prototype.cursorNextLine=function(e){this.cursorDown(e),this._bufferService.buffer.x=0},t.prototype.cursorPrecedingLine=function(e){this.cursorUp(e),this._bufferService.buffer.x=0},t.prototype.cursorCharAbsolute=function(e){this._setCursor((e.params[0]||1)-1,this._bufferService.buffer.y)},t.prototype.cursorPosition=function(e){this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1)},t.prototype.charPosAbsolute=function(e){this._setCursor((e.params[0]||1)-1,this._bufferService.buffer.y)},t.prototype.hPositionRelative=function(e){this._moveCursor(e.params[0]||1,0)},t.prototype.linePosAbsolute=function(e){this._setCursor(this._bufferService.buffer.x,(e.params[0]||1)-1)},t.prototype.vPositionRelative=function(e){this._moveCursor(0,e.params[0]||1)},t.prototype.hVPosition=function(e){this.cursorPosition(e)},t.prototype.tabClear=function(e){var t=e.params[0];0===t?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:3===t&&(this._bufferService.buffer.tabs={})},t.prototype.cursorForwardTab=function(e){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var t=e.params[0]||1;t--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},t.prototype.cursorBackwardTab=function(e){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var t=e.params[0]||1,r=this._bufferService.buffer;t--;)r.x=r.prevStop()},t.prototype._eraseInBufferLine=function(e,t,r,i){void 0===i&&(i=!1);var n=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+e);n.replaceCells(t,r,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i&&(n.isWrapped=!1)},t.prototype._resetBufferLine=function(e){var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+e);t.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),t.isWrapped=!1},t.prototype.eraseInDisplay=function(e){var t;switch(this._restrictCursor(),e.params[0]){case 0:for(t=this._bufferService.buffer.y,this._dirtyRowService.markDirty(t),this._eraseInBufferLine(t++,this._bufferService.buffer.x,this._bufferService.cols,0===this._bufferService.buffer.x);t<this._bufferService.rows;t++)this._resetBufferLine(t);this._dirtyRowService.markDirty(t);break;case 1:for(t=this._bufferService.buffer.y,this._dirtyRowService.markDirty(t),this._eraseInBufferLine(t,0,this._bufferService.buffer.x+1,!0),this._bufferService.buffer.x+1>=this._bufferService.cols&&(this._bufferService.buffer.lines.get(t+1).isWrapped=!1);t--;)this._resetBufferLine(t);this._dirtyRowService.markDirty(0);break;case 2:for(t=this._bufferService.rows,this._dirtyRowService.markDirty(t-1);t--;)this._resetBufferLine(t);this._dirtyRowService.markDirty(0);break;case 3:var r=this._bufferService.buffer.lines.length-this._bufferService.rows;r>0&&(this._bufferService.buffer.lines.trimStart(r),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-r,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-r,0),this._onScroll.fire(0))}},t.prototype.eraseInLine=function(e){switch(this._restrictCursor(),e.params[0]){case 0:this._eraseInBufferLine(this._bufferService.buffer.y,this._bufferService.buffer.x,this._bufferService.cols);break;case 1:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.buffer.x+1);break;case 2:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.cols)}this._dirtyRowService.markDirty(this._bufferService.buffer.y)},t.prototype.insertLines=function(e){this._restrictCursor();var t=e.params[0]||1,r=this._bufferService.buffer;if(!(r.y>r.scrollBottom||r.y<r.scrollTop)){for(var i=r.ybase+r.y,n=this._bufferService.rows-1-r.scrollBottom,o=this._bufferService.rows-1+r.ybase-n+1;t--;)r.lines.splice(o-1,1),r.lines.splice(i,0,r.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(r.y,r.scrollBottom),r.x=0}},t.prototype.deleteLines=function(e){this._restrictCursor();var t=e.params[0]||1,r=this._bufferService.buffer;if(!(r.y>r.scrollBottom||r.y<r.scrollTop)){var i,n=r.ybase+r.y;for(i=this._bufferService.rows-1-r.scrollBottom,i=this._bufferService.rows-1+r.ybase-i;t--;)r.lines.splice(n,1),r.lines.splice(i,0,r.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(r.y,r.scrollBottom),r.x=0}},t.prototype.insertChars=function(e){this._restrictCursor();var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);t&&(t.insertCells(this._bufferService.buffer.x,e.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},t.prototype.deleteChars=function(e){this._restrictCursor();var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);t&&(t.deleteCells(this._bufferService.buffer.x,e.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},t.prototype.scrollUp=function(e){for(var t=e.params[0]||1,r=this._bufferService.buffer;t--;)r.lines.splice(r.ybase+r.scrollTop,1),r.lines.splice(r.ybase+r.scrollBottom,0,r.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(r.scrollTop,r.scrollBottom)},t.prototype.scrollDown=function(e){for(var t=e.params[0]||1,r=this._bufferService.buffer;t--;)r.lines.splice(r.ybase+r.scrollBottom,1),r.lines.splice(r.ybase+r.scrollTop,0,r.getBlankLine(f.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(r.scrollTop,r.scrollBottom)},t.prototype.scrollLeft=function(e){var t=this._bufferService.buffer;if(!(t.y>t.scrollBottom||t.y<t.scrollTop)){for(var r=e.params[0]||1,i=t.scrollTop;i<=t.scrollBottom;++i){var n=t.lines.get(t.ybase+i);n.deleteCells(0,r,t.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)}},t.prototype.scrollRight=function(e){var t=this._bufferService.buffer;if(!(t.y>t.scrollBottom||t.y<t.scrollTop)){for(var r=e.params[0]||1,i=t.scrollTop;i<=t.scrollBottom;++i){var n=t.lines.get(t.ybase+i);n.insertCells(0,r,t.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)}},t.prototype.insertColumns=function(e){var t=this._bufferService.buffer;if(!(t.y>t.scrollBottom||t.y<t.scrollTop)){for(var r=e.params[0]||1,i=t.scrollTop;i<=t.scrollBottom;++i){var n=this._bufferService.buffer.lines.get(t.ybase+i);n.insertCells(t.x,r,t.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)}},t.prototype.deleteColumns=function(e){var t=this._bufferService.buffer;if(!(t.y>t.scrollBottom||t.y<t.scrollTop)){for(var r=e.params[0]||1,i=t.scrollTop;i<=t.scrollBottom;++i){var n=t.lines.get(t.ybase+i);n.deleteCells(t.x,r,t.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)}},t.prototype.eraseChars=function(e){this._restrictCursor();var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);t&&(t.replaceCells(this._bufferService.buffer.x,this._bufferService.buffer.x+(e.params[0]||1),this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},t.prototype.repeatPrecedingCharacter=function(e){if(this._parser.precedingCodepoint){for(var t=e.params[0]||1,r=new Uint32Array(t),i=0;i<t;++i)r[i]=this._parser.precedingCodepoint;this.print(r,0,r.length)}},t.prototype.sendDeviceAttributesPrimary=function(e){e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(s.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(s.C0.ESC+"[?6c"))},t.prototype.sendDeviceAttributesSecondary=function(e){e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(s.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(s.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(s.C0.ESC+"[>83;40003;0c"))},t.prototype._is=function(e){return 0===(this._optionsService.options.termName+"").indexOf(e)},t.prototype.setMode=function(e){for(var t=0;t<e.length;t++)4===e.params[t]&&(this._coreService.modes.insertMode=!0)},t.prototype.setModePrivate=function(e){for(var t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,a.DEFAULT_CHARSET),this._charsetService.setgCharset(1,a.DEFAULT_CHARSET),this._charsetService.setgCharset(2,a.DEFAULT_CHARSET),this._charsetService.setgCharset(3,a.DEFAULT_CHARSET);break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0;break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}},t.prototype.resetMode=function(e){for(var t=0;t<e.length;t++)4===e.params[t]&&(this._coreService.modes.insertMode=!1)},t.prototype.resetModePrivate=function(e){for(var t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),1049===e.params[t]&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}},t.prototype._updateAttrColor=function(e,t,r,i,n){return 2===t?(e|=50331648,e&=-16777216,e|=v.AttributeData.fromColorRGB([r,i,n])):5===t&&(e&=-50331904,e|=33554432|255&r),e},t.prototype._extractColor=function(e,t,r){var i=[0,0,-1,0,0,0],n=0,o=0;do{if(i[o+n]=e.params[t+o],e.hasSubParams(t+o)){var s=e.getSubParams(t+o),a=0;do{5===i[1]&&(n=1),i[o+a+1+n]=s[a]}while(++a<s.length&&a+o+1+n<i.length);break}if(5===i[1]&&o+n>=2||2===i[1]&&o+n>=5)break;i[1]&&(n=1)}while(++o+t<e.length&&o+n<i.length);for(a=2;a<i.length;++a)-1===i[a]&&(i[a]=0);switch(i[0]){case 38:r.fg=this._updateAttrColor(r.fg,i[1],i[3],i[4],i[5]);break;case 48:r.bg=this._updateAttrColor(r.bg,i[1],i[3],i[4],i[5]);break;case 58:r.extended=r.extended.clone(),r.extended.underlineColor=this._updateAttrColor(r.extended.underlineColor,i[1],i[3],i[4],i[5])}return o},t.prototype._processUnderline=function(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,0===e&&(t.fg&=-268435457),t.updateExtended()},t.prototype.charAttributes=function(e){if(1===e.length&&0===e.params[0])return this._curAttrData.fg=f.DEFAULT_ATTR_DATA.fg,void(this._curAttrData.bg=f.DEFAULT_ATTR_DATA.bg);for(var t,r=e.length,i=this._curAttrData,n=0;n<r;n++)(t=e.params[n])>=30&&t<=37?(i.fg&=-50331904,i.fg|=16777216|t-30):t>=40&&t<=47?(i.bg&=-50331904,i.bg|=16777216|t-40):t>=90&&t<=97?(i.fg&=-50331904,i.fg|=16777224|t-90):t>=100&&t<=107?(i.bg&=-50331904,i.bg|=16777224|t-100):0===t?(i.fg=f.DEFAULT_ATTR_DATA.fg,i.bg=f.DEFAULT_ATTR_DATA.bg):1===t?i.fg|=134217728:3===t?i.bg|=67108864:4===t?(i.fg|=268435456,this._processUnderline(e.hasSubParams(n)?e.getSubParams(n)[0]:1,i)):5===t?i.fg|=536870912:7===t?i.fg|=67108864:8===t?i.fg|=1073741824:2===t?i.bg|=134217728:21===t?this._processUnderline(2,i):22===t?(i.fg&=-134217729,i.bg&=-134217729):23===t?i.bg&=-67108865:24===t?i.fg&=-268435457:25===t?i.fg&=-536870913:27===t?i.fg&=-67108865:28===t?i.fg&=-1073741825:39===t?(i.fg&=-67108864,i.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):49===t?(i.bg&=-67108864,i.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):38===t||48===t||58===t?n+=this._extractColor(e,n,i):59===t?(i.extended=i.extended.clone(),i.extended.underlineColor=-1,i.updateExtended()):100===t?(i.fg&=-67108864,i.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,i.bg&=-67108864,i.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",t)},t.prototype.deviceStatus=function(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(s.C0.ESC+"[0n");break;case 6:var t=this._bufferService.buffer.y+1,r=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(s.C0.ESC+"["+t+";"+r+"R")}},t.prototype.deviceStatusPrivate=function(e){if(6===e.params[0]){var t=this._bufferService.buffer.y+1,r=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(s.C0.ESC+"[?"+t+";"+r+"R")}},t.prototype.softReset=function(e){this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._bufferService.buffer.scrollTop=0,this._bufferService.buffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._bufferService.buffer.savedX=0,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1},t.prototype.setCursorStyle=function(e){var t=e.params[0]||1;switch(t){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}var r=t%2==1;this._optionsService.options.cursorBlink=r},t.prototype.setScrollRegion=function(e){var t,r=e.params[0]||1;(e.length<2||(t=e.params[1])>this._bufferService.rows||0===t)&&(t=this._bufferService.rows),t>r&&(this._bufferService.buffer.scrollTop=r-1,this._bufferService.buffer.scrollBottom=t-1,this._setCursor(0,0))},t.prototype.windowOptions=function(e){if(b(e.params[0],this._optionsService.options.windowOptions)){var t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:2!==t&&this._onRequestWindowsOptionsReport.fire(o.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(o.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(s.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:0!==t&&2!==t||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),0!==t&&1!==t||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:0!==t&&2!==t||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==t&&1!==t||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}},t.prototype.saveCursor=function(e){this._bufferService.buffer.savedX=this._bufferService.buffer.x,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase+this._bufferService.buffer.y,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset},t.prototype.restoreCursor=function(e){this._bufferService.buffer.x=this._bufferService.buffer.savedX||0,this._bufferService.buffer.y=Math.max(this._bufferService.buffer.savedY-this._bufferService.buffer.ybase,0),this._curAttrData.fg=this._bufferService.buffer.savedCurAttrData.fg,this._curAttrData.bg=this._bufferService.buffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._bufferService.buffer.savedCharset&&(this._charsetService.charset=this._bufferService.buffer.savedCharset),this._restrictCursor()},t.prototype.setTitle=function(e){this._windowTitle=e,this._onTitleChange.fire(e)},t.prototype.setIconName=function(e){this._iconName=e},t.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},t.prototype.keypadApplicationMode=function(){this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire()},t.prototype.keypadNumericMode=function(){this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire()},t.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,a.DEFAULT_CHARSET)},t.prototype.selectCharset=function(e){2===e.length?"/"!==e[0]&&this._charsetService.setgCharset(m[e[0]],a.CHARSETS[e[1]]||a.DEFAULT_CHARSET):this.selectDefaultCharset()},t.prototype.index=function(){this._restrictCursor();var e=this._bufferService.buffer;this._bufferService.buffer.y++,e.y===e.scrollBottom+1?(e.y--,this._onRequestScroll.fire(this._eraseAttrData())):e.y>=this._bufferService.rows&&(e.y=this._bufferService.rows-1),this._restrictCursor()},t.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},t.prototype.reverseIndex=function(){this._restrictCursor();var e=this._bufferService.buffer;if(e.y===e.scrollTop){var t=e.scrollBottom-e.scrollTop;e.lines.shiftElements(e.ybase+e.y,t,1),e.lines.set(e.ybase+e.y,e.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(e.scrollTop,e.scrollBottom)}else e.y--,this._restrictCursor()},t.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},t.prototype.reset=function(){this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone()},t.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},t.prototype.setgLevel=function(e){this._charsetService.setgLevel(e)},t.prototype.screenAlignmentPattern=function(){var e=new p.CellData;e.content=1<<22|"E".charCodeAt(0),e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg;var t=this._bufferService.buffer;this._setCursor(0,0);for(var r=0;r<this._bufferService.rows;++r){var i=t.ybase+t.y+r,n=t.lines.get(i);n&&(n.fill(e),n.isWrapped=!1)}this._dirtyRowService.markAllDirty(),this._setCursor(0,0)},t}(l.Disposable);t.InputHandler=S},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;var i=function(){function e(e,t){if(void 0===e&&(e=32),void 0===t&&(t=32),this.maxLength=e,this.maxSubParamsLength=t,t>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return e.fromArray=function(t){var r=new e;if(!t.length)return r;for(var i=t[0]instanceof Array?1:0;i<t.length;++i){var n=t[i];if(n instanceof Array)for(var o=0;o<n.length;++o)r.addSubParam(n[o]);else r.addParam(n)}return r},e.prototype.clone=function(){var t=new e(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t},e.prototype.toArray=function(){for(var e=[],t=0;t<this.length;++t){e.push(this.params[t]);var r=this._subParamsIdx[t]>>8,i=255&this._subParamsIdx[t];i-r>0&&e.push(Array.prototype.slice.call(this._subParams,r,i))}return e},e.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},e.prototype.addParam=function(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>2147483647?2147483647:e}},e.prototype.addSubParam=function(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>2147483647?2147483647:e,this._subParamsIdx[this.length-1]++}},e.prototype.hasSubParams=function(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0},e.prototype.getSubParams=function(e){var t=this._subParamsIdx[e]>>8,r=255&this._subParamsIdx[e];return r-t>0?this._subParams.subarray(t,r):null},e.prototype.getSubParamsAll=function(){for(var e={},t=0;t<this.length;++t){var r=this._subParamsIdx[t]>>8,i=255&this._subParamsIdx[t];i-r>0&&(e[t]=this._subParams.slice(r,i))}return e},e.prototype.addDigit=function(e){var t;if(!(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var r=this._digitIsSub?this._subParams:this.params,i=r[t-1];r[t-1]=~i?Math.min(10*i+e,2147483647):e}},e}();t.Params=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;var i=r(23),n=r(8),o=function(){function e(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}return e.prototype.addHandler=function(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);var r=this._handlers[e];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},e.prototype.setHandler=function(e,t){this._handlers[e]=[t]},e.prototype.clearHandler=function(e){this._handlers[e]&&delete this._handlers[e]},e.prototype.setHandlerFallback=function(e){this._handlerFb=e},e.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},e.prototype.reset=function(){2===this._state&&this.end(!1),this._id=-1,this._state=0},e.prototype._start=function(){var e=this._handlers[this._id];if(e)for(var t=e.length-1;t>=0;t--)e[t].start();else this._handlerFb(this._id,"START")},e.prototype._put=function(e,t,r){var i=this._handlers[this._id];if(i)for(var o=i.length-1;o>=0;o--)i[o].put(e,t,r);else this._handlerFb(this._id,"PUT",n.utf32ToString(e,t,r))},e.prototype._end=function(e){var t=this._handlers[this._id];if(t){for(var r=t.length-1;r>=0&&!1===t[r].end(e);r--);for(r--;r>=0;r--)t[r].end(!1)}else this._handlerFb(this._id,"END",e)},e.prototype.start=function(){this.reset(),this._id=-1,this._state=1},e.prototype.put=function(e,t,r){if(3!==this._state){if(1===this._state)for(;t<r;){var i=e[t++];if(59===i){this._state=2,this._start();break}if(i<48||57<i)return void(this._state=3);-1===this._id&&(this._id=0),this._id=10*this._id+i-48}2===this._state&&r-t>0&&this._put(e,t,r)}},e.prototype.end=function(e){0!==this._state&&(3!==this._state&&(1===this._state&&this._start(),this._end(e)),this._id=-1,this._state=0)},e}();t.OscParser=o;var s=function(){function e(e){this._handler=e,this._data="",this._hitLimit=!1}return e.prototype.start=function(){this._data="",this._hitLimit=!1},e.prototype.put=function(e,t,r){this._hitLimit||(this._data+=n.utf32ToString(e,t,r),this._data.length>i.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},e.prototype.end=function(e){var t;return this._hitLimit?t=!1:e&&(t=this._handler(this._data)),this._data="",this._hitLimit=!1,t},e}();t.OscHandler=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;var i=r(8),n=r(21),o=r(23),s=[],a=function(){function e(){this._handlers=Object.create(null),this._active=s,this._ident=0,this._handlerFb=function(){}}return e.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},e.prototype.addHandler=function(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);var r=this._handlers[e];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},e.prototype.setHandler=function(e,t){this._handlers[e]=[t]},e.prototype.clearHandler=function(e){this._handlers[e]&&delete this._handlers[e]},e.prototype.setHandlerFallback=function(e){this._handlerFb=e},e.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=s,this._ident=0},e.prototype.hook=function(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||s,this._active.length)for(var r=this._active.length-1;r>=0;r--)this._active[r].hook(t);else this._handlerFb(this._ident,"HOOK",t)},e.prototype.put=function(e,t,r){if(this._active.length)for(var n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,r);else this._handlerFb(this._ident,"PUT",i.utf32ToString(e,t,r))},e.prototype.unhook=function(e){if(this._active.length){for(var t=this._active.length-1;t>=0&&!1===this._active[t].unhook(e);t--);for(t--;t>=0;t--)this._active[t].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",e);this._active=s,this._ident=0},e}();t.DcsParser=a;var c=function(){function e(e){this._handler=e,this._data="",this._hitLimit=!1}return e.prototype.hook=function(e){this._params=e.clone(),this._data="",this._hitLimit=!1},e.prototype.put=function(e,t,r){this._hitLimit||(this._data+=i.utf32ToString(e,t,r),this._data.length>o.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},e.prototype.unhook=function(e){var t;return this._hitLimit?t=!1:e&&(t=this._handler(this._data,this._params||new n.Params)),this._params=void 0,this._data="",this._hitLimit=!1,t},e}();t.DcsHandler=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireCharAtlas=void 0;var i=r(26),n=r(43),o=[];t.acquireCharAtlas=function(e,t,r,s,a){for(var c=i.generateConfig(s,a,e,r),l=0;l<o.length;l++){var u=(h=o[l]).ownedBy.indexOf(t);if(u>=0){if(i.configEquals(h.config,c))return h.atlas;1===h.ownedBy.length?(h.atlas.dispose(),o.splice(l,1)):h.ownedBy.splice(u,1);break}}for(l=0;l<o.length;l++){var h=o[l];if(i.configEquals(h.config,c))return h.ownedBy.push(t),h.atlas}var f={atlas:new n.DynamicCharAtlas(document,c),config:c,ownedBy:[t]};return o.push(f),f.atlas},t.removeTerminalFromCache=function(e){for(var t=0;t<o.length;t++){var r=o[t].ownedBy.indexOf(e);if(-1!==r){1===o[t].ownedBy.length?(o[t].atlas.dispose(),o.splice(t,1)):o[t].ownedBy.splice(r,1);break}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;var i=r(3);t.generateConfig=function(e,t,r,i){var n={foreground:i.foreground,background:i.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:i.ansi.slice(0,16)};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:e,scaledCharHeight:t,fontFamily:r.fontFamily,fontSize:r.fontSize,fontWeight:r.fontWeight,fontWeightBold:r.fontWeightBold,allowTransparency:r.allowTransparency,colors:n}},t.configEquals=function(e,t){for(var r=0;r<e.colors.ansi.length;r++)if(e.colors.ansi[r].rgba!==t.colors.ansi[r].rgba)return!1;return e.devicePixelRatio===t.devicePixelRatio&&e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontWeightBold===t.fontWeightBold&&e.allowTransparency===t.allowTransparency&&e.scaledCharWidth===t.scaledCharWidth&&e.scaledCharHeight===t.scaledCharHeight&&e.colors.foreground===t.colors.foreground&&e.colors.background===t.colors.background},t.is256Color=function(e){return e<i.DEFAULT_COLOR}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorManager=t.DEFAULT_ANSI_COLORS=void 0;var i=r(10),n=r(45),o=i.css.toColor("#ffffff"),s=i.css.toColor("#000000"),a=i.css.toColor("#ffffff"),c=i.css.toColor("#000000"),l={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};t.DEFAULT_ANSI_COLORS=function(){for(var e=[i.css.toColor("#2e3436"),i.css.toColor("#cc0000"),i.css.toColor("#4e9a06"),i.css.toColor("#c4a000"),i.css.toColor("#3465a4"),i.css.toColor("#75507b"),i.css.toColor("#06989a"),i.css.toColor("#d3d7cf"),i.css.toColor("#555753"),i.css.toColor("#ef2929"),i.css.toColor("#8ae234"),i.css.toColor("#fce94f"),i.css.toColor("#729fcf"),i.css.toColor("#ad7fa8"),i.css.toColor("#34e2e2"),i.css.toColor("#eeeeec")],t=[0,95,135,175,215,255],r=0;r<216;r++){var n=t[r/36%6|0],o=t[r/6%6|0],s=t[r%6];e.push({css:i.channels.toCss(n,o,s),rgba:i.channels.toRgba(n,o,s)})}for(r=0;r<24;r++){var a=8+10*r;e.push({css:i.channels.toCss(a,a,a),rgba:i.channels.toRgba(a,a,a)})}return e}();var u=function(){function e(e,r){this.allowTransparency=r;var u=e.createElement("canvas");u.width=1,u.height=1;var h=u.getContext("2d");if(!h)throw new Error("Could not get rendering context");this._ctx=h,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new n.ColorContrastCache,this.colors={foreground:o,background:s,cursor:a,cursorAccent:c,selectionTransparent:l,selectionOpaque:i.color.blend(s,l),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return e.prototype.onOptionsChange=function(e){"minimumContrastRatio"===e&&this._contrastCache.clear()},e.prototype.setTheme=function(e){void 0===e&&(e={}),this.colors.foreground=this._parseColor(e.foreground,o),this.colors.background=this._parseColor(e.background,s),this.colors.cursor=this._parseColor(e.cursor,a,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,c,!0),this.colors.selectionTransparent=this._parseColor(e.selection,l,!0),this.colors.selectionOpaque=i.color.blend(this.colors.background,this.colors.selectionTransparent),i.color.isOpaque(this.colors.selectionTransparent)&&(this.colors.selectionTransparent=i.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(e.black,t.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(e.red,t.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(e.green,t.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(e.yellow,t.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(e.blue,t.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(e.magenta,t.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(e.cyan,t.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(e.white,t.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(e.brightWhite,t.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},e.prototype._parseColor=function(e,t,r){if(void 0===r&&(r=this.allowTransparency),void 0===e)return t;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=e,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+e+" is invalid using fallback "+t.css),t;this._ctx.fillRect(0,0,1,1);var n=this._ctx.getImageData(0,0,1,1).data;if(255!==n[3]){if(!r)return console.warn("Color: "+e+" is using transparency, but allowTransparency is false. Using fallback "+t.css+"."),t;var o=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map((function(e){return Number(e)})),s=o[0],a=o[1],c=o[2],l=o[3],u=Math.round(255*l);return{rgba:i.channels.toRgba(s,a,c,u),css:e}}return{css:this._ctx.fillStyle,rgba:i.channels.toRgba(n[0],n[1],n[2],n[3])}},e}();t.ColorManager=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw new Error("value must not be falsy");return e}},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerRegistry=t.JoinedCellData=void 0;var o=r(6),s=r(3),a=r(4),c=function(e){function t(t,r,i){var n=e.call(this)||this;return n.content=0,n.combinedData="",n.fg=t.fg,n.bg=t.bg,n.combinedData=r,n._width=i,n}return n(t,e),t.prototype.isCombined=function(){return 2097152},t.prototype.getWidth=function(){return this._width},t.prototype.getChars=function(){return this.combinedData},t.prototype.getCode=function(){return 2097151},t.prototype.setFromCharData=function(e){throw new Error("not implemented")},t.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},t}(o.AttributeData);t.JoinedCellData=c;var l=function(){function e(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new a.CellData}return e.prototype.registerCharacterJoiner=function(e){var t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id},e.prototype.deregisterCharacterJoiner=function(e){for(var t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1},e.prototype.getJoinedCharacters=function(e){if(0===this._characterJoiners.length)return[];var t=this._bufferService.buffer.lines.get(e);if(!t||0===t.length)return[];for(var r=[],i=t.translateToString(!0),n=0,o=0,a=0,c=t.getFg(0),l=t.getBg(0),u=0;u<t.getTrimmedLength();u++)if(t.loadCell(u,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==c||this._workCell.bg!==l){if(u-n>1)for(var h=this._getJoinedRanges(i,a,o,t,n),f=0;f<h.length;f++)r.push(h[f]);n=u,a=o,c=this._workCell.fg,l=this._workCell.bg}o+=this._workCell.getChars().length||s.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-n>1)for(h=this._getJoinedRanges(i,a,o,t,n),f=0;f<h.length;f++)r.push(h[f]);return r},e.prototype._getJoinedRanges=function(t,r,i,n,o){for(var s=t.substring(r,i),a=this._characterJoiners[0].handler(s),c=1;c<this._characterJoiners.length;c++)for(var l=this._characterJoiners[c].handler(s),u=0;u<l.length;u++)e._mergeRanges(a,l[u]);return this._stringRangesToCellRanges(a,n,o),a},e.prototype._stringRangesToCellRanges=function(e,t,r){var i=0,n=!1,o=0,a=e[i];if(a){for(var c=r;c<this._bufferService.cols;c++){var l=t.getWidth(c),u=t.getString(c).length||s.WHITESPACE_CELL_CHAR.length;if(0!==l){if(!n&&a[0]<=o&&(a[0]=c,n=!0),a[1]<=o){if(a[1]=c,!(a=e[++i]))break;a[0]<=o?(a[0]=c,n=!0):n=!1}o+=u}}a&&(a[1]=this._bufferService.cols)}},e._mergeRanges=function(e,t){for(var r=!1,i=0;i<e.length;i++){var n=e[i];if(r){if(t[1]<=n[0])return e[i-1][1]=t[1],e;if(t[1]<=n[1])return e[i-1][1]=Math.max(t[1],n[1]),e.splice(i,1),e;e.splice(i,1),i--}else{if(t[1]<=n[0])return e.splice(i,0,t),e;if(t[1]<=n[1])return n[0]=Math.min(t[0],n[0]),e;t[0]<n[1]&&(n[0]=Math.min(t[0],n[0]),r=!0)}}return r?e[e.length-1][1]=t[1]:e.push(t),e},e}();t.CharacterJoinerRegistry=l},function(e,t,r){"use strict";function i(e,t){var r=t.getBoundingClientRect();return[e.clientX-r.left,e.clientY-r.top]}Object.defineProperty(t,"__esModule",{value:!0}),t.getRawByteCoords=t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=i,t.getCoords=function(e,t,r,n,o,s,a,c){if(o){var l=i(e,t);if(l)return l[0]=Math.ceil((l[0]+(c?s/2:0))/s),l[1]=Math.ceil(l[1]/a),l[0]=Math.min(Math.max(l[0],1),r+(c?1:0)),l[1]=Math.min(Math.max(l[1],1),n),l}},t.getRawByteCoords=function(e){if(e)return{x:e[0]+32,y:e[1]+32}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0;var i=function(){function e(e){this._renderCallback=e}return e.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},e.prototype.refresh=function(e,t,r){var i=this;this._rowCount=r,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=window.requestAnimationFrame((function(){return i._innerRefresh()})))},e.prototype._innerRefresh=function(){if(void 0!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount){var e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0,this._renderCallback(e,t)}},e}();t.RenderDebouncer=i},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenDprMonitor=void 0;var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._currentDevicePixelRatio=window.devicePixelRatio,t}return n(t,e),t.prototype.setListener=function(e){var t=this;this._listener&&this.clearListener(),this._listener=e,this._outerListener=function(){t._listener&&(t._listener(window.devicePixelRatio,t._currentDevicePixelRatio),t._updateDpr())},this._updateDpr()},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.clearListener()},t.prototype._updateDpr=function(){var e;this._outerListener&&(null===(e=this._resolutionMediaMatchList)||void 0===e||e.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},t.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},t}(r(2).Disposable);t.ScreenDprMonitor=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function e(t,r){if(void 0===r&&(r=5),"object"!=typeof t)return t;var i=Array.isArray(t)?[]:{};for(var n in t)i[n]=r<=1?t[n]:t[n]?e(t[n],r-1):t[n];return i}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;var i=r(4),n=r(35),o=r(18),s=r(0),a=r(83),c=function(){function e(e){this._core=new n.Terminal(e),this._addonManager=new a.AddonManager}return e.prototype._checkProposedApi=function(){if(!this._core.optionsService.options.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")},Object.defineProperty(e.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new f(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unicode",{get:function(){return this._checkProposedApi(),new d(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._checkProposedApi(),new u(this._core.buffers)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),e.prototype.blur=function(){this._core.blur()},e.prototype.focus=function(){this._core.focus()},e.prototype.resize=function(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)},e.prototype.open=function(e){this._core.open(e)},e.prototype.attachCustomKeyEventHandler=function(e){this._core.attachCustomKeyEventHandler(e)},e.prototype.registerLinkMatcher=function(e,t,r){return this._checkProposedApi(),this._core.registerLinkMatcher(e,t,r)},e.prototype.deregisterLinkMatcher=function(e){this._checkProposedApi(),this._core.deregisterLinkMatcher(e)},e.prototype.registerLinkProvider=function(e){return this._checkProposedApi(),this._core.registerLinkProvider(e)},e.prototype.registerCharacterJoiner=function(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)},e.prototype.deregisterCharacterJoiner=function(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)},e.prototype.registerMarker=function(e){return this._checkProposedApi(),this._verifyIntegers(e),this._core.addMarker(e)},e.prototype.addMarker=function(e){return this.registerMarker(e)},e.prototype.hasSelection=function(){return this._core.hasSelection()},e.prototype.select=function(e,t,r){this._verifyIntegers(e,t,r),this._core.select(e,t,r)},e.prototype.getSelection=function(){return this._core.getSelection()},e.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},e.prototype.clearSelection=function(){this._core.clearSelection()},e.prototype.selectAll=function(){this._core.selectAll()},e.prototype.selectLines=function(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)},e.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},e.prototype.scrollLines=function(e){this._verifyIntegers(e),this._core.scrollLines(e)},e.prototype.scrollPages=function(e){this._verifyIntegers(e),this._core.scrollPages(e)},e.prototype.scrollToTop=function(){this._core.scrollToTop()},e.prototype.scrollToBottom=function(){this._core.scrollToBottom()},e.prototype.scrollToLine=function(e){this._verifyIntegers(e),this._core.scrollToLine(e)},e.prototype.clear=function(){this._core.clear()},e.prototype.write=function(e,t){this._core.write(e,t)},e.prototype.writeUtf8=function(e,t){this._core.write(e,t)},e.prototype.writeln=function(e,t){this._core.write(e),this._core.write("\r\n",t)},e.prototype.paste=function(e){this._core.paste(e)},e.prototype.getOption=function(e){return this._core.optionsService.getOption(e)},e.prototype.setOption=function(e,t){this._core.optionsService.setOption(e,t)},e.prototype.refresh=function(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)},e.prototype.reset=function(){this._core.reset()},e.prototype.loadAddon=function(e){return this._addonManager.loadAddon(this,e)},Object.defineProperty(e,"strings",{get:function(){return o},enumerable:!1,configurable:!0}),e.prototype._verifyIntegers=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0,i=e;r<i.length;r++){var n=i[r];if(n===1/0||isNaN(n)||n%1!=0)throw new Error("This API only accepts integers")}},e}();t.Terminal=c;var l=function(){function e(e,t){this._buffer=e,this.type=t}return e.prototype.init=function(e){return this._buffer=e,this},Object.defineProperty(e.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!1,configurable:!0}),e.prototype.getLine=function(e){var t=this._buffer.lines.get(e);if(t)return new h(t)},e.prototype.getNullCell=function(){return new i.CellData},e}(),u=function(){function e(e){var t=this;this._buffers=e,this._onBufferChange=new s.EventEmitter,this._normal=new l(this._buffers.normal,"normal"),this._alternate=new l(this._buffers.alt,"alternate"),this._buffers.onBufferActivate((function(){return t._onBufferChange.fire(t.active)}))}return Object.defineProperty(e.prototype,"onBufferChange",{get:function(){return this._onBufferChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"active",{get:function(){if(this._buffers.active===this._buffers.normal)return this.normal;if(this._buffers.active===this._buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"normal",{get:function(){return this._normal.init(this._buffers.normal)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alternate",{get:function(){return this._alternate.init(this._buffers.alt)},enumerable:!1,configurable:!0}),e}(),h=function(){function e(e){this._line=e}return Object.defineProperty(e.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._line.length},enumerable:!1,configurable:!0}),e.prototype.getCell=function(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new i.CellData)},e.prototype.translateToString=function(e,t,r){return this._line.translateToString(e,t,r)},e}(),f=function(){function e(e){this._core=e}return e.prototype.registerCsiHandler=function(e,t){return this._core.addCsiHandler(e,(function(e){return t(e.toArray())}))},e.prototype.addCsiHandler=function(e,t){return this.registerCsiHandler(e,t)},e.prototype.registerDcsHandler=function(e,t){return this._core.addDcsHandler(e,(function(e,r){return t(e,r.toArray())}))},e.prototype.addDcsHandler=function(e,t){return this.registerDcsHandler(e,t)},e.prototype.registerEscHandler=function(e,t){return this._core.addEscHandler(e,t)},e.prototype.addEscHandler=function(e,t){return this.registerEscHandler(e,t)},e.prototype.registerOscHandler=function(e,t){return this._core.addOscHandler(e,t)},e.prototype.addOscHandler=function(e,t){return this.registerOscHandler(e,t)},e}(),d=function(){function e(e){this._core=e}return e.prototype.register=function(e){this._core.unicodeService.register(e)},Object.defineProperty(e.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(e){this._core.unicodeService.activeVersion=e},enumerable:!1,configurable:!0}),e}()},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;var o=r(36),s=r(37),a=r(38),c=r(12),l=r(19),u=r(40),h=r(50),f=r(51),d=r(11),_=r(7),p=r(18),v=r(54),g=r(55),y=r(56),m=r(57),b=r(59),w=r(0),S=r(16),C=r(27),k=r(60),E=r(5),x=r(61),L=r(62),A=r(63),R=r(64),M=r(65),T="undefined"!=typeof window?window.document:null,D=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.browser=d,r._keyDownHandled=!1,r._onCursorMove=new w.EventEmitter,r._onKey=new w.EventEmitter,r._onRender=new w.EventEmitter,r._onSelectionChange=new w.EventEmitter,r._onTitleChange=new w.EventEmitter,r._onFocus=new w.EventEmitter,r._onBlur=new w.EventEmitter,r._onA11yCharEmitter=new w.EventEmitter,r._onA11yTabEmitter=new w.EventEmitter,r._setup(),r.linkifier=r._instantiationService.createInstance(h.Linkifier),r.linkifier2=r.register(r._instantiationService.createInstance(A.Linkifier2)),r.register(r._inputHandler.onRequestBell((function(){return r.bell()}))),r.register(r._inputHandler.onRequestRefreshRows((function(e,t){return r.refresh(e,t)}))),r.register(r._inputHandler.onRequestReset((function(){return r.reset()}))),r.register(r._inputHandler.onRequestScroll((function(e,t){return r.scroll(e,t||void 0)}))),r.register(r._inputHandler.onRequestWindowsOptionsReport((function(e){return r._reportWindowsOptions(e)}))),r.register(w.forwardEvent(r._inputHandler.onCursorMove,r._onCursorMove)),r.register(w.forwardEvent(r._inputHandler.onTitleChange,r._onTitleChange)),r.register(w.forwardEvent(r._inputHandler.onA11yChar,r._onA11yCharEmitter)),r.register(w.forwardEvent(r._inputHandler.onA11yTab,r._onA11yTabEmitter)),r.register(r._bufferService.onResize((function(e){return r._afterResize(e.cols,e.rows)}))),r}return n(t,e),Object.defineProperty(t.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){var t,r,i;this._isDisposed||(e.prototype.dispose.call(this),null===(t=this._renderService)||void 0===t||t.dispose(),this._customKeyEventHandler=void 0,this.write=function(){},null===(i=null===(r=this.element)||void 0===r?void 0:r.parentNode)||void 0===i||i.removeChild(this.element))},t.prototype._setup=function(){e.prototype._setup.call(this),this._customKeyEventHandler=void 0},Object.defineProperty(t.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),t.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},t.prototype._updateOptions=function(t){var r,i,n,o;switch(e.prototype._updateOptions.call(this,t),t){case"fontFamily":case"fontSize":null===(r=this._renderService)||void 0===r||r.clear(),null===(i=this._charSizeService)||void 0===i||i.measure();break;case"cursorBlink":case"cursorStyle":this.refresh(this.buffer.y,this.buffer.y);break;case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":this._renderService&&(this._renderService.clear(),this._renderService.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"rendererType":this._renderService&&(this._renderService.setRenderer(this._createRenderer()),this._renderService.onResize(this.cols,this.rows));break;case"scrollback":null===(n=this.viewport)||void 0===n||n.syncScrollArea();break;case"screenReaderMode":this.optionsService.options.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new y.AccessibilityManager(this,this._renderService)):(null===(o=this._accessibilityManager)||void 0===o||o.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.options.theme)}},t.prototype._onTextAreaFocus=function(e){this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(c.C0.ESC+"[I"),this.updateCursorStyle(e),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()},t.prototype.blur=function(){var e;return null===(e=this.textarea)||void 0===e?void 0:e.blur()},t.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(c.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},t.prototype._syncTextArea=function(){if(this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing){var e=Math.ceil(this._charSizeService.height*this.optionsService.options.lineHeight),t=this._bufferService.buffer.y*e,r=this._bufferService.buffer.x*this._charSizeService.width;this.textarea.style.left=r+"px",this.textarea.style.top=t+"px",this.textarea.style.width=this._charSizeService.width+"px",this.textarea.style.height=e+"px",this.textarea.style.lineHeight=e+"px",this.textarea.style.zIndex="-5"}},t.prototype._initGlobal=function(){var e=this;this._bindKeys(),this.register(_.addDisposableDomListener(this.element,"copy",(function(t){e.hasSelection()&&a.copyHandler(t,e._selectionService)})));var t=function(t){return a.handlePasteEvent(t,e.textarea,e._coreService)};this.register(_.addDisposableDomListener(this.textarea,"paste",t)),this.register(_.addDisposableDomListener(this.element,"paste",t)),d.isFirefox?this.register(_.addDisposableDomListener(this.element,"mousedown",(function(t){2===t.button&&a.rightClickHandler(t,e.textarea,e.screenElement,e._selectionService,e.options.rightClickSelectsWord)}))):this.register(_.addDisposableDomListener(this.element,"contextmenu",(function(t){a.rightClickHandler(t,e.textarea,e.screenElement,e._selectionService,e.options.rightClickSelectsWord)}))),d.isLinux&&this.register(_.addDisposableDomListener(this.element,"auxclick",(function(t){1===t.button&&a.moveTextAreaUnderMouseCursor(t,e.textarea,e.screenElement)})))},t.prototype._bindKeys=function(){var e=this;this.register(_.addDisposableDomListener(this.textarea,"keyup",(function(t){return e._keyUp(t)}),!0)),this.register(_.addDisposableDomListener(this.textarea,"keydown",(function(t){return e._keyDown(t)}),!0)),this.register(_.addDisposableDomListener(this.textarea,"keypress",(function(t){return e._keyPress(t)}),!0)),this.register(_.addDisposableDomListener(this.textarea,"compositionstart",(function(){return e._compositionHelper.compositionstart()}))),this.register(_.addDisposableDomListener(this.textarea,"compositionupdate",(function(t){return e._compositionHelper.compositionupdate(t)}))),this.register(_.addDisposableDomListener(this.textarea,"compositionend",(function(){return e._compositionHelper.compositionend()}))),this.register(this.onRender((function(){return e._compositionHelper.updateCompositionElements()}))),this.register(this.onRender((function(t){return e._queueLinkification(t.start,t.end)})))},t.prototype.open=function(e){var t=this;if(!e)throw new Error("Terminal requires a parent element.");T.body.contains(e)||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=e.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),e.appendChild(this.element);var r=T.createDocumentFragment();this._viewportElement=T.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),r.appendChild(this._viewportElement),this._viewportScrollArea=T.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=T.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=T.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),r.appendChild(this.screenElement),this.textarea=T.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register(_.addDisposableDomListener(this.textarea,"focus",(function(e){return t._onTextAreaFocus(e)}))),this.register(_.addDisposableDomListener(this.textarea,"blur",(function(){return t._onTextAreaBlur()}))),this._helperContainer.appendChild(this.textarea);var i=this._instantiationService.createInstance(R.CoreBrowserService,this.textarea);this._instantiationService.setService(E.ICoreBrowserService,i),this._charSizeService=this._instantiationService.createInstance(x.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._compositionView=T.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(o.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(r),this._theme=this.options.theme||this._theme,this._colorManager=new C.ColorManager(T,this.options.allowTransparency),this.register(this.optionsService.onOptionChange((function(e){return t._colorManager.onOptionsChange(e)}))),this._colorManager.setTheme(this._theme);var n=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(k.RenderService,n,this.rows,this.screenElement)),this._instantiationService.setService(E.IRenderService,this._renderService),this.register(this._renderService.onRenderedBufferChange((function(e){return t._onRender.fire(e)}))),this.onResize((function(e){return t._renderService.resize(e.cols,e.rows)})),this._soundService=this._instantiationService.createInstance(v.SoundService),this._instantiationService.setService(E.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(L.MouseService),this._instantiationService.setService(E.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(s.Viewport,(function(e,r){return t.scrollLines(e,r)}),this._viewportElement,this._viewportScrollArea),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar((function(){return t.viewport.syncScrollArea()}))),this.register(this.viewport),this.register(this.onCursorMove((function(){t._renderService.onCursorMove(),t._syncTextArea()}))),this.register(this.onResize((function(){return t._renderService.onResize(t.cols,t.rows)}))),this.register(this.onBlur((function(){return t._renderService.onBlur()}))),this.register(this.onFocus((function(){return t._renderService.onFocus()}))),this.register(this._renderService.onDimensionsChange((function(){return t.viewport.syncScrollArea()}))),this._selectionService=this.register(this._instantiationService.createInstance(f.SelectionService,this.element,this.screenElement)),this._instantiationService.setService(E.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((function(e){return t.scrollLines(e.amount,e.suppressScrollEvent)}))),this.register(this._selectionService.onSelectionChange((function(){return t._onSelectionChange.fire()}))),this.register(this._selectionService.onRequestRedraw((function(e){return t._renderService.onSelectionChanged(e.start,e.end,e.columnSelectMode)}))),this.register(this._selectionService.onLinuxMouseSelection((function(e){t.textarea.value=e,t.textarea.focus(),t.textarea.select()}))),this.register(this.onScroll((function(){t.viewport.syncScrollArea(),t._selectionService.refresh()}))),this.register(_.addDisposableDomListener(this._viewportElement,"scroll",(function(){return t._selectionService.refresh()}))),this._mouseZoneManager=this._instantiationService.createInstance(g.MouseZoneManager,this.element,this.screenElement),this.register(this._mouseZoneManager),this.register(this.onScroll((function(){return t._mouseZoneManager.clearAll()}))),this.linkifier.attachToDom(this.element,this._mouseZoneManager),this.linkifier2.attachToDom(this.element,this._mouseService,this._renderService),this.register(_.addDisposableDomListener(this.element,"mousedown",(function(e){return t._selectionService.onMouseDown(e)}))),this._coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new y.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},t.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return this._instantiationService.createInstance(u.Renderer,this._colorManager.colors,this.screenElement,this.linkifier,this.linkifier2);case"dom":return this._instantiationService.createInstance(m.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier,this.linkifier2);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},t.prototype._setTheme=function(e){var t,r,i;this._theme=e,null===(t=this._colorManager)||void 0===t||t.setTheme(e),null===(r=this._renderService)||void 0===r||r.setColors(this._colorManager.colors),null===(i=this.viewport)||void 0===i||i.onThemeChange(this._colorManager.colors)},t.prototype.bindMouse=function(){var e=this,t=this,r=this.element;function i(e){var r,i,n=t._mouseService.getRawByteCoords(e,t.screenElement,t.cols,t.rows);if(!n)return!1;switch(e.overrideType||e.type){case"mousemove":i=32,void 0===e.buttons?(r=3,void 0!==e.button&&(r=e.button<3?e.button:3)):r=1&e.buttons?0:4&e.buttons?1:2&e.buttons?2:3;break;case"mouseup":i=0,r=e.button<3?e.button:3;break;case"mousedown":i=1,r=e.button<3?e.button:3;break;case"wheel":0!==e.deltaY&&(i=e.deltaY<0?0:1),r=4;break;default:return!1}return!(void 0===i||void 0===r||r>4)&&t._coreMouseService.triggerMouseEvent({col:n.x-33,row:n.y-33,button:r,action:i,ctrl:e.ctrlKey,alt:e.altKey,shift:e.shiftKey})}var n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o=function(t){return i(t),t.buttons||(e._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&e._document.removeEventListener("mousemove",n.mousedrag)),e.cancel(t)},s=function(t){return i(t),t.preventDefault(),e.cancel(t)},a=function(e){e.buttons&&i(e)},l=function(e){e.buttons||i(e)};this.register(this._coreMouseService.onProtocolChange((function(t){t?("debug"===e.optionsService.options.logLevel&&e._logService.debug("Binding to mouse events:",e._coreMouseService.explainEvents(t)),e.element.classList.add("enable-mouse-events"),e._selectionService.disable()):(e._logService.debug("Unbinding from mouse events."),e.element.classList.remove("enable-mouse-events"),e._selectionService.enable()),8&t?n.mousemove||(r.addEventListener("mousemove",l),n.mousemove=l):(r.removeEventListener("mousemove",n.mousemove),n.mousemove=null),16&t?n.wheel||(r.addEventListener("wheel",s,{passive:!1}),n.wheel=s):(r.removeEventListener("wheel",n.wheel),n.wheel=null),2&t?n.mouseup||(n.mouseup=o):(e._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),4&t?n.mousedrag||(n.mousedrag=a):(e._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)}))),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(_.addDisposableDomListener(r,"mousedown",(function(t){if(t.preventDefault(),e.focus(),e._coreMouseService.areMouseEventsActive&&!e._selectionService.shouldForceSelection(t))return i(t),n.mouseup&&e._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&e._document.addEventListener("mousemove",n.mousedrag),e.cancel(t)}))),this.register(_.addDisposableDomListener(r,"wheel",(function(t){if(n.wheel);else if(!e.buffer.hasScrollback){var r=e.viewport.getLinesScrolled(t);if(0===r)return;for(var i=c.C0.ESC+(e._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(t.deltaY<0?"A":"B"),o="",s=0;s<Math.abs(r);s++)o+=i;e._coreService.triggerDataEvent(o,!0)}}),{passive:!0})),this.register(_.addDisposableDomListener(r,"wheel",(function(t){if(!n.wheel)return e.viewport.onWheel(t)?void 0:e.cancel(t)}),{passive:!1})),this.register(_.addDisposableDomListener(r,"touchstart",(function(t){if(!e._coreMouseService.areMouseEventsActive)return e.viewport.onTouchStart(t),e.cancel(t)}),{passive:!0})),this.register(_.addDisposableDomListener(r,"touchmove",(function(t){if(!e._coreMouseService.areMouseEventsActive)return e.viewport.onTouchMove(t)?void 0:e.cancel(t)}),{passive:!1}))},t.prototype.refresh=function(e,t){var r;null===(r=this._renderService)||void 0===r||r.refreshRows(e,t)},t.prototype._queueLinkification=function(e,t){var r;null===(r=this.linkifier)||void 0===r||r.linkifyRows(e,t)},t.prototype.updateCursorStyle=function(e){this._selectionService&&this._selectionService.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},t.prototype._showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},t.prototype.scrollLines=function(t,r){e.prototype.scrollLines.call(this,t,r),this.refresh(0,this.rows-1)},t.prototype.paste=function(e){a.paste(e,this.textarea,this._coreService)},t.prototype.attachCustomKeyEventHandler=function(e){this._customKeyEventHandler=e},t.prototype.registerLinkMatcher=function(e,t,r){var i=this.linkifier.registerLinkMatcher(e,t,r);return this.refresh(0,this.rows-1),i},t.prototype.deregisterLinkMatcher=function(e){this.linkifier.deregisterLinkMatcher(e)&&this.refresh(0,this.rows-1)},t.prototype.registerLinkProvider=function(e){return this.linkifier2.registerLinkProvider(e)},t.prototype.registerCharacterJoiner=function(e){var t=this._renderService.registerCharacterJoiner(e);return this.refresh(0,this.rows-1),t},t.prototype.deregisterCharacterJoiner=function(e){this._renderService.deregisterCharacterJoiner(e)&&this.refresh(0,this.rows-1)},Object.defineProperty(t.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!1,configurable:!0}),t.prototype.addMarker=function(e){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)},t.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},t.prototype.select=function(e,t,r){this._selectionService.setSelection(e,t,r)},t.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},t.prototype.getSelectionPosition=function(){if(this._selectionService&&this._selectionService.hasSelection)return{startColumn:this._selectionService.selectionStart[0],startRow:this._selectionService.selectionStart[1],endColumn:this._selectionService.selectionEnd[0],endRow:this._selectionService.selectionEnd[1]}},t.prototype.clearSelection=function(){var e;null===(e=this._selectionService)||void 0===e||e.clearSelection()},t.prototype.selectAll=function(){var e;null===(e=this._selectionService)||void 0===e||e.selectAll()},t.prototype.selectLines=function(e,t){var r;null===(r=this._selectionService)||void 0===r||r.selectLines(e,t)},t.prototype._keyDown=function(e){if(this._keyDownHandled=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(!this._compositionHelper.keydown(e))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var t=b.evaluateKeyboardEvent(e,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3===t.type||2===t.type){var r=this.rows-1;return this.scrollLines(2===t.type?-r:r),this.cancel(e,!0)}return 1===t.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(t.cancel&&this.cancel(e,!0),!t.key||(t.key!==c.C0.ETX&&t.key!==c.C0.CR||(this.textarea.value=""),this._onKey.fire({key:t.key,domEvent:e}),this._showCursor(),this._coreService.triggerDataEvent(t.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(e,!0)))},t.prototype._isThirdLevelShift=function(e,t){var r=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey;return"keypress"===t.type?r:r&&(!t.keyCode||t.keyCode>47)},t.prototype._keyUp=function(e){this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode}(e)||this.focus(),this.updateCursorStyle(e))},t.prototype._keyPress=function(e){var t;if(this._keyDownHandled)return!1;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null===e.which||void 0===e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this._coreService.triggerDataEvent(t,!0),0))},t.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},t.prototype.resize=function(t,r){t!==this.cols||r!==this.rows?e.prototype.resize.call(this,t,r):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},t.prototype._afterResize=function(e,t){var r,i;null===(r=this._charSizeService)||void 0===r||r.measure(),null===(i=this.viewport)||void 0===i||i.syncScrollArea(!0)},t.prototype.clear=function(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(S.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},t.prototype.reset=function(){var t,r;this.options.rows=this.rows,this.options.cols=this.cols;var i=this._customKeyEventHandler;this._setup(),e.prototype.reset.call(this),null===(t=this._selectionService)||void 0===t||t.reset(),this._customKeyEventHandler=i,this.refresh(0,this.rows-1),null===(r=this.viewport)||void 0===r||r.syncScrollArea()},t.prototype._reportWindowsOptions=function(e){if(this._renderService)switch(e){case l.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:var t=this._renderService.dimensions.scaledCanvasWidth.toFixed(0),r=this._renderService.dimensions.scaledCanvasHeight.toFixed(0);this._coreService.triggerDataEvent(c.C0.ESC+"[4;"+r+";"+t+"t");break;case l.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var i=this._renderService.dimensions.scaledCellWidth.toFixed(0),n=this._renderService.dimensions.scaledCellHeight.toFixed(0);this._coreService.triggerDataEvent(c.C0.ESC+"[6;"+n+";"+i+"t")}},t.prototype.cancel=function(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1},t.prototype._visualBell=function(){return!1},t.prototype._soundBell=function(){return"sound"===this.options.bellStyle},t}(M.CoreTerminal);t.Terminal=D},function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},n=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;var o=r(5),s=r(1),a=function(){function e(e,t,r,i,n,o){this._textarea=e,this._compositionView=t,this._bufferService=r,this._optionsService=i,this._charSizeService=n,this._coreService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0}}return Object.defineProperty(e.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),e.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},e.prototype.compositionupdate=function(e){var t=this;this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout((function(){t._compositionPosition.end=t._textarea.value.length}),0)},e.prototype.compositionend=function(){this._finalizeComposition(!0)},e.prototype.keydown=function(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)},e.prototype._finalizeComposition=function(e){var t=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){var r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((function(){if(t._isSendingComposition){t._isSendingComposition=!1;var e=void 0;e=t._isComposing?t._textarea.value.substring(r.start,r.end):t._textarea.value.substring(r.start),t._coreService.triggerDataEvent(e,!0)}}),0)}else{this._isSendingComposition=!1;var i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}},e.prototype._handleAnyTextareaChanges=function(){var e=this,t=this._textarea.value;setTimeout((function(){if(!e._isComposing){var r=e._textarea.value.replace(t,"");r.length>0&&e._coreService.triggerDataEvent(r,!0)}}),0)},e.prototype.updateCompositionElements=function(e){var t=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var r=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),i=this._bufferService.buffer.y*r,n=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var o=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=i+"px",this._textarea.style.width=o.width+"px",this._textarea.style.height=o.height+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout((function(){return t.updateCompositionElements(!0)}),0)}},i([n(2,s.IBufferService),n(3,s.IOptionsService),n(4,o.ICharSizeService),n(5,s.ICoreService)],e)}();t.CompositionHelper=a},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;var a=r(2),c=r(7),l=r(5),u=r(1),h=function(e){function t(t,r,i,n,o,s,a){var l=e.call(this)||this;return l._scrollLines=t,l._viewportElement=r,l._scrollArea=i,l._bufferService=n,l._optionsService=o,l._charSizeService=s,l._renderService=a,l.scrollBarWidth=0,l._currentRowHeight=0,l._lastRecordedBufferLength=0,l._lastRecordedViewportHeight=0,l._lastRecordedBufferHeight=0,l._lastTouchY=0,l._lastScrollTop=0,l._wheelPartialScroll=0,l._refreshAnimationFrame=null,l._ignoreNextScrollEvent=!1,l.scrollBarWidth=l._viewportElement.offsetWidth-l._scrollArea.offsetWidth||15,l.register(c.addDisposableDomListener(l._viewportElement,"scroll",l._onScroll.bind(l))),setTimeout((function(){return l.syncScrollArea()}),0),l}return n(t,e),t.prototype.onThemeChange=function(e){this._viewportElement.style.backgroundColor=e.background.css},t.prototype._refresh=function(e){var t=this;if(e)return this._innerRefresh(),void(null!==this._refreshAnimationFrame&&cancelAnimationFrame(this._refreshAnimationFrame));null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame((function(){return t._innerRefresh()})))},t.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var t=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==t&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=t),this._refreshAnimationFrame=null},t.prototype.syncScrollArea=function(e){if(void 0===e&&(e=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);if(this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight){var t=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===t&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(e)}else this._refresh(e)},t.prototype._onScroll=function(e){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(t,!0)}},t.prototype._bubbleScroll=function(e,t){var r=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&0!==this._viewportElement.scrollTop||t>0&&r<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)},t.prototype.onWheel=function(e){var t=this._getPixelsScrolled(e);return 0!==t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))},t.prototype._getPixelsScrolled=function(e){if(0===e.deltaY)return 0;var t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t},t.prototype.getLinesScrolled=function(e){if(0===e.deltaY)return 0;var t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t},t.prototype._applyScrollModifier=function(e,t){var r=this._optionsService.options.fastScrollModifier;return"alt"===r&&t.altKey||"ctrl"===r&&t.ctrlKey||"shift"===r&&t.shiftKey?e*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:e*this._optionsService.options.scrollSensitivity},t.prototype.onTouchStart=function(e){this._lastTouchY=e.touches[0].pageY},t.prototype.onTouchMove=function(e){var t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,0!==t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))},o([s(3,u.IBufferService),s(4,u.IOptionsService),s(5,l.ICharSizeService),s(6,l.IRenderService)],t)}(a.Disposable);t.Viewport=h},function(e,t,r){"use strict";function i(e){return e.replace(/\r?\n/g,"\r")}function n(e,t){return t?"[200~"+e+"[201~":e}function o(e,t,r){e=n(e=i(e),r.decPrivateModes.bracketedPasteMode),r.triggerDataEvent(e,!0),t.value=""}function s(e,t,r){var i=r.getBoundingClientRect(),n=e.clientX-i.left-10,o=e.clientY-i.top-10;t.style.width="20px",t.style.height="20px",t.style.left=n+"px",t.style.top=o+"px",t.style.zIndex="1000",t.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=i,t.bracketTextForPaste=n,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,r){e.stopPropagation(),e.clipboardData&&o(e.clipboardData.getData("text/plain"),t,r)},t.paste=o,t.moveTextAreaUnderMouseCursor=s,t.rightClickHandler=function(e,t,r,i,n){s(e,t,r),n&&!i.isClickInSelection(e)&&i.selectWordAtCursor(e),t.value=i.selectionText,t.select()}},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;var o=r(2),s=r(15),a=r(21),c=r(22),l=r(24),u=function(){function e(e){this.table=new Uint8Array(e)}return e.prototype.setDefault=function(e,t){s.fill(this.table,e<<4|t)},e.prototype.add=function(e,t,r,i){this.table[t<<8|e]=r<<4|i},e.prototype.addMany=function(e,t,r,i){for(var n=0;n<e.length;n++)this.table[t<<8|e[n]]=r<<4|i},e}();t.TransitionTable=u,t.VT500_TRANSITION_TABLE=function(){var e=new u(4095),t=Array.apply(null,Array(256)).map((function(e,t){return t})),r=function(e,r){return t.slice(e,r)},i=r(32,127),n=r(0,24);n.push(25),n.push.apply(n,r(28,32));var o,s=r(0,14);for(o in e.setDefault(1,0),e.addMany(i,0,2,0),s)e.addMany([24,26,153,154],o,3,0),e.addMany(r(128,144),o,3,0),e.addMany(r(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(n,0,3,0),e.addMany(n,1,3,1),e.add(127,1,0,1),e.addMany(n,8,0,8),e.addMany(n,3,3,3),e.add(127,3,0,3),e.addMany(n,4,3,4),e.add(127,4,0,4),e.addMany(n,6,3,6),e.addMany(n,5,3,5),e.add(127,5,0,5),e.addMany(n,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(i,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(i,7,0,7),e.addMany(n,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(n,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(n,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(n,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(n,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(n,13,13,13),e.addMany(i,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(160,0,2,0),e.add(160,8,5,8),e.add(160,6,0,6),e.add(160,11,0,11),e.add(160,13,13,13),e}();var h=function(e){function r(r){void 0===r&&(r=t.VT500_TRANSITION_TABLE);var i=e.call(this)||this;return i._transitions=r,i.initialState=0,i.currentState=i.initialState,i._params=new a.Params,i._params.addParam(0),i._collect=0,i.precedingCodepoint=0,i._printHandlerFb=function(e,t,r){},i._executeHandlerFb=function(e){},i._csiHandlerFb=function(e,t){},i._escHandlerFb=function(e){},i._errorHandlerFb=function(e){return e},i._printHandler=i._printHandlerFb,i._executeHandlers=Object.create(null),i._csiHandlers=Object.create(null),i._escHandlers=Object.create(null),i._oscParser=new c.OscParser,i._dcsParser=new l.DcsParser,i._errorHandler=i._errorHandlerFb,i.setEscHandler({final:"\\"},(function(){})),i}return n(r,e),r.prototype._identifier=function(e,t){void 0===t&&(t=[64,126]);var r=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if((r=e.prefix.charCodeAt(0))&&60>r||r>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var i=0;i<e.intermediates.length;++i){var n=e.intermediates.charCodeAt(i);if(32>n||n>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=n}}if(1!==e.final.length)throw new Error("final must be a single byte");var o=e.final.charCodeAt(0);if(t[0]>o||o>t[1])throw new Error("final must be in range "+t[0]+" .. "+t[1]);return(r<<=8)|o},r.prototype.identToString=function(e){for(var t=[];e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")},r.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},r.prototype.setPrintHandler=function(e){this._printHandler=e},r.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},r.prototype.addEscHandler=function(e,t){var r=this._identifier(e,[48,126]);void 0===this._escHandlers[r]&&(this._escHandlers[r]=[]);var i=this._escHandlers[r];return i.push(t),{dispose:function(){var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}},r.prototype.setEscHandler=function(e,t){this._escHandlers[this._identifier(e,[48,126])]=[t]},r.prototype.clearEscHandler=function(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]},r.prototype.setEscHandlerFallback=function(e){this._escHandlerFb=e},r.prototype.setExecuteHandler=function(e,t){this._executeHandlers[e.charCodeAt(0)]=t},r.prototype.clearExecuteHandler=function(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]},r.prototype.setExecuteHandlerFallback=function(e){this._executeHandlerFb=e},r.prototype.addCsiHandler=function(e,t){var r=this._identifier(e);void 0===this._csiHandlers[r]&&(this._csiHandlers[r]=[]);var i=this._csiHandlers[r];return i.push(t),{dispose:function(){var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}},r.prototype.setCsiHandler=function(e,t){this._csiHandlers[this._identifier(e)]=[t]},r.prototype.clearCsiHandler=function(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]},r.prototype.setCsiHandlerFallback=function(e){this._csiHandlerFb=e},r.prototype.addDcsHandler=function(e,t){return this._dcsParser.addHandler(this._identifier(e),t)},r.prototype.setDcsHandler=function(e,t){this._dcsParser.setHandler(this._identifier(e),t)},r.prototype.clearDcsHandler=function(e){this._dcsParser.clearHandler(this._identifier(e))},r.prototype.setDcsHandlerFallback=function(e){this._dcsParser.setHandlerFallback(e)},r.prototype.addOscHandler=function(e,t){return this._oscParser.addHandler(e,t)},r.prototype.setOscHandler=function(e,t){this._oscParser.setHandler(e,t)},r.prototype.clearOscHandler=function(e){this._oscParser.clearHandler(e)},r.prototype.setOscHandlerFallback=function(e){this._oscParser.setHandlerFallback(e)},r.prototype.setErrorHandler=function(e){this._errorHandler=e},r.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},r.prototype.reset=function(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0},r.prototype.parse=function(e,t){for(var r=0,i=0,n=this.currentState,o=this._oscParser,s=this._dcsParser,a=this._collect,c=this._params,l=this._transitions.table,u=0;u<t;++u){switch((i=l[n<<8|((r=e[u])<160?r:160)])>>4){case 2:for(var h=u+1;;++h){if(h>=t||(r=e[h])<32||r>126&&r<160){this._printHandler(e,u,h),u=h-1;break}if(++h>=t||(r=e[h])<32||r>126&&r<160){this._printHandler(e,u,h),u=h-1;break}if(++h>=t||(r=e[h])<32||r>126&&r<160){this._printHandler(e,u,h),u=h-1;break}if(++h>=t||(r=e[h])<32||r>126&&r<160){this._printHandler(e,u,h),u=h-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:u,code:r,currentState:n,collect:a,params:c,abort:!1}).abort)return;break;case 7:for(var f=this._csiHandlers[a<<8|r],d=f?f.length-1:-1;d>=0&&!1===f[d](c);d--);d<0&&this._csiHandlerFb(a<<8|r,c),this.precedingCodepoint=0;break;case 8:do{switch(r){case 59:c.addParam(0);break;case 58:c.addSubParam(-1);break;default:c.addDigit(r-48)}}while(++u<t&&(r=e[u])>47&&r<60);u--;break;case 9:a<<=8,a|=r;break;case 10:for(var _=this._escHandlers[a<<8|r],p=_?_.length-1:-1;p>=0&&!1===_[p]();p--);p<0&&this._escHandlerFb(a<<8|r),this.precedingCodepoint=0;break;case 11:c.reset(),c.addParam(0),a=0;break;case 12:s.hook(a<<8|r,c);break;case 13:for(var v=u+1;;++v)if(v>=t||24===(r=e[v])||26===r||27===r||r>127&&r<160){s.put(e,u,v),u=v-1;break}break;case 14:s.unhook(24!==r&&26!==r),27===r&&(i|=1),c.reset(),c.addParam(0),a=0,this.precedingCodepoint=0;break;case 4:o.start();break;case 5:for(var g=u+1;;g++)if(g>=t||(r=e[g])<32||r>127&&r<=159){o.put(e,u,g),u=g-1;break}break;case 6:o.end(24!==r&&26!==r),27===r&&(i|=1),c.reset(),c.addParam(0),a=0,this.precedingCodepoint=0}n=15&i}this._collect=a,this.currentState=n},r}(o.Disposable);t.EscapeSequenceParser=h},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Renderer=void 0;var a=r(41),c=r(47),l=r(48),u=r(49),h=r(29),f=r(2),d=r(5),_=r(1),p=r(25),v=r(0),g=1,y=function(e){function t(t,r,i,n,o,s,f,d,_){var p=e.call(this)||this;p._colors=t,p._screenElement=r,p._bufferService=o,p._charSizeService=s,p._optionsService=f,p._id=g++,p._onRequestRedraw=new v.EventEmitter;var y=p._optionsService.options.allowTransparency;return p._characterJoinerRegistry=new h.CharacterJoinerRegistry(p._bufferService),p._renderLayers=[new a.TextRenderLayer(p._screenElement,0,p._colors,p._characterJoinerRegistry,y,p._id,p._bufferService,f),new c.SelectionRenderLayer(p._screenElement,1,p._colors,p._id,p._bufferService,f),new u.LinkRenderLayer(p._screenElement,2,p._colors,p._id,i,n,p._bufferService,f),new l.CursorRenderLayer(p._screenElement,3,p._colors,p._id,p._onRequestRedraw,p._bufferService,f,d,_)],p.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},p._devicePixelRatio=window.devicePixelRatio,p._updateDimensions(),p.onOptionsChanged(),p}return n(t,e),Object.defineProperty(t.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){for(var t=0,r=this._renderLayers;t<r.length;t++)r[t].dispose();e.prototype.dispose.call(this),p.removeTerminalFromCache(this._id)},t.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},t.prototype.setColors=function(e){this._colors=e;for(var t=0,r=this._renderLayers;t<r.length;t++){var i=r[t];i.setColors(this._colors),i.reset()}},t.prototype.onResize=function(e,t){this._updateDimensions();for(var r=0,i=this._renderLayers;r<i.length;r++)i[r].resize(this.dimensions);this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},t.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},t.prototype.onBlur=function(){this._runOperation((function(e){return e.onBlur()}))},t.prototype.onFocus=function(){this._runOperation((function(e){return e.onFocus()}))},t.prototype.onSelectionChanged=function(e,t,r){void 0===r&&(r=!1),this._runOperation((function(i){return i.onSelectionChanged(e,t,r)}))},t.prototype.onCursorMove=function(){this._runOperation((function(e){return e.onCursorMove()}))},t.prototype.onOptionsChanged=function(){this._runOperation((function(e){return e.onOptionsChanged()}))},t.prototype.clear=function(){this._runOperation((function(e){return e.reset()}))},t.prototype._runOperation=function(e){for(var t=0,r=this._renderLayers;t<r.length;t++)e(r[t])},t.prototype.renderRows=function(e,t){for(var r=0,i=this._renderLayers;r<i.length;r++)i[r].onGridChanged(e,t)},t.prototype._updateDimensions=function(){this._charSizeService.hasValidSize&&(this.dimensions.scaledCharWidth=Math.floor(this._charSizeService.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharTop=1===this._optionsService.options.lineHeight?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._optionsService.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._bufferService.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._bufferService.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols)},t.prototype.registerCharacterJoiner=function(e){return this._characterJoinerRegistry.registerCharacterJoiner(e)},t.prototype.deregisterCharacterJoiner=function(e){return this._characterJoinerRegistry.deregisterCharacterJoiner(e)},o([s(4,_.IBufferService),s(5,d.ICharSizeService),s(6,_.IOptionsService),s(7,_.ICoreService),s(8,d.ICoreBrowserService)],t)}(f.Disposable);t.Renderer=y},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.TextRenderLayer=void 0;var o=r(42),s=r(13),a=r(6),c=r(3),l=r(29),u=r(4),h=function(e){function t(t,r,i,n,s,a,c,l){var h=e.call(this,t,"text",r,s,i,a,c,l)||this;return h._characterWidth=0,h._characterFont="",h._characterOverlapCache={},h._workCell=new u.CellData,h._state=new o.GridCache,h._characterJoinerRegistry=n,h}return n(t,e),t.prototype.resize=function(t){e.prototype.resize.call(this,t);var r=this._getFont(!1,!1);this._characterWidth===t.scaledCharWidth&&this._characterFont===r||(this._characterWidth=t.scaledCharWidth,this._characterFont=r,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},t.prototype.reset=function(){this._state.clear(),this._clearAll()},t.prototype._forEachCell=function(e,t,r,i){for(var n=e;n<=t;n++)for(var o=n+this._bufferService.buffer.ydisp,s=this._bufferService.buffer.lines.get(o),a=r?r.getJoinedCharacters(o):[],u=0;u<this._bufferService.cols;u++){s.loadCell(u,this._workCell);var h=this._workCell,f=!1,d=u;if(0!==h.getWidth()){if(a.length>0&&u===a[0][0]){f=!0;var _=a.shift();h=new l.JoinedCellData(this._workCell,s.translateToString(!0,_[0],_[1]),_[1]-_[0]),d=_[1]-1}!f&&this._isOverlapping(h)&&d<s.length-1&&s.getCodePoint(d+1)===c.NULL_CELL_CODE&&(h.content&=-12582913,h.content|=2<<22),i(h,u,n),u=d}}},t.prototype._drawBackground=function(e,t){var r=this,i=this._ctx,n=this._bufferService.cols,o=0,s=0,c=null;i.save(),this._forEachCell(e,t,null,(function(e,t,l){var u=null;e.isInverse()?u=e.isFgDefault()?r._colors.foreground.css:e.isFgRGB()?"rgb("+a.AttributeData.toColorRGB(e.getFgColor()).join(",")+")":r._colors.ansi[e.getFgColor()].css:e.isBgRGB()?u="rgb("+a.AttributeData.toColorRGB(e.getBgColor()).join(",")+")":e.isBgPalette()&&(u=r._colors.ansi[e.getBgColor()].css),null===c&&(o=t,s=l),l!==s?(i.fillStyle=c||"",r._fillCells(o,s,n-o,1),o=t,s=l):c!==u&&(i.fillStyle=c||"",r._fillCells(o,s,t-o,1),o=t,s=l),c=u})),null!==c&&(i.fillStyle=c,this._fillCells(o,s,n-o,1)),i.restore()},t.prototype._drawForeground=function(e,t){var r=this;this._forEachCell(e,t,this._characterJoinerRegistry,(function(e,t,i){if(!e.isInvisible()&&(r._drawChars(e,t,i),e.isUnderline())){if(r._ctx.save(),e.isInverse())if(e.isBgDefault())r._ctx.fillStyle=r._colors.background.css;else if(e.isBgRGB())r._ctx.fillStyle="rgb("+a.AttributeData.toColorRGB(e.getBgColor()).join(",")+")";else{var n=e.getBgColor();r._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&n<8&&(n+=8),r._ctx.fillStyle=r._colors.ansi[n].css}else if(e.isFgDefault())r._ctx.fillStyle=r._colors.foreground.css;else if(e.isFgRGB())r._ctx.fillStyle="rgb("+a.AttributeData.toColorRGB(e.getFgColor()).join(",")+")";else{var o=e.getFgColor();r._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&o<8&&(o+=8),r._ctx.fillStyle=r._colors.ansi[o].css}r._fillBottomLineAtCells(t,i,e.getWidth()),r._ctx.restore()}}))},t.prototype.onGridChanged=function(e,t){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,e,this._bufferService.cols,t-e+1),this._drawBackground(e,t),this._drawForeground(e,t))},t.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},t.prototype._isOverlapping=function(e){if(1!==e.getWidth())return!1;if(e.getCode()<256)return!1;var t=e.getChars();if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;var r=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=r,r},t}(s.BaseRenderLayer);t.TextRenderLayer=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GridCache=void 0;var i=function(){function e(){this.cache=[]}return e.prototype.resize=function(e,t){for(var r=0;r<e;r++){this.cache.length<=r&&this.cache.push([]);for(var i=this.cache[r].length;i<t;i++)this.cache[r].push(void 0);this.cache[r].length=t}this.cache.length=e},e.prototype.clear=function(){for(var e=0;e<this.cache.length;e++)for(var t=0;t<this.cache[e].length;t++)this.cache[e][t]=void 0},e}();t.GridCache=i},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.NoneCharAtlas=t.DynamicCharAtlas=t.getGlyphCacheKey=void 0;var o=r(9),s=r(44),a=r(27),c=r(46),l=r(11),u=r(28),h=r(10),f={css:"rgba(0, 0, 0, 0)",rgba:0};function d(e){return e.code<<21|e.bg<<12|e.fg<<3|(e.bold?0:4)+(e.dim?0:2)+(e.italic?0:1)}t.getGlyphCacheKey=d;var _=function(e){function t(t,r){var i=e.call(this)||this;i._config=r,i._drawToCacheCount=0,i._glyphsWaitingOnBitmap=[],i._bitmapCommitTimeout=null,i._bitmap=null,i._cacheCanvas=t.createElement("canvas"),i._cacheCanvas.width=1024,i._cacheCanvas.height=1024,i._cacheCtx=u.throwIfFalsy(i._cacheCanvas.getContext("2d",{alpha:!0}));var n=t.createElement("canvas");n.width=i._config.scaledCharWidth,n.height=i._config.scaledCharHeight,i._tmpCtx=u.throwIfFalsy(n.getContext("2d",{alpha:i._config.allowTransparency})),i._width=Math.floor(1024/i._config.scaledCharWidth),i._height=Math.floor(1024/i._config.scaledCharHeight);var o=i._width*i._height;return i._cacheMap=new c.LRUMap(o),i._cacheMap.prealloc(o),i}return n(t,e),t.prototype.dispose=function(){null!==this._bitmapCommitTimeout&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},t.prototype.beginFrame=function(){this._drawToCacheCount=0},t.prototype.draw=function(e,t,r,i){if(32===t.code)return!0;if(!this._canCache(t))return!1;var n=d(t),o=this._cacheMap.get(n);if(null!=o)return this._drawFromCache(e,o,r,i),!0;if(this._drawToCacheCount<100){var s=void 0;s=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var a=this._drawToCache(t,s);return this._cacheMap.set(n,a),this._drawFromCache(e,a,r,i),!0}return!1},t.prototype._canCache=function(e){return e.code<256},t.prototype._toCoordinateX=function(e){return e%this._width*this._config.scaledCharWidth},t.prototype._toCoordinateY=function(e){return Math.floor(e/this._width)*this._config.scaledCharHeight},t.prototype._drawFromCache=function(e,t,r,i){if(!t.isEmpty){var n=this._toCoordinateX(t.index),o=this._toCoordinateY(t.index);e.drawImage(t.inBitmap?this._bitmap:this._cacheCanvas,n,o,this._config.scaledCharWidth,this._config.scaledCharHeight,r,i,this._config.scaledCharWidth,this._config.scaledCharHeight)}},t.prototype._getColorFromAnsiIndex=function(e){return e<this._config.colors.ansi.length?this._config.colors.ansi[e]:a.DEFAULT_ANSI_COLORS[e]},t.prototype._getBackgroundColor=function(e){return this._config.allowTransparency?f:e.bg===o.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:e.bg<256?this._getColorFromAnsiIndex(e.bg):this._config.colors.background},t.prototype._getForegroundColor=function(e){return e.fg===o.INVERTED_DEFAULT_COLOR?h.color.opaque(this._config.colors.background):e.fg<256?this._getColorFromAnsiIndex(e.fg):this._config.colors.foreground},t.prototype._drawToCache=function(e,t){this._drawToCacheCount++,this._tmpCtx.save();var r=this._getBackgroundColor(e);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=r.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var i=e.bold?this._config.fontWeightBold:this._config.fontWeight,n=e.italic?"italic":"";this._tmpCtx.font=n+" "+i+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(e).css,e.dim&&(this._tmpCtx.globalAlpha=o.DIM_OPACITY),this._tmpCtx.fillText(e.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var s=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),a=!1;this._config.allowTransparency||(a=function(e,t){for(var r=!0,i=t.rgba>>>24,n=t.rgba>>>16&255,o=t.rgba>>>8&255,s=0;s<e.data.length;s+=4)e.data[s]===i&&e.data[s+1]===n&&e.data[s+2]===o?e.data[s+3]=0:r=!1;return r}(s,r));var c=this._toCoordinateX(t),l=this._toCoordinateY(t);this._cacheCtx.putImageData(s,c,l);var u={index:t,isEmpty:a,inBitmap:!1};return this._addGlyphToBitmap(u),u},t.prototype._addGlyphToBitmap=function(e){var t=this;!("createImageBitmap"in window)||l.isFirefox||l.isSafari||(this._glyphsWaitingOnBitmap.push(e),null===this._bitmapCommitTimeout&&(this._bitmapCommitTimeout=window.setTimeout((function(){return t._generateBitmap()}),100)))},t.prototype._generateBitmap=function(){var e=this,t=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then((function(r){e._bitmap=r;for(var i=0;i<t.length;i++)t[i].inBitmap=!0})),this._bitmapCommitTimeout=null},t}(s.BaseCharAtlas);t.DynamicCharAtlas=_;var p=function(e){function t(t,r){return e.call(this)||this}return n(t,e),t.prototype.draw=function(e,t,r,i){return!1},t}(s.BaseCharAtlas);t.NoneCharAtlas=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseCharAtlas=void 0;var i=function(){function e(){this._didWarmUp=!1}return e.prototype.dispose=function(){},e.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},e.prototype._doWarmUp=function(){},e.prototype.beginFrame=function(){},e}();t.BaseCharAtlas=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;var i=function(){function e(){this._color={},this._rgba={}}return e.prototype.clear=function(){this._color={},this._rgba={}},e.prototype.setCss=function(e,t,r){this._rgba[e]||(this._rgba[e]={}),this._rgba[e][t]=r},e.prototype.getCss=function(e,t){return this._rgba[e]?this._rgba[e][t]:void 0},e.prototype.setColor=function(e,t,r){this._color[e]||(this._color[e]={}),this._color[e][t]=r},e.prototype.getColor=function(e,t){return this._color[e]?this._color[e][t]:void 0},e}();t.ColorContrastCache=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LRUMap=void 0;var i=function(){function e(e){this.capacity=e,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return e.prototype._unlinkNode=function(e){var t=e.prev,r=e.next;e===this._head&&(this._head=r),e===this._tail&&(this._tail=t),null!==t&&(t.next=r),null!==r&&(r.prev=t)},e.prototype._appendNode=function(e){var t=this._tail;null!==t&&(t.next=e),e.prev=t,e.next=null,this._tail=e,null===this._head&&(this._head=e)},e.prototype.prealloc=function(e){for(var t=this._nodePool,r=0;r<e;r++)t.push({prev:null,next:null,key:null,value:null})},e.prototype.get=function(e){var t=this._map[e];return void 0!==t?(this._unlinkNode(t),this._appendNode(t),t.value):null},e.prototype.peekValue=function(e){var t=this._map[e];return void 0!==t?t.value:null},e.prototype.peek=function(){var e=this._head;return null===e?null:e.value},e.prototype.set=function(e,t){var r=this._map[e];if(void 0!==r)r=this._map[e],this._unlinkNode(r),r.value=t;else if(this.size>=this.capacity)r=this._head,this._unlinkNode(r),delete this._map[r.key],r.key=e,r.value=t,this._map[e]=r;else{var i=this._nodePool;i.length>0?((r=i.pop()).key=e,r.value=t):r={prev:null,next:null,key:e,value:t},this._map[e]=r,this.size++}this._appendNode(r)},e}();t.LRUMap=i},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRenderLayer=void 0;var o=function(e){function t(t,r,i,n,o,s){var a=e.call(this,t,"selection",r,!0,i,n,o,s)||this;return a._clearState(),a}return n(t,e),t.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this._clearState()},t.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},t.prototype.onSelectionChanged=function(e,t,r){if(this._didStateChange(e,t,r,this._bufferService.buffer.ydisp))if(this._clearAll(),e&&t){var i=e[1]-this._bufferService.buffer.ydisp,n=t[1]-this._bufferService.buffer.ydisp,o=Math.max(i,0),s=Math.min(n,this._bufferService.rows-1);if(!(o>=this._bufferService.rows||s<0)){if(this._ctx.fillStyle=this._colors.selectionTransparent.css,r){var a=e[0],c=t[0]-a,l=s-o+1;this._fillCells(a,o,c,l)}else{a=i===o?e[0]:0;var u=o===s?t[0]:this._bufferService.cols;this._fillCells(a,o,u-a,1);var h=Math.max(s-o-1,0);if(this._fillCells(0,o+1,this._bufferService.cols,h),o!==s){var f=n===s?t[0]:this._bufferService.cols;this._fillCells(0,s,f,1)}}this._state.start=[e[0],e[1]],this._state.end=[t[0],t[1]],this._state.columnSelectMode=r,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},t.prototype._didStateChange=function(e,t,r,i){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||r!==this._state.columnSelectMode||i!==this._state.ydisp},t.prototype._areCoordinatesEqual=function(e,t){return!(!e||!t)&&e[0]===t[0]&&e[1]===t[1]},t}(r(13).BaseRenderLayer);t.SelectionRenderLayer=o},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CursorRenderLayer=void 0;var o=r(13),s=r(4),a=function(e){function t(t,r,i,n,o,a,c,l,u){var h=e.call(this,t,"cursor",r,!0,i,n,a,c)||this;return h._onRequestRedraw=o,h._coreService=l,h._coreBrowserService=u,h._cell=new s.CellData,h._state={x:0,y:0,isFocused:!1,style:"",width:0},h._cursorRenderers={bar:h._renderBarCursor.bind(h),block:h._renderBlockCursor.bind(h),underline:h._renderUnderlineCursor.bind(h)},h}return n(t,e),t.prototype.resize=function(t){e.prototype.resize.call(this,t),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},t.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},t.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},t.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},t.prototype.onOptionsChanged=function(){var e,t=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new c(this._coreBrowserService.isFocused,(function(){t._render(!0)}))):(null===(e=this._cursorBlinkStateManager)||void 0===e||e.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},t.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},t.prototype.onGridChanged=function(e,t){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},t.prototype._render=function(e){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var t=this._bufferService.buffer.ybase+this._bufferService.buffer.y,r=t-this._bufferService.buffer.ydisp;if(r<0||r>=this._bufferService.rows)this._clearCursor();else{var i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(t).loadCell(i,this._cell),void 0!==this._cell.content){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var n=this._optionsService.options.cursorStyle;return n&&"block"!==n?this._cursorRenderers[n](i,r,this._cell):this._renderBlurCursor(i,r,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=r,this._state.isFocused=!1,this._state.style=n,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===i&&this._state.y===r&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.options.cursorStyle||"block"](i,r,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=r,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},t.prototype._clearCursor=function(){this._state&&(this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})},t.prototype._renderBarCursor=function(e,t,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(e,t,this._optionsService.options.cursorWidth),this._ctx.restore()},t.prototype._renderBlockCursor=function(e,t,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(e,t,r.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(r,e,t),this._ctx.restore()},t.prototype._renderUnderlineCursor=function(e,t,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(e,t),this._ctx.restore()},t.prototype._renderBlurCursor=function(e,t,r){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(e,t,r.getWidth(),1),this._ctx.restore()},t}(o.BaseRenderLayer);t.CursorRenderLayer=a;var c=function(){function e(e,t){this._renderCallback=t,this.isCursorVisible=!0,e&&this._restartInterval()}return Object.defineProperty(e.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},e.prototype.restartBlinkAnimation=function(){var e=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame((function(){e._renderCallback(),e._animationFrame=void 0}))))},e.prototype._restartInterval=function(e){var t=this;void 0===e&&(e=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout((function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);if(t._animationTimeRestarted=void 0,e>0)return void t._restartInterval(e)}t.isCursorVisible=!1,t._animationFrame=window.requestAnimationFrame((function(){t._renderCallback(),t._animationFrame=void 0})),t._blinkInterval=window.setInterval((function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);return t._animationTimeRestarted=void 0,void t._restartInterval(e)}t.isCursorVisible=!t.isCursorVisible,t._animationFrame=window.requestAnimationFrame((function(){t._renderCallback(),t._animationFrame=void 0}))}),600)}),e)},e.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},e.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},e}()},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;var o=r(13),s=r(9),a=r(26),c=function(e){function t(t,r,i,n,o,s,a,c){var l=e.call(this,t,"link",r,!0,i,n,a,c)||this;return o.onShowLinkUnderline((function(e){return l._onShowLinkUnderline(e)})),o.onHideLinkUnderline((function(e){return l._onHideLinkUnderline(e)})),s.onShowLinkUnderline((function(e){return l._onShowLinkUnderline(e)})),s.onHideLinkUnderline((function(e){return l._onHideLinkUnderline(e)})),l}return n(t,e),t.prototype.resize=function(t){e.prototype.resize.call(this,t),this._state=void 0},t.prototype.reset=function(){this._clearCurrentLink()},t.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},t.prototype._onShowLinkUnderline=function(e){if(e.fg===s.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:e.fg&&a.is256Color(e.fg)?this._ctx.fillStyle=this._colors.ansi[e.fg].css:this._ctx.fillStyle=this._colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(var t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e},t.prototype._onHideLinkUnderline=function(e){this._clearCurrentLink()},t}(o.BaseRenderLayer);t.LinkRenderLayer=c},function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},n=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseZone=t.Linkifier=void 0;var o=r(0),s=r(1),a=function(){function e(e,t,r){this._bufferService=e,this._logService=t,this._unicodeService=r,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new o.EventEmitter,this._onHideLinkUnderline=new o.EventEmitter,this._onLinkTooltip=new o.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(e.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),e.prototype.attachToDom=function(e,t){this._element=e,this._mouseZoneManager=t},e.prototype.linkifyRows=function(t,r){var i=this;this._mouseZoneManager&&(void 0===this._rowsToLinkify.start||void 0===this._rowsToLinkify.end?(this._rowsToLinkify.start=t,this._rowsToLinkify.end=r):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,t),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,r)),this._mouseZoneManager.clearAll(t,r),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout((function(){return i._linkifyRows()}),e._timeBeforeLatency))},e.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var e=this._bufferService.buffer;if(void 0!==this._rowsToLinkify.start&&void 0!==this._rowsToLinkify.end){var t=e.ydisp+this._rowsToLinkify.start;if(!(t>=e.lines.length)){for(var r=e.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,i=Math.ceil(2e3/this._bufferService.cols),n=this._bufferService.buffer.iterator(!1,t,r,i,i);n.hasNext();)for(var o=n.next(),s=0;s<this._linkMatchers.length;s++)this._doLinkifyRow(o.range.first,o.content,this._linkMatchers[s]);this._rowsToLinkify.start=void 0,this._rowsToLinkify.end=void 0}}else this._logService.debug("_rowToLinkify was unset before _linkifyRows was called")},e.prototype.registerLinkMatcher=function(e,t,r){if(void 0===r&&(r={}),!t)throw new Error("handler must be defined");var i={id:this._nextLinkMatcherId++,regex:e,handler:t,matchIndex:r.matchIndex,validationCallback:r.validationCallback,hoverTooltipCallback:r.tooltipCallback,hoverLeaveCallback:r.leaveCallback,willLinkActivate:r.willLinkActivate,priority:r.priority||0};return this._addLinkMatcherToList(i),i.id},e.prototype._addLinkMatcherToList=function(e){if(0!==this._linkMatchers.length){for(var t=this._linkMatchers.length-1;t>=0;t--)if(e.priority<=this._linkMatchers[t].priority)return void this._linkMatchers.splice(t+1,0,e);this._linkMatchers.splice(0,0,e)}else this._linkMatchers.push(e)},e.prototype.deregisterLinkMatcher=function(e){for(var t=0;t<this._linkMatchers.length;t++)if(this._linkMatchers[t].id===e)return this._linkMatchers.splice(t,1),!0;return!1},e.prototype._doLinkifyRow=function(e,t,r){for(var i,n=this,o=new RegExp(r.regex.source,(r.regex.flags||"")+"g"),s=-1,a=function(){var a=i["number"!=typeof r.matchIndex?0:r.matchIndex];if(!a)return c._logService.debug("match found without corresponding matchIndex",i,r),"break";if(s=t.indexOf(a,s+1),o.lastIndex=s+a.length,s<0)return"break";var l=c._bufferService.buffer.stringIndexToBufferIndex(e,s);if(l[0]<0)return"break";var u=c._bufferService.buffer.lines.get(l[0]);if(!u)return"break";var h=u.getFg(l[1]),f=h?h>>9&511:void 0;r.validationCallback?r.validationCallback(a,(function(e){n._rowsTimeoutId||e&&n._addLink(l[1],l[0]-n._bufferService.buffer.ydisp,a,r,f)})):c._addLink(l[1],l[0]-c._bufferService.buffer.ydisp,a,r,f)},c=this;null!==(i=o.exec(t))&&"break"!==a(););},e.prototype._addLink=function(e,t,r,i,n){var o=this;if(this._mouseZoneManager&&this._element){var s=this._unicodeService.getStringCellWidth(r),a=e%this._bufferService.cols,l=t+Math.floor(e/this._bufferService.cols),u=(a+s)%this._bufferService.cols,h=l+Math.floor((a+s)/this._bufferService.cols);0===u&&(u=this._bufferService.cols,h--),this._mouseZoneManager.add(new c(a+1,l+1,u+1,h+1,(function(e){if(i.handler)return i.handler(e,r);var t=window.open();t?(t.opener=null,t.location.href=r):console.warn("Opening link blocked as opener could not be cleared")}),(function(){o._onShowLinkUnderline.fire(o._createLinkHoverEvent(a,l,u,h,n)),o._element.classList.add("xterm-cursor-pointer")}),(function(e){o._onLinkTooltip.fire(o._createLinkHoverEvent(a,l,u,h,n)),i.hoverTooltipCallback&&i.hoverTooltipCallback(e,r,{start:{x:a,y:l},end:{x:u,y:h}})}),(function(){o._onHideLinkUnderline.fire(o._createLinkHoverEvent(a,l,u,h,n)),o._element.classList.remove("xterm-cursor-pointer"),i.hoverLeaveCallback&&i.hoverLeaveCallback()}),(function(e){return!i.willLinkActivate||i.willLinkActivate(e,r)})))}},e.prototype._createLinkHoverEvent=function(e,t,r,i,n){return{x1:e,y1:t,x2:r,y2:i,cols:this._bufferService.cols,fg:n}},e._timeBeforeLatency=200,e=i([n(0,s.IBufferService),n(1,s.ILogService),n(2,s.IUnicodeService)],e)}();t.Linkifier=a;var c=function(e,t,r,i,n,o,s,a,c){this.x1=e,this.y1=t,this.x2=r,this.y2=i,this.clickCallback=n,this.hoverCallback=o,this.tooltipCallback=s,this.leaveCallback=a,this.willLinkActivate=c};t.MouseZone=c},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;var a=r(11),c=r(52),l=r(4),u=r(0),h=r(5),f=r(1),d=r(30),_=r(53),p=r(2),v=String.fromCharCode(160),g=new RegExp(v,"g"),y=function(e){function t(t,r,i,n,o,s,a){var h=e.call(this)||this;return h._element=t,h._screenElement=r,h._bufferService=i,h._coreService=n,h._mouseService=o,h._optionsService=s,h._renderService=a,h._dragScrollAmount=0,h._enabled=!0,h._workCell=new l.CellData,h._mouseDownTimeStamp=0,h._onLinuxMouseSelection=h.register(new u.EventEmitter),h._onRedrawRequest=h.register(new u.EventEmitter),h._onSelectionChange=h.register(new u.EventEmitter),h._onRequestScrollLines=h.register(new u.EventEmitter),h._mouseMoveListener=function(e){return h._onMouseMove(e)},h._mouseUpListener=function(e){return h._onMouseUp(e)},h._coreService.onUserInput((function(){h.hasSelection&&h.clearSelection()})),h._trimListener=h._bufferService.buffer.lines.onTrim((function(e){return h._onTrim(e)})),h.register(h._bufferService.buffers.onBufferActivate((function(e){return h._onBufferActivate(e)}))),h.enable(),h._model=new c.SelectionModel(h._bufferService),h._activeSelectionMode=0,h}return n(t,e),Object.defineProperty(t.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this._removeMouseDownListeners()},t.prototype.reset=function(){this.clearSelection()},t.prototype.disable=function(){this.clearSelection(),this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},Object.defineProperty(t.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasSelection",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectionText",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";var r=this._bufferService.buffer,i=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";for(var n=e[1];n<=t[1];n++){var o=r.translateBufferLineToString(n,!0,e[0],t[0]);i.push(o)}}else{var s=e[1]===t[1]?t[0]:void 0;for(i.push(r.translateBufferLineToString(e[1],!0,e[0],s)),n=e[1]+1;n<=t[1]-1;n++){var c=r.lines.get(n);o=r.translateBufferLineToString(n,!0),c&&c.isWrapped?i[i.length-1]+=o:i.push(o)}e[1]!==t[1]&&(c=r.lines.get(t[1]),o=r.translateBufferLineToString(t[1],!0,0,t[0]),c&&c.isWrapped?i[i.length-1]+=o:i.push(o))}return i.map((function(e){return e.replace(g," ")})).join(a.isWindows?"\r\n":"\n")},enumerable:!1,configurable:!0}),t.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},t.prototype.refresh=function(e){var t=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame((function(){return t._refresh()}))),a.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},t.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})},t.prototype.isClickInSelection=function(e){var t=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!!(r&&i&&t)&&this._areCoordsInSelection(t,r,i)},t.prototype._areCoordsInSelection=function(e,t,r){return e[1]>t[1]&&e[1]<r[1]||t[1]===r[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<r[0]||t[1]<r[1]&&e[1]===r[1]&&e[0]<r[0]||t[1]<r[1]&&e[1]===t[1]&&e[0]>=t[0]},t.prototype.selectWordAtCursor=function(e){var t=this._getMouseBufferCoords(e);t&&(this._selectWordAt(t,!1),this._model.selectionEnd=void 0,this.refresh(!0))},t.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},t.prototype.selectLines=function(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()},t.prototype._onTrim=function(e){this._model.onTrim(e)&&this.refresh()},t.prototype._getMouseBufferCoords=function(e){var t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t},t.prototype._getMouseEventScrollAmount=function(e){var t=d.getCoordsRelativeToElement(e,this._screenElement)[1],r=this._renderService.dimensions.canvasHeight;return t>=0&&t<=r?0:(t>r&&(t-=r),t=Math.min(Math.max(t,-50),50),(t/=50)/Math.abs(t)+Math.round(14*t))},t.prototype.shouldForceSelection=function(e){return a.isMac?e.altKey&&this._optionsService.options.macOptionClickForcesSelection:e.shiftKey},t.prototype.onMouseDown=function(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._onIncrementalClick(e):1===e.detail?this._onSingleClick(e):2===e.detail?this._onDoubleClick(e):3===e.detail&&this._onTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}},t.prototype._addMouseDownListeners=function(){var e=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval((function(){return e._dragScroll()}),50)},t.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0},t.prototype._onIncrementalClick=function(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))},t.prototype._onSingleClick=function(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),this._model.selectionStart){this._model.selectionEnd=void 0;var t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&0===t.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}},t.prototype._onDoubleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=1,this._selectWordAt(t,!0))},t.prototype._onTripleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))},t.prototype.shouldColumnSelect=function(e){return e.altKey&&!(a.isMac&&this._optionsService.options.macOptionClickForcesSelection)},t.prototype._onMouseMove=function(e){if(e.stopImmediatePropagation(),this._model.selectionStart){var t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),this._model.selectionEnd){2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var r=this._bufferService.buffer;if(this._model.selectionEnd[1]<r.lines.length){var i=r.lines.get(this._model.selectionEnd[1]);i&&0===i.hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]++}t&&t[0]===this._model.selectionEnd[0]&&t[1]===this._model.selectionEnd[1]||this.refresh(!0)}else this.refresh(!0)}},t.prototype._dragScroll=function(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});var e=this._bufferService.buffer;this._dragScrollAmount>0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}},t.prototype._onMouseUp=function(e){var t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var r=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(r&&void 0!==r[0]&&void 0!==r[1]){var i=_.moveToCellSequence(r[0]-1,r[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(i,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},t.prototype._onBufferActivate=function(e){var t=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim((function(e){return t._onTrim(e)}))},t.prototype._convertViewportColToCharacterIndex=function(e,t){for(var r=t[0],i=0;t[0]>=i;i++){var n=e.loadCell(i,this._workCell).getChars().length;0===this._workCell.getWidth()?r--:n>1&&t[0]!==i&&(r+=n-1)}return r},t.prototype.setSelection=function(e,t,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=r,this.refresh()},t.prototype._getWordAt=function(e,t,r,i){if(void 0===r&&(r=!0),void 0===i&&(i=!0),!(e[0]>=this._bufferService.cols)){var n=this._bufferService.buffer,o=n.lines.get(e[1]);if(o){var s=n.translateBufferLineToString(e[1],!1),a=this._convertViewportColToCharacterIndex(o,e),c=a,l=e[0]-a,u=0,h=0,f=0,d=0;if(" "===s.charAt(a)){for(;a>0&&" "===s.charAt(a-1);)a--;for(;c<s.length&&" "===s.charAt(c+1);)c++}else{var _=e[0],p=e[0];0===o.getWidth(_)&&(u++,_--),2===o.getWidth(p)&&(h++,p++);var v=o.getString(p).length;for(v>1&&(d+=v-1,c+=v-1);_>0&&a>0&&!this._isCharWordSeparator(o.loadCell(_-1,this._workCell));){o.loadCell(_-1,this._workCell);var g=this._workCell.getChars().length;0===this._workCell.getWidth()?(u++,_--):g>1&&(f+=g-1,a-=g-1),a--,_--}for(;p<o.length&&c+1<s.length&&!this._isCharWordSeparator(o.loadCell(p+1,this._workCell));){o.loadCell(p+1,this._workCell);var y=this._workCell.getChars().length;2===this._workCell.getWidth()?(h++,p++):y>1&&(d+=y-1,c+=y-1),c++,p++}}c++;var m=a+l-u+f,b=Math.min(this._bufferService.cols,c-a+u+h-f-d);if(t||""!==s.slice(a,c).trim()){if(r&&0===m&&32!==o.getCodePoint(0)){var w=n.lines.get(e[1]-1);if(w&&o.isWrapped&&32!==w.getCodePoint(this._bufferService.cols-1)){var S=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(S){var C=this._bufferService.cols-S.start;m-=C,b+=C}}}if(i&&m+b===this._bufferService.cols&&32!==o.getCodePoint(this._bufferService.cols-1)){var k=n.lines.get(e[1]+1);if(k&&k.isWrapped&&32!==k.getCodePoint(0)){var E=this._getWordAt([0,e[1]+1],!1,!1,!0);E&&(b+=E.length)}}return{start:m,length:b}}}}},t.prototype._selectWordAt=function(e,t){var r=this._getWordAt(e,t);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}},t.prototype._selectToWordAt=function(e){var t=this._getWordAt(e,!0);if(t){for(var r=e[1];t.start<0;)t.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,r]}},t.prototype._isCharWordSeparator=function(e){return 0!==e.getWidth()&&this._optionsService.options.wordSeparator.indexOf(e.getChars())>=0},t.prototype._selectLineAt=function(e){var t=this._bufferService.buffer.getWrappedRangeForLine(e);this._model.selectionStart=[0,t.first],this._model.selectionEnd=[this._bufferService.cols,t.last],this._model.selectionStartLength=0},o([s(2,f.IBufferService),s(3,f.ICoreService),s(4,h.IMouseService),s(5,f.IOptionsService),s(6,h.IRenderService)],t)}(p.Disposable);t.SelectionService=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0;var i=function(){function e(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}return e.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(e.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){var e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd}},enumerable:!1,configurable:!0}),e.prototype.areSelectionValuesReversed=function(){var e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])},e.prototype.onTrim=function(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},e}();t.SelectionModel=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;var i=r(12);function n(e,t,r,i){var n=e-o(r,e),a=t-o(r,t);return l(Math.abs(n-a)-function(e,t,r){for(var i=0,n=e-o(r,e),a=t-o(r,t),c=0;c<Math.abs(n-a);c++){var l="A"===s(e,t)?-1:1,u=r.buffer.lines.get(n+l*c);u&&u.isWrapped&&i++}return i}(e,t,r),c(s(e,t),i))}function o(e,t){for(var r=0,i=e.buffer.lines.get(t),n=i&&i.isWrapped;n&&t>=0&&t<e.rows;)r++,n=(i=e.buffer.lines.get(--t))&&i.isWrapped;return r}function s(e,t){return e>t?"A":"B"}function a(e,t,r,i,n,o){for(var s=e,a=t,c="";s!==r||a!==i;)s+=n?1:-1,n&&s>o.cols-1?(c+=o.buffer.translateBufferLineToString(a,!1,e,s),s=0,e=0,a++):!n&&s<0&&(c+=o.buffer.translateBufferLineToString(a,!1,0,e+1),e=s=o.cols-1,a--);return c+o.buffer.translateBufferLineToString(a,!1,e,s)}function c(e,t){var r=t?"O":"[";return i.C0.ESC+r+e}function l(e,t){e=Math.floor(e);for(var r="",i=0;i<e;i++)r+=t;return r}t.moveToCellSequence=function(e,t,r,i){var s,u=r.buffer.x,h=r.buffer.y;if(!r.buffer.hasScrollback)return function(e,t,r,i,s,u){return 0===n(t,i,s,u).length?"":l(a(e,t,e,t-o(s,t),!1,s).length,c("D",u))}(u,h,0,t,r,i)+n(h,t,r,i)+function(e,t,r,i,s,u){var h;h=n(t,i,s,u).length>0?i-o(s,i):t;var f=i,d=function(e,t,r,i,s,a){var c;return c=n(r,i,s,a).length>0?i-o(s,i):t,e<r&&c<=i||e>=r&&c<i?"C":"D"}(e,t,r,i,s,u);return l(a(e,h,r,f,"C"===d,s).length,c(d,u))}(u,h,e,t,r,i);if(h===t)return s=u>e?"D":"C",l(Math.abs(u-e),c(s,i));s=h>t?"D":"C";var f=Math.abs(h-t);return l(function(e,t){return t.cols-e}(h>t?e:u,r)+(f-1)*r.cols+1+((h>t?u:e)-1),c(s,i))}},function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},n=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SoundService=void 0;var o=r(1),s=function(){function e(e){this._optionsService=e}return Object.defineProperty(e,"audioContext",{get:function(){if(!e._audioContext){var t=window.AudioContext||window.webkitAudioContext;if(!t)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;e._audioContext=new t}return e._audioContext},enumerable:!1,configurable:!0}),e.prototype.playBellSound=function(){var t=e.audioContext;if(t){var r=t.createBufferSource();t.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),(function(e){r.buffer=e,r.connect(t.destination),r.start(0)}))}},e.prototype._base64ToArrayBuffer=function(e){for(var t=window.atob(e),r=t.length,i=new Uint8Array(r),n=0;n<r;n++)i[n]=t.charCodeAt(n);return i.buffer},e.prototype._removeMimeType=function(e){return e.split(",")[1]},e=i([n(0,o.IOptionsService)],e)}();t.SoundService=s},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseZoneManager=void 0;var a=r(2),c=r(7),l=r(5),u=r(1),h=function(e){function t(t,r,i,n,o,s){var a=e.call(this)||this;return a._element=t,a._screenElement=r,a._bufferService=i,a._mouseService=n,a._selectionService=o,a._optionsService=s,a._zones=[],a._areZonesActive=!1,a._lastHoverCoords=[void 0,void 0],a._initialSelectionLength=0,a.register(c.addDisposableDomListener(a._element,"mousedown",(function(e){return a._onMouseDown(e)}))),a._mouseMoveListener=function(e){return a._onMouseMove(e)},a._mouseLeaveListener=function(e){return a._onMouseLeave(e)},a._clickListener=function(e){return a._onClick(e)},a}return n(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._deactivate()},t.prototype.add=function(e){this._zones.push(e),1===this._zones.length&&this._activate()},t.prototype.clearAll=function(e,t){if(0!==this._zones.length){e&&t||(e=0,t=this._bufferService.rows-1);for(var r=0;r<this._zones.length;r++){var i=this._zones[r];(i.y1>e&&i.y1<=t+1||i.y2>e&&i.y2<=t+1||i.y1<e&&i.y2>t+1)&&(this._currentZone&&this._currentZone===i&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(r--,1))}0===this._zones.length&&this._deactivate()}},t.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._element.addEventListener("mousemove",this._mouseMoveListener),this._element.addEventListener("mouseleave",this._mouseLeaveListener),this._element.addEventListener("click",this._clickListener))},t.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._element.removeEventListener("mousemove",this._mouseMoveListener),this._element.removeEventListener("mouseleave",this._mouseLeaveListener),this._element.removeEventListener("click",this._clickListener))},t.prototype._onMouseMove=function(e){this._lastHoverCoords[0]===e.pageX&&this._lastHoverCoords[1]===e.pageY||(this._onHover(e),this._lastHoverCoords=[e.pageX,e.pageY])},t.prototype._onHover=function(e){var t=this,r=this._findZoneEventAt(e);r!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),r&&(this._currentZone=r,r.hoverCallback&&r.hoverCallback(e),this._tooltipTimeout=window.setTimeout((function(){return t._onTooltip(e)}),this._optionsService.options.linkTooltipHoverDuration)))},t.prototype._onTooltip=function(e){this._tooltipTimeout=void 0;var t=this._findZoneEventAt(e);t&&t.tooltipCallback&&t.tooltipCallback(e)},t.prototype._onMouseDown=function(e){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var t=this._findZoneEventAt(e);(null==t?void 0:t.willLinkActivate(e))&&(e.preventDefault(),e.stopImmediatePropagation())}},t.prototype._onMouseLeave=function(e){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},t.prototype._onClick=function(e){var t=this._findZoneEventAt(e),r=this._getSelectionLength();t&&r===this._initialSelectionLength&&(t.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},t.prototype._getSelectionLength=function(){var e=this._selectionService.selectionText;return e?e.length:0},t.prototype._findZoneEventAt=function(e){var t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(t)for(var r=t[0],i=t[1],n=0;n<this._zones.length;n++){var o=this._zones[n];if(o.y1===o.y2){if(i===o.y1&&r>=o.x1&&r<o.x2)return o}else if(i===o.y1&&r>=o.x1||i===o.y2&&r<o.x2||i>o.y1&&i<o.y2)return o}},o([s(2,u.IBufferService),s(3,l.IMouseService),s(4,l.ISelectionService),s(5,u.IOptionsService)],t)}(a.Disposable);t.MouseZoneManager=h},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;var o=r(18),s=r(11),a=r(31),c=r(7),l=r(2),u=r(32),h=r(17),f=function(e){function t(t,r){var i=e.call(this)||this;i._terminal=t,i._renderService=r,i._liveRegionLineCount=0,i._charsToConsume=[],i._charsToAnnounce="",i._accessibilityTreeRoot=document.createElement("div"),i._accessibilityTreeRoot.classList.add("xterm-accessibility"),i._rowContainer=document.createElement("div"),i._rowContainer.classList.add("xterm-accessibility-tree"),i._rowContainer.setAttribute("role","list"),i._rowElements=[];for(var n=0;n<i._terminal.rows;n++)i._rowElements[n]=i._createAccessibilityTreeNode(),i._rowContainer.appendChild(i._rowElements[n]);if(i._topBoundaryFocusListener=function(e){return i._onBoundaryFocus(e,0)},i._bottomBoundaryFocusListener=function(e){return i._onBoundaryFocus(e,1)},i._rowElements[0].addEventListener("focus",i._topBoundaryFocusListener),i._rowElements[i._rowElements.length-1].addEventListener("focus",i._bottomBoundaryFocusListener),i._refreshRowsDimensions(),i._accessibilityTreeRoot.appendChild(i._rowContainer),i._renderRowsDebouncer=new a.RenderDebouncer(i._renderRows.bind(i)),i._refreshRows(),i._liveRegion=document.createElement("div"),i._liveRegion.classList.add("live-region"),i._liveRegion.setAttribute("aria-live","assertive"),i._accessibilityTreeRoot.appendChild(i._liveRegion),!i._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");return i._terminal.element.insertAdjacentElement("afterbegin",i._accessibilityTreeRoot),i.register(i._renderRowsDebouncer),i.register(i._terminal.onResize((function(e){return i._onResize(e.rows)}))),i.register(i._terminal.onRender((function(e){return i._refreshRows(e.start,e.end)}))),i.register(i._terminal.onScroll((function(){return i._refreshRows()}))),i.register(i._terminal.onA11yChar((function(e){return i._onChar(e)}))),i.register(i._terminal.onLineFeed((function(){return i._onChar("\n")}))),i.register(i._terminal.onA11yTab((function(e){return i._onTab(e)}))),i.register(i._terminal.onKey((function(e){return i._onKey(e.key)}))),i.register(i._terminal.onBlur((function(){return i._clearLiveRegion()}))),i.register(i._renderService.onDimensionsChange((function(){return i._refreshRowsDimensions()}))),i._screenDprMonitor=new u.ScreenDprMonitor,i.register(i._screenDprMonitor),i._screenDprMonitor.setListener((function(){return i._refreshRowsDimensions()})),i.register(c.addDisposableDomListener(window,"resize",(function(){return i._refreshRowsDimensions()}))),i}return n(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),h.removeElementFromParent(this._accessibilityTreeRoot),this._rowElements.length=0},t.prototype._onBoundaryFocus=function(e,t){var r=e.target,i=this._rowElements[0===t?1:this._rowElements.length-2];if(r.getAttribute("aria-posinset")!==(0===t?"1":""+this._terminal.buffer.lines.length)&&e.relatedTarget===i){var n,o;if(0===t?(n=r,o=this._rowElements.pop(),this._rowContainer.removeChild(o)):(n=this._rowElements.shift(),o=r,this._rowContainer.removeChild(n)),n.removeEventListener("focus",this._topBoundaryFocusListener),o.removeEventListener("focus",this._bottomBoundaryFocusListener),0===t){var s=this._createAccessibilityTreeNode();this._rowElements.unshift(s),this._rowContainer.insertAdjacentElement("afterbegin",s)}else s=this._createAccessibilityTreeNode(),this._rowElements.push(s),this._rowContainer.appendChild(s);this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===t?-1:1),this._rowElements[0===t?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}},t.prototype._onResize=function(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},t.prototype._createAccessibilityTreeNode=function(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e},t.prototype._onTab=function(e){for(var t=0;t<e;t++)this._onChar(" ")},t.prototype._onChar=function(e){var t=this;this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=o.tooMuchOutput)),s.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout((function(){t._accessibilityTreeRoot.appendChild(t._liveRegion)}),0))},t.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,s.isMac&&h.removeElementFromParent(this._liveRegion)},t.prototype._onKey=function(e){this._clearLiveRegion(),this._charsToConsume.push(e)},t.prototype._refreshRows=function(e,t){this._renderRowsDebouncer.refresh(e,t,this._terminal.rows)},t.prototype._renderRows=function(e,t){for(var r=this._terminal.buffer,i=r.lines.length.toString(),n=e;n<=t;n++){var o=r.translateBufferLineToString(r.ydisp+n,!0),s=(r.ydisp+n+1).toString(),a=this._rowElements[n];a&&(0===o.length?a.innerHTML="&nbsp;":a.textContent=o,a.setAttribute("aria-posinset",s),a.setAttribute("aria-setsize",i))}this._announceCharacters()},t.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}},t.prototype._refreshRowDimensions=function(e){e.style.height=this._renderService.dimensions.actualCellHeight+"px"},t.prototype._announceCharacters=function(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},t}(l.Disposable);t.AccessibilityManager=f},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;var a=r(58),c=r(9),l=r(2),u=r(5),h=r(1),f=r(0),d=r(10),_=r(17),p=1,v=function(e){function t(t,r,i,n,o,s,c,l,u){var h=e.call(this)||this;return h._colors=t,h._element=r,h._screenElement=i,h._viewportElement=n,h._linkifier=o,h._linkifier2=s,h._charSizeService=c,h._optionsService=l,h._bufferService=u,h._terminalClass=p++,h._rowElements=[],h._rowContainer=document.createElement("div"),h._rowContainer.classList.add("xterm-rows"),h._rowContainer.style.lineHeight="normal",h._rowContainer.setAttribute("aria-hidden","true"),h._refreshRowElements(h._bufferService.cols,h._bufferService.rows),h._selectionContainer=document.createElement("div"),h._selectionContainer.classList.add("xterm-selection"),h._selectionContainer.setAttribute("aria-hidden","true"),h.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},h._updateDimensions(),h._injectCss(),h._rowFactory=new a.DomRendererRowFactory(document,h._optionsService,h._colors),h._element.classList.add("xterm-dom-renderer-owner-"+h._terminalClass),h._screenElement.appendChild(h._rowContainer),h._screenElement.appendChild(h._selectionContainer),h._linkifier.onShowLinkUnderline((function(e){return h._onLinkHover(e)})),h._linkifier.onHideLinkUnderline((function(e){return h._onLinkLeave(e)})),h._linkifier2.onShowLinkUnderline((function(e){return h._onLinkHover(e)})),h._linkifier2.onHideLinkUnderline((function(e){return h._onLinkLeave(e)})),h}return n(t,e),Object.defineProperty(t.prototype,"onRequestRedraw",{get:function(){return(new f.EventEmitter).event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),_.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),e.prototype.dispose.call(this)},t.prototype._updateDimensions=function(){this.dimensions.scaledCharWidth=this._charSizeService.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(var e=0,t=this._rowElements;e<t.length;e++){var r=t[e];r.style.width=this.dimensions.canvasWidth+"px",r.style.height=this.dimensions.actualCellHeight+"px",r.style.lineHeight=this.dimensions.actualCellHeight+"px",r.style.overflow="hidden"}this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var i=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=i,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},t.prototype.setColors=function(e){this._colors=e,this._injectCss()},t.prototype._injectCss=function(){var e=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var t=this._terminalSelector+" .xterm-rows { color: "+this._colors.foreground.css+"; font-family: "+this._optionsService.options.fontFamily+"; font-size: "+this._optionsService.options.fontSize+"px;}";t+=this._terminalSelector+" span:not(."+a.BOLD_CLASS+") { font-weight: "+this._optionsService.options.fontWeight+";}"+this._terminalSelector+" span."+a.BOLD_CLASS+" { font-weight: "+this._optionsService.options.fontWeightBold+";}"+this._terminalSelector+" span."+a.ITALIC_CLASS+" { font-style: italic;}",t+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",t+="@keyframes blink_block_"+this._terminalClass+" { 0% { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+"; } 50% { background-color: "+this._colors.cursorAccent.css+"; color: "+this._colors.cursor.css+"; }}",t+=this._terminalSelector+" .xterm-rows:not(.xterm-focus) ."+a.CURSOR_CLASS+"."+a.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+a.CURSOR_CLASS+"."+a.CURSOR_BLINK_CLASS+":not(."+a.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+a.CURSOR_CLASS+"."+a.CURSOR_BLINK_CLASS+"."+a.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+a.CURSOR_CLASS+"."+a.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" .xterm-rows ."+a.CURSOR_CLASS+"."+a.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.options.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+a.CURSOR_CLASS+"."+a.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",t+=this._terminalSelector+" .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" .xterm-selection div { position: absolute; background-color: "+this._colors.selectionTransparent.css+";}",this._colors.ansi.forEach((function(r,i){t+=e._terminalSelector+" .xterm-fg-"+i+" { color: "+r.css+"; }"+e._terminalSelector+" .xterm-bg-"+i+" { background-color: "+r.css+"; }"})),t+=this._terminalSelector+" .xterm-fg-"+c.INVERTED_DEFAULT_COLOR+" { color: "+d.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+c.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=t},t.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},t.prototype._refreshRowElements=function(e,t){for(var r=this._rowElements.length;r<=t;r++){var i=document.createElement("div");this._rowContainer.appendChild(i),this._rowElements.push(i)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())},t.prototype.onResize=function(e,t){this._refreshRowElements(e,t),this._updateDimensions()},t.prototype.onCharSizeChanged=function(){this._updateDimensions()},t.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},t.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},t.prototype.onSelectionChanged=function(e,t,r){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(e&&t){var i=e[1]-this._bufferService.buffer.ydisp,n=t[1]-this._bufferService.buffer.ydisp,o=Math.max(i,0),s=Math.min(n,this._bufferService.rows-1);if(!(o>=this._bufferService.rows||s<0)){var a=document.createDocumentFragment();if(r)a.appendChild(this._createSelectionElement(o,e[0],t[0],s-o+1));else{var c=i===o?e[0]:0,l=o===s?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,c,l));var u=s-o-1;if(a.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,u)),o!==s){var h=n===s?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(s,0,h))}}this._selectionContainer.appendChild(a)}}},t.prototype._createSelectionElement=function(e,t,r,i){void 0===i&&(i=1);var n=document.createElement("div");return n.style.height=i*this.dimensions.actualCellHeight+"px",n.style.top=e*this.dimensions.actualCellHeight+"px",n.style.left=t*this.dimensions.actualCellWidth+"px",n.style.width=this.dimensions.actualCellWidth*(r-t)+"px",n},t.prototype.onCursorMove=function(){},t.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},t.prototype.clear=function(){for(var e=0,t=this._rowElements;e<t.length;e++)t[e].innerHTML=""},t.prototype.renderRows=function(e,t){for(var r=this._bufferService.buffer.ybase+this._bufferService.buffer.y,i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._optionsService.options.cursorBlink,o=e;o<=t;o++){var s=this._rowElements[o];s.innerHTML="";var a=o+this._bufferService.buffer.ydisp,c=this._bufferService.buffer.lines.get(a),l=this._optionsService.options.cursorStyle;s.appendChild(this._rowFactory.createRow(c,a===r,l,i,n,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(t.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!1,configurable:!0}),t.prototype.registerCharacterJoiner=function(e){return-1},t.prototype.deregisterCharacterJoiner=function(e){return!1},t.prototype._onLinkHover=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)},t.prototype._onLinkLeave=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)},t.prototype._setCellUnderline=function(e,t,r,i,n,o){for(;e!==t||r!==i;){var s=this._rowElements[r];if(!s)return;var a=s.children[e];a&&(a.style.textDecoration=o?"underline":"none"),++e>=n&&(e=0,r++)}},o([s(6,u.ICharSizeService),s(7,h.IOptionsService),s(8,h.IBufferService)],t)}(l.Disposable);t.DomRenderer=v},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=t.CURSOR_STYLE_UNDERLINE_CLASS=t.CURSOR_STYLE_BAR_CLASS=t.CURSOR_STYLE_BLOCK_CLASS=t.CURSOR_BLINK_CLASS=t.CURSOR_CLASS=t.UNDERLINE_CLASS=t.ITALIC_CLASS=t.DIM_CLASS=t.BOLD_CLASS=void 0;var i=r(9),n=r(3),o=r(4),s=r(10);t.BOLD_CLASS="xterm-bold",t.DIM_CLASS="xterm-dim",t.ITALIC_CLASS="xterm-italic",t.UNDERLINE_CLASS="xterm-underline",t.CURSOR_CLASS="xterm-cursor",t.CURSOR_BLINK_CLASS="xterm-cursor-blink",t.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",t.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",t.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var a=function(){function e(e,t,r){this._document=e,this._optionsService=t,this._colors=r,this._workCell=new o.CellData}return e.prototype.setColors=function(e){this._colors=e},e.prototype.createRow=function(e,r,o,a,l,u,h){for(var f=this._document.createDocumentFragment(),d=0,_=Math.min(e.length,h)-1;_>=0;_--)if(e.loadCell(_,this._workCell).getCode()!==n.NULL_CELL_CODE||r&&_===a){d=_+1;break}for(_=0;_<d;_++){e.loadCell(_,this._workCell);var p=this._workCell.getWidth();if(0!==p){var v=this._document.createElement("span");if(p>1&&(v.style.width=u*p+"px"),r&&_===a)switch(v.classList.add(t.CURSOR_CLASS),l&&v.classList.add(t.CURSOR_BLINK_CLASS),o){case"bar":v.classList.add(t.CURSOR_STYLE_BAR_CLASS);break;case"underline":v.classList.add(t.CURSOR_STYLE_UNDERLINE_CLASS);break;default:v.classList.add(t.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&v.classList.add(t.BOLD_CLASS),this._workCell.isItalic()&&v.classList.add(t.ITALIC_CLASS),this._workCell.isDim()&&v.classList.add(t.DIM_CLASS),this._workCell.isUnderline()&&v.classList.add(t.UNDERLINE_CLASS),this._workCell.isInvisible()?v.textContent=n.WHITESPACE_CELL_CHAR:v.textContent=this._workCell.getChars()||n.WHITESPACE_CELL_CHAR;var g=this._workCell.getFgColor(),y=this._workCell.getFgColorMode(),m=this._workCell.getBgColor(),b=this._workCell.getBgColorMode(),w=!!this._workCell.isInverse();if(w){var S=g;g=m,m=S;var C=y;y=b,b=C}switch(y){case 16777216:case 33554432:this._workCell.isBold()&&g<8&&this._optionsService.options.drawBoldTextInBrightColors&&(g+=8),this._applyMinimumContrast(v,this._colors.background,this._colors.ansi[g])||v.classList.add("xterm-fg-"+g);break;case 50331648:var k=s.rgba.toColor(g>>16&255,g>>8&255,255&g);this._applyMinimumContrast(v,this._colors.background,k)||this._addStyle(v,"color:#"+c(g.toString(16),"0",6));break;default:this._applyMinimumContrast(v,this._colors.background,this._colors.foreground)||w&&v.classList.add("xterm-fg-"+i.INVERTED_DEFAULT_COLOR)}switch(b){case 16777216:case 33554432:v.classList.add("xterm-bg-"+m);break;case 50331648:this._addStyle(v,"background-color:#"+c(m.toString(16),"0",6));break;default:w&&v.classList.add("xterm-bg-"+i.INVERTED_DEFAULT_COLOR)}f.appendChild(v)}}return f},e.prototype._applyMinimumContrast=function(e,t,r){if(1===this._optionsService.options.minimumContrastRatio)return!1;var i=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return void 0===i&&(i=s.color.ensureContrastRatio(t,r,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,null!=i?i:null)),!!i&&(this._addStyle(e,"color:"+i.css),!0)},e.prototype._addStyle=function(e,t){e.setAttribute("style",""+(e.getAttribute("style")||"")+t+";")},e}();function c(e,t,r){for(;e.length<r;)e=t+e;return e}t.DomRendererRowFactory=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;var i=r(12),n={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};t.evaluateKeyboardEvent=function(e,t,r,o){var s={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?s.key=t?i.C0.ESC+"OA":i.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?s.key=t?i.C0.ESC+"OD":i.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?s.key=t?i.C0.ESC+"OC":i.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(s.key=t?i.C0.ESC+"OB":i.C0.ESC+"[B");break;case 8:if(e.shiftKey){s.key=i.C0.BS;break}if(e.altKey){s.key=i.C0.ESC+i.C0.DEL;break}s.key=i.C0.DEL;break;case 9:if(e.shiftKey){s.key=i.C0.ESC+"[Z";break}s.key=i.C0.HT,s.cancel=!0;break;case 13:s.key=e.altKey?i.C0.ESC+i.C0.CR:i.C0.CR,s.cancel=!0;break;case 27:s.key=i.C0.ESC,e.altKey&&(s.key=i.C0.ESC+i.C0.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;a?(s.key=i.C0.ESC+"[1;"+(a+1)+"D",s.key===i.C0.ESC+"[1;3D"&&(s.key=i.C0.ESC+(r?"b":"[1;5D"))):s.key=t?i.C0.ESC+"OD":i.C0.ESC+"[D";break;case 39:if(e.metaKey)break;a?(s.key=i.C0.ESC+"[1;"+(a+1)+"C",s.key===i.C0.ESC+"[1;3C"&&(s.key=i.C0.ESC+(r?"f":"[1;5C"))):s.key=t?i.C0.ESC+"OC":i.C0.ESC+"[C";break;case 38:if(e.metaKey)break;a?(s.key=i.C0.ESC+"[1;"+(a+1)+"A",r||s.key!==i.C0.ESC+"[1;3A"||(s.key=i.C0.ESC+"[1;5A")):s.key=t?i.C0.ESC+"OA":i.C0.ESC+"[A";break;case 40:if(e.metaKey)break;a?(s.key=i.C0.ESC+"[1;"+(a+1)+"B",r||s.key!==i.C0.ESC+"[1;3B"||(s.key=i.C0.ESC+"[1;5B")):s.key=t?i.C0.ESC+"OB":i.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(s.key=i.C0.ESC+"[2~");break;case 46:s.key=a?i.C0.ESC+"[3;"+(a+1)+"~":i.C0.ESC+"[3~";break;case 36:s.key=a?i.C0.ESC+"[1;"+(a+1)+"H":t?i.C0.ESC+"OH":i.C0.ESC+"[H";break;case 35:s.key=a?i.C0.ESC+"[1;"+(a+1)+"F":t?i.C0.ESC+"OF":i.C0.ESC+"[F";break;case 33:e.shiftKey?s.type=2:s.key=i.C0.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:s.key=i.C0.ESC+"[6~";break;case 112:s.key=a?i.C0.ESC+"[1;"+(a+1)+"P":i.C0.ESC+"OP";break;case 113:s.key=a?i.C0.ESC+"[1;"+(a+1)+"Q":i.C0.ESC+"OQ";break;case 114:s.key=a?i.C0.ESC+"[1;"+(a+1)+"R":i.C0.ESC+"OR";break;case 115:s.key=a?i.C0.ESC+"[1;"+(a+1)+"S":i.C0.ESC+"OS";break;case 116:s.key=a?i.C0.ESC+"[15;"+(a+1)+"~":i.C0.ESC+"[15~";break;case 117:s.key=a?i.C0.ESC+"[17;"+(a+1)+"~":i.C0.ESC+"[17~";break;case 118:s.key=a?i.C0.ESC+"[18;"+(a+1)+"~":i.C0.ESC+"[18~";break;case 119:s.key=a?i.C0.ESC+"[19;"+(a+1)+"~":i.C0.ESC+"[19~";break;case 120:s.key=a?i.C0.ESC+"[20;"+(a+1)+"~":i.C0.ESC+"[20~";break;case 121:s.key=a?i.C0.ESC+"[21;"+(a+1)+"~":i.C0.ESC+"[21~";break;case 122:s.key=a?i.C0.ESC+"[23;"+(a+1)+"~":i.C0.ESC+"[23~";break;case 123:s.key=a?i.C0.ESC+"[24;"+(a+1)+"~":i.C0.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(r&&!o||!e.altKey||e.metaKey)r&&!e.altKey&&!e.ctrlKey&&e.metaKey?65===e.keyCode&&(s.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&1===e.key.length?s.key=e.key:e.key&&e.ctrlKey&&"_"===e.key&&(s.key=i.C0.US);else{var c=n[e.keyCode],l=c&&c[e.shiftKey?1:0];if(l)s.key=i.C0.ESC+l;else if(e.keyCode>=65&&e.keyCode<=90){var u=e.ctrlKey?e.keyCode-64:e.keyCode+32;s.key=i.C0.ESC+String.fromCharCode(u)}}else e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?s.key=i.C0.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?s.key=i.C0.DEL:219===e.keyCode?s.key=i.C0.ESC:220===e.keyCode?s.key=i.C0.FS:221===e.keyCode&&(s.key=i.C0.GS)}return s}},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;var a=r(31),c=r(0),l=r(2),u=r(32),h=r(7),f=r(1),d=r(5),_=function(e){function t(t,r,i,n,o,s){var l=e.call(this)||this;if(l._renderer=t,l._rowCount=r,l._isPaused=!1,l._needsFullRefresh=!1,l._isNextRenderRedrawOnly=!0,l._needsSelectionRefresh=!1,l._canvasWidth=0,l._canvasHeight=0,l._selectionState={start:void 0,end:void 0,columnSelectMode:!1},l._onDimensionsChange=new c.EventEmitter,l._onRender=new c.EventEmitter,l._onRefreshRequest=new c.EventEmitter,l.register({dispose:function(){return l._renderer.dispose()}}),l._renderDebouncer=new a.RenderDebouncer((function(e,t){return l._renderRows(e,t)})),l.register(l._renderDebouncer),l._screenDprMonitor=new u.ScreenDprMonitor,l._screenDprMonitor.setListener((function(){return l.onDevicePixelRatioChange()})),l.register(l._screenDprMonitor),l.register(s.onResize((function(e){return l._fullRefresh()}))),l.register(n.onOptionChange((function(){return l._renderer.onOptionsChanged()}))),l.register(o.onCharSizeChange((function(){return l.onCharSizeChanged()}))),l._renderer.onRequestRedraw((function(e){return l.refreshRows(e.start,e.end,!0)})),l.register(h.addDisposableDomListener(window,"resize",(function(){return l.onDevicePixelRatioChange()}))),"IntersectionObserver"in window){var f=new IntersectionObserver((function(e){return l._onIntersectionChange(e[e.length-1])}),{threshold:0});f.observe(i),l.register({dispose:function(){return f.disconnect()}})}return l}return n(t,e),Object.defineProperty(t.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),t.prototype._onIntersectionChange=function(e){this._isPaused=0===e.intersectionRatio,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},t.prototype.refreshRows=function(e,t,r){void 0===r&&(r=!1),this._isPaused?this._needsFullRefresh=!0:(r||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))},t.prototype._renderRows=function(e,t){this._renderer.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0},t.prototype.resize=function(e,t){this._rowCount=t,this._fireOnCanvasResize()},t.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},t.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.setRenderer=function(e){var t=this;this._renderer.dispose(),this._renderer=e,this._renderer.onRequestRedraw((function(e){return t.refreshRows(e.start,e.end,!0)})),this._needsSelectionRefresh=!0,this._fullRefresh()},t.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},t.prototype.setColors=function(e){this._renderer.setColors(e),this._fullRefresh()},t.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},t.prototype.onResize=function(e,t){this._renderer.onResize(e,t),this._fullRefresh()},t.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},t.prototype.onBlur=function(){this._renderer.onBlur()},t.prototype.onFocus=function(){this._renderer.onFocus()},t.prototype.onSelectionChanged=function(e,t,r){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=r,this._renderer.onSelectionChanged(e,t,r)},t.prototype.onCursorMove=function(){this._renderer.onCursorMove()},t.prototype.clear=function(){this._renderer.clear()},t.prototype.registerCharacterJoiner=function(e){return this._renderer.registerCharacterJoiner(e)},t.prototype.deregisterCharacterJoiner=function(e){return this._renderer.deregisterCharacterJoiner(e)},o([s(3,f.IOptionsService),s(4,d.ICharSizeService),s(5,f.IBufferService)],t)}(l.Disposable);t.RenderService=_},function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},n=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;var o=r(1),s=r(0),a=function(){function e(e,t,r){this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=new s.EventEmitter,this._measureStrategy=new c(e,t,this._optionsService)}return Object.defineProperty(e.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),e.prototype.measure=function(){var e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())},i([n(2,o.IOptionsService)],e)}();t.CharSizeService=a;var c=function(){function e(e,t,r){this._document=e,this._parentElement=t,this._optionsService=r,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}return e.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var e=this._measureElement.getBoundingClientRect();return 0!==e.width&&0!==e.height&&(this._result.width=e.width,this._result.height=Math.ceil(e.height)),this._result},e}()},function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},n=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;var o=r(5),s=r(30),a=function(){function e(e,t){this._renderService=e,this._charSizeService=t}return e.prototype.getCoords=function(e,t,r,i,n){return s.getCoords(e,t,r,i,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,n)},e.prototype.getRawByteCoords=function(e,t,r,i){var n=this.getCoords(e,t,r,i);return s.getRawByteCoords(n)},i([n(0,o.IRenderService),n(1,o.ICharSizeService)],e)}();t.MouseService=a},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier2=void 0;var a=r(1),c=r(0),l=r(2),u=r(7),h=function(e){function t(t){var r=e.call(this)||this;return r._bufferService=t,r._linkProviders=[],r._linkCacheDisposables=[],r._isMouseOut=!0,r._activeLine=-1,r._onShowLinkUnderline=r.register(new c.EventEmitter),r._onHideLinkUnderline=r.register(new c.EventEmitter),r.register(l.getDisposeArrayDisposable(r._linkCacheDisposables)),r}return n(t,e),Object.defineProperty(t.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),t.prototype.registerLinkProvider=function(e){var t=this;return this._linkProviders.push(e),{dispose:function(){var r=t._linkProviders.indexOf(e);-1!==r&&t._linkProviders.splice(r,1)}}},t.prototype.attachToDom=function(e,t,r){var i=this;this._element=e,this._mouseService=t,this._renderService=r,this.register(u.addDisposableDomListener(this._element,"mouseleave",(function(){i._isMouseOut=!0,i._clearCurrentLink()}))),this.register(u.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(u.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},t.prototype._onMouseMove=function(e){if(this._lastMouseEvent=e,this._element&&this._mouseService){var t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(t){this._isMouseOut=!1;for(var r=e.composedPath(),i=0;i<r.length;i++){var n=r[i];if(n.classList.contains("xterm"))break;if(n.classList.contains("xterm-hover"))return}this._lastBufferCell&&t.x===this._lastBufferCell.x&&t.y===this._lastBufferCell.y||(this._onHover(t),this._lastBufferCell=t)}}},t.prototype._onHover=function(e){if(this._activeLine!==e.y)return this._clearCurrentLink(),void this._askForLink(e,!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))},t.prototype._askForLink=function(e,t){var r=this;this._activeProviderReplies&&t||(this._activeProviderReplies=new Map,this._activeLine=e.y);var i=!1;this._linkProviders.forEach((function(n,o){var s;t?(null===(s=r._activeProviderReplies)||void 0===s?void 0:s.get(o))&&(i=r._checkLinkProviderResult(o,e,i)):n.provideLinks(e.y,(function(t){var n,s;if(!r._isMouseOut){var a=null==t?void 0:t.map((function(e){return{link:e}}));null===(n=r._activeProviderReplies)||void 0===n||n.set(o,a),i=r._checkLinkProviderResult(o,e,i),(null===(s=r._activeProviderReplies)||void 0===s?void 0:s.size)===r._linkProviders.length&&r._removeIntersectingLinks(e.y,r._activeProviderReplies)}}))}))},t.prototype._removeIntersectingLinks=function(e,t){for(var r=new Set,i=0;i<t.size;i++){var n=t.get(i);if(n)for(var o=0;o<n.length;o++)for(var s=n[o],a=s.link.range.start.y<e?0:s.link.range.start.x,c=s.link.range.end.y>e?this._bufferService.cols:s.link.range.end.x,l=a;l<=c;l++){if(r.has(l)){n.splice(o--,1);break}r.add(l)}}},t.prototype._checkLinkProviderResult=function(e,t,r){var i,n=this;if(!this._activeProviderReplies)return r;for(var o=this._activeProviderReplies.get(e),s=!1,a=0;a<e;a++)this._activeProviderReplies.has(a)&&!this._activeProviderReplies.get(a)||(s=!0);if(!s&&o){var c=o.find((function(e){return n._linkAtPosition(e.link,t)}));c&&(r=!0,this._handleNewLink(c))}if(this._activeProviderReplies.size===this._linkProviders.length&&!r)for(a=0;a<this._activeProviderReplies.size;a++){var l=null===(i=this._activeProviderReplies.get(a))||void 0===i?void 0:i.find((function(e){return n._linkAtPosition(e.link,t)}));if(l){r=!0,this._handleNewLink(l);break}}return r},t.prototype._onClick=function(e){if(this._element&&this._mouseService&&this._currentLink){var t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}},t.prototype._clearCurrentLink=function(e,t){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,l.disposeArray(this._linkCacheDisposables))},t.prototype._handleNewLink=function(e){var t=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var r=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);r&&this._linkAtPosition(e.link,r)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:void 0===e.link.decorations||e.link.decorations.underline,pointerCursor:void 0===e.link.decorations||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:function(){var e,r;return null===(r=null===(e=t._currentLink)||void 0===e?void 0:e.state)||void 0===r?void 0:r.decorations.pointerCursor},set:function(e){var r,i;(null===(r=t._currentLink)||void 0===r?void 0:r.state)&&t._currentLink.state.decorations.pointerCursor!==e&&(t._currentLink.state.decorations.pointerCursor=e,t._currentLink.state.isHovered&&(null===(i=t._element)||void 0===i||i.classList.toggle("xterm-cursor-pointer",e)))}},underline:{get:function(){var e,r;return null===(r=null===(e=t._currentLink)||void 0===e?void 0:e.state)||void 0===r?void 0:r.decorations.underline},set:function(r){var i,n,o;(null===(i=t._currentLink)||void 0===i?void 0:i.state)&&(null===(o=null===(n=t._currentLink)||void 0===n?void 0:n.state)||void 0===o?void 0:o.decorations.underline)!==r&&(t._currentLink.state.decorations.underline=r,t._currentLink.state.isHovered&&t._fireUnderlineEvent(e.link,r))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange((function(e){var r=0===e.start?0:e.start+1+t._bufferService.buffer.ydisp;t._clearCurrentLink(r,e.end+1+t._bufferService.buffer.ydisp)}))))}},t.prototype._linkHover=function(e,t,r){var i;(null===(i=this._currentLink)||void 0===i?void 0:i.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(r,t.text)},t.prototype._fireUnderlineEvent=function(e,t){var r=e.range,i=this._bufferService.buffer.ydisp,n=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-i-1,r.end.x,r.end.y-i-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(n)},t.prototype._linkLeave=function(e,t,r){var i;(null===(i=this._currentLink)||void 0===i?void 0:i.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(r,t.text)},t.prototype._linkAtPosition=function(e,t){var r=e.range.start.y===e.range.end.y,i=e.range.start.y<t.y,n=e.range.end.y>t.y;return(r&&e.range.start.x<=t.x&&e.range.end.x>=t.x||i&&e.range.end.x>=t.x||n&&e.range.start.x<=t.x||i&&n)&&e.range.start.y<=t.y&&e.range.end.y>=t.y},t.prototype._positionFromMouseEvent=function(e,t,r){var i=r.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}},t.prototype._createLinkUnderlineEvent=function(e,t,r,i,n){return{x1:e,y1:t,x2:r,y2:i,cols:this._bufferService.cols,fg:n}},o([s(0,a.IBufferService)],t)}(l.Disposable);t.Linkifier2=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0;var i=function(){function e(e){this._textarea=e}return Object.defineProperty(e.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),e}();t.CoreBrowserService=i},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;var o=r(2),s=r(1),a=r(66),c=r(67),l=r(68),u=r(74),h=r(75),f=r(0),d=r(76),_=r(77),p=r(78),v=r(80),g=r(81),y=r(19),m=r(82),b=function(e){function t(t){var r=e.call(this)||this;return r._onBinary=new f.EventEmitter,r._onData=new f.EventEmitter,r._onLineFeed=new f.EventEmitter,r._onResize=new f.EventEmitter,r._onScroll=new f.EventEmitter,r._instantiationService=new a.InstantiationService,r.optionsService=new u.OptionsService(t),r._instantiationService.setService(s.IOptionsService,r.optionsService),r._bufferService=r.register(r._instantiationService.createInstance(l.BufferService)),r._instantiationService.setService(s.IBufferService,r._bufferService),r._logService=r._instantiationService.createInstance(c.LogService),r._instantiationService.setService(s.ILogService,r._logService),r._coreService=r.register(r._instantiationService.createInstance(h.CoreService,(function(){return r.scrollToBottom()}))),r._instantiationService.setService(s.ICoreService,r._coreService),r._coreMouseService=r._instantiationService.createInstance(d.CoreMouseService),r._instantiationService.setService(s.ICoreMouseService,r._coreMouseService),r._dirtyRowService=r._instantiationService.createInstance(_.DirtyRowService),r._instantiationService.setService(s.IDirtyRowService,r._dirtyRowService),r.unicodeService=r._instantiationService.createInstance(p.UnicodeService),r._instantiationService.setService(s.IUnicodeService,r.unicodeService),r._charsetService=r._instantiationService.createInstance(v.CharsetService),r._instantiationService.setService(s.ICharsetService,r._charsetService),r._inputHandler=new y.InputHandler(r._bufferService,r._charsetService,r._coreService,r._dirtyRowService,r._logService,r.optionsService,r._coreMouseService,r.unicodeService),r.register(f.forwardEvent(r._inputHandler.onLineFeed,r._onLineFeed)),r.register(r._inputHandler),r.register(f.forwardEvent(r._bufferService.onResize,r._onResize)),r.register(f.forwardEvent(r._coreService.onData,r._onData)),r.register(f.forwardEvent(r._coreService.onBinary,r._onBinary)),r.register(r.optionsService.onOptionChange((function(e){return r._updateOptions(e)}))),r._writeBuffer=new m.WriteBuffer((function(e){return r._inputHandler.parse(e)})),r}return n(t,e),Object.defineProperty(t.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){var t;this._isDisposed||(e.prototype.dispose.call(this),null===(t=this._windowsMode)||void 0===t||t.dispose(),this._windowsMode=void 0)},t.prototype.write=function(e,t){this._writeBuffer.write(e,t)},t.prototype.writeSync=function(e){this._writeBuffer.writeSync(e)},t.prototype.resize=function(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,l.MINIMUM_COLS),t=Math.max(t,l.MINIMUM_ROWS),this._bufferService.resize(e,t))},t.prototype.scroll=function(e,t){void 0===t&&(t=!1);var r,i=this._bufferService.buffer;(r=this._cachedBlankLine)&&r.length===this.cols&&r.getFg(0)===e.fg&&r.getBg(0)===e.bg||(r=i.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;var n=i.ybase+i.scrollTop,o=i.ybase+i.scrollBottom;if(0===i.scrollTop){var s=i.lines.isFull;o===i.lines.length-1?s?i.lines.recycle().copyFrom(r):i.lines.push(r.clone()):i.lines.splice(o+1,0,r.clone()),s?this._bufferService.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this._bufferService.isUserScrolling||i.ydisp++)}else{var a=o-n+1;i.lines.shiftElements(n+1,a-1,-1),i.lines.set(o,r.clone())}this._bufferService.isUserScrolling||(i.ydisp=i.ybase),this._dirtyRowService.markRangeDirty(i.scrollTop,i.scrollBottom),this._onScroll.fire(i.ydisp)},t.prototype.scrollLines=function(e,t){var r=this._bufferService.buffer;if(e<0){if(0===r.ydisp)return;this._bufferService.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this._bufferService.isUserScrolling=!1);var i=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),i!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))},t.prototype.scrollPages=function(e){this.scrollLines(e*(this.rows-1))},t.prototype.scrollToTop=function(){this.scrollLines(-this._bufferService.buffer.ydisp)},t.prototype.scrollToBottom=function(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)},t.prototype.scrollToLine=function(e){var t=e-this._bufferService.buffer.ydisp;0!==t&&this.scrollLines(t)},t.prototype.addEscHandler=function(e,t){return this._inputHandler.addEscHandler(e,t)},t.prototype.addDcsHandler=function(e,t){return this._inputHandler.addDcsHandler(e,t)},t.prototype.addCsiHandler=function(e,t){return this._inputHandler.addCsiHandler(e,t)},t.prototype.addOscHandler=function(e,t){return this._inputHandler.addOscHandler(e,t)},t.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},t.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},t.prototype._updateOptions=function(e){var t;switch(e){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():(null===(t=this._windowsMode)||void 0===t||t.dispose(),this._windowsMode=void 0)}},t.prototype._enableWindowsMode=function(){var e=this;if(!this._windowsMode){var t=[];t.push(this.onLineFeed(g.updateWindowsModeWrappedState.bind(null,this._bufferService))),t.push(this.addCsiHandler({final:"H"},(function(){return g.updateWindowsModeWrappedState(e._bufferService),!1}))),this._windowsMode={dispose:function(){for(var e=0,r=t;e<r.length;e++)r[e].dispose()}}}},t}(o.Disposable);t.CoreTerminal=b},function(e,t,r){"use strict";var i=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var i=Array(e),n=0;for(t=0;t<r;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,n++)i[n]=o[s];return i};Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;var n=r(1),o=r(14),s=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._entries=new Map;for(var r=0,i=e;r<i.length;r++){var n=i[r],o=n[0],s=n[1];this.set(o,s)}}return e.prototype.set=function(e,t){var r=this._entries.get(e);return this._entries.set(e,t),r},e.prototype.forEach=function(e){this._entries.forEach((function(t,r){return e(r,t)}))},e.prototype.has=function(e){return this._entries.has(e)},e.prototype.get=function(e){return this._entries.get(e)},e}();t.ServiceCollection=s;var a=function(){function e(){this._services=new s,this._services.set(n.IInstantiationService,this)}return e.prototype.setService=function(e,t){this._services.set(e,t)},e.prototype.getService=function(e){return this._services.get(e)},e.prototype.createInstance=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=o.getServiceDependencies(e).sort((function(e,t){return e.index-t.index})),s=[],a=0,c=n;a<c.length;a++){var l=c[a],u=this._services.get(l.id);if(!u)throw new Error("[createInstance] "+e.name+" depends on UNKNOWN service "+l.id+".");s.push(u)}var h=n.length>0?n[0].index:t.length;if(t.length!==h)throw new Error("[createInstance] First service dependency of "+e.name+" at position "+(h+1)+" conflicts with "+t.length+" static arguments");return new(e.bind.apply(e,i([void 0],i(t,s))))},e}();t.InstantiationService=a},function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},n=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}},o=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var i=Array(e),n=0;for(t=0;t<r;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,n++)i[n]=o[s];return i};Object.defineProperty(t,"__esModule",{value:!0}),t.LogService=t.LogLevel=void 0;var s,a=r(1);!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.OFF=4]="OFF"}(s=t.LogLevel||(t.LogLevel={}));var c={debug:s.DEBUG,info:s.INFO,warn:s.WARN,error:s.ERROR,off:s.OFF},l=function(){function e(e){var t=this;this._optionsService=e,this._updateLogLevel(),this._optionsService.onOptionChange((function(e){"logLevel"===e&&t._updateLogLevel()}))}return e.prototype._updateLogLevel=function(){this._logLevel=c[this._optionsService.options.logLevel]},e.prototype._evalLazyOptionalParams=function(e){for(var t=0;t<e.length;t++)"function"==typeof e[t]&&(e[t]=e[t]())},e.prototype._log=function(e,t,r){this._evalLazyOptionalParams(r),e.call.apply(e,o([console,"xterm.js: "+t],r))},e.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this._logLevel<=s.DEBUG&&this._log(console.log,e,t)},e.prototype.info=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this._logLevel<=s.INFO&&this._log(console.info,e,t)},e.prototype.warn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this._logLevel<=s.WARN&&this._log(console.warn,e,t)},e.prototype.error=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this._logLevel<=s.ERROR&&this._log(console.error,e,t)},i([n(0,a.IOptionsService)],e)}();t.LogService=l},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;var a=r(1),c=r(69),l=r(0),u=r(2);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;var h=function(e){function r(r){var i=e.call(this)||this;return i._optionsService=r,i.isUserScrolling=!1,i._onResize=new l.EventEmitter,i.cols=Math.max(r.options.cols,t.MINIMUM_COLS),i.rows=Math.max(r.options.rows,t.MINIMUM_ROWS),i.buffers=new c.BufferSet(r,i),i}return n(r,e),Object.defineProperty(r.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),r.prototype.dispose=function(){e.prototype.dispose.call(this),this.buffers.dispose()},r.prototype.resize=function(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:e,rows:t})},r.prototype.reset=function(){this.buffers.dispose(),this.buffers=new c.BufferSet(this._optionsService,this),this.isUserScrolling=!1},o([s(0,a.IOptionsService)],r)}(u.Disposable);t.BufferService=h},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;var o=r(70),s=r(0),a=function(e){function t(t,r){var i=e.call(this)||this;return i._onBufferActivate=i.register(new s.EventEmitter),i._normal=new o.Buffer(!0,t,r),i._normal.fillViewportRows(),i._alt=new o.Buffer(!1,t,r),i._activeBuffer=i._normal,i.setupTabStops(),i}return n(t,e),Object.defineProperty(t.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),t.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},t.prototype.activateAltBuffer=function(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},t.prototype.resize=function(e,t){this._normal.resize(e,t),this._alt.resize(e,t)},t.prototype.setupTabStops=function(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)},t}(r(2).Disposable);t.BufferSet=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferStringIterator=t.Buffer=t.MAX_BUFFER_SIZE=void 0;var i=r(71),n=r(16),o=r(4),s=r(3),a=r(72),c=r(73),l=r(20),u=r(6);t.MAX_BUFFER_SIZE=4294967295;var h=function(){function e(e,t,r){this._hasScrollback=e,this._optionsService=t,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=n.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=o.CellData.fromCharData([0,s.NULL_CELL_CHAR,s.NULL_CELL_WIDTH,s.NULL_CELL_CODE]),this._whitespaceCell=o.CellData.fromCharData([0,s.WHITESPACE_CELL_CHAR,s.WHITESPACE_CELL_WIDTH,s.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new i.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return e.prototype.getNullCell=function(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell},e.prototype.getWhitespaceCell=function(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell},e.prototype.getBlankLine=function(e,t){return new n.BufferLine(this._bufferService.cols,this.getNullCell(e),t)},Object.defineProperty(e.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows},enumerable:!1,configurable:!0}),e.prototype._getCorrectBufferLength=function(e){if(!this._hasScrollback)return e;var r=e+this._optionsService.options.scrollback;return r>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:r},e.prototype.fillViewportRows=function(e){if(0===this.lines.length){void 0===e&&(e=n.DEFAULT_ATTR_DATA);for(var t=this._rows;t--;)this.lines.push(this.getBlankLine(e))}},e.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new i.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},e.prototype.resize=function(e,t){var r=this.getNullCell(n.DEFAULT_ATTR_DATA),i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(var o=0;o<this.lines.length;o++)this.lines.get(o).resize(e,r);var s=0;if(this._rows<t)for(var a=this._rows;a<t;a++)this.lines.length<t+this.ybase&&(this._optionsService.options.windowsMode?this.lines.push(new n.BufferLine(e,r)):this.ybase>0&&this.lines.length<=this.ybase+this.y+s+1?(this.ybase--,s++,this.ydisp>0&&this.ydisp--):this.lines.push(new n.BufferLine(e,r)));else for(a=this._rows;a>t;a--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){var c=this.lines.length-i;c>0&&(this.lines.trimStart(c),this.ybase=Math.max(this.ybase-c,0),this.ydisp=Math.max(this.ydisp-c,0),this.savedY=Math.max(this.savedY-c,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),s&&(this.y+=s),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(o=0;o<this.lines.length;o++)this.lines.get(o).resize(e,r);this._cols=e,this._rows=t},Object.defineProperty(e.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._optionsService.options.windowsMode},enumerable:!1,configurable:!0}),e.prototype._reflow=function(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))},e.prototype._reflowLarger=function(e,t){var r=a.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(n.DEFAULT_ATTR_DATA));if(r.length>0){var i=a.reflowLargerCreateNewLayout(this.lines,r);a.reflowLargerApplyNewLayout(this.lines,i.layout),this._reflowLargerAdjustViewport(e,t,i.countRemoved)}},e.prototype._reflowLargerAdjustViewport=function(e,t,r){for(var i=this.getNullCell(n.DEFAULT_ATTR_DATA),o=r;o-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new n.BufferLine(e,i))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-r,0)},e.prototype._reflowSmaller=function(e,t){for(var r=this.getNullCell(n.DEFAULT_ATTR_DATA),i=[],o=0,s=this.lines.length-1;s>=0;s--){var c=this.lines.get(s);if(!(!c||!c.isWrapped&&c.getTrimmedLength()<=e)){for(var l=[c];c.isWrapped&&s>0;)c=this.lines.get(--s),l.unshift(c);var u=this.ybase+this.y;if(!(u>=s&&u<s+l.length)){var h=l[l.length-1].getTrimmedLength(),f=a.reflowSmallerGetNewLineLengths(l,this._cols,e),d=f.length-l.length,_=void 0;_=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+d):Math.max(0,this.lines.length-this.lines.maxLength+d);for(var p=[],v=0;v<d;v++){var g=this.getBlankLine(n.DEFAULT_ATTR_DATA,!0);p.push(g)}p.length>0&&(i.push({start:s+l.length+o,newLines:p}),o+=p.length),l.push.apply(l,p);var y=f.length-1,m=f[y];0===m&&(m=f[--y]);for(var b=l.length-d-1,w=h;b>=0;){var S=Math.min(w,m);if(l[y].copyCellsFrom(l[b],w-S,m-S,S,!0),0==(m-=S)&&(m=f[--y]),0==(w-=S)){b--;var C=Math.max(b,0);w=a.getWrappedLineTrimmedLength(l,C,this._cols)}}for(v=0;v<l.length;v++)f[v]<e&&l[v].setCell(f[v],r);for(var k=d-_;k-- >0;)0===this.ybase?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+o)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+t-1)}}}if(i.length>0){var E=[],x=[];for(v=0;v<this.lines.length;v++)x.push(this.lines.get(v));var L=this.lines.length,A=L-1,R=0,M=i[R];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+o);var T=0;for(v=Math.min(this.lines.maxLength-1,L+o-1);v>=0;v--)if(M&&M.start>A+T){for(var D=M.newLines.length-1;D>=0;D--)this.lines.set(v--,M.newLines[D]);v++,E.push({index:A+1,amount:M.newLines.length}),T+=M.newLines.length,M=i[++R]}else this.lines.set(v,x[A--]);var P=0;for(v=E.length-1;v>=0;v--)E[v].index+=P,this.lines.onInsertEmitter.fire(E[v]),P+=E[v].amount;var O=Math.max(0,L+o-this.lines.maxLength);O>0&&this.lines.onTrimEmitter.fire(O)}},e.prototype.stringIndexToBufferIndex=function(e,t,r){for(void 0===r&&(r=!1);t;){var i=this.lines.get(e);if(!i)return[-1,-1];for(var n=r?i.getTrimmedLength():i.length,o=0;o<n;++o)if(i.get(o)[s.CHAR_DATA_WIDTH_INDEX]&&(t-=i.get(o)[s.CHAR_DATA_CHAR_INDEX].length||1),t<0)return[e,o];e++}return[e,0]},e.prototype.translateBufferLineToString=function(e,t,r,i){void 0===r&&(r=0);var n=this.lines.get(e);return n?n.translateToString(t,r,i):""},e.prototype.getWrappedRangeForLine=function(e){for(var t=e,r=e;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:t,last:r}},e.prototype.setupTabStops=function(e){for(null!=e?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.options.tabStopWidth)this.tabs[e]=!0},e.prototype.prevStop=function(e){for(null==e&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e},e.prototype.nextStop=function(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e},e.prototype.addMarker=function(e){var t=this,r=new c.Marker(e);return this.markers.push(r),r.register(this.lines.onTrim((function(e){r.line-=e,r.line<0&&r.dispose()}))),r.register(this.lines.onInsert((function(e){r.line>=e.index&&(r.line+=e.amount)}))),r.register(this.lines.onDelete((function(e){r.line>=e.index&&r.line<e.index+e.amount&&r.dispose(),r.line>e.index&&(r.line-=e.amount)}))),r.register(r.onDispose((function(){return t._removeMarker(r)}))),r},e.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},e.prototype.iterator=function(e,t,r,i,n){return new f(this,e,t,r,i,n)},e}();t.Buffer=h;var f=function(){function e(e,t,r,i,n,o){void 0===r&&(r=0),void 0===i&&(i=e.lines.length),void 0===n&&(n=0),void 0===o&&(o=0),this._buffer=e,this._trimRight=t,this._startIndex=r,this._endIndex=i,this._startOverscan=n,this._endOverscan=o,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return e.prototype.hasNext=function(){return this._current<this._endIndex},e.prototype.next=function(){var e=this._buffer.getWrappedRangeForLine(this._current);e.first<this._startIndex-this._startOverscan&&(e.first=this._startIndex-this._startOverscan),e.last>this._endIndex+this._endOverscan&&(e.last=this._endIndex+this._endOverscan),e.first=Math.max(e.first,0),e.last=Math.min(e.last,this._buffer.lines.length);for(var t="",r=e.first;r<=e.last;++r)t+=this._buffer.translateBufferLineToString(r,this._trimRight);return this._current=e.last+1,{range:e,content:t}},e}();t.BufferStringIterator=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;var i=r(0),n=function(){function e(e){this._maxLength=e,this.onDeleteEmitter=new i.EventEmitter,this.onInsertEmitter=new i.EventEmitter,this.onTrimEmitter=new i.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(e.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxLength",{get:function(){return this._maxLength},set:function(e){if(this._maxLength!==e){for(var t=new Array(e),r=0;r<Math.min(e,this.length);r++)t[r]=this._array[this._getCyclicIndex(r)];this._array=t,this._maxLength=e,this._startIndex=0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},set:function(e){if(e>this._length)for(var t=this._length;t<e;t++)this._array[t]=void 0;this._length=e},enumerable:!1,configurable:!0}),e.prototype.get=function(e){return this._array[this._getCyclicIndex(e)]},e.prototype.set=function(e,t){this._array[this._getCyclicIndex(e)]=t},e.prototype.push=function(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++},e.prototype.recycle=function(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]},Object.defineProperty(e.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!1,configurable:!0}),e.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},e.prototype.splice=function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(t){for(var n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t}for(n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+r.length)]=this._array[this._getCyclicIndex(n)];for(n=0;n<r.length;n++)this._array[this._getCyclicIndex(e+n)]=r[n];if(this._length+r.length>this._maxLength){var o=this._length+r.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=r.length},e.prototype.trimStart=function(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)},e.prototype.shiftElements=function(e,t,r){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(var i=t-1;i>=0;i--)this.set(e+i+r,this.get(e+i));var n=e+t+r-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(i=0;i<t;i++)this.set(e+i+r,this.get(e+i))}},e.prototype._getCyclicIndex=function(e){return(this._startIndex+e)%this._maxLength},e}();t.CircularList=n},function(e,t,r){"use strict";function i(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();var i=!e[t].hasContent(r-1)&&1===e[t].getWidth(r-1),n=2===e[t+1].getWidth(0);return i&&n?r-1:r}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(e,t,r,n,o){for(var s=[],a=0;a<e.length-1;a++){var c=a,l=e.get(++c);if(l.isWrapped){for(var u=[e.get(a)];c<e.length&&l.isWrapped;)u.push(l),l=e.get(++c);if(n>=a&&n<c)a+=u.length-1;else{for(var h=0,f=i(u,h,t),d=1,_=0;d<u.length;){var p=i(u,d,t),v=p-_,g=r-f,y=Math.min(v,g);u[h].copyCellsFrom(u[d],_,f,y,!1),(f+=y)===r&&(h++,f=0),(_+=y)===p&&(d++,_=0),0===f&&0!==h&&2===u[h-1].getWidth(r-1)&&(u[h].copyCellsFrom(u[h-1],r-1,f++,1,!1),u[h-1].setCell(r-1,o))}u[h].replaceCells(f,r,o);for(var m=0,b=u.length-1;b>0&&(b>h||0===u[b].getTrimmedLength());b--)m++;m>0&&(s.push(a+u.length-m),s.push(m)),a+=u.length-1}}}return s},t.reflowLargerCreateNewLayout=function(e,t){for(var r=[],i=0,n=t[i],o=0,s=0;s<e.length;s++)if(n===s){var a=t[++i];e.onDeleteEmitter.fire({index:s-o,amount:a}),s+=a-1,o+=a,n=t[++i]}else r.push(s);return{layout:r,countRemoved:o}},t.reflowLargerApplyNewLayout=function(e,t){for(var r=[],i=0;i<t.length;i++)r.push(e.get(t[i]));for(i=0;i<r.length;i++)e.set(i,r[i]);e.length=t.length},t.reflowSmallerGetNewLineLengths=function(e,t,r){for(var n=[],o=e.map((function(r,n){return i(e,n,t)})).reduce((function(e,t){return e+t})),s=0,a=0,c=0;c<o;){if(o-c<r){n.push(o-c);break}s+=r;var l=i(e,a,t);s>l&&(s-=l,a++);var u=2===e[a].getWidth(s-1);u&&s--;var h=u?r-1:r;n.push(h),c+=h}return n},t.getWrappedLineTrimmedLength=i},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;var o=r(0),s=function(e){function t(r){var i=e.call(this)||this;return i.line=r,i._id=t._nextId++,i.isDisposed=!1,i._onDispose=new o.EventEmitter,i}return n(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},t._nextId=1,t}(r(2).Disposable);t.Marker=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=t.DEFAULT_BELL_SOUND=void 0;var i=r(0),n=r(11),o=r(33);t.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",t.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:t.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,linkTooltipHoverDuration:500,letterSpacing:0,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!0,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:n.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var s=["cols","rows"],a=function(){function e(e){this._onOptionChange=new i.EventEmitter,this.options=o.clone(t.DEFAULT_OPTIONS);for(var r=0,n=Object.keys(e);r<n.length;r++){var s=n[r];if(s in this.options){var a=e[s];this.options[s]=a}}}return Object.defineProperty(e.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!1,configurable:!0}),e.prototype.setOption=function(e,r){if(!(e in t.DEFAULT_OPTIONS))throw new Error('No option with key "'+e+'"');if(-1!==s.indexOf(e))throw new Error('Option "'+e+'" can only be set in the constructor');this.options[e]!==r&&(r=this._sanitizeAndValidateOption(e,r),this.options[e]!==r&&(this.options[e]=r,this._onOptionChange.fire(e)))},e.prototype._sanitizeAndValidateOption=function(e,r){switch(e){case"bellStyle":case"cursorStyle":case"fontWeight":case"fontWeightBold":case"rendererType":case"wordSeparator":r||(r=t.DEFAULT_OPTIONS[e]);break;case"cursorWidth":r=Math.floor(r);case"lineHeight":case"tabStopWidth":if(r<1)throw new Error(e+" cannot be less than 1, value: "+r);break;case"minimumContrastRatio":r=Math.max(1,Math.min(21,Math.round(10*r)/10));break;case"scrollback":if((r=Math.min(r,4294967295))<0)throw new Error(e+" cannot be less than 0, value: "+r);break;case"fastScrollSensitivity":case"scrollSensitivity":if(r<=0)throw new Error(e+" cannot be less than or equal to 0, value: "+r)}return r},e.prototype.getOption=function(e){if(!(e in t.DEFAULT_OPTIONS))throw new Error('No option with key "'+e+'"');return this.options[e]},e}();t.OptionsService=a},function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;var a=r(1),c=r(0),l=r(33),u=r(2),h=Object.freeze({insertMode:!1}),f=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),d=function(e){function t(t,r,i,n){var o=e.call(this)||this;return o._bufferService=r,o._logService=i,o._optionsService=n,o.isCursorInitialized=!1,o.isCursorHidden=!1,o._onData=o.register(new c.EventEmitter),o._onUserInput=o.register(new c.EventEmitter),o._onBinary=o.register(new c.EventEmitter),o._scrollToBottom=t,o.register({dispose:function(){return o._scrollToBottom=void 0}}),o.modes=l.clone(h),o.decPrivateModes=l.clone(f),o}return n(t,e),Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.modes=l.clone(h),this.decPrivateModes=l.clone(f)},t.prototype.triggerDataEvent=function(e,t){if(void 0===t&&(t=!1),!this._optionsService.options.disableStdin){var r=this._bufferService.buffer;r.ybase!==r.ydisp&&this._scrollToBottom(),t&&this._onUserInput.fire(),this._logService.debug('sending data "'+e+'"',(function(){return e.split("").map((function(e){return e.charCodeAt(0)}))})),this._onData.fire(e)}},t.prototype.triggerBinaryEvent=function(e){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+e+'"',(function(){return e.split("").map((function(e){return e.charCodeAt(0)}))})),this._onBinary.fire(e))},o([s(1,a.IBufferService),s(2,a.ILogService),s(3,a.IOptionsService)],t)}(u.Disposable);t.CoreService=d},function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},n=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;var o=r(1),s=r(0),a={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(e){return 4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)}},VT200:{events:19,restrict:function(e){return 32!==e.action}},DRAG:{events:23,restrict:function(e){return 32!==e.action||3!==e.button}},ANY:{events:31,restrict:function(e){return!0}}};function c(e,t){var r=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return 4===e.button?(r|=64,r|=e.action):(r|=3&e.button,4&e.button&&(r|=64),8&e.button&&(r|=128),32===e.action?r|=32:0!==e.action||t||(r|=3)),r}var l=String.fromCharCode,u={DEFAULT:function(e){var t=[c(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":""+l(t[0])+l(t[1])+l(t[2])},SGR:function(e){var t=0===e.action&&4!==e.button?"m":"M";return"[<"+c(e,!0)+";"+e.col+";"+e.row+t}},h=function(){function e(e,t){this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new s.EventEmitter,this._lastEvent=null;for(var r=0,i=Object.keys(a);r<i.length;r++){var n=i[r];this.addProtocol(n,a[n])}for(var o=0,c=Object.keys(u);o<c.length;o++){var l=c[o];this.addEncoding(l,u[l])}this.reset()}return e.prototype.addProtocol=function(e,t){this._protocols[e]=t},e.prototype.addEncoding=function(e,t){this._encodings[e]=t},Object.defineProperty(e.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(e){if(!this._protocols[e])throw new Error('unknown protocol "'+e+'"');this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"areMouseEventsActive",{get:function(){return 0!==this._protocols[this._activeProtocol].events},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeEncoding",{get:function(){return this._activeEncoding},set:function(e){if(!this._encodings[e])throw new Error('unknown encoding "'+e+'"');this._activeEncoding=e},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null},Object.defineProperty(e.prototype,"onProtocolChange",{get:function(){return this._onProtocolChange.event},enumerable:!1,configurable:!0}),e.prototype.triggerMouseEvent=function(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows)return!1;if(4===e.button&&32===e.action)return!1;if(3===e.button&&32!==e.action)return!1;if(4!==e.button&&(2===e.action||3===e.action))return!1;if(e.col++,e.row++,32===e.action&&this._lastEvent&&this._compareEvents(this._lastEvent,e))return!1;if(!this._protocols[this._activeProtocol].restrict(e))return!1;var t=this._encodings[this._activeEncoding](e);return t&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0},e.prototype.explainEvents=function(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}},e.prototype._compareEvents=function(e,t){return e.col===t.col&&e.row===t.row&&e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift},i([n(0,o.IBufferService),n(1,o.ICoreService)],e)}();t.CoreMouseService=h},function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},n=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DirtyRowService=void 0;var o=r(1),s=function(){function e(e){this._bufferService=e,this.clearRange()}return Object.defineProperty(e.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),e.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},e.prototype.markDirty=function(e){e<this._start?this._start=e:e>this._end&&(this._end=e)},e.prototype.markRangeDirty=function(e,t){if(e>t){var r=e;e=t,t=r}e<this._start&&(this._start=e),t>this._end&&(this._end=t)},e.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},i([n(0,o.IBufferService)],e)}();t.DirtyRowService=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;var i=r(0),n=r(79),o=function(){function e(){this._providers=Object.create(null),this._active="",this._onChange=new i.EventEmitter;var e=new n.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}return Object.defineProperty(e.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeVersion",{get:function(){return this._active},set:function(e){if(!this._providers[e])throw new Error('unknown Unicode version "'+e+'"');this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)},enumerable:!1,configurable:!0}),e.prototype.register=function(e){this._providers[e.version]=e},e.prototype.wcwidth=function(e){return this._activeProvider.wcwidth(e)},e.prototype.getStringCellWidth=function(e){for(var t=0,r=e.length,i=0;i<r;++i){var n=e.charCodeAt(i);if(55296<=n&&n<=56319){if(++i>=r)return t+this.wcwidth(n);var o=e.charCodeAt(i);56320<=o&&o<=57343?n=1024*(n-55296)+o-56320+65536:t+=this.wcwidth(o)}t+=this.wcwidth(n)}return t},e}();t.UnicodeService=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;var i,n=r(15),o=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],s=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],a=function(){function e(){if(this.version="6",!i){i=new Uint8Array(65536),n.fill(i,1),i[0]=0,n.fill(i,0,1,32),n.fill(i,0,127,160),n.fill(i,2,4352,4448),i[9001]=2,i[9002]=2,n.fill(i,2,11904,42192),i[12351]=1,n.fill(i,2,44032,55204),n.fill(i,2,63744,64256),n.fill(i,2,65040,65050),n.fill(i,2,65072,65136),n.fill(i,2,65280,65377),n.fill(i,2,65504,65511);for(var e=0;e<o.length;++e)n.fill(i,0,o[e][0],o[e][1]+1)}}return e.prototype.wcwidth=function(e){return e<32?0:e<127?1:e<65536?i[e]:function(e,t){var r,i=0,n=t.length-1;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=i;)if(e>t[r=i+n>>1][1])i=r+1;else{if(!(e<t[r][0]))return!0;n=r-1}return!1}(e,s)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1},e}();t.UnicodeV6=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0;var i=function(){function e(){this.glevel=0,this._charsets=[]}return e.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},e.prototype.setgLevel=function(e){this.glevel=e,this.charset=this._charsets[e]},e.prototype.setgCharset=function(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)},e}();t.CharsetService=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;var i=r(3);t.updateWindowsModeWrappedState=function(e){var t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1),r=null==t?void 0:t.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&r&&(n.isWrapped=r[i.CHAR_DATA_CODE_INDEX]!==i.NULL_CELL_CODE&&r[i.CHAR_DATA_CODE_INDEX]!==i.WHITESPACE_CELL_CODE)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;var i=function(){function e(e){this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return e.prototype.writeSync=function(e){if(this._writeBuffer.length){for(var t=this._bufferOffset;t<this._writeBuffer.length;++t){var r=this._writeBuffer[t],i=this._callbacks[t];this._action(r),i&&i()}this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=2147483647}this._action(e)},e.prototype.write=function(e,t){var r=this;if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout((function(){return r._innerWrite()}))),this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)},e.prototype._innerWrite=function(){for(var e=this,t=Date.now();this._writeBuffer.length>this._bufferOffset;){var r=this._writeBuffer[this._bufferOffset],i=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(r),this._pendingData-=r.length,i&&i(),Date.now()-t>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((function(){return e._innerWrite()}),0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},e}();t.WriteBuffer=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0;var i=function(){function e(){this._addons=[]}return e.prototype.dispose=function(){for(var e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()},e.prototype.loadAddon=function(e,t){var r=this,i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=function(){return r._wrappedAddonDispose(i)},t.activate(e)},e.prototype._wrappedAddonDispose=function(e){if(!e.isDisposed){for(var t=-1,r=0;r<this._addons.length;r++)if(this._addons[r]===e){t=r;break}if(-1===t)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},e}();t.AddonManager=i}])}}]);