exports.default=function(e){void 0===e&&(e=[{}]);try{return Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,Promise.resolve(new Promise(function(r,t){var i=document.createElement("input");i.type="file",i.webkitdirectory=!0;var n=function(e){"function"==typeof c&&c(),r(e)},c=e[0].legacySetup&&e[0].legacySetup(n,function(){return c(t)},i);i.addEventListener("change",function(){var r=Array.from(i.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(r=r.filter(function(r){return r.webkitRelativePath.split("/").every(function(r){return!e[0].skipDirectory({name:r,kind:"directory"})})})):r=r.filter(function(e){return 2===e.webkitRelativePath.split("/").length}),n(r)}),i.click()}))}catch(e){return Promise.reject(e)}};
