1import{au as T,b as $,h as z,t as y,y as A,_ as N}from"./EW60oKse.js";import{z as Q,i as h,b as o,k as U,H as j,w as r,O as v,P as D,R as b,a7 as E,aa as F,u as p,c as G,U as g,W as w,a1 as H}from"./QVWpw_zs.js";import{u as K}from"./D1BwKX6u.js";const W={class:"relative inline-block w-full"},q=["placeholder"],J=Q({__name:"LayoutSearchInput",props:{type:{}},emits:["click-away"],setup(_,{expose:k,emit:S}){const{isCustomSearchVisible:x}=K(),{escape:C,enter:I}=T(),f=$(),M=z(),i=_,O=S,s=h("searchActive",o(!1)),a=h("searchQuery",o("")),V=h("isSideMenuOpened",o(!1)),B=h("mobileSearchOpen",o(!1)),L=o(null),c=o(null),u=o(!1),P=U(()=>!u.value&&i.type!=="mobile"&&x()),m=()=>{var t;const{focused:e}=y(c);e.value=!1,(t=c.value)==null||t.blur()},l=function(){var e;s.value=!1,a.value="",u.value=!1,B.value=!1,(e=document==null?void 0:document.body)==null||e.classList.remove("overflow-y-hidden"),m(),O("click-away")},R=async()=>{s.value&&a.value.length>1&&(l(),await M.push(f.path),history.replaceState({...history.state,...[]},""),history.pushState(null,document.title,f.path))};return j(()=>{window.onpopstate=R}),r(()=>f.fullPath,()=>{s.value&&l()}),r(I,()=>{m()}),r(C,()=>{s.value&&l()}),r(s,e=>{var t,n;if(e){const{focused:d}=y(c);d.value=e,a.value.length>0&&((t=document==null?void 0:document.body)==null||t.classList.add("overflow-y-hidden"),u.value=!0,setTimeout(()=>{window.scrollTo(0,0)},0))}else u.value=!1,(n=document==null?void 0:document.body)==null||n.classList.remove("overflow-y-hidden")}),r(()=>a.value,e=>{s.value=e.length>1,e.length>=1&&s.value&&(V.value=!1)}),k({closeSearch:l}),(e,t)=>{const n=A;return v(),D("div",{ref_key:"searchContainer",ref:L,class:g(["relative group lg:pr-0 transition duration-300 inline-block w-full box-border",{hidden:p(P)}])},[b("div",W,[E(b("input",{ref_key:"searchInput",ref:c,id:"mainSearchInput","onUpdate:modelValue":t[0]||(t[0]=d=>G(a)?a.value=d:null),autocomplete:"off",type:"search",class:g([{"bg-white text-[16px]":i.type&&i.type=="mobile","bg-brand-lightGray rounded-full":!i.type},"border-transparent h-[35px] font-light px-6 py-1 outline-none box-border w-full md:text-xs"]),placeholder:e.$t("search.searchPlaceholder"),onClick:t[1]||(t[1]=d=>s.value=!0)},null,10,q),[[F,p(a)]]),p(s)&&p(a).length>0?(v(),w(n,{key:0,src:"/close.svg",height:"15",width:"15",alt:"Søg",class:"absolute hidden md:block right-3 lg:right-6 top-1/2 -translate-y-1/2 cursor-pointer",onClick:H(l,["prevent"])})):(v(),w(n,{key:1,src:"/search.svg",height:"15",width:"15",alt:"Søg",class:"absolute hidden md:block right-3 lg:right-6 top-1/2 -translate-y-1/2 pointer-events-none"}))])],2)}}}),ee=N(J,[["__scopeId","data-v-3f871f03"]]);export{ee as default};
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.