async function a(e){if(!e)return!1;try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0}catch{}try{const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.select();const o=document.execCommand("copy");return document.body.removeChild(t),o}catch{return!1}}function i(e,t,o="text/plain;charset=utf-8"){const n=e instanceof Blob?e:new Blob([e],{type:o}),r=URL.createObjectURL(n),c=document.createElement("a");c.href=r,c.download=t,document.body.appendChild(c),c.click(),document.body.removeChild(c),setTimeout(()=>URL.revokeObjectURL(r),1e3)}function d(e){if(!Number.isFinite(e)||e<0)return"—";if(e<1024)return`${e} B`;const t=["KB","MB","GB","TB"];let o=-1,n=e;do n/=1024,o++;while(n>=1024&&o<t.length-1);return`${n.toFixed(n>=100?0:n>=10?1:2)} ${t[o]}`}export{a as c,i as d,d as f};
