import{T as y,E as V}from"./@wangeditor.f28454bb.js";import{_ as w}from"./picker.e77eb06d.js";import{j as i}from"./index.75e08341.js";import{d as U,s as m,r as k,b as f,D as x,o as B,c as E,V as u,u as t,j as R,a1 as P}from"./@vue.96c135a1.js";const F=U({__name:"index",props:{modelValue:{default:""},mode:{default:"default"},height:{default:"100%"},width:{default:"auto"},toolbarConfig:{default:()=>({})}},emits:["update:modelValue"],setup(p,{emit:c}){const l=p,h=c,a=m(),d=m(),n=k("");let r;const g={MENU_CONF:{uploadImage:{customBrowseAndUpload(e){var o;n.value="image",(o=d.value)==null||o.showPopup(-1),r=e}},uploadVideo:{customBrowseAndUpload(e){var o;n.value="video",(o=d.value)==null||o.showPopup(-1),r=e}}}},_=f(()=>({height:i(l.height),width:i(l.width)})),s=f({get(){return l.modelValue},set(e){h("update:modelValue",e)}}),v=e=>{e.forEach(o=>{r(o)})};x(()=>{const e=a.value;e!=null&&e.destroy()});const C=e=>{a.value=e};return(e,o)=>(B(),E("div",{class:"border border-br flex flex-col",style:P(t(_))},[u(t(y),{class:"border-b border-br",editor:t(a),defaultConfig:e.toolbarConfig,mode:e.mode},null,8,["editor","defaultConfig","mode"]),u(t(V),{class:"flex-1 overflow-hidden",modelValue:t(s),"onUpdate:modelValue":o[0]||(o[0]=b=>R(s)?s.value=b:null),defaultConfig:g,mode:e.mode,onOnCreated:C},null,8,["modelValue","mode"]),u(w,{ref_key:"materialPickerRef",ref:d,type:t(n),limit:-1,"hidden-upload":"",onChange:v},null,8,["type"])],4))}});export{F as _};
