const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./util.DyniJHYf.js","./chunk.DuxOD-Sk.js","./preload-helper.CAj27AsG.js","./FileSystemFileHandle.B7tMxkkQ.js","./FileSystemHandle.DIBYSYyr.js","./config.C6PEK-vI.js","./downloader.6Uyng6C-.js","./sandbox.BSwYA5Ed.js","./FileSystemDirectoryHandle.Cy5k_ruS.js"])))=>i.map(i=>d[i]);
import{t as e}from"./preload-helper.CAj27AsG.js";import{t}from"./FileSystemHandle.DIBYSYyr.js";import{FileSystemDirectoryHandle as n}from"./FileSystemDirectoryHandle.Cy5k_ruS.js";import{FileSystemFileHandle as r,t as i}from"./FileSystemFileHandle.B7tMxkkQ.js";var a=globalThis.showDirectoryPicker;async function o(t={}){if(a&&!t._preferPolyfill)return a(t);let n=document.createElement(`input`);n.type=`file`,n.webkitdirectory=!0,n.multiple=!0,n.style.position=`fixed`,n.style.top=`-100000px`,n.style.left=`-100000px`,document.body.appendChild(n);let r=e(()=>import(`./util.DyniJHYf.js`).then(e=>e.n),__vite__mapDeps([0,1,2]),import.meta.url);return await new Promise(e=>{n.addEventListener(`change`,e),n.click()}),r.then(e=>e.getDirHandlesFromInput(n))}var s={accepts:[]},c=globalThis.showOpenFilePicker;async function l(t={}){let n={...s,...t};if(c&&!t._preferPolyfill)return c(n);let r=document.createElement(`input`);r.type=`file`,r.multiple=n.multiple,r.accept=(n.accepts||[]).map(e=>[...(e.extensions||[]).map(e=>`.`+e),...e.mimeTypes||[]]).flat().join(`,`),Object.assign(r.style,{position:`fixed`,top:`-100000px`,left:`-100000px`}),document.body.appendChild(r);let i=e(()=>import(`./util.DyniJHYf.js`).then(e=>e.n),__vite__mapDeps([0,1,2]),import.meta.url);return await new Promise(e=>{r.addEventListener(`change`,e,{once:!0}),r.click()}),r.remove(),i.then(e=>e.getFileHandlesFromInput(r))}var u=globalThis.showSaveFilePicker;async function d(t={}){if(u&&!t._preferPolyfill)return u(t);t._name&&(console.warn("deprecated _name, spec now have `suggestedName`"),t.suggestedName=t._name);let{FileSystemFileHandle:n}=await e(async()=>{let{FileSystemFileHandle:e}=await import(`./FileSystemFileHandle.B7tMxkkQ.js`);return{FileSystemFileHandle:e}},__vite__mapDeps([3,4,5,0,1,2]),import.meta.url),{FileHandle:r}=await e(async()=>{let{FileHandle:e}=await import(`./downloader.6Uyng6C-.js`);return{FileHandle:e}},__vite__mapDeps([6,5,0,1,2]),import.meta.url);return new n(new r(t.suggestedName))}globalThis.DataTransferItem&&!DataTransferItem.prototype.getAsFileSystemHandle&&(DataTransferItem.prototype.getAsFileSystemHandle=async function(){let t=this.webkitGetAsEntry(),[{FileHandle:n,FolderHandle:r},{FileSystemDirectoryHandle:i},{FileSystemFileHandle:a}]=await Promise.all([e(()=>import(`./sandbox.BSwYA5Ed.js`),__vite__mapDeps([7,0,1,2]),import.meta.url),e(()=>import(`./FileSystemDirectoryHandle.Cy5k_ruS.js`),__vite__mapDeps([8,2,4,0,1]),import.meta.url),e(()=>import(`./FileSystemFileHandle.B7tMxkkQ.js`),__vite__mapDeps([3,4,5,0,1,2]),import.meta.url)]);return t.isFile?new a(new n(t,!1)):new i(new r(t,!1))});async function f(t,n={}){if(!t)return globalThis.navigator?.storage?.getDirectory()||globalThis.getOriginPrivateDirectory();let{FileSystemDirectoryHandle:r}=await e(async()=>{let{FileSystemDirectoryHandle:e}=await import(`./FileSystemDirectoryHandle.Cy5k_ruS.js`);return{FileSystemDirectoryHandle:e}},__vite__mapDeps([8,2,4,0,1]),import.meta.url),i=await t;return new r(await(i.default?i.default(n):i(n)))}export{n as FileSystemDirectoryHandle,r as FileSystemFileHandle,t as FileSystemHandle,i as FileSystemWritableFileStream,f as getOriginPrivateDirectory,o as showDirectoryPicker,l as showOpenFilePicker,d as showSaveFilePicker};