1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3490,9817],{20142:function(e,t,r){r.r(t),r.d(t,{default:function(){return D}});var a=r(85893),o=r(67294),n=r(36133),l=r(91339),i=r(42954),s=r(55917),c=r(58366),d=r(96457),u=r(35135),m=r(61892);let h="vkh_filter__panel",p="vkh_filter__free_text_search",f="vkh_filter__free_text_search_no_results",g="vkh_filter__feedback",y=["make_id","model_group_id"],b=e=>{if(!e)return;let t=y.flatMap(t=>{let r=e[t];return r?[`${t}:${r}`]:[]});return t.length>0?t.join("|"):void 0},v=e=>e.replaceAll(/[;=\s]+/g," ").trim(),w=e=>{(0,u.vYk)({name:h,type:"action",category:"engagement",details:{type:e}}),(0,m.RF)({category:"engagement",action:h},{event_details:`type=${e}`})},k=(e,t,r)=>{let a=b(r),o=String(t);(0,u.vYk)({name:p,type:"action",category:"engagement",action:"text_input",details:{...a&&{source:a},content:e,placement:o}});let n=[a&&`source=${a}`,`content=${v(e)}`,`placement=${o}`].filter(Boolean);(0,m.RF)({category:"engagement",action:p},{event_details:n.join(";")})},_=(e,t)=>{let r=b(t);(0,u.vYk)({name:f,type:"action",category:"engagement",action:"text_input",details:{...r&&{source:r},content:e}});let a=[r&&`source=${r}`,`content=${v(e)}`].filter(Boolean);(0,m.RF)({category:"engagement",action:f},{event_details:a.join(";")})},x=e=>{let{message:t,breadcrumbs:r,selectedItems:a,searchQuery:o,source:n}=e,l=b(n),i=r.map(e=>e.id).join(">")||"make-grid",s=a.map(e=>e.cat);(0,u.vYk)({name:g,type:"action",category:"engagement",details:{...l&&{source:l},placement:i,content:t}}),(0,m.RF)({category:"engagement",action:g},{...n?.make_id&&{search_makeid:n.make_id},...n?.model_group_id&&{search_modelgroupid:n.model_group_id},...s.length>0&&{search_model_taxonomy:s.join(";")},event_details:`placement=${i};query=${v(o)};message=${v(t)}`})};var $=r(28352),j=r(38816);let T=(e,t)=>{for(let r of t)for(let t of r.categories)e.set(t.cat,{cat:t.cat,label:t.title,secondaryLabel:t.subtitle})},S=(e,t,r,a)=>{for(let o of t){let t=[o.makeId?`ma${o.makeId}`:"",o.modelId?`mo${o.modelId}`:"",o.modelLineId?`ml${o.modelLineId}`:""].join("");if(!t||e.has(t))continue;let n=[o.modelId&&r.get(o.modelId),o.modelLineId&&a.get(o.modelLineId)].filter(Boolean).join(" ");t&&e.set(t,{cat:t,label:n})}},M=(e,t,r,a)=>{let o=new Map;return e&&(0,d.K)(e)?T(o,e):S(o,t,r,a),Array.from(o.values())},N=`Basic ${btoa("as24-search-funnel:vnrfbbBjI32Ol1Wka6uNHRp3EYn4dj")}`,C=["16355","20"],I=["6","13"],O="16328",L=e=>({models:e.models.map(e=>({value:e.value,label:e.label,modelLineId:e.modelLineId,makeId:e.makeId})),modelLines:e.modelLines.map(e=>({id:e.id,label:e.label??e.name??void 0,name:e.name??void 0})),modelGroups:e.modelGroups.map(e=>({value:e.value,label:e.label}))});var D=e=>{let{closeModal:t,isOpen:r,isHybridMode:d,isScopedSearchEnabled:u,excludeZeroResults:m}=e;(0,j.y)(r),o.useEffect(()=>(r&&(document.documentElement.dataset.modalDrillDownActive="true"),()=>{delete document.documentElement.dataset.modalDrillDownActive}),[r]);let{queryString:h}=(0,$._2)(),{isoCulture:p,country:f}=(0,s.B)(),{vkhFilters:g,makesModelsVariants:y,taxonomy:b,articleTypeFilter:v}=(0,c.X)(),T=i.VE[v],S="de-DE"===p?[...C,...I]:C,D="B"===T?[]:S,E=o.useCallback(async e=>{let t=b.models[e];if(t&&t.length>0)return L({models:t,modelLines:b.modelLines[e]??[],modelGroups:b.modelGroups[e]??[]});let r=new URLSearchParams({vehicleType:T,makeId:e}),a=await fetch(`/as24-search-funnel/get-models-and-groups?${r}`);return L(await a.json())},[b.models,b.modelLines,b.modelGroups,T]),P=o.useMemo(()=>new Set(b.topMakes.map(e=>e.value)),[b.topMakes]),R=o.useMemo(()=>{let e=new Map;for(let t of Object.values(b.models))for(let r of t)"string"==typeof r.label&&e.set(r.value,r.label);return e},[b.models]),A=o.useMemo(()=>{let e=new Map;for(let t of Object.values(b.modelLines))for(let r of t){let t=r.label??r.name;"string"==typeof t&&e.set(r.id,t)}return e},[b.modelLines]),F=o.useMemo(()=>b.makesSorted.filter(e=>null!=e.label).map(e=>({label:e.label,id:String(e.value),isTopMake:P.has(e.value)})).sort((e,t)=>e.id===O?1:t.id===O?-1:0),[b.makesSorted,P]),q=o.useMemo(()=>M(g,y,R,A),[g,y,R,A]);o.useEffect(()=>{r&&w("open")},[r]);let B=o.useCallback(e=>{e||w("close"),t(e)},[t]);return(0,a.jsx)(n.u,{openModal:r,closeModal:B,hasCloseButton:!1,className:"vkh-drill-down-modal",children:r&&(0,a.jsx)("div",{className:"vkh-drill-down-modal-content",children:(0,a.jsx)(l.Q,{name:"vkh-drill-down",makes:F,selectedItems:q,imageRecognitionClientId:"as24-search-funnel",onSearchSuggestions:(e,t,r)=>{k(e,t,r),0===t&&_(e,r)},onApply:e=>{globalThis.window.skipNextListPopstateFlag="vkh-drilldown-apply";let t=[];for(let r of e)t.push({cat:r.cat,title:r.label,subtitle:r.secondaryLabel});B({type:"replaceVkhFilterCategories",categories:t})},onReportIssueSubmit:x,lsApiAuthHeader:N,marketplace:f,language:p,closeModal:B,queryString:h,isOpen:r,scopedSearchEnabled:u,excludeZeroResults:m,...d&&{hybridMode:!0,hybridModeVkhMakeIds:D,oldTaxonomyFetcher:E}})})})}},38816:function(e,t,r){r.d(t,{y:function(){return o}});var a=r(67294);let o=e=>{let t=(0,a.useRef)(0);(0,a.useEffect)(()=>(e?(t.current=window.scrollY,document.documentElement.style.setProperty("--scroll-y",`-${t.current}px`),document.body.classList.add("scrollLocked")):(document.body.classList.remove("scrollLocked"),document.documentElement.style.removeProperty("--scroll-y")),()=>{e&&(document.body.classList.remove("scrollLocked"),document.documentElement.style.removeProperty("--scroll-y"),window.scrollTo(0,t.current))}),[e])}},1750:function(e,t,r){r.d(t,{A:function(){return n}});
1var a=r(85893),o=r(45635);let n=({className:e,label:t,leftIcon:r,rightIcon:n,chipState:l,isPressed:i,...s})=>(0,a.jsxs)("button",{disabled:"disabled"===l,className:(0,o.c)("sr-chip",{error:"error"===l},e),"aria-pressed":i,"aria-disabled":"disabled"===l,...s,children:[r&&(0,a.jsx)("div",{className:(0,o.c)("icon-container","icon-container--left"),children:(0,a.jsx)("span",{className:"icon","aria-hidden":"true",children:r})}),t,n&&(0,a.jsx)("div",{className:(0,o.c)("icon-container","icon-container--right"),children:(0,a.jsx)("span",{className:"icon","aria-hidden":"true",children:n})})]})},36133:function(e,t,r){r.d(t,{u:function(){return s}});var a=r(85893),o=r(23358),n=r(67294),l=r(33970),i=r(45635);let s=({openModal:e,closeModal:t,title:r,children:s,hasCloseButton:c=!0,footer:d,className:u,onClick:m,...h})=>{let p=(0,n.useRef)(null);(0,n.useLayoutEffect)(()=>{e?p.current?.showModal():p.current?.close()},[e]);let f=e=>{e.stopPropagation()};return(0,a.jsx)("dialog",{ref:p,onCancel:t,onMouseDown:e=>{e.target===p.current&&t()},className:(0,i.c)("sr-modal",u,{"sr-modal-closed":!e}),onClick:m,...h,children:(0,a.jsxs)("div",{className:"sr-modal_content sr-thin-scrollbar",tabIndex:0,onClick:f,children:[(r||c)&&(0,a.jsxs)("div",{onClick:f,className:(0,i.c)("sr-modal_content_title",{"sr-modal_content_title--hide":typeof r>"u"}),children:[r&&(0,a.jsx)("h2",{className:"sr-modal__title",children:r}),c&&(0,a.jsx)("div",{className:"sr-modal__close",children:(0,a.jsx)(l.z,{mode:"ghost-neutral",onClick:t,"aria-label":"Close modal",children:(0,a.jsx)(o.C,{"aria-hidden":"true",width:"24",height:"24"})})})]}),s,d&&(0,a.jsx)("div",{className:"sr-modal_content_footer",onClick:f,children:d})]})})}},75715:function(e,t,r){r.d(t,{V:function(){return n}});var a=r(85893),o=r(45635);let n=({className:e,children:t,type:r="default",size:n="small",isIconOnly:l=!1,...i})=>(0,a.jsx)("span",{className:(0,o.c)("sr-tag",`sr-tag-${r}`,`sr-tag-${n}`,{"sr-tag--icon-only":l},e),...i,children:t})},34721:function(e,t,r){r.d(t,{g:function(){return i}});var a=r(85893),o=r(23358),n=r(67294),l=r(45635);let i=({label:e,hideLabel:t,placeholder:r,helper:i,error:s,disabled:c,id:d,className:u,"aria-label":m,...h})=>{let p=(0,n.useId)(),f=d??`input-${p}`,g=`${f}-helper`;return(0,n.useEffect)(()=>{},[t,m,f]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{className:(0,l.c)({"sr-visually-hidden":t}),htmlFor:f,children:e}),(0,a.jsxs)("div",{className:(0,l.c)("sr-textarea__container"),children:[(0,a.jsx)("textarea",{className:(0,l.c)("sr-textarea","sr-thin-scrollbar",{"sr-textarea--error":s&&!c},u),placeholder:r,...h,id:f,disabled:c,"aria-label":m,"aria-invalid":!!s,"aria-describedby":i||"boolean"==typeof s?g:void 0,"aria-errormessage":"string"==typeof s?s:void 0}),s&&!c&&(0,a.jsx)(o.K,{"aria-hidden":"true",className:"sr-textarea__error-icon"})]}),(i||s)&&(0,a.jsx)("p",{id:g,className:(0,l.c)("sr-textarea__helper",{"sr-textarea__helper--error":s&&!c,"sr-textarea__helper--disabled":c}),children:"boolean"!=typeof s&&s?s:i})]})}},35149:function(e,t,r){var a,o,n,l,i,s,c;r.d(t,{L:function(){return v},a:function(){return D},b:function(){return A},f:function(){return C},s:function(){return L},t:function(){return M}});let d=(c=function(){if(s)return i;s=1;let e=function(){if(l)return n;l=1;let e=(o||(o=1,a=()=>{let e={};return e.promise=new Promise((t,r)=>{e.resolve=t,e.reject=r}),e}),a);return n=function(t,r="maxAge"){let a,o,n;let l=async()=>{if(void 0!==a)return;let l=async l=>{n=e();let i=l[1][r]-Date.now();if(i<=0){t.delete(l[0]),n.resolve();return}return a=l[0],"function"==typeof(o=setTimeout(()=>{t.delete(l[0]),n&&n.resolve()},i)).unref&&o.unref(),n.promise};try{for(let e of t)await l(e)}catch{}a=void 0},i=()=>{a=void 0,void 0!==o&&(clearTimeout(o),o=void 0),void 0!==n&&(n.reject(void 0),n=void 0)},s=t.set.bind(t);return t.set=(e,r)=>{t.has(e)&&t.delete(e);let o=s(e,r);return a&&a===e&&i(),l(),o},l(),t}}();class t{constructor(t,r){if(this.maxAge=t,this[Symbol.toStringTag]="Map",this.data=new Map,e(this.data),r)for(let[e,t]of r)this.set(e,t)}get size(){return this.data.size}clear(){this.data.clear()}delete(e){return this.data.delete(e)}has(e){return this.data.has(e)}get(e){let t=this.data.get(e);if(t)return t.data}set(e,t){return this.data.set(e,{maxAge:Date.now()+this.maxAge,data:t}),this}values(){return this.createIterator(e=>e[1].data)}keys(){return this.data.keys()}entries(){return this.createIterator(e=>[e[0],e[1].data])}forEach(e,t){for(let[r,a]of this.entries())e.apply(t,[a,r,this])}[Symbol.iterator](){return this.entries()}*createIterator(e){for(let t of this.data.entries())yield e(t)}}return i=t}())&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c,u=(e,t,r,a)=>{if("length"===r||"prototype"===r||"arguments"===r||"caller"===r)return;let o=Object.getOwnPropertyDescriptor(e,r),n=Object.getOwnPropertyDescriptor(t,r);!m(o,n)&&a||Object.defineProperty(e,r,n)},m=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},h=(e,t)=>{let r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},p=(e,t)=>`/* Wrapped ${e}*/ 2${t}`,f=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),g=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),y=(e,t,r)=>{let a=""===r?"":`with ${r.trim()}() `,o=p.bind(null,a,t.toString());Object.defineProperty(o,"name",g),Object.defineProperty(e,"toString",{...f,value:o})},b=new WeakMap,v="https://www.autoscout24.de/listing-search-api-v2/graphql",w=e=>t=>{console.groupCollapsed("Logger `console` driver"),console.error(Object.assign(Object.assign({},t),{label:e})),console.groupEnd()},k=e=>{};class _{constructor(e,t=[]){this.config=e,this.tags=t,this.counted={},this.count=(e,t=1,r=[])=>this.sendMetric("increment",e,t,r),this.histogram=(e,t,r=[])=>this.sendMetric("histogram",e,t,r),this.sendMetric=(e,t,r,a=[])=>this.shouldTrack(t)?fetch(this.config.endpoint??"/frontend-metrics/metrics/timeseries",{headers:new Headers({accept:"application/json","content-type":"application/json"}),method:"POST",body:JSON.stringify({metrics:[{type:e,name:`${this.config.prefix}${t}`,value:r,tags:[...this.tags,...a]}]})}).then(e=>(this.increaseCounter(t),!0)).catch(e=>!1):Promise.resolve(!1),this.shouldTrack=e=>this.config.enabled&&(void 0===this.config.perMetricCap||void 0===this.counted[e]||this.counted[e]<this.config.perMetricCap),this.increaseCounter=e=>{this.counted[e]=void 0!==this.counted[e]?this.counted[e]+1:1}}}let x=!globalThis.location?.hostname.endsWith(".github.io"),$=new _({prefix:"vkh-drill-down.",enabled:x}),j=new class{constructor(e){this.config=e,this.remoteLog=e=>t=>fetch(this.config.endpoint??"/frontend-metrics/log",{headers:new Headers({accept:"application/json","content-type":"application/json"}),method:"POST",body:JSON.stringify({errorStacktrace:t.stacktrace||"",errorMessage:t.message,httpUri:window.location.href,httpReferrer:document.referrer,pagePath:location.pathname,browserOs:navigator.platform,browserUseragent:navigator.userAgent,jsSrc:e})}).then(e=>e.ok).catch(e=>!1),this.error="remote"===this.config.driver?this.remoteLog(this.config.label):"console"===this.config.driver?w(this.config.label):k}}({driver:x?"remote":"noop",label:"vkh-drill-down"});function T(e,t,r){$.histogram(e,t,r)}function S(e,t,r){$.count(e,t,r)}function M(e,t){S("failures",1,e),j.error({message:t})}function N(e,t){return"object"==typeof e&&null!==e&&t in e&&"string"==typeof e[t]}function C(e,t,r=[]){let a=performance.now();return globalThis.fetch(e,t).then(e=>(T("response_time",performance.now()-a,[...r,`success:${e.ok}
2`]),e.ok||(S("failures",1,[...r,"reason:http_error",`status:${e.status}`]),j.error({message:`HTTP error ${e.status} [${r.join(", ")}]`})),e),e=>{T("response_time",performance.now()-a,[...r,"success:false"]);let t=e instanceof TypeError?"network_error":"unknown";throw S("failures",1,[...r,`reason:${t}`]),j.error({message:N(e,"message")?`Network error (${t}): ${e.message} [${r.join(", ")}]`:`Network error (${t}) [${r.join(", ")}]`,stacktrace:N(e,"stack")?e.stack.substring(0,500):void 0}),e})}let I=e=>e.trim()?e:"",O=e=>e.trim()?"endpoint:free_text_search":"endpoint:default_suggestions",L=function(e,{cacheKey:t=([e])=>e,cache:r=new Map}={}){let a=new Map,o=function(...o){let n=t(o);if(a.has(n))return a.get(n);let l=(async()=>{try{if(r&&await r.has(n))return await r.get(n);let t=await e.apply(this,o);try{return t}finally{r&&await r.set(n,t)}}finally{a.delete(n)}})();return a.set(n,l),l};return function(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:a}=e;for(let a of Reflect.ownKeys(t))u(e,t,a,r);h(e,t),y(e,t,a)}(o,e,{ignoreNonConfigurable:!0}),b.set(o,r),o}(async function({lsApiAuthHeader:e,searchTerm:t="",cat:r,marketplace:a,language:o,filterDepth:n,limit:l=50,searchQueryString:i,excludeZeroResults:s=!1}){let c=I(t),d=s&&0===c.length,u={searchTerm:c,cat:r,limit:l,vehicleTypeId:"C",marketplaces:a,filterDepth:n,...c?{leanMode:"level1"}:{}},m=[O(c),`country:${a.toLowerCase()}`];return d?(await E(R,e,o,{...u,queryString:i,excludeZeroResults:!0},m)).getFreeTextTaxonomyV2??{isExactMatch:!1,items:[]}:(await E(P,e,o,u,m)).getFreeTextTaxonomyCategories??{isExactMatch:!1,items:[]}},{cache:new d(3e5),cacheKey:([e])=>{let t=I(e.searchTerm??""),r=!0===e.excludeZeroResults&&0===t.length;return JSON.stringify([t,e.cat??"",e.marketplace,e.language,e.filterDepth??"",e.limit??50,r,r?e.searchQueryString??"":""])}});async function D({lsApiAuthHeader:e,searchTerm:t="",cat:r,marketplace:a,language:o,filterDepth:n,limit:l=50,searchQueryString:i}){return(await E(R,e,o,{searchTerm:t,cat:r,limit:l,vehicleTypeId:"C",marketplaces:a,filterDepth:n,queryString:i},["endpoint:trim_free_text_search",`country:${a.toLowerCase()}`])).getFreeTextTaxonomyV2??{isExactMatch:!1,items:[]}}async function E(e,t,r,a,o=[]){let n=await (await C(v,{method:"POST",headers:{"Content-Type":"application/json",Authorization:t,"X-Culture":r},body:JSON.stringify({query:e,variables:a})},o)).json();if(n.errors){let e=n.errors.map(e=>e.message).join(` 3`).substring(0,500);throw M([...o,"reason:graphql_error"],e),Error(e)}if(!n.data)throw M([...o,"reason:graphql_error"],"No data returned from GraphQL"),Error("No data returned from GraphQL");return n.data}let P=` 4 query GetFreeTextTaxonomyCategories( 5 $searchTerm: String 6 $cat: String 7 $limit: Int 8 $vehicleTypeId: String 9 $marketplaces: String 10 $filterDepth: Int 11 $leanMode: String 12 ) { 13 getFreeTextTaxonomyCategories( 14 searchTerm: $searchTerm 15 cat: $cat 16 limit: $limit 17 vehicleTypeId: $vehicleTypeId 18 marketplaces: $marketplaces 19 filterDepth: $filterDepth 20 leanMode: $leanMode 21 ) { 22 totalCount 23 isExactMatch 24 items { 25 displayName 26 cat 27 title 28 subtitle 29 shortTitle 30 subline 31 canDrillDown 32 } 33 } 34 } 35`,R=` 36 query GetFreeTextTaxonomyV2( 37 $searchTerm: String 38 $cat: String 39 $limit: Int 40 $vehicleTypeId: String 41 $marketplaces: String 42 $filterDepth: Int 43 $queryString: String 44 $leanMode: String 45 $excludeZeroResults: Boolean 46 ) { 47 getFreeTextTaxonomyV2( 48 searchTerm: $searchTerm 49 cat: $cat 50 limit: $limit 51 vehicleTypeId: $vehicleTypeId 52 marketplaces: $marketplaces 53 filterDepth: $filterDepth 54 queryString: $queryString 55 leanMode: $leanMode 56 excludeZeroResults: $excludeZeroResults 57 ) { 58 totalCount 59 isExactMatch 60 items { 61 displayName 62 cat 63 title 64 subtitle 65 subline 66 shortTitle 67 canDrillDown 68 listingsCount 69 } 70 } 71 } 72`,A=e=>e.map(e=>({id:e.cat,label:e.shortTitle??e.title,displayName:e.displayName,canDrillDown:e.canDrillDown,listingCount:e.listingsCount}))}}]);
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.