import{d as k,u as w,r as y,t as C,c as x,o as v,a as Q,b as l,e,f as t,_ as g,w as o,Q as E,g as r,h as c,i as S,j as B,k as N,l as I,m as J}from"./index-ChZ5pZgG.js";import{u as L,a as T}from"./CodeEditor-CnZTVh8q.js";const j={class:"border-2 code-editor"},q={class:"code-editor__actions"},z={class:"inline-block"},D={class:"inline-block"},R=k({__name:"CodeEditor",props:{modelValue:{},commands:{}},emits:["update:modelValue"],setup(u,{emit:m}){const a=u,_=m,s=w(),d=L(),n=y(null),{copyContent:f,beautifyEditorValue:p}=T(n,{initialValue:C(a,"modelValue"),commands:a.commands,emit:_}),h=x(()=>{if(a.modelValue==="")return!0;try{return JSON.parse(a.modelValue),!0}catch{return!1}});return(b,i)=>(v(),Q("div",j,[l("div",{ref_key:"editor",ref:n,class:"full-width full-height"},null,512),l("div",q,[l("div",z,[e(g,{round:"",flat:"",dense:"","custom-handler":t(f)},null,8,["custom-handler"])]),l("div",D,[e(c,{icon:"settings",round:"",flat:"",dense:""},{default:o(()=>[e(E,{style:{"white-space":"nowrap"},dense:"",anchor:"bottom right",self:"top end"},{default:o(()=>[e(r,null,{default:o(()=>[e(c,{disable:!h.value,title:t(s)("shared.code_editor.actions.beautify.title"),color:"dark-grey",class:"full-width",onClick:t(p)},{default:o(()=>[e(S,{dense:"",name:"auto_fix_normal"}),B(" "+N(t(s)("shared.code_editor.actions.beautify.text")),1)]),_:1},8,["disable","title","onClick"])]),_:1}),e(I),e(r,{dense:"",class:"q-py-sm"},{default:o(()=>[e(J,{modelValue:t(d).wrapLines,"onUpdate:modelValue":i[0]||(i[0]=V=>t(d).wrapLines=V),size:"32px",dense:"",label:t(s)("shared.code_editor.actions.wrap_lines.label"),title:t(s)("shared.code_editor.actions.wrap_lines.title")},null,8,["modelValue","label","title"])]),_:1})]),_:1})]),_:1})])])]))}});export{R as default};
//# sourceMappingURL=CodeEditor-CqcJD01-.js.map
