const a=async(n,d)=>{try{const e=await fetch(n);if(!e.ok)throw new Error("Download failed");const t=await e.blob(),r=window.URL.createObjectURL(t),o=document.createElement("a");return o.href=r,o.download=d||"download",document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(r),!0}catch(e){return console.error("Download error:",e),window.open(n,"_blank","noopener,noreferrer"),!1}};export{a as d};
