"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function u(t){function i(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var n=e.done;return Promise.resolve(e.value).then(function(s){return{value:s,done:n}})}return u=function(e){this.s=e,this.n=e.next},u.prototype={s:null,n:null,next:function(){return i(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):i(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):i(n.apply(this.s,arguments))}},new u(t)}const m=async(t,i,e=t.name,n)=>{const s=[],y=[];var d,c=!1,v=!1;try{for(var h,f=(function(r){var o,a,l,p=2;for(typeof Symbol<"u"&&(a=Symbol.asyncIterator,l=Symbol.iterator);p--;){if(a&&(o=r[a])!=null)return o.call(r);if(l&&(o=r[l])!=null)return new u(o.call(r));a="@@asyncIterator",l="@@iterator"}throw new TypeError("Object is not async iterable")})(t.values());c=!(h=await f.next()).done;c=!1){const r=h.value,o=`${e}/${r.name}`;r.kind==="file"?y.push(r.getFile().then(a=>(a.directoryHandle=t,a.handle=r,Object.defineProperty(a,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>o})))):r.kind!=="directory"||!i||n&&n(r)||s.push(m(r,i,o,n))}}catch(r){v=!0,d=r}finally{try{c&&f.return!=null&&await f.return()}finally{if(v)throw d}}return[...(await Promise.all(s)).flat(),...await Promise.all(y)]};var w=async(t={})=>{t.recursive=t.recursive||!1;const i=await window.showDirectoryPicker({id:t.id,startIn:t.startIn});return m(i,t.recursive,void 0,t.skipDirectory)};exports.default=w;
