import{cd as o,aK as a,u as l,v as s,b9 as c,at as n,aW as f,H as i,I as h,bH as d,c5 as _}from"./index-UvaAT40e.js";const p={props:{text:{type:String,default:""},url:{type:String,default:""},sup:{type:Boolean,default:!1},textAsLink:{type:Boolean,default:!1},classStr:{type:String,default:"linewraplink"}},computed:{checked_url:function(){return this.url!=""&&!this.url.startsWith("/")&&!this.url.startsWith("http")?(console.error("improper url found"),"https://"+this.url):this.url},formated_text:function(){if(this.text)return this.text;if(this.url){const t=this.create_url();if(t)return t.hostname}return""},href_url:function(){const t=this.create_url();return t?t.href:""}},methods:{create_url:function(){try{if(this.checked_url)return new URL(this.checked_url)}catch{console.log("wrong url: "+this.url)}}}},k={key:0},m=["href"],x={key:1,style:{"margin-left":"-2px"}},y=["href"],g={key:2},S=["href"];function b(t,u,e,w,B,r){return e.textAsLink?(a(),l("span",k,[s("a",{class:n(e.classStr),href:r.href_url,target:"_blank"},c(r.formated_text),11,m)])):e.sup?(a(),l("span",x,[s("a",{class:n(e.classStr),href:r.href_url,target:"_blank"},[s("sup",null,[f(t.$slots,"default",{},void 0,!0)])],10,y)])):(a(),l("span",g,[i(c(r.formated_text)+" ",1),s("a",{class:n(e.classStr),href:r.href_url,target:"_blank"},[s("sup",null,[h(_,{class:"outside_link",size:"x-small"},{default:d(()=>u[0]||(u[0]=[i("mdi-open-in-new")])),_:1})])],10,S)]))}const V=o(p,[["render",b],["__scopeId","data-v-ad154bf0"]]);export{V as A};