import{R as b,ay as v,f as h,g as x,o as c,c as u,n as o,i as e,b as d,a as p,t as q,I as k,S as C,r as S,J as $,k as w,l as m}from"./B96cjQS3.js";import B from"./Cj3_emzb.js";const P={slots:{root:"relative my-5 group",header:"flex items-center gap-1.5 border border-muted bg-default border-b-0 relative rounded-t-md px-4 py-3",filename:"text-default text-sm/6",icon:"size-4 shrink-0",copy:"absolute top-[11px] right-[11px] lg:opacity-0 lg:group-hover:opacity-100 transition",base:"group font-mono text-sm/6 border border-muted bg-muted rounded-md px-4 py-3 whitespace-pre-wrap break-words overflow-x-auto focus:outline-none"},variants:{filename:{true:{root:"[&>pre]:rounded-t-none [&>pre]:my-0 my-5"}}}},A={__name:"ProsePre",props:{icon:{type:null,required:!1},code:{type:String,required:!1},language:{type:String,required:!1},filename:{type:String,required:!1},highlights:{type:Array,required:!1},hideHeader:{type:Boolean,required:!1},meta:{type:String,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(a){const t=a,{t:f}=b(),{copy:y,copied:g}=v(),l=h(),s=x("prose.pre",t),r=w(()=>m({extend:m(P),...l.ui?.prose?.pre||{}})());return(n,i)=>(c(),u("div",{class:o(r.value.root({class:[e(s)?.root],filename:!!a.filename}))},[a.filename&&!a.hideHeader?(c(),u("div",{key:0,class:o(r.value.header({class:e(s)?.header}))},[d(B,{icon:a.icon,filename:a.filename,class:o(r.value.icon({class:e(s)?.icon}))},null,8,["icon","filename","class"]),p("span",{class:o(r.value.filename({class:e(s)?.filename}))},q(a.filename),3)],2)):k("",!0),d(C,{icon:e(g)?e(l).ui.icons.copyCheck:e(l).ui.icons.copy,color:"neutral",variant:"outline",size:"sm","aria-label":e(f)("prose.pre.copy"),class:o(r.value.copy({class:e(s)?.copy})),tabindex:"-1",onClick:i[0]||(i[0]=z=>e(y)(t.code||""))},null,8,["icon","aria-label","class"]),p("pre",$({class:r.value.base({class:[e(s)?.base,t.class]})},n.$attrs),[S(n.$slots,"default")],16)],2))}};export{A as default};
