var g=(o,u,t)=>new Promise((n,d)=>{var p=e=>{try{r(t.next(e))}catch(i){d(i)}},s=e=>{try{r(t.throw(e))}catch(i){d(i)}},r=e=>e.done?n(e.value):Promise.resolve(e.value).then(p,s);r((t=t.apply(o,u)).next())});import{U as l,_ as v}from"./JUpload-DgDEmizw.js";import{d as k,f as M,r as _,e as w,u as m,n as B,a2 as R,ad as x,af as C,k as O,ag as h}from"./vue-vendor-CxLCUzY4.js";import{B as U}from"./index-XZKTTfG1.js";import{a8 as V,F as c,u as $}from"./index-CLZzJyTP.js";const J=k({__name:"JUploadModal",props:{value:c.oneOfType([c.string,c.array]),width:c.number.def(520)},emits:["change","update:value","register"],setup(o,{emit:u}){const{createMessage:t}=$(),n=u,d=o,p=M(),s=_({props:{}}),r=w(()=>{var a;return((a=s.props)==null?void 0:a.fileType)===l.image?"图片上传":"文件上传"}),[e,{closeModal:i}]=V(a=>g(this,null,function*(){var f;s.props=m(a)||{},[l.image,"img","picture"].includes((f=s.props)==null?void 0:f.fileType)?s.props.fileType=l.image:s.props.fileType=l.file,B(()=>p.value.addActionsListener())}));function y(){i()}function T(a){n("change",a),n("update:value",a)}return(a,f)=>(R(),x(m(U),h({onRegister:m(e),title:r.value,width:o.width,onOk:y},a.$attrs),{default:C(()=>[O(v,h({ref_key:"uploadRef",ref:p,value:o.value},s.props,{onChange:T}),null,16,["value"])]),_:1},16,["onRegister","title","width"]))}});export{J as _};
