import{_ as n,d as o,o as d,c as r,r as p,i as f,t as u,a as h,n as m,b5 as i}from"./v5WcX6fg.js";import{g}from"./D5Cu5Chz.js";const y=o({props:{prompt:{type:String,default:"Select file"},multiple:{type:Boolean,default:!1},accept:{type:String,default:null},maxSize:{type:Number,default:null},showIcon:{type:Boolean,default:!0},shouldAlwaysReset:{type:Boolean,default:!1},longStyle:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["change"],data(){return{files:[]}},methods:{addFiles(e,l){(!l||this.shouldAlwaysReset)&&(this.files=e);const a={maxSize:this.maxSize,alertOnInvalid:!0};this.files=[...this.files].filter(s=>g(s,a)),this.files.length>0&&this.$emit("change",this.files)},handleDrop(e){this.addFiles(e.dataTransfer.files)},handleChange(e){this.addFiles(e.target.files)}}}),S=["multiple","accept","disabled"];function c(e,l,a,s,B,b){return d(),r("label",{class:m({"long-style":e.longStyle}),onDrop:l[1]||(l[1]=i((...t)=>e.handleDrop&&e.handleDrop(...t),["prevent"])),onDragover:l[2]||(l[2]=i(()=>{},["prevent"]))},[p(e.$slots,"default",{},void 0,!0),f(" "+u(e.prompt)+" ",1),h("input",{type:"file",multiple:e.multiple,accept:e.accept,disabled:e.disabled,onChange:l[0]||(l[0]=(...t)=>e.handleChange&&e.handleChange(...t))},null,40,S)],34)}const D=n(y,[["render",c],["__scopeId","data-v-eadd0e21"]]);export{D as F};