vare={exports:{}},t=e.exports=(()=>{vare={6:(e,t)=>{functionr(e){try{constt=newURL(e),r=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;returne.toLocaleLowerCase().startsWith(r.toLocaleLowerCase())}catch(e){return!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.LinkComputer=t.WebLinkProvider=void0,t.WebLinkProvider=class{constructor(e,t,r,n={}){this._terminal=e,this._regex=t,this._handler=r,this._options=n}provideLinks(e,t){constr=n.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(r))}_addCallbacks(e){returne.map((e=>(e.leave=this._options.leave,e.hover=(t,r)=>{if(this._options.hover){const{range:n}=e;this._options.hover(t,r,n)}},e)))}};classn{staticcomputeLink(e,t,s,o){consti=newRegExp(t.source,(t.flags||"")+"g"),[a,l]=n._getWindowedLineStrings(e-1,s),c=a.join("");letd;constp=[];for(;d=i.exec(c);){conste=d[0];if(!r(e))continue;const[t,i]=n._mapStrIdx(s,l,0,d.index),[a,c]=n._mapStrIdx(s,t,i,e.length);if(-1===t||-1===i||-1===a||-1===c)continue;consth={start:{x:i+1,y:t+1},end:{x:c,y:a+1}};p.push({range:h,text:e,activate:o})}returnp}static_getWindowedLineStrings(e,t){letr,n=e,s=e,o=0,i="";consta=[];if(r=t.buffer.active.getLine(e)){conste=r.translateToString(!0);if(r.isWrapped&&""!==e[0]){for(o=0;(r=t.buffer.active.getLine(--n))&&o<2048&&(i=r.translateToString(!0),o+=i.length,a.push(i),r.isWrapped&&-1===i.indexOf("")););a.reverse()}for(a.push(e),o=0;(r=t.buffer.active.getLine(++s))&&r.isWrapped&&o<2048&&(i=r.translateToString(!0),o+=i.length,a.push(i),-1===i.indexOf("")););}return[a,n]}static_mapStrIdx(e,t,r,n){consts=e.buffer.active,o=s.getNullCell();leti=r;for(;n;){conste=s.getLine(t);if(!e)return[-1,-1];for(letr=i;r<e.length;++r){e.getCell(r,o);consti=o.getChars();if(o.getWidth()&&(n-=i.length||1,r===e.length-1&&""===i)){conste=s.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,o),2===o.getWidth()&&(n+=1))}if(n<0)return[t,r]}t++,i=0}return[t,i]}}t.LinkComputer=n}},t={};functionr(n){vars=t[n];if(void0!==s)returns.exports;varo=t[n]={exports:{}};returne[n](o,o.exports,r),o.exports}varn={};return(()=>{vare=n;Object.defineProperty(e,"__esModule",{value:!0}),e.WebLinksAddon=void0;constt=r(6),s=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;functiono(e,t){constr=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}elseconsole.warn("Opening link blocked as opener could not be cleared")}e.WebLinksAddon=class{constructor(e=o,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;constr=this._options,n=r.urlRegex||s;this._linkProvider=this._terminal.registerLinkProvider(newt.WebLinkProvider(this._terminal,n,this._handler,r))}dispose(){this._linkProvider?.dispose()}}})(),n})(),r=e.exports.WebLinksAddon,n=e.exports.__esModule;export{rasWebLinksAddon,nas__esModule,tasdefault};//# sourceMappingURL=xterm_addon-web-links-Cnej-nJ6.js.map