1import{m as p,N as m,a9 as h,u as i,U as d,M as w,p as a}from"./uOatmh1Q.js";import{_ as g}from"./p7j0WGZt.js";const k=["title"],x=p({__name:"SmartLink",props:{url:{},maxLength:{default:15}},setup(n){const r=n,s=t=>{if(!t||typeof t!="string")return!1;const e=t.trim();if(/\s/.test(e))return!1;if(/^(https?|ftp|file|ws|wss):\/\//i.test(e)||/^([\w\d][\w\d-]*\.)+[\w\d]{2,}(:\d+)?(\/.*)?$/i.test(e))return!0;if(e.includes(".")&&!e.startsWith(".")&&!e.endsWith(".")&&!e.includes(" ")){const l=e.split(".");if(l.length>=2&&l[l.length-1].length>=2)return!0}return!1},u=a(()=>{if(!s(r.url))return r.url;let t=r.url;return t=t.replace(/^(https?|ftp|file|ws|wss):\/\//i,""),t=t.replace(/^mailto:/i,""),t=t.replace(/^tel:/i,""),t=t.replace(/^www\./i,""),t.length>r.maxLength?t.substring(0,r.maxLength)+"â¦":t}),o=a(()=>r.url),f=()=>{const t=r.url.trim();return t.startsWith("mailto:")||t.startsWith("tel:")||/^(https?|ftp|file|ws|wss):\/\//i.test(t)?t:"https://"+t},c=t=>{if(!s(r.url)){t.preventDefault();return}const e=f();e.startsWith("mailto:")||e.startsWith("tel:")?window.location.href=e:window.open(e,"_blank","noopener,noreferrer"),t.preventDefault()};return(t,e)=>(w(),m("a",{href:"#",class:d({"smart-link":!0,"is-link":s(n.url),"is-text":!s(n.url)}),title:s(n.url)?i(o):"",onClick:c},h(i(u)),11,k))}}),C=g(x,[["__scopeId","data-v-2716676c"]]);export{C as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.