import{T as y,E as w}from"./@wangeditor.f9245a4a.js";import{_ as V}from"./picker.57293a6f.js";import{g as i}from"./index.fbf661f7.js";import{d as E,s as m,r as U,b as f,E as k,o as x,c as B,W as u,u as t,j as R,$ as P}from"./@vue.a7a54728.js";const O=E({__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,g=c,a=m(),d=m(),n=U("");let r;const h={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){g("update:modelValue",e)}}),v=e=>{e.forEach(o=>{r(o)})};k(()=>{const e=a.value;e!=null&&e.destroy()});const C=e=>{a.value=e};return(e,o)=>(x(),B("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(w),{class:"flex-1 overflow-hidden",modelValue:t(s),"onUpdate:modelValue":o[0]||(o[0]=b=>R(s)?s.value=b:null),defaultConfig:h,mode:e.mode,onOnCreated:C},null,8,["modelValue","mode"]),u(V,{ref_key:"materialPickerRef",ref:d,type:t(n),limit:-1,"hidden-upload":"",onChange:v},null,8,["type"])],4))}});export{O as _};
