import{$ as e,I as t,O as n,X as r,Z as i,w as a,x as o}from"./app-CWV4wngb.js";import{t as s}from"./i18n-BR4oMRez.js";var c={key:0,class:`animate-spin`,width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.4`,"stroke-linecap":`round`},l={key:1,width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},u=[`accept`],d=n({__name:`UploadButton`,props:{label:{},accept:{},uploading:{type:Boolean}},emits:[`file`],setup(n,{emit:d}){let f=d;function p(e){let t=e.target,n=t.files?.[0];n&&f(`file`,n),t.value=``}return(d,f)=>(t(),a(`label`,{class:i([`inline-flex cursor-pointer items-center gap-2 rounded-lg border border-line bg-surface-2 px-3.5 py-2 text-sm font-semibold text-ink-2 transition hover:border-primary/50 hover:bg-appbg hover:text-ink`,n.uploading?`pointer-events-none opacity-70`:``])},[n.uploading?(t(),a(`svg`,c,[...f[0]||=[o(`path`,{d:`M21 12a9 9 0 1 1-6.2-8.5`},null,-1)]])):(t(),a(`svg`,l,[...f[1]||=[o(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12`},null,-1)]])),o(`span`,null,e(n.uploading?r(s)(`Uploading…`):n.label||r(s)(`Choose image`)),1),o(`input`,{type:`file`,accept:n.accept||`image/png,image/jpeg,image/webp`,class:`sr-only`,onChange:p},null,40,u)],2))}});export{d as t};