import{x as B,y as D,E as T,w as j,I as N}from"./element-plus.4a7d92a3.js";import{f as r,b as U}from"./index.76ab889f.js";import{u as $}from"./vue-clipboard3.7d5a7a5d.js";import{d as F,r as L,b as R,af as S,o as c,c as d,U as o,L as t,u as m,j as i,T as I,a9 as K,K as P,a as p,R as q}from"./@vue.18505fe0.js";const z={class:"code-preview"},A={class:"flex",style:{height:"50vh"}},Q=F({__name:"code-preview",props:{modelValue:{type:Boolean},code:{}},emits:["update:modelValue"],setup(_,{emit:f}){const b=_,h=f,{toClipboard:V}=$(),n=L("index0"),g=async a=>{try{await V(a),r.msgSuccess("\u590D\u5236\u6210\u529F")}catch{r.msgError("\u590D\u5236\u5931\u8D25")}},s=R({get(){return b.modelValue},set(a){h("update:modelValue",a)}});return(a,l)=>{const v=S("highlightjs"),y=T,C=U,E=j,k=B,x=D,w=N;return c(),d("div",z,[o(w,{modelValue:m(s),"onUpdate:modelValue":l[1]||(l[1]=e=>i(s)?s.value=e:null),width:"900px",title:"\u4EE3\u7801\u9884\u89C8"},{default:t(()=>[o(x,{modelValue:m(n),"onUpdate:modelValue":l[0]||(l[0]=e=>i(n)?n.value=e:null)},{default:t(()=>[(c(!0),d(I,null,K(a.code,(e,u)=>(c(),P(k,{label:e.name,name:`index${u}`,key:u},{default:t(()=>[p("div",A,[o(y,{class:"flex-1"},{default:t(()=>[o(v,{autodetect:"",code:e.content},null,8,["code"])]),_:2},1024),p("div",null,[o(E,{onClick:G=>g(e.content),type:"primary",link:""},{icon:t(()=>[o(C,{name:"el-icon-CopyDocument"})]),default:t(()=>[q(" \u590D\u5236 ")]),_:2},1032,["onClick"])])])]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])])}}});export{Q as _};
