import{d as p,N as C,a as R,C as T,r as k,b as n,e as I,f as b,g as l,w as u,s as B,l as N,A as Q,J as A}from"./vue.BxlDVA1H.js";import{y as O,a6 as H}from"./index.lP_uh0LI.js";import{_ as M}from"./_plugin-vue_export-helper.DlAUqK2U.js";const U={class:"layout-search-dialog"},$=p({name:"layoutBreadcrumbSearch"}),j=p({...$,setup(D,{expose:f}){const _=O(),{tagsViewRoutes:h}=C(_),m=R(),{t:w}=H.useI18n(),d=T(),o=k({isShowSearch:!1,menuQuery:"",tagsViewList:[]}),S=()=>{o.menuQuery="",o.isShowSearch=!0,x(),A(()=>{setTimeout(()=>{m.value.focus()})})},V=()=>{o.isShowSearch=!1},g=(e,t)=>{let s=e?o.tagsViewList.filter(L(e)):o.tagsViewList;t(s)},L=e=>t=>t.path.toLowerCase().indexOf(e.toLowerCase())>-1||t.meta.title.toLowerCase().indexOf(e.toLowerCase())>-1||w(t.meta.title).indexOf(e.toLowerCase())>-1,x=()=>{if(o.tagsViewList.length>0)return!1;h.value.map(e=>{var t;(t=e.meta)!=null&&t.isHide||o.tagsViewList.push({...e})})},v=e=>{var c,r,i;let{path:t,redirect:s}=e;(c=e.meta)!=null&&c.isLink&&!((r=e.meta)!=null&&r.isIframe)?window.open((i=e.meta)==null?void 0:i.isLink):s?d.push(s):d.push(t),V()};return f({openSearch:S}),(e,t)=>{const s=n("ele-Search"),c=n("el-icon"),r=n("SvgIcon"),i=n("el-autocomplete"),y=n("el-dialog");return b(),I("div",U,[l(y,{modelValue:o.isShowSearch,"onUpdate:modelValue":t[1]||(t[1]=a=>o.isShowSearch=a),"destroy-on-close":"","show-close":!1,width:"560px"},{default:u(()=>[l(i,{modelValue:o.menuQuery,"onUpdate:modelValue":t[0]||(t[0]=a=>o.menuQuery=a),"fetch-suggestions":g,placeholder:e.$t("message.user.searchPlaceholder"),ref_key:"layoutMenuAutocompleteRef",ref:m,onSelect:v,"fit-input-width":!0},{prefix:u(()=>[l(c,{class:"el-input__icon"},{default:u(()=>[l(s)]),_:1})]),default:u(({item:a})=>[B("div",null,[l(r,{name:a.meta.icon,class:"mr5"},null,8,["name"]),N(" "+Q(e.$t(a.meta.title)),1)])]),_:1},8,["modelValue","placeholder"])]),_:1},8,["modelValue"])])}}}),P=M(j,[["__scopeId","data-v-7fab5b02"]]);export{P as default};
