mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
1 line
2.4 KiB
JavaScript
1 line
2.4 KiB
JavaScript
import{$ as e,It as t,P as n,R as r,V as i,_ as a,_t as o,c as s,d as c,f as l,g as u,i as d,l as f,mt as p,u as m,y as h,z as g,zt as _}from"./runtime-core.esm-bundler-CZvn3YaB.js";import{D as v,M as y}from"./client-C5e5tgZO.js";import{Q as b,j as x,x as S,y as C}from"./composables-DsGBjQEX.js";import{t as w}from"./plugin-vue_export-helper-CxTVcLa7.js";var T={key:0,class:`visually-hidden`},E=h({__name:`VPLink`,props:{tag:{},href:{},text:{},noIcon:{type:Boolean},target:{},rel:{}},setup(r){let a=r,d=y(),{theme:f}=S(),h=s(()=>a.tag??(a.href?`a`:`span`)),{link:C,isExternal:w,isExternalProtocol:E}=x(p(a,`href`),p(a,`target`)),D=s(()=>{if(a.text||w.value||!C.value)return a.text;let{text:e}=b(C.value);return e});function O(e){!w.value&&C.value&&(e.preventDefault(),d.push(C.value))}return(a,s)=>(n(),m(i(h.value),{class:t([`vp-link`,{link:o(C),"no-icon":r.noIcon,"vp-external-link-icon":o(w)}]),href:o(C)?o(E)||o(w)?o(C):o(v)(o(C)):void 0,target:r.target??(o(w)?`_blank`:void 0),rel:r.rel??(o(w)?`noopener noreferrer`:void 0),onClick:s[0]||=e=>O(e)},{default:e(()=>[g(a.$slots,`default`,{},()=>[u(_(D.value||r.href),1)]),g(a.$slots,`after-text`),o(w)&&!r.noIcon?(n(),l(`span`,T,_(o(f).openNewWindowText||`(Open in new window)`),1)):c(``,!0)]),_:3},8,[`class`,`href`,`target`,`rel`]))}}),D={class:`vp-copyright`},O={key:0},k={key:1,"data-allow-mismatch":``},A={class:`source`},j={key:2},M=w(h({__name:`VPCopyright`,props:{author:{},creation:{},source:{},license:{}},setup(i){let p=i,{theme:m}=S(),{author:h,creation:g,creationText:v,license:y,sourceUrl:b}=C(s(()=>p));return(i,s)=>(n(),l(`div`,D,[s[0]||=f(`span`,{class:`copyright-mask`},null,-1),o(h)?(n(),l(`p`,O,[f(`span`,null,_(o(m).copyrightAuthorText||`Copyright Ownership:`),1),a(E,{href:o(h).url,"no-icon":``},{default:e(()=>[u(_(o(h).name),1)]),_:1},8,[`href`])])):c(``,!0),o(b)?(n(),l(`p`,k,[f(`span`,null,_(o(v)),1),f(`span`,A,[a(E,{href:o(b),"no-icon":o(g)===`original`,"data-allow-mismatch":``},{default:e(()=>[u(_(decodeURIComponent(o(b))),1)]),_:1},8,[`href`,`no-icon`])])])):c(``,!0),o(y)?(n(),l(`p`,j,[f(`span`,null,_(o(m).copyrightLicenseText||`License under`),1),a(E,{href:o(y).url,"no-icon":``},{default:e(()=>[u(_(o(y).name),1)]),_:1},8,[`href`]),o(y).icons?(n(!0),l(d,{key:0},r(o(y).icons,e=>(n(),l(`span`,{key:e,class:t(`vpi-license-${e}`)},null,2))),128)):c(``,!0)])):c(``,!0)]))}}),[[`__scopeId`,`data-v-cc92b5a4`]]);export{E as n,M as t}; |