import{W as c,a as m,b as p,c as g}from"./ts.worker.921d436c.js";import{W as f,e as v}from"./toggleHighContrast.483b4227.js";import{d as V,h as n,ag as W,L as y,D as h,o as k,c as E}from"./index.e3896b23.js";const S=["id"],F=V({__name:"param-studio",props:{id:{type:String,required:!0},value:{type:String,required:!1,default:()=>"{}"}},setup(a,{expose:s}){const o=a,i=n(""),u=n("json"),l=n("vs-dark");W(()=>{e.dispose(),console.log("editor dispose")}),y(()=>{d(),console.log("editor init")}),self.MonacoEnvironment={getWorker(r,t){return t==="json"?new c:t==="css"||t==="scss"||t==="less"?new m:t==="html"||t==="handlebars"||t==="razor"?new p:["typescript","javascript"].includes(t)?new g:new f}};let e=null;const d=()=>{h(()=>{e?e.setValue(o.value):e=v.create(document.getElementById(o.id),{value:i.value,language:u.value,automaticLayout:!0,theme:l.value,foldingStrategy:"indentation",renderLineHighlight:"all",selectOnLineNumbers:!0,minimap:{enabled:!1},cursorStyle:"line",readOnly:!1,fontSize:16,autoIndent:!0,useTabStops:!1,quickSuggestionsDelay:100,scrollBeyondLastLine:!1,overviewRulerBorder:!1}),e.setValue(o.value)})};return s({setEditorValue:r=>{e.setValue(r)},getEditorValue:()=>e.getValue(),handleFormat:()=>{let r=e.getValue();e.trigger("anyString","editor.action.formatDocument"),e.setValue(r)},setEditorValueAndFormat:r=>{e.setValue(r),e.trigger("anyString","editor.action.formatDocument")}}),(r,t)=>(k(),E("div",{id:a.id},null,8,S))}});export{F as _};
