@haxtheweb/haxcms-nodejs
Version:
HAXcms single and multisite nodejs server, api, and administration
1 lines • 492 kB
JavaScript
!function(N,j){if("object"==typeof exports&&"object"==typeof module)module.exports=j();else if("function"==typeof define&&define.amd)define([],j);else{var X=j();for(var ie in X)("object"==typeof exports?exports:N)[ie]=X[ie]}}(globalThis,(()=>(()=>{var N={2840:function(N,j,X){var ie=this&&this.__decorate||function(N,j,X,ie){var se,le=arguments.length,he=le<3?j:null===ie?ie=Object.getOwnPropertyDescriptor(j,X):ie;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)he=Reflect.decorate(N,j,X,ie);else for(var ce=N.length-1;ce>=0;ce--)(se=N[ce])&&(he=(le<3?se(he):le>3?se(j,X,he):se(j,X))||he);return le>3&&he&&Object.defineProperty(j,X,he),he},se=this&&this.__param||function(N,j){return function(X,ie){j(X,ie,N)}};Object.defineProperty(j,"__esModule",{value:!0}),j.AccessibilityManager=void 0;const le=X(7721),he=X(4292),ce=X(7150),_e=X(7098),me=X(6501),ve=X(7093);let Se=class extends ce.Disposable{constructor(N,j,X,ie){super(),this._terminal=N,this._coreBrowserService=X,this._renderService=ie,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";const se=this._coreBrowserService.mainDocument;this._accessibilityContainer=se.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=se.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;N<this._terminal.rows;N++)this._rowElements[N]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[N]);if(this._topBoundaryFocusListener=N=>this._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=se.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new he.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((N=>this._handleResize(N.rows)))),this._register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this._register(this._terminal.onScroll((()=>this._refreshRows()))),this._register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this._register(this._terminal.onLineFeed((()=>this._handleChar("\n")))),this._register(this._terminal.onA11yTab((N=>this._handleTab(N)))),this._register(this._terminal.onKey((N=>this._handleKey(N.key)))),this._register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this._register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this._register((0,ve.addDisposableListener)(se,"selectionchange",(()=>this._handleSelectionChange()))),this._register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRowsDimensions(),this._refreshRows(),this._register((0,ce.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(N){for(let j=0;j<N;j++)this._handleChar(" ")}_handleChar(N){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==N&&(this._charsToAnnounce+=N):this._charsToAnnounce+=N,"\n"===N&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=le.tooMuchOutput.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(N){this._clearLiveRegion(),/\p{Control}/u.test(N)||this._charsToConsume.push(N)}_refreshRows(N,j){this._liveRegionDebouncer.refresh(N,j,this._terminal.rows)}_renderRows(N,j){const X=this._terminal.buffer,ie=X.lines.length.toString();for(let se=N;se<=j;se++){const N=X.lines.get(X.ydisp+se),j=[],le=N?.translateToString(!0,void 0,void 0,j)||"",he=(X.ydisp+se+1).toString(),ce=this._rowElements[se];ce&&(0===le.length?(ce.innerText=" ",this._rowColumns.set(ce,[0,1])):(ce.textContent=le,this._rowColumns.set(ce,j)),ce.setAttribute("aria-posinset",he),ce.setAttribute("aria-setsize",ie),this._alignRowWidth(ce))}this._announceCharacters()}_announceCharacters(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(N,j){const X=N.target,ie=this._rowElements[0===j?1:this._rowElements.length-2];if(X.getAttribute("aria-posinset")===(0===j?"1":`${this._terminal.buffer.lines.length}`))return;if(N.relatedTarget!==ie)return;let se,le;if(0===j?(se=X,le=this._rowElements.pop(),this._rowContainer.removeChild(le)):(se=this._rowElements.shift(),le=X,this._rowContainer.removeChild(se)),se.removeEventListener("focus",this._topBoundaryFocusListener),le.removeEventListener("focus",this._bottomBoundaryFocusListener),0===j){const N=this._createAccessibilityTreeNode();this._rowElements.unshift(N),this._rowContainer.insertAdjacentElement("afterbegin",N)}else{const N=this._createAccessibilityTreeNode();this._rowElements.push(N),this._rowContainer.appendChild(N)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===j?-1:1),this._rowElements[0===j?1:this._rowElements.length-2].focus(),N.preventDefault(),N.stopImmediatePropagation()}_handleSelectionChange(){if(0===this._rowElements.length)return;const N=this._coreBrowserService.mainDocument.getSelection();if(!N)return;if(N.isCollapsed)return void(this._rowContainer.contains(N.anchorNode)&&this._terminal.clearSelection());if(!N.anchorNode||!N.focusNode)return void console.error("anchorNode and/or focusNode are null");let j={node:N.anchorNode,offset:N.anchorOffset},X={node:N.focusNode,offset:N.focusOffset};if((j.node.compareDocumentPosition(X.node)&Node.DOCUMENT_POSITION_PRECEDING||j.node===X.node&&j.offset>X.offset)&&([j,X]=[X,j]),j.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(j={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(j.node))return;const ie=this._rowElements.slice(-1)[0];if(X.node.compareDocumentPosition(ie)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(X={node:ie,offset:ie.textContent?.length??0}),!this._rowContainer.contains(X.node))return;const r=({node:N,offset:j})=>{const X=N instanceof Text?N.parentNode:N;let ie=parseInt(X?.getAttribute("aria-posinset"),10)-1;if(isNaN(ie))return console.warn("row is invalid. Race condition?"),null;const se=this._rowColumns.get(X);if(!se)return console.warn("columns is null. Race condition?"),null;let le=j<se.length?se[j]:se.slice(-1)[0]+1;return le>=this._terminal.cols&&(++ie,le=0),{row:ie,column:le}},se=r(j),le=r(X);if(se&&le){if(se.row>le.row||se.row===le.row&&se.column>=le.column)throw new Error("invalid range");this._terminal.select(se.column,se.row,(le.row-se.row)*this._terminal.cols-se.column+le.column)}}_handleResize(N){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let N=this._rowContainer.children.length;N<this._terminal.rows;N++)this._rowElements[N]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[N]);for(;this._rowElements.length>N;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const N=this._coreBrowserService.mainDocument.createElement("div");return N.setAttribute("role","listitem"),N.tabIndex=-1,this._refreshRowDimensions(N),N}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let N=0;N<this._terminal.rows;N++)this._refreshRowDimensions(this._rowElements[N]),this._alignRowWidth(this._rowElements[N])}}_refreshRowDimensions(N){N.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(N){N.style.transform="";const j=N.getBoundingClientRect().width,X=this._rowColumns.get(N)?.slice(-1)?.[0];if(!X)return;const ie=X*this._renderService.dimensions.css.cell.width;N.style.transform=`scaleX(${ie/j})`}};j.AccessibilityManager=Se,j.AccessibilityManager=Se=ie([se(1,me.IInstantiationService),se(2,_e.ICoreBrowserService),se(3,_e.IRenderService)],Se)},7861:(N,j)=>{function i(N){return N.replace(/\r?\n/g,"\r")}function s(N,j){return j?"[200~"+N+"[201~":N}function r(N,j,X,ie){N=s(N=i(N),X.decPrivateModes.bracketedPasteMode&&!0!==ie.rawOptions.ignoreBracketedPasteMode),X.triggerDataEvent(N,!0),j.value=""}function n(N,j,X){const ie=X.getBoundingClientRect(),se=N.clientX-ie.left-10,le=N.clientY-ie.top-10;j.style.width="20px",j.style.height="20px",j.style.left=`${se}px`,j.style.top=`${le}px`,j.style.zIndex="1000",j.focus()}Object.defineProperty(j,"__esModule",{value:!0}),j.prepareTextForTerminal=i,j.bracketTextForPaste=s,j.copyHandler=function(N,j){N.clipboardData&&N.clipboardData.setData("text/plain",j.selectionText),N.preventDefault()},j.handlePasteEvent=function(N,j,X,ie){N.stopPropagation(),N.clipboardData&&r(N.clipboardData.getData("text/plain"),j,X,ie)},j.paste=r,j.moveTextAreaUnderMouseCursor=n,j.rightClickHandler=function(N,j,X,ie,se){n(N,j,X),se&&ie.rightClickSelect(N),j.value=ie.selectionText,j.select()}},7174:(N,j,X)=>{Object.defineProperty(j,"__esModule",{value:!0}),j.ColorContrastCache=void 0;const ie=X(7710);j.ColorContrastCache=class{constructor(){this._color=new ie.TwoKeyMap,this._css=new ie.TwoKeyMap}setCss(N,j,X){this._css.set(N,j,X)}getCss(N,j){return this._css.get(N,j)}setColor(N,j,X){this._color.set(N,j,X)}getColor(N,j){return this._color.get(N,j)}clear(){this._color.clear(),this._css.clear()}}},1718:(N,j,X)=>{Object.defineProperty(j,"__esModule",{value:!0}),j.CoreBrowserTerminal=void 0;const ie=X(7861),se=X(7721),le=X(3285),he=X(4017),ce=X(4196),_e=X(9925),me=X(3618),ve=X(3955),Se=X(4792),be=X(945),Ce=X(9574),ye=X(9820),we=X(9784),Ee=X(5783),De=X(2079),Le=X(7098),Ae=X(9078),Re=X(4103),Te=X(5777),ke=X(701),Me=X(6107),Oe=X(3534),Ie=X(706),Pe=X(8693),xe=X(4720),Be=X(6501),Ne=X(2486),Ue=X(2840),Fe=X(8906),We=X(802),He=X(7093),Ke=X(7150);class x extends Te.CoreTerminal{get linkifier(){return this._linkifier.value}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(N={}){super(N),this._linkifier=this._register(new Ke.MutableDisposable),this.browser=ke,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Ke.MutableDisposable),this._onCursorMove=this._register(new We.Emitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new We.Emitter),this.onKey=this._onKey.event,this._onRender=this._register(new We.Emitter),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new We.Emitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new We.Emitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new We.Emitter),this.onBell=this._onBell.event,this._onFocus=this._register(new We.Emitter),this._onBlur=this._register(new We.Emitter),this._onA11yCharEmitter=this._register(new We.Emitter),this._onA11yTabEmitter=this._register(new We.Emitter),this._onWillOpen=this._register(new We.Emitter),this._setup(),this._decorationService=this._instantiationService.createInstance(xe.DecorationService),this._instantiationService.setService(Be.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ye.LinkProviderService),this._instantiationService.setService(Le.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(le.OscLinkProvider)),this._register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this._register(this._inputHandler.onRequestRefreshRows((N=>this.refresh(N?.start??0,N?.end??this.rows-1)))),this._register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this._register(this._inputHandler.onRequestReset((()=>this.reset()))),this._register(this._inputHandler.onRequestWindowsOptionsReport((N=>this._reportWindowsOptions(N)))),this._register(this._inputHandler.onColor((N=>this._handleColorEvent(N)))),this._register(We.Event.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(We.Event.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(We.Event.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(We.Event.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize((N=>this._afterResize(N.cols,N.rows)))),this._register((0,Ke.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(N){if(this._themeService)for(const j of N){let N,X="";switch(j.index){case 256:N="foreground",X="10";break;case 257:N="background",X="11";break;case 258:N="cursor",X="12";break;default:N="ansi",X="4;"+j.index}switch(j.type){case 0:const ie=Re.color.toColorRGB("ansi"===N?this._themeService.colors.ansi[j.index]:this._themeService.colors[N]);this.coreService.triggerDataEvent(`${Oe.C0.ESC}]${X};${(0,Pe.toRgbString)(ie)}${Oe.C1_ESCAPED.ST}`);break;case 1:if("ansi"===N)this._themeService.modifyColors((N=>N.ansi[j.index]=Re.channels.toColor(...j.color)));else{const X=N;this._themeService.modifyColors((N=>N[X]=Re.channels.toColor(...j.color)))}break;case 2:this._themeService.restoreColor(j.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(N){N?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Ue.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(N){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Oe.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Oe.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 N=this.buffer.ybase+this.buffer.y,j=this.buffer.lines.get(N);if(!j)return;const X=Math.min(this.buffer.x,this.cols-1),ie=this._renderService.dimensions.css.cell.height,se=j.getWidth(X),le=this._renderService.dimensions.css.cell.width*se,he=this.buffer.y*this._renderService.dimensions.css.cell.height,ce=X*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ce+"px",this.textarea.style.top=he+"px",this.textarea.style.width=le+"px",this.textarea.style.height=ie+"px",this.textarea.style.lineHeight=ie+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register((0,He.addDisposableListener)(this.element,"copy",(N=>{this.hasSelection()&&(0,ie.copyHandler)(N,this._selectionService)})));const e=N=>(0,ie.handlePasteEvent)(N,this.textarea,this.coreService,this.optionsService);this._register((0,He.addDisposableListener)(this.textarea,"paste",e)),this._register((0,He.addDisposableListener)(this.element,"paste",e)),ke.isFirefox?this._register((0,He.addDisposableListener)(this.element,"mousedown",(N=>{2===N.button&&(0,ie.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this._register((0,He.addDisposableListener)(this.element,"contextmenu",(N=>{(0,ie.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ke.isLinux&&this._register((0,He.addDisposableListener)(this.element,"auxclick",(N=>{1===N.button&&(0,ie.moveTextAreaUnderMouseCursor)(N,this.textarea,this.screenElement)})))}_bindKeys(){this._register((0,He.addDisposableListener)(this.textarea,"keyup",(N=>this._keyUp(N)),!0)),this._register((0,He.addDisposableListener)(this.textarea,"keydown",(N=>this._keyDown(N)),!0)),this._register((0,He.addDisposableListener)(this.textarea,"keypress",(N=>this._keyPress(N)),!0)),this._register((0,He.addDisposableListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this._register((0,He.addDisposableListener)(this.textarea,"compositionupdate",(N=>this._compositionHelper.compositionupdate(N)))),this._register((0,He.addDisposableListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this._register((0,He.addDisposableListener)(this.textarea,"input",(N=>this._inputEvent(N)),!0)),this._register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(N){if(!N)throw new Error("Terminal requires a parent element.");if(N.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=N.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),N.appendChild(this.element);const j=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),j.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register((0,He.addDisposableListener)(this.screenElement,"mousemove",(N=>this.updateCursorStyle(N)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),j.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",se.promptLabel.get()),ke.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._register(this._instantiationService.createInstance(Ce.CoreBrowserService,this.textarea,N.ownerDocument.defaultView??window,this._document??"undefined"!=typeof window?window.document:null)),this._instantiationService.setService(Le.ICoreBrowserService,this._coreBrowserService),this._register((0,He.addDisposableListener)(this.textarea,"focus",(N=>this._handleTextAreaFocus(N)))),this._register((0,He.addDisposableListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Se.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(Le.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(Ae.ThemeService),this._instantiationService.setService(Le.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(be.CharacterJoinerService),this._instantiationService.setService(Le.ICharacterJoinerService,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Ee.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(Le.IRenderService,this._renderService),this._register(this._renderService.onRenderedViewportChange((N=>this._onRender.fire(N)))),this.onResize((N=>this._renderService.resize(N.cols,N.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(me.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(we.MouseService),this._instantiationService.setService(Le.IMouseService,this._mouseService);const X=this._linkifier.value=this._register(this._instantiationService.createInstance(Fe.Linkifier,this.screenElement));this.element.appendChild(j);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(he.Viewport,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines((N=>{super.scrollLines(N,!1),this.refresh(0,this.rows-1)}))),this._selectionService=this._register(this._instantiationService.createInstance(De.SelectionService,this.element,this.screenElement,X)),this._instantiationService.setService(Le.ISelectionService,this._selectionService),this._register(this._selectionService.onRequestScrollLines((N=>this.scrollLines(N.amount,N.suppressScrollEvent)))),this._register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this._register(this._selectionService.onRequestRedraw((N=>this._renderService.handleSelectionChanged(N.start,N.end,N.columnSelectMode)))),this._register(this._selectionService.onLinuxMouseSelection((N=>{this.textarea.value=N,this.textarea.focus(),this.textarea.select()}))),this._register(this._onScroll.event((()=>this._selectionService.refresh()))),this._register(this._instantiationService.createInstance(ce.BufferDecorationRenderer,this.screenElement)),this._register((0,He.addDisposableListener)(this.element,"mousedown",(N=>this._selectionService.handleMouseDown(N)))),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(Ue.AccessibilityManager,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",(N=>this._handleScreenReaderModeOptionChange(N)))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(_e.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",(N=>{!this._overviewRulerRenderer&&N&&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(ve.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const N=this,j=this.element;function i(j){const X=N._mouseService.getMouseReportCoords(j,N.screenElement);if(!X)return!1;let ie,se;switch(j.overrideType||j.type){case"mousemove":se=32,void 0===j.buttons?(ie=3,void 0!==j.button&&(ie=j.button<3?j.button:3)):ie=1&j.buttons?0:4&j.buttons?1:2&j.buttons?2:3;break;case"mouseup":se=0,ie=j.button<3?j.button:3;break;case"mousedown":se=1,ie=j.button<3?j.button:3;break;case"wheel":if(N._customWheelEventHandler&&!1===N._customWheelEventHandler(j))return!1;const X=j.deltaY;if(0===X)return!1;se=X<0?0:1,ie=4;break;default:return!1}return!(void 0===se||void 0===ie||ie>4)&&N.coreMouseService.triggerMouseEvent({col:X.col,row:X.row,x:X.x,y:X.y,button:ie,action:se,ctrl:j.ctrlKey,alt:j.altKey,shift:j.shiftKey})}const X={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ie={mouseup:N=>(i(N),N.buttons||(this._document.removeEventListener("mouseup",X.mouseup),X.mousedrag&&this._document.removeEventListener("mousemove",X.mousedrag)),this.cancel(N)),wheel:N=>(i(N),this.cancel(N,!0)),mousedrag:N=>{N.buttons&&i(N)},mousemove:N=>{N.buttons||i(N)}};this._register(this.coreMouseService.onProtocolChange((N=>{N?("debug"===this.optionsService.rawOptions.logLevel&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(N)),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&N?X.mousemove||(j.addEventListener("mousemove",ie.mousemove),X.mousemove=ie.mousemove):(j.removeEventListener("mousemove",X.mousemove),X.mousemove=null),16&N?X.wheel||(j.addEventListener("wheel",ie.wheel,{passive:!1}),X.wheel=ie.wheel):(j.removeEventListener("wheel",X.wheel),X.wheel=null),2&N?X.mouseup||(X.mouseup=ie.mouseup):(this._document.removeEventListener("mouseup",X.mouseup),X.mouseup=null),4&N?X.mousedrag||(X.mousedrag=ie.mousedrag):(this._document.removeEventListener("mousemove",X.mousedrag),X.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register((0,He.addDisposableListener)(j,"mousedown",(N=>{if(N.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(N))return i(N),X.mouseup&&this._document.addEventListener("mouseup",X.mouseup),X.mousedrag&&this._document.addEventListener("mousemove",X.mousedrag),this.cancel(N)}))),this._register((0,He.addDisposableListener)(j,"wheel",(N=>{if(!X.wheel){if(this._customWheelEventHandler&&!1===this._customWheelEventHandler(N))return!1;if(!this.buffer.hasScrollback){if(0===N.deltaY)return!1;const j=Oe.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(N.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(j,!0),this.cancel(N,!0)}}}),{passive:!1}))}refresh(N,j){this._renderService?.refreshRows(N,j)}updateCursorStyle(N){this._selectionService?.shouldColumnSelect(N)?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(N,j){this._viewport?this._viewport.scrollLines(N):super.scrollLines(N,j),this.refresh(0,this.rows-1)}scrollPages(N){this.scrollLines(N*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(N){N&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(N){const j=N-this._bufferService.buffer.ydisp;0!==j&&this.scrollLines(j)}paste(N){(0,ie.paste)(N,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(N){this._customKeyEventHandler=N}attachCustomWheelEventHandler(N){this._customWheelEventHandler=N}registerLinkProvider(N){return this._linkProviderService.registerLinkProvider(N)}registerCharacterJoiner(N){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const j=this._characterJoinerService.register(N);return this.refresh(0,this.rows-1),j}deregisterCharacterJoiner(N){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(N)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(N){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+N)}registerDecoration(N){return this._decorationService.registerDecoration(N)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(N,j,X){this._selectionService.setSelection(N,j,X)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(N,j){this._selectionService?.selectLines(N,j)}_keyDown(N){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(N))return!1;const j=this.browser.isMac&&this.options.macOptionIsMeta&&N.altKey;if(!j&&!this._compositionHelper.keydown(N))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;j||"Dead"!==N.key&&"AltGraph"!==N.key||(this._unprocessedDeadKey=!0);const X=(0,Ie.evaluateKeyboardEvent)(N,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(N),3===X.type||2===X.type){const j=this.rows-1;return this.scrollLines(2===X.type?-j:j),this.cancel(N,!0)}return 1===X.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,N)||(X.cancel&&this.cancel(N,!0),!X.key||!!(N.key&&!N.ctrlKey&&!N.altKey&&!N.metaKey&&1===N.key.length&&N.key.charCodeAt(0)>=65&&N.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(X.key!==Oe.C0.ETX&&X.key!==Oe.C0.CR||(this.textarea.value=""),this._onKey.fire({key:X.key,domEvent:N}),this._showCursor(),this.coreService.triggerDataEvent(X.key,!0),!this.optionsService.rawOptions.screenReaderMode||N.altKey||N.ctrlKey?this.cancel(N,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(N,j){const X=N.isMac&&!this.options.macOptionIsMeta&&j.altKey&&!j.ctrlKey&&!j.metaKey||N.isWindows&&j.altKey&&j.ctrlKey&&!j.metaKey||N.isWindows&&j.getModifierState("AltGraph");return"keypress"===j.type?X:X&&(!j.keyCode||j.keyCode>47)}_keyUp(N){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(N)||(function(N){return 16===N.keyCode||17===N.keyCode||18===N.keyCode}(N)||this.focus(),this.updateCursorStyle(N),this._keyPressHandled=!1)}_keyPress(N){let j;if(this._keyPressHandled=!1,this._keyDownHandled)return!1;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(N))return!1;if(this.cancel(N),N.charCode)j=N.charCode;else if(null===N.which||void 0===N.which)j=N.keyCode;else{if(0===N.which||0===N.charCode)return!1;j=N.which}return!(!j||(N.altKey||N.ctrlKey||N.metaKey)&&!this._isThirdLevelShift(this.browser,N)||(j=String.fromCharCode(j),this._onKey.fire({key:j,domEvent:N}),this._showCursor(),this.coreService.triggerDataEvent(j,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(N){if(N.data&&"insertText"===N.inputType&&(!N.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const j=N.data;return this.coreService.triggerDataEvent(j,!0),this.cancel(N),!0}return!1}resize(N,j){N!==this.cols||j!==this.rows?super.resize(N,j):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(N,j){this._charSizeService?.measure()}clear(){if(0!==this.buffer.ybase||0!==this.buffer.y){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 N=1;N<this.rows;N++)this.buffer.lines.push(this.buffer.getBlankLine(Me.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const N=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=N,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(Oe.C0.ESC+"[I"):this.coreService.triggerDataEvent(Oe.C0.ESC+"[O")}_reportWindowsOptions(N){if(this._renderService)switch(N){case Ne.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const N=this._renderService.dimensions.css.canvas.width.toFixed(0),j=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Oe.C0.ESC}[4;${j};${N}t`);break;case Ne.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const X=this._renderService.dimensions.css.cell.width.toFixed(0),ie=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Oe.C0.ESC}[6;${ie};${X}t`)}}cancel(N,j){if(this.options.cancelEvents||j)return N.preventDefault(),N.stopPropagation(),!1}}j.CoreBrowserTerminal=x},8906:function(N,j,X){var ie=this&&this.__decorate||function(N,j,X,ie){var se,le=arguments.length,he=le<3?j:null===ie?ie=Object.getOwnPropertyDescriptor(j,X):ie;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)he=Reflect.decorate(N,j,X,ie);else for(var ce=N.length-1;ce>=0;ce--)(se=N[ce])&&(he=(le<3?se(he):le>3?se(j,X,he):se(j,X))||he);return le>3&&he&&Object.defineProperty(j,X,he),he},se=this&&this.__param||function(N,j){return function(X,ie){j(X,ie,N)}};Object.defineProperty(j,"__esModule",{value:!0}),j.Linkifier=void 0;const le=X(7150),he=X(6501),ce=X(7098),_e=X(802),me=X(7093);let ve=class extends le.Disposable{get currentLink(){return this._currentLink}constructor(N,j,X,ie,se){super(),this._element=N,this._mouseService=j,this._renderService=X,this._bufferService=ie,this._linkProviderService=se,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new _e.Emitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new _e.Emitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register((0,le.toDisposable)((()=>{(0,le.dispose)(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this._register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this._register((0,me.addDisposableListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this._register((0,me.addDisposableListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register((0,me.addDisposableListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register((0,me.addDisposableListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(N){this._lastMouseEvent=N;const j=this._positionFromMouseEvent(N,this._element,this._mouseService);if(!j)return;this._isMouseOut=!1;const X=N.composedPath();for(let N=0;N<X.length;N++){const j=X[N];if(j.classList.contains("xterm"))break;if(j.classList.contains("xterm-hover"))return}this._lastBufferCell&&j.x===this._lastBufferCell.x&&j.y===this._lastBufferCell.y||(this._handleHover(j),this._lastBufferCell=j)}_handleHover(N){if(this._activeLine!==N.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(N,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,N)||(this._clearCurrentLink(),this._askForLink(N,!0))}_askForLink(N,j){this._activeProviderReplies&&j||(this._activeProviderReplies?.forEach((N=>{N?.forEach((N=>{N.link.dispose&&N.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=N.y);let X=!1;for(const[ie,se]of this._linkProviderService.linkProviders.entries())if(j){const j=this._activeProviderReplies?.get(ie);j&&(X=this._checkLinkProviderResult(ie,N,X))}else se.provideLinks(N.y,(j=>{if(this._isMouseOut)return;const se=j?.map((N=>({link:N})));this._activeProviderReplies?.set(ie,se),X=this._checkLinkProviderResult(ie,N,X),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(N.y,this._activeProviderReplies)}))}_removeIntersectingLinks(N,j){const X=new Set;for(let ie=0;ie<j.size;ie++){const se=j.get(ie);if(se)for(let j=0;j<se.length;j++){const ie=se[j],le=ie.link.range.start.y<N?0:ie.link.range.start.x,he=ie.link.range.end.y>N?this._bufferService.cols:ie.link.range.end.x;for(let N=le;N<=he;N++){if(X.has(N)){se.splice(j--,1);break}X.add(N)}}}}_checkLinkProviderResult(N,j,X){if(!this._activeProviderReplies)return X;const ie=this._activeProviderReplies.get(N);let se=!1;for(let j=0;j<N;j++)this._activeProviderReplies.has(j)&&!this._activeProviderReplies.get(j)||(se=!0);if(!se&&ie){const N=ie.find((N=>this._linkAtPosition(N.link,j)));N&&(X=!0,this._handleNewLink(N))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!X)for(let N=0;N<this._activeProviderReplies.size;N++){const ie=this._activeProviderReplies.get(N)?.find((N=>this._linkAtPosition(N.link,j)));if(ie){X=!0,this._handleNewLink(ie);break}}return X}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(N){if(!this._currentLink)return;const j=this._positionFromMouseEvent(N,this._element,this._mouseService);var X,ie;j&&this._mouseDownLink&&(X=this._mouseDownLink.link,ie=this._currentLink.link,X.text===ie.text&&X.range.start.x===ie.range.start.x&&X.range.start.y===ie.range.start.y&&X.range.end.x===ie.range.end.x&&X.range.end.y===ie.range.end.y)&&this._linkAtPosition(this._currentLink.link,j)&&this._currentLink.link.activate(N,this._currentLink.link.text)}_clearCurrentLink(N,j){this._currentLink&&this._lastMouseEvent&&(!N||!j||this._currentLink.link.range.start.y>=N&&this._currentLink.link.range.end.y<=j)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,le.dispose)(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(N){if(!this._lastMouseEvent)return;const j=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);j&&this._linkAtPosition(N.link,j)&&(this._currentLink=N,this._currentLink.state={decorations:{underline:void 0===N.link.decorations||N.link.decorations.underline,pointerCursor:void 0===N.link.decorations||N.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,N.link,this._lastMouseEvent),N.link.decorations={},Object.defineProperties(N.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:N=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==N&&(this._currentLink.state.decorations.pointerCursor=N,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",N))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:j=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==j&&(this._currentLink.state.decorations.underline=j,this._currentLink.state.isHovered&&this._fireUnderlineEvent(N.link,j))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((N=>{if(!this._currentLink)return;const j=0===N.start?0:N.start+1+this._bufferService.buffer.ydisp,X=this._bufferService.buffer.ydisp+1+N.end;if(this._currentLink.link.range.start.y>=j&&this._currentLink.link.range.end.y<=X&&(this._clearCurrentLink(j,X),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(N,j,X){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(j,!0),this._currentLink.state.decorations.pointerCursor&&N.classList.add("xterm-cursor-pointer")),j.hover&&j.hover(X,j.text)}_fireUnderlineEvent(N,j){const X=N.range,ie=this._bufferService.buffer.ydisp,se=this._createLinkUnderlineEvent(X.start.x-1,X.start.y-ie-1,X.end.x,X.end.y-ie-1,void 0);(j?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(se)}_linkLeave(N,j,X){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(j,!1),this._currentLink.state.decorations.pointerCursor&&N.classList.remove("xterm-cursor-pointer")),j.leave&&j.leave(X,j.text)}_linkAtPosition(N,j){const X=N.range.start.y*this._bufferService.cols+N.range.start.x,ie=N.range.end.y*this._bufferService.cols+N.range.end.x,se=j.y*this._bufferService.cols+j.x;return X<=se&&se<=ie}_positionFromMouseEvent(N,j,X){const ie=X.getCoords(N,j,this._bufferService.cols,this._bufferService.rows);if(ie)return{x:ie[0],y:ie[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(N,j,X,ie,se){return{x1:N,y1:j,x2:X,y2:ie,cols:this._bufferService.cols,fg:se}}};j.Linkifier=ve,j.Linkifier=ve=ie([se(1,ce.IMouseService),se(2,ce.IRenderService),se(3,he.IBufferService),se(4,ce.ILinkProviderService)],ve)},7721:(N,j)=>{Object.defineProperty(j,"__esModule",{value:!0}),j.tooMuchOutput=j.promptLabel=void 0;let X="Terminal input";const ie={get:()=>X,set:N=>X=N};j.promptLabel=ie;let se="Too much output to announce, navigate to rows manually to read";const le={get:()=>se,set:N=>se=N};j.tooMuchOutput=le},3285:function(N,j,X){var ie=this&&this.__decorate||function(N,j,X,ie){var se,le=arguments.length,he=le<3?j:null===ie?ie=Object.getOwnPropertyDescriptor(j,X):ie;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)he=Reflect.decorate(N,j,X,ie);else for(var ce=N.length-1;ce>=0;ce--)(se=N[ce])&&(he=(le<3?se(he):le>3?se(j,X,he):se(j,X))||he);return le>3&&he&&Object.defineProperty(j,X,he),he},se=this&&this.__param||function(N,j){return function(X,ie){j(X,ie,N)}};Object.defineProperty(j,"__esModule",{value:!0}),j.OscLinkProvider=void 0;const le=X(3055),he=X(6501);let ce=class{constructor(N,j,X){this._bufferService=N,this._optionsService=j,this._oscLinkService=X}provideLinks(N,j){const X=this._bufferService.buffer.lines.get(N-1);if(!X)return void j(void 0);const ie=[],se=this._optionsService.rawOptions.linkHandler,he=new le.CellData,ce=X.getTrimmedLength();let _e=-1,me=-1,ve=!1;for(let j=0;j<ce;j++)if(-1!==me||X.hasContent(j)){if(X.loadCell(j,he),he.hasExtendedAttrs()&&he.extended.urlId){if(-1===me){me=j,_e=he.extended.urlId;continue}ve=he.extended.urlId!==_e}else-1!==me&&(ve=!0);if(ve||-1!==me&&j===ce-1){const X=this._oscLinkService.getLinkData(_e)?.uri;if(X){const le={start:{x:me+1,y:N},end:{x:j+(ve||j!==ce-1?0:1),y:N}};let he=!1;if(!se?.allowNonHttpProtocols)try{const N=new URL(X);["http:","https:"].includes(N.protocol)||(he=!0)}catch(N){he=!0}he||ie.push({text:X,range:le,activate:(N,j)=>se?se.activate(N,j,le):l(0,j),hover:(N,j)=>se?.hover?.(N,j,le),leave:(N,j)=>se?.leave?.(N,j,le)})}ve=!1,he.hasExtendedAttrs()&&he.extended.urlId?(me=j,_e=he.extended.urlId):(me=-1,_e=-1)}}j(ie)}};function l(N,j){if(confirm(`Do you want to navigate to ${j}?\n\nWARNING: This link could potentially be dangerous`)){const N=window.open();if(N){try{N.opener=null}catch{}N.location.href=j}else console.warn("Opening link blocked as opener could not be cleared")}}j.OscLinkProvider=ce,j.OscLinkProvider=ce=ie([se(0,he.IBufferService),se(1,he.IOptionsService),se(2,he.IOscLinkService)],ce)},4852:(N,j)=>{Object.defineProperty(j,"__esModule",{value:!0}),j.RenderDebouncer=void 0,j.RenderDebouncer=class{constructor(N,j){this._renderCallback=N,this._coreBrowserService=j,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(N){return this._refreshCallbacks.push(N),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(N,j,X){this._rowCount=X,N=void 0!==N?N:0,j=void 0!==j?j:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,N):N,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,j):j,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return void this._runRefreshCallbacks();const N=Math.max(this._rowStart,0),j=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(N,j),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const N of this._refreshCallbacks)N(0);this._refreshCallbacks=[]}}},4292:(N,j)=>{Object.defineProperty(j,"__esModule",{value:!0}),j.TimeBasedDebouncer=void 0,j.TimeBasedDebouncer=class{constructor(N,j=1e3){this._renderCallback=N,this._debounceThresholdMS=j,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(N,j,X){this._rowCount=X,N=void 0!==N?N:0,j=void 0!==j?j:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,N):N,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,j):j;const ie=Date.now();if(ie-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=ie,this._innerRefresh();else if(!this._additionalRefreshRequested){const N=ie-this._lastRefreshMs,j=this._debounceThresholdMS-N;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),j)}}_innerRefresh(){if(void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return;const N=Math.max(this._rowStart,0),j=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(N,j)}}},9302:(N,j,X)=>{Object.defineProperty(j,"__esModule",{value:!0}),j.DEFAULT_ANSI_COLORS=void 0;const ie=X(4103);j.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const N=[ie.css.toColor("#2e3436"),ie.css.toColor("#cc0000"),ie.css.toColor("#4e9a06"),ie.css.toColor("#c4a000"),ie.css.toColor("#3465a4"),ie.css.toColor("#75507b"),ie.css.toColor("#06989a"),ie.css.toColor("#d3d7cf"),ie.css.toColor("#555753"),ie.css.toColor("#ef2929"),ie.css.toColor("#8ae234"),ie.css.toColor("#fce94f"),ie.css.toColor("#729fcf"),ie.css.toColor("#ad7fa8"),ie.css.toColor("#34e2e2"),ie.css.toColor("#eeeeec")],j=[0,95,135,175,215,255];for(let X=0;X<216;X++){const se=j[X/36%6|0],le=j[X/6%6|0],he=j[X%6];N.push({css:ie.channels.toCss(se,le,he),rgba:ie.channels.toRgba(se,le,he)})}for(let j=0;j<24;j++){const X=8+10*j;N.push({css:ie.channels.toCss(X,X,X),rgba:ie.channels.toRgba(X,X,X)})}return N})())},4017:function(N,j,X){var ie=this&&this.__decorate||function(N,j,X,ie){var se,le=arguments.length,he=le<3?j:null===ie?ie=Object.getOwnPropertyDescriptor(j,X):ie;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)he=Reflect.decorate(N,j,X,ie);else for(var ce=N.length-1;ce>=0;ce--)(se=N[ce])&&(he=(le<3?se(he):le>3?se(j,X,he):se(j,X))||he);return le>3&&he&&Object.defineProperty(j,X,he),he},se=this&&this.__param||function(N,j){return function(X,ie){j(X,ie,N)}};Object.defineProperty(j,"__esModule",{value:!0}),j.Viewport=void 0;const le=X(7098),he=X(7150),ce=X(6501),_e=X(7093),me=X(8234),ve=X(802),Se=X(9881);let be=class extends he.Disposable{constructor(N,j,X,ie,se,le,ce,be){super(),this._bufferService=X,this._optionsService=ce,this._renderService=be,this._onRequestScrollLines=this._register(new ve.Emitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;const Ce=this._register(new Se.Scrollable({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:N=>(0,_e.scheduleAtNextAnimationFrame)(ie.window,N)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",(()=>{Ce.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)}))),this._scrollableElement=this._register(new me.SmoothScrollableElement(j,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},Ce)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],(()=>this._scrollableElement.updateOptions(this._getChangeOptions())))),this._register(se.onProtocolChange((N=>{this._scrollableElement.updateOptions({handleMouseWheel:!(16&N)})}))),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(ve.Event.runAndSubscribe(le.onChang