1(function(){const _U={Lang:{isEN:()=>!document.body.classList.contains('FRENCH')},Format:{toNumber:(s)=>{const x=s.toString().split('.');const rgx=/(\d+)(\d{3})/;while(rgx.test(x[0])){x[0]=x[0].replace(rgx,'$1,$2');} 2return x[0];},toPrice:(s,n=false)=>{n=n||false;if(n){let frS=_U.Lang.isEN()?'':' $';let enS=_U.Lang.isEN()?'$':'';return`${enS}${_U.Format.toNumber(s)}${frS}`;} 3return`<span class="format-price">${_U.Format.toNumber(s)}</span>`;}},Number:{roundDown:(n,r=1)=>Math.floor(n / r)*r,roundUp:(n,r=1)=>Math.ceil(n / r)*r},Arrays:{find:(a,k,v)=>a.find(item=>item[k]===v)??-1},Objects:{isset:(o,a=[])=>{if(o===null||typeof o==='undefined'){return false;} 4if(a.length===0){return true;} 5const k=a.shift();return typeof o[k]!=='undefined'?_U.Objects.isset(o[k],a):false;},is:(o,a=[],type)=>{if(o===null||typeof o==='undefined'){return false;} 6if(a.length===0){return typeof o===type;} 7const k=a.shift();return typeof o[k]!=='undefined'?_U.Objects.is(o[k],a,type):false;},obj:(o,a=[])=>{if(o===null||typeof o==='undefined'){return null;} 8if(a.length===0){return o;} 9const k=a.shift();return typeof o[k]!=='undefined'?_U.Objects.obj(o[k],a):null;},keys:(obj)=>{if(!Object.keys){Object.keys=(obj)=>{const a=[];for(const k in obj){if(obj.hasOwnProperty(k)){a.push(k);}} 10return a;};} 11return Object.keys(obj);}},Strings:{replaceUsedVehicleModelDisplay:(s)=>{if(typeof s==='string'||s instanceof String){if(_U.Lang.isEN()){const replacements={'Hybride':'Hybrid','hybride':'hybrid','Limitée':'Limited','Limité':'Limited'};return Object.entries(replacements).reduce((str,[old,new_])=>str.replace(new RegExp(old,'g'),new_),s);}} 12return s;}},GeoLocation:{get:(a,b)=>{if(navigator.geolocation){navigator.geolocation.getCurrentPosition(a,b);return true;} 13return false;}},Cookies:{state:null,get:(a)=>{let c;if(_U.Cookies.state===null){c=getCookie('usedsrpfilters');}else{if(typeof a==='string'){if(typeof _U.Cookies.state[a]!=='undefined'){return _U.Cookies.state[a];}}else{return _U.Cookies.state;}} 14if(c===null||c===''||c===undefined||c==='undefined'){return null;} 15const obj=JSON.parse(c);if(typeof obj!=='object'||obj===null){return null;} 16if(typeof a==='string'){if(typeof obj[a]!=='undefined'){_U.Cookies.state=JSON.parse(JSON.stringify(obj));return obj[a];}}else{_U.Cookies.state=JSON.parse(JSON.stringify(obj));return obj;} 17return null;},push:(a,obj)=>{let c=_U.Cookies.get();if(typeof c!=='object'||c===null){c={};} 18c[a]=obj;c=JSON.stringify(c);_U.Cookies.state=JSON.parse(c);setCookie('usedsrpfilters',c,30);}},Compilation:{compileid:'6ac717f78170a',compilestarttime:'1791432695',compilesitecompiler:'sitecompiler3'},WsWidth:{replacer:(s)=>{return s.replace('{{WSWIDTHREPLACER}}',document.getElementById('wswidthreplacer')?.value??0);}}};var AbstractObserver=function(){this._observers=new Set();this.addObserver=function(cb){this._observers.add(cb);};this.notifyObservers=function(curr,prev){const id=this._C?.id??null;this._observers.forEach(function(cb){cb(id,curr,prev);});};};var AbstractBaseComponent=function(){this.loadBase=function(config){if(typeof config==='object'){Object.assign(this._C,config);} 19this._C.selected=(this._C?.selected&&this._C.selected!==null)?this._C.selected:[];this._group=this._C?.group||false;this._open=false;this._disabled=this._C?.disabled||false;this._datamodel=null;this._initialized=false;this._wrapper='divAllWrapper';this._vals=this._C.selected;this._values=[];this._uri=false;this._hasFocused=false;this._C.orderBy=this._C?.orderBy||false;this._active=false;this._isMobile=document.body.classList.contains('UsedSrp2Mobile');Object.assign(this,new AbstractObserver());this.getObservables=function(n){var obs=('observables'in this._C)?this._C.observables:false;var len=obs?_U.Objects.keys(obs).length:0;if(typeof n!=='undefined'){if(len&&obs.hasOwnProperty(n)){return obs[n];} 20return null;} 21return len?obs:false;};this.getId=function(){return(this._C?.id&&this._C.id!=='')?this._C.id:null;};this.getGroup=function(){return this._group;};this.setDataModel=function(v){this._datamodel=v;};this.setValues=function(v){this._values=v;};this.setUri=function(v){this._uri=v;};this.getParentComponentId=function(){if(this._C?.parentcomponentid&&this._C.parentcomponentid!==''){return this._C.parentcomponentid;} 22return false;};this.getInnerComponentIds=function(){if(this._C?.innercomponent&&this._C.innercomponent!==null){return this._C.innercomponent;} 23return false;};this.getType=function(){return this._C?.type||'Unknown Type';};this.getXand=function(){return this._C?.xand||false;};this.addCallStack=function(f){this.pushStack=f;};this.getVisibility=function(){return!(this._C?.visible===false);};this.reorder=function(arr){var f=this._C.orderBy;if(f!==false&&f?.field&&f?.direction){try{arr.sort(function(a,b){if(a&&a[f.field]&&b&&b[f.field]){return a[f.field].localeCompare(b[f.field]);} 24return 0;});}catch(ex){console.error(ex);}}};this.isMocked=function(){return this._C?.mocked||false;};this.hasFocus=function(){return(this._hasFocused===true);};this.getConfig=function(){if(typeof this._C!=='undefined'){return this._C;} 25return{};};this.isActive=function(b){if(typeof b==='undefined'){return this._active;} 26this._active=b;};this.isHidden=function(){const element=this._C?.id?document.getElementById(this._C.id):null;return element?.classList.contains('hide')||false;};this.isInitialized=function(b){if(typeof b==='undefined'){return this._initialized;} 27this._initialized=b;};this.rectify=function(){if(['ListingBox','ColorBox','ButtonBox','SelectBox'].indexOf(this.getType())!==-1&&this._vals.length&&this._values.length){var reject=[];var valid=this._values.map(function(item){return item.value;});for(var i=0,len=this._vals.length;i!==len;i++){if(valid.indexOf(this._vals[i])===-1){reject.push(this._vals[i]);}}
27 28if(reject.length){var keep=this._vals.filter(function(value){return(reject.indexOf(value)===-1);});this._vals=keep.slice();}}};this._hookedEventTimer={timer:false,delay:1000};this._hookedMethodsByComponentType={All:['clickItem'],RangeSlider:['setShowedValues'],SearchInputBox:['onInputChange'],PaginationBox:['clickItem','clickArrow'],GeoLocationDistanceBox:['onChange','onInputChange'],DealerLocatorBox:['onChange']};this.setHookOnMethods=function(){var that=this;var mth=this._hookedMethodsByComponentType[this.getType()]||this._hookedMethodsByComponentType.All;var methods=Object.getOwnPropertyNames(this).filter(function(item){if(typeof that[item]==="function"&&mth.indexOf(item)!==-1){var f=that[item];that[item]=function(){setTimeout(that.handleHookedUserEvent.bind(that,arguments),that._hookedEventTimer.delay);return f.apply(that,arguments);};return true;} 29return false;});};this.handleHookedUserEvent=function(){var id,ev,vals,label='',value='',delayed=true;if(this.getType()==='RangeSlider'){if(!arguments[0]?.[0]){return false;} 30ev=arguments[0][0];if(!ev?.type||ev.type!=='slide'){return false;} 31vals=arguments[0][1];value=this.rounded(vals.values).toString();id=this._C.id;}else if(this.getType()==='SearchInputBox'){vals=this.getVals();if(vals===false||!vals.length){return false;} 32value=vals[0].v;label=vals[0].n;id=this._C.id;}else if(this.getType()==='GeoLocationDistanceBox'){if(arguments[0]?.length){if(arguments[0][0]===this.getInputId()){id=this.getInputId();value=arguments[0][1];delayed=false;}else if(arguments[0]?.[0]?.[0]===this.getSelectorId()){vals=this.getVals();if(vals===false||!vals.length){return false;} 33value=vals.toString();id=this.getSelectorId();}else{return false;}}else{return false;}}else if(this.getType()==='DealerLocatorBox'){if(arguments[0]?.length>=2){id=arguments[0][0];label=document.getElementById(id)?.querySelector('.divLabel')?.textContent||'';value=parseInt(arguments[0][1].toString());if(value===0){return false;}}else{return false;}}else{if(!arguments[0]?.[0]){return false;} 34ev=arguments[0][0];var el=ev.target.closest('LI');if(!el){return false;} 35label=el.getAttribute('title');value=el.getAttribute('item-value')+'::'+(el.classList.contains('selected')?'ON':'OFF');delayed=false;id=this._C.id;} 36if(delayed){clearTimeout(this._hookedEventTimer.timer);this._hookedEventTimer.timer=setTimeout(this.trackUserEvent.bind(this,id,label,value),this._hookedEventTimer.delay);}else{this.trackUserEvent(id,label,value);}};this.trackUserEvent=function(id,label,value){if(!window?.gUsedSrpAppz?.filterInterface?.getFilterController?.()){return;} 37if(!window.gUsedSrpAppz.filterInterface.getFilterController().isLoaded()){return;} 38document.body.dispatchEvent(new CustomEvent('usedSrpFilters.onChange',{detail:{id,label,value}}));var acct=['_trackEvent'],category='SRP - Filter',action=id+'::'+this.getType();if(!this._C?.event?.name){return;} 39action=this._C.event.name;if(this.getType()==='SearchInputBox'){action+='::'+label;label=value;}else if(this.getType()==='RangeSlider'){label=value.toString().replace(',','-');}else if(this.getType()==='GeoLocationDistanceBox'){if(value.toString().indexOf(',')!==-1){label=value.toString().replace(',','-');action+='::distance';}else{label=value;action+='::postalcode';}}else if(this.getType()==='DealerLocatorBox'){action+='::'+id.split('-')[1];} 40if(typeof window._satellite==='object'){document.body.dispatchEvent(new CustomEvent('inventorySearch.filter',{detail:{filterType:action,filterDetail:label}}));} 41if(typeof window.gaTrack==='function'){acct.forEach(function(item){window.gaTrack(item,category,action,label,1);});}};this.shared=[];this.addShared=function(o){this.shared.push(o);};this.share=function(name,obj){for(var i=0,len=this.shared.length;i!=len;i++){this.shared[i].onShare(name,obj);}};this.onShare=()=>{};this.isOpen=function(b){if(typeof b==='undefined'){return this._open;} 42this._open=b;};this.isDisabled=function(b){if(typeof b==='undefined'){return this._disabled;} 43this._disabled=b;if(this._C?.id){const element=document.getElementById(this._C.id);if(element){const wrapper=element.querySelector('div.divActionWrapper');if(wrapper){if(this._disabled){wrapper.classList.add('disabled');}else{wrapper.classList.remove('disabled');}}}}};
43this.openSelect=function(){if(!this.isDisabled()){if(!this.isOpen()){const element=this._C?.id?document.getElementById(this._C.id):null;const arrow=element?.querySelector('span.i-down-arrow');const wrappers=element?.querySelectorAll(`div.${this._wrapper}`);if(arrow){arrow.classList.add('up');} 44if(wrappers){wrappers.forEach(wrapper=>{wrapper.style.display='block';});} 45this.isOpen(true);}else{this.closeSelect();}}};this.closeSelect=function(){if(this.isOpen()){const element=this._C?.id?document.getElementById(this._C.id):null;const arrow=element?.querySelector('span.i-down-arrow');const wrappers=element?.querySelectorAll(`div.${this._wrapper}`);if(arrow){arrow.classList.remove('up');} 46if(wrappers){wrappers.forEach(wrapper=>{wrapper.style.display='none';});} 47this.isOpen(false);}};this.getVals=function(){return this._vals;};this.pushStack=()=>{};this.restore=function(){if(this._vals.length>0){this.notifyObservers(this._vals.slice(),[]);}};this.clearState=function(){if(!this.getVisibility()||this.isMocked()){return;} 48this.isActive((document.querySelectorAll(`#${this._C.id} .selected[item-value]`).length>0||document.querySelectorAll(`#${this._C.id} .range-slider.selected`).length>0));const element=this._C?.id?document.getElementById(this._C.id):null;const clearButton=element?.querySelector('span.sp-clear');if(clearButton){if(this.isActive()){clearButton.classList.add('active');}else{clearButton.classList.remove('active');}}};this.initElements=function(){this.isInitialized(true);this.clearState();if(!(this._C?.open===false)){if(!this.isOpen()){this.openSelect();}}};if(this._isMobile){this.syncChipsFromFilterBar=()=>{};}else{this.createSingleChip=function(v){var frmt,min,max,txt,val,css='',attr='',style='';if(this.getType()==='RangeSlider'){frmt=v.slice();if(this._C?.format?.indexOf('number')!==-1){frmt=[_U.Format.toNumber(frmt[0]),_U.Format.toNumber(frmt[1])];} 49if(this._C?.format?.indexOf('price')!==-1){frmt=[_U.Format.toPrice(frmt[0],true),_U.Format.toPrice(frmt[1],true)];} 50if(frmt[0]!==frmt[1]){min=`${this._C.prefix}${frmt[0]}${this._C.sufix}`;max=`${this._C.prefix}${frmt[1]}${this._C.sufix}`;txt=`${min} - ${max}`;}else{txt=`${this._C.prefix}${frmt[1]}${this._C.sufix}`;} 51val=frmt;}else if(this.getType()==='GeoLocationDistanceBox'){if(typeof v==='string'){txt=`${this._C.utext.input.from} <b>${v.toUpperCase()}</b>`;css='postalcode';attr=` sub-component-id="${this.getInputId()}" `;val=v;}else{frmt=v.slice();frmt=[_U.Format.toNumber(frmt[0]),_U.Format.toNumber(frmt[1])];txt=`${this._C.utext.distance.title} ${this._C.prefix}${frmt[1]}${this._C.sufix}`;css='distance';attr=` sub-component-id="${this.getSelectorId()}" `;val=frmt;} 52if(!this.hasFocus()){css+=' hideMe';}}else if(this.getType()==='DealerLocatorBox'){attr=` sub-component-id="${v.id}" `;val=v.v;txt=v.t;if(!this.hasFocus()){css=' hideMe';}}else if(this.getType()==='SearchInputBox'){if(v.n==='styleid'){txt=_U.Lang.isEN()?'Specific style filtering':'Filtre de style spécifique';css='styleidfocus';}else{txt=`${_U.Lang.isEN() ? 'Text Search:' : 'Recherche Texte :'} "<i>${v.v}</i>"`;} 53attr=` sub-component-id="${v.n}" `;val=v.v;}else{txt=this._datamodel.getTxtByFltId(this._C.id,v);val=v;} 54txt+=' ';if(document.getElementById('oemCertification')?.value==='21'){txt=txt.replace(/\bused\b/gi,'Pre-Owned');} 55var html=`<li class="standalone chips ${css}" item-value="${val}" component-id="${this._C.id}" ${attr}> 56 <button> 57 <span class="divSpan s-name actionGoToFilter" style="${style}">${txt}</span> 58 <div class="divBadgeNum"><span class="sp-clear"></span></div> 59 </button> 60 </li>`;const tempDiv=document.createElement('div');tempDiv.innerHTML=html;return tempDiv.firstChild;};this.addChipToFilterBar=function(elTo,el){elTo.appendChild(el);el.querySelector('.divBadgeNum span.sp-clear').addEventListener('click',this.removeChipFromFilterBar.bind(this));el.querySelector('.actionGoToFilter').addEventListener('click',this.goToFilterId.bind(this));};this.removeChipFromFilterBar=function(ev){var el=ev.target.closest('LI');var item=el.getAttribute('item-value');el.remove();var scope=typeof this._scopeId!=='undefined'?` .${this._scopeId}`:'';if(this.isMocked()){this.reset(ev);}else if(this.getType()==='RangeSlider'){this.reset(ev);}else if(this.getType()==='GeoLocationDistanceBox'){if(el.getAttribute('sub-component-id')===this.getInputId()){this._hasFocused=false;this.setState(false,'',false,'');_U.Cookies.push(this._C.id,{v:this._postalCode,f:this.hasFocus(),d:this._vals.slice()});}else{this.reset(ev,true);}}else if(this.getType()==='DealerLocatorBox'){this.reset(ev);}else if(this.getType()==='SearchInputBox'){this.reset(ev);}else{const targetElement=document.querySelector(`#${this._C.id}${scope} LI.selected[item-value="${item}"]`);if(targetElement){const newEvent=new CustomEvent('click',{bubbles:true,cancelable:true,detail
60:{itemValue:item}});targetElement.dispatchEvent(newEvent);}}};this.goToFilterId=function(ev){var el=ev.target.closest('LI');var item=el.getAttribute('item-value');var componentId=el.getAttribute('component-id');var elComponent=document.getElementById(el.getAttribute('component-id'));if(elComponent){elComponent.classList.add('boxFocus');window.scrollTo({top:elComponent.offsetTop-100,behavior:'smooth'});setTimeout(()=>{elComponent.classList.remove('boxFocus');},500);if(this.getType()==='SearchInputBox'||this.getType()==='GeoLocationDistanceBox'){this.setInputFocus(el.getAttribute('sub-component-id'));}}};this.syncChipsFromFilterBar=function(){if(!this.getVisibility()||this.isMocked()){return;} 61var i,len,vs,items,fBarChp=document.querySelector('.fltBar UL');if(fBarChp){if(this.getType()==='RangeSlider'){const chips=fBarChp.querySelectorAll(`LI[component-id="${this._C.id}"]`);chips.forEach(chip=>chip.remove());vs=this.getVals();if(vs.length===2){this.addChipToFilterBar(fBarChp,this.createSingleChip(vs));}}else if(this.getType()==='GeoLocationDistanceBox'){const chips=fBarChp.querySelectorAll(`LI[component-id="${this._C.id}"]`);chips.forEach(chip=>chip.remove());if(this.getValidatedPostalCode()!==''){this.addChipToFilterBar(fBarChp,this.createSingleChip(this._postalCode));} 62vs=this.getVals();if(vs.length===2){this.addChipToFilterBar(fBarChp,this.createSingleChip(vs));}}else if(this.getType()==='DealerLocatorBox'){const chips=fBarChp.querySelectorAll(`LI[component-id="${this._C.id}"]`);chips.forEach(chip=>chip.remove());vs=this.getVals();var txt='';for(i=0,len=this._inputs.length;i!=len;i++){if(vs[i]!==0){this.addChipToFilterBar(fBarChp,this.createSingleChip({v:vs[i],id:this._inputs[i].id,t:this._inputs[i].box.getCurrentText()}));}}}else if(this.getType()==='SearchInputBox'){const chips=fBarChp.querySelectorAll(`LI[component-id="${this._C.id}"]`);chips.forEach(chip=>chip.remove());if(typeof this._vals[0]==='object'&&this._vals[0].v!==''){this.addChipToFilterBar(fBarChp,this.createSingleChip(this._vals[0]));}}else{if(this._vals.length){items=fBarChp.querySelectorAll(`LI[component-id="${this._C.id}"]`);vs=this._vals.slice();items.forEach(function(item){var ind=vs.indexOf(parseInt(item.getAttribute('item-value')));if(ind===-1){item.remove();}else{delete vs[ind];}});vs=vs.filter(function(it){return(it!==null);});if(vs.length){for(i=0,len=vs.length;i<len;i++){this.addChipToFilterBar(fBarChp,this.createSingleChip(vs[i]));}}}else{const chips=fBarChp.querySelectorAll(`LI[component-id="${this._C.id}"]`);chips.forEach(chip=>chip.remove());}}}};} 63this.updated=()=>{};this.init=()=>{};this.reset=()=>{};this.changeNumsInBatch=()=>{};this.hideItems=()=>{};this.changeSelectedState=()=>{};this.onFcReady=()=>{};this.setHookDecorator=()=>{};this.doUpdate=function(fid,initiatorId){if(this._datamodel){var res=this._datamodel.getItemsFromResultSet(this._C.id);if(res!==false){this.changeNumsInBatch(res,fid,initiatorId);}else{this.changeNumsInBatch([],fid,initiatorId);} 64if(!this.isInitialized()){this.initElements();}}};};};var MockBox=function(config){this._C={id:'MockBox',debug:false,selected:[],values:[],visible:false,mocked:true,...(typeof config==='object'&&config!==null?config:{})};Object.assign(this,new AbstractBaseComponent());this.loadBase(this._C);this.init=function(){if(typeof window?.gUsedSrpAppz?.filterInterface?.getDefaultValuesByFltId==='function'){this._vals=window.gUsedSrpAppz.filterInterface.getDefaultValuesByFltId(this._C.id);} 65if(this._vals===null){this._vals=[];}};this.onFcReady=function(){if(this.getType()==='DealerLocatorBox'){this.notifyObservers(this._range.slice(),[0,0]);}else{this.notifyObservers(this._vals.slice(),this._vals.slice());}};this.setBehaviorByType=function(){if(this.getType()==='DealerLocatorBox'){_U.Cookies.push(this._C.id,{v:this._vals.slice(),f:false});this._range=[0,200];this.getDataType=function(){return'RangeSlider';};this.getRangeVals=function(){return this._range.slice();};}else if(this.getType()==='GeoLocationDistanceBox'){_U.Cookies.push(this._C.id,{v:'',f:false,d:this._vals.slice()});this.getDataType=function(){return'RangeSlider';};
65this.getSelectorId=function(){return this._C.distance.id;};this.getInputId=function(){return this._C.input.id;};this.getValidatedPostalCode=function(){return'';};}};this.setBehaviorByType();};var ButtonBox=function(config){this._C={debug:false,id:'',type:'ButtonBox',multi:true,shownum:true,selected:[],values:[],disabelable:false,seo:false};Object.assign(this,new AbstractBaseComponent());this.loadBase(config);this._disabelable=this._C.disabelable;this.setContainer=function(){document.getElementById(this._C.id).querySelector('.fltFilter').innerHTML='<div class="divSpan divSpan12 '+this._wrapper+'" style="display:none;">'+'<div class="divSpan divSpan12 divButtonBoxWrapper">'+'<ul class="divSpan divSpan12 divButtonBoxes"></ul>'+'</div>'+'</div>';};this.hideItems=function(vs){const arr=[];for(const o in vs){if(vs.hasOwnProperty(o)){arr.push(vs[o].value);}} 66const elements=document.querySelectorAll('#'+this._C.id+' LI[item-value]');elements.forEach(function(el){if(arr.indexOf(parseInt(el.getAttribute('item-value')))===-1){el.classList.add('hideme');}});};this.changeSelectedState=function(vs){const elements=document.querySelectorAll('#'+this._C.id+' LI[item-value]');if(elements.length>0){elements.forEach(function(el){el.classList.remove('selected');});} 67for(let i=0,len=vs.length;i!==len;i++){const el=document.querySelector('#'+this._C.id+' LI[item-value="'+vs[i]+'"]');if(el){el.classList.add('selected');}} 68this.rebuildValues();};this.setButtonBoxes=function(){const el=document.querySelector('#'+this._C.id+' .divButtonBoxes');let html='';for(let i=0,len=this._values.length;i!==len;i++){html+=this.setItem(this._values[i]);} 69el.innerHTML=html;};this.setItem=function(v){const sel=this._C.selected.indexOf(v.value)!==-1?' selected':'';const ico=v?.icon!==''&&v?.icon!==undefined?'<span class="'+v.icon+'"></span>':'';const pad=ico===''?' bigger':'';const txt=v?.txt?'<span class="s-text">'+v.txt+'</span>':'';const num=v?.num??0;const hideMe=v?.hide===1?' hideme':' isactivated';const dsbl=sel===''?(this._disabelable?' disabelable':' disabled'):'';const badge=this._C.shownum?'':'style="display:none;"';return`<li class="divSpan divSpan6 divButtonBox ${sel}${dsbl}${hideMe}" title="${v.txt}" item-value="${v.value}"> 70 <div class="divButtonBoxOuter ${pad}"> 71 <button class="buttoned-box">${ico}${txt}</button> 72 <div class="divBadgeNum" ${badge}> 73 <span class="s-num">${num}</span> 74 </div> 75 </div> 76 </li>`;};this.rebuildValues=function(ntfy){const vals=[];const elements=document.querySelectorAll('#'+this._C.id+' LI.selected[item-value]');elements.forEach(function(el){vals.push(parseInt(el.getAttribute('item-value')));});const vs=this._vals.slice();this._vals=vals.slice();this.clearState();if(typeof ntfy==='undefined'||ntfy!==false){this.notifyObservers(vals,vs);}};this.clickItem=function(ev){const el=ev.target.closest('LI');if(!el.classList.contains('disabled')){if(el.classList.contains('selected')){el.classList.remove('selected');}else{el.classList.add('selected');} 77this.pushStack(this._C.id);this.rebuildValues();} 78return false;};this.initActions=function(){document.getElementById(this._C.id).addEventListener('click',function(ev){if(ev.target.closest('LI')){this.clickItem(ev);}}.bind(this));};this.changeNumsInBatch=function(v,fid,initiatorId){const kp=(fid===this._C.id);const dsbl=this._disabelable;const vs={};for(let i=0,len=v.length;i!==len;i++){vs[v[i].value]=v[i].num;} 79document.querySelectorAll('#'+this._C.id+' LI[item-value]').forEach(function(el){const val=el.getAttribute('item-value');if(typeof vs[val]==='undefined'){el.querySelector('.divBadgeNum').classList.add('disabled');el.querySelector('span.s-num').textContent='0';if(!kp&&dsbl){if(dsbl){el.classList.add('disabelable');}else{el.classList.add('disabled');}}}else{if(dsbl){el.classList.remove('disabelable');}else{el.classList.remove('disabled');} 80el.querySelector('.divBadgeNum').classList.remove('disabled');el.querySelector('span.s-num').textContent=vs[val];}});if(kp){this.rebuildValues(false);}};this.reset=function(){const elements=document.querySelectorAll('#'+this._C.id+' LI.selected');
80if(elements.length){elements.forEach(function(el){el.classList.remove('selected');});const vs=this._vals.slice();this._vals=[];this.notifyObservers([],vs);this.clearState();}};this.initElements=function(){this.isInitialized(true);this.clearState();this.openSelect();};this.init=function(){this.rectify();this.setContainer();this.setButtonBoxes();this.initActions();};};var ColorBox=function(config){this._C={debug:false,id:'',type:'ColorBox',shownum:true,selected:[],values:[],seo:false};Object.assign(this,new AbstractBaseComponent());this.loadBase(config);this._disabelable=this._C.disabelable;this.setContainer=function(){document.querySelector('#'+this._C.id+' .fltFilter').innerHTML='<div class="divSpan divSpan12 '+this._wrapper+'" style="display:none;">'+'<div class="divSpan divSpan12 divColorBoxWrapper">'+'<ul class="divSpan divSpan12 divColorBoxes">'+'</ul>'+'</div>'+'</div>';};this.hideItems=function(vs){var arr=[];for(var o in vs){if(vs.hasOwnProperty(o)){arr.push(vs[o].value);}} 81var elements=document.querySelectorAll('#'+this._C.id+' LI[item-value]');elements.forEach(function(el){if(arr.indexOf(parseInt(el.getAttribute('item-value')))===-1){el.classList.add('hideme');}});};this.changeSelectedState=function(vs){var elements=document.querySelectorAll('#'+this._C.id+' LI[item-value]');elements.forEach(function(el){el.classList.remove('selected');});vs.forEach((value)=>{var el=document.querySelector('#'+this._C.id+' LI[item-value="'+value+'"]');if(el){el.classList.add('selected');}});this.rebuildValues();};this.setColorBoxes=function(){var el=document.querySelector('#'+this._C.id+' .divColorBoxes');var html='';for(var i=0,len=this._values.length;i!==len;i++){html+=this.setItem(this._values[i]);} 82el.insertAdjacentHTML('beforeend',html);};this.setItem=function(v){var revertColor=[0,12];var strikedClass=(v.value===0)?'striked':'';var brdStyle=(revertColor.indexOf(v.value)===-1)?'border-color:'+v.color+';':'border-color:#ddd;';var checkStyle=(revertColor.indexOf(v.value)===-1)?'color:#fff;':'color:#999;';var bgStyle='background-color:'+v.color+';';var sel=(this._C.selected.indexOf(v.value)!==-1)?' selected':'';var dsbl=(sel==='')?((this._disabelable)?' disabelable':' disabled'):'';var num=v?.num??0;var hideMe=(v?.hide===1)?' hideme':'';var glossyStyle='position:absolute;top:0;left:0;right:0;bottom:0;'+'background: linear-gradient(180deg,rgba(255,255,255,.4),'+v.color+');';return'<li class="divSpan divSpan4 divColorBox '+sel+dsbl+hideMe+'" title="'+v.txt+'" item-value="'+v.value+'">'+'<div class="divColorBoxOuter">'+'<a class="colored-box '+strikedClass+'" style="'+bgStyle+brdStyle+'">'+'<div style="'+glossyStyle+'"></div>'+'<div class="checkBoxOuter">'+'<div class="checkBoxInner" style="'+checkStyle+'">'+'<i class="fas fa-check"></i>'+'</div>'+'</div>'+'<div class="divBadgeNum" style="'+brdStyle+'">'+'<span class="s-num">'+num+'</span>'+'</div>'+'</a>'+'</div>'+'</li>';};this.rebuildValues=function(ntfy){var vals=[];var elements=document.querySelectorAll('#'+this._C.id+' LI.selected[item-value]');elements.forEach(function(el){vals.push(parseInt(el.getAttribute('item-value')));});var vs=this._vals.slice();this._vals=vals.slice();this.clearState();if(typeof ntfy==='undefined'||ntfy!==false){this.notifyObservers(vals,vs);}};this.clickItem=function(ev){var el=ev.target.closest('LI');if(!el.classList.contains('disabled')){if(el.classList.contains('selected')){el.classList.remove('selected');}else{el.classList.add('selected');} 83this.pushStack(this._C.id);this.rebuildValues();} 84return false;};this.changeNumsInBatch=function(v,fid,initiatorId){var kp=(fid===this._C.id);var dsbl=this._disabelable;var vs={};for(var i=0,len=v.length;i!==len;i++){vs[v[i].value]=v[i].num;} 85var elements=document.querySelectorAll('#'+this._C.id+' LI[item-value]');elements.forEach(function(el){var val=el.getAttribute('item-value');if(typeof vs[val]==='undefined'){el.querySelector('.divBadgeNum').classList.add('disabled');el.querySelector('span.s-num').textContent=0;if(!kp&&dsbl){if(dsbl){el.classList.add('disabelable');}else{el.classList.add('disabled');}}}else{if(dsbl){el.classList.remove('disabelable');}else{el.classList.remove('disabled');} 86el.classList.remove('disabled');el.querySelector('.divBadgeNum').classList.remove('disabled');el.querySelector('span.s-num').textContent=vs[val];}});if(kp){this.rebuildValues(false);}};this.initActions=function(){document.querySelector('#'+this._C.id).addEventListener('click',function(event){if(event.target.closest('LI[item-value]')){this.clickItem(event);}}.bind(this));};this.reset=function(){var elements=document.querySelectorAll('#'+this._C.id+' LI.selected');
86if(elements.length){elements.forEach(function(el){el.classList.remove('selected');});var vs=this._vals.slice();this._vals=[];this.notifyObservers([],vs);this.clearState();}};this.init=function(){this.rectify();this.setContainer();this.setColorBoxes();this.initActions();};};var ListingBox=function(config){this._C={debug:false,id:'',type:'ListingBox',tags:'notags',disabled:false,msg:' ',label:false,shownum:true,multi:true,selected:[],values:[],open:false,group:false,disabelable:false,innercomponent:null,seo:false,groupchild:false,visible:true,isParentVisible:true};Object.assign(this,new AbstractBaseComponent());this.loadBase(config);this._group=this._C.group;this._groups=[];this._groupSelected=[];this._groupChild=this._C.groupchild;this._disabelable=this._C.disabelable;this._scopeId='divScope'+this._C.id;this._wrapperId='divWrapper'+this._C.id;this._multiselect=this._C.multi;this.setContainer=function(){var el=document.querySelector('#'+this._C.id+' .divListingBoxWrapper.'+this._wrapperId);var label=(this._C.label)?'':' disabled';var html='<div class="divSpan divSpan12 divSelectWrapper">'+'<div class="divSpan divSpan12 divLabel'+label+'">'+'<span class="sp-msg">'+this._C.msg+'</span>'+'</div>'+'<div class="divSpan divSpan12 divSelectGroup '+this._scopeId+'"></div>'+'</div>';var wrapper=el.querySelector('div.'+this._wrapper);if(wrapper){wrapper.insertAdjacentHTML('afterbegin',html);} 87this.setMsg();this.isDisabled(this._disabled);};this.hideItems=function(vs){var arr=[];for(var o in vs){if(vs.hasOwnProperty(o)){arr.push(vs[o].value);}} 88var el=document.querySelectorAll('#'+this._C.id+' .'+this._scopeId+' LI[item-value]');el.forEach(function(item){if(arr.indexOf(parseInt(item.getAttribute('item-value')))===-1){item.classList.add('hideme');}});if(this._C.innercomponent===null&&this._group===false){if(document.querySelector('#'+this._C.id+' .'+this._scopeId).querySelectorAll('LI[item-value]:not(.hideme)').length===0){document.querySelector('#'+this._C.id).style.display='none';}}};this.setListing=function(arr){var listing='';var len=arr.length;if(len>0){this.reorder(arr);for(var i=0;i!==len;i++){listing+=this.setItem(arr[i]);} 89listing='<ul>'+listing+'</ul>';document.querySelector('#'+this._C.id+' .'+this._scopeId).innerHTML=listing;}};this.setGroupValues=function(v){var el=document.querySelector('#'+this._C.id+' .'+this._scopeId);for(var i=0,len=v.length;i!==len;i++){this._groups.push(v[i].value);el.insertAdjacentHTML('beforeend',this.setGroup(v[i]));} 90this.setGroupVisibility(this._groupSelected,true);};this.setGroupVisibility=function(v,skipRebuild){this._groupSelected=v;var el=document.querySelector('#'+this._C.id+' .'+this._scopeId);if(this._groupSelected.length===0){el.querySelectorAll('UL[group-value]').forEach(function(ul){ul.style.display='none';});this.reset();this.isDisabled(true);this.closeSelect();this.setChildFocusFromGroupSelection(false);return;} 91for(var i=0,len=this._groups.length;i!==len;i++){if(this._groupSelected.indexOf(this._groups[i])!==-1){el.querySelector('UL[group-value="'+this._groups[i]+'"]').style.display='';}else{var ul=el.querySelector('UL[group-value="'+this._groups[i]+'"]');ul.style.display='none';ul.querySelectorAll('LI.selected').forEach(function(li){li.classList.remove('selected');});}} 92this.isDisabled(false);if(!this.isOpen()){this.openSelect();} 93this.setChildFocusFromGroupSelection(true);if(typeof skipRebuild!=='undefined'&&skipRebuild===true){this.rebuildValues(false);}};this.setChildFocusFromGroupSelection=function(focus){var el=document.querySelector('#'+this._C.id);el.classList.remove('onParentSelected');if(focus&&this._C.isParentVisible){setTimeout(function(){el.classList.add('onParentSelected');},200);}};this.setGroup=function(v){this.reorder(v.values);var pre='';var html='<ul group-value="'+v.value+'" style="display:none">'+'<li class="subGroup">'+pre+v.txt+'</li>';for(var i=0,len=v.values.length;i!==len;i++){html+=this.setItem(v.values[i]);} 94html+='</ul>';return html;};this.setMsg=function(v){if(this._C.label){var el=document.querySelector('#'+this._C.id+' .divLabel');v=(typeof v==='undefined')?'':v;if(v===''){el.style.display='none';}else{el.style.display='block';} 95el.querySelector('span.sp-msg').innerHTML=v;}};this.setItem=function(v){var sel=(this._vals.indexOf(v.value)!==-1)?' selected':'';var num=v?.num??0;var badge=(this._C.shownum)?'':'style="display:none;"';var hideMe=(v?.hide===1)?' hideme':'';
95var ico=v?.icon?`<span class="-ph --s-3 ${v.icon}"></span>`:'';var exclass=v?.exclass?' '+v.exclass:'';var dsbl=(sel==='')?((this._disabelable&&!this.getXand())?' disabelable':' disabled'):'';var tags=(this._C.tags!=='')?' '+this._C.tags:'';var rawTxt=v.txt;if(document.getElementById('oemCertification')?.value==='21'){rawTxt=(v.txt||'').replace(/\bused\b/gi,'Pre-Owned');} 96var txt=_U.Strings.replaceUsedVehicleModelDisplay(rawTxt);if(this._groupChild==='fltModelId'&&txt.trim()==='Volkswagen'){exclass+=' -w100p';} 97return` 98 <li class="${tags}${exclass}${sel}${dsbl}${hideMe}" item-value="${v.value}" title="${v.txt}"> 99 <button class="flex-between align-center"> 100 ${ico} 101 <span class="s-name"> 102 <span>${txt}</span> 103 </span> 104 <div class="divBadgeNum" ${badge}> 105 <span class="s-num">${num}</span> 106 </div> 107 </button> 108 </li> 109 `;};this.changeSelectedState=function(vs){var el=document.querySelectorAll('#'+this._C.id+' .'+this._scopeId+' LI.selected[item-value]');if(el.length>0){el.forEach(function(item){item.classList.remove('selected');});} 110for(var i=0,len=vs.length;i!==len;i++){el=document.querySelector('#'+this._C.id+' .'+this._scopeId+' LI[item-value="'+vs[i]+'"]');if(el){el.classList.add('selected');}} 111this.rebuildValues();};this.rebuildValues=function(ntfy){var vals=[];var el=document.querySelectorAll('#'+this._C.id+' .'+this._scopeId+' LI.selected[item-value]');el.forEach(function(item){vals.push(parseInt(item.getAttribute('item-value')));});var vs=this._vals.slice();this._vals=vals.slice();this.clearState();if(typeof ntfy==='undefined'||ntfy!==false){this.notifyObservers(vals,vs);}};this.clickItem=function(ev){var el=ev.target.closest('LI');var isSelected=el.classList.contains('selected');if(!this._multiselect){document.querySelectorAll('#'+this._C.id+' .'+this._scopeId+' LI.selected').forEach(function(item){item.classList.remove('selected');});if(!isSelected){el.classList.add('selected');}}else{if(isSelected){el.classList.remove('selected');}else{el.classList.add('selected');}} 112this.pushStack(this._C.id);this.rebuildValues();if(!isSelected){this.animItemToGroupChild(el);} 113return false;};this.animItemToGroupChild=function(el){};this.changeNumsInBatch=function(v,fid,initiatorId){if(fid===this._groupChild&&fid!==initiatorId&&this._group!==initiatorId&&this._C.id!==initiatorId){return;} 114var kp=(initiatorId===this._C.id);var xAnd=this.getXand();var xAndOwner=(kp&&xAnd);var vs={};for(var i=0,len=v.length;i!==len;i++){vs[v[i].value]=v[i].num;} 115var cid=this._C.id;var scid=this._scopeId;var dsbl=this._disabelable;document.querySelectorAll('#'+cid+' .'+scid+' LI[item-value]').forEach(function(item){var val=item.getAttribute('item-value');if(typeof vs[val]==='undefined'){item.querySelector('.divBadgeNum').classList.add('disabled');item.querySelector('span.s-num').textContent=0;if(!kp||xAndOwner){if(dsbl&&!xAnd){item.classList.add('disabelable');}else{item.classList.add('disabled');}}}else{if(dsbl&&!xAnd){item.classList.remove('disabelable');}else{item.classList.remove('disabled');} 116item.querySelector('.divBadgeNum').classList.remove('disabled');item.querySelector('span.s-num').textContent=vs[val];}});if(this._group===fid&&this._C.id!==initiatorId){this.rebuildValues();}else if(kp){this.rebuildValues(false);}};this.reset=function(){var el=document.querySelectorAll('#'+this._C.id+' .'+this._scopeId+' LI.selected');if(el.length){el.forEach(function(item){item.classList.remove('selected');});var vs=this._vals.slice();this._vals=[];this.notifyObservers([],vs);this.clearState();}};this.checkInnerComponents=function(){let innerComp=this.getInnerComponentIds();if(innerComp!==false){let el=document.querySelector(`#${this._C.id} .fltInnerComponentWrapper`);if(el){let enable=false,bmsg=false;for(let i=0,len=innerComp.length;i<len;i++){let innerEl=document.querySelector(`#${innerComp[i]}`);if(innerEl){if(innerEl.querySelectorAll('LI[item-value]:not(.hideme)').length!==0){enable=bmsg=true;break;} 117if(innerEl.querySelector('.divFilterRangeSlider')){enable=true;break;}}} 118if(enable){if(bmsg&&this._C?.utext?.seperator){el.insertAdjacentHTML('afterbegin',`<
118div class="divSpan divSpan12 divInnerLabel"><span class="sp-msg">${this._C.utext.seperator}</span></div>`);}}else{el.style.display='none';}}}};this.initActions=function(){document.querySelector('#'+this._C.id).addEventListener('click',function(event){if(event.target.closest('.divActionWrapper')){this.openSelect();}}.bind(this));document.querySelector('#'+this._C.id+' div.'+this._scopeId).addEventListener('click',function(event){if(event.target.closest('LI[item-value]')){this.clickItem(event);}}.bind(this));};this.initElements=function(){this.isInitialized(true);this.clearState();if((this._C.open||document.querySelector('#'+this._C.id+' .selected[item-value]'))&&this._group===false){this.openSelect();}};this.init=function(){this.rectify();this.setContainer();this.setListing(this._values);this.initActions();this.checkInnerComponents();};};var SelectBox=function(config){this._C={debug:false,id:'',type:'SelectBox',selected:[],values:[],seo:false,noSel:'...'};Object.assign(this,new AbstractBaseComponent());this.loadBase(config);this._isOpen=false;this.selText=this._C.noSel;this.reset=function(){var el=document.querySelectorAll(`#${this._C.id} LI.selected`);if(el.length){el.forEach(item=>item.classList.remove('selected'));this.rebuildValues();this.clearState();}};this.setContainer=function(){var el=document.querySelector(`#${this._C.id} .divSelectBoxWrapper`);var html='<div class="divSpan divSpan12 divSelectWrapper" style="display: none;">'+'<ul></ul>'+'</div>';el.insertAdjacentHTML('beforeend',html);};this.setListing=function(){var listing='';for(var i=0,len=this._values.length;i!==len;i++){listing+=this.setItem(this._values[i]);} 119document.querySelector(`#${this._C.id} .divSelectWrapper UL`).innerHTML=listing;};this.setItem=function(v){var sel='';if(this._C.selected.indexOf(v.value)!==-1){sel='selected';this.setCurrent(v.txt);} 120return'<li class="'+sel+'" item-value="'+v.value+'" title="'+v.txt+'"><button data-btn-value="'+v.value+'">'+v.txt+'</button></li>';};this.isOpen=function(b){if(typeof b==='undefined'){return this._isOpen;} 121this._isOpen=b;};this.openSelect=function(){if(!this.isOpen()&&!this.isDisabled()){document.querySelector(`#${this._C.id} .divActionWrapper`).classList.add('boxShadow');var wrapper=document.querySelector(`#${this._C.id} .divSelectWrapper`);wrapper.classList.add('boxShadow');wrapper.style.display='block';this.isOpen(true);}};this.closeSelect=function(){if(this.isOpen()){document.querySelector(`#${this._C.id} .divActionWrapper`).classList.remove('boxShadow');var wrapper=document.querySelector(`#${this._C.id} .divSelectWrapper`);wrapper.classList.remove('boxShadow');wrapper.style.display='none';this.isOpen(false);}};this.clickItem=function(ev){this.closeSelect();document.querySelectorAll(`#${this._C.id} LI`).forEach(item=>item.classList.remove('selected'));var el=ev.target.closest('LI');el.classList.add('selected');this.pushStack(this._C.id);this.rebuildValues();ev.stopPropagation();ev.preventDefault();};this.setCurrent=function(t){if(t==='...'){t=this._C.noSel;} 122this.selText=t;document.querySelector(`#${this._C.id} .divLabel`).innerHTML=t;};this.getCurrentText=function(){return this.selText;};this.changeSelectedState=function(vs){var el=document.querySelectorAll(`#${this._C.id} LI[item-value]`);if(el.length>0){el.forEach(item=>item.classList.remove('selected'));} 123for(var i=0,len=vs.length;i!==len;i++){el=document.querySelector(`#${this._C.id} LI[item-value="${vs[i]}"]`);if(el){el.classList.add('selected');this.setCurrent(el.getAttribute('title'));}} 124this.rebuildValues();};this.rebuildValues=function(){var vals=[];var el=document.querySelectorAll(`#${this._C.id} LI.selected[item-value]`);el.forEach(item=>{vals.push(parseInt(item.getAttribute('item-value')));});var vs=this._vals.slice();this._vals=vals.slice();var ntf=true;var t=this._vals.length?el[0].getAttribute('title'):this._C.noSel;this.setCurrent(t);for(var i=0,len=vs.length;i!==len;i++){if(this._vals.indexOf(vs[i])!==-1){ntf=false;break;}} 125if(ntf){this.clearState();this.notifyObservers(this._vals.slice(),vs);}}
125;this.docClicked=function(ev){if(!ev.target.closest(`#${this._C.id}`)){this.closeSelect();}};this.initActions=function(){var container=document.querySelector(`#${this._C.id}`);container.querySelector('.divActionWrapper').addEventListener('click',this.openSelect.bind(this));container.addEventListener('click',ev=>{if(ev.target.tagName==='LI'||ev.target.closest('LI')){this.clickItem(ev);}});};this.init=function(){this.rectify();this.setContainer();this.setListing();this.initActions();};this.updateRowCounter=function(arr){var el=document.querySelectorAll(`#${this._C.id} LI[item-value]`);var none=(typeof arr==='undefined');if(el.length>0){el.forEach(item=>{var id=parseInt(item.getAttribute('item-value'));var t=item.getAttribute('title');if(!none&&id!==0&&arr?.[id]!==undefined){t+=` (${arr[id]})`;} 126item.querySelector('button').innerHTML=t;});}};document.addEventListener('click',this.docClicked.bind(this));};var RangeSlider=function(config){this._C={wait:501,debug:false,id:'',type:'RangeSlider',format:'',round:1,values:[],selected:[],prefix:'',sufix:'',utext:{outofrange:'Out of range!',noresult:'0 result'}};Object.assign(this,new AbstractBaseComponent());this.loadBase(config);this._slider=null;this._timer=null;this._min=0;this._max=0;this._hasInputFields=['fltPriceId','fltYearId','fltDPaymentId'].includes(this._C.id);this.rounded=function(v){return[_U.Number.roundDown(v[0],this._C.round),_U.Number.roundUp(v[1],this._C.round)]};this.setValues=function(v){if(this._C.selected===null||this._C.selected.length!==2){this._C.selected=v;} 127this._values=[((this._C.selected[0]<v[0])?this._C.selected[0]:v[0]),((this._C.selected[1]>v[1])?this._C.selected[1]:v[1])];};this.clearState=function(){var v1=this.rounded(this._vals);var v2=this.rounded(this._values);this.isActive((v1[0]!==v2[0]||v1[1]!==v2[1]));var el=document.querySelector(`#${this._C.id} span.sp-clear`);if(el){if(this.isActive()){el.classList.add('active');}else{el.classList.remove('active');}} 128if(this.getParentComponentId()!==false){el=document.querySelector(`#${this._C.id} .range-slider`);if(el){if(this.isActive()){el.classList.add('selected');}else{el.classList.remove('selected');}}}};this.setContainer=function(){const type=this._hasInputFields?'number':'text';const disable=this._hasInputFields?'':'disabled';const step=type==='number'?`step="${this._C.round}"`:'';const html=` 129 <div class="divSpan divSpan12 ${this._wrapper} divFilterRangeSliderWrapper inPreload"> 130 <div class="divSpan divSpan12 divFilterRangeSlider"> 131 <div class="divSpan divSpan12 double-range-slider"> 132 <div class="values"> 133 <input type="${type}" id="range1Input" ${disable} class="left" ${step}> 134 <input type="${type}" id="range2Input" ${disable} class="right" ${step}> 135 </div> 136 <div class="container"> 137 <div class="slider-track"></div> 138 <div class="range-active"></div> 139 <input type="range" id="slider-1" step="${this._C.round}"> 140 <input type="range" id="slider-2" step="${this._C.round}"> 141 <div id="numsDisplay"></div> 142 </div> 143 </div> 144 </div> 145 </div> 146 `;const container=document.querySelector(`#${this._C.id} div.fltFilter`);if(container){container.innerHTML=html;}};this.setRangeSlider=function(){var el=document.querySelector(`#${this._C.id}`);if(el){var rngSlider=el.querySelector('div.double-range-slider');if(rngSlider){[this._min,this._max]=this.rounded(this._values);const selected=this.rounded(this._C.selected);this._slider=new DoubleRangeSlider(`#${this._C.id} div.double-range-slider`,{minGap:0,min:this._min,max:this._max,value1:selected[0],value2:selected[1],prefix:this._C?.prefix??'',sufix:this._C?.sufix??'',utext:this._C?.utext??null,step:this._C.round,format:this._C.format,inputType:this._hasInputFields?'number':'text',fid:this._C.id,observer:(a)=>this.setShowedValues(a),rounded:(vs)=>this.rounded(vs)}) 147this.rebuildValues(selected,false);}}};this.setShowedValues=function(values,type='none'){if(!Array.isArray(values)){return;} 148values=this.rounded(values);if(['reset','created','changestate'].includes(type)){this.rebuildValues(values);}else{clearTimeout(this._timer);this._timer=setTimeout(()=>{this.rebuildValues(values);},this._C.wait)}};this.openSelect=function(){const wrapper=document.querySelector(`#${this._C.id} .divFilterRangeSliderWrapper`);if(wrapper){wrapper.classList.remove('inPreload');}};this.changeSelectedState=function(vs){if(!Array.isArray(vs)||vs.length!==2){vs=[this._min,this._max];}else{if(vs[0]<this._min){vs[0]=this._min;} 149if(vs[1]>this._max){vs[1]=this._max;}} 150if(this._slider){this._slider.updateValues(vs);} 151this.setShowedValues(vs,'changestate');};this.rebuildValues=function(v,notif=true){const vs=this._vals.slice();this._vals=v;this.clearState();if(notif){this.pushStack(this._C.id);this.notifyObservers(this._vals.slice(),vs);}}
151;this.changeNumsInBatch=function(v,fid,initiatorId){if(v.length===0){v=false;} 152if(this._slider){this._slider.updateNums(v,fid,initiatorId);}};this.reset=function(){this.setShowedValues(this._values,'reset');if(this._slider){this._slider.reset();}};this.getVals=function(){if(this._min===this._vals[0]&&this._max===this._vals[1]){return[];} 153return this._vals;};this.init=function(){this.setContainer();this.setRangeSlider();};};class DoubleRangeSlider{constructor(wrapperSelector,options={}){const wrapper=document.querySelector(wrapperSelector);this.sliderOne=wrapper.querySelector('#slider-1');this.sliderTwo=wrapper.querySelector('#slider-2');this.range1=wrapper.querySelector('#range1Input');this.range2=wrapper.querySelector('#range2Input');this.track=wrapper.querySelector('.slider-track');this.rangeActive=wrapper.querySelector('.range-active');this.numsDisplay=wrapper.querySelector('#numsDisplay');this.container=wrapper.querySelector('.container');this.prefix=options?.prefix??'';this.sufix=options?.sufix??'';this.utext=options?.utext??null;this.step=options?.step??1;this.format=options?.format??null;this.inputType=options?.inputType??'text';this.fid=options?.fid??null;this.observer=options?.observer??null;this.rounded=options?.rounded??null;let min=options.min??0;let max=options.max??100;const{minGap=0,value1=min,value2=max}=options;[this.minValue,this.maxValue,this.minGap]=[min,max,minGap];[this.sliderOne.min,this.sliderOne.max,this.sliderOne.value]=[min,max,value1];[this.sliderTwo.min,this.sliderTwo.max,this.sliderTwo.value]=[min,max,value2];this.init();} 154updateValues(vs){this.sliderOne.value=parseInt(vs[0],10);this.sliderTwo.value=parseInt(vs[1],10);this.updateTrack();this.updateDisplay();} 155round(vs){if(typeof this.rounded==='function'){return this.rounded(vs);} 156return vs;} 157reset(){this.sliderOne.value=this.minValue;this.sliderTwo.value=this.maxValue;this.updateDisplay();this.updateTrack();} 158init(){this.updateDisplay();this.updateTrack();
158[this.sliderOne,this.sliderTwo].forEach(slider=>slider.addEventListener('input',(event)=>this.handleSlide(event)));if(this.range1&&this.range2){[this.range1,this.range2].forEach(input=>input.addEventListener('change',(event)=>this.handleInputChange(event)));} 159this.track.addEventListener('click',(e)=>this.handleTrackClick(e));} 160handleSlide(event){if(parseInt(this.sliderTwo.value,10)-parseInt(this.sliderOne.value,10)<this.minGap){if(event.target.id==='slider-1'){this.sliderOne.value=parseInt(this.sliderTwo.value,10)-this.minGap;}else{this.sliderTwo.value=parseInt(this.sliderOne.value,10)+this.minGap;}} 161this.updateDisplay();this.updateTrack();this.notify('slide');} 162handleInputChange(event){const input=event.target;if(input.id==='range1Input'){this.sliderOne.value=Math.min(input.value,this.sliderTwo.value-this.minGap);}else{this.sliderTwo.value=Math.max(input.value,parseInt(this.sliderOne.value,10)+this.minGap);} 163this.updateDisplay();this.updateTrack();this.notify('input');} 164handleTrackClick(e){const rect=this.track.getBoundingClientRect();const clickX=e.clientX-rect.left;const clickPercent=clickX / rect.width;const[newValue]=this.rounded([Math.round(this.minValue+(this.maxValue-this.minValue)*clickPercent),0]);const distToSliderOne=Math.abs(newValue-this.sliderOne.value);const distToSliderTwo=Math.abs(newValue-this.sliderTwo.value);if(distToSliderOne<distToSliderTwo){this.animateSlider(this.sliderOne,newValue);}else{this.animateSlider(this.sliderTwo,newValue);}} 165animateSlider(slider,newValue){slider.style.transition='all 0.4s ease';const startValue=parseInt(slider.value,10);const diff=newValue-startValue;const step=diff / 10;let currentStep=0;const animate=()=>{if(currentStep<10){slider.value=Math.round(startValue+step*currentStep);this.updateTrack();currentStep++;requestAnimationFrame(animate);}else{slider.value=newValue;this.updateTrack();this.updateDisplay();this.notify('track');slider.style.transition='';}};animate();} 166notify(type){if(typeof this.observer==='function'){this.observer([parseInt(this.sliderOne.value,10),parseInt(this.sliderTwo.value,10)],type);}} 167updateDisplay(){if(this.range1&&this.range2){if(this.inputType==='text'){this.range1.value=this.formatedDisplay(this.sliderOne.value);this.range2.value=this.formatedDisplay(this.sliderTwo.value);}else{this.range1.value=this.sliderOne.value;this.range2.value=this.sliderTwo.value;}}} 168updateTrack(){this.track.style.background=`#dadae5`;} 169formatedDisplay(v,plainText=true){if(this.format==='number'){v=_U.Format.toNumber(v);}else if(this.format==='price'){v=_U.Format.toPrice(v,plainText);} 170return`${this.prefix}${v}${this.sufix}`;} 171updateNums(vs,fid,initiatorId){if(typeof vs==='object'&&vs!==null){const[minNum,maxNum]=this.round([vs.min,vs.max]);let minShow=this.formatedDisplay(minNum,false);let maxShow=this.formatedDisplay(maxNum,false);this.numsDisplay.innerHTML=(minNum!==maxNum)?`<b>${minShow} - ${maxShow}</b> (${vs.count})`:`<b>${minShow}</b> (${vs.count})`;const percent=value=>((value-this.minValue)/(this.maxValue-this.minValue))*100;const startPercent=percent(minNum);const endPercent=percent(maxNum);let rangeLeft=startPercent;let rangeWidth=endPercent-startPercent;if(rangeWidth<15){rangeWidth=15;if(rangeWidth+rangeLeft>100){rangeLeft-=15;}} 172if(rangeWidth>100){rangeWidth=100;} 173if(rangeLeft<0){rangeLeft=0;} 174this.rangeActive.style.left=`${rangeLeft}%`;this.rangeActive.style.width=`${rangeWidth}%`;const centerPercent=(startPercent+endPercent)/ 2;const containerWidth=this.container.offsetWidth;const numsWidth=this.numsDisplay.offsetWidth;let left=(containerWidth*centerPercent / 100);left=Math.min(containerWidth-numsWidth / 2,Math.max(numsWidth / 2,left));this.numsDisplay.style.left=`${left}px`;}else{this.numsDisplay.style.left=`50%`;if(this.fid===initiatorId){this.numsDisplay.innerHTML=`<span style="color:#900000;">${this.utext?.outofrange ?? ''}</span>`;}else{this.numsDisplay.innerHTML=(this.utext?.noresult??'');} 175this.rangeActive.style.width='0';}}} 176var PaginationBox=function(config){this._C={debug:false,id:'',type:'PaginationBox',selected:[],values:[],perpage:0};Object.assign(this,new AbstractBaseComponent());this.loadBase(config);this._perpage=(this._C?.perpage&&parseInt(this._C.perpage)>0)?parseInt(this._C.perpage):48;this._maxpage=0;this._total=0;this._isMobile=document.body.classList.contains('UsedSrp2Mobile');this.setContainer=function(){document.getElementById(this._C.id).innerHTML='<div class="divSpan divSpan12 '+this._wrapper+'">'+'<div class="divSpan divSpan12 divPaginationBoxWrapper">'+'<div class="divSpan divSpan12 divPaginationBoxes"></div>'+'</div>'+'</div>';};this.setPaging=function(v){this._total=v;if(v===0){this._maxpage=0;this.hideBar(true);return;} 177var el=document.querySelector('#'+this._C.id+' .divPaginationBoxes');if(el){var html='';var maxPage=Math.floor(v / this._perpage);if(v%this._perpage!==0){maxPage++;} 178this._maxpage=maxPage;var curr=this._vals[0]+1;var start=0,end=0;var boxSize=this._isMobile?36:40;var maxSize=document.querySelector('#'+this._C.id+' .divPaginationBoxWrapper').offsetWidth;var maxBoxes=Math.floor(maxSize / boxSize)-2-2;if(maxPage<=maxBoxes){if(maxPage>1){start=2;} 179if(maxPage>2){end=maxPage-1;}}else{var limit=curr-Math.floor(maxBoxes / 2);start=(limit>1)?limit:2;end=start+maxBoxes-1;if(end>
179=maxPage){start-=end-maxPage+1;if(start<2){start=2;} 180end=maxPage-1;} 181if(start>2){start++;} 182if(maxPage-end>1){end--;}} 183var first=mid=last='';first=this.setItem({value:0,txt:1});if(maxPage>1){last=this.setItem({value:maxPage-1,txt:maxPage});} 184if(start&&end&&end>=start){mid=this.setRange(1,start,end);} 185if(start>2){mid=this.setBlank()+mid;} 186if(end&&maxPage-end>1){mid+=this.setBlank();} 187html+='<ul>';html+=this.setArrow({value:0,txt:'down'});html+=first+mid+last;html+=this.setArrow({value:1,txt:'up'});html+='</ul>';el.innerHTML=html;this.verifyArrows();this.hideBar(false);}};this.setRange=function(inc,min,max){var html='';for(var i=min;i<=max;i+=inc){html+=this.setItem({value:i-1,txt:i});} 188return html;};this.setBlank=function(){return'<li class="divPaginationBox blank"><span class="s-name">...</span></li>';};this.setItem=function(v){var sel=this._vals[0]===v.value?'selected ':'';return'<li class="divPaginationBox '+sel+'" item-value="'+v.value+'" title="Page '+v.txt+'">'+'<button><span class="s-name">'+v.txt+'</span></button>'+'</li>';};this.setArrow=function(v){return'<li class="divPaginationArrowBox" item-value="'+v.value+'" title="'+v.txt+'">'+'<button title="'+v.txt+'"><span class="i-'+v.value+'-arrow fas fa-angle-down"></span></button>'+'</li>';};this.changeSelectedState=function(vs){this.hideBar(true);this._vals[0]=vs[0];};this.rebuildValues=function(){var vals=[];var el=document.querySelector('#'+this._C.id+' LI.divPaginationBox.selected[item-value]');if(el){vals[0]=parseInt(el.getAttribute('item-value'));}else{vals[0]=0;} 189vals[1]=this._perpage;var vs=this._vals.slice();this._vals=vals.slice();this.notifyObservers(this._vals.slice(),vs);this.verifyArrows();el=document.querySelector('.elPageTitle');if(el){window.scrollTo({top:el.offsetTop,behavior:'smooth'});} 190setTimeout(this.setPaging.bind(this,this._total),500);};this.resetCssSelected=function(){var els=document.querySelectorAll('#'+this._C.id+' LI.divPaginationBox.selected');els.forEach(function(el){el.classList.remove('selected');});};this.reset=function(){this.hideBar(true);this._maxpage=0;this._vals=[0,this._perpage];};this.hideBar=function(b){var el=document.querySelector('#'+this._C.id+' .divPaginationBoxes');if(el){el.style.opacity=b?0:1;}};this.gotoFirstPage=function(){if(this._vals[0]!==0){const targetElement=document.querySelector(`#${this._C.id} LI.divPaginationBox[item-value="0"]`);if(targetElement){const customEvent=new CustomEvent('click',{bubbles:true,cancelable:true,detail:{target:targetElement}});targetElement.dispatchEvent(customEvent);}}};this.verifyArrows=function(){var el=document.querySelector('#'+this._C.id+' LI.divPaginationArrowBox[item-value="0"]');if(this._vals[0]===0||this._maxpage===1){el.classList.add('disabled');}else{el.classList.remove('disabled');} 191el=document.querySelector('#'+this._C.id+' LI.divPaginationArrowBox[item-value="1"]');if(this._vals[0]>=(this._maxpage-1)||this._maxpage===1){el.classList.add('disabled');}else{el.classList.remove('disabled');}};this.clickItem=function(ev){var el=ev.target.closest('LI.divPaginationBox[item-value]');if(el&&parseInt(el.getAttribute('item-value'))!==this._vals[0]){this.resetCssSelected();el.classList.add('selected');this.pushStack(this._C.id);this.rebuildValues();}};this.clickArrow=function(ev){var el=ev.target.closest('LI.divPaginationArrowBox[item-value]');if(el){var c=this._vals[0];if(parseInt(el.getAttribute('item-value'))===0){c=(c>0)?c-1:c;}else{c=(c<(this._maxpage-1))?c+1:c;} 192if(c!==this._vals[0]){this.resetCssSelected();document.querySelector('#'+this._C.id+' LI.divPaginationBox[item-value="'+c+'"]').classList.add('selected');this.rebuildValues();}}};this.initActions=function(){var container=document.getElementById(this._C.id);container.addEventListener('click',function(event){if(event.target.closest('LI.divPaginationBox')){this.clickItem(event);}else if(event.target.closest('LI.divPaginationArrowBox')){this.clickArrow(event);}}.bind(this));};this.init=function(){this.setContainer();this.initActions();};};var SearchInputBox=function(config){this._C={debug:false,id:'',type:'SearchInputBox',shownum:true,values:[]};Object.assign(this,new AbstractBaseComponent());this.loadBase(config);this._timerInputChange=null;this._waitInputChange=500;this._lastFocusedValues=false;this.setContainer=function(){var el=document.querySelector('#'+this._C.id+' .divInputBoxWrapper');var html='<div class="divSpan divSpan12 '+this._wrapper+'" style="display:none;">'+'<div class="divSpan divSpan12 divInputWrapper">'+'<div class="divSpan divSpan12 divInputBoxes"></div>'+'</div>'+'</div>';el.querySelector('.divClearWrapper').insertAdjacentHTML('afterend',html);this.isDisabled(this._disabled);};this.setInputBoxes=function(){var el=document.querySelector('#'+this._C.id+' .divInputBoxes');var html='';for(var i=0,len=this._values.length;i!==len;i++){html+=this.setInputBox(this._values[i]);} 193el.insertAdjacentHTML('beforeend',html);};this.setInputBox=function(v){var hideBox=(v?.hidden===true)?'hidden':'';var html='<input '+'autocomplete="off" '+'autocorrect="off" '+'autocapitalize="none" '+'type="text" '+'spellcheck="false" '+'value="" '+'name="'+v.value+'" '+'aria-label="'+v.txt+'" '+'placeholder="'+v.txt+'" '+'seperated="'+v.seperated+'"'+'>';if(this._C.shownum){var num=v?.num||0;html+='<div class="divBadgeNum" style="opacity:0;">'+'<span class="s-num">
193'+num+'</span>'+'</div>';} 194return'<div class="divSpan divSpan12 divInputBox '+hideBox+'">'+html+'</div>';};this.rebuildValues=function(){var vs=this._vals.slice();var vals=this._lastFocusedValues!==false?[this._lastFocusedValues]:[];this._vals=vals;this.clearState();this.notifyObservers(vals,vs);};this.checkForRebuildValues=function(){clearTimeout(this._timerInputChange);this._timerInputChange=setTimeout(()=>{this.rebuildValues();this.onInputChange();},this._waitInputChange);};this.onInputEvent=function(ev){switch(ev.type){case'paste':case'keyup':var el=ev.target;var v=el.value.replace(new RegExp("['\"]","g"),'').replace(new RegExp("\\s+","g"),' ').trim();this._lastFocusedValues={n:el.getAttribute('name'),v:v,s:parseInt(el.getAttribute('seperated'))};if(ev.type==='paste'||ev.keyCode===13){document.documentElement.scrollTo({top:document.querySelector('h1').offsetTop,behavior:'smooth'});} 195if(ev.type!=='paste'&&ev.keyCode===13){this.rebuildValues();this.onInputChange();}else{this.checkForRebuildValues();} 196break;default:break;} 197this.clearState();};this.clearState=function(){var active=false,el=document.querySelectorAll('#'+this._C.id+' .divInputBox INPUT');if(el.length){el.forEach(function(input){if(input.value!==''){active=true;return false;}});} 198this.isActive(active);var elClr=document.querySelector('#'+this._C.id+' span.sp-clear');if(elClr){if(this.isActive()){elClr.classList.add('active');}else{elClr.classList.remove('active');}}};this.reset=function(ev){document.querySelectorAll('#'+this._C.id+' .divInputBox INPUT').forEach(input=>input.value='');this.clearState();this._lastFocusedValues=false;this.rebuildValues();};this.initActions=function(){var container=document.querySelector('#'+this._C.id);container.addEventListener('click',function(event){if(event.target.closest('.divActionWrapper')){this.openSelect();}}.bind(this));container.addEventListener('keyup',this.onInputEvent.bind(this));container.addEventListener('keypress',this.onInputEvent.bind(this));container.addEventListener('blur',this.onInputEvent.bind(this),true);container.addEventListener('change',this.onInputEvent.bind(this));container.addEventListener('focusin',this.onInputEvent.bind(this));container.addEventListener('focusout',this.onInputEvent.bind(this));container.addEventListener('paste',(ev)=>{setTimeout(this.onInputEvent.bind(this,ev),250);});};this.changeSelectedState=function(vs){var el=document.querySelectorAll('#'+this._C.id+' .divInputBox INPUT');el.forEach(input=>input.value='');var len=vs.length;if(len===0){this._lastFocusedValues=false;}else{for(var i=0;i!==len;i++){var input=document.querySelector('#'+this._C.id+' .divInputBox INPUT[name="'+vs[i].n+'"]');if(input){input.value=vs[i].v;this._lastFocusedValues={n:vs[i].n,v:vs[i].v,s:vs[i].s};}}} 199this.rebuildValues();};this.changeNumsInBatch=function(v,fid,initiatorId){var el=document.querySelectorAll('#'+this._C.id+' .divInputBox');el.forEach(box=>{box.classList.remove('noResult');var badge=box.querySelector('.divBadgeNum');if(badge){badge.style.opacity=0;}});if(v!==false){for(var i=0,len=v.length;i!==len;i++){var input=document.querySelector('#'+this._C.id+' .divInputBox INPUT[name="'+v[i].name+'"]');if(input){var badge=input.parentElement.querySelector('.divBadgeNum');if(badge){badge.style.opacity=1.0;badge.querySelector('span.s-num').textContent=v[i].count;} 200if(v[i].count===0){input.parentElement.classList.add('noResult');}}}}};this.restore=function(){if(this._vals.length===0)return;let open=false;const elements=document.querySelectorAll(`#${this._C.id} .divInputBox`);this._vals.forEach(val=>{if(val.v==='')return;open=true;elements.forEach(el=>{const input=el.querySelector(`INPUT[name="${val.n}"]`);if(input){input.value=val.v;this._lastFocusedValues={n:val.n,v:val.v,s:val.s};}});});if(open&&!this.isOpen()){this.openSelect();}};this.setInputFocus=function(n){var input=document.querySelector('#'+this._C.id+' INPUT[name="'+n+'"]');if(input){input.focus();}};this.onInputChange=function(ev){};this.init=function(){this.setContainer();this.setInputBoxes();this.initActions();};};var CarburantListingBox=function(config){this._C={id:'CarburantListingBox',...(typeof config==='object'&&config!==null?config:{})};Object.assign(this,new ListingBox(this._C));this.updated=(id)=>{const observables=[this.getObservables('lowconsumption'),this.getObservables('electricrange'),this.getObservables('batteryenergy')];if(observables.includes(id)){this.clearState();}};};var CategoryListingBox=function(config){this._C={id:'CategoryListingBox',...(typeof config==='object'&&config!==null?config:{})};Object.assign(this,new ListingBox(this._C));this.updated=(id)=>{const observables=[this.getObservables('clearance'),this.getObservables('certified'),this.getObservables('asis'),this.getObservables('cuvapproved'),this.getObservables('cuvcertified'),this.getObservables('autocancpo'),this.getObservables('autocanacc'),this.getObservables('autocanviv'),this.getObservables('typecertification')];if(observables.includes(id)){this.clearState();}};};var SubBodyTypeListingBox=function(config){this._C={id:'SubBodyTypeListingBox',...(typeof config==='object'&&config!==null?config:{})};Object.assign(this,new ListingBox(this._C));this.updated=(id,curr)=>{if(id!==this.getObservables('bodytype'))return;if(!curr?.length||!this._C?.conditions?.bodytype?.ids){this.setGroupVisibility([]);return;} 201const hasMatchingBodyType=curr.some(id=>this._C.conditions.bodytype.ids.includes(id));this.setGroupVisibility(hasMatchingBodyType?[...curr]:[]);};};var FloorPlanListingBox=function(config){this._C={id:'FloorPlanListingBox',...(typeof config==='object'&&config!==null?config:{})};Object.assign(this,new ListingBox(this._C));this.updated=(id,curr)=>{if(id!==this.getObservables('bodytype'))return;if(!curr?.length||!this._C?.conditions?.bodytype?.ids){this.setGroupVisibility([]);return;} 202const hasMatchingBodyType=curr.some(id=>this._C.conditions.bodytype.ids.includes(id));this.setGroupVisibility(hasMatchingBodyType?[...curr]:[]);};};var MakesListingBox=function(config){this._C={id:'MakesListingBox',...(typeof config==='object'&&config!==null?config:{})};Object.assign(this,new ListingBox(this._C));this.setHookDecorator=function(){const fn='changeNumsInBatch';if(typeof this[fn]==='function'){const f=this[fn];const that=this;this[fn]=function(){const rtn=f.apply(that,arguments);const selector=`#${that._C.id} .${that._scopeId} LI[item-value]`;const res=that._datamodel?.getItemsFromResultSet('makeVisibility');if(res!==false&&res!==undefined){document.querySelectorAll(selector).forEach(item=>{const value=parseInt(item.getAttribute('item-value'));if(res.includes(value)){item.classList.remove('hideme');}else if(!item.classList.contains('selected')){item.classList.add('hideme');}});}else{document.querySelectorAll(selector).forEach(item=>{item.classList.remove('hideme');});} 203return rtn;};}};this.setHookDecorator();};var ModelsListingBox=function(config){this._C={id:'ModelsListingBox',...(typeof config==='object'&&config!==null?config:{})};Object.assign(this,new ListingBox(this._C));this.setHookDecorator=function(){const fn='changeNumsInBatch';if(typeof this[fn]==='function'){const f=this[fn];const that=this;this[fn]=function(){const rtn=f.apply(that,arguments);const selector=`#${that._C.id} .${that._scopeId} LI[item-value]`;const res=that._datamodel?.getItemsFromResultSet('modelVisibility');if(res!==false&&res!==undefined){document.querySelectorAll(selector).forEach(item=>{const value=parseInt(item.getAttribute('item-value'));if(res.includes(value)){item.classList.remove('hideme');}else if(!item.classList.contains('selected')){item.classList.add('hideme');}});}else{document.querySelectorAll(selector).forEach(item=>{item.classList.remove('hideme');});} 204return rtn;};}};this.updated=(id,curr)=>{if(id!==this.getObservables('make'))return;this.setGroupVisibility(curr);};this.setHookDecorator();};var TrimsListingBox=function(config){this._C={id:'TrimsListingBox',...(typeof config==='object'&&config!==null?config:{})};Object.assign(this,new ListingBox(this._C));this.updated=(id,curr)=>{if(id!==this.getObservables('model'))return;this.setGroupVisibility(curr);};};var EngineListingBox=function(config){this._C={id:'EngineListingBox',...(typeof config==='object'&&config!==null?config:{})};Object.assign(this,new ListingBox(this._C));this.setHookDecorator=function(){if(this.isHidden()){return;} 205const that=this;const gHideOn=this._C?.hideOn||[];let fn='setItem';if(typeof this[fn]==='function'){const f=this[fn];this[fn]=function(){if(arguments[0]?.hide!==undefined&&arguments[0]?.value!==undefined&&arguments[0].value===0){arguments[0].hide=1;} 206return f.apply(that,arguments);};} 207fn='changeNumsInBatch';if(typeof this[fn]==='function'){const f2=this[fn];this[fn]=function(){let count=0;const rtn=f2.apply(that,arguments);const hide=((gHideOn.indexOf(arguments[2])!==-1||gHideOn.indexOf('ALL')!==-1||!that.isInitialized())&&arguments[2]!==that._C.id);const items=document.querySelectorAll(`#${that._C.id} .${that._scopeId} LI[item-value]`);
207items.forEach(item=>{const value=parseInt(item.getAttribute('item-value'));if(value===0||item.classList.contains('disabelable')){if(!item.classList.contains('selected')&&hide){item.classList.add('hideme');}else{count++;}}else{item.classList.remove('hideme');count++;}});if(!count){that.setMsg(that._C?.utext?.none);}else{that.setMsg();} 208return rtn;};}};this.setHookDecorator();};var CylindersListingBox=function(config){this._C={id:'CylindersListingBox',...(typeof config==='object'&&config!==null?config:{})};Object.assign(this,new ListingBox(this._C));var that=this;this.reorder=function(arr){var f=that._C.orderBy;try{arr.sort(function(a,b){var az=(a&&a.value===0)?1:0;var bz=(b&&b.value===0)?1:0;if(az!==bz){return az-bz;} 209if(f&&f.field&&a&&a[f.field]&&b&&b[f.field]){return a[f.field].localeCompare(b[f.field]);} 210return 0;});}catch(ex){console.error(ex);}};};var PackageListingBox=function(config){this._C={id:'PackageListingBox',...(typeof config==='object'&&config!==null?config:{})};Object.assign(this,new ListingBox(this._C));this.setHookDecorator=function(){if(this.isHidden()){return;} 211const that=this;const gHideOn=this._C?.hideOn||[];let fn='setItem';if(typeof this[fn]==='function'){const f=this[fn];this[fn]=function(){if(arguments[0]?.hide!==undefined&&arguments[0]?.value!==undefined&&arguments[0].value===0){arguments[0].hide=1;} 212return f.apply(that,arguments);};} 213fn='changeNumsInBatch';if(typeof this[fn]==='function'){const f2=this[fn];this[fn]=function(){let count=0;const rtn=f2.apply(that,arguments);const hide=((gHideOn.indexOf(arguments[2])!==-1||gHideOn.indexOf('ALL')!==-1||!that.isInitialized())&&arguments[2]!==that._C.id);const items=document.querySelectorAll(`#${that._C.id} .${that._scopeId} LI[item-value]`);items.forEach(item=>{const value=parseInt(item.getAttribute('item-value'));if(value===0||item.classList.contains('disabelable')){if(!item.classList.contains('selected')&&hide){item.classList.add('hideme');}else{count++;}}else{item.classList.remove('hideme');count++;}});if(!count){that.setMsg(that._C?.utext?.none);}else{that.setMsg();} 214return rtn;};}};this.setHookDecorator();};var DealersListingBox=function(config){this._C={id:'DealersListingBox',...(typeof config==='object'&&config!==null?config:{})};Object.assign(this,new ListingBox(this._C));this.setHookDecorator=function(){if(this.isHidden()){return;} 215const that=this;const gHideOn=this._C?.hideOn||[];const fn='changeNumsInBatch';if(typeof this[fn]==='function'){const f=this[fn];this[fn]=function(){const rtn=f.apply(that,arguments);const hide=((gHideOn.indexOf(arguments[2])!==-1||gHideOn.indexOf('ALL')!==-1||!that.isInitialized())&&arguments[2]!==that._C.id);const items=document.querySelectorAll(`#${that._C.id} .${that._scopeId} LI[item-value]`);items.forEach(item=>{if(item.classList.contains('disabelable')){if(!item.classList.contains('selected')&&hide){item.classList.add('hideme');}}else{item.classList.remove('hideme');}});return rtn;};}};this.setHookDecorator();};var CarburantInnerRangeSlider=function(config){this._C={id:'CarburantInnerRangeSlider',conditions:{ids:[]},...(typeof config==='object'&&config!==null?config:{})};Object.assign(this,new RangeSlider(this._C));this.updated=(id,curr)=>{if(id!==this.getObservables('carburant'))return;const element=document.getElementById(this._C.id);if(!element)return;const hasMatchingCondition=curr?.length&&this._C?.conditions?.ids?.length&&curr.some(id=>this._C.conditions.ids.includes(id));element.classList.toggle('hide',!hasMatchingCondition);if(!hasMatchingCondition)this.reset();};};var BodyTypeConditionalRangeSlider=function(config){this._C={id:'BodyTypeConditionalRangeSlider',...(typeof config==='object'&&config!==null?config:{})};Object.assign(this,new RangeSlider(this._C));this.updated=(id,curr)=>{if(id!==this.getObservables('bodytype')||!this._C.conditions?.ids?.length)return;const element=document.getElementById(this._C.id);if(!element)return;const shouldHide=!curr.some(id=>this._C.conditions.ids.includes(id));element.classList.toggle('hide',shouldHide);if(shouldHide)this.reset();};};var CarrosserieButtonBox=function(config){this._C={id:'CarrosserieButtonBox',...(typeof config==='object'&&config!==null?config:{})};Object.assign(this,new ButtonBox(this._C));this.setHookDecorator=function(){var fn='changeNumsInBatch';if(typeof this[fn]==='function'){let f=this[fn],that=this;this[fn]=function(){let rtn=f.apply(that,arguments),res=that._datamodel.getItemsFromResultSet('bodytypeVisibility'),el=document.querySelectorAll(`#${that._C.id} LI[item-value].isactivated`);if(res!==false){el.forEach(function(t){let itemValue=parseInt(t.getAttribute('item-value'));if(res.indexOf(itemValue)!==-1){t.classList.remove('hideme');}else{if(!t.classList.contains('selected')){t.classList.add('hideme');}}});}else{el.forEach(function(t){t.classList.remove('hideme');});} 216var items=arguments[0];for(var o in items){if(!items.hasOwnProperty(o)){continue;} 217let el2=document.querySelector(`#${that._C.id} LI[item-value="${items[o].value}"] SPAN.s-text`);if(el2){let itm=(that._values.filter(function(t){return(t.value===items[o].value);}))[0];el2.innerHTML=itm.txt;}} 218return rtn;};}};this.setHookDecorator();};var FilterModel=function(config){this._C={id:'filterModel',name:'FilterModel',debug:false,workerConf:null,preset:'preset',data:false,isDealerInspire:false,...(typeof config==='object'&&config!==null?config:{})};this._inclusion=false;this._exclusion=false;this._dbcolumns=false;this._data=this._C?.data??false;this._resultset=null;this._fWrk=null;this.loadData=function(){if(this._data===false){return false;} 219this.loadExtras();return true;};this.loadExtras=function(){var hf=document.getElementById(this._C.id);if(hf){try{var val=hf.value;if(val!==''){val=JSON.parse(atob(val));if(typeof val==='object'){this._inclusion=val?.inclusion??false;this._exclusion=val?.exclusion??false;this._dbcolumns=val?.dbcolumns??false;return;}}}catch(ex){console.error(ex);}} 220this._inclusion=false;this._exclusion=false;this._dbcolumns=false;};
220this.getSeededGeoColumn=function(){if(this._dbcolumns===false){return null;} 221for(var i=0,len=this._dbcolumns.length;i!==len;i++){var col=this._dbcolumns[i].column;if(col==='geolocation'||col==='dealerlocator'){return col;}} 222return null;};this.getTxtByFltId=function(id,v){if(this._data?.fkeys[id]){var r=_U.Arrays.find(this._data[this._data.fkeys[id]],'value',v);if(r===-1){console.error('ERR: cant found the value for ['+id+']:'+v);return'';} 223return r.txt;} 224console.error('ERR: data is not defined for ['+id+']:'+v);return'';};this.loadWorker=function(cb){let blob;try{blob=(!window?.Blob||!window?.URL)?false:URL.createObjectURL(new Blob(['function buildRegex(a,b,c){var d="",e=b?"^":"",f=c?"\\\\s":"";return a.forEach(function(a){d+=b?""===d?a:"|"+a:-1===a.indexOf("%")?"(?=.*"+f+a+")":"(?=.*\\\\s"+a.replace(/%/g,"[-\\\\w\\\\d\\\\s]+")+"\\\\s)"}),e+"(?:"+d+")"}var FilterWorker=function(a){this._C={name:"FilterWorker",db:!1,debug:!1,conf:null,baseURI:null,...("object"==typeof a&&null!==a?a:{})},this._cancel=!1,this._id=!1,this._fo=!1,this._dbrestore=!1,this._cache={resultset:[],visibility:{make:[],model:[],bodytype:[]}},this._filterIdFromKeyNameCache=[],"undefined"!=typeof this._C.db&&this._C.db?this._data=this._C.db:(console.error("Cannot continue! DB is empty"),this._data=!1),this._baseURI=this._C.baseURI,this._inclusion=!("object"!=typeof this._C.inclusion)&&this._C.inclusion,this._exclusion=!("object"!=typeof this._C.exclusion)&&this._C.exclusion,this._dbcolumns=!("object"!=typeof this._C.dbcolumns)&&this._C.dbcolumns,this._lastTotalCount=0,this._priorities="undefined"==typeof this._C.conf.priorities?[]:this._C.conf.priorities,this._filterToIndex="undefined"==typeof this._C.conf.toIndex?[]:this._C.conf.toIndex,this._filterHasObject="undefined"==typeof this._C.conf.hasObject?[]:this._C.conf.hasObject,this._filterHasMultiDimension="undefined"==typeof this._C.conf.hasMultiDimension?[]:this._C.conf.hasMultiDimension,this._filterNoRsChildCount="undefined"==typeof this._C.conf.noRsChildCount?[]:this._C.conf.noRsChildCount,this._indexValuePos={},this._indexArrayValuePos={},this._regexTextCache=[],this._keywordsFile="undefined"==typeof this._C.conf.keywordsJsonFile?"":this._C.conf.keywordsJsonFile,this._keywordsObj=null,this.getFieldSearchKeywordsByVehicleId=a=>{const b=this._keywordsObj["_"+a];return"string"==typeof b?{vin:"",stock_number:"",txt_search:b}:this._keywordsObj["_"+a]??null},this.loadKeywords=async()=>{if(null!==this._keywordsObj)return!0;if(!this._keywordsFile.length)return this._keywordsObj={},!1;let a=new URL(this._keywordsFile,this._baseURI),b=await fetch(a.href);if(200!==b.status)return this._keywordsObj={},!1;let c=await b.json();return 1==c.error?(this._keywordsObj={},!1):(this._keywordsObj=c,!0)},this.createIndexes=function(){for(var a=0,b=this._filterToIndex.length;a!==b;a++){var c=this._filterToIndex[a],d=this.getFilterKeyName(c);this._indexValuePos[d]={},this._indexArrayValuePos[d]=[];for(var e=0,f=this._data[d].length;e!==f;e++)this._indexValuePos[d][this._data[d][e].value]=e,this._indexArrayValuePos[d].push(e)}},this.isCancel=function(a){return"undefined"!=typeof a&&(this._cancel=a),this._cancel},this.getFilterKeyName=function(a){return this._data.fkeys[a]},this.getDbKeyName=function(a){return"undefined"!=typeof this._data.dbkeys[a]&&this._data.dbkeys[a]},this.getFilterIdFromKeyName=function(a){if("undefined"!=typeof this._filterIdFromKeyNameCache[a])return this._filterIdFromKeyNameCache[a];for(var b in this._data.fkeys)if(this._data.fkeys.hasOwnProperty(b)&&this._data.fkeys[b]===a)return this._filterIdFromKeyNameCache[a]=b,b;return!1},this.getIndexArrayFromFilter=function(a){return this._indexArrayValuePos[a]},this.getFilterIndexByValue=function(a,b){return this._indexValuePos[a][b]},this.getFilterObjectByIndex=function(a,b){return this._data[a][b]},this.getResultSet=async function(a,b){if(!0===this._cancel)return!1;try{var c=this._fo[b],e=c.value.length}catch(b){return a}if(0<e&&!1!==a&&!c.skip){let b,d;if("SearchInputBox"===c.type)for(d=0;d!==e;d++){const b=c.value[d];a=await this.getFilterSearchInputBoxData(a,b,this)}else{var g=this.getFilterKeyName(c.id);if(b=this.getDbKeyName(g),"RangeSlider"===c.type){var f=c.value[0],h=c.value[1];-1!==[this.getFilterIdFromKeyName("dpayment"),this.getFilterIdFromKeyName("price")].indexOf(c.id)&&(f=0===f?1:f),a=a.filter(function(a){return a[b]>=f&&a[b]<=h})}else{var j=[];for(d=0;d<e;d++)j.push(this.getFilterIndexByValue(g,c.value[d]));a=-1===this._filterHasObject.indexOf(c.id)?-1===this._filterHasMultiDimension.indexOf(c.id)?a.filter(function(a){return-1!==j.indexOf(a[b])}):a.filter(function(a){for(var c=0,d=j.length;c<d;c++)if(-1!==a[b].indexOf(j[c]))return!0;return!1}):a.filter(function(a){for(var c=0,d=j.length;c<d;c++)if(!Array.isArray(a[b])||-1===a[b].indexOf(j[c]))return!1;return!0})}}}return!!(!0!==this._cancel&&null!==a&&a&&0!==a.length)&&a},this.filterBySingleCharMakeModel=function(a,b){const c=this.getDbKeyName("make"),d=this.getDbKeyName("model");if(!1===c||!1===d)return a;const e=this._data.make,f=this._data.model,g=" "+b;return a.filter(a=>{const h=e[a[c]],i=f[a[d]];return"undefined"!=typeof h&&(" "+h.txt.toLowerCase()).includes(g)||"undefined"!=typeof i&&(" "+i.txt.toLowerCase()).includes(g)})},this.getFilterSearchInputBoxData=async function(a,b,c){if(""===b.v||""===b.n)return a;const d=c.getDbKeyName(b.n);if(!1===d)return a;let e=null;if("fieldsearch"===b.n){const m=b.v.replace(/\\s+/g,"").toLowerCase();if(1===m.length)return c.filterBySingleCharMakeModel(a,m);e=c.getDbKeyName("id"),await c.loadKeywords()}const f=b.v.replace(/\\.|\\^|\\$|\\*|\\+|\\?|\\(|\\)|\\[|{|\\\\\\\\|\\|/gi,a=>"\\\\"+a);let g,h="";1===b.s?(h=" ","undefined"==typeof c._regexTextCache[f]?(g=buildRegex(f.split(" ").slice(0,4),!1,!0),c._regexTextCache[f]=g):g=c._regexTextCache[f]):2===b.s?g=buildRegex(f.split(" "),!0,!0):g=f;const i=new RegExp(g,"i"),j=f.toLowerCase().split(/\\s+/).filter(
224Boolean);return a.filter(a=>{let b=e?c.getFieldSearchKeywordsByVehicleId(a[e]):a[d];if(null===b)return!1;const f=b.vin?.toLowerCase()??"",g=b.stock_number?.toLowerCase()??"",k=b.txt_search?.toLowerCase()??"",l=j.every(a=>{const n=1===j.length&&1<a.length;return n&&f.includes(a)||n&&g.includes(a)||k.includes(" "+a)});return l||b.txt_search&&i.test(h+b.txt_search+h)})},this.getItemsCountFromResultSet=function(a,b){if(!0===this._cancel||!1===a)return!1;let c,d,e,f;const g=a.length,h=this.getFilterKeyName(b),j=this.getIndexArrayFromFilter(h);if(0===g||!1===j)return!1;const k=this.getDbKeyName(h),l=-1!==this._filterHasObject.indexOf(b),m=-1!==this._filterHasMultiDimension.indexOf(b),n={};for(f=0;f!==g;f++){if(!0===this._cancel)return!1;let b=a[f],g=[];if(!l&&!m){if("fieldsearch"===h){let a=this.getFieldSearchKeywordsByVehicleId(b[this.getDbKeyName("id")]);a&&(a.vin&&g.push(a.vin),a.stock_number&&g.push(a.stock_number),a.txt_search&&g.push(a.txt_search))}else g.push(b[k]);for(let a of g)if(-1!==j.indexOf(a)){"undefined"==typeof n[a]?(c=this.getFilterObjectByIndex(h,a),n[a]={value:c.value,num:1}):n[a].num++;break}}else for(e in b[k])b[k].hasOwnProperty(e)&&(d=b[k][e],"undefined"==typeof n[d]?(c=this.getFilterObjectByIndex(h,d),n[d]={value:c.value,num:1}):n[d].num++)}let o=[];for(d in n)n.hasOwnProperty(d)&&o.push(n[d]);return o},this.trimDbWithInclusion=function(){if(!1!==this._data){var a;if(!1!==this._inclusion){var b=this._inclusion;a=this.getDbKeyName("id"),this._data.db=this._data.db.filter(function(c){return-1!==b.indexOf(c[a])})}else a=this.getDbKeyName("excluded"),this._data.db=this._data.db.filter(function(b){return 0===b[a]});this._dbrestore=JSON.stringify(this._data.db)}},this.trimDbWithExclusion=function(){if(!1!==this._data){var a;if(!1!==this._exclusion){var b=this._exclusion;a=this.getDbKeyName("id"),this._data.db=this._data.db.filter(function(c){return-1===b.indexOf(c[a])})}this._dbrestore=JSON.stringify(this._data.db)}},this.prepareResultSet=async function(a){var b,c;this._id=a.id,this._fo=a.fo;var d=this._id+"-"+btoa(a.ch)+"-"+btoa(JSON.stringify(this._fo));if("undefined"!=typeof this._cache.resultset[d])return this._lastTotalCount=this._cache.resultset[d].count,this._cache.resultset[d].rs;var e,f=this._fo.length,g={},h={},k=JSON.stringify(this._data.db),l=this._data.db,m=JSON.parse(k),n=a.dealerFltIds,o=this._id,p=!1;for(b=0;b!==f;b++)g[this._fo[b].id]=b;for(b=0;b!==f&&(o===this._fo[b].id&&!0===this._fo[b].xand&&(p=!0),-1===n.indexOf(this._fo[b].id)&&(m=await this.getResultSet(m,b)),!((o!==this._fo[b].id||p)&&-1===this._priorities.indexOf(this._fo[b].id)&&(l=await this.getResultSet(l,b),!1===l)));b++);var q=this._priorities.length;for(b=0;b!==q;b++)for(h[this._priorities[b]]=!1!==l&&l.slice(),c=0;c!==q&&!(this._priorities[b]!==this._priorities[c]&&(h[this._priorities[b]]=await this.getResultSet(h[this._priorities[b]],g[this._priorities[c]]),!1===h[this._priorities[b]]));c++);if(!p)if(-1===this._priorities.indexOf(o))for(e=!1!==l&&l.slice(),b=0;b!==q;b++)e=await this.getResultSet(e,g[this._priorities[b]]);else e=!1!==h[o]&&h[o].slice();for(b=0;b!==q;b++)this._priorities[b]!==o&&(h[this._priorities[b]]=await this.getResultSet(h[this._priorities[b]],g[o])),l=await this.getResultSet(l,g[this._priorities[b]]);p||(l=await this.getResultSet(l,g[o])),this._lastTotalCount=!1===l?0:l.length;var r={};for(b=0;b!==q;b++){var s=!0,t=this._filterNoRsChildCount.length;if(0<t)for(c=0;c<t;c++)if(this._priorities[b]===this._filterNoRsChildCount[c].item&&0===this._fo[g[this._filterNoRsChildCount[c].group]].value.length){s=!1;break}s&&(r[this._priorities[b]]=this.getItemsCountFromResultSet(h[this._priorities[b]],this._priorities[b]))}for(b=0;b!==f;b++)if("RangeSlider"!==this._fo[b].type&&"SearchInputBox"!==this._fo[b].type&&-1===this._priorities.indexOf(this._fo[b].id)){var s=!0,t=this._filterNoRsChildCount.length;if(0<t)for(c=0;c<t;c++)if(this._fo[b].id===this._filterNoRsChildCount[c].item&&0===this._fo[g[this._filterNoRsChildCount[c].group]].value.length){s=!1;break}s&&(r[this._fo[b].id]=this.getItemsCountFromResultSet(o!==this._fo[b].id||p?l:e,this._fo[b].id))}else"RangeSlider"===this._fo[b].type?r[this._fo[b].id]=this.getMinMaxValue(l,this._fo[b]):"SearchInputBox"===this._fo[b].type&&(r[this._fo[b].id]=this.getTextSearchValue(l,this._fo[b]));r.dealerDb=this.buildDealerLocatorResultSet(m);try{var u=this._fo[g.fltCategorieId].value;r.makeVisibility=this.buildVisibilityFromCategories("make",u,k),r.modelVisibility=this.buildVisibilityFromCategories("model",u,k),r.bodytypeVisibility=this.buildVisibilityFromCategories("bodytype",u,k)}catch(a){console.error(a)}
224return"undefined"==typeof this._cache.resultset[d]&&(this._cache.resultset[d]={rs:r,count:this._lastTotalCount}),r},this.buildDealerLocatorResultSet=function(a){if(!0===this._cancel)return!1;if(!1===a)return!1;var b=a.length;if(0===b)return!1;for(var c,d=[],e=this.getFilterKeyName("fltDealersId"),f=this.getDbKeyName(e),g=0;g!==b;g++)c=this._data[e][a[g][f]].value,"undefined"==typeof d[c]&&(d[c]=0),d[c]++;return d},this.buildVisibilityFromCategories=function(a,b,c){var e=[];if(-1===["make","model","bodytype"].indexOf(a))return!1;!1===this._inclusion||b.length||"undefined"==typeof this._data.category||this._data.category.forEach(a=>{b.push(a.value)});var f=btoa(JSON.stringify(b));if("undefined"!=typeof this._cache.visibility[a][f])return this._cache.visibility[a][f];try{if(this._cancel)return!1;if(c=JSON.parse(c),!1===c)return!1;var g=c.length;if(0===g)return!1;if(!b.length)return!1;var h=this.getDbKeyName("category"),k=this.getDbKeyName(a);if(!b.length)return!1;for(var l=0;l!==g;l++)if(-1!==b.indexOf(this._data.category[c[l][h]].value)){let d=c[l][k];if(-1!==b.indexOf(this._data.category[c[l][h]].value))if("bodytype"===a)for(var m=0;m!==d.length;m++)e.push(this._data[a][d[m]].value);else e.push(this._data[a][d].value)}}catch(a){console.error(a)}return e=!!e.length&&[...new Set(e)],this._cache.visibility[a][f]=e,e},this.getTextSearchValue=function(a,b){if(!0===this._cancel)return!1;if("undefined"==typeof b.value||"undefined"!=typeof b.value&&0===b.value.length)return!1;var c=[];for(var d in b.value)b.value.hasOwnProperty(d)&&c.push({name:b.value[d].n,value:b.value[d].v,seperated:b.value[d].s,count:this._lastTotalCount});return c},this.getMinMaxValue=function(a,b){if(!0===this._cancel)return!1;if(!1===a)return!1;var c=a.length;if(0===c)return!1;for(var d,e={min:0,max:0,count:c},f=this.getFilterKeyName(b.id),g=this.getDbKeyName(f),h=0;h!==c;h++){if(d=a[h][g],0==h){e.min=e.max=d;continue}d<e.min&&(e.min=d),d>e.max&&(e.max=d)}return e},this.getItemsToHide=function(){if(!1===this._data)return!1;var a,b=[];if(!1===this._inclusion)a=this.getFilterIdFromKeyName("category"),!1!==a&&(b[a]=this.getItemsCountFromResultSet(this._data.db,a));else for(var c=0,d=this._filterToIndex.length;c!==d;c++)a=this._filterToIndex[c],b[a]=this.getItemsCountFromResultSet(this._data.db,a);return b},this.getLastTotalCount=function(){return this._lastTotalCount},this.getItemsByGroup=function(a,b){for(var c=this._data[this.getFilterKeyName(a)],d=this._data[this.getFilterKeyName(b)],e={},f=0,g=c.length;f!==g;f++)if("undefined"!=typeof c[f].group){var h=d[c[f].group];"undefined"==typeof e[h.value]?e[h.value]={txt:h.txt,value:h.value,values:[c[f]]}:e[h.value].values.push(c[f])}else console.error("db["+f+"].group is not defined for: "+a+", "+b);var j=[];for(var l in e)e.hasOwnProperty(l)&&j.push(e[l]);return j},this.setDbStandardColumn=function(a,b){var c,d=this._data.db.length,e=this.getDbKeyName(a),f=this.getDbKeyName("id");for(c=0;c!==d;c++)"undefined"!=typeof b[this._data.db[c][f]]&&(this._data.db[c][e]=b[this._data.db[c][f]])},this.setDbGeoLocation=function(a,b){var c,d,e=this._data.db.length,f={},g=this.getDbKeyName(a),h=this.getDbKeyName("dealers");for(d in b)b.hasOwnProperty(d)&&(f[this.getFilterIndexByValue("dealers",d)]=b[d]);for(c=0;c!==e;c++)"undefined"!=typeof f[this._data.db[c][h]]&&(this._data.db[c][g]=f[this._data.db[c][h]])},this.setDbColumn=function(a,b){this._data.db&&this._data.db.length&&(!1===b?this.restoreDbButKeep(a):"geolocation"===a||"dealerlocator"===a?this.setDbGeoLocation(a,b):this.setDbStandardColumn(a,b))},this.restoreDbButKeep=function(a){if("geolocation"===a||"dealerlocator"===a){var b=[],c=this._data.db.length,d="geolocation"===a?this.getDbKeyName("dealerlocator"):this.getDbKeyName("geolocation");for(let a=0;a!==c;a++)b[a]=this._data.db[a][d];this._data.db=JSON.parse(this._dbrestore);for(let a=0;a!==c;a++)this._data.db[a][d]=b[a]}else this._data.db=JSON.parse(this._dbrestore)},this.setDbColumns=function(){if(!1!==this._data&&this._dbcolumns&&!1!==this._dbcolumns)for(var a in this._dbcolumns)this._dbcolumns.hasOwnProperty(a)&&this.setDbColumn(this._dbcolumns[a].column,this._dbcolumns[a].data)}};self.addEventListener("message",function(a){var b;switch(a.data.cmd){case"load":self.filterWorker=new FilterWorker(a.data.config),self.filterWorker.createIndexes(),self.filterWorker.trimDbWithInclusion(),self.filterWorker.trimDbWithExclusion(),self.filterWorker.setDbColumns(),b=self.filterWorker.getItemsToHide(),self.postMessage({cmd:"hide-items",rs:b});break;case"prepare-group":if("object"==typeof a.data.groups){for(var c,d,e=[],f=0,g=a.data.groups.length;f<g;f++)c=a.data.groups[f].fid,d=a.data.groups[f].gid,self.filterWorker.isCancel(!1),e.push({id:c,rs:self.filterWorker.getItemsByGroup(c,d)});self.postMessage({cmd:"group-created",groups:e})}break;case"prepare-resulset":"undefined"==typeof self.filterWorker?self.postMessage({cmd:"resultset-created",id:a.data.config.id,fo:a.data.config.fo,initiatorId:a.data.config.initiatorId,rs:!1,nb:0}):(self.filterWorker.isCancel(!1),self.filterWorker.prepareResultSet(a.data.config).then(b=>{!0!==self.filterWorker.isCancel()&&!1!==b&&self.postMessage({cmd:"resultset-created",id:a.data.config.id,fo:a.data.config.fo,initiatorId:a.data.config.initiatorId,rs:b,nb:self.filterWorker.getLastTotalCount()})}));break;case"cancel":"undefined"!=typeof self.filterWorker&&self.filterWorker.isCancel(!0);break;case"set-db-column":"undefined"!=typeof self.filterWorker&&self.filterWorker.setDbColumn(a.data.column,a.data.data);break;default:}},!1);']));}catch(e){console.error(e);blob=false;} 225this.loadWorkerNonBlocking(cb,blob);};this.loadWorkerNonBlocking=function(cb,blob){this._fWrk=new Worker((blob!==false)?blob:'/js/usedsrp2/filters.worker.js');var self=this;this._fWrk.addEventListener('message',function(ev){switch(ev.data.cmd){case'resultset-created':self._resultset=ev.data.rs;cb(ev.data.cmd,{id:ev.data.id,fo:ev.data.fo,initiatorId:ev.data.initiatorId,nb:parseInt(ev.data.nb)});break;case'group-created':cb(ev.data.cmd,{groups:ev.data.groups});break;case'hide-items':cb(ev.data.cmd,{rs:ev.data.rs});break;default:break;}},false);let baseURI=document.baseURI;if(this._C.isDealerInspire){let stor=document.getElementById('d2cDataStore');
225if(stor){baseURI=stor?.dataset?.baseurl??baseURI;}} 226this._fWrk.postMessage({cmd:'load',config:{db:this._data,debug:this._C.debug,conf:this._C.workerConf,inclusion:this._inclusion,exclusion:this._exclusion,dbcolumns:this._dbcolumns,baseURI:baseURI}});cb('is-ready',{});};this.getComponentValues=function(id){if(this._data?.fkeys[id]&&this._data[this._data.fkeys[id]]){return this._data[this._data.fkeys[id]];} 227return[];};this.getValuesByName=function(name){if(this._data&&this._data[name]){return this._data[name];} 228return[];};this.getComponentValuesByGroup=function(grp){this._fWrk.postMessage({cmd:'prepare-group',groups:grp});};this.prepareResultSetByWorker=function(id,fo,initiatorId,ch,dealerFltIds){this._resultset=false;if(this._fWrk){this._fWrk.postMessage({cmd:'cancel'});this._fWrk.postMessage({cmd:'prepare-resulset',config:{id:id,fo:fo,initiatorId:initiatorId,ch:ch,dealerFltIds:dealerFltIds}});}else{console.error('the worker doesnt exist');}};this.getItemsFromResultSet=function(id){return this._resultset!==null&&this._resultset[id]?this._resultset[id]:false;};this.getFilterIdFromKeyName=function(v){if(this._data?.fkeys){for(let p in this._data.fkeys){if(this._data.fkeys[p]===v){return p;}}} 229return false;};this.setDbColumn=function(column,data){this._fWrk.postMessage({cmd:'set-db-column',column:column,data:data});};this.getKeyNameByFilterId=function(v){if(this._data?.fkeys[v]){return this._data.fkeys[v];} 230return false;};};var FilterObject=function(config){this._C={name:'FilterObject',debug:false,basicFilter:{},...(typeof config==='object'&&config!==null?config:{})};this.getBasicFilter=function(){return JSON.parse(JSON.stringify(this._C.basicFilter));};this.toModelObj=function(fs,geo,loc){var o=[];for(var fId in fs){if(fs.hasOwnProperty(fId)){o.push({id:fs[fId].getId(),type:fs[fId].getType(),value:fs[fId].getVals(),xand:fs[fId].getXand(),skip:false});}} 231if(typeof geo==='object'&&geo!==null){o.push({id:geo.getId(),type:geo.getDataType(),value:geo.getVals(),xand:geo.getXand(),cache:geo.getValidatedPostalCode(),skip:!geo.hasFocus()});} 232if(typeof loc==='object'&&loc!==null){o.push({id:loc.getId(),type:loc.getDataType(),value:loc.getRangeVals(),xand:loc.getXand(),cache:loc.getVals(),skip:!loc.hasFocus()});} 233return o;};this.toProxyObj=function(f,s,p,g,l){var o=this.getBasicFilter();o[s.getId()]=s.getVals();if(typeof p==='object'&&p!==null){o[p.getId()]=p.getVals();} 234if(typeof g==='object'&&g!==null){o[g.getId()]=g.hasFocus()?g.getVals():[];o[g.getInputId()]=g.hasFocus()?g.getValidatedPostalCode():'';} 235if(typeof l==='object'&&l!==null){o[l.getId()]=l.hasFocus()?l.getVals():[0,0,0];} 236for(var fId in f){if(f.hasOwnProperty(fId)){o[f[fId].getId()]=f[fId].getVals();}} 237return o;};this.toHumanObj=function(f,s,p,g,l){var o={};for(var fId in f){if(f.hasOwnProperty(fId)){o[f[fId].getId()]={type:f[fId].getType(),value:f[fId].getVals()};}} 238if(typeof s==='object'&&s!==null){o[s.getId()]={type:'SortingBox',value:s.getVals()};} 239if(typeof p==='object'&&p!==null){o[p.getId()]={type:p.getType(),value:p.getVals()};} 240if(typeof g==='object'&&g!==null){o[g.getId()]={type:g.getType(),distance:g.getVals(),value:g.getValidatedPostalCode(),focus:g.hasFocus()};} 241if(typeof l==='object'&&l!==null){o[l.getId()]={type:l.getType(),distance:l.getRangeVals(),value:l.getVals(),focus:l.hasFocus()};} 242return o;};this.validate=function(v){try{var bf=this.getBasicFilter();for(var p in bf){if(bf.hasOwnProperty(p)&&typeof v[p]!=='object'){return false;}} 243return true;}catch(ex){console.error(ex);return false;}};};var FilterProxy=function(config){this._uriparams=false;this._data=null;this._lastReqId=0;this._currenturl='';this._lasturl='';this._currentdata=false;this._waitChange=301;this._timerChange=null;this._reqResultCache=[];this._C={name:'FilterProxy',debug:false,filterRequest:null,filterObject:null,filterData:null,...(typeof config==='object'&&config!==null?config:{})};Object.assign(this,new AbstractObserver());this._filterRequest=this._C.filterRequest;this._filterData=this._C.filterData;this.doQuery=function(){this._lasturl=this._currenturl;if(this._filterRequest){var cacheKey=btoa(this._currenturl);if(typeof this._reqResultCache[cacheKey]==='object'){this._lastReqId=0;
243this.onLoadFromFilterRequest(this._lastReqId,this._reqResultCache[cacheKey].data,this._reqResultCache[cacheKey].extras,false);}else{this._lastReqId=this._filterRequest.process(this.onLoadFromFilterRequest.bind(this),this._currenturl,this._uriparams,{currenturl:this._currenturl,currentdata:this._currentdata,uriparams:this._uriparams});this.notifyObservers({cmd:'fetch',data:false});}}};this.onLoadFromFilterRequest=function(reqid,data,extras,err){if(data!==false&&data?.error){console.error(data.error);} 244if(reqid===this._lastReqId){if(err!==false){console.error(err);}else{if(data!==false&&!data?.error&&typeof extras!=='undefined'){this._filterData.rewriteUrl(data,extras);if(typeof extras.currenturl!=='undefined'){var cacheKey=btoa(extras.currenturl);if(typeof this._reqResultCache[cacheKey]!=='object'){this._reqResultCache[cacheKey]={data:data,extras:extras};}}}} 245if(data?.D2CMediaDebug&&data.D2CMediaDebug!==false){try{console.log(JSON.parse(data.D2CMediaDebug));}catch(ex){}} 246this.notifyObservers({cmd:'request',data:data,extras:extras});}else{console.warn('Rejected reqid['+reqid+'] not matching _lastId['+this._lastReqId+']');}};this.buildQuery=function(){var url=JSON.stringify(this._data);if(this._lasturl!==url){this._currenturl=url;this._currentdata=JSON.parse(url);this.doQuery();}else{this.notifyObservers({cmd:'unpreload',data:false,extras:false});console.warn('URL already sent:'+this._currenturl);}};this.preFetchContent=function(){this.notifyObservers({cmd:'preload',data:false,extras:false});};this.fetchContent=function(f){this._data=f;clearTimeout(this._timerChange);this._timerChange=setTimeout(this.buildQuery.bind(this),this._waitChange);};this.loadExtras=function(){var hf=document.getElementById(this._C.id);if(hf){try{var val=hf.value;if(val!==''){val=JSON.parse(atob(val));if(typeof val==='object'){this._uriparams=val['uriparams'];return;}}}catch(ex){console.error(ex);}} 247this._uriparams=false;};this.clearCache=function(){this._lasturl='';this._reqResultCache=[];};this.init=function(){this.loadExtras();};this.init();};let FilterRequest=function(config){this._C={id:'filterRequest',name:'FilterRequest',debug:true,infos:'data',url:'',...(typeof config==='object'&&config!==null?config:{})};this._C.url=_U.WsWidth.replacer(this._C.url);this.reqId=100;this.getTicket=function(){this.reqId++;return this.reqId;};this.process=function(cb,data,uriparams,extras){if(typeof extras==='undefined'){extras=false;} 248let str=JSON.stringify(data).replaceAll('\\"','"');let infos=encodeURIComponent(this._C.infos)+'='+encodeURIComponent(str.slice(1,str.length-1));let timestamp=Date.now();let reqId=this.getTicket();let url=this._C.url;if(!url.match(/[?]/g)){url+='?';} 249url+='&time='+timestamp+'&reqid='+reqId;if(uriparams!==false){for(let o in uriparams){if(uriparams.hasOwnProperty(o)){url+='&'+o+'='+uriparams[o];}}} 250const xhr=new XMLHttpRequest();xhr.cb=cb;xhr.parentclass=this;xhr.timestamp=timestamp;xhr.reqid=reqId;xhr.extras=extras;xhr.open('POST',url,true);xhr.setRequestHeader('cache-control','no-cache');xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8;');xhr.onreadystatechange=function(){if(xhr.readyState===4){if(xhr.status>=200&&xhr.status<300){let rtn=xhr.responseText?JSON.parse(xhr.responseText):false;xhr.cb(xhr.reqid,rtn,xhr.extras,false);}else{console.error('process.fail(pid:'+xhr.reqid+') in '+((Date.now()-xhr.timestamp)/ 1000)+' seconds');xhr.cb(xhr.reqid,false,xhr.extras,xhr.statusText);}}};xhr.send(infos);return reqId;};};var FilterData=function(config){this._C={id:'filterData',name:'FilterData',filterObject:null,uri:'',debug:true,ready:null,history:true,isDealerInspire:false,...(typeof config==='object'&&config!==null?config:{})};this._extras=false;this._userInteracted=false;this._filterObject=this._C.filterObject;this._isGeneric=false;Object.assign(this,new AbstractObserver());this.rewriteUrl=function(data,extras){try{var uri='';if(this._isGeneric===false){if(this._C.isDealerInspire){uri=this._C.uri.replace(`${this._C.id}.html`,`${data.url}.html`);}else{uri=this._C.uri+'?'+this._C.id+'='+data.url;}}else{var ndl=".html";uri=uri.substring(0,(uri.lastIndexOf(ndl)+ndl.length));uri+='?'+this._C.id+'='+data.url;} 251if(data?.h1){let h1Parsed=new DOMParser().parseFromString(data.h1,'text/html');let spanObject=h1Parsed.querySelectorAll("span.format-price");let activeLang=$('#activesitelanguage').val();let priceFr=activeLang=='ENGLISH'?'':'$';let priceEn=activeLang=='ENGLISH'?'$':'';if(spanObject.length>0){for(let s of spanObject){s.replaceWith(`${priceEn}${s.textContent}${priceFr}`);}} 252document.title=h1Parsed.body.textContent;} 253this.syncShareUrl(uri);if(this._C.history){window.history.pushState({data:data,extras:extras},document.title,uri);}else{if(typeof window.parent!=='undefined'){window.parent.history.replaceState({data:data,extras:extras},document.title,uri);}else{window.history.replaceState({data:data,extras:extras},document.title,uri);}}}catch(ex){console.error(ex);}};this.syncShareUrl=function(uri){if(this._userInteracted!==true){return;} 254if(typeof uri!=='string'||uri===''){return;} 255try{var absUrl=new URL(uri,window.location.origin).href;var canonical=document.querySelector('link[data-canonical-header-widget="1"]');if(canonical){canonical.setAttribute('href',absUrl);} 256var ogUrl=document.querySelector('meta[property="og:url"]');
256if(ogUrl){ogUrl.setAttribute('content',absUrl);}}catch(ex){console.error(ex);}};this.getFilterObject=function(){if(this._filterObject){return this._filterObject;} 257return false;};this.getDataByKey=function(k){return(typeof this._data[k]==='object'||typeof this._data[k]==='string')?this._data[k]:null;};this.getFiltersData=function(){if(this._filterObject){try{if(this._extras?.basic&&this._filterObject.validate(this._extras.basic)){return this._extras.basic;}}catch(ex){console.error(ex);}} 258return this._filterObject.getBasicFilter();};this.loadExtras=function(){var hf=document.getElementById(this._C.id);if(hf){try{var val=hf.value;if(val!==''){val=JSON.parse(atob(val));if(typeof val==='object'){this._extras=val;this._isGeneric=val['isgeneric'];return;}}}catch(ex){console.error(ex);}} 259this._isGeneric=false;};this.onHistoryPopState=function(state){if(!state?.extras?.currentdata){console.error('the state.extras.currentdata is not an object');return;} 260if(!this._filterObject.validate(state.extras.currentdata)){console.error('the state.extras.currentdata object is not valid');return;} 261this._data=state.extras.currentdata;this.notifyObservers(state);};this.init=function(){if(typeof this._C.ready!=='function'){console.error('Need a ready callback function to be able to start');return;} 262this.loadExtras();this._data=this.getFiltersData();var self=this;var interactionTypes=['pointerdown','keydown','change'];var markInteracted=function(ev){if(ev?.isTrusted!==true){return;} 263self._userInteracted=true;for(var i=0;i!==interactionTypes.length;i++){document.removeEventListener(interactionTypes[i],markInteracted,true);}};for(var t=0;t!==interactionTypes.length;t++){document.addEventListener(interactionTypes[t],markInteracted,true);} 264window.addEventListener('popstate',function(){self.onHistoryPopState(window.history.state);});this._C.ready.call(this);};this.init();};var FilterController=function(config){this._C={name:'FilterController',debug:false,el:'',utext:{clearmsg:'clear',clearallmsg:'clear all',resultsmsg:'Results',resultmsg:'Result'},baseuri:false,forDealerDb:[],oemEvent:{etype:'filters:change',ltype:'filters:load',id:'filterState',ids:[],field:'#oemCertification'},filters:[],sortcomponent:null,pagecomponent:null,geocomponent:null,locatorcomponent:null,skeletons:[],parentContainer:'divSpanFilters'};if(typeof config==='object'){Object.assign(this._C,config);} 265Object.assign(this,new AbstractObserver());this._loaded=false;this._ready=false;this._onReadyEventSent=false;this._filterData=(typeof this._C.filterData==='object')?this._C.filterData:null;this._filterObject=(this._filterData!==null)?this._filterData.getFilterObject():null;this._filterProxy=(typeof this._C.filterProxy==='object')?this._C.filterProxy:null;this._filterModel=(typeof this._C.filterModel==='object')?this._C.filterModel:null;this._sortcomponent=this._C.sortcomponent;this._pagecomponent=this._C.pagecomponent;this._geocomponent=this._C.geocomponent;this._locatorcomponent=this._C.locatorcomponent;this._filtersIndex={};this._filtersRef={};this._filterCallStack=[];this._timerFilterChange=null;this._waitFilterChange=50;this._timerSyncBar=null;this._timerShowCount=null;this._isUnrelatedContentRemoved=false;this._lastTotalCount=0;this._isMobile=false;this.skeleton=function(){if(this._C?.skeletons?.length>0){for(var i=0,len=this._C.skeletons.length;i!==len;i++){const elements=document.querySelectorAll(this._C.skeletons[i]);elements.forEach(el=>el.classList.remove('loading'));}}};this.idExist=function(id){if(document.getElementById(id)){return true;} 266console.error(`Element:"#${id}" does not exist!!!`);return false;};this.addSort=function(){if(this._sortcomponent!==null){if(!this.idExist(this._sortcomponent.getId())){console.warn(`${this._sortcomponent.getId()} dont exist, replacing component with a MockBox.`);this._sortcomponent=new MockBox(this._sortcomponent.getConfig());} 267this._sortcomponent.addObserver(this.onFilterChange.bind(this));this._sortcomponent.addCallStack(this.pushFilterStack.bind(this));this._sortcomponent.setUri(this._C.baseuri);}};this.addPagination=function(){if(this._pagecomponent!==null){if(!this.idExist(this._pagecomponent.getId())){console.warn(`${this._pagecomponent.getId()} dont exist, replacing component with a MockBox.`);this._pagecomponent=new MockBox(this._pagecomponent.getConfig());} 268this._pagecomponent.addObserver(this.onFilterChange.bind(this));this._pagecomponent.addCallStack(this.pushFilterStack.bind(this));}};this.addGeoLocation=function(){if(this._geocomponent!==null){if(!this.idExist(this._geocomponent.getId())){console.warn(`nullished filter "${this._geocomponent.getId()}"`);this._geocomponent=null;return;} 269this._geocomponent.addObserver(this.onFilterChange.bind(this));this._geocomponent.addCallStack(this.pushFilterStack.bind(this));if(this._locatorcomponent!==null){this._locatorcomponent.addShared(this._geocomponent);}}};this.addDealerLocator=function(){if(this._locatorcomponent!==null){if(!this.idExist(this._locatorcomponent.getId())){console.warn(`nullished filter "${this._locatorcomponent.getId()}"`);this._locatorcomponent=null;return;} 270this._locatorcomponent.addObserver(this.onFilterChange.bind(this));this._locatorcomponent.addCallStack(this.pushFilterStack.bind(this));if(this._geocomponent!==null){this._geocomponent.addShared(this._locatorcomponent);}}};this.onFilterChange=function(id){if(this.isLoaded()){if(id===this._sortcomponent.getId()||id===this._pagecomponent.getId()){if(id===this._sortcomponent.getId()){this._pagecomponent.gotoFirstPage();if(this._isMobile){this.setActiveAndShowCount(false);}} 271if(this.isReady()){this._filterProxy.fetchContent(this._filterObject.toProxyObj(this._filtersIndex,this._sortcomponent,this._pagecomponent,this._geocomponent,this._locatorcomponent));}}else{this._filterProxy.preFetchContent();clearTimeout(this._timerFilterChange);this._timerFilterChange=setTimeout(this.applyChanges.bind(this,id,this.pushFilterStack()),this._waitFilterChange);}}};this.removeUnrelatedContent=function(){const usedCarsRefContent=document.getElementById('usedCarsRefContent');if(usedCarsRefContent){usedCarsRefContent.remove();} 272const refContentDemo=document.querySelectorAll('.refferenceContentDemo');refContentDemo.forEach(el=>el.remove());const refContentClearance=document.querySelectorAll('.refferenceContentClearance');refContentClearance.forEach(el=>el.remove());this._isUnrelatedContentRemoved=true;};
272this.applyChanges=function(id,initiatorId){if(this.isReady()){if(!this._isUnrelatedContentRemoved){this.removeUnrelatedContent();} 273this._pagecomponent.reset();this._filterProxy.fetchContent(this._filterObject.toProxyObj(this._filtersIndex,this._sortcomponent,this._pagecomponent,this._geocomponent,this._locatorcomponent));} 274this._filterModel.prepareResultSetByWorker(id,this._filterObject.toModelObj(this._filtersIndex,this._geocomponent,this._locatorcomponent),initiatorId,(this._geocomponent!==null?this._geocomponent.getValidatedPostalCode():''),this._C.forDealerDb);};this.setActiveAndShowCount=(b)=>{clearTimeout(this._timerShowCount);this._timerShowCount=setTimeout(()=>{if(b){const s=this._lastTotalCount+' '+ 275(this._lastTotalCount>1?this._C.utext.resultsmsg:this._C.utext.resultmsg);const filterBtnsCount=document.querySelector('body .filterBtns span.sp-rslt-count');if(filterBtnsCount){filterBtnsCount.innerHTML=s;} 276const fltHeadCount=document.querySelector('body .fltHead span.sp-rslt-count');if(fltHeadCount){fltHeadCount.innerHTML=`<span>${s}</span><i class="fa fa-chevron-circle-right"></i>`;}} 277window.scrollTo(0,0);},100);};this.onWorkerMessage=function(cmd,args){switch(cmd){case'resultset-created':this._lastTotalCount=args.nb;this._pagecomponent.setPaging(args.nb);for(var fId in this._filtersIndex){if(this._filtersIndex.hasOwnProperty(fId)){this._filtersIndex[fId].doUpdate(args.id,args.initiatorId);}} 278if(this._geocomponent!==null){this._geocomponent.doUpdate(args.id,args.initiatorId);} 279if(this._locatorcomponent!==null){this._locatorcomponent.doUpdate(args.id,args.initiatorId)} 280setTimeout(this.checkClearState.bind(this));this.onReadyEvent();if(!this._isMobile){this.showGotoResultButton(true);}else{this.setActiveAndShowCount(true);} 281break;case'group-created':if(typeof args.groups==='object'){for(var i=0,len=args.groups.length;i<len;i++){if(this._filtersIndex.hasOwnProperty(args.groups[i].id)){this._filtersIndex[args.groups[i].id].setGroupValues(args.groups[i].rs);}}} 282break;case'hide-items':this.hideComponentsItems(args.rs);break;case'is-ready':this.loadComponentValues();break;default:break;}};this.hideComponentsItems=function(rs){if(rs!==false){for(var fId in rs){if(rs.hasOwnProperty(fId)&&this._filtersIndex.hasOwnProperty(fId)){this._filtersIndex[fId].hideItems(rs[fId]);}}} 283setTimeout(this.isReady.bind(this,true),this._waitFilterChange+1);};this.pushFilterStack=function(v){if(typeof v!=='undefined'){if(this._filterCallStack.length>=10){this._filterCallStack=this._filterCallStack.slice(1,10);} 284this._filterCallStack.push(v);}else{if(this._filterCallStack.length>0){return this._filterCallStack[this._filterCallStack.length-1];} 285return false;}};this.addClear=function(id,f){if(f.clear){var el=document.querySelector(`#${id} span.sp-clear`);if(el){el.setAttribute('component-refid',id);el.innerHTML=this._C.utext.clearmsg;}}};this.addFilters=function(){var fId,i=0;var removeIds=[];for(i=0,len=this._C.filters.length;i!==len;i++){var c=this._C.filters[i].component;fId=c.getId();if(!this.idExist(fId)){removeIds.push({pos:i,id:fId});}else{if(c.getVisibility()===false){document.getElementById(fId).classList.add('hide');} 286this._filtersIndex[fId]=c;this._filtersRef[fId]=this._C.filters[i];c.addObserver(this.onFilterChange.bind(this));c.addCallStack(this.pushFilterStack.bind(this));c.setUri(this._C.baseuri);}} 287if(removeIds.length){for(i=0,len=removeIds.length;i!==len;i++){console.warn(`removing filter "${removeIds[i].id}"`) 288delete this._C.filters[removeIds[i].pos];}} 289for(fId in this._filtersIndex){if(this._filtersIndex.hasOwnProperty(fId)){this.addObservables(this._filtersIndex[fId]);}}};this.addObservables=function(c){var obs=c.getObservables();if(obs!==false){var ks=_U.Objects.keys(obs);for(var i=0,len=ks.length;i!==len;i++){if(this._filtersIndex.hasOwnProperty(obs[ks[i]])){this._filtersIndex[obs[ks[i]]].addObserver(c.updated.bind(c));}}}};this.checkClearState=function(){var active=false;if((this._geocomponent!==null&&this._geocomponent.isActive())||(this._locatorcomponent!==null&&this._locatorcomponent.isActive())){active=true;}else{for(var fId in this._filtersIndex){if(this._filtersIndex.hasOwnProperty(fId)&&this._filtersIndex[fId].isActive()){active=true;break;}}} 290if(this._isMobile){const clearAllBtn=document.querySelector(`${this._C.el} div.fltHead .sp-clear-all`);if(clearAllBtn){if(active){if(!clearAllBtn.classList.contains('active')){clearAllBtn.classList.add('active');}}else{if(clearAllBtn.classList.contains('active')){clearAllBtn.classList.remove('active');}}}} 291if(!this._isMobile){clearTimeout(this._timerSyncBar);this._timerSyncBar=setTimeout(this.syncFilterBar.bind(this,active),this._waitFilterChange);}};this.syncFilterBar=function(active){const fBarChp=document.querySelector('.fltBar');if(fBarChp){fBarChp.classList.remove('loading');const ul=fBarChp.querySelector('UL');if(ul){let el=ul.querySelector('LI.actionClearAll');if(active){if(!el){const li=document.createElement('li');li.className='standalone chips clearall actionClearAll';li.innerHTML=`<button><span class="divSpan s-name">${this._C.utext.clearallmsg}</span></button>`;ul.appendChild(li);li.addEventListener('click',this.resetAll.bind(this));}}else{if(el){el.removeEventListener('click',this.resetAll.bind(this));el.remove();}} 292if(this._geocomponent!==null){this._geocomponent.syncChipsFromFilterBar();} 293if(this._locatorcomponent!==null){this._locatorcomponent.syncChipsFromFilterBar();} 294for(var fId in this._filtersIndex){if(this._filtersIndex.hasOwnProperty(fId)){this._filtersIndex[fId].syncChipsFromFilterBar();}}}}};this.resetAll=function(ev){for(var fId in this._filtersIndex){if(this._filtersIndex.hasOwnProperty(fId)&&this._filtersIndex[fId].getVisibility()===true){this._filtersIndex[fId].reset();}} 295if(this._geocomponent!==null){this._geocomponent.reset(ev);} 296if(this._locatorcomponent!==null){this._locatorcomponent.reset(ev);} 297this.checkClearState();};this.resetOnes=function(ev){const fId=ev.target.getAttribute('component-refid');if(fId===(this._geocomponent!==null?this._geocomponent.getId():0)){this._geocomponent.reset(ev);}else if(fId===(this._locatorcomponent!==null?this._locatorcomponent.getId():0)){this._locatorcomponent.reset(ev);}else{if(this._filtersIndex.hasOwnProperty(fId)){this._filtersIndex[fId].reset(ev);var fInIds=this._filtersIndex[fId].getInnerComponentIds();if(fInIds!==false){for(var id in fInIds){if(fInIds.hasOwnProperty(id)){try{this._filtersIndex[fInIds[id]].reset();}catch(ex){console.warn(`The '${fInIds[id]}' component doesnt have the reset method registered`);}}}}}} 298this.checkClearState();};this.initActions=function(){const fltCols=document.querySelector(`${this._C.el} div.fltCols`);
298if(fltCols){fltCols.addEventListener('click',(e)=>{if(e.target.matches('span.sp-clear')){this.resetOnes(e);}});} 299if(!this._isMobile){this.showGotoResultButton=function(args){const el=document.querySelector(this._C.el);if(!el)return;const el2=el.querySelector('div.fltToResult');const el3=el2?el2.querySelector('span.num'):null;const el4=document.getElementById(this._pagecomponent.getId());if(el&&el2&&el3&&el4){const t0=window.pageYOffset||document.documentElement.scrollTop;const rect=el.getBoundingClientRect();const t1=rect.top;const t2=rect.bottom-(window.innerHeight/2);if(t1<=120&&t2>0){const pos=rect.left-el2.offsetWidth-15;if(pos>10){el3.textContent=this._lastTotalCount;if(this._lastTotalCount<=0){el3.classList.add('noresult');}else{el3.classList.remove('noresult');} 300el2.style.left=pos+'px';el2.classList.remove('disabled');}else{el2.classList.add('disabled');}}else{const rect4=el4.getBoundingClientRect();const t4=rect.bottom;const t5=rect4.bottom-window.innerHeight;if(t4-300<0&&0<t5+300){el3.textContent=this._lastTotalCount;if(this._lastTotalCount<=0){el3.classList.add('noresult');}else{el3.classList.remove('noresult');} 301el2.style.left=`calc(${rect.left}px + ${el.offsetWidth/2}px - ${el2.offsetWidth/2}px)`;el2.classList.remove('disabled');}else{el2.classList.add('disabled');}}}};this.gotoTopFilters=function(){const el=document.querySelector('.elPageTitle');if(el){window.scrollTo({top:el.getBoundingClientRect().top+window.pageYOffset,behavior:'smooth'});}};window.addEventListener('resize',(e)=>this.showGotoResultButton(e));document.addEventListener('scroll',(e)=>this.showGotoResultButton(e));const fltToResult=document.querySelector(`${this._C.el} div.fltToResult`);if(fltToResult){fltToResult.addEventListener('click',(e)=>{if(e.target.closest('div.divAction')){this.gotoTopFilters();}});}}else{const fltHead=document.querySelector(`${this._C.el} div.fltHead`);if(fltHead){fltHead.addEventListener('click',(e)=>{if(e.target.matches('.sp-clear-all')){this.resetAll(e);}});} 302this.openFilters=function(){const el=document.querySelector(`.${this._C.parentContainer}`);if(el){const isOpening=el.classList.contains('--is-hidden');el.classList.toggle('--is-hidden');document.body.classList.toggle('filters-open',isOpening);}};document.body.addEventListener('click',(e)=>{if(e.target.closest('.sp-filters-opener')){this.openFilters();}});}};this.initFilters=function(){if(!this._sortcomponent.isMocked()){this._sortcomponent.setHookOnMethods();} 303if(!this._pagecomponent.isMocked()){this._pagecomponent.setHookOnMethods();} 304if(this._geocomponent!==null&&!this._geocomponent.isMocked()){this.addClear(this._geocomponent.getId(),this._geocomponent);this._geocomponent.setHookOnMethods();} 305if(this._locatorcomponent!==null&&!this._locatorcomponent.isMocked()){this.addClear(this._locatorcomponent.getId(),this._locatorcomponent);this._locatorcomponent.setHookOnMethods();} 306var fId;for(fId in this._filtersIndex){if(this._filtersIndex.hasOwnProperty(fId)){if(!this._filtersIndex[fId].isMocked()){this.addClear(fId,this._filtersRef[fId]);this._filtersIndex[fId].setHookOnMethods();}}} 307this._sortcomponent.init();this._pagecomponent.init();if(this._geocomponent!==null){this._geocomponent.init();} 308if(this._locatorcomponent!==null){this._locatorcomponent.init();} 309for(fId in this._filtersIndex){if(this._filtersIndex.hasOwnProperty(fId)){this._filtersIndex[fId].init();}}};this.onReady=function(){if(!this.isReady){return;} 310for(var fId in this._filtersIndex){if(this._filtersIndex.hasOwnProperty(fId)){this._filtersIndex[fId].onFcReady();}} 311this._sortcomponent.onFcReady();this._pagecomponent.onFcReady();if(this._geocomponent!==null){this._geocomponent.onFcReady();} 312if(this._locatorcomponent!==null){this._locatorcomponent.onFcReady();} 313this.applySeededGeoFocus();this.notifyObservers({cmd:'ready'});setTimeout(this.checkClearState.bind(this));setTimeout(this.skeleton.bind(this));};this.applySeededGeoFocus=function(){if(this._geocomponent===null&&this._locatorcomponent===null){return;} 314var seeded=this._filterModel.getSeededGeoColumn(),changed=false;window.gUsedSrpAppz.isUsedLocatorConstrainingResults=(seeded==='dealerlocator');window.gUsedSrpAppz._contentController?.applyNearbyCityBadges();if(this._geocomponent!==null&&this._geocomponent.hasFocus()!==(seeded==='geolocation')){this._geocomponent.setContainerFocus(seeded==='geolocation');changed=true;} 315if(this._locatorcomponent!==null&&this._locatorcomponent.hasFocus()!==(seeded==='dealerlocator')){this._locatorcomponent.setContainerFocus(seeded==='dealerlocator');changed=true;} 316if(changed){if(this._geocomponent!==null){_U.Cookies.push(this._geocomponent.getId(),{v:this._geocomponent.getValidatedPostalCode(),f:this._geocomponent.hasFocus(),d:this._geocomponent.getVals()});} 317if(this._locatorcomponent!==null){_U.Cookies.push(this._locatorcomponent.getId(),{v:this._locatorcomponent.getVals(),f:this._locatorcomponent.hasFocus()});}} 318if(!changed||seeded===null){return;} 319if(seeded==='dealerlocator'){this._locatorcomponent.delayedObsNotif();return;} 320this._geocomponent.notifyObservers(this._geocomponent.getVals(),[0,0]);};this.restoreFilters=function(){for(var fId in this._filtersIndex){if(this._filtersIndex.hasOwnProperty(fId)){this._filtersIndex[fId].restore(
320);}} 321this._sortcomponent.restore();this._pagecomponent.restore();if(this._geocomponent!==null){this._geocomponent.restore();} 322if(this._locatorcomponent!==null){this._locatorcomponent.restore();}};this.render=function(){this.initFilters();this.initActions();this.isLoaded(true);this.restoreFilters();};this.isReady=function(v){if(typeof v!=='undefined'){this._ready=v;this.onReady();} 323return this._ready;};this.isLoaded=function(v){if(typeof v!=='undefined'){this._loaded=v;} 324return this._loaded;};this.onDataLoaded=function(){this._filterModel.loadWorker(this.onWorkerMessage.bind(this));};this.loadComponentValues=function(){var batchGroup=[];for(var o in this._filtersIndex){if(this._filtersIndex.hasOwnProperty(o)){var comp=this._filtersIndex[o];if(comp.getGroup()!==false){batchGroup.push({fid:o,gid:comp.getGroup()});}else{comp.setValues(this._filterModel.getComponentValues(o));} 325comp.setDataModel(this._filterModel);}} 326this._sortcomponent.setValues(this._filterModel.getComponentValues(this._sortcomponent.getId()));if(this._geocomponent!==null){this._geocomponent.setValues(this._filterModel.getComponentValues(this._geocomponent.getSelectorId()));this._geocomponent.setDataModel(this._filterModel);} 327if(this._locatorcomponent!==null){this._locatorcomponent.setDataModel(this._filterModel);} 328if(batchGroup.length){this._filterModel.getComponentValuesByGroup(batchGroup);} 329this.render();};this.onFilterDataChange=function(id,state){var data=state?.extras?.currentdata;this.isReady(false);for(var fid in data){if(data.hasOwnProperty(fid)){try{if(this._sortcomponent.getId()===fid){this._sortcomponent.changeSelectedState(data[fid]);}else if(this._pagecomponent.getId()===fid){this._pagecomponent.changeSelectedState(data[fid]);}else if((this._geocomponent!==null?this._geocomponent.getId():0)===fid){this._geocomponent.changeSelectedState(data[fid]);}else if((this._locatorcomponent!==null?this._locatorcomponent.getId():0)===fid){this._locatorcomponent.changeSelectedState(data[fid]);}else{if(this._filtersIndex.hasOwnProperty(fid)){this._filtersIndex[fid].changeSelectedState(data[fid]);}}}catch(ex){console.error(ex);}}} 330setTimeout(this.isReady.bind(this,true),this._waitFilterChange+1);};this.onLoadFromFilterProxy=function(id,args){if(args?.cmd==='request'&&args?.data?.filterState){if(args.data.filterState?.genericTrigger){this.genericTrigger(args.data.filterState.genericTrigger);} 331const oemField=document.querySelector(`#${this._C.oemEvent.field}`);if(!oemField||this._C.oemEvent.ids.indexOf(parseInt(oemField.value))===-1){return;} 332var data=JSON.parse(JSON.stringify(args.data.filterState));data.countSearchResults=parseInt(this._lastTotalCount);var o={type:this._C.oemEvent.etype,filterData:data};setTimeout(function(){const event=new CustomEvent(o.type,{detail:o});document.body.dispatchEvent(event);});}};this.genericTrigger=(obj)=>{setTimeout(()=>{const event=new CustomEvent('usedSrpFilters:genericTrigger',{detail:{genericTrigger:JSON.parse(JSON.stringify(obj))}});document.body.dispatchEvent(event);},500);};this.onReadyEvent=function(){if(this._onReadyEventSent){return;} 333this._onReadyEventSent=true;var data=null,ddata=document.getElementById(this._C.oemEvent.id)?.value;if(ddata!=='undefined'&&ddata!==undefined){try{data=JSON.parse(atob(ddata));}catch(err){console.error(err);}} 334if(data?.genericTrigger){this.genericTrigger(data.genericTrigger);} 335const oemField=document.querySelector(`#${this._C.oemEvent.field}`);if(!oemField||this._C.oemEvent.ids.indexOf(parseInt(oemField.value))===-1){return;} 336if(data?.filterSearch){try{data.countSearchResults=parseInt(this._lastTotalCount);var o={type:this._C.oemEvent.ltype,filterData:data};setTimeout(function(){for(var i=0;i<3;i++){setTimeout(function(){const event=new CustomEvent(o.type,{detail:o});if(!document.body.dataset[o.type]){document.body.dispatchEvent(event);}},i*3000);}});}catch(err){console.error(err);}}};this.init=function(){if(this._filterProxy===null){console.error('"_filterProxy" is not an object');return;} 337if(this._filterData===null){console.error('"_filterData" is not an object');return;} 338if(this._filterObject===null){console.error('"_filterObject" is not an object');return;} 339if(this._filterModel===null){console.error('"_filterModel" is not an object');return;} 340if(this._filterModel.loadData()===false){console.error('"_filterModel._data" is not val
340id');return;} 341this._isMobile=document.body.classList.contains('UsedSrp2Mobile');this._filterProxy.addObserver(this.onLoadFromFilterProxy.bind(this));this._filterData.addObserver(this.onFilterDataChange.bind(this));this.addFilters();this.addSort();this.addPagination();this.addGeoLocation();this.addDealerLocator();this.onDataLoaded();if(!this._isMobile){setTimeout(()=>this.showGotoResultButton(),3000);}};this.getCurrentFiltersValues=function(){var fId,filters=[];for(fId in this._filtersIndex){if(this._filtersIndex.hasOwnProperty(fId)){filters.push({fid:fId,values:this._filtersIndex[fId].getVals()});}} 342return(!filters.length)?false:filters;};};const ContentController=function(config){this._C={name:'ContentController',debug:false,el:'',elseoboxes:'',elbottomdisclaimer:'',carfaxurl:'',utext:{loadingmsg:'Please wait while loading!...',resetmsg:'Click to clear your filter settings',errormsg:'Sorry! A generic error has occured',showmemoremsg:'Show me more...',showmelessmsg:'Show me less...'},filterProxy:null,filterData:null,filterController:null,filterLeads:null,triggers:null,imageSlider:null,...(typeof config==='object'&&config!==null?config:{})};this._C.carfaxurl=_U.WsWidth.replacer(this._C.carfaxurl);Object.assign(this,new AbstractObserver());this._name=this._C.name;this._showloading=false;this._containerClone=null;this._ready=false;this._lastSize=(window.innerWidth>1300)?1300:960;this._container=this._C.el;this._compareVh={enabled:document.getElementById('compareVehicles')?.value==='1',ids:[],lastKey:0};this._filterData=(typeof this._C.filterData==='object')?this._C.filterData:null;this._filterProxy=(typeof this._C.filterProxy==='object')?this._C.filterProxy:null;this._filterController=(typeof this._C.filterController==='object')?this._C.filterController:null;this._filterLeads=(typeof this._C.filterLeads==='object')?this._C.filterLeads:null;this._canReplaceHiddenValues=true;this._extras=false;this._isFullDisplay=false;this.onSeoShowMeMoreClick=function(ev){var el=ev.target.closest('LI');if(el){var ul=el.closest('UL');if(ul){if(ul.getAttribute('showhidden')==='0'){ul.setAttribute('showhidden','1');ul.querySelectorAll('LI.hideMe').forEach(li=>li.classList.add('showMe'));el.querySelector('.s-more').innerHTML=this._C.utext.showmelessmsg;el.querySelector('.s-more').classList.add('isActive');}else{ul.setAttribute('showhidden','0');ul.querySelectorAll('LI.hideMe').forEach(li=>li.classList.remove('showMe'));el.querySelector('.s-more').innerHTML=this._C.utext.showmemoremsg;el.classList.remove('isActive');}}}};this.resetAllFilters=function(){this._filterController.resetAll(null);};this.initActions=function(){document.querySelector(this._container).addEventListener('click',function(e){if(e.target.closest('div.divRsltReset BUTTON')){this.resetAllFilters();}}.bind(this));const el=document.querySelector(this._C?.elseoboxes);if(el){el.addEventListener('click',function(e){if(e.target.closest('LI.elShowMeMore')){this.onSeoShowMeMoreClick(e);}}.bind(this));}};this.adjustCarBoxHeight=function(load,clone){var step=(window.innerWidth>1300&&document.querySelector('BODY.isFullWidthPage')&&document.querySelector('BODY.isPageFullWidthEnabled'))?this._isFullDisplay?4:3:this._isFullDisplay?3:2;if(clone){const children=Array.from(document.querySelector(this._container).children);children.forEach(child=>{this._containerClone.appendChild(child.cloneNode(true));});} 343var items=[];var self=this;this._containerClone.style.width=document.querySelector(this._container).offsetWidth+'px';const carBoxes=this._containerClone.querySelectorAll('div.carBoxOuter');carBoxes.forEach((box,ind)=>{items.push(box);if((ind+1)%step===0){self.setBoxHeight(items);items=[];}});if(items.length>0){this.setBoxHeight(items);} 344this.appendCloneToContainer();};this.appendCloneToContainer=function(){this._containerClone.querySelectorAll('div.carBoxOuter')?.forEach(box=>{box.classList.add('elIsLoaded');box.classList.remove('elIsGreyed','elIsLoading');});let update=false;this._showloading=false;const container=document.querySelector(this._container);if(container){container.style.height=this._containerClone.offsetHeight+'px';while(container.firstChild){container.removeChild(container.firstChild);} 345Array.from(this._containerClone.children)?.forEach(cloneChild=>{container.appendChild(cloneChild.cloneNode(true));});container.style.height='';while(this._containerClone.firstChild){this._containerClone.removeChild(this._containerClone.firstChild);} 346update=true;} 347this.afterAppendCloneToContainer(update);};this.callConfigTriggers=function(){if(Array.isArray(this._C?.triggers?.onchange)){let intervalRLLoaded=setInterval(()=>{if(window.gResourceLoaderAndJqueryIsReady){clearInterval(intervalRLLoaded);const details={detail:{selector:this._C.el}} 348this._C.triggers.onchange.forEach((name)=>{document.dispatchEvent(new CustomEvent(name,details));});return;}},200);}};this.afterAppendCloneToContainer=function(update){if(update){if(typeof bannerHandler!=='undefined'&&typeof bannerHandler.reset==='function'){bannerHandler.reset();} 349this.applyNearbyCityBadges();} 350setTimeout(this.injectCarFaxScript.bind(this));setTimeout(this.reInitAutofi.bind(this));setTimeout(this.initCardSliders.bind(this));this.callConfigTriggers();this.notifyObservers({cmd:'buffered'});};this.initCardSliders=function(){this._C?.imageSlider?.refresh();};this.createContainerClone=function(){const cloneDiv=document.createElement('div');cloneDiv.id='listingContainerClone';cloneDiv.className='lstListingWrapperClone';cloneDiv.style.position='absolute';cloneDiv.style.top='0';
350cloneDiv.style.left='0';cloneDiv.style.width='0';cloneDiv.style.height='0';cloneDiv.style.overflow='hidden';const innerDiv=document.createElement('div');innerDiv.className='divSpan divSpan12';cloneDiv.appendChild(innerDiv);document.body.appendChild(cloneDiv);this._containerClone=document.querySelector('#listingContainerClone > div');this.adjustCarBoxHeight(true,true);};this.forMobileRoutine=function(){setTimeout(this.injectCarFaxScript.bind(this));setTimeout(this.reInitAutofi.bind(this));setTimeout(this.initCardSliders.bind(this));this.setInnerBoxVisibility(false);this.callConfigTriggers();this.notifyObservers({cmd:'buffered'});};this.setBoxHeight=function(items){var maxCbH=0;var maxLinkH=0;var clinkAdjustH=[];var len=items.length;for(var i=0;i!==len;i++){let carBasics=items[i].querySelector('.carBasics');if(!carBasics){continue;} 351carBasics.style.height='';const cbh=carBasics.offsetHeight;const clink=items[i].querySelector('.carLinks');if(clink){const clinkH=clink.offsetHeight;if(clinkH>maxLinkH){maxLinkH=clinkH;} 352clinkAdjustH[i]=false;}else{clinkAdjustH[i]=true;} 353if(cbh>maxCbH){maxCbH=cbh;}} 354for(i=0;i!==len;i++){let carBasics=items[i].querySelector('.carBasics');if(!carBasics){continue;} 355carBasics.style.height=maxCbH+'px';const cimg=items[i].querySelector('.carImage');cimg.style.marginBottom='0';if(clinkAdjustH[i]===true){cimg.style.marginBottom=maxLinkH+'px';}}};this.onLoadFromFilterProxy=function(id,args){if(!args?.cmd){return;} 356switch(args.cmd){case'request':case'reload':if(args?.data?.html!==undefined){if(args?.data?.url?.length){this.getVehicleIdsForCompare(args.data.url,args.data.html);} 357this.setContent(args.data.html);}else{this.showGenericErrorMsg();} 358let txt=args?.data?.h1;if(document.getElementById('oemCertification')?.value==='21'){txt=txt.replace(/\bused\b/gi,'Pre-Owned');} 359if(args?.data?.h1!==undefined&&args.data.h1!==''){if(document.getElementById('isDRSite')?.value==1&&args?.data?.filterState?.filterSearch?.status!=undefined){let showOnlyFilter=args?.data?.filterState?.filterSearch?.status;let superScript16LinkHTML='<a href="javascript:void(0)" class="disclaimersSuperscripts " data-disclaimer-divid="disclaimers-superscripts-16-div" data-disclaimer-id="16"><sup data-disclaimer-divid="disclaimers-superscripts-16-div">16</sup></a>';txt+=showOnlyFilter.includes("certified")?superScript16LinkHTML:'';} 360this.setTagH1(txt);this.setBreadcrumbChild(txt);} 361if(args?.data?.seolinkboxes!==undefined&&args.data.seolinkboxes!==''){this.setSeoLinkBoxes(args.data.seolinkboxes);} 362if(args?.data?.bottomDisclaimer!==undefined){this.setBottomDisclaimer(args.data.bottomDisclaimer);} 363if(args?.data?.banner!==undefined){this.setBanner(args.data.banner);} 364this.setHiddenValues(args.data);break;case'fetch':case'preload':this.setInnerBoxVisibility(true);break;case'unpreload':this.setInnerBoxVisibility(false);break;default:break;}};this.getCarfaxBadges=function(obj){var vins=Object.keys(obj);if(!vins.length){return false;} 365fetch(this._C.carfaxurl,{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded','cache-control':'no-cache'},body:'vins='+vins.toString()}).then(response=>response.json()).then(rtn=>{if(rtn===null){rtn=false;} 366this.setCarfaxBadges(obj,rtn);}).catch(()=>{this.setCarfaxBadges(obj,false);});};this.setCarfaxBadges=function(obj,data){if(data===false){console.error(`${this._C.name}.setCarfaxBadges data error`);return false;} 367if(data?.errors!==undefined){console.error(`${this._C.name}.setCarfaxBadges Errors :${data.errors.toString()}`);return false;} 368var showReport=document.getElementById('carFaxShowReport')?.value==='1';for(var o in data){if(data.hasOwnProperty(o)){var el=document.querySelector(`${this._container} .carproof-badge[data-vin="${o}"]`);if(el&&data[o]?.url!==undefined&&data[o]?.img!==undefined){let url=showReport?{url:data[o].url}:{url:''};let b64=obj?.[o]?btoa(JSON.stringify({...obj[o],...url})):null;const cfDiv=document.createElement('div');const cfA=document.createElement('a');const cfImg=document.createElement('img');cfA.className='srpCarfaxBadgeLink';cfA.dataset.carfaxb64=b64;cfA.title='Carfax';cfA.target='_blank';cfA.href=data[o].url;cfA.onclick=function(e){if(document.getElementById('carFaxFormHack')?.value!=='1'){e.stopPropagation();}} 369cfImg.src=data[o].img;cfImg.className='srpCarfaxBadge';cfImg.title='Carfax';cfImg.alt='Carfax';cfA.append(cfImg);cfDiv.append(cfA);el.append(cfDiv);}}} 370const srpCarfaxBadgesWrapper=document.querySelector('.lstListingWrapper');if(srpCarfaxBadgesWrapper){srpCarfaxBadgesWrapper.removeEventListener('click',this.handleCarFaxBadgeClick);srpCarfaxBadgesWrapper.addEventListener('click',this.handleCarFaxBadgeClick);}};this.handleCarFaxBadgeClick=function(e){if(e.target.classList.contains('srpCarfaxBadge')){let frmhk=(document.getElementById('carFaxFormHack')?.value==='1'&&typeof carproofHandler!=='undefined');let carfaxLink=e.target.closest('.srpCarfaxBadgeLink');let carfaxBadgeb64=carfaxLink.dataset.carfaxb64;if(frmhk&&undefined!=carfaxBadgeb64&&'null'!=carfaxBadgeb64&&''!=carfaxBadgeb64){e.preventDefault();let dset=JSON.parse(atob(carfaxBadgeb64));try{carproofHandler.show(dset.make,dset.model,dset.year,dset.color,dset.sn,dset.url,dset.sendto,dset.dealername,dset.sendtoAdf);}catch(e){console.error(e);}}}};this.injectCarFaxScript=function(){if(document.getElementById('carFaxEnabled')?.value==='1'&&document.getElementById('carFaxType')?.value==='badge'){var a=document.querySelectorAll(this._container+' .carproof-badge[data-vin]');if(a.length){var vs={};var dt=['vin','make','model','year','color','sn','sendto','dealername','sendtoAdf'];a.forEach(function(el){var v=el.getAttribute('data-vin');if(v&&(v.length===17||v.length===12)){vs[v]={};for(var i=0,len=dt.length;i<len;i++){vs[v][dt[i]]=el.getAttribute('data-'+dt[i]);}}});if(Object.keys(vs).length){var tmp={},cmpt=0,max=5;for(var o in vs){if(vs.hasOwnProperty(o)){if(cmpt===max){setTimeout(this.getCarfaxBadges.bind(this,tmp));cmpt=0;tmp={};} 371tmp[o]=vs[o];cmpt++;}} 372setTimeout(this.getCarfaxBadges.bind(this,tmp));}}}};this.reInitAutofi=function(){if(window?.autofi?.scraper?.vinVehicleMap!==undefined){window.autofi.scraper.vinVehicleMap={};}};this.setInnerBoxVisibility=function(loading){if(this._ready){if(loading){if(!this._showloading){const carBoxes=document.querySelectorAll(this._container+' div.carBoxOuter');
372carBoxes.forEach(box=>{box.classList.remove('elIsLoaded');box.classList.add('elIsGreyed');});} 373this._showloading=true;}else{const carBoxes=document.querySelectorAll(this._container+' div.carBoxOuter');carBoxes.forEach(box=>{box.classList.add('elIsLoaded');box.classList.remove('elIsGreyed');});this._showloading=false;}}};this.applyNearbyCityBadges=function(root){if(!root){root=document.querySelector(this._container);} 374if(!root){return;} 375if(window.gUsedSrpAppz?.isUsedLocatorConstrainingResults!==true){var stale=root.querySelectorAll('.nearbyCityBadge');for(var j=0;j<stale.length;j++){stale[j].remove();} 376return;} 377if(document.getElementById('USEDSRP_NEARBY_CITY_LABEL_MODE')?.value!=='1'){return;} 378var tagText=document.getElementById('USEDSRP_NEARBY_CITY_TAG')?.value||'';if(tagText===''){return;} 379var nearby=window.gUsedSrpAppz?.usedNearbyDealers;if(!Array.isArray(nearby)||nearby.length===0){return;} 380var nearbySet=new Set(nearby.map(String));var cards=root.querySelectorAll('.carBoxOuter[data-owner]');for(var i=0;i<cards.length;i++){var card=cards[i];if(!nearbySet.has(String(card.getAttribute('data-owner')))){continue;} 381if(card.querySelector('.nearbyCityBadge')){continue;} 382var badge=document.createElement('div');badge.className='nearbyCityBadge';badge.textContent=tagText;var bannerWrap=card.querySelector('.carBannerWrapper');if(bannerWrap){bannerWrap.insertAdjacentElement('afterend',badge);}else{var inner=card.querySelector('.carBoxInner');if(inner){inner.insertBefore(badge,inner.firstChild);}}}};this.setContent=function(html){this.notifyObservers({cmd:'buffering'});if(!document.querySelector('BODY.UsedSrp2Mobile')){this._containerClone.innerHTML=html;this.adjustCarBoxHeight(true,false);this.applyNearbyCityBadges(this._containerClone);}else{document.querySelector(this._container).innerHTML=html;this.forMobileRoutine();this.applyNearbyCityBadges(document.querySelector(this._container));}};this.showGenericErrorMsg=function(){var html=`<div class="divSpan divSpan12 divEmptyRslt"> 383 <div class="divSpan divSpan12 divRsltMsg">${this._C.utext.errormsg}</div> 384 <div class="divSpan divSpan12 divRsltReset"><button><span>${this._C.utext.resetmsg}</span></button></div> 385 </div>`;this.setContent(html);};this.setTagH1=function(html){var el=document.querySelector('H1 .makeModelYear');if(el){el.innerHTML=html;} 386el=document.getElementById('used_404_message');if(el){el.remove();}};this.setBanner=function(html){var el=document.getElementById('bannerWrapper');if(!el){return;} 387var safe=(typeof html==='string')?html.trim():'';el.innerHTML=safe;el.querySelectorAll('img').forEach(img=>img.classList.add('lazyloaded'));el.style.display=safe!==''?'block':'none';};this.setSeoLinkBoxes=function(html){const el=document.querySelector(this._C?.elseoboxes);if(el){el.innerHTML=html;}};this.setBottomDisclaimer=function(html){var el=document.querySelector(this._C.elbottomdisclaimer);if(el){el.innerHTML=html;}};this.setBreadcrumbChild=function(html){var el=document.getElementById('breadcrumbs');if(el){var brd=el.querySelector('span.home').cloneNode(true);el.innerHTML='';el.appendChild(brd);var span=document.createElement('span');span.innerHTML=html;brd.insertAdjacentElement('afterend',span);span.insertAdjacentHTML('beforebegin','<span class="-ph">»</span> ');}};this.setHiddenValues=function(data,order){if(this._canReplaceHiddenValues){if(typeof order==='undefined'){order=this._filterLeads.keys.slice();} 388if(order.length===0){return;} 389var k=order.shift();if(data?.[k]!==undefined){for(var i=0;i<this._filterLeads.inputs.length;i++){var id='#'+this._filterLeads.inputs[i].prefix+k+this._filterLeads.inputs[i].suffix;var input=document.querySelector(id);if(input){input.value=data[k];}} 390return this.setHiddenValues(data,order);}}};this.isHiddenValuesReplacable=function(){if(!this._filterLeads?.keys||!this._filterLeads?.inputs){this._canReplaceHiddenValues=false;return;} 391var arr=this._filterLeads.keys;for(var i=0;i<arr.length;i++){for(var j=0;j<this._filterLeads.inputs.length;j++){var id='#'+this._filterLeads.inputs[j].prefix+arr[i]+this._filterLeads.inputs[j].suffix;var input=document.querySelector(id);if(input&&input.value!==''){this._canReplaceHiddenValues=false;return;}}} 392if(this._extras!==false){this.setHiddenValues(this._extras);}};this.onFilterDataChange=function(id,state){try{this.onLoadFromFilterProxy(this._C.name,{cmd:'reload',data:state.data});}catch(ex){console.error(ex);}};this.onFilterControllerMsg=function(id,data){if(data?.cmd==='ready'){this._ready=true;}};this.getVehicleIdsForCompare=function(key,html){if(!this._compareVh.enabled){return;} 393this._compareVh.lastKey=key;if(this._compareVh?.ids?.[key]!==undefined){this.setVehicleIdsForCompare(key,this._compareVh.ids[key]);return;} 394let carIds=[];if(html){carIds=[...html.matchAll(/\sdata-carid="(\d+)">/g)].map(match=>parseInt(match[1]));}else{document.querySelector(this._container)?.querySelectorAll('LI.carBoxWrapper[data-carid]')?.forEach(box=>{carIds.push(parseInt(box.getAttribute('data-carid')));});} 395if(carIds.length===0){return;} 396if(document.getElementById('compareVehiclesOrigin')?.value==='dealer'){this.setVehicleIdsForCompare(key,carIds);return;} 397let callData={action2:'getIdsValidToCompareAutoaubaine',ids:carIds.join(',')};fetch('/ajax/getCompareVehicles?'+new URLSearchParams(callData),{method:'GET',cache:'force-cache'}).then(response=>response.json()).then(rtn=>{this.setVehicleIdsForCompare(key,rtn===null?false:rtn);}).catch(()=>{this.setVehicleIdsForCompare(key,false);});};this.setVehicleIdsForCompare=function(key,data){if(key===''){return;} 398this._compareVh.ids[key]=(data!==null&&typeof data==='object'&&data.length)?data:false;setTimeout(()=>
398this.updateVehicleCompare());};this.updateVehicleCompare=function(){if(!this._compareVh.enabled){return;} 399if(this._compareVh?.ids?.[this._compareVh.lastKey]===undefined){return;} 400var step=(window.innerWidth>1300&&document.querySelector('BODY.isFullWidthPage')&&document.querySelector('BODY.isPageFullWidthEnabled'))?this._isFullDisplay?4:3:this._isFullDisplay?3:2;var rows=[];var items=[];var count=0;var ids=this._compareVh.ids[this._compareVh.lastKey];const carLinks=document.querySelectorAll(this._container+' .carLinks');carLinks.forEach(link=>link.style.display='block');const carBoxes=document.querySelectorAll(this._container+' LI[data-carid]');carBoxes.forEach((box)=>{if(ids===false||ids.indexOf(parseInt(box.getAttribute('data-carid')))===-1){const carLinks=box.querySelectorAll('.carLink');if(carLinks.length>=2){const compareButton=box.querySelector('.compareButton');if(compareButton){compareButton.closest('.carLink').remove();} 401const carLinksBar=box.querySelector('.carLinks');if(carLinksBar){carLinksBar.classList.remove('isHidden');}}else{const bt=box.querySelector('.compareButton');if(bt){bt.style.display='block';items.push(box);}else{const carLinksBar=box.querySelector('.carLinks');if(carLinksBar){carLinksBar.classList.remove('isHidden');}}}}else{const compareButton=box.querySelector('.compareButton');if(compareButton){compareButton.style.display='block';} 402const carLinksBar=box.querySelector('.carLinks');if(carLinksBar){carLinksBar.classList.remove('isHidden');}} 403if(++count===step){if(items.length===step){rows=rows.concat(items);} 404items=[];count=0;}});if(count!==0&&items.length===count){rows=rows.concat(items);} 405if(rows.length!==0){rows.forEach(row=>{const carLinksBar=row.querySelector('.carLinks');if(carLinksBar){carLinksBar.style.display='none';}});}};this.resizeElements=function(){var tmpSize=(window.innerWidth>1300)?1300:960;if(tmpSize!==this._lastSize){this._lastSize=tmpSize;this.adjustCarBoxHeight(false,true);}};this.loadExtras=function(){if(this._filterLeads?.id!==undefined){try{var v,hf=document.getElementById(this._filterLeads.id);if(hf){v=hf.value;if(v!==''){v=JSON.parse(atob(v));if(typeof v==='object'){this._extras=v;}}}}catch(ex){console.error(ex);}}};this.init=function(){if(this._filterProxy===null){console.error('"_filterProxy" is not an object');return;} 406if(this._filterData===null){console.error('"_filterData" is not an object');return;} 407if(this._filterController===null){console.error('"_filterController" is not an object');return;} 408if(!document.querySelector(this._container)){console.error(`no valid "_container": ${this._container}`);return;} 409this._isFullDisplay=(document.querySelector('BODY.usrp2IsfullDisplay')!==null);this._filterProxy.addObserver(this.onLoadFromFilterProxy.bind(this));this._filterData.addObserver(this.onFilterDataChange.bind(this));this._filterController.addObserver(this.onFilterControllerMsg.bind(this));this.loadExtras();this.initActions();if(!document.querySelector('BODY.UsedSrp2Mobile')){this.createContainerClone();window.addEventListener('resize',this.resizeElements.bind(this));setTimeout(()=>this.getVehicleIdsForCompare('start',false));}else{this.forMobileRoutine();setTimeout(()=>this.getVehicleIdsForCompare('start',false));} 410this._filterController.init();setTimeout(this.isHiddenValuesReplacable.bind(this),500);};this.init();};var FilterInterface=function(config){this._C={name:'FilterInterface',filterController:null,...(typeof config==='object'&&config!==null?config:{})};this._filterController=(typeof this._C.filterController==='object')?this._C.filterController:null;this.isOK=function(){return!(this._filterController===null||this._filterController._filtersIndex===null||this._filterController._filterProxy===null||this._filterController._filterModel===null);};this.setFilters=function(overwrite,keep){if(!this.isOK()||overwrite===null||typeof overwrite!=='object'){return false;} 411var i,p,len,fid,filters=[];if(keep!==null&&typeof keep==='object'&&keep.length>0){for(i=0,len=keep.length;i<len;i++){if((fid=this.getFilterModel().getFilterIdFromKeyName(keep[i]))!==false){filters.push({fid:fid,values:this.getFilterIndex(fid).getVals()});}}} 412for(p in overwrite){if(overwrite.hasOwnProperty(p)){if((fid=this.getFilterModel().getFilterIdFromKeyName(p))!==false){filters.push({f
412id:fid,values:overwrite[p]});}}} 413this._filterController.resetAll();for(i=0,len=filters.length;i<len;i++){this.getFilterIndex(filters[i].fid).changeSelectedState(filters[i].values);} 414return true;};this.clearProxyCacheAndReFetch=function(){if(!this.isOK()){return false;} 415var i,len,filters;if((filters=this._filterController.getCurrentFiltersValues())===false){return false;} 416var geoVals=this._filterController._geocomponent!==null?this._filterController._geocomponent.getVals():null;var locatorVals=this._filterController._locatorcomponent!==null?this._filterController._locatorcomponent.getVals():null;this._filterController._filterProxy.clearCache();this._filterController.resetAll();for(i=0,len=filters.length;i<len;i++){this.getFilterIndex(filters[i].fid).changeSelectedState(filters[i].values);} 417if(geoVals!==null){this._filterController._geocomponent.changeSelectedState(geoVals);} 418if(locatorVals!==null){this._filterController._locatorcomponent.changeSelectedState(locatorVals);} 419return true;};this.setDbColumn=function(column,data){if(!this.isOK()){return false;} 420this.getFilterModel().setDbColumn(column,data);};this.getFilterController=function(){return this._filterController;};this.getFilterModel=function(){return this._filterController?._filterModel;};this.getFilterIndex=function(ind){return this._filterController?._filtersIndex?.[ind];};this.getCurrentFilterState=function(name){var i,len,filters,k,flts={},dflt=false;if(!this.isOK()){return dflt;} 421name=(typeof name==='string')?name:false;if((filters=this._filterController?.getCurrentFiltersValues())===false){return dflt;} 422for(i=0,len=filters.length;i!==len;i++){if((k=this.getFilterModel()?.getKeyNameByFilterId(filters[i].fid))!==false){if(name!==false){if(name===k){var j,o,len2,counts={},nums=this.getFilterModel().getItemsFromResultSet(filters[i].fid);for(o in nums){if(!nums.hasOwnProperty(o)){continue;} 423counts[nums[o].value+'_']=nums[o].num;} 424flts=[];for(j=0,len2=filters[i].values.length;j!==len2;j++){var v=filters[i].values[j];flts.push({value:v,num:(typeof counts[v+'_']==='undefined')?0:counts[v+'_']});} 425return flts;}}else{flts[k]=filters[i].values;}}} 426return(name!==false)?dflt:flts;};this.getDefaultValuesByFltId=function(id){var obj=this._filterController._filterObject.getBasicFilter();if(typeof obj[id]!=='undefined'){return obj[id];} 427return null;};this.getHumanFilterState=function(){var o,i,len,curr,basic,tmp,filters={};curr=this._filterController._filterObject.toHumanObj(this._filterController._filtersIndex,this._filterController._sortcomponent,this._filterController._pagecomponent,this._filterController._geocomponent,this._filterController._locatorcomponent);basic=this._filterController._filterObject.getBasicFilter();if(!basic||!curr){return false;} 428for(o in basic){if(basic.hasOwnProperty(o)){filters[o]=typeof curr[o]!=='undefined'?curr[o]:{type:null,value:basic[o]};}} 429for(o in curr){if(curr.hasOwnProperty(o)&&typeof filters[o]==='undefined'){filters[o]=curr[o];}} 430var dm=this.getFilterModel();for(o in filters){if(filters.hasOwnProperty(o)){if(filters[o].type!==null){switch(filters[o].type){case'RangeSlider':var min=typeof filters[o].value[0]!=='undefined'?filters[o].value[0]:0,max=typeof filters[o].value[1]!=='undefined'?filters[o].value[1]:0;filters[o]=(min||max)?{min:min,max:max,}:false;break;case'SearchInputBox':filters[o]=(filters[o].value.length&&typeof filters[o].value[0]['v']!=='undefined'&&filters[o].value[0]['v']!=='')?filters[o].value[0]['v']:false;break;case'PaginationBox':filters[o]=(filters[o].value.length===2)?{page:filters[o].value[0]+1,perPage:filters[o].value[1]}:false;break;case'SortingBox':filters[o]=filters[o].value.length===1?dm.getTxtByFltId(o,filters[o].value[0]):false;break;case'GeoLocationDistanceBox':if(typeof filters[o].focus==='undefined'||(typeof filters[o].focus!=='undefined'&&filters[o].focus!==true)){filters[o]=false;}else{filters[o]={distance:{min:filters[o].distance[0],max:filters[o].distance[1],},postalcode:filters[o].value}} 431break;case'DealerLocatorBox':if(typeof filters[o].focus==='undefined'||(typeof filters[o].focus!=='undefined'&&filters[o].focus!==true)||filters[o].value.length!==3||typeof this._filterController._locatorcomponent==='undefined'||this._filterController._locatorcomponent===null){filters[o]=false;}else{var loc=this._filterController._locatorcomponent;filters[o]={distance:{min:filters[o].distance[0],max:filters[o].distance[1],},province:loc.getSelectedText(0,filters[o].value[0]),city:loc.getSelectedText(1,filters[o].value[1]),dealer:loc.getSelectedText(2,filters[o].value[2])}} 432break;default:len=filters[o].value.length;if(len){var holder=[];for(i=0;i!==len;i++){if((tmp=dm.getTxtByFltId(o,filters[o].value[i]))!==''){holder.push(tmp);}} 433filters[o]=holder.length?holder:false;}else{filters[o]=false;} 434break;}}else{filters[o]=false;}}} 435return JSON.parse(JSON.stringify(filters));};this.resetAllFilters=function(){this._filterController._filterProxy.clearCache();this._filterController.resetAll(null);};};window.AbstractUsedSrpObject=window.AbstractUsedSrpObject||function(config){this._C={name:'AbstractUsedSrpObject',...(typeof config==='object'&&config!==null?config:{})};if(!this._C?.id){this._C.id=this._C.name;} 436Object.assign(this,new AbstractObserver());this._fObserver={proxy:[],filter:[],content:[]};this.addUsedSrpEventObserver=function(name,f){if(typeof f==='function'&&this._fObserver[name]){this._fObserver[name].push(f);} 437return this;};this._onProxyEvent=function(id,args){this._fObserver.proxy.forEach(function(f){if(typeof f==='function'){f(args);}});};this._onFilterEvent=function(id,state){this._fObserver.filter.forEach(function(f){if(typeof f==='function'){f(state);}});};this._onContentEvent=function(id,state){this._fObserver.content.forEach(function(f){if(typeof f==='function'){f(state);}});};
437this._initObserverConfig={count:0,max:30,timeout:100};this.initUsedSrpObserver=function(){if(!window?.gUsedSrpAppz?._contentController?._filterProxy){if(this._initObserverConfig.count<this._initObserverConfig.max){setTimeout(this.initUsedSrpObserver.bind(this),this._initObserverConfig.timeout);} 438return;} 439gUsedSrpAppz._contentController._filterProxy.addObserver(this._onProxyEvent.bind(this));gUsedSrpAppz.filterInterface.getFilterController().addObserver(this._onFilterEvent.bind(this));gUsedSrpAppz._contentController.addObserver(this._onContentEvent.bind(this));};};var CardImageSlider=function(config){'use strict';config={name:'CardImageSlider',url:'',batchSize:6,rootMargin:'300px',utext:{seeAll:'View all {{total}} photos'},...(typeof config==='object'&&config!==null?config:{})};config.url=_U.WsWidth.replacer(config.url);var HAS_IO=('IntersectionObserver'in window);var pending={};var pendingCount=0;var flushTimer=null;var imageData={};var inflight={};var cardIo=HAS_IO?new IntersectionObserver(onCardIntersect,{rootMargin:config.rootMargin}):null;this.refresh=function(){scan(document);};function scan(root){root=root||document;var fresh=root.querySelectorAll('[data-cs-slider]:not([data-cs-done])');for(var i=0;i<fresh.length;i++){if(cardIo)cardIo.observe(fresh[i]);else queue(fresh[i]);} 440var done=root.querySelectorAll('[data-cs-slider][data-cs-done]');for(var j=0;j<done.length;j++){if(!done[j]._csWired)wire(done[j]);}} 441function onCardIntersect(entries){for(var i=0;i<entries.length;i++){if(!entries[i].isIntersecting)continue;cardIo.unobserve(entries[i].target);queue(entries[i].target);}} 442function queue(el){var id=el.getAttribute('data-cs-id');if(!id||el.hasAttribute('data-cs-done')||pending[id])return;pending[id]=el;pendingCount++;scheduleFlush();} 443function scheduleFlush(){if(flushTimer)return;flushTimer=window.setTimeout(flush,60);} 444function flush(){flushTimer=null;if(!pendingCount)return;var ids=[],batch={},id;for(id in pending){if(!pending.hasOwnProperty(id))continue;if(ids.length>=config.batchSize)break;ids.push(id);batch[id]=pending[id];delete pending[id];pendingCount--;} 445if(pendingCount)scheduleFlush();var toFetch=[];for(var i=0;i<ids.length;i++){id=ids[i];if(imageData.hasOwnProperty(id)){if(imageData[id])hydrate(batch[id],imageData[id]);}else if(inflight[id]){attach(inflight[id],batch[id]);}else{toFetch.push(id);}} 446if(!toFetch.length)return;var p=fetch(config.url+'&ids='+encodeURIComponent(toFetch.join(',')),{credentials:'same-origin'}).then(function(r){return r.ok?r.json():null;}).then(function(json){return(json&&json.data)?json.data:{};}).catch(function(){return{};});for(var j=0;j<toFetch.length;j++){(function(fid,el){inflight[fid]=p.then(function(data){var info=data[fid]||null;imageData[fid]=info;delete inflight[fid];return info;});attach(inflight[fid],el);})(toFetch[j],batch[toFetch[j]]);}} 447function attach(promise,el){promise.then(function(info){if(info)hydrate(el,info);});} 448function hydrate(slider,info){if(!slider||!slider.isConnected)return;if(slider.hasAttribute('data-cs-done'))return;slider.setAttribute('data-cs-done','1');var track=slider.querySelector('[data-cs-track]');var imgs=info.images||[];var total=info.total||imgs.length;if(!track||imgs.length<=1){slider._csWired=true;return;} 449slider.setAttribute('data-cs-total',String(total));var vdpLink='';var firstA=track.querySelector('.cs-slide a');if(firstA)vdpLink=firstA.getAttribute('href')||'';for(var i=1;i<imgs.length;i++){track.appendChild(buildSlide(imgs[i],vdpLink));} 450if(total>imgs.length&&vdpLink){var last=track.lastElementChild;if(last)last.appendChild(buildViewAll(vdpLink,total));}
451buildControls(slider,track);wire(slider);} 452function wire(slider){if(slider._csWired)return;var track=slider.querySelector('[data-cs-track]');if(!track){slider._csWired=true;return;} 453if(track.querySelectorAll('.cs-slide').length<=1){slider._csWired=true;return;} 454var prev=slider.querySelector('.cs-arrow--prev');var next=slider.querySelector('.cs-arrow--next');if(prev)prev.addEventListener('click',function(e){stop(e);step(track,-1);});if(next)next.addEventListener('click',function(e){stop(e);step(track,1);});var dots=slider.querySelectorAll('.cs-dots button');for(var i=0;i<dots.length;i++){(function(idx){dots[idx].addEventListener('click',function(e){stop(e);goTo(track,idx);});})(i);} 455slider.classList.remove('is-swiping');var ticking=false;track.addEventListener('scroll',function(){if(ticking)return;ticking=true;window.requestAnimationFrame(function(){updateState(slider,track);revealOnSwipe(slider);ticking=false;});});observeSlideImages(track);updateState(slider,track);slider._csWired=true;} 456function revealOnSwipe(slider){slider.classList.add('is-swiping');if(slider._csHideTimer)window.clearTimeout(slider._csHideTimer);slider._csHideTimer=window.setTimeout(function(){slider.classList.remove('is-swiping');slider._csHideTimer=null;},1500);} 457function currentIndex(track){return track.clientWidth?Math.round(track.scrollLeft / track.clientWidth):0;} 458function goTo(track,i){var slides=track.querySelectorAll('.cs-slide');i=Math.max(0,Math.min(i,slides.length-1));slides[i].scrollIntoView({behavior:'smooth',inline:'center',block:'nearest'});} 459function step(track,delta){goTo(track,currentIndex(track)+delta);} 460function sliderTotal(slider,track){var t=parseInt(slider.getAttribute('data-cs-total'),10);return(t&&t>0)?t:track.querySelectorAll('.cs-slide').length;} 461function updateState(slider,track){var cur=currentIndex(track);var dots=slider.querySelectorAll('.cs-dots button');for(var i=0;i<dots.length;i++){dots[i].classList.toggle('is-active',i===cur);} 462var span=slider.querySelector('[data-cs-counter-text]');if(span)span.textContent=(cur+1)+' / '+sliderTotal(slider,track);} 463function observeSlideImages(track){var imgs=track.querySelectorAll('img[data-src]');if(!imgs.length)return;if(!HAS_IO){for(var k=0;k<imgs.length;k++)swapSrc(imgs[k]);return;} 464var tio=new IntersectionObserver(function(entries){for(var i=0;i<entries.length;i++){if(!entries[i].isIntersecting)continue;tio.unobserve(entries[i].target);swapSrc(entries[i].target);}},{root:track,rootMargin:'0px 100% 0px 100%'});for(var j=0;j<imgs.length;j++)tio.observe(imgs[j]);} 465function swapSrc(img){var url=img.getAttribute('data-src');if(!url)return;img.src=url;img.removeAttribute('data-src');} 466function buildSlide(url,vdpLink){var slide=document.createElement('div');slide.className='cs-slide';var a=document.createElement('a');a.href=vdpLink||'#';var img=document.createElement('img');img.className='mainImage';img.alt='';img.setAttribute('data-src',url);a.appendChild(img);slide.appendChild(a);return slide;} 467function buildViewAll(vdpLink,total){var a=document.createElement('a');a.className='cs-viewall';a.href=vdpLink;var span=document.createElement('span');span.textContent=config.utext?.seeAll?.replace('{{total}}',total);a.appendChild(span);return a;}
468function buildControls(slider,track){var slidesShown=track.querySelectorAll('.cs-slide').length;if(slidesShown<=1)return;slider.appendChild(arrowButton('prev'));slider.appendChild(arrowButton('next'));slider.appendChild(counterEl(sliderTotal(slider,track)));var dotsWrap=document.createElement('div');dotsWrap.className='cs-dots';for(var i=0;i<slidesShown;i++){var dot=document.createElement('button');dot.type='button';dot.setAttribute('aria-label','image '+(i+1));dotsWrap.appendChild(dot);} 469slider.appendChild(dotsWrap);} 470function arrowButton(dir){var b=document.createElement('button');b.type='button';b.className='cs-arrow cs-arrow--'+dir;b.setAttribute('aria-label',dir==='prev'?'previous image':'next image');b.innerHTML='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="' 471+((dir==='prev')?'M15 18l-6-6 6-6':'M9 18l6-6-6-6')+'"/></svg>';return b;} 472function counterEl(total){var c=document.createElement('div');c.className='cs-counter';c.innerHTML='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+'<rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/>'+'<path d="M21 15l-5-5L5 21"/></svg><span data-cs-counter-text>1 / '+total+'</span>';return c;} 473function stop(e){e.preventDefault();e.stopPropagation();}};var UsedSrpAppz=function(fd){try{if(typeof _U.Compilation!=='undefined'){if(typeof _U.Compilation.compileid!=='undefined'){document.getElementById('compileidjs').value=_U.Compilation.compileid;} 474if(typeof _U.Compilation.compilestarttime!=='undefined'){var dcst=new Date(_U.Compilation.compilestarttime*1000);document.getElementById('compilestarttimejs').value=`${dcst.getFullYear()}-${dcst.getMonth() + 1}-${dcst.getDate()} ${dcst.getHours()}:${dcst.getMinutes()}:${dcst.getSeconds()}`;} 475if(typeof _U.Compilation.compilesitecompiler!=='undefined'){document.getElementById('compilesitecompilerjs').value=_U.Compilation.compilesitecompiler;}}}catch(e){} 476var filterProxy=new FilterProxy({debug:true,id:"filterproxy",filterRequest:new FilterRequest({"debug":true,"infos":"filterid","url":"\/en\/ajax\/getSearchVehiclesFromFilterObject?wswidth={{WSWIDTHREPLACER}}"}),filterData:fd,});var filterController=new FilterController({debug:true,el:'.fltWrapper',skeletons:[".fltGeoLocBar > div","#fltSortId",".divSpanFilters"],oemEvent:{"etype":"filters:change","ltype":"filters:load","field":"oemCertification","id":"filterState","ids":[1004,1006,1007,1008,1009,1010,1011,1012,1014,1015,1016,1017,1018,1019,1020]},utext:{"clearmsg":"clear","clearallmsg":"Remove filters","applymsg":"apply","closemsg":"Close","resultsmsg":"Results","resultmsg":"Result"},baseuri:'/inventory.html?filterid=',forDealerDb:["fltDealersId","fltDealerLocatorId","fltGeoLocationId"],filterData:fd,filterProxy:filterProxy,filterModel:new FilterModel({"debug":true,"id":"filtermodel","data":{"sort":[{txt:"Price: Low to High",value:1},{txt:"Price: High to Low",value:2},{txt:"KM: Low to High",value:3},{txt:"KM: High to Low",value:4},{txt:"Year: Old to New",value:5},{txt:"Year: New to Old",value:6},{txt:"Make",value:7},{txt:"House make first",value:8},{txt:"Dealer inventory first",value:9},{txt:"Arrival date descending",value:10},{txt:"Arrival date ascending",value:11},{txt:"Nearest first",value:12}],"distance":[{txt:"10km",value:10},{txt:"25km",value:25},{txt:"50km",value:50},{txt:"100km",value:100},{txt:"150km",value:150},{txt:"200km",value:200},{txt:"250km",value:250}],"geolocation":[0,1000000],"category":[{txt:"Used vehicles",value:1,hide:0},{txt:"Demo vehicles",value:2,hide:1},{txt:"New Inventory",value:3,hide:0}],"clearance":[{txt:"Promotions",value:1,hide:1,icon:"fas fa-dollar-sign","exclass":"exclearance"}],"lowconsumption":[{txt:"Fuel efficient",value:1,hide:0,icon:"fas fa-gas-pump","exclass":"exlowconsumption"}],"certified":[{txt:"Certified vehicles",value:1,hide:0,icon:"fas fa-star","exclass":"excertified"}],"asis":[{txt:"Sold As-Is",value:1,hide:1,icon:"fas fa-check","exclass":"exasis"}],"cuvapproved":[{txt:" Approved Pre-Owned",value:1,hide:1,icon:"fas fa-check","exclass":"excuvapproved"}],"cuvcertified":[{txt:" Certified Pre-Owned",value:1,hide:1,icon:"fas fa-check","exclass":"excuvcertified"}],"autocancpo":[{txt:"Certified Pre-Owned Vehicles",value:1,hide:1,icon:"fas fa-check","exclass":"exautocancpo"}],"autocanacc":[{txt:"AutoCanada Certified",value:1,hide:1,icon:"fas fa-check","exclass":"exautocanacc"}],"autocanviv":[{txt:"Value Inspected Vehicle",value:1,hide:1,icon:"fas fa-check","exclass":"exautocanviv"}],"bodytype":[{txt:"Others",value:0,hide:1,icon:"",sgulrtxt:"Other"},{txt:"Cars",value:1,hide:0,icon:"carosseriestyle sedan",sgulrtxt:"Car"},{txt:"Hatchback",value:17,hide:0,icon:"carosseriestyle hatchback",sgulrtxt:"Hatchback"},{txt:"Trucks",value:2,hide:0,icon:"carosseriestyle pickup",sgulrtxt:"Truck"},{txt:"Convert.",value:3,hide:1,icon:"carosseriestyle convertible"},{txt:"Minivans",value:4,hide:0,icon:"carosseriestyle van",sgulrtxt:"Minivan"},{txt:"Commerc.",value:5,hide:1,icon:"carosseriestyle commercial"},{txt:"SUV",value:6,hide:0,icon:"carosseriestyle suv"},{txt:"RVs",value:7,hide:1,icon:"carosseriestyle rv"},{txt:"Heavy trucks",value:8,hide:1,icon:"",sgulrtxt:"Heavy truck"},{txt:"Trailers",value:9,hide:1,icon:"",sgulrtxt:"Trailer"},{txt:"Boats",value:10,hide:1,icon:"carosseriestyle boat",sgulrtxt:"Boat"},{txt:"Watercraft",value:11,hide:1,icon:""},{txt:"Sleds",value:12,hide:1,icon:"carosseriestyle snowmobile",sgulrtxt:"Snowmobile"},{txt:"Bikes",value:13,hide:1,icon:"carosseriestyle motocycle",sgulrtxt:"Motorcycle"},{txt:"ATVs",value:14,hide:1,icon:"carosseriestyle atv"},{txt:"Heavy",value:15,hide:1,icon:""},{txt:"Farm equip.",value:16,hide:1,icon:""}],"subbodytype":[{txt:"Other",value:0,hide:0,group:0}],"floorplan":[{txt:"Front Bath",value:1,hide:1,group:8},{txt:"Rear Bath",value:2,hide:1,group:8},{txt:"Front Bedroom",value:3,hide:1,group:8},{txt:"Rear Bedroom",value:4,hide:1,group:8},{txt:"Outdoor Kitchen",value:5,hide:1,group:8},{txt:"Rear Kitchen",value:6,hide:1,group:8},{txt:"Rear Living",value:7,hide:1,group:8},{txt:"Two Entry\/Exit Doors",value:8,hide:1,group:8},{txt:"Walk-Thru Bath",value:9,hide:1,group:8},{txt:"Other",value:0,hide:1,group:0}],"transmission":[{txt:"Automatic",value:1,hide:0},{txt:"Manual",value:2,hide:0},{txt:"Others",value:3,hide:1}],"carburant":[{txt:"Gas",value:1,hide:0},{txt:"Electric",value:2,hide:0},{txt:"Hybrid",value:3,hide:0},{txt:"Diesel",value:4,hide:1},{txt:"PHEV",value:5,hide:1}],color:[{txt:"Black",value:2,color:"#000000",hide:0},{txt:"Grey",value:7,color:"#979797",hide:0},{txt:"Silver",value:9,color:"#C0C0C0",hide:0},{txt:"White",value:12,color:"#ffffff",hide:0},{txt:"Blue",value:3,color:"#0000ee",hide:0},{txt:"Green",value:6,color:"#009900",hide:1},{txt:"Red",value:11,color:"#cc0000",hide:0},{txt:"Purple",value:15,color:"#800080",hide:1},{txt:"Mauve",value:10,color:"#D473D4",hide:1},{txt:"Brown",value:5,color:"#66330E",hide:0}
476,{txt:"Gold",value:4,color:"#B29600",hide:0},{txt:"Copper",value:14,color:"#C87533",hide:1},{txt:"Orange",value:8,color:"#E69400",hide:1},{txt:"Tan",value:1,color:"#D2B48C",hide:1},{txt:"Yellow",value:13,color:"#f0c000",hide:1},{txt:"Other",value:0,color:"#fbfbfb",hide:0}],"option":[{txt:"Bluetooth Integration",value:366,hide:0},{txt:"Backup Camera",value:130,hide:0},{txt:"Heated Seats",value:67,hide:0},{txt:"3rd Row Seats",value:663,hide:1},{txt:"Leather Seats",value:54,hide:0},{txt:"Navigation System (GPS)",value:245,hide:1},{txt:"Remote Starter",value:18,hide:0},{txt:"Sunroof",value:4,hide:1},{txt:"Heated Steering Wheel",value:529,hide:0},{txt:"Front Air Conditioning",value:53,hide:0},{txt:"Proximity Sensors",value:533,hide:1},{txt:"Apple CarPlay",value:535,hide:1},{txt:"Satellite Radio",value:108,hide:0},{txt:"Cruise Control",value:1,hide:0}],"arrivals":[{txt:"Last 7 days",value:6,hide:0},{txt:"Last 15 days",value:1,hide:0},{txt:"Last 30 days",value:2,hide:0}],"trims":[{txt:"LX",value:4141741675,hide:0,group:14},{txt:"GL",value:1346407056,hide:0,group:7},{txt:"S",value:2051853394,hide:0,group:25},{txt:"EX",value:2801189887,hide:0,group:13},{txt:"L",value:1205391271,hide:0,group:25},{txt:"Others",value:3859746544,hide:0,group:27},{txt:"LE",value:4055679437,hide:0,group:25},{txt:"2.5 SV",value:3923196259,hide:0,group:18},{txt:"SE",value:880777794,hide:0,group:25},{txt:"Sport",value:1954569052,hide:0,group:20},{txt:"Preferred",value:810027719,hide:0,group:9},{txt:"LX",value:3689500465,hide:0,group:5},{txt:"LE",value:3431090180,hide:0,group:26},{txt:"SE",value:3397031669,hide:0,group:2},{txt:"LE",value:2969767202,hide:0,group:35},{txt:"XSE",value:1851278592,hide:0,group:25},{txt:"SE",value:1142255309,hide:0,group:24},{txt:"CE",value:1192747560,hide:0,group:38},{txt:"Trailhawk",value:1654054988,hide:0,group:11},{txt:"Highline",value:249087831,hide:0,group:42},{txt:"380 Autobahn",value:2378670512,hide:0,group:41},{txt:"Highline",value:245406681,hide:0,group:43},{txt:"Premium",value:426146392,hide:0,group:30},{txt:"Touring",value:2508017949,hide:0,group:21},{txt:"Limited",value:448113113,hide:0,group:36},{txt:"Trail",value:1386128416,hide:0,group:35},{txt:"XLE",value:1875669084,hide:0,group:33},{txt:"XLE",value:415973578,hide:0,group:35},{txt:"Limited",value:3302731880,hide:0,group:8},{txt:"Hybrid XLE",value:2085991963,hide:0,group:35},{txt:"SE",value:2545866619,hide:0,group:34},{txt:"Platinum",value:552319905,hide:0,group:19},{txt:"SR5",value:3953407879,hide:0,group:22},{txt:"Limited",value:1566324808,hide:0,group:33},{txt:"XLT",value:2995794846,hide:0,group:3},{txt:"XSE",value:255250456,hide:0,group:34},{txt:"XLE",value:673085610,hide:0,group:24},{txt:"XSE",value:506638735,hide:0,group:24},{txt:"4dr 4wd",value:1147054358,hide:0,group:22},{txt:"4dr Hb Mt",value:601197183,hide:0,group:29},{txt:"GT Limited",value:180359433,hide:0,group:15},{txt:"XLE",value:3368784308,hide:0,group:31},{txt:"Others",value:652849030,hide:0,group:29},{txt:"Pro",value:1667600905,hide:0,group:4},{txt:"Hybrid XLE",value:2891278181,hide:0,group:31},{txt:"XSE",value:4276574353,hide:0,group:31},{txt:"TrailSport",value:2767679050,hide:0,group:6},{txt:"Limited",value:710609118,hide:0,group:35},{txt:"Limited",value:4200323488,hide:0,group:31},{txt:"Others",value:3213055518,hide:0,group:22},{txt:"RX 350",value:3542901806,hide:0,group:17},{txt:"XSE",value:2655758270,hide:0,group:37},{txt:"GR Sport",value:2963754019,hide:0,group:37},{txt:"Trd Off-Road Premium",value:973153212,hide:0,group:39},{txt:"SR",value:4196734571,hide:0,group:40},{txt:"Limited",value:2885541377,hide:0,group:28},{txt:"Select",value:552334397,hide:0,group:1},{txt:"SR5",value:160597115,hide:0,group:40},{txt:"Veloce",value:4286634413,hide:0,group:0},{txt:"Others",value:3689816043,hide:0,group:23},{txt:"Altitude",value:2154273210,hide:0,group:12},{txt:"Trd Sport - Roof",value:4217021885,hide:0,group:39},{txt:"Trd Off-Road - Roof",value:1417952705,hide:0,group:39},{txt:"Trd Sport",value:3035210470,hide:0,group:39},{txt:"Hybrid Limited",value:2739815661,hide:0,group:31},{txt:"Others",value:2017672723,hide:0,group:39},{txt:"Hybrid",value:581573797,hide:0,group:39},{txt:"Limited",value:2536839150,hide:0,group:12},{txt:"Hybrid",value:3848959144,hide:0,group:22},{txt:"Limited",value:3549810817,hide:0,group:38},{txt:"1958",value:4060916872,hide:0,group:32},{txt:"Limited",value:1639043832,hide:0,group:40},{txt:"Limited Hybrid",value:415164830,hide:0,group:40},{txt:"Platinum",value:3144527977,hide:0,group:40},{txt:"Platinum Hybrid",value:3300930337,hide:0,group:40},{txt:"Ultra Bright Theme",value:2450665147,hide:0,group:44},{txt:"Fieldmaster Edition",value:2770927224,hide:0,group:10},{txt:"LX 570",value:161915039,hide:0,group:16}],"dealers":[{txt:"Country Hills Toyota",value:4470,hide:0}],"regions":[{txt:"Other Regions",value:0,hide:0}],"provinces":[{txt:"...",value:0,"dealer":"0"},{txt:"Alberta",value:812207111,"dealer":4470}],"drivetrain":[{txt:"Front-wheel drive",value:3,hide:0},{txt:"Rear-wheel drive",value:5,hide:0},{txt:"Four-wheel drive",value:2,hide:0},{txt:"All-wheel drive",value:4,hide:0},{txt:"Other",value:1,hide:0}],"doors":[{txt:"2 Doors",value:2,hide:0},{txt:"4 Doors",value:4,hide:0}],"seats":[{txt:"4 Passengers",value:4,hide:0},{txt:"5 Passengers",value:5,hide:0},{txt:"6 Passengers",value:6,hide:0},{txt:"7 Passengers",value:7,hide:0},{txt:"Other",value:0,hide:0}],"engine":[{txt:"Unknown",value:0,hide:0}],"cylinders":[{txt:"Other",value:0,hide:0}],"package":[{txt:"Unknown",value:0,hide:0}],"delivery":[{txt:"In Stock",value:1,hide:0},{txt:"In Transit",value:2,hide:1},{txt:"In Production",value:3,hide:1},{txt:"Other",value:0,hide:1}],"typecertification":[{txt:"...",value:0,hide:1},{txt:"Toyota Canada Certified",value:12,hide:0}],"make":[{txt:"Alfa Romeo",value:66},{txt:"Chrysler",value:43},{txt:"Ford",value:45},{txt:"GMC",value:26},{txt:"Honda",value:47},{txt:"Hyundai",value:27},{txt:"INEOS",value:119},{txt:"Jeep",value:49},{txt:"Kia",value:11},{txt:"Lexus",value:50},{txt:"Nissan",value:53},{txt:"Subaru",value:19},{txt:"Toyota",value:64},{txt:"Volkswagen",value:39},{txt:"Volvo",value:63}],"model":[{txt:"Giulia",value:2295,group:0},{txt:"Pacifica",value:189,group:1},{txt:"Escape",value:289,group:2},{txt:"F-150",value:297,group:2},{txt:"Sierra 1500",value:360,group:3},{txt:"CR-V",value:374,group:4},{txt:"Passport",value:380,group:4},{txt:"Elantra",value:396,group:5},{txt:"Santa Fe Sport",value:2288,group:5},{txt:"Tucson",value:402,group:5},{txt:"Grenadier Station Wagon",value:3025,group:6},{txt:"Compass",value:1069,group:7},{txt:"Grand Cherokee",value:458,group:7},{txt:"Forte",value:1379,group:8},{txt:"Soul",value:2651,group:8},{txt:"Stinger",value:2346,group:8},{txt:"LX",value:3122,group:9},{txt:"RX",value:499,group:9},{txt:"Altima",value:833,group:10},{txt:"Rogue",value:1206,group:10},{txt:"Crosstrek",value:2297,group:11},{txt:"Outback",value:863,group:11},{txt:"4Runner",value:690,group:12},{txt:"BZ Woodland",value:3202,group:12},{txt:"Camry",value:693,group:12},{txt:"Corolla",value:696,group:12},{txt:"Corolla Cross",value:2708,group:12},{txt:"Corolla Hatchback",value:2511,group:12},{txt:"Crown Signia",value:3019,group:12},{txt:"GR Corolla",value:2876,group:12},{txt:"GR86",value:2862,group:12},{txt:"Highlander",value:699,group:12},{txt:"Land Cruiser",value:700,group:12},{txt:"Prius",value:708,group:12},{txt:"Prius Plug-In Hybrid",value:3156,group:12},{txt:"RAV4",value:709,group:12},{txt:"RAV4 Hybrid",value:2248,group:12},{txt:"RAV4 Plug-In Hybrid",value:3059,group:12},{txt:"Sienna",value:713,group:12},{txt:"Tacoma",value:718,group:12},{txt:"Tundra",value:720,group:12},{txt:"Golf GTI",value:677,group:13},{txt:"Taos",value:2676,group:13},{txt:"Tiguan",value:1333,group:13}
476,{txt:"XC90",value:642,group:14}],"price":[0,98883],"year":[2014,2027],"mileage":[0,261743],"dpayment":[0,0],"dealerlocator":[0,1000000],"electricrange":[452,452],"batteryenergy":[74,74],"truckbedlen":[0,0],"towingcpc":[0,0],"invitem_weight":[0,0],"invitem_length":[0,0],"invitem_sleeps":[0,0],"tsearch":[{txt:"Trim, Cyl., Trans., etc...",value:"fieldsearch",seperated:1,hidden:false},{txt:"style ids",value:"styleid",seperated:2,hidden:true}],"fkeys":{"fltSortId":"sort","fltCategorieId":"category","fltCarosserieId":"bodytype","fltSubBodyTypeId":"subbodytype","fltFloorPlanId":"floorplan","fltMakeId":"make","fltModelId":"model","fltTransmissionId":"transmission","fltCarburantId":"carburant","fltColorId":"color","fltPriceId":"price","fltYearId":"year","fltKmId":"mileage","fltDPaymentId":"dpayment","fltOptionId":"option","fltArrivalsId":"arrivals","fltClearanceId":"clearance","fltLowConsumptionId":"lowconsumption","fltCertifiedId":"certified","fltAsIsId":"asis","fltCuvApprovedId":"cuvapproved","fltCuvCertifiedId":"cuvcertified","fltAutocanCpoId":"autocancpo","fltAutocanAccId":"autocanacc","fltAutocanVivId":"autocanviv","fltTextSearchId":"tsearch","fltPageId":"page","fltTrimsId":"trims","fltDealersId":"dealers","fltRegionsId":"regions","fltGeoLocationId":"geolocation","fltDistanceId":"distance","fltPostalCodeId":"postalcode","fltDealerLocatorId":"dealerlocator","fltDriveTrainId":"drivetrain","fltDoorsId":"doors","fltSeatsId":"seats","fltEngineId":"engine","fltCylindersId":"cylinders","fltPackageId":"package","fltDeliveryId":"delivery","fltElectricRangeId":"electricrange","fltBatteryEnergyId":"batteryenergy","fltTruckBedLenId":"truckbedlen","fltTowingCpc":"towingcpc","fltTypeCertId":"typecertification","fltWeightId":"invitem_weight","fltLengthId":"invitem_length","fltSleepsId":"invitem_sleeps"},"dbkeys":{"fieldsearch":0,"id":1,"excluded":2,"styleid":3,"geolocation":38,"category":5,"clearance":6,"lowconsumption":7,"certified":8,"asis":9,"cuvapproved":10,"cuvcertified":11,"autocancpo":12,"autocanacc":13,"autocanviv":14,"bodytype":15,"subbodytype":16,"floorplan":17,"transmission":18,"carburant":19,color:20,"option":21,"arrivals":22,"trims":23,"dealers":24,"regions":25,"drivetrain":26,"doors":27,"seats":28,"engine":29,"cylinders":30,"package":31,"delivery":32,"typecertification":33,"price":34,"year":35,"mileage":36,"dpayment":37,"dealerlocator":39,"electricrange":40,"batteryenergy":41,"truckbedlen":42,"towingcpc":43,"invitem_weight":44,"invitem_length":45,"invitem_sleeps":46,"make":47,"model":48},"db":[[0,14342546,0,423963,0,0,,,,,,,,,,[1],0,,0,0,6,[13,6,9,4,12,1,2,0,8],,58,0,0,3,1,1,0,0,0,0,0,39883,2022,24252,0,0,0,0,0,0,0,0,0,0,0,0],[0,14387825,0,461110,0,0,,,,,,,,,,[5],0,,0,0,4,[13,6,9,12,1,2,0,8],[2],56,0,0,3,1,3,0,0,0,0,0,51883,2025,14824,0,0,0,0,0,0,0,0,0,0,1,1],[0,14434264,0,407997,0,0,,,,,,,,,,[7],0,,0,0,0,[13,9,12,1,2,0],[1,2],13,0,0,3,1,1,0,0,0,0,0,24883,2020,72361,0,0,0,0,0,0,0,0,0,0,2,2],[0,14434265,0,403682,0,0,,,,,,,,,,[3],0,,0,0,2,[13,9,1,0],[1,2],34,0,0,2,1,2,0,0,0,0,0,30883,2019,152964,0,0,0,0,0,0,0,0,0,0,2,3],[0,14449845,0,429152,0,0,,,,,,,,,,[3],0,,0,0,0,[9,1,0],[1,2],43,0,0,2,1,2,0,0,0,0,0,39883,2023,113806,0,0,0,0,0,0,0,0,0,0,3,4],[0,14421189,0,404273,0,0,,,,,,,,,,[7],0,,0,0,0,[13,9,1],[1,2],11,0,0,4,1,1,0,0,0,0,0,26883,2019,123583,0,0,0,0,0,0,0,0,0,0,4,5],[0,14288379,0,433441,0,0,,,,,,,,,,[7],0,,0,0,4,[13,6,9,4,12,1,2,0],,46,0,0,3,1,1,0,0,0,0,0,47883,2023,71371,0,0,0,0,0,0,0,0,0,0,4,6],[0,14480174,0,383172,0,0,,,,,,,,,,[1],0,,0,0,0,[9,2,1,13,12],[0,1,2],1,0,0,0,1,1,0,0,0,0,0,13883,2017,135355,0,0,0,0,0,0,0,0,0,0,5,7],[0,14393925,0,364839,0,0,,,,,,,,,,[7],0,,0,0,2,[13,9,4,12,1,2,0],[2],28,0,0,3,1,1,0,0,0,0,0,15883,2014,160981,0,0,0,0,0,0,0,0,0,0,5,8],[0,14387822,0,404599,0,0,,,,,,,,,,[7],0,,0,0,3,[13,9,1],[2],10,0,0,3,1,1,0,0,0,0,0,18883,2019,127679,0,0,0,0,0,0,0,0,0,0,5,9],[0,14381219,0,482589,0,0,,,,,,,,,,[7],0,,0,0,0,[13,9,12,1],[2],76,0,0,2,1,1,0,0,0,0,0,94883,2024,22194,0,0,0,0,0,0,0,0,0,0,6,10],[0,14387824,0,416337,0,0,,,,,,,,,,[7],0,,0,0,1,[13,9,4,12,1,0],[2],18,0,0,2,1,1,0,0,0,0,0,29883,2021,44072,0,0,0,0,0,0,0,0,0,0,7,11],[0,14387821,0,444072,0,0,,,,,,,,,,[7],0,,0,0,3,[13,6,9,12,1,2,0,8],[2],67,0,0,2,1,1,0,0,0,0,0,46883,2024,50371,0,0,0,0,0,0,0,0,0,0,7,12],[0,14387827,0,455174,0,0,,,,,,,,,,[7],0,,0,0,1,[13,9,1,0,8],[2],60,0,0,2,1,1,0,0,0,0,0,47883,2024,27268,0,0,0,0,0,0,0,0,0,0,7,12],[0,14434263,0,409919,0,0,,[0],,,,,,,,[1],0,,0,0,1,[13,9,2,12,1,0],[1,2],3,0,0,0,1,1,0,0,0,0,0,15883,2020,126751,0,0,0,0,0,0,0,0,0,0,8,13],[0,14400425,0,401370,0,0,,,,,,,,,,[2],0,,0,0,2,[9,12,1,0],[2],0,0,0,0,1,1,0,0,0,0,0,16883,2019,112891,0,0,0,0,0,0,0,0,0,0,8,14],[0,14366850,0,397319,0,0,,,,,,,,,,[1],0,,0,0,0,[13,4,2,12,1],[2],40,0,0,4,1,1,0,0,0,0,0,28883,2018,114897,0,0,0,0,0,0,0,0,0,0,8,15],[0,14400424,0,410863,0,0,,,,,,,,,,[7],0,,0,0,3,[13,4,12,1,2],[2],77,0,0,2,1,4,0,0,0,0,0,89883,2020,60247,0,0,0,0,0,0,0,0,0,0,9,16],[0,13858953,0,408623,0,0,,,,,,,,,,[7],0,,0,0,0,[13,6,9,12,1,0],,50,0,0,3,1,1,0,0,0,0,0,36883,2020,92746,0,0,0,0,0,0,0,0,0,0,9,17],[0,14449847,
4760,417631,0,0,,,,,,,,,,[7],0,,0,0,3,[13,6,9,12,1,0],[1,2],50,0,0,3,1,1,0,0,0,0,0,45883,2021,93315,0,0,0,0,0,0,0,0,0,0,9,17],[0,14480170,0,395977,0,0,,,,,,,,,,[1],0,,0,0,0,[13,6,9,12,1,0],[0,1,2],7,0,0,0,1,1,0,0,0,0,0,18883,2018,45715,0,0,0,0,0,0,0,0,0,0,10,18],[0,14456804,0,430716,0,0,,,,,,,,,,[7],0,,0,0,3,[13,6,9,4,12,1,2,8],[1,2],31,0,0,3,1,1,0,0,0,0,0,33883,2023,82070,0,0,0,0,0,0,0,0,0,0,10,19],[0,14421188,0,401891,0,0,,,,,,,,,,[7],0,,0,0,1,[13,9,1],[1,2],9,0,0,3,1,1,0,0,0,0,0,30883,2019,69517,0,0,0,0,0,0,0,0,0,0,11,20],[0,14421190,0,439711,0,0,,,,,,,,,,[7],0,,0,0,0,[13,9,4,2,12,1,0,8],[1,2],23,0,0,3,1,1,0,0,0,0,0,40883,2024,26390,0,0,0,0,0,0,0,0,0,0,11,21],[0,14486705,0,381317,0,0,,,,,,,,,,[7],0,,0,0,1,[13,9,12,1,0],[0,1,2],32,0,0,2,1,1,0,0,0,0,0,38883,2016,115592,0,0,0,0,0,0,0,0,0,0,12,22],[0,14456805,0,410616,0,0,,,[0],,,,,,,[7],0,,0,0,0,[13,9,12],[1,2],38,0,0,2,1,1,0,0,0,0,1,38883,2020,172462,0,0,0,0,0,0,0,0,0,0,12,22],[0,14348905,0,467866,0,0,,,[0],,,,,,,[7],0,,0,2,3,[13,9,12,1],,68,0,0,2,1,1,0,0,0,0,1,92883,2025,24356,0,0,0,0,0,0,0,0,0,0,12,22],[0,14300264,0,481663,0,2,,,,,,,,,,[7],0,,0,0,0,[13,6,9,12,1,2,0],,49,0,0,2,1,3,0,0,0,0,0,0,2026,6,0,0,0,0,0,0,0,0,0,0,12,22],[0,14300269,0,481663,0,2,,,,,,,,,,[7],0,,0,0,3,[13,6,9,12,1,2,0],,49,0,0,2,1,3,0,0,0,0,0,0,2026,4,0,0,0,0,0,0,0,0,0,0,12,22],[0,14449844,0,481663,0,2,,,,,,,,,,[7],0,,0,0,0,[13,6,9,12,1,2,0],[1,2],49,0,0,2,1,3,0,0,0,0,0,0,2026,8,0,0,0,0,0,0,0,0,0,0,12,22],[0,14486695,0,481663,0,2,,,,,,,,,,[7],0,,0,0,3,[13,6,9,12,1,2,0],[0,1,2],49,0,0,2,1,3,0,0,0,0,0,0,2026,4,0,0,0,0,0,0,0,0,0,0,12,22],[0,14491632,0,481663,0,2,,,,,,,,,,[7],0,,0,0,4,[13,6,9,12,1,2,0],[0,1,2],49,0,0,2,1,3,0,0,0,0,0,0,2026,7,0,0,0,0,0,0,0,0,0,0,12,22],[0,14347220,0,483907,0,2,,,,,,,,,,[7],0,,0,1,0,[13,9,12,1,2,0,8],,59,0,0,3,1,1,0,0,0,0,0,0,2026,2,0,0,0,452,74.7,0,0,0,0,0,12,23],[0,13899766,0,478145,0,2,,[0],,,,,,,,[1],0,,0,2,1,[13,9,4,2,12,1,0,8],,36,0,0,3,1,1,0,0,0,0,0,0,2026,5,0,0,0,0,0,0,0,0,0,0,12,24],[0,14288371,0,478143,0,2,,[0],,,,,,,,[1],0,,0,2,3,[13,9,12,1,2,0,8],,16,0,0,0,1,1,0,0,0,0,0,0,2026,5,0,0,0,0,0,0,0,0,0,0,12,24],[0,14372009,0,478146,0,2,,[0],,,,,,,,[1],0,,0,2,1,[13,9,4,2,12,1,0,8],[2],37,0,0,3,1,1,0,0,0,0,0,0,2026,4,0,0,0,0,0,0,0,0,0,0,12,24],[0,14491629,0,478146,0,2,,[0],,,,,,,,[1],0,,0,2,1,[13,9,4,2,12,1,0,8],[0,1,2],37,0,0,3,1,1,0,0,0,0,0,0,2026,6,0,0,0,0,0,0,0,0,0,0,12,24],[0,14449846,0,372355,0,0,,,,,,,,,,[1],0,,0,0,0,[13,9,1,0],[1,2],2,0,0,0,1,1,0,0,0,0,0,16883,2015,181072,0,0,0,0,0,0,0,0,0,0,12,25],[0,11741650,0,463470,0,2,,[0],,,,,,,,[1],0,,0,0,2,[13,9,12,1,2,0],,6,0,0,0,1,1,0,0,0,0,0,0,2025,1,0,0,0,0,0,0,0,0,0,0,12,25],[0,13684327,0,478211,0,2,,[0],,,,,,,,[1],0,,0,0,1,[13,9,12,1,2,0,8],,8,0,0,0,1,1,0,0,0,0,0,0,2026,2,0,0,0,0,0,0,0,0,0,0,12,25],[0,14080384,0,478212,0,2,,[0],,,,,,,,[1],0,,0,0,1,[13,9,12,1,2,0,8],,15,0,0,0,1,1,0,0,0,0,0,0,2026,8,0,0,0,0,0,0,0,0,0,0,12,25],[0,14179854,0,478212,0,2,,[0],,,,,,,,[1],0,,0,0,1,[13,9,12,1,2,0,8],,15,0,0,0,1,1,0,0,0,0,0,0,2026,1,0,0,0,0,0,0,0,0,0,0,12,25],[0,14355709,0,478211,0,2,,[0],,,,,,,,[1],0,,0,0,6,[13,9,12,1,2,0,8],[2],8,0,0,0,1,1,0,0,0,0,0,0,2026,7,0,0,0,0,0,0,0,0,0,0,12,25],[0,14387820,0,478210,0,2,,[0],,,,,,,,[1],0,,0,0,4,[13,9,12,1,2,0],[2],6,0,0,0,1,1,0,0,0,0,0,0,2026,1,0,0,0,0,0,0,0,0,0,0,12,25],[0,14486692,0,478209,0,2,,[0],,,,,,,,[1],0,,0,0,0,[13,9,12,1,0],[0,1,2],4,0,0,0,1,1,0,0,0,0,0,0,2026,4,0,0,0,0,0,0,0,0,0,0,12,25],[0,14212309,0,477378,0,2,,,,,,,,,,[7],0,,0,0,2,[13,9,12,1,2,0,8],,12,0,0,0,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,26],[0,13468763,0,479663,0,2,,[0],,,,,,,,[2],0,,0,0,4,[13,9,12,1,0],,5,0,0,0,1,1,0,0,0,0,0,0,2026,2,0,0,0,0,0,0,0,0,0,0,12,27],[0,13695591,0,479663,0,2,,[0],,,,,,,,[2],0,,0,0,3,[13,9,12,1,0],,5,0,0,0,1,1,0,0,0,0,0,0,2026,1,0,0,0,0,0,0,0,0,0,0,12,27],[0,13830609,0,479663,0,2,,[0],,,,,,,,[2],0,,0,0,3,[13,9,12,1,0],,5,0,0,0,1,1,0,0,0,0,0,0,2026,1,0,0,0,0,0,0,0,0,0,0,12,27],[0,14293921,0,487277,0,2,,[0],,,,,,,,[2],0,,0,0,6,[13,9,12,1,0],,5,0,0,0,1,1,0,0,0,0,0,0,2027,5,0,0,0,0,0,0,0,0,0,0,12,27],[0,14440128,0,487277,0,2,,[0],,,,,,,,[2],0,,0,0,6,[13,9,12,1,0],[1,2],5,0,0,0,1,1,0,0,0,0,0,0,2027,2,0,0,0,0,0,0,0,0,0,0,12,27],[0,14486696,0,487277,0,2,,[0],,,,,,,,[2],0,,0,0,0,[13,9,12,1,0],[0,1,2],5,0,0,0,1,1,0,0,0,0,0,0,2027,5,0,0,0,0,0,0,0,0,0,0,12,27],[0,14486699,0,487277,0,2,,[0],,,,,,,,[2],0,,0,0,2,[13,9,12,1,0],[0,1,2],5,0,0,0,1,1,0,0,0,0,0,0,2027,2,0,0,0,0,0,0,0,0,0,0,12,27],[0,14117775,0,481525,0,2,,,,,,,,,,[7],0,,0,2,1,[13,9,4,2,12,1,0,8],,55,0,0,3,1,1,0,0,0,0,0,0,2026,5,0,0,0,0,0,0,0,0,0,0,12,28],[0,14300263,0,481525,0,2,,,,,,,,,,[7],0,,0,2,1,[13,9,4,2,12,1,0,8],,55,0,0,3,1,1,0,0,0,0,0,0,2026,5,0,0,0,0,0,0,0,0,0,0,12,28],[0,14300267,0,481525,0,2,,,,,,,,,,[7],0,,0,2,0,[13,9,4,2,12,1,0,8],,55,0,0,3,1,1,0,0,0,0,0,0,2026,4,0,0,0,0,0,0,0,0,0,0,12,28],[0,14300270,0,481525,0,2,,,,,,,,,,[7],0,,0,2,3,[13,9,4,2,12,1,0,8],,55,0,0,3,1,1,0,0,0,0,0,0,2026,4,0,0,0,0,0,0,0,0,0,0,12,28],[0,14491635,0,481525,0,2,,,,,,,,,,[7],0,,0,2,3,[13,9,4,2,12,1,0,8],[0,1,2],55,0,0,3,1,1,0,0,0,0,0,0,2026,8,0,0,0,0,0,0,0,0,0,0,12,28],[0,14322527,0,464583,0,0,,,[0],,,,,,,[2],0,,1,0,3,[13,9,12,1,0],,39,0,0,3,1,1,0,0,0,0,1,51883,2025,28891,0,0,0,0,0,0,0,0,0,0,12,29],[0,1417985
4767,0,480993,0,2,,,,,,,,,,[2],0,,1,0,1,[13,9,12,1,2,0,8],,42,0,0,3,1,1,0,0,0,0,0,0,2026,1,0,0,0,0,0,0,0,0,0,0,12,29],[0,14288367,0,480993,0,2,,,,,,,,,,[2],0,,1,0,1,[13,9,12,1,2,0,8],,42,0,0,3,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,29],[0,14300260,0,480993,0,2,,,,,,,,,,[2],0,,0,0,3,[13,9,12,1,2,0,8],,42,0,0,3,1,1,0,0,0,0,0,0,2026,16,0,0,0,0,0,0,0,0,0,0,12,29],[0,12722374,0,464564,0,2,,,,,,,,,,[1],0,,0,0,4,[13,9,4,12,1,2,0],,22,0,0,1,0,0,0,0,0,0,0,0,2025,10,0,0,0,0,0,0,0,0,0,0,12,30],[0,14405847,0,417887,0,0,,,[0],,,,,,,[7],0,,0,0,6,[13,9,12,1,2,0],[2],45,0,0,3,1,3,0,0,0,0,1,42883,2021,105745,0,0,0,0,0,0,0,0,0,0,12,31],[0,14375179,0,424864,0,0,,,[0],,,,,,,[7],0,,0,0,6,[13,9,4,2,12,1,0,8],[2],48,0,0,3,1,3,0,0,0,0,1,48883,2022,92990,0,0,0,0,0,0,0,0,0,0,12,31],[0,14348906,0,433707,0,0,,,[0],,,,,,,[7],0,,0,0,3,[13,9,12,1,2,0],,41,0,0,3,1,3,0,0,0,0,1,50883,2023,84956,0,0,0,0,0,0,0,0,0,0,12,31],[0,14400426,0,433756,0,0,,,[0],,,,,,,[7],0,,0,2,0,[13,9,12,1,2,0],[2],44,0,0,3,1,3,0,0,0,0,1,51883,2023,99480,0,0,0,0,0,0,0,0,0,0,12,31],[0,14387826,0,447122,0,0,,,[0],,,,,,,[7],0,,0,0,2,[13,9,12,1,2,0],[2],41,0,0,3,1,3,0,0,0,0,1,49883,2024,63099,0,0,0,0,0,0,0,0,0,0,12,31],[0,14421191,0,447123,0,0,,,[0],,,,,,,[7],0,,0,0,3,[13,9,12,1,2,0],[1,2],45,0,0,3,1,3,0,0,0,0,1,48883,2024,68944,0,0,0,0,0,0,0,0,0,0,12,31],[0,14322525,0,479795,0,2,,,,,,,,,,[7],0,,0,2,1,[13,6,9,4,2,12,1,0,8],,64,0,0,3,1,3,0,0,0,0,0,0,2026,6,0,0,0,0,0,0,0,0,0,0,12,31],[0,14470726,0,478419,0,0,,,[0],,,,,,,[7],0,,0,0,1,[13,9,12,1,2,0],[0,1,2],41,0,0,3,1,3,0,0,0,0,1,68883,2026,33607,0,0,0,0,0,0,0,0,0,0,12,31],[0,13891592,0,452411,0,0,,,[0],,,,,,,[7],0,,0,2,0,[13,9,12,1,2,0,8],,70,0,0,2,1,1,0,0,0,0,1,72883,2024,46680,0,0,0,0,0,0,0,0,0,0,12,32],[0,14442557,0,480063,0,0,,,[0],,,,,,,[7],0,,0,2,0,[2,1,0,13,8,12],[1,2],70,0,0,2,1,1,0,0,0,0,1,98883,2026,4400,0,0,0,0,0,0,0,0,0,0,12,32],[0,14342545,0,484183,0,2,,,,,,,,,,[7],0,,0,2,4,[13,9,2,12,1,0,8],,70,0,0,2,1,1,0,0,0,0,0,0,2027,2,0,0,0,0,0,0,0,0,0,0,12,32],[0,14355703,0,484183,0,2,,,,,,,,,,[7],0,,0,2,3,[13,9,2,12,1,0,8],[2],70,0,0,2,1,1,0,0,0,0,0,0,2027,5,0,0,0,0,0,0,0,0,0,0,12,32],[0,13441502,0,477189,0,2,,[0],,,,,,,,[2],0,,0,2,6,[13,9,2,12,1,0,8],,33,0,0,3,1,1,0,0,0,0,0,0,2026,8,0,0,0,0,0,0,0,0,0,0,12,33],[0,14306236,0,487212,0,2,,[0],,,,,,,,[2],0,,0,2,0,[13,9,12,1,2,0,8],,26,0,0,3,1,1,0,0,0,0,0,0,2027,7,0,0,0,0,0,0,0,0,0,0,12,33],[0,14288373,0,487298,0,2,,[0],,,,,,,,[2],0,,0,2,3,[13,9,12,1,2,0,8],,35,0,0,0,1,1,0,0,0,0,0,0,2027,6,0,0,0,0,0,0,0,0,0,0,12,34],[0,14342542,0,487298,0,2,,[0],,,,,,,,[2],0,,0,2,4,[13,9,12,1,2,0,8],,35,0,0,0,1,1,0,0,0,0,0,0,2027,0,0,0,0,0,0,0,0,0,0,0,12,34],[0,14440129,0,487297,0,2,,[0],,,,,,,,[2],0,,0,2,1,[13,9,12,1,2,0,8],[1,2],30,0,0,0,1,1,0,0,0,0,0,0,2027,2,0,0,0,0,0,0,0,0,0,0,12,34],[0,14491638,0,487298,0,2,,[0],,,,,,,,[2],0,,0,2,6,[13,9,12,1,2,0,8],[0,1,2],35,0,0,0,1,1,0,0,0,0,0,0,2027,8,0,0,0,0,0,0,0,0,0,0,12,34],[0,14415189,0,411454,0,0,,,[0],,,,,,,[7],0,,0,0,0,[13,9,12,1],[2],25,0,0,3,1,1,0,0,0,0,1,30883,2020,161668,0,0,0,0,0,0,0,0,0,0,12,35],[0,14480169,0,411452,0,0,,,[0],,,,,,,[7],0,,0,0,3,[13,9,12,1],[0,1,2],14,0,0,4,1,1,0,0,0,0,1,27883,2020,167889,0,0,0,0,0,0,0,0,0,0,12,35],[0,14148623,0,425884,0,0,,,[0],,,,,,,[7],0,,0,0,1,[9,1,13,12],,14,0,0,4,1,1,0,0,0,0,1,26883,2022,186345,0,0,0,0,0,0,0,0,0,0,12,35],[0,14440130,0,425885,0,0,,,[0],,,,,,,[7],0,,0,0,4,[9,1,0,13,12],[1,2],27,0,0,3,1,1,0,0,0,0,1,34883,2022,104013,0,0,0,0,0,0,0,0,0,0,12,35],[0,14480172,0,445212,0,0,,,[0],,,,,,,[7],0,,0,0,2,[13,9,12,1,0],[0,1,2],14,0,0,4,1,1,0,0,0,0,1,43883,2024,8655,0,0,0,0,0,0,0,0,0,0,12,35],[0,14400427,0,464668,0,0,,,[0],,,,,,,[7],0,,0,2,3,[13,9,12,1,0],[2],29,0,0,3,1,1,0,0,0,0,1,49883,2025,31812,0,0,0,0,0,0,0,0,0,0,12,35],[0,14456803,0,464472,0,0,,,[0],,,,,,,[7],0,,0,0,3,[13,9,12,1,0],[1,2],14,0,0,3,1,1,0,0,0,0,1,40883,2025,9710,0,0,0,0,0,0,0,0,0,0,12,35],[0,14480171,0,464472,0,0,,,[0],,,,,,,[7],0,,0,0,0,[13,9,12,1,0],[0,1,2],14,0,0,3,1,1,0,0,0,0,1,43883,2025,22906,0,0,0,0,0,0,0,0,0,0,12,35],[0,14486704,0,482277,0,2,,,,,,,,,,[7],0,,0,2,3,[13,6,9,2,12,1,0,8],[0,1,2],47,0,0,3,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,35],[0,14491637,0,482276,0,2,,,,,,,,,,[7],0,,0,2,1,[13,6,9,12,1,2,0,8],[0,1,2],27,0,0,3,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,35],[0,14491639,0,482276,0,2,,,,,,,,,,[7],0,,0,2,4,[13,6,9,12,1,2,0,8],[0,1,2],27,0,0,3,1,1,0,0,0,0,0,0,2026,6,0,0,0,0,0,0,0,0,0,0,12,35],[0,14456806,0,381826,0,0,,,,,,,,,,[7],0,,0,2,0,[13,9,12,1,2,0],[1,2],24,0,0,3,1,1,0,0,0,0,0,18883,2016,250889,0,0,0,0,0,0,0,0,0,0,12,36],[0,14300259,0,482978,0,2,,,,,,,,,,[7],0,,0,2,0,[13,6,9,2,12,1,0,8],,51,0,0,3,1,1,0,0,0,0,0,0,2026,385,0,0,0,0,0,0,0,0,0,0,12,37],[0,14456802,0,482977,0,2,,,,,,,,,,[7],0,,0,2,6,[13,6,9,12,1,2,0,8],[1,2],52,0,0,3,1,1,0,0,0,0,0,0,2026,11,0,0,0,0,0,0,0,0,0,0,12,37],[0,14491630,0,482978,0,2,,,,,,,,,,[7],0,,0,2,0,[13,6,9,2,12,1,0,8],[0,1,2],51,0,0,3,1,1,0,0,0,0,0,0,2026,8,0,0,0,0,0,0,0,0,0,0,12,37],[0,14491640,0,405443,0,0,,,[0],,,,,,,[5],0,,0,0,1,[13,9,1,0],[0,1,2],17,0,0,0,1,3,0,0,0,0,1,36883,2020,78463,0,0,0,0,0,0,0,0,0,0,12,38],[0,14486703,0,481304,0,2,,,,,,,,,,[5],0,,0,2,6,[13,6,9,4,2,12,1,0,8],[0,1,2],69,0,0,3,1,3,0,0,0,0,0,0,2026,5,0,0,0,0,0,0,0,0,0,0,12,38],[0,14491631,0,481304,0,2,,,,,,,,,,[5],0,,0,2,3,[13,6,9,4,2,12,1,0,8],[0,1,2],69,0,0,3,1,3,0,0,0,0,0,0,2026,4,0,0,0,0,0,0,0,0,0,0,12,38],[0,13617273,0,448682,0,0,,,[0],,,,,,,[3],0,,0,0,3,[13,9,12,1,0],,53,0,0,2,1,1,0,0,0,0,1,73883,2024,12947,0,0,0,0,0,0,0,0,0,0,12,39],[0,12114
476127,0,464966,0,2,,,,,,,,,,[3],0,,0,2,9,[13,9,2,12,1,0,8],,66,0,0,2,1,1,0,0,0,0,0,0,2025,5,0,0,0,0,0,0,0,0,0,0,12,39],[0,13156952,0,464966,0,2,,,,,,,,,,[3],0,,0,2,3,[13,9,2,12,1,8],,66,0,0,2,1,1,0,0,0,0,0,0,2025,5,0,0,0,0,0,0,0,0,0,0,12,39],[0,13617272,0,464964,0,0,,,[0],,,,,,,[3],0,,0,0,2,[13,9,12,1,0],,61,0,0,2,1,1,0,0,0,0,1,65883,2025,8,0,0,0,0,0,0,0,0,0,0,12,39],[0,13665086,0,464966,0,0,,,[0],,,,,,,[3],0,,0,2,3,[13,9,12,1,0],,66,0,0,2,1,1,0,0,0,0,1,74883,2025,16711,0,0,0,0,0,0,0,0,0,0,12,39],[0,13943908,0,464964,0,0,,,[0],,,,,,,[3],0,,0,0,4,[13,9,12,1,0],,62,0,0,2,1,1,0,0,0,0,1,62883,2025,8865,0,0,0,0,0,0,0,0,0,0,12,39],[0,13987047,0,464964,0,0,,,[0],,,,,,,[3],0,,0,0,2,[13,9,12,1,0],,63,0,0,2,1,1,0,0,0,0,1,56883,2025,4290,0,0,0,0,0,0,0,0,0,0,12,39],[0,14232918,0,464966,0,0,,,[0],,,,,,,[3],0,,0,2,4,[13,9,12,1,0],,66,0,0,2,1,1,0,0,0,0,1,69883,2025,18909,0,0,0,0,0,0,0,0,0,0,12,39],[0,13654042,0,481043,0,2,,,,,,,,,,[3],0,,0,0,1,[13,9,1,2],,65,0,0,2,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,39],[0,13675235,0,481043,0,2,,,,,,,,,,[3],0,,0,0,1,[13,9,1,2],,65,0,0,2,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,39],[0,13684326,0,481045,0,2,,,,,,,,,,[3],0,,0,2,3,[13,9,2,1,8],,66,0,0,2,1,1,0,0,0,0,0,0,2026,7,0,0,0,0,0,0,0,0,0,0,12,39],[0,13748121,0,481043,0,2,,,,,,,,,,[3],0,,0,0,6,[13,9,1,2],,65,0,0,2,1,1,0,0,0,0,0,0,2026,2,0,0,0,0,0,0,0,0,0,0,12,39],[0,13781093,0,481045,0,2,,,,,,,,,,[3],0,,0,2,10,[13,9,2,1,8],,66,0,0,2,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,39],[0,13818423,0,481045,0,2,,,,,,,,,,[3],0,,0,2,3,[13,9,2,1,8],,66,0,0,2,1,1,0,0,0,0,0,0,2026,2,0,0,0,0,0,0,0,0,0,0,12,39],[0,13846247,0,481043,0,2,,,,,,,,,,[3],0,,0,0,1,[13,9,1,2],,65,0,0,2,1,1,0,0,0,0,0,0,2026,2,0,0,0,0,0,0,0,0,0,0,12,39],[0,14014112,0,481043,0,2,,,,,,,,,,[3],0,,0,0,1,[13,9,1,2],,65,0,0,2,1,1,0,0,0,0,0,0,2026,2,0,0,0,0,0,0,0,0,0,0,12,39],[0,14190468,0,481043,0,2,,,,,,,,,,[3],0,,0,0,0,[13,9,1,2],,65,0,0,2,1,1,0,0,0,0,0,0,2026,2,0,0,0,0,0,0,0,0,0,0,12,39],[0,14190471,0,481045,0,2,,,,,,,,,,[3],0,,0,2,1,[13,9,2,1,8],,66,0,0,2,1,1,0,0,0,0,0,0,2026,1,0,0,0,0,0,0,0,0,0,0,12,39],[0,14212311,0,481043,0,2,,,,,,,,,,[3],0,,0,0,1,[13,9,1,2],,65,0,0,2,1,1,0,0,0,0,0,0,2026,14,0,0,0,0,0,0,0,0,0,0,12,39],[0,14212312,0,481043,0,2,,,,,,,,,,[3],0,,0,0,3,[13,9,1,2],,65,0,0,2,1,1,0,0,0,0,0,0,2026,2,0,0,0,0,0,0,0,0,0,0,12,39],[0,14227297,0,481045,0,2,,,,,,,,,,[3],0,,0,2,6,[13,9,2,1,8],,66,0,0,2,1,1,0,0,0,0,0,0,2026,5,0,0,0,0,0,0,0,0,0,0,12,39],[0,14280459,0,481043,0,2,,,,,,,,,,[3],0,,0,0,1,[13,9,1,2],,65,0,0,2,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,39],[0,14288376,0,481045,0,2,,,,,,,,,,[3],0,,0,2,3,[13,9,2,1,8],,66,0,0,2,1,1,0,0,0,0,0,0,2026,5,0,0,0,0,0,0,0,0,0,0,12,39],[0,14312188,0,481043,0,2,,,,,,,,,,[3],0,,0,0,0,[13,9,1,2],,65,0,0,2,1,1,0,0,0,0,0,0,2026,0,0,0,0,0,0,0,0,0,0,0,12,39],[0,14312189,0,481043,0,2,,,,,,,,,,[3],0,,0,0,0,[13,9,1,2],,65,0,0,2,1,1,0,0,0,0,0,0,2026,2,0,0,0,0,0,0,0,0,0,0,12,39],[0,14335833,0,481045,0,2,,,,,,,,,,[3],0,,0,2,6,[13,9,2,1,8],,66,0,0,2,1,1,0,0,0,0,0,0,2026,1,0,0,0,0,0,0,0,0,0,0,12,39],[0,14335834,0,481045,0,2,,,,,,,,,,[3],0,,0,2,3,[13,9,2,1,8],,66,0,0,2,1,1,0,0,0,0,0,0,2026,6,0,0,0,0,0,0,0,0,0,0,12,39],[0,14342543,0,481045,0,2,,,,,,,,,,[3],0,,0,2,0,[13,9,2,1,8],,66,0,0,2,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,39],[0,14347219,0,481043,0,2,,,,,,,,,,[3],0,,0,0,0,[13,9,1,2],,65,0,0,2,1,1,0,0,0,0,0,0,2026,1,0,0,0,0,0,0,0,0,0,0,12,39],[0,14355707,0,481043,0,2,,,,,,,,,,[3],0,,0,0,9,[13,9,1,2],[2],65,0,0,2,1,1,0,0,0,0,0,0,2026,2,0,0,0,0,0,0,0,0,0,0,12,39],[0,14372008,0,481043,0,2,,,,,,,,,,[3],0,,0,0,0,[13,9,1,2],[2],65,0,0,2,1,1,0,0,0,0,0,0,2026,7,0,0,0,0,0,0,0,0,0,0,12,39],[0,14372010,0,481043,0,2,,,,,,,,,,[3],0,,0,0,2,[13,9,1,2],[2],65,0,0,2,1,1,0,0,0,0,0,0,2026,2,0,0,0,0,0,0,0,0,0,0,12,39],[0,14381218,0,481045,0,2,,,,,,,,,,[3],0,,0,2,0,[13,9,2,1,8],[2],66,0,0,2,1,1,0,0,0,0,0,0,2026,7,0,0,0,0,0,0,0,0,0,0,12,39],[0,14486693,0,481043,0,2,,,,,,,,,,[3],0,,0,0,0,[13,9,1,2],[0,1,2],65,0,0,2,1,1,0,0,0,0,0,0,2026,2,0,0,0,0,0,0,0,0,0,0,12,39],[0,14486694,0,481045,0,2,,,,,,,,,,[3],0,,0,2,0,[13,9,2,1,8],[0,1,2],66,0,0,2,1,1,0,0,0,0,0,0,2026,2,0,0,0,0,0,0,0,0,0,0,12,39],[0,14486702,0,481043,0,2,,,,,,,,,,[3],0,,0,0,1,[13,9,1,2],[0,1,2],65,0,0,2,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,39],[0,14491633,0,481043,0,2,,,,,,,,,,[3],0,,0,0,1,[13,9,1,2],[0,1,2],65,0,0,2,1,1,0,0,0,0,0,0,2026,1,0,0,0,0,0,0,0,0,0,0,12,39],[0,14491636,0,481045,0,2,,,,,,,,,,[3],0,,0,2,1,[13,9,2,1,8],[0,1,2],66,0,0,2,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,39],[0,14405846,0,395702,0,0,,,,,,,,,,[3],0,,0,0,6,[13,9,4,2,12,1,0],[2],73,0,0,2,1,1,0,0,0,0,0,30883,2018,261743,0,0,0,0,0,0,0,0,0,0,12,40],[0,14179858,0,433671,0,0,,,[0],,,,,,,[3],0,,0,0,3,[13,9,12,1,0],,57,0,0,2,1,1,0,0,0,0,1,49883,2023,87372,0,0,0,0,0,0,0,0,0,0,12,40],[0,14179859,0,433671,0,0,,,[0],,,,,,,[3],0,,0,0,3,[13,9,12,1,0],,57,0,0,2,1,1,0,0,0,0,1,49883,2023,94403,0,0,0,0,0,0,0,0,0,0,12,40],[0,14190472,0,433671,0,0,,,[0],,,,,,,[3],0,,0,0,3,[13,9,12,1,0],,57,0,0,2,1,1,0,0,0,0,1,48883,2023,118812,0,0,0,0,0,0,0,0,0,0,12,40],[0,14232919,0,433673,0,0,,,[0],,,,,,,[3],0,,0,0,2,[13,9,4,2,12,1,0,8],,73,0,0,2,1,1,0,0,0,0,1,78883,2023,31230,0,0,0,0,0,0,0,0,0,0,12,40],[0,11508508,0,464431,0,2,,,,,,,,,,[3],0,,0,0,1,[13,6,9,12,1,0],,54,0,0,2,1,1,0,0,0,0,0,0,2025,2,0,0,0,0,0,0,0,0,0,0,12,40],[0,12801610,0,464262,0,2,,,,,,,,,,[3],0,,0,2,0,[13,6,9,2,12,1,0,8],,72,0,0,2,1,1,0,0,0,0,0,0,2025,3,0,0,0,0,0,0,0,0,0,0,12,40],[0,12850087,0,464437,0,2,,,,,,,,,,[3],0,,0,0,1,[13,6,9,2,12,1,0,8],,71,0,0,2,1,1,0,0,0,0,0,0,2025,3,0,0,0,0,0,0,0,0,0,0,12,40],[0,13938150,0,464262,0,0,,,[0],,,,,,,[3],0,,0,2,3,[13,9,2,12,1,8],,72,0,0,2,1,1,0,0,0,0,1,78883,2025,12201,0,0,0,0,0,0,0,0,0,0,12,40],[0,12917121,0,478515,0,2,,,,,,,,,,[3],0,,0,0,0,[13,6,9,4,2,12,1,0,8],,73,0,0,2,1,1,0,0,0,0,0,0,2026,5,0,0,0,0,0,0,0,0,0,0,12,40],[0,13231459,0,478513,0,2,,,,,,,,,,[3],0,,0,0,1,[13,6,9,12,1,0],,54,0,0,2,1,1,0,0,0,0,0,0,2026,1,0,0,0,0,0,0,0,0,0,0,12,40],[0,13767263,0,478416,0,2,,,,,,,,,,[3],0,,0,2,6,[13,6,9,4,2,12,1,0,8],,74,0,0,2,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,40],[0,14179851,0,478515,0,2,,,,,,,,,,[3],0,,0,0,4,[13,6,9,4,2,12,1,0,8],,73,0,0,2,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,40],[0,14206959,0,478514,0,2,,,,,,,,,,[3],0,,0,0,4,[13,6,9,4,2,12,1,0,8],,71,0,0,2,1,1,0,0,0,0,0,0,2026,4,0,0,0,0,0,0,0,0,0,0,12,40],[0,14280464,0,478416,0,2,,,,,,,,,,[3],0,,0,2,1,[13,6,9,4,2,12,1,0,8],,74,0,0,2,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,40],[0,14280465,0,478514,0,2,,,,,,,,,,[3],0,,0,0,0,[13,6,9,4,2,12,1,0,8],,71,0,0,2,1,1,0,0,0,0,0,0,2026,4,0,0,0,0,0,0,0,0,0,0,12,40],[0,14288374,0,478415,0,2,,,,,,,,,,[3],0,,0,2,9,[13,6,9,4,2,12,1,0,8],,72,0,0,2,1,1,0,0,0,0,0,0,2026,2,0,0,0,0,0,0,0,0,0,0,12,40],[0,14300268,0,478511,0,2,,,,,,,,,,[3],0,,0,0,3,[13,6,9,12,1,0],,54,0,0,2,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,40],[0,14355699,0,478516,0,2,,,,,,,,,,[3],0,,0,0,0,[13,6,9,12,1,2,0,8],[2],5
4767,0,0,2,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,40],[0,14355711,0,478514,0,0,,,[0],,,,,,,[3],0,,0,0,3,[13,9,4,2,12,1,0],[2],71,0,0,2,1,1,0,0,0,0,1,86883,2026,19818,0,0,0,0,0,0,0,0,0,0,12,40],[0,14387823,0,478515,0,0,,,[0],,,,,,,[3],0,,0,0,3,[13,9,4,2,12,1,0,8],[2],73,0,0,2,1,1,0,0,0,0,1,86883,2026,17119,0,0,0,0,0,0,0,0,0,0,12,40],[0,14486697,0,478513,0,2,,,,,,,,,,[3],0,,0,0,1,[13,6,9,12,1,0],[0,1,2],54,0,0,2,1,1,0,0,0,0,0,0,2026,3,0,0,0,0,0,0,0,0,0,0,12,40],[0,14486698,0,478514,0,2,,,,,,,,,,[3],0,,0,0,3,[13,6,9,4,2,12,1,0,8],[0,1,2],71,0,0,2,1,1,0,0,0,0,0,0,2026,4,0,0,0,0,0,0,0,0,0,0,12,40],[0,14486700,0,478514,0,2,,,,,,,,,,[3],0,,0,0,3,[13,6,9,4,2,12,1,0,8],[0,1,2],71,0,0,2,1,1,0,0,0,0,0,0,2026,5,0,0,0,0,0,0,0,0,0,0,12,40],[0,14491634,0,478415,0,2,,,,,,,,,,[3],0,,0,2,3,[13,6,9,4,2,12,1,0,8],[0,1,2],72,0,0,2,1,1,0,0,0,0,0,0,2026,4,0,0,0,0,0,0,0,0,0,0,12,40],[0,14480173,0,448167,0,0,,,,,,,,,,[2],0,,1,0,1,[13,9,1,2,0,8],[0,1,2],20,0,0,0,1,1,0,0,0,0,0,38883,2024,21000,0,0,0,0,0,0,0,0,0,0,13,41],[0,14440131,0,421783,0,0,,,,,,,,,,[7],0,,0,0,4,[13,6,9,4,2,12,1,0,8],[1,2],19,0,0,3,1,1,0,0,0,0,0,25883,2022,70759,0,0,0,0,0,0,0,0,0,0,13,42],[0,14348907,0,384877,0,0,,,,,,,,,,[7],0,,0,0,15,[13,9,12,1,2],,21,0,0,4,1,1,0,0,0,0,0,20883,2017,137700,0,0,0,0,0,0,0,0,0,0,13,43],[0,14470725,0,476264,0,0,,,,,,,,,,[1],0,,0,2,15,[13,9,4,2,12,1,0,8],[0,1,2],75,0,0,3,1,3,0,0,0,0,0,67883,2026,41366,0,0,0,0,0,0,0,0,0,0,14,44]]},"isDealerInspire":false,"workerConf":{"keywordsJsonFile":"\/js\/usedsrp2\/filters.keywords.en.json","priorities":["fltClearanceId","fltLowConsumptionId","fltCertifiedId","fltAsIsId","fltCuvApprovedId","fltCuvCertifiedId","fltAutocanCpoId","fltAutocanAccId","fltAutocanVivId","fltCategorieId","fltCarosserieId","fltMakeId","fltModelId","fltColorId","fltTransmissionId","fltCarburantId","fltDriveTrainId","fltDoorsId","fltSeatsId","fltEngineId","fltCylindersId","fltPackageId","fltDeliveryId","fltTypeCertId"],"toIndex":["fltClearanceId","fltLowConsumptionId","fltCertifiedId","fltAsIsId","fltCuvApprovedId","fltCuvCertifiedId","fltAutocanCpoId","fltAutocanAccId","fltAutocanVivId","fltCategorieId","fltCarosserieId","fltSubBodyTypeId","fltFloorPlanId","fltMakeId","fltModelId","fltColorId","fltTransmissionId","fltCarburantId","fltOptionId","fltArrivalsId","fltTrimsId","fltDealersId","fltRegionsId","fltDriveTrainId","fltDoorsId","fltSeatsId","fltEngineId","fltCylindersId","fltPackageId","fltDeliveryId","fltTypeCertId"],"hasObject":["fltOptionId","fltFloorPlanId","fltArrivalsId","fltClearanceId","fltLowConsumptionId","fltCertifiedId","fltAsIsId","fltCuvApprovedId","fltCuvCertifiedId","fltAutocanCpoId","fltAutocanAccId","fltAutocanVivId"],"hasMultiDimension":["fltCarosserieId"],"noRsChildCount":[{"group":"fltMakeId","item":"fltModelId"},{"group":"fltModelId","item":"fltTrimsId"},{"group":"fltCarosserieId","item":"fltSubBodyTypeId"}]}}),sortcomponent:new SelectBox({debug:true,event:{"name":"Sort"},id:'fltSortId',selected:fd.getDataByKey('fltSortId')}),pagecomponent:new PaginationBox({debug:true,event:{"name":"Page"},id:'fltPageId',selected:fd.getDataByKey('fltPageId'),perpage:36}),geocomponent:null,locatorcomponent:null,filters:[{clear:true,component:new ListingBox({"event":{"name":"Certified"},"debug":true,"id":"fltCertifiedId","open":false,"tags":"notags checker","label":false,"disabelable":true,"xand":true,"parentcomponentid":"fltCategorieId","selected":fd.getDataByKey("fltCertifiedId"),})},{clear:true,component:new ListingBox({"event":{"name":"AsIs"},"debug":true,"id":"fltAsIsId","open":false,"tags":"notags checker","label":false,"disabelable":true,"xand":true,"parentcomponentid":"fltCategorieId","selected":fd.getDataByKey("fltAsIsId"),})},{component:new ListingBox({"event":{"name":"Clearance"},"debug":true,"id":"fltClearanceId","open":true,"tags":"notags checker","label":false,"disabelable":true,"xand":true,"parentcomponentid":"fltCategorieId","selected":fd.getDataByKey("fltClearanceId"),})},{clear:true,component:new ListingBox({"event":{"name":"Consumption"},"debug":true,"id":"fltLowConsumptionId","open":false,"tags":"notags checker","label":false,"disabelable":true,"xand":true,"parentcomponentid":"fltCarburantId","selected":fd.getDataByKey("fltLowConsumptionId"),})},{clear:true,component:new CarburantInnerRangeSlider({"event":{"
476name":"ElectricRange"},"debug":true,"id":"fltElectricRangeId","sufix":"km","round":10,"parentcomponentid":"fltCarburantId","observables":{"carburant":"fltCarburantId"},"conditions":{"ids":[2,3,5]},"selected":fd.getDataByKey("fltElectricRangeId"),})},{clear:true,component:new CarburantInnerRangeSlider({"event":{"name":"BatteryEnergy"},"debug":true,"id":"fltBatteryEnergyId","sufix":"kWh","round":1,"parentcomponentid":"fltCarburantId","observables":{"carburant":"fltCarburantId"},"conditions":{"ids":[2,3,5]},"selected":fd.getDataByKey("fltBatteryEnergyId"),})},{clear:true,component:new SearchInputBox({"event":{"name":"TextSearch"},"debug":true,"id":"fltTextSearchId","open":true,"xand":true,"selected":fd.getDataByKey("fltTextSearchId"),})},{clear:true,component:new CategoryListingBox({"event":{"name":"Category"},"debug":true,"id":"fltCategorieId","open":true,"label":false,"disabelable":true,"innercomponent":["fltClearanceId","fltCertifiedId","fltAsIsId"],"observables":{"clearance":"fltClearanceId","certified":"fltCertifiedId","asis":"fltAsIsId"},"utext":{"seperator":"Show only:"},"selected":fd.getDataByKey("fltCategorieId"),})},{clear:true,component:new CarrosserieButtonBox({"event":{"name":"BodyType"},"debug":true,"id":"fltCarosserieId","disabelable":true,"groupchild":"fltSubBodyTypeId","selected":fd.getDataByKey("fltCarosserieId"),})},{clear:true,component:new MakesListingBox({"orderBy":{"field":"txt","direction":"asc"},"event":{"name":"Make"},"debug":true,"id":"fltMakeId","open":true,"visible":true,"tags":"tags flex","label":false,"disabelable":true,"groupchild":"fltModelId","selected":fd.getDataByKey("fltMakeId"),})},{clear:true,component:new ModelsListingBox({"isParentVisible":true,"orderBy":{"field":"txt","direction":"asc"},"event":{"name":"Model"},"debug":true,"disabled":true,"id":"fltModelId","tags":"tags flex","disabelable":true,"group":"fltMakeId","observables":{"make":"fltMakeId"},"groupchild":"fltTrimsId","selected":fd.getDataByKey("fltModelId"),})},{clear:true,component:new TrimsListingBox({"orderBy":{"field":"txt","direction":"asc"},"event":{"name":"Trims"},"debug":true,"disabled":true,"id":"fltTrimsId","tags":"notags","disabelable":true,"group":"fltModelId","observables":{"model":"fltModelId"},"selected":fd.getDataByKey("fltTrimsId"),})}
476,{clear:true,component:new RangeSlider({"event":{"name":"Year"},"debug":true,"id":"fltYearId","utext":{"outofrange":"Out of range!","noresult":"0 result"},"selected":fd.getDataByKey("fltYearId"),})},{clear:true,component:new RangeSlider({"event":{"name":"Price"},"debug":true,"round":1000,"format":"price","id":"fltPriceId","utext":{"outofrange":"Out of range!","noresult":"0 result"},"selected":fd.getDataByKey("fltPriceId"),})},{clear:true,component:new RangeSlider({"event":{"name":"Mileage"},"debug":true,"round":10000,"format":"number","id":"fltKmId","sufix":"km","utext":{"outofrange":"Out of range!","noresult":"0 result"},"selected":fd.getDataByKey("fltKmId"),})},{clear:true,component:new ListingBox({"event":{"name":"Transmission"},"debug":true,"id":"fltTransmissionId","label":false,"disabelable":true,"selected":fd.getDataByKey("fltTransmissionId"),})},{clear:true,component:new ListingBox({"event":{"name":"DriveTrain"},"debug":true,"id":"fltDriveTrainId","label":false,"disabelable":true,"selected":fd.getDataByKey("fltDriveTrainId"),})},{clear:true,component:new ColorBox({"event":{"name":"Color"},"debug":true,"id":"fltColorId","disabelable":true,"selected":fd.getDataByKey("fltColorId"),})},{clear:true,component:new CarburantListingBox({"event":{"name":"Carburant"},"debug":true,"id":"fltCarburantId","label":false,"disabelable":true,"innercomponent":["fltLowConsumptionId","fltElectricRangeId","fltBatteryEnergyId"],"observables":{"lowconsumption":"fltLowConsumptionId","electricrange":"fltElectricRangeId","batteryenergy":"fltBatteryEnergyId"},"utext":{"seperator":"Show only:"},"selected":fd.getDataByKey("fltCarburantId"),})},{clear:true,component:new ListingBox({"event":{"name":"Options"},"debug":true,"id":"fltOptionId","label":false,"open":false,"xand":true,"disabelable":true,"selected":fd.getDataByKey("fltOptionId"),})},{clear:true,component:new ListingBox({"event":{"name":"Doors"},"debug":true,"id":"fltDoorsId","label":false,"disabelable":true,"selected":fd.getDataByKey("fltDoorsId"),})},{clear:true,component:new ListingBox({"event":{"name":"Seats"},"debug":true,"id":"fltSeatsId","label":false,"disabelable":true,"selected":fd.getDataByKey("fltSeatsId"),})},{clear:true,component:new ListingBox({"event":{"name":"Arrivals"},"debug":true,"id":"fltArrivalsId","label":false,"open":false,"multi":false,"disabelable":true,"selected":fd.getDataByKey("fltArrivalsId"),})},{clear:true,component:new ListingBox({"event":{"name":"Delivery"},"debug":true,"id":"fltDeliveryId","label":false,"disabelable":true,"selected":fd.getDataByKey("fltDeliveryId"),})},]});this.filterInterface=new FilterInterface({filterController:filterController});this._contentController=new ContentController({debug:true,el:'.lstListingWrapper',elseoboxes:'.divSeoLinkWrapper',elbottomdisclaimer:'#disclaimerMsg',carfaxurl:'/en/ajax/getCarfaxBadges?wswidth={{WSWIDTHREPLACER}}',utext:{"errormsg":"Sorry! An error has occured.","resetmsg":"Click here to clear your filter settings","loadingmsg":"Loading! Please wait","showmemoremsg":"Show me more...","showmelessmsg":"Show me less..."},filterLeads:{"id":"filterleads","keys":["make","model","year"],"input
476s":[{"prefix":"lastviewed","suffix":""},{"prefix":"popup","suffix":""},{"prefix":"popup","suffix":"MultistepForm"}]},filterData:fd,filterProxy:filterProxy,filterController:filterController,triggers:null,imageSlider:new CardImageSlider({"url":"\/en\/ajax\/getSrpSliderImages?wswidth={{WSWIDTHREPLACER}}","utext":{"seeAll":"View all {{total}} photos"},"batchSize":6,"rootMargin":"300px"})});};new FilterData({debug:true,id:'filterid',uri:'/inventory.html',history:false,isDealerInspire:false,filterObject:new FilterObject({"debug":true,"basicFilter":{"fltSortId":[6],"fltCategorieId":[],"fltCarosserieId":[],"fltSubBodyTypeId":[],"fltFloorPlanId":[],"fltMakeId":[],"fltModelId":[],"fltTransmissionId":[],"fltCarburantId":[],"fltColorId":[],"fltPriceId":[],"fltYearId":[],"fltKmId":[],"fltDPaymentId":[],"fltOptionId":[],"fltArrivalsId":[],"fltClearanceId":[],"fltLowConsumptionId":[],"fltCertifiedId":[],"fltAsIsId":[],"fltCuvApprovedId":[],"fltCuvCertifiedId":[],"fltAutocanCpoId":[],"fltAutocanAccId":[],"fltAutocanVivId":[],"fltPageId":[0,36],"fltTrimsId":[],"fltDealersId":[],"fltRegionsId":[],"fltGeoLocationId":[],"fltDealerLocatorId":[0,0,0],"fltDriveTrainId":[],"fltDoorsId":[],"fltSeatsId":[],"fltTruckBedLenId":[],"fltTowingCpc":[],"fltWeightId":[],"fltLengthId":[],"fltSleepsId":[],"fltEngineId":[],"fltCylindersId":[],"fltPackageId":[],"fltDeliveryId":[],"fltElectricRangeId":[],"fltBatteryEnergyId":[],"fltTypeCertId":[]}}),ready:function(){window.gUsedSrpAppz=window.gUsedSrpAppz||new UsedSrpAppz(this);},});})();
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.