"use strict";const e=require("../../../../common/vendor.js");require("../../../adapter-vue.js");const n=require("../../../../common/assets.js"),r=require("../../../utils/env.js");Math||a();const a=()=>"../../common/Icon.js",u=e.defineComponent({__name:"index",props:{placeholder:{type:String,default:()=>e.Wt.t("TUISearch.搜索")},searchType:{type:String,default:"global",validator:e=>["global","conversation"].includes(e)}},setup(a){const u=a,t=e.ref(""),c=e.ref(""),o=e.ref(!1);function l(e){(null==e?void 0:e.searchType)===(null==u?void 0:u.searchType)&&(c.value=null==e?void 0:e.value,t.value=null==e?void 0:e.value)}function i(e){(null==e?void 0:e.searchType)===(null==u?void 0:u.searchType)&&(o.value=null==e?void 0:e.isSearching)}e.onMounted((()=>{e.Jt.watch(e.o.SEARCH,{currentSearchInputValue:l,currentSearchingStatus:i})})),e.onUnmounted((()=>{e.Jt.unwatch(e.o.SEARCH,{currentSearchInputValue:l,currentSearchingStatus:i})}));const s=()=>{t.value!==c.value&&e.Jt.update(e.o.SEARCH,"currentSearchInputValue",{value:t.value,searchType:u.searchType})},h=()=>{o.value=!1,e.Jt.update(e.o.SEARCH,"currentSearchingStatus",{isSearching:!1,searchType:u.searchType}),e.Jt.update(e.o.SEARCH,"currentSearchInputValue",{value:"",searchType:u.searchType})},p=()=>{e.Jt.update(e.o.SEARCH,"currentSearchingStatus",{isSearching:!0,searchType:u.searchType})},d=()=>{var n,r;null==(r=null==(n=e.i)?void 0:n.hideKeyboard)||r.call(n)};return(a,c)=>e.e({a:e.p({file:e.unref(n.searchIcon),width:"14px",height:"14px"}),b:u.placeholder,c:e.o$1(d),d:e.o$1(s),e:e.o$1(s),f:e.o$1(p),g:e.unref(t),h:e.o$1((n=>e.isRef(t)?t.value=n.detail.value:null)),i:e.unref(o)},e.unref(o)?{j:e.p({file:e.unref(n.closeIcon),width:"14px",height:"14px"}),k:e.o$1(h)}:{},{l:e.n(!e.unref(r.isPC)&&"tui-search-input-h5"),m:!e.unref(r.isPC)&&e.unref(o)&&"global"===u.searchType},!e.unref(r.isPC)&&e.unref(o)&&"global"===u.searchType?{n:e.t(e.unref(e.Wt).t("TUISearch.取消")),o:e.n(!e.unref(r.isPC)&&"tui-search-input-h5-cancel"),p:e.o$1(h)}:{},{q:e.n(!e.unref(r.isPC)&&"tui-search-input-container-h5"),r:e.n("global"===u.searchType?"tui-search-input-container-global":"tui-search-input-container-conversation")})}}),t=e._export_sfc(u,[["__scopeId","data-v-6d9c2069"]]);wx.createComponent(t);
