async function e(e,t,n,r){let i=new FormData;i.append(`file`,r);let a=await fetch(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(t)}/${encodeURIComponent(n)}/assets`,{method:`POST`,body:i});if(!a.ok){let e=await a.json().catch(()=>({error:a.statusText}));throw Error(e.error??`Upload failed`)}return a.json()}async function t(e,t){let n=await fetch(`/api/repos/${encodeURIComponent(e)}/assets`,{signal:t});if(!n.ok){let e=await n.json().catch(()=>({error:n.statusText}));throw Error(e.error??`Failed to list assets`)}return(await n.json()).assets}async function n(e){let t=await fetch(`/api/workspace/assets`,{signal:e});if(!t.ok){let e=await t.json().catch(()=>({error:t.statusText}));throw Error(e.error??`Failed to list workspace assets`)}return t.json()}async function r(e,t,n,r){let i=await fetch(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(t)}/${encodeURIComponent(n)}/assets/${encodeURIComponent(r)}`,{method:`DELETE`});if(!i.ok){let e=await i.json().catch(()=>({error:i.statusText}));throw Error(e.error??`Delete failed`)}}export{e as i,t as n,n as r,r as t};