import{_ as C}from"./E2XRodt7.js";import{d as S,bf as x,e as B,a as w,aB as N,o as s,m as a,k as l,F as i,n as $,D as u,f as o,t as V,i as f,j as m,v,h,p as c,_ as D}from"./zEcrVex8.js";const T={key:0,relative:"","n-code-block":""},E={flex:"~ wrap","w-full":""},F=["onClick"],L={flex:"~ gap-2",px3:"",pb3:"",n:"sm primary"},q=S({__name:"CodeSnippets",props:{codeSnippets:{},eventType:{}},setup(_){const p=_,e=x(p.codeSnippets[0]),b=B(),k=w(()=>e.value?.lang||"text");return N(()=>{p.codeSnippets.includes(e.value)||(e.value=p.codeSnippets[0])}),(r,t)=>{const y=C,d=D;return r.codeSnippets.length?(s(),a("div",T,[l("div",E,[(s(!0),a(i,null,$(r.codeSnippets,(n,g)=>(s(),a("button",{key:g,px4:"",py2:"",border:"r base",hover:"bg-active",class:u(n===o(e)?"":"border-b"),onClick:j=>e.value=n},[l("div",{class:u(n===o(e)?"":"op30"),"font-mono":""},V(n.name),3)],10,F))),128)),t[1]||(t[1]=l("div",{border:"b base","flex-auto":""},null,-1))]),o(e)?(s(),a(i,{key:0},[f(y,{code:o(e).code,lang:o(k),lines:!1,"w-full":"","of-auto":"",p3:""},null,8,["code","lang"]),l("div",L,[f(d,{icon:"carbon-copy",onClick:t[0]||(t[0]=n=>o(b)(o(e).code,r.eventType||`code-snippet-${o(e).name}`))},{default:m(()=>t[2]||(t[2]=[v(" Copy ")])),_:1}),o(e)?.docs?(s(),h(d,{key:0,to:o(e).docs,target:"_blank",icon:"carbon-catalog"},{default:m(()=>t[3]||(t[3]=[v(" Docs ")])),_:1},8,["to"])):c("",!0)])],64)):c("",!0)])):c("",!0)}}});export{q as _};
