import{_ as y}from"./ViewLayoutSection.vue-Cvh5w_-L.js";import{q as k,$ as h,ag as _,a5 as C,E as z,F as B,j as E}from"./ReferenceContentLoader-jQeEHBuo.js";import"./navigation-BK47qCFk.js";import{d as g,e as V,c as v,w as $,K as I,o,b as n,y as c,a as u,A as m,f as p,u as l,F as w}from"./index-D86EVCbM.js";import"./__vite-browser-external-D7Ct-6yo.js";const j={class:"flex h-full w-full flex-col gap-2 pt-8"},D={class:"flex min-h-8 items-center justify-between gap-2 pl-1.5"},F={class:"has-[:focus-visible]:bg-b-1 z-1 group relative flex flex-col rounded-lg"},M={class:"h-full min-h-[calc(1rem*4)]"},N={key:1,class:"text-c-3 flex h-full items-center justify-center rounded-lg border p-4"},P=g({__name:"MarkdownInput",props:{modelValue:{},environment:{},envVariables:{},workspace:{}},emits:["update:modelValue"],setup(x,{emit:r}){const d=r,t=V("preview"),i=V(null);return $(t,a=>{a==="edit"&&I(()=>{var e;(e=i.value)==null||e.focus()})}),(a,e)=>(o(),v("div",j,[n("div",D,[e[6]||(e[6]=n("h3",{class:"font-bold"},"Description",-1)),t.value==="preview"?(o(),c(l(h),{key:0,class:"text-c-2 hover:text-c-1 flex items-center gap-2",size:"sm",type:"button",variant:"outlined",onClick:e[0]||(e[0]=s=>t.value="edit")},{default:m(()=>[p(l(k),{icon:"Pencil",size:"sm",thickness:"1.5"}),e[5]||(e[5]=n("span",null,"Edit",-1))]),_:1})):u("",!0)]),n("div",F,[n("div",M,[t.value==="preview"?(o(),v(w,{key:0},[a.modelValue?(o(),v(w,{key:0},[a.modelValue?(o(),c(l(_),{key:0,class:"hover:border-b-3 h-full rounded border border-transparent p-1.5",value:a.modelValue,withImages:"",onDblclick:e[1]||(e[1]=s=>t.value="edit")},null,8,["value"])):u("",!0),e[7]||(e[7]=n("div",{class:"brightness-lifted -z-1 bg-b-1 absolute inset-0 hidden rounded group-hover:block group-has-[:focus-visible]:hidden"},null,-1))],64)):(o(),v("div",N,[p(l(h),{class:"hover:bg-b-2 hover:text-c-1 text-c-2 flex items-center gap-2",size:"sm",variant:"ghost",onClick:e[2]||(e[2]=s=>t.value="edit")},{default:m(()=>[p(l(k),{icon:"Pencil",size:"sm",thickness:"1.5"}),e[8]||(e[8]=n("span",null,"Write a description",-1))]),_:1})]))],64)):u("",!0),t.value==="edit"?(o(),c(C,{key:1,ref_key:"codeInputRef",ref:i,class:"h-full border px-0.5 py-0",envVariables:a.envVariables,environment:a.environment,modelValue:a.modelValue,workspace:a.workspace,onBlur:e[3]||(e[3]=s=>t.value="preview"),"onUpdate:modelValue":e[4]||(e[4]=s=>d("update:modelValue",s))},null,8,["envVariables","environment","modelValue","workspace"])):u("",!0)])])]))}}),U=z(P,[["__scopeId","data-v-b6d37ddc"]]),T=g({__name:"CollectionOverview",setup(x){const{activeCollection:r,activeEnvironment:d,activeEnvVariables:t,activeWorkspace:i}=B(),{collectionMutators:a}=E(),e=s=>{r.value&&a.edit(r.value.uid,"info.description",s)};return(s,W)=>(o(),c(y,null,{default:m(()=>{var f,b;return[l(d)&&l(i)?(o(),c(U,{key:0,envVariables:l(t),environment:l(d),modelValue:((b=(f=l(r))==null?void 0:f.info)==null?void 0:b.description)??"",workspace:l(i),"onUpdate:modelValue":e},null,8,["envVariables","environment","modelValue","workspace"])):u("",!0)]}),_:1}))}});export{T as default};
