import{S as Q,i as V,s as W,R as X,f as E,m as Y,b as u,t as w,c as Z,d as C,l as f,$ as m,p as g,N as x,O as p,P as $,v as ee,w as te,e as le,r as ne,A as ae,E as _,C as ie}from"./index.f808f2eb.js";function re(l){let t,a,r,c,d,b,y;const h=l[17].default,i=X(h,l,l[16],null);return{c(){t=E("div"),i&&i.c(),a=Y(),r=E("input"),u(r,"class","hidden-upload hidden"),u(r,"type","file"),u(r,"accept",l[0]),r.multiple=l[6]==="multiple"||void 0,u(r,"webkitdirectory",l[6]==="directory"||void 0),u(r,"mozdirectory",l[6]==="directory"||void 0),u(t,"class",c="w-full cursor-pointer h-full items-center justify-center text-gray-400 md:text-xl "+(l[2]?"min-h-[10rem] md:min-h-[15rem] max-h-[15rem] xl:max-h-[18rem] 2xl:max-h-[20rem]":"")),u(t,"theme",l[1]),w(t,"text-center",l[3]),w(t,"flex",l[4])},m(n,s){Z(n,t,s),i&&i.m(t,null),C(t,a),C(t,r),l[25](r),d=!0,b||(y=[f(r,"change",l[9]),f(t,"drag",m(g(l[18]))),f(t,"dragstart",m(g(l[19]))),f(t,"dragend",m(g(l[20]))),f(t,"dragover",m(g(l[21]))),f(t,"dragenter",m(g(l[22]))),f(t,"dragleave",m(g(l[23]))),f(t,"drop",m(g(l[24]))),f(t,"click",l[8]),f(t,"drop",l[10]),f(t,"dragenter",l[7]),f(t,"dragleave",l[7])],b=!0)},p(n,[s]){i&&i.p&&(!d||s&65536)&&x(i,h,n,n[16],d?$(h,n[16],s,null):p(n[16]),null),(!d||s&1)&&u(r,"accept",n[0]),(!d||s&4&&c!==(c="w-full cursor-pointer h-full items-center justify-center text-gray-400 md:text-xl "+(n[2]?"min-h-[10rem] md:min-h-[15rem] max-h-[15rem] xl:max-h-[18rem] 2xl:max-h-[20rem]":"")))&&u(t,"class",c),(!d||s&2)&&u(t,"theme",n[1]),s&12&&w(t,"text-center",n[3]),s&20&&w(t,"flex",n[4])},i(n){d||(ee(i,n),d=!0)},o(n){te(i,n),d=!1},d(n){n&&le(t),i&&i.d(n),l[25](null),b=!1,ne(y)}}}function de(l,t,a){let{$$slots:r={},$$scope:c}=t,{filetype:d=void 0}=t,{theme:b="default"}=t,{single_file:y=!0}=t,{include_file_metadata:h=!0}=t,{dragging:i=!1}=t,{style:n=""}=t,{boundedheight:s=!0}=t,{click:R=!0}=t,{center:D=!0}=t,{flex:j=!0}=t,k,O;const S=ae(),T=()=>{a(11,i=!i)},q=()=>{!R||k.click()},z=e=>{let o=Array.from(e);if(!(!e.length||!window.FileReader)){var F=[];o.forEach((U,M)=>{let A=new FileReader;A.readAsDataURL(U),A.onloadend=function(){F[M]=h?{name:U.name,size:U.size,data:this.result}:this.result,F.length===e.length&&S("load",y?F[0]:F)}})}},L=e=>{const o=e.target;!o.files||z(o.files)},N=e=>{var o;a(11,i=!1),(o=e.dataTransfer)!=null&&o.files&&z(e.dataTransfer.files)};function P(e){_.call(this,l,e)}function v(e){_.call(this,l,e)}function B(e){_.call(this,l,e)}function G(e){_.call(this,l,e)}function H(e){_.call(this,l,e)}function I(e){_.call(this,l,e)}function J(e){_.call(this,l,e)}function K(e){ie[e?"unshift":"push"](()=>{k=e,a(5,k)})}return l.$$set=e=>{"filetype"in e&&a(0,d=e.filetype),"theme"in e&&a(1,b=e.theme),"single_file"in e&&a(12,y=e.single_file),"include_file_metadata"in e&&a(13,h=e.include_file_metadata),"dragging"in e&&a(11,i=e.dragging),"style"in e&&a(14,n=e.style),"boundedheight"in e&&a(2,s=e.boundedheight),"click"in e&&a(15,R=e.click),"center"in e&&a(3,D=e.center),"flex"in e&&a(4,j=e.flex),"$$scope"in e&&a(16,c=e.$$scope)},[d,b,s,D,j,k,O,T,q,L,N,i,y,h,n,R,c,r,P,v,B,G,H,I,J,K]}class fe extends Q{constructor(t){super(),V(this,t,de,re,W,{filetype:0,theme:1,single_file:12,include_file_metadata:13,dragging:11,style:14,boundedheight:2,click:15,center:3,flex:4})}}export{fe as U};
