import{d as m}from"./CjURGq3V.js";import{d as k,a as f,az as _,o as n,m as s,G as r,k as t,F as d,n as g,t as h}from"./CCqMIw4K.js";const C=["innerHTML"],b={class:"shiki"},v=["textContent"],y=t("br",null,null,-1),L=k({__name:"NCodeBlock",props:{code:{},lang:{},lines:{type:Boolean,default:!0},transformRendered:{}},emits:["loaded"],setup(a,{emit:c}){const o=a,i=c,l=f(()=>{const e=o.lang==="text"?{code:o.code,supported:!1}:m.value?.devtools.renderCodeHighlight(o.code,o.lang)||{code:o.code,supported:!1};return e.supported&&o.transformRendered&&(e.code=o.transformRendered(e.code)),e.supported&&_(()=>i("loaded")),e});return(e,B)=>e.lang&&l.value.supported?(n(),s("pre",{key:0,class:r(["n-code-block",e.lines?"n-code-block-lines":""]),innerHTML:l.value.code},null,10,C)):(n(),s("pre",{key:1,class:r(["n-code-block",e.lines?"n-code-block-lines":""])},[t("pre",b,[t("code",null,[(n(!0),s(d,null,g(e.code.split(`
`),(p,u)=>(n(),s(d,{key:u},[t("span",{class:"line",textContent:h(p)},null,8,v),y],64))),128))])])],2))}});export{L as _};
