@runeya/runeya
Version:
Monitor processes as a stack
5 lines (4 loc) • 400 kB
JavaScript
import{r as oe,c as Te,j as Ze,Y as Qe,a as pe,o as ve,b as Q,e as we,g as ye,s as je,f as he,m as Ee,v as Be,d as ce,aK as Pe,F as Oe,q as qe,n as et,t as ke,a1 as Ie,p as tt}from"./index-CXxIspfv.js";import{a as He,n as le}from"./router-CdfdQZKk.js";import{M as Le}from"./Modal-DfzlogP3.js";import{_ as Fe}from"./Section-D0z9MjV4.js";import{T as Me}from"./Theme-B97b3UpJ.js";import{u as it}from"./currentEditor-D3XVS39E.js";import{_ as st}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./Editor-B--wgkn6.js";/* empty css */import"./_baseFor-DiPelG4M.js";var We={exports:{}},Ke;function rt(){return Ke||(Ke=1,function(ue,V){(function(_e,se){ue.exports=se()})(self,()=>(()=>{var _e={4567:function(B,r,o){var d=this&&this.__decorate||function(i,c,u,f){var m,h=arguments.length,p=h<3?c:f===null?f=Object.getOwnPropertyDescriptor(c,u):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,c,u,f);else for(var y=i.length-1;y>=0;y--)(m=i[y])&&(p=(h<3?m(p):h>3?m(c,u,p):m(c,u))||p);return h>3&&p&&Object.defineProperty(c,u,p),p},v=this&&this.__param||function(i,c){return function(u,f){c(u,f,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=o(9042),l=o(6114),_=o(9924),g=o(844),a=o(5596),e=o(4725),s=o(3656);let t=r.AccessibilityManager=class extends g.Disposable{constructor(i,c){super(),this._terminal=i,this._renderService=c,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let u=0;u<this._terminal.rows;u++)this._rowElements[u]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[u]);if(this._topBoundaryFocusListener=u=>this._handleBoundaryFocus(u,0),this._bottomBoundaryFocusListener=u=>this._handleBoundaryFocus(u,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(u=>this._handleResize(u.rows))),this.register(this._terminal.onRender(u=>this._refreshRows(u.start,u.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(u=>this._handleChar(u))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
`))),this.register(this._terminal.onA11yTab(u=>this._handleTab(u))),this.register(this._terminal.onKey(u=>this._handleKey(u.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new a.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,s.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,g.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(i){for(let c=0;c<i;c++)this._handleChar(" ")}_handleChar(i){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==i&&(this._charsToAnnounce+=i):this._charsToAnnounce+=i,i===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)),l.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,l.isMac&&this._liveRegion.remove()}_handleKey(i){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(i)||this._charsToConsume.push(i)}_refreshRows(i,c){this._liveRegionDebouncer.refresh(i,c,this._terminal.rows)}_renderRows(i,c){const u=this._terminal.buffer,f=u.lines.length.toString();for(let m=i;m<=c;m++){const h=u.translateBufferLineToString(u.ydisp+m,!0),p=(u.ydisp+m+1).toString(),y=this._rowElements[m];y&&(h.length===0?y.innerText=" ":y.textContent=h,y.setAttribute("aria-posinset",p),y.setAttribute("aria-setsize",f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(i,c){const u=i.target,f=this._rowElements[c===0?1:this._rowElements.length-2];if(u.getAttribute("aria-posinset")===(c===0?"1":`${this._terminal.buffer.lines.length}`)||i.relatedTarget!==f)return;let m,h;if(c===0?(m=u,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(m=this._rowElements.shift(),h=u,this._rowContainer.removeChild(m)),m.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),c===0){const p=this._createAccessibilityTreeNode();this._rowElements.unshift(p),this._rowContainer.insertAdjacentElement("afterbegin",p)}else{const p=this._createAccessibilityTreeNode();this._rowElements.push(p),this._rowContainer.appendChild(p)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(c===0?-1:1),this._rowElements[c===0?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}_handleResize(i){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let c=this._rowContainer.children.length;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const i=document.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let i=0;i<this._terminal.rows;i++)this._refreshRowDimensions(this._rowElements[i])}}_refreshRowDimensions(i){i.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=t=d([v(1,e.IRenderService)],t)},3614:(B,r)=>{function o(l){return l.replace(/\r?\n/g,"\r")}function d(l,_){return _?"\x1B[200~"+l+"\x1B[201~":l}function v(l,_,g,a){l=d(l=o(l),g.decPrivateModes.bracketedPasteMode&&a.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(l,!0),_.value=""}function n(l,_,g){const a=g.getBoundingClientRect(),e=l.clientX-a.left-10,s=l.clientY-a.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${e}px`,_.style.top=`${s}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=o,r.bracketTextForPaste=d,r.copyHandler=function(l,_){l.clipboardData&&l.clipboardData.setData("text/plain",_.selectionText),l.preventDefault()},r.handlePasteEvent=function(l,_,g,a){l.stopPropagation(),l.clipboardData&&v(l.clipboardData.getData("text/plain"),_,g,a)},r.paste=v,r.moveTextAreaUnderMouseCursor=n,r.rightClickHandler=function(l,_,g,a,e){n(l,_,g),e&&a.rightClickSelect(l),_.value=a.selectionText,_.select()}},7239:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const d=o(1505);r.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(v,n,l){this._css.set(v,n,l)}getCss(v,n){return this._css.get(v,n)}setColor(v,n,l){this._color.set(v,n,l)}getColor(v,n){return this._color.get(v,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(o,d,v,n){o.addEventListener(d,v,n);let l=!1;return{dispose:()=>{l||(l=!0,o.removeEventListener(d,v,n))}}}},6465:function(B,r,o){var d=this&&this.__decorate||function(e,s,t,i){var c,u=arguments.length,f=u<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(c=e[m])&&(f=(u<3?c(f):u>3?c(s,t,f):c(s,t))||f);return u>3&&f&&Object.defineProperty(s,t,f),f},v=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier2=void 0;const n=o(3656),l=o(8460),_=o(844),g=o(2585);let a=r.Linkifier2=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new l.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new l.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const s=this._linkProviders.indexOf(e);s!==-1&&this._linkProviders.splice(s,1)}}}attachToDom(e,s,t){this._element=e,this._mouseService=s,this._renderService=t,this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;const s=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const t=e.composedPath();for(let i=0;i<t.length;i++){const c=t[i];if(c.classList.contains("xterm"))break;if(c.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,s){var t,i;this._activeProviderReplies&&s||((t=this._activeProviderReplies)===null||t===void 0||t.forEach(u=>{u==null||u.forEach(f=>{f.link.dispose&&f.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let c=!1;for(const[u,f]of this._linkProviders.entries())s?!((i=this._activeProviderReplies)===null||i===void 0)&&i.get(u)&&(c=this._checkLinkProviderResult(u,e,c)):f.provideLinks(e.y,m=>{var h,p;if(this._isMouseOut)return;const y=m==null?void 0:m.map(C=>({link:C}));(h=this._activeProviderReplies)===null||h===void 0||h.set(u,y),c=this._checkLinkProviderResult(u,e,c),((p=this._activeProviderReplies)===null||p===void 0?void 0:p.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,s){const t=new Set;for(let i=0;i<s.size;i++){const c=s.get(i);if(c)for(let u=0;u<c.length;u++){const f=c[u],m=f.link.range.start.y<e?0:f.link.range.start.x,h=f.link.range.end.y>e?this._bufferService.cols:f.link.range.end.x;for(let p=m;p<=h;p++){if(t.has(p)){c.splice(u--,1);break}t.add(p)}}}}_checkLinkProviderResult(e,s,t){var i;if(!this._activeProviderReplies)return t;const c=this._activeProviderReplies.get(e);let u=!1;for(let f=0;f<e;f++)this._activeProviderReplies.has(f)&&!this._activeProviderReplies.get(f)||(u=!0);if(!u&&c){const f=c.find(m=>this._linkAtPosition(m.link,s));f&&(t=!0,this._handleNewLink(f))}if(this._activeProviderReplies.size===this._linkProviders.length&&!t)for(let f=0;f<this._activeProviderReplies.size;f++){const m=(i=this._activeProviderReplies.get(f))===null||i===void 0?void 0:i.find(h=>this._linkAtPosition(h.link,s));if(m){t=!0,this._handleNewLink(m);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;const s=this._positionFromMouseEvent(e,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,s){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!s||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(e.link,s)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var t,i;return(i=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.decorations.pointerCursor},set:t=>{var i,c;!((i=this._currentLink)===null||i===void 0)&&i.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&((c=this._element)===null||c===void 0||c.classList.toggle("xterm-cursor-pointer",t)))}},underline:{get:()=>{var t,i;return(i=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.decorations.underline},set:t=>{var i,c,u;!((i=this._currentLink)===null||i===void 0)&&i.state&&((u=(c=this._currentLink)===null||c===void 0?void 0:c.state)===null||u===void 0?void 0:u.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(t=>{if(!this._currentLink)return;const i=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,c=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=c&&(this._clearCurrentLink(i,c),this._lastMouseEvent&&this._element)){const u=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);u&&this._askForLink(u,!1)}})))}_linkHover(e,s,t){var i;!((i=this._currentLink)===null||i===void 0)&&i.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(t,s.text)}_fireUnderlineEvent(e,s){const t=e.range,i=this._bufferService.buffer.ydisp,c=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-i-1,t.end.x,t.end.y-i-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(c)}_linkLeave(e,s,t){var i;!((i=this._currentLink)===null||i===void 0)&&i.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(t,s.text)}_linkAtPosition(e,s){const t=e.range.start.y*this._bufferService.cols+e.range.start.x,i=e.range.end.y*this._bufferService.cols+e.range.end.x,c=s.y*this._bufferService.cols+s.x;return t<=c&&c<=i}_positionFromMouseEvent(e,s,t){const i=t.getCoords(e,s,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,s,t,i,c){return{x1:e,y1:s,x2:t,y2:i,cols:this._bufferService.cols,fg:c}}};r.Linkifier2=a=d([v(0,g.IBufferService)],a)},9042:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(B,r,o){var d=this&&this.__decorate||function(a,e,s,t){var i,c=arguments.length,u=c<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,s):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(a,e,s,t);else for(var f=a.length-1;f>=0;f--)(i=a[f])&&(u=(c<3?i(u):c>3?i(e,s,u):i(e,s))||u);return c>3&&u&&Object.defineProperty(e,s,u),u},v=this&&this.__param||function(a,e){return function(s,t){e(s,t,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const n=o(511),l=o(2585);let _=r.OscLinkProvider=class{constructor(a,e,s){this._bufferService=a,this._optionsService=e,this._oscLinkService=s}provideLinks(a,e){var s;const t=this._bufferService.buffer.lines.get(a-1);if(!t)return void e(void 0);const i=[],c=this._optionsService.rawOptions.linkHandler,u=new n.CellData,f=t.getTrimmedLength();let m=-1,h=-1,p=!1;for(let y=0;y<f;y++)if(h!==-1||t.hasContent(y)){if(t.loadCell(y,u),u.hasExtendedAttrs()&&u.extended.urlId){if(h===-1){h=y,m=u.extended.urlId;continue}p=u.extended.urlId!==m}else h!==-1&&(p=!0);if(p||h!==-1&&y===f-1){const C=(s=this._oscLinkService.getLinkData(m))===null||s===void 0?void 0:s.uri;if(C){const S={start:{x:h+1,y:a},end:{x:y+(p||y!==f-1?0:1),y:a}};let L=!1;if(!(c!=null&&c.allowNonHttpProtocols))try{const k=new URL(C);["http:","https:"].includes(k.protocol)||(L=!0)}catch{L=!0}L||i.push({text:C,range:S,activate:(k,A)=>c?c.activate(k,A,S):g(0,A),hover:(k,A)=>{var M;return(M=c==null?void 0:c.hover)===null||M===void 0?void 0:M.call(c,k,A,S)},leave:(k,A)=>{var M;return(M=c==null?void 0:c.leave)===null||M===void 0?void 0:M.call(c,k,A,S)}})}p=!1,u.hasExtendedAttrs()&&u.extended.urlId?(h=y,m=u.extended.urlId):(h=-1,m=-1)}}e(i)}};function g(a,e){if(confirm(`Do you want to navigate to ${e}?
WARNING: This link could potentially be dangerous`)){const s=window.open();if(s){try{s.opener=null}catch{}s.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=_=d([v(0,l.IBufferService),v(1,l.IOptionsService),v(2,l.IOscLinkService)],_)},6193:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(o,d){this._parentWindow=o,this._renderCallback=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,d,v){this._rowCount=v,o=o!==void 0?o:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const o=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},5596:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ScreenDprMonitor=void 0;const d=o(844);class v extends d.Disposable{constructor(l){super(),this._parentWindow=l,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,d.toDisposable)(()=>{this.clearListener()}))}setListener(l){this._listener&&this.clearListener(),this._listener=l,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var l;this._outerListener&&((l=this._resolutionMediaMatchList)===null||l===void 0||l.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}r.ScreenDprMonitor=v},3236:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const d=o(3614),v=o(3656),n=o(6465),l=o(9042),_=o(3730),g=o(1680),a=o(3107),e=o(5744),s=o(2950),t=o(1296),i=o(428),c=o(4269),u=o(5114),f=o(8934),m=o(3230),h=o(9312),p=o(4725),y=o(6731),C=o(8055),S=o(8969),L=o(8460),k=o(844),A=o(6114),M=o(8437),T=o(2584),b=o(7399),x=o(5941),E=o(9074),R=o(2585),O=o(5435),W=o(4567),$=typeof window<"u"?window.document:null;class P extends S.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(w={}){super(w),this.browser=A,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new k.MutableDisposable),this._onCursorMove=this.register(new L.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new L.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new L.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new L.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new L.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new L.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new L.EventEmitter),this._onBlur=this.register(new L.EventEmitter),this._onA11yCharEmitter=this.register(new L.EventEmitter),this._onA11yTabEmitter=this.register(new L.EventEmitter),this._onWillOpen=this.register(new L.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(n.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(E.DecorationService),this._instantiationService.setService(R.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((D,I)=>this.refresh(D,I))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(D=>this._reportWindowsOptions(D))),this.register(this._inputHandler.onColor(D=>this._handleColorEvent(D))),this.register((0,L.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,L.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(D=>this._afterResize(D.cols,D.rows))),this.register((0,k.toDisposable)(()=>{var D,I;this._customKeyEventHandler=void 0,(I=(D=this.element)===null||D===void 0?void 0:D.parentNode)===null||I===void 0||I.removeChild(this.element)}))}_handleColorEvent(w){if(this._themeService)for(const D of w){let I,H="";switch(D.index){case 256:I="foreground",H="10";break;case 257:I="background",H="11";break;case 258:I="cursor",H="12";break;default:I="ansi",H="4;"+D.index}switch(D.type){case 0:const z=C.color.toColorRGB(I==="ansi"?this._themeService.colors.ansi[D.index]:this._themeService.colors[I]);this.coreService.triggerDataEvent(`${T.C0.ESC}]${H};${(0,x.toRgbString)(z)}${T.C1_ESCAPED.ST}`);break;case 1:if(I==="ansi")this._themeService.modifyColors(U=>U.ansi[D.index]=C.rgba.toColor(...D.color));else{const U=I;this._themeService.modifyColors(ee=>ee[U]=C.rgba.toColor(...D.color))}break;case 2:this._themeService.restoreColor(D.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(w){w?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(w){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(T.C0.ESC+"[I"),this.updateCursorStyle(w),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var w;return(w=this.textarea)===null||w===void 0?void 0:w.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(T.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const w=this.buffer.ybase+this.buffer.y,D=this.buffer.lines.get(w);if(!D)return;const I=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,z=D.getWidth(I),U=this._renderService.dimensions.css.cell.width*z,ee=this.buffer.y*this._renderService.dimensions.css.cell.height,re=I*this._renderService.dimensions.css.cell.width;this.textarea.style.left=re+"px",this.textarea.style.top=ee+"px",this.textarea.style.width=U+"px",this.textarea.style.height=H+"px",this.textarea.style.lineHeight=H+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",D=>{this.hasSelection()&&(0,d.copyHandler)(D,this._selectionService)}));const w=D=>(0,d.handlePasteEvent)(D,this.textarea,this.coreService,this.optionsService);this.register((0,v.addDisposableDomListener)(this.textarea,"paste",w)),this.register((0,v.addDisposableDomListener)(this.element,"paste",w)),A.isFirefox?this.register((0,v.addDisposableDomListener)(this.element,"mousedown",D=>{D.button===2&&(0,d.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",D=>{(0,d.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),A.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",D=>{D.button===1&&(0,d.moveTextAreaUnderMouseCursor)(D,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,v.addDisposableDomListener)(this.textarea,"keyup",w=>this._keyUp(w),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keydown",w=>this._keyDown(w),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keypress",w=>this._keyPress(w),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionupdate",w=>this._compositionHelper.compositionupdate(w))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,v.addDisposableDomListener)(this.textarea,"input",w=>this._inputEvent(w),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(w){var D;if(!w)throw new Error("Terminal requires a parent element.");w.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=w.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),w.appendChild(this.element);const I=$.createDocumentFragment();this._viewportElement=$.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),I.appendChild(this._viewportElement),this._viewportScrollArea=$.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=$.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=$.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),I.appendChild(this.screenElement),this.textarea=$.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",l.promptLabel),A.isChromeOS||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._coreBrowserService=this._instantiationService.createInstance(u.CoreBrowserService,this.textarea,(D=this._document.defaultView)!==null&&D!==void 0?D:window),this._instantiationService.setService(p.ICoreBrowserService,this._coreBrowserService),this.register((0,v.addDisposableDomListener)(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this.register((0,v.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(i.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(p.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(y.ThemeService),this._instantiationService.setService(p.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(c.CharacterJoinerService),this._instantiationService.setService(p.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(m.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(p.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(H=>this._onRender.fire(H))),this.onResize(H=>this._renderService.resize(H.cols,H.rows)),this._compositionView=$.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(I);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(f.MouseService),this._instantiationService.setService(p.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(g.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(h.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(p.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(H=>this._renderService.handleSelectionChanged(H.start,H.end,H.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(H=>{this.textarea.value=H,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(H=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,v.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(a.BufferDecorationRenderer,this.screenElement)),this.register((0,v.addDisposableDomListener)(this.element,"mousedown",H=>this._selectionService.handleMouseDown(H))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(t.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const w=this,D=this.element;function I(U){const ee=w._mouseService.getMouseReportCoords(U,w.screenElement);if(!ee)return!1;let re,ne;switch(U.overrideType||U.type){case"mousemove":ne=32,U.buttons===void 0?(re=3,U.button!==void 0&&(re=U.button<3?U.button:3)):re=1&U.buttons?0:4&U.buttons?1:2&U.buttons?2:3;break;case"mouseup":ne=0,re=U.button<3?U.button:3;break;case"mousedown":ne=1,re=U.button<3?U.button:3;break;case"wheel":if(w.viewport.getLinesScrolled(U)===0)return!1;ne=U.deltaY<0?0:1,re=4;break;default:return!1}return!(ne===void 0||re===void 0||re>4)&&w.coreMouseService.triggerMouseEvent({col:ee.col,row:ee.row,x:ee.x,y:ee.y,button:re,action:ne,ctrl:U.ctrlKey,alt:U.altKey,shift:U.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},z={mouseup:U=>(I(U),U.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(U)),wheel:U=>(I(U),this.cancel(U,!0)),mousedrag:U=>{U.buttons&&I(U)},mousemove:U=>{U.buttons||I(U)}};this.register(this.coreMouseService.onProtocolChange(U=>{U?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(U)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&U?H.mousemove||(D.addEventListener("mousemove",z.mousemove),H.mousemove=z.mousemove):(D.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&U?H.wheel||(D.addEventListener("wheel",z.wheel,{passive:!1}),H.wheel=z.wheel):(D.removeEventListener("wheel",H.wheel),H.wheel=null),2&U?H.mouseup||(D.addEventListener("mouseup",z.mouseup),H.mouseup=z.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),D.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&U?H.mousedrag||(H.mousedrag=z.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)(D,"mousedown",U=>{if(U.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(U))return I(U),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(U)})),this.register((0,v.addDisposableDomListener)(D,"wheel",U=>{if(!H.wheel){if(!this.buffer.hasScrollback){const ee=this.viewport.getLinesScrolled(U);if(ee===0)return;const re=T.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(U.deltaY<0?"A":"B");let ne="";for(let Z=0;Z<Math.abs(ee);Z++)ne+=re;return this.coreService.triggerDataEvent(ne,!0),this.cancel(U,!0)}return this.viewport.handleWheel(U)?this.cancel(U):void 0}},{passive:!1})),this.register((0,v.addDisposableDomListener)(D,"touchstart",U=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(U),this.cancel(U)},{passive:!0})),this.register((0,v.addDisposableDomListener)(D,"touchmove",U=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(U)?void 0:this.cancel(U)},{passive:!1}))}refresh(w,D){var I;(I=this._renderService)===null||I===void 0||I.refreshRows(w,D)}updateCursorStyle(w){var D;!((D=this._selectionService)===null||D===void 0)&&D.shouldColumnSelect(w)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(w,D,I=0){var H;I===1?(super.scrollLines(w,D,I),this.refresh(0,this.rows-1)):(H=this.viewport)===null||H===void 0||H.scrollLines(w)}paste(w){(0,d.paste)(w,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(w){this._customKeyEventHandler=w}registerLinkProvider(w){return this.linkifier2.registerLinkProvider(w)}registerCharacterJoiner(w){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const D=this._characterJoinerService.register(w);return this.refresh(0,this.rows-1),D}deregisterCharacterJoiner(w){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(w)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(w){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+w)}registerDecoration(w){return this._decorationService.registerDecoration(w)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(w,D,I){this._selectionService.setSelection(w,D,I)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var w;(w=this._selectionService)===null||w===void 0||w.clearSelection()}selectAll(){var w;(w=this._selectionService)===null||w===void 0||w.selectAll()}selectLines(w,D){var I;(I=this._selectionService)===null||I===void 0||I.selectLines(w,D)}_keyDown(w){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(w)===!1)return!1;const D=this.browser.isMac&&this.options.macOptionIsMeta&&w.altKey;if(!D&&!this._compositionHelper.keydown(w))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;D||w.key!=="Dead"&&w.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const I=(0,b.evaluateKeyboardEvent)(w,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(w),I.type===3||I.type===2){const H=this.rows-1;return this.scrollLines(I.type===2?-H:H),this.cancel(w,!0)}return I.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,w)||(I.cancel&&this.cancel(w,!0),!I.key||!!(w.key&&!w.ctrlKey&&!w.altKey&&!w.metaKey&&w.key.length===1&&w.key.charCodeAt(0)>=65&&w.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(I.key!==T.C0.ETX&&I.key!==T.C0.CR||(this.textarea.value=""),this._onKey.fire({key:I.key,domEvent:w}),this._showCursor(),this.coreService.triggerDataEvent(I.key,!0),!this.optionsService.rawOptions.screenReaderMode||w.altKey||w.ctrlKey?this.cancel(w,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(w,D){const I=w.isMac&&!this.options.macOptionIsMeta&&D.altKey&&!D.ctrlKey&&!D.metaKey||w.isWindows&&D.altKey&&D.ctrlKey&&!D.metaKey||w.isWindows&&D.getModifierState("AltGraph");return D.type==="keypress"?I:I&&(!D.keyCode||D.keyCode>47)}_keyUp(w){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(w)===!1||(function(D){return D.keyCode===16||D.keyCode===17||D.keyCode===18}(w)||this.focus(),this.updateCursorStyle(w),this._keyPressHandled=!1)}_keyPress(w){let D;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(w)===!1)return!1;if(this.cancel(w),w.charCode)D=w.charCode;else if(w.which===null||w.which===void 0)D=w.keyCode;else{if(w.which===0||w.charCode===0)return!1;D=w.which}return!(!D||(w.altKey||w.ctrlKey||w.metaKey)&&!this._isThirdLevelShift(this.browser,w)||(D=String.fromCharCode(D),this._onKey.fire({key:D,domEvent:w}),this._showCursor(),this.coreService.triggerDataEvent(D,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(w){if(w.data&&w.inputType==="insertText"&&(!w.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const D=w.data;return this.coreService.triggerDataEvent(D,!0),this.cancel(w),!0}return!1}resize(w,D){w!==this.cols||D!==this.rows?super.resize(w,D):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(w,D){var I,H;(I=this._charSizeService)===null||I===void 0||I.measure(),(H=this.viewport)===null||H===void 0||H.syncScrollArea(!0)}clear(){var w;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),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(let D=1;D<this.rows;D++)this.buffer.lines.push(this.buffer.getBlankLine(M.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(w=this.viewport)===null||w===void 0||w.reset(),this.refresh(0,this.rows-1)}}reset(){var w,D;this.options.rows=this.rows,this.options.cols=this.cols;const I=this._customKeyEventHandler;this._setup(),super.reset(),(w=this._selectionService)===null||w===void 0||w.reset(),this._decorationService.reset(),(D=this.viewport)===null||D===void 0||D.reset(),this._customKeyEventHandler=I,this.refresh(0,this.rows-1)}clearTextureAtlas(){var w;(w=this._renderService)===null||w===void 0||w.clearTextureAtlas()}_reportFocus(){var w;!((w=this.element)===null||w===void 0)&&w.classList.contains("focus")?this.coreService.triggerDataEvent(T.C0.ESC+"[I"):this.coreService.triggerDataEvent(T.C0.ESC+"[O")}_reportWindowsOptions(w){if(this._renderService)switch(w){case O.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const D=this._renderService.dimensions.css.canvas.width.toFixed(0),I=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${T.C0.ESC}[4;${I};${D}t`);break;case O.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const H=this._renderService.dimensions.css.cell.width.toFixed(0),z=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${T.C0.ESC}[6;${z};${H}t`)}}cancel(w,D){if(this.options.cancelEvents||D)return w.preventDefault(),w.stopPropagation(),!1}}r.Terminal=P},9924:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(o,d=1e3){this._renderCallback=o,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,d,v){this._rowCount=v,o=o!==void 0?o:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const n=Date.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){const l=n-this._lastRefreshMs,_=this._debounceThresholdMS-l;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,d)}}},1680:function(B,r,o){var d=this&&this.__decorate||function(s,t,i,c){var u,f=arguments.length,m=f<3?t:c===null?c=Object.getOwnPropertyDescriptor(t,i):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,t,i,c);else for(var h=s.length-1;h>=0;h--)(u=s[h])&&(m=(f<3?u(m):f>3?u(t,i,m):u(t,i))||m);return f>3&&m&&Object.defineProperty(t,i,m),m},v=this&&this.__param||function(s,t){return function(i,c){t(i,c,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const n=o(3656),l=o(4725),_=o(8460),g=o(844),a=o(2585);let e=r.Viewport=class extends g.Disposable{constructor(s,t,i,c,u,f,m,h){super(),this._viewportElement=s,this._scrollArea=t,this._bufferService=i,this._optionsService=c,this._charSizeService=u,this._renderService=f,this._coreBrowserService=m,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(p=>this._activeBuffer=p.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(p=>this._renderDimensions=p)),this._handleThemeChange(h.colors),this.register(h.onChangeColors(p=>this._handleThemeChange(p))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(s){this._viewportElement.style.backgroundColor=s.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(s){if(s)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&