import{u as y}from"./vue-router-7f882520.js";import{d as S,l as w,o as s,c,$ as a,bl as i,bc as n,a as p,F as L,aI as C,O as I}from"./@vue-cb50a1c4.js";import{v as b,l as $,I as l,q as x,L as D}from"./index-ae60edf9.js";import"./index-fc073ec7.js";import{S as G}from"./index-7aceb4e5.js";import{_ as B}from"./index.vue_vue_type_script_setup_true_lang-1170722e.js";import{_ as N}from"./index.vue_vue_type_script_setup_true_lang-e7eadba1.js";import{_ as V}from"./index.vue_vue_type_script_setup_true_lang-fbf25b5f.js";import"./open-im-sdk-wasm-f19f04ec.js";import"./dayjs-4460abc8.js";import"./@amap-aca98dec.js";import"./vue-i18n-90d534a9.js";import"./@intlify-1c0af683.js";import"./pinia-de4079f2.js";import"./axios-7d5a0a64.js";import"./form-data-497f8b5e.js";import"./uuid-a960c1f4.js";import"./date-fns-f56f60e6.js";import"./@babel-7fd5df1e.js";import"./mitt-f7ef348c.js";import"./@vueuse-19adab01.js";import"./livekit-client-ca552de3.js";import"./@livekit-3058dbe8.js";import"./loglevel-e40a507a.js";import"./rxjs-2154ddb2.js";import"./tslib-8dbab242.js";import"./@vuemap-5ebdc63e.js";import"./lodash-es-91418b19.js";import"./use-id-22cfdfcf.js";import"./index-597402db.js";import"./arrows_left-f963ef62.js";import"./index-e4a7d928.js";const F={class:"page_container"},U={class:"relative flex-1 overflow-y-auto overflow-x-hidden"},E={class:"flex justify-center bg-white px-[22px] pt-1 pb-4 text-[#999]"},ge=S({__name:"index",setup(R){const m=b(),d=$(),u=y(),e=w({dataList:[],keyword:"",loading:!1}),h=()=>{e.loading=!0;let t;history.state.isGroup?t=l.searchGroups({keywordList:[e.keyword],isSearchGroupID:!1,isSearchGroupName:!0}):t=l.searchFriends({keywordList:[e.keyword],isSearchUserID:!1,isSearchNickname:!0,isSearchRemark:!0}),t.then(({data:o})=>{e.dataList=o}).catch(o=>x({error:o})).finally(()=>e.loading=!1)},f=t=>{if(history.state.isGroup){d.updateCurrentGroupInfo(t),u.push({path:"groupCard"});return}m.setUserCardData({baseInfo:t})};return(t,o)=>{const _=B,g=G,k=D;return s(),c("div",F,[a(_,{title:t.$t("placeholder.search")},null,8,["title"]),a(g,{modelValue:e.keyword,"onUpdate:modelValue":o[0]||(o[0]=r=>e.keyword=r),background:"#fff",placeholder:t.$t("placeholder.search"),autofocus:"",onSearch:h},null,8,["modelValue","placeholder"]),i(p("div",U,[(s(!0),c(L,null,C(e.dataList,(r,v)=>(s(),I(N,{class:"bg-white",key:r.userID||r.groupID,source:r,total:e.dataList.length,index:v,onClick:T=>f(r)},null,8,["source","total","index","onClick"]))),128))],512),[[n,e.dataList.length>0&&!e.loading]]),i(a(V,{description:t.$t("messageTip.searchEmpty")},null,8,["description"]),[[n,e.dataList.length===0&&!e.loading]]),i(p("div",E,[a(k,{size:"24",type:"spinner"})],512),[[n,e.loading]])])}}});export{ge as default};
