import{S as e}from"./index-BMHRAnq5.js";const a=async a=>{let r;try{r=await fetch(e(a))}catch(e){throw new Error(`Downloading firmware failed: ${e}`)}if(!r.ok)throw new Error(`Downloading firmware failed: ${r.status}`);const t=new FileReader,s=await r.blob();return[{data:await new Promise((e=>{t.addEventListener("load",(()=>e(t.result))),t.readAsBinaryString(s)})),address:0}]},r=async(e,a,r,t)=>{r&&await e.eraseFlash();let s=0;for(const e of a)s+=e.data.length;let o=0;t(0),await e.writeFlash({fileArray:a,flashSize:"keep",flashMode:"keep",flashFreq:"keep",eraseAll:!1,compress:!0,reportProgress:(e,r,i)=>{const l=r/i*a[e].data.length,n=Math.floor((o+l)/s*100);r!==i?t(n):o+=l}}),t(100)};export{r as f,a as g};
//# sourceMappingURL=c.BjQzkQZY.js.map
