@openscout/scout 0.2.69 → 0.2.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{g as We}from"./index-5-XOQrKH.js";function He(Te,Ie){for(var Le=0;Le<Ie.length;Le++){const ge=Ie[Le];if(typeof ge!="string"&&!Array.isArray(ge)){for(const ae in ge)if(ae!=="default"&&!(ae in Te)){const Re=Object.getOwnPropertyDescriptor(ge,ae);Re&&Object.defineProperty(Te,ae,Re.get?Re:{enumerable:!0,get:()=>ge[ae]})}}}return Object.freeze(Object.defineProperty(Te,Symbol.toStringTag,{value:"Module"}))}var Pe={exports:{}},Ne;function Ke(){return Ne||(Ne=1,(function(Te,Ie){(function(Le,ge){Te.exports=ge()})(globalThis,(()=>(()=>{var Le={2840:function(K,t,_){var i=this&&this.__decorate||function(s,e,l,o){var u,c=arguments.length,a=c<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,e,l,o);else for(var m=s.length-1;m>=0;m--)(u=s[m])&&(a=(c<3?u(a):c>3?u(e,l,a):u(e,l))||a);return c>3&&a&&Object.defineProperty(e,l,a),a},v=this&&this.__param||function(s,e){return function(l,o){e(l,o,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;const n=_(7721),f=_(4292),g=_(7150),p=_(7098),d=_(6501),r=_(7093);let h=class extends g.Disposable{constructor(s,e,l,o){super(),this._terminal=s,this._coreBrowserService=l,this._renderService=o,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";const u=this._coreBrowserService.mainDocument;this._accessibilityContainer=u.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=u.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,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=u.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new f.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((c=>this._handleResize(c.rows)))),this._register(this._terminal.onRender((c=>this._refreshRows(c.start,c.end)))),this._register(this._terminal.onScroll((()=>this._refreshRows()))),this._register(this._terminal.onA11yChar((c=>this._handleChar(c)))),this._register(this._terminal.onLineFeed((()=>this._handleChar(`
1
+ import{g as We}from"./index-CYs6TkOv.js";function He(Te,Ie){for(var Le=0;Le<Ie.length;Le++){const ge=Ie[Le];if(typeof ge!="string"&&!Array.isArray(ge)){for(const ae in ge)if(ae!=="default"&&!(ae in Te)){const Re=Object.getOwnPropertyDescriptor(ge,ae);Re&&Object.defineProperty(Te,ae,Re.get?Re:{enumerable:!0,get:()=>ge[ae]})}}}return Object.freeze(Object.defineProperty(Te,Symbol.toStringTag,{value:"Module"}))}var Pe={exports:{}},Ne;function Ke(){return Ne||(Ne=1,(function(Te,Ie){(function(Le,ge){Te.exports=ge()})(globalThis,(()=>(()=>{var Le={2840:function(K,t,_){var i=this&&this.__decorate||function(s,e,l,o){var u,c=arguments.length,a=c<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,e,l,o);else for(var m=s.length-1;m>=0;m--)(u=s[m])&&(a=(c<3?u(a):c>3?u(e,l,a):u(e,l))||a);return c>3&&a&&Object.defineProperty(e,l,a),a},v=this&&this.__param||function(s,e){return function(l,o){e(l,o,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;const n=_(7721),f=_(4292),g=_(7150),p=_(7098),d=_(6501),r=_(7093);let h=class extends g.Disposable{constructor(s,e,l,o){super(),this._terminal=s,this._coreBrowserService=l,this._renderService=o,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";const u=this._coreBrowserService.mainDocument;this._accessibilityContainer=u.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=u.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,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=u.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new f.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((c=>this._handleResize(c.rows)))),this._register(this._terminal.onRender((c=>this._refreshRows(c.start,c.end)))),this._register(this._terminal.onScroll((()=>this._refreshRows()))),this._register(this._terminal.onA11yChar((c=>this._handleChar(c)))),this._register(this._terminal.onLineFeed((()=>this._handleChar(`
2
2
  `)))),this._register(this._terminal.onA11yTab((c=>this._handleTab(c)))),this._register(this._terminal.onKey((c=>this._handleKey(c.key)))),this._register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this._register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this._register((0,r.addDisposableListener)(u,"selectionchange",(()=>this._handleSelectionChange()))),this._register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRowsDimensions(),this._refreshRows(),this._register((0,g.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(s){for(let e=0;e<s;e++)this._handleChar(" ")}_handleChar(s){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==s&&(this._charsToAnnounce+=s):this._charsToAnnounce+=s,s===`
3
3
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(s){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(s)||this._charsToConsume.push(s)}_refreshRows(s,e){this._liveRegionDebouncer.refresh(s,e,this._terminal.rows)}_renderRows(s,e){const l=this._terminal.buffer,o=l.lines.length.toString();for(let u=s;u<=e;u++){const c=l.lines.get(l.ydisp+u),a=[],m=c?.translateToString(!0,void 0,void 0,a)||"",S=(l.ydisp+u+1).toString(),R=this._rowElements[u];R&&(m.length===0?(R.textContent=" ",this._rowColumns.set(R,[0,1])):(R.textContent=m,this._rowColumns.set(R,a)),R.setAttribute("aria-posinset",S),R.setAttribute("aria-setsize",o),this._alignRowWidth(R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(s,e){const l=s.target,o=this._rowElements[e===0?1:this._rowElements.length-2];if(l.getAttribute("aria-posinset")===(e===0?"1":`${this._terminal.buffer.lines.length}`)||s.relatedTarget!==o)return;let u,c;if(e===0?(u=l,c=this._rowElements.pop(),this._rowContainer.removeChild(c)):(u=this._rowElements.shift(),c=l,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),c.removeEventListener("focus",this._bottomBoundaryFocusListener),e===0){const a=this._createAccessibilityTreeNode();this._rowElements.unshift(a),this._rowContainer.insertAdjacentElement("afterbegin",a)}else{const a=this._createAccessibilityTreeNode();this._rowElements.push(a),this._rowContainer.appendChild(a)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(e===0?-1:1),this._rowElements[e===0?1:this._rowElements.length-2].focus(),s.preventDefault(),s.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const s=this._coreBrowserService.mainDocument.getSelection();if(!s)return;if(s.isCollapsed)return void(this._rowContainer.contains(s.anchorNode)&&this._terminal.clearSelection());if(!s.anchorNode||!s.focusNode)return void console.error("anchorNode and/or focusNode are null");let e={node:s.anchorNode,offset:s.anchorOffset},l={node:s.focusNode,offset:s.focusOffset};if((e.node.compareDocumentPosition(l.node)&Node.DOCUMENT_POSITION_PRECEDING||e.node===l.node&&e.offset>l.offset)&&([e,l]=[l,e]),e.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(e={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(e.node))return;const o=this._rowElements.slice(-1)[0];if(l.node.compareDocumentPosition(o)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(l={node:o,offset:o.textContent?.length??0}),!this._rowContainer.contains(l.node))return;const u=({node:m,offset:S})=>{const R=m instanceof Text?m.parentNode:m;let T=parseInt(R?.getAttribute("aria-posinset"),10)-1;if(isNaN(T))return console.warn("row is invalid. Race condition?"),null;const C=this._rowColumns.get(R);if(!C)return console.warn("columns is null. Race condition?"),null;let y=S<C.length?C[S]:C.slice(-1)[0]+1;return y>=this._terminal.cols&&(++T,y=0),{row:T,column:y}},c=u(e),a=u(l);if(c&&a){if(c.row>a.row||c.row===a.row&&c.column>=a.column)throw new Error("invalid range");this._terminal.select(c.column,c.row,(a.row-c.row)*this._terminal.cols-c.column+a.column)}}_handleResize(s){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>s;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const s=this._coreBrowserService.mainDocument.createElement("div");return s.setAttribute("role","listitem"),s.tabIndex=-1,this._refreshRowDimensions(s),s}_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 s=0;s<this._terminal.rows;s++)this._refreshRowDimensions(this._rowElements[s]),this._alignRowWidth(this._rowElements[s])}}_refreshRowDimensions(s){s.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(s){s.style.transform="";const e=s.getBoundingClientRect().width,l=this._rowColumns.get(s)?.slice(-1)?.[0];if(!l)return;const o=l*this._renderService.dimensions.css.cell.width;s.style.transform=`scaleX(${o/e})`}};t.AccessibilityManager=h,t.AccessibilityManager=h=i([v(1,d.IInstantiationService),v(2,p.ICoreBrowserService),v(3,p.IRenderService)],h)},7861:(K,t)=>{function _(f){return f.replace(/\r?\n/g,"\r")}function i(f,g){return g?"\x1B[200~"+f+"\x1B[201~":f}function v(f,g,p,d){f=i(f=_(f),p.decPrivateModes.bracketedPasteMode&&d.rawOptions.ignoreBracketedPasteMode!==!0),p.triggerDataEvent(f,!0),g.value=""}function n(f,g,p){const d=p.getBoundingClientRect(),r=f.clientX-d.left-10,h=f.clientY-d.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${r}px`,g.style.top=`${h}px`,g.style.zIndex="1000",g.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.prepareTextForTerminal=_,t.bracketTextForPaste=i,t.copyHandler=function(f,g){f.clipboardData&&f.clipboardData.setData("text/plain",g.selectionText),f.preventDefault()},t.handlePasteEvent=function(f,g,p,d){f.stopPropagation(),f.clipboardData&&v(f.clipboardData.getData("text/plain"),g,p,d)},t.paste=v,t.moveTextAreaUnderMouseCursor=n,t.rightClickHandler=function(f,g,p,d,r){n(f,g,p),r&&d.rightClickSelect(f),g.value=d.selectionText,g.select()}},7174:(K,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;const i=_(7710);t.ColorContrastCache=class{constructor(){this._color=new i.TwoKeyMap,this._css=new i.TwoKeyMap}setCss(v,n,f){this._css.set(v,n,f)}getCss(v,n){return this._css.get(v,n)}setColor(v,n,f){this._color.set(v,n,f)}getColor(v,n){return this._color.get(v,n)}clear(){this._color.clear(),this._css.clear()}}},1718:(K,t,_)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserTerminal=void 0;const i=_(7861),v=_(7721),n=_(3285),f=_(4017),g=_(4196),p=_(9925),d=_(3618),r=_(3955),h=_(4792),s=_(945),e=_(9574),l=_(9820),o=_(9784),u=_(5783),c=_(2079),a=_(7098),m=_(9078),S=_(4103),R=_(5777),T=_(701),C=_(6107),y=_(3534),A=_(706),N=_(8693),I=_(4720),F=_(6501),E=_(2486),w=_(2840),b=_(8906),L=_(802),M=_(7093),P=_(7150);class U extends R.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(x={}){super(x),this._linkifier=this._register(new P.MutableDisposable),this.browser=T,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new P.MutableDisposable),this._onCursorMove=this._register(new L.Emitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new L.Emitter),this.onKey=this._onKey.event,this._onRender=this._register(new L.Emitter),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new L.Emitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new L.Emitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new L.Emitter),this.onBell=this._onBell.event,this._onFocus=this._register(new L.Emitter),this._onBlur=this._register(new L.Emitter),this._onA11yCharEmitter=this._register(new L.Emitter),this._onA11yTabEmitter=this._register(new L.Emitter),this._onWillOpen=this._register(new L.Emitter),this._setup(),this._decorationService=this._instantiationService.createInstance(I.DecorationService),this._instantiationService.setService(F.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(l.LinkProviderService),this._instantiationService.setService(a.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(n.OscLinkProvider)),this._register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this._register(this._inputHandler.onRequestRefreshRows((k=>this.refresh(k?.start??0,k?.end??this.rows-1)))),this._register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this._register(this._inputHandler.onRequestReset((()=>this.reset()))),this._register(this._inputHandler.onRequestWindowsOptionsReport((k=>this._reportWindowsOptions(k)))),this._register(this._inputHandler.onColor((k=>this._handleColorEvent(k)))),this._register(L.Event.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(L.Event.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(L.Event.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(L.Event.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize((k=>this._afterResize(k.cols,k.rows)))),this._register((0,P.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(x){if(this._themeService)for(const k of x){let $,j="";switch(k.index){case 256:$="foreground",j="10";break;case 257:$="background",j="11";break;case 258:$="cursor",j="12";break;default:$="ansi",j="4;"+k.index}switch(k.type){case 0:const V=S.color.toColorRGB($==="ansi"?this._themeService.colors.ansi[k.index]:this._themeService.colors[$]);this.coreService.triggerDataEvent(`${y.C0.ESC}]${j};${(0,N.toRgbString)(V)}${y.C1_ESCAPED.ST}`);break;case 1:if($==="ansi")this._themeService.modifyColors((q=>q.ansi[k.index]=S.channels.toColor(...k.color)));else{const q=$;this._themeService.modifyColors((J=>J[q]=S.channels.toColor(...k.color)))}break;case 2:this._themeService.restoreColor(k.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(x){x?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(w.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(x){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(y.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(y.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 x=this.buffer.ybase+this.buffer.y,k=this.buffer.lines.get(x);if(!k)return;const $=Math.min(this.buffer.x,this.cols-1),j=this._renderService.dimensions.css.cell.height,V=k.getWidth($),q=this._renderService.dimensions.css.cell.width*V,J=this.buffer.y*this._renderService.dimensions.css.cell.height,se=$*this._renderService.dimensions.css.cell.width;this.textarea.style.left=se+"px",this.textarea.style.top=J+"px",this.textarea.style.width=q+"px",this.textarea.style.height=j+"px",this.textarea.style.lineHeight=j+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register((0,M.addDisposableListener)(this.element,"copy",(k=>{this.hasSelection()&&(0,i.copyHandler)(k,this._selectionService)})));const x=k=>(0,i.handlePasteEvent)(k,this.textarea,this.coreService,this.optionsService);this._register((0,M.addDisposableListener)(this.textarea,"paste",x)),this._register((0,M.addDisposableListener)(this.element,"paste",x)),T.isFirefox?this._register((0,M.addDisposableListener)(this.element,"mousedown",(k=>{k.button===2&&(0,i.rightClickHandler)(k,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this._register((0,M.addDisposableListener)(this.element,"contextmenu",(k=>{(0,i.rightClickHandler)(k,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),T.isLinux&&this._register((0,M.addDisposableListener)(this.element,"auxclick",(k=>{k.button===1&&(0,i.moveTextAreaUnderMouseCursor)(k,this.textarea,this.screenElement)})))}_bindKeys(){this._register((0,M.addDisposableListener)(this.textarea,"keyup",(x=>this._keyUp(x)),!0)),this._register((0,M.addDisposableListener)(this.textarea,"keydown",(x=>this._keyDown(x)),!0)),this._register((0,M.addDisposableListener)(this.textarea,"keypress",(x=>this._keyPress(x)),!0)),this._register((0,M.addDisposableListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this._register((0,M.addDisposableListener)(this.textarea,"compositionupdate",(x=>this._compositionHelper.compositionupdate(x)))),this._register((0,M.addDisposableListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this._register((0,M.addDisposableListener)(this.textarea,"input",(x=>this._inputEvent(x)),!0)),this._register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(x){if(!x)throw new Error("Terminal requires a parent element.");if(x.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=x.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"),x.appendChild(this.element);const k=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),k.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register((0,M.addDisposableListener)(this.screenElement,"mousemove",(V=>this.updateCursorStyle(V)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),k.appendChild(this.screenElement);const $=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel.get()),T.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._register(this.optionsService.onSpecificOptionChange("disableStdin",(()=>$.readOnly=this.optionsService.rawOptions.disableStdin))),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(e.CoreBrowserService,this.textarea,x.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(a.ICoreBrowserService,this._coreBrowserService),this._register((0,M.addDisposableListener)(this.textarea,"focus",(V=>this._handleTextAreaFocus(V)))),this._register((0,M.addDisposableListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(h.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(a.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(m.ThemeService),this._instantiationService.setService(a.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(s.CharacterJoinerService),this._instantiationService.setService(a.ICharacterJoinerService,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(u.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(a.IRenderService,this._renderService),this._register(this._renderService.onRenderedViewportChange((V=>this._onRender.fire(V)))),this.onResize((V=>this._renderService.resize(V.cols,V.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(d.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(o.MouseService),this._instantiationService.setService(a.IMouseService,this._mouseService);const j=this._linkifier.value=this._register(this._instantiationService.createInstance(b.Linkifier,this.screenElement));this.element.appendChild(k);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(f.Viewport,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines((V=>{super.scrollLines(V,!1),this.refresh(0,this.rows-1)}))),this._selectionService=this._register(this._instantiationService.createInstance(c.SelectionService,this.element,this.screenElement,j)),this._instantiationService.setService(a.ISelectionService,this._selectionService),this._register(this._selectionService.onRequestScrollLines((V=>this.scrollLines(V.amount,V.suppressScrollEvent)))),this._register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this._register(this._selectionService.onRequestRedraw((V=>this._renderService.handleSelectionChanged(V.start,V.end,V.columnSelectMode)))),this._register(this._selectionService.onLinuxMouseSelection((V=>{this.textarea.value=V,this.textarea.focus(),this.textarea.select()}))),this._register(L.Event.any(this._onScroll.event,this._inputHandler.onScroll)((()=>{this._selectionService.refresh(),this._viewport?.queueSync()}))),this._register(this._instantiationService.createInstance(g.BufferDecorationRenderer,this.screenElement)),this._register((0,M.addDisposableListener)(this.element,"mousedown",(V=>this._selectionService.handleMouseDown(V)))),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",(V=>this._handleScreenReaderModeOptionChange(V)))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",(V=>{!this._overviewRulerRenderer&&V&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(r.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const x=this,k=this.element;function $(q){const J=x._mouseService.getMouseReportCoords(q,x.screenElement);if(!J)return!1;let se,te;switch(q.overrideType||q.type){case"mousemove":te=32,q.buttons===void 0?(se=3,q.button!==void 0&&(se=q.button<3?q.button:3)):se=1&q.buttons?0:4&q.buttons?1:2&q.buttons?2:3;break;case"mouseup":te=0,se=q.button<3?q.button:3;break;case"mousedown":te=1,se=q.button<3?q.button:3;break;case"wheel":if(x._customWheelEventHandler&&x._customWheelEventHandler(q)===!1)return!1;const re=q.deltaY;if(re===0||x.coreMouseService.consumeWheelEvent(q,x._renderService?.dimensions?.device?.cell?.height,x._coreBrowserService?.dpr)===0)return!1;te=re<0?0:1,se=4;break;default:return!1}return!(te===void 0||se===void 0||se>4)&&x.coreMouseService.triggerMouseEvent({col:J.col,row:J.row,x:J.x,y:J.y,button:se,action:te,ctrl:q.ctrlKey,alt:q.altKey,shift:q.shiftKey})}const j={mouseup:null,wheel:null,mousedrag:null,mousemove:null},V={mouseup:q=>($(q),q.buttons||(this._document.removeEventListener("mouseup",j.mouseup),j.mousedrag&&this._document.removeEventListener("mousemove",j.mousedrag)),this.cancel(q)),wheel:q=>($(q),this.cancel(q,!0)),mousedrag:q=>{q.buttons&&$(q)},mousemove:q=>{q.buttons||$(q)}};this._register(this.coreMouseService.onProtocolChange((q=>{q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(q)),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&q?j.mousemove||(k.addEventListener("mousemove",V.mousemove),j.mousemove=V.mousemove):(k.removeEventListener("mousemove",j.mousemove),j.mousemove=null),16&q?j.wheel||(k.addEventListener("wheel",V.wheel,{passive:!1}),j.wheel=V.wheel):(k.removeEventListener("wheel",j.wheel),j.wheel=null),2&q?j.mouseup||(j.mouseup=V.mouseup):(this._document.removeEventListener("mouseup",j.mouseup),j.mouseup=null),4&q?j.mousedrag||(j.mousedrag=V.mousedrag):(this._document.removeEventListener("mousemove",j.mousedrag),j.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register((0,M.addDisposableListener)(k,"mousedown",(q=>{if(q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(q))return $(q),j.mouseup&&this._document.addEventListener("mouseup",j.mouseup),j.mousedrag&&this._document.addEventListener("mousemove",j.mousedrag),this.cancel(q)}))),this._register((0,M.addDisposableListener)(k,"wheel",(q=>{if(!j.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(q)===!1)return!1;if(!this.buffer.hasScrollback){if(q.deltaY===0)return!1;if(x.coreMouseService.consumeWheelEvent(q,x._renderService?.dimensions?.device?.cell?.height,x._coreBrowserService?.dpr)===0)return this.cancel(q,!0);const J=y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(q.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(J,!0),this.cancel(q,!0)}}}),{passive:!1}))}refresh(x,k){this._renderService?.refreshRows(x,k)}updateCursorStyle(x){this._selectionService?.shouldColumnSelect(x)?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(x,k){this._viewport?this._viewport.scrollLines(x):super.scrollLines(x,k),this.refresh(0,this.rows-1)}scrollPages(x){this.scrollLines(x*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(x){x&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(x){const k=x-this._bufferService.buffer.ydisp;k!==0&&this.scrollLines(k)}paste(x){(0,i.paste)(x,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(x){this._customKeyEventHandler=x}attachCustomWheelEventHandler(x){this._customWheelEventHandler=x}registerLinkProvider(x){return this._linkProviderService.registerLinkProvider(x)}registerCharacterJoiner(x){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const k=this._characterJoinerService.register(x);return this.refresh(0,this.rows-1),k}deregisterCharacterJoiner(x){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(x)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(x){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+x)}registerDecoration(x){return this._decorationService.registerDecoration(x)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(x,k,$){this._selectionService.setSelection(x,k,$)}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(x,k){this._selectionService?.selectLines(x,k)}_keyDown(x){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(x)===!1)return!1;const k=this.browser.isMac&&this.options.macOptionIsMeta&&x.altKey;if(!k&&!this._compositionHelper.keydown(x))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;k||x.key!=="Dead"&&x.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const $=(0,A.evaluateKeyboardEvent)(x,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(x),$.type===3||$.type===2){const j=this.rows-1;return this.scrollLines($.type===2?-j:j),this.cancel(x,!0)}return $.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,x)||($.cancel&&this.cancel(x,!0),!$.key||!!(x.key&&!x.ctrlKey&&!x.altKey&&!x.metaKey&&x.key.length===1&&x.key.charCodeAt(0)>=65&&x.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):($.key!==y.C0.ETX&&$.key!==y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:$.key,domEvent:x}),this._showCursor(),this.coreService.triggerDataEvent($.key,!0),!this.optionsService.rawOptions.screenReaderMode||x.altKey||x.ctrlKey?this.cancel(x,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(x,k){const $=x.isMac&&!this.options.macOptionIsMeta&&k.altKey&&!k.ctrlKey&&!k.metaKey||x.isWindows&&k.altKey&&k.ctrlKey&&!k.metaKey||x.isWindows&&k.getModifierState("AltGraph");return k.type==="keypress"?$:$&&(!k.keyCode||k.keyCode>47)}_keyUp(x){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(x)===!1||((function(k){return k.keyCode===16||k.keyCode===17||k.keyCode===18})(x)||this.focus(),this.updateCursorStyle(x),this._keyPressHandled=!1)}_keyPress(x){let k;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(x)===!1)return!1;if(this.cancel(x),x.charCode)k=x.charCode;else if(x.which===null||x.which===void 0)k=x.keyCode;else{if(x.which===0||x.charCode===0)return!1;k=x.which}return!(!k||(x.altKey||x.ctrlKey||x.metaKey)&&!this._isThirdLevelShift(this.browser,x)||(k=String.fromCharCode(k),this._onKey.fire({key:k,domEvent:x}),this._showCursor(),this.coreService.triggerDataEvent(k,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(x){if(x.data&&x.inputType==="insertText"&&(!x.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const k=x.data;return this.coreService.triggerDataEvent(k,!0),this.cancel(x),!0}return!1}resize(x,k){x!==this.cols||k!==this.rows?super.resize(x,k):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(x,k){this._charSizeService?.measure()}clear(){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 x=1;x<this.rows;x++)this.buffer.lines.push(this.buffer.getBlankLine(C.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 x=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=x,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(y.C0.ESC+"[I"):this.coreService.triggerDataEvent(y.C0.ESC+"[O")}_reportWindowsOptions(x){if(this._renderService)switch(x){case E.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const k=this._renderService.dimensions.css.canvas.width.toFixed(0),$=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${y.C0.ESC}[4;${$};${k}t`);break;case E.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const j=this._renderService.dimensions.css.cell.width.toFixed(0),V=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${y.C0.ESC}[6;${V};${j}t`)}}cancel(x,k){if(this.options.cancelEvents||k)return x.preventDefault(),x.stopPropagation(),!1}}t.CoreBrowserTerminal=U},8906:function(K,t,_){var i=this&&this.__decorate||function(h,s,e,l){var o,u=arguments.length,c=u<3?s:l===null?l=Object.getOwnPropertyDescriptor(s,e):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(h,s,e,l);else for(var a=h.length-1;a>=0;a--)(o=h[a])&&(c=(u<3?o(c):u>3?o(s,e,c):o(s,e))||c);return u>3&&c&&Object.defineProperty(s,e,c),c},v=this&&this.__param||function(h,s){return function(e,l){s(e,l,h)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier=void 0;const n=_(7150),f=_(6501),g=_(7098),p=_(802),d=_(7093);let r=class extends n.Disposable{get currentLink(){return this._currentLink}constructor(h,s,e,l,o){super(),this._element=h,this._mouseService=s,this._renderService=e,this._bufferService=l,this._linkProviderService=o,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new p.Emitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new p.Emitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register((0,n.toDisposable)((()=>{(0,n.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,d.addDisposableListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this._register((0,d.addDisposableListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register((0,d.addDisposableListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register((0,d.addDisposableListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){this._lastMouseEvent=h;const s=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const e=h.composedPath();for(let l=0;l<e.length;l++){const o=e[l];if(o.classList.contains("xterm"))break;if(o.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(h){if(this._activeLine!==h.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(h,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,h)||(this._clearCurrentLink(),this._askForLink(h,!0))}_askForLink(h,s){this._activeProviderReplies&&s||(this._activeProviderReplies?.forEach((l=>{l?.forEach((o=>{o.link.dispose&&o.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=h.y);let e=!1;for(const[l,o]of this._linkProviderService.linkProviders.entries())s?this._activeProviderReplies?.get(l)&&(e=this._checkLinkProviderResult(l,h,e)):o.provideLinks(h.y,(u=>{if(this._isMouseOut)return;const c=u?.map((a=>({link:a})));this._activeProviderReplies?.set(l,c),e=this._checkLinkProviderResult(l,h,e),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)}))}_removeIntersectingLinks(h,s){const e=new Set;for(let l=0;l<s.size;l++){const o=s.get(l);if(o)for(let u=0;u<o.length;u++){const c=o[u],a=c.link.range.start.y<h?0:c.link.range.start.x,m=c.link.range.end.y>h?this._bufferService.cols:c.link.range.end.x;for(let S=a;S<=m;S++){if(e.has(S)){o.splice(u--,1);break}e.add(S)}}}}_checkLinkProviderResult(h,s,e){if(!this._activeProviderReplies)return e;const l=this._activeProviderReplies.get(h);let o=!1;for(let u=0;u<h;u++)this._activeProviderReplies.has(u)&&!this._activeProviderReplies.get(u)||(o=!0);if(!o&&l){const u=l.find((c=>this._linkAtPosition(c.link,s)));u&&(e=!0,this._handleNewLink(u))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!e)for(let u=0;u<this._activeProviderReplies.size;u++){const c=this._activeProviderReplies.get(u)?.find((a=>this._linkAtPosition(a.link,s)));if(c){e=!0,this._handleNewLink(c);break}}return e}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._currentLink)return;const s=this._positionFromMouseEvent(h,this._element,this._mouseService);var e,l;s&&this._mouseDownLink&&(e=this._mouseDownLink.link,l=this._currentLink.link,e.text===l.text&&e.range.start.x===l.range.start.x&&e.range.start.y===l.range.start.y&&e.range.end.x===l.range.end.x&&e.range.end.y===l.range.end.y)&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,s){this._currentLink&&this._lastMouseEvent&&(!h||!s||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,n.dispose)(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(h){if(!this._lastMouseEvent)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(h.link,s)&&(this._currentLink=h,this._currentLink.state={decorations:{underline:h.link.decorations===void 0||h.link.decorations.underline,pointerCursor:h.link.decorations===void 0||h.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,h.link,this._lastMouseEvent),h.link.decorations={},Object.defineProperties(h.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:e=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==e&&(this._currentLink.state.decorations.underline=e,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,e))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((e=>{if(!this._currentLink)return;const l=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(l,o),this._lastMouseEvent)){const u=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);u&&this._askForLink(u,!1)}}))))}_linkHover(h,s,e){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(e,s.text)}_fireUnderlineEvent(h,s){const e=h.range,l=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(e.start.x-1,e.start.y-l-1,e.end.x,e.end.y-l-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(h,s,e){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(e,s.text)}_linkAtPosition(h,s){const e=h.range.start.y*this._bufferService.cols+h.range.start.x,l=h.range.end.y*this._bufferService.cols+h.range.end.x,o=s.y*this._bufferService.cols+s.x;return e<=o&&o<=l}_positionFromMouseEvent(h,s,e){const l=e.getCoords(h,s,this._bufferService.cols,this._bufferService.rows);if(l)return{x:l[0],y:l[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,s,e,l,o){return{x1:h,y1:s,x2:e,y2:l,cols:this._bufferService.cols,fg:o}}};t.Linkifier=r,t.Linkifier=r=i([v(1,g.IMouseService),v(2,g.IRenderService),v(3,f.IBufferService),v(4,g.ILinkProviderService)],r)},7721:(K,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0;let _="Terminal input";const i={get:()=>_,set:f=>_=f};t.promptLabel=i;let v="Too much output to announce, navigate to rows manually to read";const n={get:()=>v,set:f=>v=f};t.tooMuchOutput=n},3285:function(K,t,_){var i=this&&this.__decorate||function(d,r,h,s){var e,l=arguments.length,o=l<3?r:s===null?s=Object.getOwnPropertyDescriptor(r,h):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(d,r,h,s);else for(var u=d.length-1;u>=0;u--)(e=d[u])&&(o=(l<3?e(o):l>3?e(r,h,o):e(r,h))||o);return l>3&&o&&Object.defineProperty(r,h,o),o},v=this&&this.__param||function(d,r){return function(h,s){r(h,s,d)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;const n=_(3055),f=_(6501);let g=class{constructor(d,r,h){this._bufferService=d,this._optionsService=r,this._oscLinkService=h}provideLinks(d,r){const h=this._bufferService.buffer.lines.get(d-1);if(!h)return void r(void 0);const s=[],e=this._optionsService.rawOptions.linkHandler,l=new n.CellData,o=h.getTrimmedLength();let u=-1,c=-1,a=!1;for(let m=0;m<o;m++)if(c!==-1||h.hasContent(m)){if(h.loadCell(m,l),l.hasExtendedAttrs()&&l.extended.urlId){if(c===-1){c=m,u=l.extended.urlId;continue}a=l.extended.urlId!==u}else c!==-1&&(a=!0);if(a||c!==-1&&m===o-1){const S=this._oscLinkService.getLinkData(u)?.uri;if(S){const R={start:{x:c+1,y:d},end:{x:m+(a||m!==o-1?0:1),y:d}};let T=!1;if(!e?.allowNonHttpProtocols)try{const C=new URL(S);["http:","https:"].includes(C.protocol)||(T=!0)}catch{T=!0}T||s.push({text:S,range:R,activate:(C,y)=>e?e.activate(C,y,R):p(0,y),hover:(C,y)=>e?.hover?.(C,y,R),leave:(C,y)=>e?.leave?.(C,y,R)})}a=!1,l.hasExtendedAttrs()&&l.extended.urlId?(c=m,u=l.extended.urlId):(c=-1,u=-1)}}r(s)}};function p(d,r){if(confirm(`Do you want to navigate to ${r}?
4
4
 
@@ -4,11 +4,45 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Scout</title>
7
+ <style>
8
+ html,
9
+ body,
10
+ #root {
11
+ min-height: 100%;
12
+ background: #050605;
13
+ color: #f3f4ee;
14
+ }
15
+
16
+ body {
17
+ margin: 0;
18
+ }
19
+ </style>
20
+ <!--
21
+ SCO-065: Pierre Diffs is loaded at runtime from esm.sh (see
22
+ scout/repo-diff/pierre.ts). It's a React *component* library, so it must
23
+ use ONE React instance, rendered in its own isolated root. This import map
24
+ canonicalises the bare `react`/`react-dom` specifiers (Pierre is fetched
25
+ with `?external=react,react-dom`) to a single pinned, immutable esm.sh copy
26
+ — matched to the app's bundled React (19.2.3). The app's own bundle never
27
+ imports bare `react` at runtime (Vite bundles it), so this only affects the
28
+ runtime-loaded Pierre subtree.
29
+ -->
30
+
7
31
  <link rel="preconnect" href="https://fonts.googleapis.com" />
8
32
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
33
  <link href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;1,400;1,500&family=Inter+Tight:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&family=Play:wght@400;700&family=Spectral:wght@500;600&display=swap" rel="stylesheet" />
10
- <script type="module" crossorigin src="/assets/index-5-XOQrKH.js"></script>
11
- <link rel="stylesheet" crossorigin href="/assets/index-BnA2HAbt.css">
34
+ <script type="importmap">
35
+ {
36
+ "imports": {
37
+ "react": "https://esm.sh/react@19.2.3",
38
+ "react/jsx-runtime": "https://esm.sh/react@19.2.3/jsx-runtime",
39
+ "react-dom": "https://esm.sh/react-dom@19.2.3?external=react",
40
+ "react-dom/client": "https://esm.sh/react-dom@19.2.3/client?external=react"
41
+ }
42
+ }
43
+ </script>
44
+ <script type="module" crossorigin src="/assets/index-CYs6TkOv.js"></script>
45
+ <link rel="stylesheet" crossorigin href="/assets/index-n_fpvwq8.css">
12
46
  </head>
13
47
  <body>
14
48
  <div id="root"></div>