1import{_ as N}from"./x_EWJMCM.js";import{_ as T}from"./Dkch5QKh.js";import{u as V,aB as q,aE as F,aA as K,a4 as P,aN as w,a8 as n,o as r,l as c,aT as R,s as h,aR as D,aL as j,aS as z,n as S,F as U,ag as G,ap as x,af as o,aF as H,e as J}from"./DG95LSu-.js";import{u as O}from"./satd74QT.js";const Q={class:"searchBox"},W={class:"searchBar"},X=["placeholder"],Y={key:0,class:"loader"},Z={key:1,class:"keywordsAutocomplete"},ee=["onClick"],se={class:"m"},ae=V({__name:"Search",props:{keywords:{type:String,required:!1}},setup(b,{expose:$}){const _=q(),m=F(),v=K(),a=o(""),l=o([]),s=o(!1),d=o(!1),B=H(),f=o(null),{isMobile:k}=O();let y=null;const C=b,g=()=>{s.value=!1,m.push({path:v("search"),query:{search:a.value,contains:!0}}),_.$trackEvent({kind:"search",name:"search",entity:{kind:k.value?"mobileSearch":"desktopSearch",identifier:"searchpage"}})},E=()=>{s.value=!1,m.push({path:v("search"),query:{search:a.value}}),_.$trackEvent({kind:"search",name:"search",entity:{kind:k.value?"mobileSearch":"desktopSearch",identifier:"searchpage"}})};P(()=>{document.addEventListener("click",()=>s.value=!1)});const p=o(!0);w(()=>C.keywords,e=>{e&&(p.value=!0,a.value=e)},{immediate:!0}),w(a,e=>{if(p.value){p.value=!1;return}if(clearTimeout(y),e.length<3){l.value=[],s.value=!1;return}y=setTimeout(async()=>{d.value=!0;try{const u=await(await fetch(`${B.public.api}/search/keywords:${e}`)).json();l.value=u?.items||[],s.value=l.value.length>0}catch(t){console.error("Erreur API :",t),s.value=!1}finally{d.value=!1}},300)});const I=e=>{a.value=e,s.value=!1,E()};function A(){f.value?.focus()}return $({focus:A}),(e,t)=>{const u=N,L=T;return n(),r("div",Q,[c("div",W,[c("div",{class:"relative",onClick:t[1]||(t[1]=R(()=>{},["stop"]))},[h(u,{class:"m"}),D(c("input",{type:"text",ref_key:"searchInput",ref:f,"onUpdate:modelValue":t[0]||(t[0]=i=>a.value=i),onKeydown:z(g,["enter"]),placeholder:e.$t("mainSearch")},null,40,X),[[j,a.value]]),d.value?(n(),r("div",Y,[h(L)])):S("",!0),s.value?(n(),r("ul",Z,[(n(!0),r(U,null,G(l.value,(i,M)=>(n(),r("li",{key:M,class:"",onClick:te=>I(i)},x(i),9,ee))),128))])):S("",!0)]),c("button",{onClick:g,class:""},[h(u,{class:"d"}),c("span",se,x(e.$t("search")),1)])])])}}}),le=J(ae,[["__scopeId","data-v-aeb0e395"]]);export{le as _};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.