1(()=>{"use strict";var e;!function(e){e.ToggleVehicleSave="do.toggleVehicleSave"}(e||(e={}));const t=new Map;class a{constructor(){var e;this.baseUrl=((e="/config/").startsWith("/")||(e="/"+e),(location.href.includes("testbench")?"/api":"/api/vclwsaa")+e)}async getIsOrionEnabled(e){const a=t.get(e);if(a)return a;const i=this.fetchIsOrionEnabled(e);return t.set(e,i),i}async fetchIsOrionEnabled(e){try{const t=await fetch(`${this.baseUrl}${e}`);if(!t.ok)return console.error("error fetching Orion status",t.statusText),!1;const a=await t.json();return a?.isOrionEnabled??!1}catch(e){return console.error("error fetching Orion status",e),!1}}}class i extends HTMLElement{constructor(){super(),this.localStorageKey="savedVehicles",this.isOrion=!1,this.savedVins=[],this.isSaved=!1,this.vehicleCard=null,this.vin=null,this.checkbox={},this.icon={}}connectedCallback(){this.innerHTML='\n<style>\n .save-vehicle-heart i.fa-heart, .save-vehicle-heart i.fa-heart-o {\n color: var(--vehicleHeartColor);\n }\n</style>\n<div class="save-vehicle-heart">\n <label style="cursor:pointer">\n <input type="checkbox" tabindex="0" class="sr-only stat-icon-link" aria-label="Save this vehicle" data-loc="vehicle save icon"\n data-dotagging-element-type="item_details"\n data-dotagging-element-subtype="cta_icon" data-dotagging-event="cta_interaction"\n data-dotagging-event-owner="dealeron"\n data-dotagging-event-action="click"\n data-dotagging-product-name="|Vehicle Save"/>\n <i aria-hidden="true" class="fa fa-heart-o fa-lg"></i>\n </label>\n</div>',this.checkbox=this.querySelector("input"),this.icon=this.querySelector("i"),this.vehicleCard=this.closest("[data-vehicle-information]"),this.vin=this.dataset.vin??this.vehicleCard?.dataset.vin??null,this.initialize(),this.resolveOrionEnabled().then(e=>this.orionSetup(e))}initialize(){this.vin?(this.checkAndSetVehicleHeartColor(),this.getItems(),this.updateHeart(),this.checkbox.addEventListener("change",()=>{this.setValue(this.vin)})):this.icon.style.display="none"}async resolveOrionEnabled(){const e=(()=>{const e=new URLSearchParams(globalThis.location.search).get("useOrionPage")?.toLowerCase();return"on"===e||"off"!==e&&null})();if(null===e){const e=function(){const e=document.getElementById("dealeron_website_metadata");let t;if(e?.textContent)try{const a=JSON.parse(e.textContent);t=a.dealerId?Number.parseInt(a.dealerId,10):void 0}catch(e){console.error("Error parsing dealer metadata",e)}return!t&&"undefined"!=typeof globalThis&&globalThis.DlronGlobal_DealerId&&(t=Number.parseInt(globalThis.DlronGlobal_DealerId,10)),t||0}();return!!e&&await(new a).getIsOrionEnabled(String(e))}return e??!1}async orionSetup(e){this.isOrion=e;const t=this.dataset.pageType??(this.vehicleCard?.classList?.contains("vdp")?"VDP":"SRP");this.checkbox.dataset.dotaggingProductName=this.isOrion?`Orion|${t}|Vehicle Save`:`${this.dataset.itemCondition??this.vehicleCard?.dataset.dotaggingItemCondition}|Vehicle Save`,this.isOrion&&(this.checkbox.classList.replace("sr-only","visually-hidden"),this.checkbox.dataset.dotaggingEvent="element_configuration",this.checkbox.dataset.dotaggingElementState="active",this.checkbox.dataset.dotaggingElementText="Save",this.checkbox.dataset.dotaggingElementSubtype="toggle",this.checkbox.dataset.dotaggingElementTitle="Saved Vehicle",this.checkbox.dataset.dotaggingPageType="itemlist",this.checkbox.dataset.dotaggingElementValue=this.isSaved?"unsaved":"saved")}checkAndSetVehicleHeartColor(){const e=document.documentElement;getComputedStyle(e).getPropertyValue("--vehicleHeartColor").trim()||e.style.setProperty("--vehicleHeartColor",this.setHeartColor())}setHeartColor(){switch(window.DlronGlobal_ActiveOemProgram?.toLowerCase()??""){case"genesis":case"kia":case"porsche":case"lexus":case"mazda":case"maserati":case"volkswagen":return"#333333";case"bmw":return"#262626";default:return"#C72020"}}getItems(){this.savedVins=JSON.parse(localStorage.getItem(this.localStorageKey)??"[]"),this.isSaved=-1!==this.savedVins.indexOf(this.vin)}setValue(t){this.getItems(),this.savedVins.length>=50?this.checkbox.checked=!1:(this.toggleSave(t),this.updateHeart(),localStorage.setItem(this.localStorageKey,JSON.stringify(this.savedVins)),document.dispatchEvent(new Event(e.ToggleVehicleSave)))}toggleSave(e){if(this.isSaved){const t=this.savedVins.indexOf(e);this.isSaved=!1,this.savedVins.splice(t,1)}else this.isSaved=!0,this.savedVins.push(e)}updateHeart(){this.checkbox.checked=this.isSaved,this.isSaved?(this.icon.classList.replace("fa-heart-o","fa-heart"),this.delayAttributeChange("uncheck","unsaved")):(this.icon.classList.replace("fa-heart","fa-heart-o"),this.delayAttributeChange("check","saved"))}async delayAttributeChange(e,t){setTimeout(()=>{this.checkbox.dataset.dotaggingEventActionResult=e,this.isOrion&&(this.checkbox.dataset.dotaggingElementValue=t)},100)}}customElements.define("heart-icon",i)})();
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.