1import{P as I}from"./Page-DgcQQH3E.js";import{b as $,f as C,o as i,g as u,y as p,M as _,_ as F,A as U,p as w,h as s,a1 as T,s as A,u as M,F as L,m as x,R as N,j as g,x as H,t as n,l as v,a0 as d,w as f,U as b,k,O,r as R,a2 as Q,a3 as D,a4 as W,a as E}from"./vue-root-Cvno3FDg.js";import{C as G}from"./Confirmation-C0IEvMzn.js";import{Country as y}from"./Country-BWrlv4HE.js";import{Feature as z}from"./Feature-DUpvScev.js";import{StaticPage as j}from"./StaticPage-ZrLecGTP.js";import{D as Z}from"./dropdown-C1HY57F1.js";const J=$({name:"autocomplete-suggestion",props:{name:{type:String,required:!0},searchValue:{type:String,required:!0},index:Number,selectedIndex:Number},computed:{highlightedText(){const e=V(this.name).indexOf(V(this.searchValue));if(e===-1)return this.name;const t=e+this.searchValue.length;return this.name.substring(0,e)+'<span class="bg-primary-400/20">'+this.name.substring(e,t)+"</span>"+this.name.substring(t)},isSelected(){return this.index===this.selectedIndex}},methods:{accept(){this.$emit("acceptSuggestion",this.index)}}});function V(e){return(e||"").toLowerCase().replace("é","e").replace("è","e").replace("â","a").replace("ê","e").replace("ë","e").replace("ç","c").replace("ï","i").replace("ö","o").replace("ô","o").replace("Å","oe").replace("-"," ").trim()}const X=["innerHTML"];function Y(e,t,r,l,m,S){return i(),u("div",{class:p(["py-2 px-4 rounded hover:bg-grey-100 cursor-pointer text-sm",{"bg-grey-100":e.isSelected}]),onClick:t[0]||(t[0]=(...h)=>e.accept&&e.accept(...h)),innerHTML:e.highlightedText},null,10,X)}const ee=C(J,[["render",Y]]),c={Tab:9,Enter:13,Shift:16,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40},te=$({name:"autocomplete-input",components:{suggestion:ee},props:{id:String,fetchUrl:{type:String,required:!0},addStreets:Boolean,placeholder:String,name:String,value:{type:String,required:!0},inputProperty:String,extraParams:{},nextTabInput:String,disabled:Boolean,readonly:Boolean,small:Boolean,variant:{type:String,default:"menu"},autofocus:Boolean,country:String},data(){return{suggestions:[],cityStreetsSuggestions:[],selectedIndex:0,searchTerm:this.value,isReady:!1,shouldHaveSuggestions:!1}},watch:{value(e){this.searchTerm=e},searchTerm(e){this.$parent[this.inputProperty]=e}},computed:{hasSuggestions(){return this.suggestions.length>0},showSuggestions(){return this.hasSuggestions},hasError(){return!this.hasSuggestions&&this.shouldHaveSuggestions&&this.searchTerm!==""},shouldFetchStreets(){return this.addStreets&&(this.country===y.NL||this.country===y.LU)&&/^\d{2,}/.test(this.searchTerm)}},methods:{makeSuggestions(e){const t=this.searchTerm.length<2;if(!(e.keyCode===c.Tab||e.keyCode===c.Shift||e.keyCode===c.Enter||e.keyCode===c.ArrowLeft||e.keyCode===c.ArrowUp||e.keyCode===c.ArrowRight||e.keyCode===c.ArrowDown)){if(t){this.clearSuggestions();return}this.fetchUrl!==""&&this.fetchUrl!==void 0&&this.fetchSuggestions()}},clearSuggestions(){this.suggestions=[]},selectPrev(){this.selectedIndex=this.selectedIndex>0?this.selectedIndex-1:0},selectNext(){const e=this.suggestions.length-1;this.selectedIndex=this.selectedIndex<e?this.selectedIndex+1:e},acceptSelected(e,t){if(e){var r="";if(!this.isReady&&(e.keyCode===c.Tab||e.keyCode===c.Enter)||(e.keyCode===c.Enter||e.keyCode===c.Tab)&&this.suggestions.length===0)return;e.keyCode===c.Enter&&e.preventDefault()}if(this.shouldFetchStreets&&this.id=="location"){const l=t?this.cityStreetsSuggestions[t]:this.cityStreetsSuggestions[this.selectedIndex];r=l.postCode+" "+l.city,this.$emit("street",l.street)}else t?r=this.suggestions[t]:r=this.suggestions[this.selectedIndex];this.clearSuggestions(),this.shouldHaveSuggestions=!1,this.searchTerm=r,this.$emit("select",r),e&&e.keyCode===c.Tab&&!e.shiftKey&&this.nextTabInput&&(e.preventDefault(),this.focusInput(this.nextTabInput))},async ajaxFetchSuggestions(){F.debounce(async()=>await this.fetchSuggestions(),100)},async fetchSuggestions(){this.isReady=!1;let e=F.merge(this.extraParams,{searchTerm:this.searchTerm,country:this.country});this.shouldHaveSuggestions=!1;try{if(this.shouldFetchStreets){const t=await U.getAsync("/ajax/autocomplete/citystreetsuggestions",e);this.cityStreetsSuggestions=t,this.suggestions=t.map(r=>`${r.postCode} ${r.city}: ${r.street}`)}else this.suggestions=await U.getAsync(this.fetchUrl,e),console.log(this.suggestions);this.shouldHaveSuggestions=!0}catch{this.shouldHaveSuggestions=!1}finally{this.isReady=!0}},acceptSuggestion(e){this.acceptSelected(null,e)},focusInput(e){let t=document.getElementById(e);_(()=>{t&&t.focus()})}},mounted(){document.addEventListener("click",()=>{this.clearSuggestions()}
1),this.autofocus&&this.id&&this.focusInput(this.id)}}),se=["placeholder","readonly","disabled","name","id","value"],re={key:0,id:"autocompleteWrapper",class:"absolute bg-white p-4 rounded-xl shadow-xl mt-2 z-50"};function oe(e,t,r,l,m,S){const h=w("suggestion");return i(),u("div",null,[s("input",{class:p({"border-red":e.hasError,"":e.small,"py-4 px-6 mobile:py-3 mobile:px-4 rounded-r-none ":e.variant=="dashboard"||e.variant=="dashboard-first","rounded-l-none":e.variant=="dashboard","rounded-l-lg":e.variant=="dashboard-first"}),type:"text",placeholder:e.placeholder,readonly:e.readonly,disabled:e.disabled,name:e.name,id:e.id,autocomplete:"off",value:e.searchTerm,onInput:t[0]||(t[0]=a=>e.searchTerm=a.target.value),onKeyup:[t[1]||(t[1]=(...a)=>e.makeSuggestions&&e.makeSuggestions(...a)),t[2]||(t[2]=T((...a)=>e.selectNext&&e.selectNext(...a),["down"])),t[3]||(t[3]=T((...a)=>e.selectPrev&&e.selectPrev(...a),["up"]))],onKeypress:t[4]||(t[4]=T((...a)=>e.acceptSelected&&e.acceptSelected(...a),["enter"])),onKeydown:t[5]||(t[5]=T((...a)=>e.acceptSelected&&e.acceptSelected(...a),["tab"]))},null,42,se),A(H,{name:"slide-fade"},{default:M(()=>[e.showSuggestions?(i(),u("div",re,[(i(!0),u(L,null,x(e.suggestions,(a,o)=>(i(),N(h,{name:a,"search-value":e.searchTerm,"selected-index":e.selectedIndex,index:o,onAcceptSuggestion:q=>e.acceptSuggestion(o),key:o},null,8,["name","search-value","selected-index","index","onAcceptSuggestion"]))),128))])):g("",!0)]),_:1})])}const P=C(te,[["render",oe]]),ne=$({name:"ayce-upgrade",props:{country:{country:String,required:!0}},data(){return{brandName:window.cw.brandName}}}),ae={class:"mt-6"},ie={class:"flex gap-x-12 isolate overflow-hidden pt-0 px-8 mobile:px-6 relative rounded-xl border border-grey-200"},le={class:"flex-auto max-w-xs mobile:max-w-none py-8 pr-2 mobile:py-6"},ue={class:"font-bold text-base tracking-tight mb-3"},de={class:"leading-6 text-sm text-grey-800"},ce={class:"flex gap-6 items-center mt-5 mobile:justify-between"},me=["href"];function he(e,t,r,l,m,S){return i(),u("div",ae,[s("div",ie,[s("div",le,[s("h2",ue,n(e.translate("ayce_upgrade_title")),1),s("p",de,n(e.translate("ayce_upgrade_text",e.brandName)),1),s("div",ce,[s("a",{href:"/upgrade/ayce?countries="+e.country,class:"btn btn-primary"},[v(n(e.translate("upgrade_now"))+" ",1),t[0]||(t[0]=s("i",{class:"far fa-angle-right ml-1.5"},null,-1))],8,me)])]),t[1]||(t[1]=s("div",{class:"absolute top-0 bottom-0 max-h-full right-0 w-[32%] tablet:hidden flex items-center justify-center overflow-clip"},[s("div",{class:"inset-0 h-full w-full absolute z-10 bg-gradient-to-r from-white to-transparent"}),s("img",{class:"-z-10 absolute bg-white/5 h-full max-w-none rounded-md",src:"/images-new/home/benefralux.svg",alt:"App screenshot"})],-1))])])}const B=C(ne,[["render",he]]),pe=$({name:"companies",components:{AutocompleteInput:P,AyceUpgrade:B},props:{value:String,country:String,hasMultiCountry:Boolean,canSeeAyceUpgrade:Boolean,hasCountryAccess:Boolean},data:function(){return{nameOrVat:"",location:"",minimumSearchLength:2,errorMessage:"",errorField:""}},methods:{showError(e,t){this.errorMessage=t&&this.translate(t),this.errorField=e},hideError(){this.errorField="",this.errorMessage=""},validateSubmit(e){let t="";if(this.nameOrVat===""?t="no_search_result_reason_company_name_missing":this.nameOrVat.length<this.minimumSearchLength&&(t="no_search_result_reason_company_name_too_short"),t==="")this.hideError();else return this.showError("nameOrVat",t);e.target.submit()}},mounted(){_(()=>{setTimeout(()=>{this.$refs.nameOrVat.focus()},0)}),this.nameOrVat=this.value||(d.getUrlParameter("NameOrVat")??""),this.location=d.getUrlParameter("Location")??""}}),ge={class:"grid grid-cols-[4fr_3fr_1fr] gap-4 mobile:grid-cols-1"},ye={for:"",class:"text-xs font-medium text-grey-700"},fe={for:"",class:"text-xs font-medium text-grey-700"},be={class:"mt-auto w-full"},Se={class:"btn btn-primary w-full",type:"submit"},ve={key:1,class:"text-barometer-red text-sm mt-2"};function we(e,t,r,l,m,S){const h=w("autocomplete-input"),a=w("ayce-upgrade");return i(),u("form",{method:"GET",onSubmit:t[2]||(t[2]=k((...o)=>e.validateSubmit&&e.validateSubmit(...o),["prevent"])),action:"/search/companies"},[f(s("input",{type:"hidden",name:"country","onUpdate:modelValue":t[0]||(t[0]=o=>e.country=o)},null,512),[[b,e.country]]),s("div",ge,[s("div",null,[s("label",ye,n(e.translate("placeholder_bedrijf")),1),f(s("input",{name:"NameOrVat",ref:"nameOrVat",autocomplete:"off",type:"text","onUpdate:modelValue":t[1]||(t[1]=o=>e.nameOrVat=o),class:p({error:e.errorField=="nameOrVat"})},null,2),[[b,e.nameOrVat]])]),s("div",null,[s("label",fe,n(e.translate("placeholder_gemeente")),1),A(h,{"fetch-url":"/ajax/autocomplete/citysuggestions",name:"Location",country:e.country,value:e.location},null,8,["country","value"])]),s("div",be,[s("button",Se,n(e.translate("zoek")),1)])]),!e.hasCountryAccess&&e.canSeeAyceUpgrade?(i(),N(a,{key:0,country:e.country},null,8,["country"])):g("",!0),e.errorMessage!==""?(i(),u("div",ve,n(e.errorMessage),1)):g("",!0)],32)}const $e=C(pe,[["render",we]]),Ce=$({name:"manager-search",components:{AyceUpgrade:B,AutocompleteInput:P},props:{permissions:{type:Object,required:!0},country:String,canSeeAyceUpgrade:Boolean,hasCountryAccess:Boolean},data(){return{firstName:"",lastName:"",minimumSearchLength:2,errorMessage:"",errorField:"",StaticPage:j}},computed:{canSearchOnManager(){return this.permissions[z.SEARCH_ON_MANAGER]},isBlockedBecauseOfCountry(){return this.country=="nl"}},methods:{showError(e,t){this.errorMessage=t&&this.translate(t),this.errorField=e},hideError(){this.errorField="",this.errorMessage=""},validateSubmit(e){if(this.lastName==="")return this.showError("lastName","no_search_result_reason_last_name_missing");if(this.lastName.length<this.minimumSearchLength)return this.showError("lastName","no_search_result_reason_last_name_too_short");if(this.firstName==="")return this.showError("firstName","no_search_result_reason_first_name_missing");if(this.firstName.length<this.minimumSearchLength)return this.showError("firstName","no_search_result_reason_first_name_too_short");e.target.submit()}},mounted(){_(()=>{setTimeout(()=>{this.canSearchOnManager&&this.$refs.lastName.focus()},0)}),this.firstName=d.getUrlParameter("FirstName")??"",this.lastName=d.getUrlParameter("LastName")??""}}),ke={key:0},_e={class:"text-center py-8 px-5 space-y-8"},Ae=["alt"],Ne={class:"mb-3 font-bold text-xl"},Te={class:"text-sm text-grey-800 max-w-sm mx-auto"},Oe={href:"/upgrade/mandates",class:"btn btn-primary"},Ee={class:"grid grid-cols-[4fr_3fr_1fr] gap-4 mobile:grid-cols-1"},Ue={for:"",class:"text-xs font-medium text-grey-700"},Me=["disabled"],Pe={for:"",class:"text-xs font-medium text-grey-700"},Be=["disabled"],Fe={class:"mt-auto w-full"},Ve=["disabled"],Ie={key:1,class:"text-barometer-red text-sm mt-2"},Le={key:2,class:"text-grey-500 text-sm mt-2"};function xe(e,t,r,l,m,S){const h=w("ayce-upgrade");return e.canSearchOnManager?(i(),u("form",{key:1,method:"GET",onSubmit:t[3]||(t[3]=k((...a)=>e.validateSubmit&&e.validateSubmit(...a),["prevent"])),action:"/search/persons"},[f(s("input",{type:"hidden",name:"country","onUpdate:modelValue":t[0]||(t[0]=a=>e.country=a)},null,512),[[b,e.country]]),s("div",Ee,[s("div",null,[s("label",Ue,n(e.translate("placeholder_familienaam")),1),f(s("input",{name:"LastName",ref:"lastName",disabled:e.isBlockedBecauseOfCountry||!e.hasCountryAccess,autocomplete:"off",type:"text","onUpdate:modelValue":t[1]||(t[1]=a=>e.lastName=a),class:p({error:e.errorField=="lastName"})},null,10,Me),[[b,e.lastName]])]),s("div",null,[s("label",Pe,n(e.translate("placeholder_voornaam")),1),f(s("input",{name:"FirstName",ref:"firstName",disabled:e.isBlockedBecauseOfCountry||!e.hasCountryAccess,autocomplete:"off",type:"text","onUpdate:modelValue":t[2]||(t[2]=a=>e.firstName=a),class:p({error:e.errorField=="firstName"})},null,10,Be),[[b,e.firstName]])]),s("div",Fe,[s("button",{class:"btn btn-primary w-full",type:"submit",disabled:e.isBlockedBecauseOfCountry||!e.hasCountryAccess},n(e.translate("zoek")),9,Ve)])]),!e.hasCountryAccess&&e.canSeeAyceUpgrade?(i(),N(h,{key:0,country:e.country},null,8,["country"])):g("",!0),e.errorMessage!==""?(i(),u("div",Ie,n(e.errorMessage),1)):g("",!0),e.isBlockedBecauseOfCountry?(i(),u("div",Le,[...t[4]||(t[4]=[s("i",{class:"fas fa-info-circle"},null,-1),v(" Het is niet mogelijk om te zoeken op personen in dit land. ",-1)])])):g("",!0)],32)):(i(),u("div",ke,[s("div",_e,[s("img",{src:"/images-new/search/persons.png",class:"w-full max-w-[200px] inline-block",alt:e.translate("feature_search_on_manager")},null,8,Ae),s("div",null,[s("div",Ne,n(e.translate("feature_search_on_manager")),1),s("p",Te,n(e.translate("feature_search_on_manager_description")),1)]),s("div",null,[s("a",Oe,n(e.translate("upgrade_now")),1)])])]))}const De=C(Ce,[["render",xe]]),ze=$({name:"address-search",components:{AyceUpgrade:B,AutocompleteInput:P},props:{permissions:{type:Object,required:!0},isTrial:{required:!0,type:Boolean},country:String,canSeeAyceUpgrade:Boolean,hasCountryAccess:Boolean},data:function(){return{street:"",houseNumber:"",location:"",minimumSearchLength:2,errorMessage:"",errorField:"",initialAddress:{street:"",houseNumber:"",postalCode:"",city:"",country:""},StaticPage:j}},computed:{canSearchOnAddress(){return this.permissions[z.SEARCH_ON_ADDRESS]},postalCode(){const e=/(\d{4,5}[A-Z]{0,2})\s(\D+)/g,t=[...this.location.matchAll(e)][0];return t?`${t[1]}`:""},city(){const e=/(\d{4,5}[A-Z]{0,2})\s(\D+)/g,t=[...this.location.matchAll(e)][0];return t?`${t[2]}`:this.location},streetInputEnabled(){return this.country==y.BE?this.location!==""&&/^\d{4,5}\s{1}\w+/.test(this.location):this.location!==""&&!/^\d{4,5}[a-zA-Z]{2}\s{1}\w+/.test(this.location)},houseInputEnabled(){return this.location!==""&&(/^\d{4,5}\s{1}\w+/.test(this.location)||this.country!==y.BE)}},watch:{country(e){this.street="",this.houseNumber="",this.location=""}},methods:{setStreet(e){this.street=e},showError(e,t){this.errorMessage=t&&this.translate(t),this.errorField=e},hideError(){this.errorField="",this.errorMessage=""},validateSubmit(e){let t="",r="";if(this.location.trim()===""?(t="no_search_result_reason_location_missing",r="location"):this.location.length<this.minimumSearchLength?(t="no_search_result_reason_location_too_short",r="location"):this.street.trim()===""?(t="no_search_result_reason_street_missing",r="street"):this.houseNumber.trim()===""&&(t="no_search_result_reason_house_number_missing",r="houseNumber"),t==="")this.hideError();else return this.showError(r,t);e.target.submit()}},mounted(){this.initialAddress.postalCode=d.getUrlParameter("PostalCode")??"",this.initialAddress.city=d.getUrlParameter("City")??"",this.initialAddress.street=d.getUrlParameter("Street")??"",this.initialAddress.houseNumber=d.getUrlParameter("Number")??"",this.initialAddress.country=d.getUrlParameter("Country")??"",this.location=this.initialAddress.postalCode&&(this.initialAddress.country==="be"||this.initialAddress.country==="fr")?this.initialAddress.postalCode+" "+this.initialAddress.city:this.initialAddress.city,this.street=this.initialAddress.street,this.houseNumber=this.initialAddress.houseNumber}}),je={key:0},Ke={class:"text-center py-8 px-5 space-y-8"},qe=["alt"],He={class:"mb-3 font-bold text-xl"},Re={class:"text-sm text-grey-800 max-w-sm mx-auto"},Qe={href:"/upgrade/search-on-address",class:"btn btn-primary"},We=["value"],Ge=["value"],Ze={class:"grid grid-cols-[2fr_2fr_1fr_1fr] mobile:grid-cols-1 gap-4 w-full"},Je={for:"",class:"text-xs font-medium text-grey-700"},Xe={for:"",class:"text-xs font-medium text-grey-700"},Ye={for:"",class:"text-xs font-medium text-grey-700"},et=["disabled"],tt={class:"mt-auto w-full"},st={class:"btn btn-primary w-full",type:"submit"},rt={key:0,class:"text-barometer-red text-sm mt-2"};function ot(e,t,r,l,m,S){const h=w("ayce-upgrade"),a=w("autocomplete-input");return e.canSearchOnAddress?!e.hasCountryAccess&&e.canSeeAyceUpgrade?(i(),N(h,{key:1,country:e.country},null,8,["country"])):(i(),u("form",{key:2,method:"GET",onSubmit:t[2]||(t[2]=k((...o)=>e.validateSubmit&&e.validateSubmit(...o),["prevent"])),action:"/search/address"},[s("input",{type:"hidden",name:"PostalCode",value:e.postalCode},null,8,We),s("input",{type:"hidden",name:"City",value:e.city},null,8,Ge),f(s("input",{type:"hidden",name:"Country","onUpdate:modelValue":t[0]||(t[0]=o=>e.country=o)}
1,null,512),[[b,e.country]]),s("div",Ze,[s("div",null,[s("label",Je,n(e.translate("placeholder_gemeente")),1),A(a,{"fetch-url":"/ajax/autocomplete/citysuggestions",id:"location",country:e.country,"input-property":"location",autofocus:"",value:e.location,"add-streets":"",onStreet:e.setStreet,"next-tab-input":"street"},null,8,["country","value","onStreet"])]),s("div",null,[s("label",Xe,n(e.translate("placeholder_straat")),1),A(a,{"fetch-url":"/ajax/autocomplete/streetsuggestions",name:"Street",id:"street",country:e.country,"input-property":"street",readonly:!e.streetInputEnabled,"next-tab-input":"houseNumber",value:e.street,"extra-params":{postcode:e.postalCode,city:e.city}},null,8,["country","readonly","value","extra-params"])]),s("div",null,[s("label",Ye,n(e.translate("placeholder_huisnummer")),1),f(s("input",{type:"text",name:"Number",id:"houseNumber",ref:"number",autocomplete:"off","onUpdate:modelValue":t[1]||(t[1]=o=>e.houseNumber=o),disabled:!e.houseInputEnabled},null,8,et),[[b,e.houseNumber]])]),s("div",tt,[s("button",st,n(e.translate("zoek")),1)])]),e.errorMessage!==""?(i(),u("div",rt,n(e.errorMessage),1)):g("",!0)],32)):(i(),u("div",je,[s("div",Ke,[s("img",{src:"/images-new/search/address.png",class:"w-full max-w-[148px] inline-block",alt:e.translate("feature_search_on_address")},null,8,qe),s("div",null,[s("div",He,n(e.translate("feature_search_on_address")),1),s("p",Re,n(e.translate("feature_search_on_address_description")),1)]),s("div",null,[s("a",Qe,n(e.translate("upgrade_now")),1)])])]))}const nt=C(ze,[["render",ot]]);var K=(e=>(e.Companies="companies",e.Managers="managers",e.Address="address-search",e))(K||{});const at=$({name:"search-bar",components:{Dropdown:Z,Companies:$e,Managers:De,AddressSearch:nt},props:{isTrial:{type:Boolean,required:!0},canSeeAyceUpgrade:Boolean},data(){const e=window.cw.brandId;return{isOpen:!1,SearchTab:K,currentSearchTab:"companies",permissions:window.cw.permissions,countryPermissions:window.cw.countryPermissions,inputValue:"",brandId:e,currentCountry:e===1?y.BE:y.NL,Country:y}},computed:{canSeeCountryDropdown(){return(this.canSeeAyceUpgrade||this.isTrial||this.hasMultiCountry)&&!this.isLookingAtUpgradeAddressComponent},isLiza(){return this.brandId===2},isLookingAtUpgradeAddressComponent(){return this.currentSearchTab==="address-search"&&!this.permissions["search-on-address"]},shouldAutoFocus(){return!this.store.openedDrawer.hasValue()&&!this.store.openedModal.hasValue()},isMobile(){return window.innerWidth<=500},placeholder(){return this.isMobile?this.translate("zoek"):this.translate("zoek_placeholder")},countriesWithAccess(){return Object.entries(this.countryPermissions).filter(([e,t])=>t).map(([e,t])=>e)},countries(){return Object.entries(this.countryPermissions).map(([e,t])=>e)},hasMultiCountry(){return this.countriesWithAccess.length>1},hasAccessToCurrentCountry(){return this.countryPermissions[this.currentCountry]}},methods:{setCountry(e){this.currentCountry=e,_(()=>{const l=document.getElementById("searchModal").querySelectorAll('input:not([disabled]):not([type="hidden"])')[0];l&&l.focus()}),localStorage.setItem("country",e)},changeTab(e){this.currentSearchTab=e,this.setValuesFromQueryString(e)},setValuesFromQueryString(e){let t=O.none();switch(e){case"companies":t=O.someNotNullOrEmpty(d.getUrlParameter("NameOrVat")??"");break;case"managers":t=O.someNotNullOrEmpty(((d.getUrlParameter("LastName")??"")+" "+(d.getUrlParameter("FirstName")??"")).trim());break;case"address-search":t=O.someNotNullOrEmpty(((d.getUrlParameter("Street")??"")+" "+(d.getUrlParameter("Number")??"")+" "+(d.getUrlParameter("City")??"")).trim());break}this.inputValue=t.valueOr("")},listenForKeys(){window.document.onkeydown=(e=>{(e.key==="Escape"||e.key==="Esc")&&this.close(),e.ctrlKey&&e.key==="k"&&(e.preventDefault(),this.isOpen=!0)})},onKeyUp(e){(/^[a-z0-9]$/i.test(e.key)||e.key==="Backspace")&&(this.isOpen=!0)},onPaste(e){var r;const t=(r=e.clipboardData)==null?void 0:r.getData("text");this.inputValue=t??"",this.isOpen=!0},close(){this.isOpen=!1},trapFocus(){document.addEventListener("keydown",e=>{const t=document.getElementById("searchModal");if(!t||!this.isOpen)return;const r=t.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])"),l=r[0],m=r[r.length-1];
1e.key==="Tab"&&(e.shiftKey?document.activeElement===l&&(m.focus(),e.preventDefault()):document.activeElement===m&&(l.focus(),e.preventDefault()))})},blurOnScroll(){document.addEventListener("scroll",e=>{this.$refs.searchInput.blur()})}},mounted(){var t;location.pathname.includes("search/persons")?this.currentSearchTab="managers":location.pathname.includes("search/address")?this.currentSearchTab="address-search":this.currentSearchTab="companies",this.$watch(()=>this.store.shouldOpenSearchBar,r=>{r&&(this.isOpen=!0,this.store.resetSearchBarTrigger())}),this.setValuesFromQueryString(this.currentSearchTab),this.listenForKeys(),this.blurOnScroll(),_(()=>{this.trapFocus()}),this.currentCountry=((t=d.getUrlParameter("Country"))==null?void 0:t.toLowerCase())??(this.brandId===1?y.BE:y.NL);let e=localStorage.getItem("country");e&&this.countriesWithAccess.includes(e)&&!d.getUrlParameter("Country")&&(this.currentCountry=e)}}),it={class:"grow"},lt={class:"flex items-center justify-stretch relative h-full mobile-ml-auto"},ut=["autofocus","placeholder"],dt={key:0,class:"fixed rounded-xl shadow-xl bg-white z-40 top-10 w-[740px] mobile:min-w-0 mobile:w-[90%] left-[50%] translate-x-[-50%]",id:"searchModal"},ct={class:"flex mobile:grid mobile:grid-cols-3 gap-x-2 items-center py-4 px-5"},mt={href:"/international",class:"inline-block border border-grey-200 text-grey-800 font-medium text-sm py-1.5 px-2 rounded-lg hover:bg-grey-200 mobile:text-xs ml-auto mobile:hidden"},ht={class:"pb-6 px-5 pt-4 border-t border-grey-300 flex gap-5 items-start"},pt={key:0,class:"shrink-0"},gt={class:"text-xs font-medium text-grey-700",for:""},yt={class:"flex items-center gap-2 uppercase"},ft=["src","alt"],bt=["onClick"],St=["src","alt"];function vt(e,t,r,l,m,S){const h=w("dropdown"),a=R("click-outside");return i(),u("div",it,[s("div",{class:p(["fixed w-screen h-screen bg-black/50 z-40 inset-0",{hidden:!e.isOpen}])},null,2),f((i(),u("div",lt,[s("div",{class:p(["relative rounded !w-[360px] mobile:!w-[190px] mx-auto z-30",{invisible:e.isOpen}]),"tour-step-0":""},[t[7]||(t[7]=s("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-4"},[s("i",{class:"far fa-search text-grey-800 w-5 mobile:text-sm"})],-1)),f(s("input",{ref:"searchInput",type:"search",onPaste:t[0]||(t[0]=(...o)=>e.onPaste&&e.onPaste(...o)),onMousedown:t[1]||(t[1]=o=>e.isOpen=!0),onKeyup:t[2]||(t[2]=(...o)=>e.onKeyUp&&e.onKeyUp(...o)),autofocus:e.shouldAutoFocus,class:"block w-full !pl-11 mobile:min-w-0 mobile:!pl-9 tablet:min-w-0 !py-[10px] bg-grey-100 !rounded-full select-none focus:ring-0","onUpdate:modelValue":t[3]||(t[3]=o=>e.inputValue=o),placeholder:e.placeholder},null,40,ut),[[b,e.inputValue]])],2),e.isOpen?(i(),u("div",dt,[s("div",ct,[s("a",{href:"",class:p(["inline-block border border-grey-200 text-grey-800 font-medium text-sm py-1.5 px-2 rounded-lg hover:bg-grey-200 mobile:text-xs mobile:text-center",{"bg-grey-200 border-grey-300":e.currentSearchTab===e.SearchTab.Companies}]),onClick:t[4]||(t[4]=k(o=>e.changeTab(e.SearchTab.Companies),["prevent"]))},[t[8]||(t[8]=s("i",{class:"far fa-buildings text-grey-600 mr-2 mobile:hidden"},null,-1)),v(n(e.translate("company")),1)],2),e.isLiza?g("",!0):(i(),u("a",{key:0,href:"",class:p(["inline-block border border-grey-200 text-grey-800 font-medium text-sm py-1.5 px-2 rounded-lg hover:bg-grey-200 mobile:text-xs mobile:text-center",{"bg-grey-200 border-grey-300":e.currentSearchTab===e.SearchTab.Managers}]),onClick:t[5]||(t[5]=k(o=>e.changeTab(e.SearchTab.Managers),["prevent"]))},[t[9]||(t[9]=s("i",{class:"far fa-user-tie text-grey-600 mr-2 mobile:hidden"},null,-1)),v(n(e.translate("manager")),1)],2)),s("a",{href:"",class:p(["inline-block border border-grey-200 text-grey-800 font-medium text-sm py-1.5 px-2 rounded-lg hover:bg-grey-200 mobile:text-xs mobile:text-center",{"bg-grey-200 border-grey-300":e.currentSearchTab===e.SearchTab.Address}]),onClick:t[6]||(t[6]=k(o=>e.changeTab(e.SearchTab.Address),["prevent"]))},[t[10]||(t[10]=s("i",{class:"far fa-map-marker-alt text-grey-600 mr-2 mobile:hidden"},null,-1)),v(n(e.translate("address")),1)],2),s("a",mt,[t[11]||(t[11]=s("i",{class:"far fa-globe text-grey-600 mr-2 mobile:hidden"},null,-1)),v(n(e.translate("internationaal_zoeken")),1)])]),s("div",ht,[e.canSeeCountryDropdown?(i(),u("div",pt,[s("label",gt,n(e.translate("country")),1),A(h,null,{toggler:M(()=>[s("div",yt,[s("img",{src:"/images/flags/"+e.currentCountry+".svg",alt:e.translate("internationaal_ra
1pport_country_"+e.currentCountry),class:"size-4 rounded"},null,8,ft),s("span",null,n(e.currentCountry),1),t[12]||(t[12]=s("i",{class:"far fa-angle-down ml-1.5 text-grey-400"},null,-1))])]),content:M(()=>[(i(!0),u(L,null,x(e.countries,o=>(i(),u("li",{onClick:q=>e.setCountry(o),class:"!flex items-center gap-2 hover:bg-grey-transparent-100 cursor-pointer font-medium"},[s("img",{src:"/images/flags/"+o+".svg",alt:e.translate("internationaal_rapport_country_"+o),class:"size-4 rounded"},null,8,St),t[13]||(t[13]=v()),s("span",null,n(e.translate("internationaal_rapport_country_"+o)),1)],8,bt))),256))]),_:1})])):g("",!0),(i(),N(Q(e.currentSearchTab),{class:"grow",canSeeAyceUpgrade:e.canSeeAyceUpgrade,"is-trial":e.isTrial,"has-country-access":e.hasAccessToCurrentCountry,permissions:e.permissions,value:e.inputValue,country:e.currentCountry,hasMultiCountry:e.hasMultiCountry},null,8,["canSeeAyceUpgrade","is-trial","has-country-access","permissions","value","country","hasMultiCountry"]))])])):g("",!0)])),[[a,e.close]])])}const wt=C(at,[["render",vt]]);I.registerVue("[vue-header-menu]",function(e){D({name:"header-menu",data(){return{isToolsFlyoutOpen:!1,isToolsMobileFlyoutOpen:!1,isMegaMenuOpen:!1,isUserFlyoutOpen:!1,isLanguageFlyoutOpen:!1,isMobileFlyoutOpen:!1}},components:{SearchBar:wt,FreeSearchBar:W},methods:{logout(t=!1,r=!1){U.post("/ajax/account/logout",{isConfirmed:t,dontShowDialogAgain:r},l=>{l.Data.isConfirmed?l.Data.isConfirmed?window.location.href="/":console.error(l):G(m=>{this.logout(!0,!!m)},{title:E("signout_confirm_title"),text:E("signout_confirm_body"),icon:"warning",inputPlaceholder:E("signout_confirm_checkbox_label"),confirmButtonText:E("sign_out")})},l=>{console.error(l)})}},mounted(){const t=document.querySelector("[vue-header-menu]");t.classList.contains("sticky")&&document.addEventListener("scroll",()=>{t.offsetTop>0?this.$el.classList.add("border-b"):t.classList.remove("border-b")})}}).mount(e)});I.registerVue("[vue-footer-menu]",function(e){D({name:"footer-menu",data(){return{isLanguageFlyoutOpen:!1}}}).mount(e)}); 2//# sourceMappingURL=HeaderMenu-CSWNGjLp.js.map
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.