import{d as m,k as p,q as f,c as n,o as r,a,t as v,i as _}from"./app-Do7K7VDV.js";const g={class:"flex gap-x-2 items-center"},V=["href"],h=["src","alt"],y=m({__name:"ImageInput",props:["label","modelValue"],emits:["update:modelValue"],setup(s,{emit:u}){const o=s,i=u,e=p("");f(()=>{typeof o.modelValue=="string"&&(e.value=o.modelValue)});const c=l=>{const t=new FileReader;t.readAsDataURL(l),t.onload=()=>{e.value=t.result},i("update:modelValue",l)};return(l,t)=>(r(),n("div",null,[a("label",null,v(s.label),1),a("div",g,[e.value&&typeof e.value=="string"?(r(),n("a",{key:0,href:e.value,target:"_blank"},[a("img",{src:e.value,alt:e.value,class:"h-8"},null,8,h)],8,V)):_("",!0),a("input",{type:"file",accept:"image/*",class:"input",onInput:t[0]||(t[0]=d=>c(d.target.files[0]))},null,32)])]))}});export{y as _};
