mirror of
https://github.com/open-webui/open-webui
synced 2024-11-26 05:51:12 +00:00
1 line
7.8 KiB
Plaintext
1 line
7.8 KiB
Plaintext
{"version":3,"file":"xterm_addon-web-links-Cnej-nJ6.js","sources":["../src/3rd-party/xterm_addon-web-links.js"],"sourcesContent":["/**\n * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.\n * Original file: /npm/@xterm/addon-web-links@0.11.0/lib/addon-web-links.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\nvar e={exports:{}};self;var t=e.exports=(()=>{var e={6:(e,t)=>{function r(e){try{const t=new URL(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}`;return e.toLocaleLowerCase().startsWith(r.toLocaleLowerCase())}catch(e){return!1}}Object.defineProperty(t,\"__esModule\",{value:!0}),t.LinkComputer=t.WebLinkProvider=void 0,t.WebLinkProvider=class{constructor(e,t,r,n={}){this._terminal=e,this._regex=t,this._handler=r,this._options=n}provideLinks(e,t){const r=n.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(r))}_addCallbacks(e){return e.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)))}};class n{static computeLink(e,t,o,s){const i=new RegExp(t.source,(t.flags||\"\")+\"g\"),[a,l]=n._getWindowedLineStrings(e-1,o),c=a.join(\"\");let d;const p=[];for(;d=i.exec(c);){const e=d[0];if(!r(e))continue;const[t,i]=n._mapStrIdx(o,l,0,d.index),[a,c]=n._mapStrIdx(o,t,i,e.length);if(-1===t||-1===i||-1===a||-1===c)continue;const h={start:{x:i+1,y:t+1},end:{x:c,y:a+1}};p.push({range:h,text:e,activate:s})}return p}static _getWindowedLineStrings(e,t){let r,n=e,o=e,s=0,i=\"\";const a=[];if(r=t.buffer.active.getLine(e)){const e=r.translateToString(!0);if(r.isWrapped&&\" \"!==e[0]){for(s=0;(r=t.buffer.active.getLine(--n))&&s<2048&&(i=r.translateToString(!0),s+=i.length,a.push(i),r.isWrapped&&-1===i.indexOf(\" \")););a.reverse()}for(a.push(e),s=0;(r=t.buffer.active.getLine(++o))&&r.isWrapped&&s<2048&&(i=r.translateToString(!0),s+=i.length,a.push(i),-1===i.indexOf(\" \")););}return[a,n]}static _mapStrIdx(e,t,r,n){const o=e.buffer.active,s=o.getNullCell();let i=r;for(;n;){const e=o.getLine(t);if(!e)return[-1,-1];for(let r=i;r<e.length;++r){e.getCell(r,s);const i=s.getChars();if(s.getWidth()&&(n-=i.length||1,r===e.length-1&&\"\"===i)){const e=o.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,s),2===s.getWidth()&&(n+=1))}if(n<0)return[t,r]}t++,i=0}return[t,i]}}t.LinkComputer=n}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}var n={};return(()=>{var e=n;Object.defineProperty(e,\"__esModule\",{value:!0}),e.WebLinksAddon=void 0;const t=r(6),o=/(https?|HTTPS?):[/]{2}[^\\s\"'!*(){}|\\\\\\^<>`]*[^\\s\"':,.!?{}|\\\\\\^~\\[\\]`()<>]/;function s(e,t){const r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn(\"Opening link blocked as opener could not be cleared\")}e.WebLinksAddon=class{constructor(e=s,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;const r=this._options,n=r.urlRegex||o;this._linkProvider=this._terminal.registerLinkProvider(new t.WebLinkProvider(this._terminal,n,this._handler,r))}dispose(){this._linkProvider?.dispose()}}})(),n})(),r=e.exports.WebLinksAddon,n=e.exports.__esModule;export{r as WebLinksAddon,n as __esModule,t as default};\n"],"names":["e","exports","t","r","URL","password","username","protocol","host","toLocaleLowerCase","startsWith","Object","defineProperty","value","LinkComputer","WebLinkProvider","constructor","n","this","_terminal","_regex","_handler","_options","provideLinks","computeLink","_addCallbacks","map","leave","hover","range","o","s","i","RegExp","source","flags","a","l","_getWindowedLineStrings","c","join","d","p","exec","_mapStrIdx","index","length","h","start","x","y","end","push","text","activate","buffer","active","getLine","translateToString","isWrapped","indexOf","reverse","getNullCell","getCell","getChars","getWidth","WebLinksAddon","window","open","opener","location","href","console","warn","urlRegex","_linkProvider","registerLinkProvider","dispose","__esModule"],"mappings":"AAMA,IAAIA,EAAE,CAACC,QAAQ,CAAE,GAAWC,EAAEF,EAAEC,QAAQ,MAAM,IAAID,EAAE,CAAC,EAAE,CAACA,EAAEE,KAAK,SAASC,EAAEH,GAAG,IAAI,MAAME,EAAE,IAAIE,IAAIJ,GAAGG,EAAED,EAAEG,UAAUH,EAAEI,SAAS,GAAGJ,EAAEK,aAAaL,EAAEI,YAAYJ,EAAEG,YAAYH,EAAEM,OAAON,EAAEI,SAAS,GAAGJ,EAAEK,aAAaL,EAAEI,YAAYJ,EAAEM,OAAO,GAAGN,EAAEK,aAAaL,EAAEM,OAAO,OAAOR,EAAES,oBAAoBC,WAAWP,EAAEM,oBAAoB,CAAC,MAAMT,GAAG,OAAM,CAAE,CAAC,CAACW,OAAOC,eAAeV,EAAE,aAAa,CAACW,OAAM,IAAKX,EAAEY,aAAaZ,EAAEa,qBAAgB,EAAOb,EAAEa,gBAAgB,MAAM,WAAAC,CAAYhB,EAAEE,EAAEC,EAAEc,EAAE,CAAE,GAAEC,KAAKC,UAAUnB,EAAEkB,KAAKE,OAAOlB,EAAEgB,KAAKG,SAASlB,EAAEe,KAAKI,SAASL,CAAC,CAAC,YAAAM,CAAavB,EAAEE,GAAG,MAAMC,EAAEc,EAAEO,YAAYxB,EAAEkB,KAAKE,OAAOF,KAAKC,UAAUD,KAAKG,UAAUnB,EAAEgB,KAAKO,cAActB,GAAG,CAAC,aAAAsB,CAAczB,GAAG,OAAOA,EAAE0B,KAAK1B,IAAIA,EAAE2B,MAAMT,KAAKI,SAASK,MAAM3B,EAAE4B,MAAM,CAAC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