"use strict";const e=require("../../../../common/vendor.js");require("../../../adapter-vue.js");const r=require("../../../../common/assets.js"),a=require("../../../utils/env.js"),t=require("../../../utils/lodash.js");Math||u();const u=()=>"../../common/Icon.js",n=e.defineComponent({__name:"index",setup(u){const n=e.Wt.t("TUIContact.输入ID"),c=e.ref(!1),s=e.ref(""),o=e.ref({user:{label:"联系人",list:[]},group:{label:"群聊",list:[]}}),i=t.debounce((function(e){c.value=e}),200),l=async()=>{s.value&&(e.R.callService({serviceName:e.E.TUISearch.SERVICE.NAME,method:e.E.TUISearch.SERVICE.METHOD.SEARCH_USER,params:{userID:s.value}}).then((e=>{o.value.user.list=e.data})).catch((e=>{o.value.user.list=[],console.warn("search user error",e)})),e.R.callService({serviceName:e.E.TUISearch.SERVICE.NAME,method:e.E.TUISearch.SERVICE.METHOD.SEARCH_GROUP,params:{groupID:s.value}}).then((e=>{o.value.group.list=[e.data.group]})).catch((e=>{o.value.group.list=[],console.warn("search group error",e)})))};return e.watch((()=>o.value),(()=>{e.Jt.update(e.o.CUSTOM,"currentContactSearchResult",o.value)}),{deep:!0,immediate:!0}),e.watch((()=>c.value),(()=>{e.Jt.update(e.o.CUSTOM,"currentContactSearchingStatus",c.value),c.value&&(s.value="",o.value.user.list=[],o.value.group.list=[])}),{deep:!0,immediate:!0}),e.i.updateContactSearch=l,e.i.closeSearching=()=>{c.value=!1},(t,u)=>e.e({a:!e.unref(c)||!e.unref(a.isPC)},e.unref(c)&&e.unref(a.isPC)?{}:{b:e.p({file:e.unref(c)?e.unref(r.backIcon):e.unref(r.addSVG),width:e.unref(c)?"20px":"14px",height:e.unref(c)?"20px":"14px"}),c:e.n(!e.unref(a.isPC)&&"tui-contact-search-h5-header-icon"),d:e.o$1((r=>e.unref(i)(!e.unref(c)))),e:e.t(e.unref(e.Wt).t("TUIContact.添加好友/群聊")),f:e.n(!e.unref(a.isPC)&&"tui-contact-search-h5-header-title"),g:e.n(!e.unref(a.isPC)&&"tui-contact-search-h5-header"),h:e.n(e.unref(c)&&"tui-contact-searching-h5-header"),i:e.o$1((r=>e.unref(i)(!0)))},{j:e.unref(c)},e.unref(c)?{k:e.unref(n),l:e.o$1(l),m:e.o$1(l),n:e.o$1(l),o:e.unref(s),p:e.o$1((r=>e.isRef(s)?s.value=r.detail.value:null)),q:e.t(e.unref(e.Wt).t("取消")),r:e.o$1((e=>c.value=!1)),s:e.n(!e.unref(a.isPC)&&"tui-contact-search-h5-main")}:{},{t:e.n(!e.unref(a.isPC)&&"tui-contact-search-h5")})}}),c=e._export_sfc(n,[["__scopeId","data-v-5e80fdd8"]]);wx.createComponent(c);
