import{n as _}from"./index-BTglIPU2.js?v=1773287522785";import{u as y}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{a as x}from"./mail-COTHIXbY.js?v=1773287522785";import{k as L,an as h,r as k,$ as B,a8 as M,S as i,ao as r}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a6 as U}from"./naive-ui--dJnpVcV.js?v=1773287522785";const S=L({__name:"index",props:r({isInit:{type:Boolean,default:!1}},{value:{},valueModifiers:{}}),emits:r(["change"],["update:value"]),setup(o,{expose:m,emit:p}){const c=o,t=p,{loading:f,setLoading:l}=y(),n=h(o,"value"),s=k([]),v=(e,a)=>{t("change",e,a)},u=async()=>{try{l(!0);const{message:e}=await x();_(e)&&e.length>0&&(s.value=[],s.value=e.map(a=>({label:a.username,value:a.username,data:a})),n.value||(n.value=e[0].username,t("change",e[0].username,s.value[0])))}finally{l(!1)}};return c.isInit&&u(),m({getList:u}),(e,a)=>{const d=U;return B(),M(d,{value:n.value,"onUpdate:value":[a[0]||(a[0]=g=>n.value=g),v],loading:i(f),filterable:!0,options:i(s)},null,8,["value","loading","options"])}}});export{S as _};
