System.register(["./index-legacy-788fa28c.js","./config-legacy-33f5cb5f.js","./BaseUpload.vue_vue_type_style_index_0_scoped_5165bd65_lang-legacy-f2554bb9.js"],(function(e,t){"use strict";var r,a,u,i,l,c,n,s,o,p,d,y,v,g,f,m,b,_,w,B,S,h,A,I,x,L,z;return{setters:[e=>{r=e.d,a=e.p,u=e.u,i=e.r,l=e.X,c=e.a,n=e.c,s=e.I,o=e.h,p=e.w,d=e.k,y=e.t,v=e.i,g=e.a2,f=e.a3,m=e.e,b=e.g,_=e.a7,w=e.a5,B=e.E,S=e.a6,h=e._},e=>{A=e.f,I=e.e,x=e.g,L=e.v,z=e.i},null],execute:function(){const t=r({__name:"BaseUpload",props:{type:{type:String,default:"file",validator:e=>["image","video","audio","library","doc","file"].includes(e)},button:{type:String},uploadAction:{type:String},fileAccept:{type:String},fileMaxSize:{type:Number},multiple:{type:Boolean},disabled:{type:Boolean,default:!1},onSuccess:Function},setup(e){const t=e,{type:r,uploadAction:h,fileAccept:E,fileMaxSize:M}=a(t),{t:T}=u(),$=i({}),j=l((()=>{if(null!=h?.value)return h.value;switch(r.value){case"image":return z;case"video":return L;case"audio":return x;case"library":case"doc":return I;case"file":return A;default:throw new Error(`Type not support: ${r.value}`)}})),k=l((()=>{if(null!=E?.value)return E.value;switch(r.value){case"image":return w.imageInputAccept;case"video":return w.videoInputAccept;case"audio":return w.audioInputAccept;case"library":return w.libraryInputAccept;case"doc":return w.docInputAccept;case"file":return w.fileInputAccept;default:throw new Error(`Type not support: ${r.value}`)}})),U=l((()=>{if(null!=M?.value)return M.value;switch(r.value){case"image":return w.imageLimitByte;case"video":return w.videoLimitByte;case"audio":return w.audioLimitByte;case"library":return w.libraryLimitByte;case"doc":return w.docLimitByte;case"file":return w.fileLimitByte;default:throw new Error(`Type not support: ${r.value}`)}})),N=e=>!(U.value>0&&e.size>U.value&&(B.error(T("error.fileMaxSize",{size:U.value/1024/1024+" MB"})),1)),O=e=>{S(JSON.parse(e.message))};return(t,r)=>{const a=c("el-upload"),u=c("el-progress");return n(),s(_,null,[o(a,{action:v(j),headers:{...v(g)(),...v(f)()},accept:v(k),"before-upload":N,"on-success":e.onSuccess,"on-progress":(e,t)=>$.value=t,"on-error":O,"show-file-list":!1,disabled:e.disabled,multiple:e.multiple,drag:""},{default:p((()=>[d(y(e.button??t.$t("clickOrDragToUpload")),1)])),_:1},8,["action","headers","accept","on-success","on-progress","disabled","multiple"]),"uploading"===$.value.status?(n(),m(u,{key:0,percentage:parseInt($.value.percentage,10)},null,8,["percentage"])):b("",!0)],64)}}});e("B",h(t,[["__scopeId","data-v-5165bd65"]]))}}}));
