function le(n){let a=n.substring(6,n.length-1).split("|");if(a.length!==7)throw new Error("Invalid image token format");return{brand:a[1],nameplate:a[2]||"",modelYear:parseInt(a[3]||"0"),configCode1:a[4]||"",configCode2:a[5]||"",configCode3:a[6]||""}}var Pe=({env:n,isCanada:a})=>`https://${n!=="prod"?"wwwqa.":""}${a?"buildfoc.ford.com":"build.ford.com"}`,W=({token:n,imwidth:a,env:e="prod",locale:t,profile:i="HD-TILE[INTBCK]",view:r="EXT",angle:o=5})=>{let s=decodeURIComponent(n),c=le(s),l=c.brand,d=c.nameplate.replace(/ /g,"+"),p=c.modelYear,h=t.includes("ca"),f=Pe({env:e,isCanada:h}),m=new URLSearchParams;a&&m.set("imwidth",`${a}`);let x=m.toString();return`${f}/dig/${l}/${d}/${p}/${i}/${encodeURIComponent(s)}/${r}/${o}/vehicle.png${x?`?${x}`:""}`},Ht=n=>{let a=decodeURIComponent(n),e=le(a);return`${e.modelYear} ${e.brand} ${e.nameplate}`},ot={"HD-FULL-ACC":1920,"HD-FULL":1920,"HD-TILE-ACC":1024,"HD-TILE":768,"HD-THUMB-ACC":320,"HD-THUMB":320};function at(n){var t;let a=n.match(/(HD-(?:FULL|TILE|THUMB)(?:-ACC)?)\[INTBCK\]/),e=a==null?void 0:a[1];return e!==void 0&&(t=ot[e])!=null?t:1920}function st(n,a){let e=Object.entries(a).map(([t,i])=>`${encodeURIComponent(t)}=${encodeURIComponent(i)}`).join("&");return n.includes("?")?`${n}&${e}`:`${n}?${e}`}var Re={sizes:"(max-width: 767px) 100vw, (max-width: 991px) 50vw, 58vw",largeDesktopBreakpointPx:1441,nextDeviceWidths:[640,750,828,1080,1200,1920,2048,3840]};function lt(n){return n<=767?n:n<=991?Math.round(n*.5):Math.round(n*.58)}function ct(n){var e;let{nextDeviceWidths:a}=Re;return(e=a.find(t=>t>=n))!=null?e:a[a.length-1]}function dt(n,a,e,t=1){let o=`${e>=Re.largeDesktopBreakpointPx?a:n}/EXT/5/vehicle.png`,s=lt(e),c=Math.round(s*t),l=ct(c),d=at(o),p=Math.min(l,d);return st(o,{imwidth:String(p)})}function Se(n,a,e,t){let i=decodeURIComponent(n),r=le(i),o=r.brand,s=r.nameplate.replace(/ /g,"+"),c=r.modelYear,l=a.includes("ca");return`${Pe({env:e,isCanada:l})}/dig/${o}/${s}/${c}/${t}/${encodeURIComponent(i)}`}function Me({token:n,locale:a,env:e="prod",viewportWidth:t,devicePixelRatio:i=1}){let r=Se(n,a,e,"HD-TILE[INTBCK]"),o=Se(n,a,e,"HD-FULL[INTBCK]");return dt(r,o,t,i)}var De={OPEN_GOLF_FORM:"siwc:open-golf-form"},K={COUNTS_UPDATED:"inventory-counts-updated"},N={SAVE_START:"siwc:summary-card-save-start",UNSAVE:"siwc:summary-card-unsave",DISCLOSURE_OPEN:"siwc:summary-card-disclosure-open",BUY_NOW:"siwc:summary-card-buy-now",VIEW_DETAILS:"siwc:summary-card-view-details",VIEW_MORE_INVENTORY:"siwc:summary-card-view-more-inventory"};var pt={MSRP:"MSRP",AZ:"AZ",FNX:"FNX",PRX:"PRX",SPX:"SPX",X:"X"};var ht=(n,a)=>{let e=a!=null?a:{};if(!(Object.keys(e).length>0))return n;try{let i=new URL(n,"https://example.com"),r=new URLSearchParams(i.search);Object.entries(e).forEach(([d,p])=>{p!==void 0&&r.set(d,p)});let o=r.toString(),s=i.hash;return`${/^https?:\/\//i.test(n)?`${i.origin}${i.pathname}`:i.pathname}${o?`?${o}`:""}${s}`}catch{return n}},Z=(n,a,e)=>{let t=ht(a,e);try{let i=new URL(t,"https://example.com"),r=i.pathname.indexOf("/inventory/");if(r<0)return null;let o=i.pathname.slice(r);return`https://${n}${o}${i.search}${i.hash}`}catch{return null}},Fe=(n,a,e,t)=>{let i=`/inventory/details/${encodeURIComponent(a)}/vin/${encodeURIComponent(e)}`,r=new URL(`https://${n}${i}`);return t&&Object.entries(t).forEach(([o,s])=>{s!==void 0&&r.searchParams.set(o,s)}),r.toString()},B=n=>typeof window=="undefined"||!/^https?:\/\//i.test(n)?!1:(window.location.href=encodeURI(n),!0);var ut=new Set(["p","br","b","i","em","strong","u","small","span","div","ul","ol","li","a","sup","sub","h1","h2","h3","h4","h5","h6"]),mt=new Set(["href","target","rel","class","id","aria-label","aria-hidden","role","title"]);function $e(n){if(!n)return"";let e=new DOMParser().parseFromString(n,"text/html"),t=i=>{if(i.nodeType===Node.TEXT_NODE)return u(i.textContent||"");if(i.nodeType!==Node.ELEMENT_NODE)return"";let r=i,o=r.tagName.toLowerCase();if(!ut.has(o))return Array.from(r.childNodes).map(t).join("");let s=[];for(let d of Array.from(r.attributes)){let p=d.name.toLowerCase();if(!mt.has(p))continue;let h=d.value;if(p==="href"){let f=h.trim().toLowerCase();if(f.startsWith("javascript:")||f.startsWith("data:"))continue}s.push(`${p}="${y(h)}"`)}o==="a"&&s.some(d=>d.includes('target="'))&&(s.some(d=>d.startsWith("rel="))||s.push('rel="noopener noreferrer"'));let c=s.length>0?` ${s.join(" ")}`:"",l=Array.from(r.childNodes).map(t).join("");return o==="br"?` `:`<${o}${c}>${l}${o}>`};return Array.from(e.body.childNodes).map(t).join("")}function u(n){return n?n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):""}function y(n){return n?n.replace(/&/g,"&").replace(/"/g,""").replace(//g,">"):""}function gt(n){let a=[],e=!1,t=()=>{e||(e=!0,a.forEach(r=>r()),n())},i=()=>{if("requestIdleCallback"in window){let r=window.requestIdleCallback(t,{timeout:3e3});a.push(()=>window.cancelIdleCallback(r))}else{let r=setTimeout(t,100);a.push(()=>clearTimeout(r))}};try{let r=new PerformanceObserver(()=>{r.disconnect(),i()});r.observe({type:"largest-contentful-paint",buffered:!0}),a.push(()=>r.disconnect())}catch{if(document.readyState==="complete")i();else{let r=()=>i();window.addEventListener("load",r,{once:!0}),a.push(()=>window.removeEventListener("load",r))}}return()=>{a.forEach(r=>r()),e=!0}}function ft(n){let a=n.trim().toLowerCase();return a.startsWith("https://")||a.startsWith("data:image/")}function Q(n){if(n.length===0)return()=>{};let a=!1,t=gt(async()=>{for(let i of n){if(a)break;ft(i)&&await new Promise(r=>{let o=new Image;o.onload=()=>r(),o.onerror=()=>r(),o.src=i})}});return()=>{a=!0,t()}}function vt(n){let a=n.trim().toLowerCase();return a.startsWith("https://")||a.startsWith("data:image/")}function J(n,a,e,t){if(typeof window=="undefined"||!("IntersectionObserver"in window))return()=>{};let i=null,r=!1;function o(){var p;let l=Me({token:a,locale:e,env:t,viewportWidth:window.innerWidth,devicePixelRatio:(p=window.devicePixelRatio)!=null?p:1});if(i===l||(i=l,!vt(l)))return;let d=new Image;d.src=l}let s=new IntersectionObserver(l=>{let d=l[0];r=!!(d!=null&&d.isIntersecting),d!=null&&d.isIntersecting&&o()},{rootMargin:"200px"});function c(){r&&o()}return s.observe(n),window.addEventListener("resize",c),()=>{s.disconnect(),window.removeEventListener("resize",c)}}var M=(n,a,e)=>{var s;let t=n==="lincoln"?"Lincoln":"Ford",r=a.toLowerCase().includes("ca")?"CA":"US";return{brand:t,locale:(s={en_us:"en_US",en_ca:"en_CA",fr_ca:"fr_CA"}[a])!=null?s:"en_US",region:r,environment:e}};var I=' ',He=' ',D=' ',bt=' ',yt=' ';function F(n){return n==="lincoln"?yt:bt}var Ne=' ',Be=' ';var ce=class extends HTMLElement{constructor(){super();this._sectionTitle="";this._rows=[];this._disclosureLookup={};this._triggerElement=null;this._isOpen=!1;this._onOutsideClick=null;this._onKeyDown=null;this._onDialogCancel=null;this._onDialogClick=null;this._scrollListeners=[];this.attachShadow({mode:"open"})}getNextComposedAncestor(e){if(!e)return null;if(e.parentElement)return e.parentElement;let t=e.getRootNode();return t instanceof ShadowRoot?t.host:null}get sectionTitle(){return this._sectionTitle}set sectionTitle(e){this._sectionTitle=e,this.rerenderIfOpen()}get rows(){return this._rows}set rows(e){this._rows=e,this.rerenderIfOpen()}get disclosureLookup(){return this._disclosureLookup}set disclosureLookup(e){this._disclosureLookup=e}get triggerElement(){return this._triggerElement}set triggerElement(e){this._triggerElement=e}get isOpen(){return this._isOpen}isMobileViewport(){return window.innerWidth<=768}getDialog(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector(".tooltip-dialog")}openDialog(){let e=this.getDialog();if(!(!e||e.open)){if(typeof e.showModal=="function"){e.showModal();return}e.setAttribute("open","")}}closeDialog(){let e=this.getDialog();if(e!=null&&e.open){if(typeof e.close=="function"){e.close();return}e.removeAttribute("open")}}rerenderIfOpen(){if(!this._isOpen)return;let e=this.isMobileViewport();if(this.removeListeners(),this.renderContent(),this.addListeners(),e){this.openDialog();return}this.position(),this.bindScrollReposition()}open(){var t;if(this._isOpen)return;this._isOpen=!0,this.renderContent(),this.addListeners(),this.isMobileViewport()?this.openDialog():(this.position(),this.bindScrollReposition());let e=(t=this.shadowRoot)==null?void 0:t.querySelector(".close-btn");requestAnimationFrame(()=>e==null?void 0:e.focus())}close(){var t;if(!this._isOpen)return;this._isOpen=!1;let e=(t=this.shadowRoot)==null?void 0:t.querySelector("disclaimer-popover");e!=null&&e.isOpen&&e.close(),e==null||e.remove(),this.removeListeners(),this.closeDialog(),this.shadowRoot&&(this.shadowRoot.innerHTML=""),this.dispatchEvent(new CustomEvent("tooltip-close",{bubbles:!0,composed:!0}))}toggle(){this._isOpen?this.close():this.open()}disconnectedCallback(){this.removeListeners()}position(){var h;if(window.innerWidth<=768)return;let e=(h=this.shadowRoot)==null?void 0:h.querySelector(".tooltip-panel");if(!e||!this._triggerElement)return;let t=this._triggerElement.getBoundingClientRect(),i=320,r=window.innerWidth,o=window.innerHeight,s=8,c=r-t.right-s,l,d;if(c>=i){d=t.right+s,l=t.top+t.height/2;let f=e.offsetHeight||300;l=Math.max(8,Math.min(l-f/2,o-f-8))}else d=Math.max(8,t.left),l=t.bottom+s,d+i>r-8&&(d=r-i-8);let p=this.getContainingBlockOffset();e.style.top=`${l-p.y}px`,e.style.left=`${d-p.x}px`}addListeners(){if(this.isMobileViewport()){let e=this.getDialog();if(!e)return;this._onDialogCancel=t=>{t.preventDefault(),this.close()},e.addEventListener("cancel",this._onDialogCancel),this._onDialogClick=t=>{t.target===e&&this.close()},e.addEventListener("click",this._onDialogClick);return}this._onOutsideClick=e=>{let t=e.composedPath();!t.includes(this)&&this._triggerElement&&!t.includes(this._triggerElement)&&this.close()},document.addEventListener("click",this._onOutsideClick,!0),this._onKeyDown=e=>{e.key==="Escape"&&this.close()},document.addEventListener("keydown",this._onKeyDown)}removeListeners(){let e=this.getDialog();e&&this._onDialogCancel&&(e.removeEventListener("cancel",this._onDialogCancel),this._onDialogCancel=null),e&&this._onDialogClick&&(e.removeEventListener("click",this._onDialogClick),this._onDialogClick=null),this._onOutsideClick&&(document.removeEventListener("click",this._onOutsideClick,!0),this._onOutsideClick=null),this._onKeyDown&&(document.removeEventListener("keydown",this._onKeyDown),this._onKeyDown=null),this.unbindScrollReposition()}getContainingBlockOffset(){let e=this.getNextComposedAncestor(this);for(;e instanceof HTMLElement;){let t=getComputedStyle(e);if(t.transform&&t.transform!=="none"||t.filter&&t.filter!=="none"||t.perspective!=="none"||t.willChange.includes("transform")||t.willChange.includes("perspective")){let i=e.getBoundingClientRect();return{x:i.left,y:i.top}}e=this.getNextComposedAncestor(e)}return{x:0,y:0}}bindScrollReposition(){if(window.innerWidth<=768)return;let e=()=>{this._isOpen&&this.position()},t=r=>{r.addEventListener("scroll",e,{passive:!0}),this._scrollListeners.push({target:r,fn:e})};t(window);let i=this.getNextComposedAncestor(this);for(;i instanceof HTMLElement;){let{overflowY:r}=getComputedStyle(i);/(auto|scroll)/.test(r)&&t(i),i=this.getNextComposedAncestor(i)}}unbindScrollReposition(){this._scrollListeners.forEach(({target:e,fn:t})=>{e.removeEventListener("scroll",t)}),this._scrollListeners=[]}renderContent(){var i;if(!this.shadowRoot)return;let e=this.isMobileViewport(),t=this._rows.map(r=>{let o=r.disclosureId?`${u(r.disclosureId)} `:"";return`
${u(r.label)}${o} ${u(r.formattedValue)}
`}).join("");this.shadowRoot.innerHTML=`
${e?'':""}
${e?" ":""}
`,(i=this.shadowRoot.querySelector(".close-btn"))==null||i.addEventListener("click",r=>{r.stopPropagation(),this.close()}),this.shadowRoot.querySelectorAll(".row-disclosure-btn").forEach(r=>{r.addEventListener("click",o=>{o.stopPropagation();let s=r,c=s.getAttribute("data-disclosure-key")||"",l=s.getAttribute("data-disclosure-id")||"",d=s.getAttribute("data-disclosure-title")||"",p=this._disclosureLookup[c],h=(p==null?void 0:p.detail)||"",f=this.shadowRoot.querySelector("disclaimer-popover");f==null||f.close(),f==null||f.remove();let m=document.createElement("disclaimer-popover");m.disclosureId=l,m.title=d,m.detail=h,m.showBack=!0,m.triggerElement=s,this.shadowRoot.appendChild(m),m.open(),m.addEventListener("popover-back",()=>{var b;m.remove();let x=(b=this.shadowRoot)==null?void 0:b.querySelector(".close-btn");requestAnimationFrame(()=>x==null?void 0:x.focus())}),m.addEventListener("popover-close",()=>{m.remove(),this.close()})})})}};customElements.get("pricing-tooltip")||customElements.define("pricing-tooltip",ce);var de=class extends HTMLElement{constructor(){super();this._disclosureId="";this._title="";this._detail="";this._showBack=!1;this._triggerElement=null;this._isOpen=!1;this._onOutsideClick=null;this._onKeyDown=null;this._onDialogCancel=null;this._onDialogClick=null;this._scrollListeners=[];this.attachShadow({mode:"open"})}getNextComposedAncestor(e){if(!e)return null;if(e.parentElement)return e.parentElement;let t=e.getRootNode();return t instanceof ShadowRoot?t.host:null}get disclosureId(){return this._disclosureId}set disclosureId(e){this._disclosureId=e,this.rerenderIfOpen()}get title(){return this._title}set title(e){this._title=e,this.rerenderIfOpen()}get detail(){return this._detail}set detail(e){this._detail=e,this.rerenderIfOpen()}get triggerElement(){return this._triggerElement}set triggerElement(e){this._triggerElement=e}get showBack(){return this._showBack}set showBack(e){this._showBack=e,this.rerenderIfOpen()}isMobileViewport(){return window.innerWidth<=768}getDialog(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector(".popover-dialog")}openDialog(){let e=this.getDialog();if(!(!e||e.open)){if(typeof e.showModal=="function"){e.showModal();return}e.setAttribute("open","")}}closeDialog(){let e=this.getDialog();if(e!=null&&e.open){if(typeof e.close=="function"){e.close();return}e.removeAttribute("open")}}rerenderIfOpen(){if(!this._isOpen)return;let e=this.isMobileViewport();if(this.removeListeners(),this.renderContent(),this.addListeners(),e){this.openDialog();return}this.position(),this.bindScrollReposition()}open(){this._isOpen||(this._isOpen=!0,this.renderContent(),this.addListeners(),this.isMobileViewport()?this.openDialog():(this.position(),this.bindScrollReposition()))}close(){this._isOpen&&(this._isOpen=!1,this.removeListeners(),this.closeDialog(),this.shadowRoot&&(this.shadowRoot.innerHTML=""),this.dispatchEvent(new CustomEvent("popover-close",{bubbles:!0,composed:!0})))}get isOpen(){return this._isOpen}disconnectedCallback(){this.removeListeners()}addListeners(){if(this.isMobileViewport()){let e=this.getDialog();if(!e)return;this._onDialogCancel=t=>{t.preventDefault(),this.close()},e.addEventListener("cancel",this._onDialogCancel),this._onDialogClick=t=>{t.target===e&&this.close()},e.addEventListener("click",this._onDialogClick);return}this._onOutsideClick=e=>{let t=e.composedPath();!t.includes(this)&&this._triggerElement&&!t.includes(this._triggerElement)&&this.close()},document.addEventListener("click",this._onOutsideClick,!0),this._onKeyDown=e=>{e.key==="Escape"&&this.close()},document.addEventListener("keydown",this._onKeyDown)}removeListeners(){let e=this.getDialog();e&&this._onDialogCancel&&(e.removeEventListener("cancel",this._onDialogCancel),this._onDialogCancel=null),e&&this._onDialogClick&&(e.removeEventListener("click",this._onDialogClick),this._onDialogClick=null),this._onOutsideClick&&(document.removeEventListener("click",this._onOutsideClick,!0),this._onOutsideClick=null),this._onKeyDown&&(document.removeEventListener("keydown",this._onKeyDown),this._onKeyDown=null),this.unbindScrollReposition()}getContainingBlockOffset(){let e=this.getNextComposedAncestor(this);for(;e instanceof HTMLElement;){let t=getComputedStyle(e);if(t.transform&&t.transform!=="none"||t.filter&&t.filter!=="none"||t.perspective!=="none"||t.willChange.includes("transform")||t.willChange.includes("perspective")){let i=e.getBoundingClientRect();return{x:i.left,y:i.top}}e=this.getNextComposedAncestor(e)}return{x:0,y:0}}bindScrollReposition(){if(window.innerWidth<=768)return;let e=()=>{this._isOpen&&this.position()},t=r=>{r.addEventListener("scroll",e,{passive:!0}),this._scrollListeners.push({target:r,fn:e})};t(window);let i=this.getNextComposedAncestor(this);for(;i instanceof HTMLElement;){let{overflowY:r}=getComputedStyle(i);/(auto|scroll)/.test(r)&&t(i),i=this.getNextComposedAncestor(i)}}unbindScrollReposition(){this._scrollListeners.forEach(({target:e,fn:t})=>{e.removeEventListener("scroll",t)}),this._scrollListeners=[]}position(){if(window.innerWidth<=768||!this._triggerElement||!this.shadowRoot)return;let e=this.shadowRoot.querySelector(".popover-panel");if(!e)return;let t=this._triggerElement.getBoundingClientRect(),i=320,r=window.innerWidth,o=window.innerHeight,s,c,l=8;if(r-t.right-l>=i){c=t.right+l,s=t.top+t.height/2;let h=e.offsetHeight||300;s=Math.max(8,Math.min(s-h/2,o-h-8))}else c=Math.max(8,t.left),s=t.bottom+l,c+i>r-8&&(c=r-i-8);let p=this.getContainingBlockOffset();e.style.top=`${s-p.y}px`,e.style.left=`${c-p.x}px`}renderContent(){if(!this.shadowRoot)return;let e=this.isMobileViewport();this.shadowRoot.innerHTML=`
${e?``:""}
${u(this._disclosureId)}
${$e(this._detail)}
${e?" ":""}
`;let t=this.shadowRoot.querySelector(".close-btn");t==null||t.addEventListener("click",o=>{o.stopPropagation(),this.close()});let i=this.shadowRoot.querySelector(".back-btn");i==null||i.addEventListener("click",o=>{o.stopPropagation(),this.dispatchEvent(new CustomEvent("popover-back",{bubbles:!0,composed:!0}))});let r=t||this.shadowRoot.querySelector(".popover-panel");requestAnimationFrame(()=>r==null?void 0:r.focus())}};customElements.get("disclaimer-popover")||customElements.define("disclaimer-popover",de);var ee=`
.disclosure-superscript {
background: none;
border: none;
padding: 0;
cursor: pointer;
vertical-align: super;
align-self: flex-start;
margin-left: var(--spacing-xs, 4px);
}
.disclosure-superscript sup {
font-size: 10px;
line-height: 11px;
text-decoration: underline;
}
.info-btn {
background: none;
border: none;
padding: 0;
margin-left: 4px;
cursor: pointer;
vertical-align: middle;
display: inline-flex;
align-items: center;
justify-content: center;
}
.info-btn svg {
width: 16px;
height: 16px;
}
`;function te(n,a){let e=n.querySelector('[data-action="open-disclaimer"]');e&&e.addEventListener("click",t=>{t.stopPropagation();let i=n.querySelector("disclaimer-popover");if(i!=null&&i.isOpen){i.close(),i.remove(),e.setAttribute("aria-expanded","false");return}i==null||i.remove();let r=document.createElement("disclaimer-popover");r.disclosureId=e.getAttribute("data-disclosure-id")||"",r.title=e.getAttribute("data-disclosure-title")||"",r.detail=a(),r.triggerElement=e,n.appendChild(r),r.open(),e.setAttribute("aria-expanded","true"),r.addEventListener("popover-close",()=>{e.setAttribute("aria-expanded","false"),r.remove(),requestAnimationFrame(()=>e.focus())})})}var xt=["lincoln.com","lincolncanada.com"],wt=["ford.com","ford.ca"];function O(n){let a=n.toLowerCase(),e=t=>t.some(i=>a===i||a.endsWith(`.${i}`));return e(xt)?"lincoln":(e(wt),"ford")}var S=class extends HTMLElement{constructor(){super();this._brand="ford";this._locale="en_us";this._env="prod";this.attachShadow({mode:"open"})}static get baseObservedAttributes(){return["brand","locale","env"]}connectedCallback(){!this.hasAttribute("brand")&&typeof window!="undefined"&&(this._brand=O(window.location.hostname)),this.render()}attributeChangedCallback(e,t,i){e==="brand"&&(this._brand=i),e==="locale"&&(this._locale=i),e==="env"&&(this._env=i)}formatPrice(e){return e?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(e):"$0"}getBrandStyles(){return""}};var pe=class extends S{constructor(){super();this._vehicle=null;this._disclaimerDetail="";this._preloadCleanup=null;this._vdpLcpCleanup=null;this.handleViewDetailsClick=()=>{var r;let e=(r=this._vehicle)==null?void 0:r.detailsUrl;if(!e)return;let t=typeof window!="undefined"?window.location.host||window.location.hostname:"";if(!t)return;let i=Z(t,e,{intcmp:this._campaignId});i&&B(i)}}static get observedAttributes(){return[...S.baseObservedAttributes,"campaign-id"]}get vehicle(){return this._vehicle}set vehicle(e){this._vehicle=e,this.render(),this._scheduleVdpLcpPrefetch()}get brand(){return this._brand}set brand(e){this.setAttribute("brand",e)}get locale(){return this._locale}set locale(e){this.setAttribute("locale",e)}get env(){return this._env}set env(e){this.setAttribute("env",e)}get campaignId(){return this._campaignId}set campaignId(e){this._campaignId=e,e?this.setAttribute("campaign-id",e):this.removeAttribute("campaign-id")}connectedCallback(){super.connectedCallback(),this._scheduleVdpLcpPrefetch()}disconnectedCallback(){var e;this._preloadCleanup&&(this._preloadCleanup(),this._preloadCleanup=null),(e=this._vdpLcpCleanup)==null||e.call(this),this._vdpLcpCleanup=null}attributeChangedCallback(e,t,i){t!==i&&(super.attributeChangedCallback(e,t,i),e==="campaign-id"&&(this._campaignId=i||void 0),this.render())}getBrandStyles(){return this._brand==="lincoln"?`
/* \u2500\u2500 Lincoln brand overrides \u2500\u2500 */
:host {
--text-interactive: var(--lincoln-interactive-color, #485b65);
}
`:""}_scheduleVdpLcpPrefetch(){var e,t;(e=this._vdpLcpCleanup)==null||e.call(this),this._vdpLcpCleanup=null,(t=this._vehicle)!=null&&t.imageToken&&(this._vdpLcpCleanup=J(this,this._vehicle.imageToken,this._locale,this._env))}render(){var X,Y,U,z,se,G;if(!this.shadowRoot)return;if(!this._vehicle){this.shadowRoot.innerHTML='
';return}let{year:e,model:t,trim:i,imageToken:r,dealer:o,vin:s,eta:c,pricing:l}=this._vehicle,d=this._locale.includes("ca"),p=l==null?void 0:l.some(C=>{var k;return((k=C.disclosure)==null?void 0:k.key)==="estimatedEmployeeNetPrice"}),h=d?l==null?void 0:l.find(C=>{var k;return((k=C.disclosure)==null?void 0:k.key)==="disclaimerAdjustedPrice"}):l==null?void 0:l.find(C=>{var k;return((k=C.disclosure)==null?void 0:k.key)===(p?"estimatedEmployeeNetPrice":"disclaimerNetPrice")});this._disclaimerDetail=((X=h==null?void 0:h.disclosure)==null?void 0:X.detail)||"";let f={};l!=null&&l.length&&l.forEach(C=>{var k,T;(k=C.disclosure)!=null&&k.key&&((T=C.disclosure)!=null&&T.id)&&(f[C.disclosure.key]={id:C.disclosure.id,title:C.disclosure.title||"",detail:C.disclosure.detail||""})});let m=r?W({token:r,imwidth:600,locale:this._locale,env:this._env}):"https://via.placeholder.com/320x200?text=Vehicle+Image",x=m.startsWith("https://")?[m]:[];this._preloadCleanup&&this._preloadCleanup(),this._preloadCleanup=Q(x);let b=`
:host {
display: block;
width: 100%;
max-width: var(--inventory-card-max-width, 440px);
height: 100%;
flex-shrink: 0;
font-family: var(--font-body-1-regular-font-family, var(--caption-semibold-font-family, 'Ford F-1', sans-serif));
/* Design tokens */
--card-bg: var(--color-fill-onlight-subtlest, var(--semantic-color-fill-onlight-subtlest, #fafafa));
--text-strong: var(--color-text-onlight-strong, var(--semantic-color-text-onlight-strong, black));
--text-moderate: var(--color-text-onlight-moderate-default, var(--semantic-color-text-onlight-moderate-default, #333));
--text-subtle: var(--color-text-onlight-subtle, var(--semantic-color-text-onlight-subtle, #666));
--text-success: var(--color-text-onlight-success, var(--semantic-color-text-onlight-success, #008200));
--text-interactive: var(--color-text-onlight-interactive, var(--semantic-color-text-onlight-interactive, #0562d2));
--space-xs: var(--space-xs, 4px);
--space-lg: var(--space-lg, 16px);
}
.card {
padding: 20px;
border-radius: 12px;
background: var(--card-bg);
display: flex;
flex-direction: column;
height: 100%;
}
.year-model {
font-family: var(--caption-regular-font-family, 'Ford F-1', sans-serif);
font-size: var(--caption-regular-font-size, 12px);
line-height: var(--caption-regular-line-height, 16px);
color: var(--text-subtle);
margin: 0;
}
.trim {
font-family: var(--body-1-bold-font-family, 'Ford F-1', sans-serif);
font-size: var(--body-1-bold-font-size, 16px);
font-weight: 700;
line-height: var(--body-1-bold-line-height, 24px);
color: var(--text-moderate);
margin: 0;
}
.image-container {
width: 100%;
aspect-ratio: 16 / 9;
overflow: hidden;
margin: 8px 0;
}
.image-container img {
width: 100%;
height: 100%;
object-fit: contain;
}
.pricing {
padding: var(--space-lg) 0;
display: flex;
flex-direction: column;
}
.price-label {
font-family: var(--body-1-bold-font-family, 'Ford F-1', sans-serif);
font-size: var(--body-1-bold-font-size, 16px);
font-weight: 700;
line-height: var(--body-1-bold-line-height, 24px);
color: var(--text-moderate);
}
.price-row {
display: flex;
gap: var(--space-xs, 4px);
align-items: center;
}
.price-val {
font-family: var(--caption-regular-font-family, 'Ford F-1', sans-serif);
font-size: var(--caption-regular-font-size, 12px);
line-height: var(--caption-regular-line-height, 16px);
color: var(--text-subtle);
}
${ee}
.info-btn svg {
color: var(--text-interactive);
}
.eta {
font-family: var(--caption-bold-font-family, 'Ford F-1', sans-serif);
font-size: var(--caption-bold-font-size, 12px);
font-weight: 700;
line-height: var(--caption-bold-line-height, 16px);
color: var(--text-success);
margin-top: var(--space-lg, 16px);
}
.dealer {
font-family: var(--body-2-regular-font-family, 'Ford F-1', sans-serif);
font-size: var(--body-2-regular-font-size, 14px);
line-height: var(--body-2-regular-line-height, 20px);
color: var(--text-moderate);
}
.vin {
font-family: var(--body-2-regular-font-family, 'Ford F-1', sans-serif);
font-size: var(--body-2-regular-font-size, 14px);
line-height: var(--body-2-regular-line-height, 20px);
color: var(--text-moderate);
margin-top: var(--space-lg, 16px);
}
.action-row {
margin-top:var(--space-lg, 16px);
padding-top: var(--space-lg, 16px);
}
.view-details-btn {
background: none;
border: none;
font-family: var(--body-2-bold-font-family, 'Ford F-1', sans-serif);
font-size: var(--body-2-bold-font-size, 14px);
font-weight: 700;
line-height: var(--body-2-bold-line-height, 20px);
color: var(--text-interactive);
padding: 0;
cursor: pointer;
text-decoration: none;
display: inline-flex;
align-items: center;
gap: var(--space-xs, 4px);
}
.view-details-btn:hover {
text-decoration: underline;
}
.chevron-icon {
width: 16px;
height: 16px;
color: var(--text-interactive);
}
${this.getBrandStyles()}
`,A=h?this.formatPrice(h.value):"",v=d?"Adjusted Price":p?"Est. Employee Net Price":"Estimated Net Price",E=((Y=h==null?void 0:h.disclosure)==null?void 0:Y.id)||"",L=((U=h==null?void 0:h.disclosure)==null?void 0:U.title)||"",oe=(l==null?void 0:l.map(C=>{var T,R,q;let k=C.prefix==="-"&&C.value>0?`- ${this.formatPrice(C.value)}`:this.formatPrice(C.value);return{label:C.label,formattedValue:k,disclosureKey:((T=C.disclosure)==null?void 0:T.key)||void 0,disclosureId:((R=C.disclosure)==null?void 0:R.id)||void 0,disclosureTitle:((q=C.disclosure)==null?void 0:q.title)||void 0}}))||[],ae=s&&((z=this._vehicle)==null?void 0:z.vendorCategory)!=="Company"&&((se=this._vehicle)==null?void 0:se.vendorCategory)!=="RRC";this.shadowRoot.innerHTML=`
${u(String(e))} ${u(t)}
${u(i)}
${h&&h.value>0?`
${u(v)}
${u(A)}${E?`${u(E)} `:""}
${F(this._brand)}
`:""}
${c?`
${u(c)}
`:""}
${u(o)}
${ae?`
VIN: ${u(s)}
`:""}
View Details ${D}
`;let H=document.createElement("pricing-tooltip");H.sectionTitle=v,H.rows=oe,H.disclosureLookup=f,(G=this.shadowRoot.querySelector(".pricing"))==null||G.appendChild(H),this.setupListeners()}dispatchDisclosureOpenEvent(){if(!this._vehicle)return;let t={type:"summary-card-disclosure-open",context:M(this._brand,this._locale,this._env),vehicle:{modelYear:String(this._vehicle.year),nameplate:this._vehicle.model,trim:this._vehicle.trim}};this.dispatchEvent(new CustomEvent(N.DISCLOSURE_OPEN,{detail:t,bubbles:!0,composed:!0}))}setupListeners(){if(!this.shadowRoot)return;let e=this.shadowRoot.querySelector("pricing-tooltip"),t=this.shadowRoot.querySelector('[data-action="open-tooltip"]'),i=this.shadowRoot.querySelector('[data-action="view-details"]');i==null||i.addEventListener("click",this.handleViewDetailsClick),e&&t&&(e.triggerElement=t,t.addEventListener("click",r=>{r.stopPropagation(),this.dispatchDisclosureOpenEvent(),e.toggle()}),e.addEventListener("tooltip-close",()=>{requestAnimationFrame(()=>t.focus())})),te(this.shadowRoot,()=>this._disclaimerDetail)}};customElements.get("inventory-card")||customElements.define("inventory-card",pe);var Oe="Discover More Vehicles Near You",Ve="Browse local inventory, compare trims and features, and narrow down options that fit your needs.",Ue="View More Inventory",ie="#",he=class extends HTMLElement{constructor(){super();this._heading=Oe;this._body=Ve;this._ctaLabel=Ue;this._ctaHref=ie;this._brand="ford";this._locale="en_us";this._env="prod";this.attachShadow({mode:"open"})}static get observedAttributes(){return["heading","body","cta-label","cta-href","brand","locale","env"]}get heading(){return this._heading}set heading(e){this.setAttribute("heading",e)}get body(){return this._body}set body(e){this.setAttribute("body",e)}get ctaLabel(){return this._ctaLabel}set ctaLabel(e){this.setAttribute("cta-label",e)}get ctaHref(){return this._ctaHref}set ctaHref(e){this.setAttribute("cta-href",e)}get brand(){return this._brand}set brand(e){this.setAttribute("brand",e)}get locale(){return this._locale}set locale(e){this.setAttribute("locale",e)}get env(){return this._env}set env(e){this.setAttribute("env",e)}connectedCallback(){!this.hasAttribute("brand")&&typeof window!="undefined"&&(this._brand=O(window.location.hostname)),this.render()}attributeChangedCallback(e,t,i){t!==i&&(e==="heading"&&(this._heading=i||Oe),e==="body"&&(this._body=i||Ve),e==="cta-label"&&(this._ctaLabel=i||Ue),e==="cta-href"&&(this._ctaHref=i||ie),e==="brand"&&(this._brand=i||"ford"),e==="locale"&&(this._locale=i||"en_us"),e==="env"&&(this._env=i||"prod"),this.render())}getSafeHref(e){let t=e.trim();return!t||/^javascript:/i.test(t)||/^data:/i.test(t)?ie:t}getBrandStyles(){return this._brand==="lincoln"?`
/* \u2500\u2500 Lincoln brand overrides \u2500\u2500 */
.card {
/* Lincoln: solid deep navy, no radial glows */
background: var(--marketing-card-background, var(--color-fill-onlight-brand-strongest, #00142e));
}
/* Lincoln: no arc decorations */
.card::before,
.card::after {
display: none;
}
.heading {
font-weight: var(--headline-2-large-semibold-font-weight, 300);
letter-spacing: var(--lincoln-headline-letter-spacing, 0.02em);
}
/* Lincoln CTA: filled white, square corners (vs Ford's pill) */
.cta {
background: var(--color-fill-onlight-highcontrast-default, #ffffff);
color: var(--color-fill-ondark-highcontrast-default, #000000);
border: none;
border-radius: var(--lincoln-button-radius, 4px);
}
.cta:hover {
background: rgba(255, 255, 255, 0.9);
}
`:""}render(){var i;if(!this.shadowRoot)return;let e=this.getSafeHref(this._ctaHref),t=`
:host {
display: block;
width: 100%;
max-width: var(--marketing-card-max-width, 430px);
height: 100%;
min-height: var(--marketing-card-min-height, 100%);
--si-font-family: 'Ford F-1', sans-serif;
font-family: var(--body-1-medium-font-family, var(--font-body-1-regular-font-family, var(--si-font-family)));
}
:host([brand="lincoln"]) {
--si-font-family: 'Lincoln Proxima Nova', sans-serif;
}
.card {
position: relative;
width: 100%;
height: 100%;
min-height: 100%;
overflow: hidden;
border-radius: var(--radius-xl, 16px);
/* Ford: primary blue gradient with light blue overlays */
background:
/* Upper-left radial glow */
radial-gradient(ellipse 600px 400px at -15% 5%, rgba(99, 194, 255, 0.5) 0%, rgba(99, 194, 255, 0) 50%),
/* Lower-right radial glow */
radial-gradient(ellipse 550px 450px at 110% 95%, rgba(88, 180, 255, 0.4) 0%, rgba(88, 180, 255, 0) 55%),
/* Base blue */
var(--marketing-card-background, #1062d5);
}
/* Curved arc decorations (Ford only; hidden for Lincoln via brand overrides) */
.card::before,
.card::after {
content: "";
position: absolute;
pointer-events: none;
border: 3px solid var(--marketing-card-arc-color, rgba(68, 170, 255, 0.6));
border-radius: 9999px;
}
/* Top-left arc */
.card::before {
width: 320%;
height: 255%;
left: -170%;
top: -165%;
}
/* Bottom-right arc */
.card::after {
width: 360%;
height: 310%;
left: -210%;
top: -275%;
}
.content {
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
gap: var(--space-2xl, 32px);
padding: var(--space-2xl, 32px) var(--space-3xl, 40px);
margin-top: 121px;
}
.copy {
display: flex;
flex-direction: column;
gap: var(--space-lg, 16px);
}
.heading {
margin: 0;
color: var(--color-text-ondark-strong, var(--semantic-color-text-ondark-strong, #ffffff));
font-family: var(--headline-2-large-semibold-font-family, var(--headline-2-large-font-family, var(--si-font-family)));
font-size: var(--headline-2-large-semibold-font-size, var(--headline-2-large-font-size, 40px));
line-height: var(--headline-2-large-semibold-line-height, var(--headline-2-large-line-height, 48px));
font-weight: var(--headline-2-large-semibold-font-weight, 600);
}
.body {
margin: 0;
color: var(--color-text-ondark-strong, var(--semantic-color-text-ondark-strong, #ffffff));
font-family: var(--body-1-medium-font-family, var(--font-body-1-regular-font-family, var(--si-font-family)));
font-size: var(--body-1-medium-font-size, 16px);
line-height: var(--body-1-medium-line-height, 24px);
font-weight: var(--body-1-medium-font-weight, 500);
}
.cta {
align-self: flex-start;
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 40px;
border: none;
padding: 0px 24px;
border-radius: var(--button-primary-radius-default, 9999px);
background: var(--color-fill-onlight-highcontrast-default, #ffffff);
color: var(--color-fill-ondark-highcontrast-default, #000000);
font-family: var(--body-2-bold-font-family, var(--font-body-1-regular-font-family, var(--si-font-family)));
font-size: var(--body-2-bold-font-size, 14px);
line-height: var(--body-2-bold-line-height, 20px);
font-weight: var(--body-2-bold-font-weight, 700);
text-decoration: none;
white-space: nowrap;
cursor: pointer;
}
.cta:focus-visible {
outline: 2px solid var(--marketing-card-focus-ring, #ffffff);
outline-offset: 2px;
}
@media (max-width: 767px) {
:host {
/* Use the variable when set by a parent carousel; fall back to 358px for standalone use */
max-width: var(--marketing-card-max-width, 358px);
min-height: var(--marketing-card-min-height-mobile, var(--marketing-card-min-height, 100%));
}
.content {
margin-top: 96px;
padding: var(--space-xl, 24px);
}
.heading {
font-size: var(--headline-2-large-semibold-font-size-mobile, 36px);
line-height: var(--headline-2-large-semibold-line-height-mobile, 44px);
}
.body {
font-size: var(--body-1-medium-font-size-mobile, 16px);
line-height: var(--body-1-medium-line-height-mobile, 24px);
}
.cta {
min-height: 40px;
font-size: var(--body-2-bold-font-size-mobile, 14px);
line-height: var(--body-2-bold-line-height-mobile, 20px);
}
}
${this.getBrandStyles()}
`;this.shadowRoot.innerHTML=`
${u(this._heading)}
${u(this._body)}
${u(this._ctaLabel)}
`,(i=this.shadowRoot.querySelector(".cta"))==null||i.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("marketing-card-cta-click",{bubbles:!0,composed:!0,detail:{href:e,label:this._ctaLabel}}))})}};customElements.get("marketing-card")||customElements.define("marketing-card",he);var P=n=>n?n.toLowerCase().replace(/[™®©]/g,"").replace(/[()]/g,"").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g," ").trim():"";var ze={"buy-now":"nfbcSummary-cta-cartDetails","view-details":"nfbcSummary-cta-siVdp","view-more-inventory":"nfbc-vehicleCard-cta-siResults"},V=(n,a)=>{let e=ze[n],t=P(a).replace(/\s+/g,"-");return`${e}-${t}`};var qe=`
.chip-success,
.chip-info,
.chip-moderate {
padding: 0px 4px;
border-radius: var(--border-radius-sm, 4px);
font-family: var(--caption-medium-font-family, 'Ford F-1', sans-serif);
font-size: var(--caption-medium-font-size, 12px);
font-weight: var(--caption-medium-font-weight, 500);
line-height: var(--caption-medium-line-height, 16px);
display: inline-flex;
align-items: center;
gap: 4px;
}
.chip-success {
background: var(--color-fill-onlight-success-subtle, #e5f6e8);
color: var(--color-text-onlight-success, #008200);
}
.chip-info {
background: var(--color-fill-onlight-informational-subtle, #e6f2fc);
color: var(--color-text-onlight-interactive, #0562d2);
}
.chip-moderate {
background: var(--color-fill-onlight-subtle, #f0f0f0);
color: var(--color-text-onlight-moderate-default, #333);
}
`;function re(n,a,e){let t=e?` ${F(e)}`:"";return`${u(a)}${t} `}var ue=class extends HTMLElement{constructor(){super();this._matchedFilters=[];this._substitutedFilters=[];this._triggerElement=null;this._isOpen=!1;this._packages=[];this._onOutsideClick=null;this._onKeyDown=null;this._scrollListeners=[];this.attachShadow({mode:"open"})}getNextComposedAncestor(e){if(!e)return null;if(e.parentElement)return e.parentElement;let t=e.getRootNode();return t instanceof ShadowRoot?t.host:null}get matchedFilters(){return this._matchedFilters}set matchedFilters(e){this._matchedFilters=e,this._isOpen&&this.renderContent()}get substitutedFilters(){return this._substitutedFilters}set substitutedFilters(e){this._substitutedFilters=e,this._isOpen&&this.renderContent()}get triggerElement(){return this._triggerElement}set triggerElement(e){this._triggerElement=e}get packages(){return this._packages}set packages(e){this._packages=e,this._isOpen&&this.renderContent()}get isOpen(){return this._isOpen}open(){var t;if(this._isOpen)return;this._isOpen=!0,this.renderContent(),this.position(),this.addListeners(),this.bindScrollReposition();let e=(t=this.shadowRoot)==null?void 0:t.querySelector(".close-btn");requestAnimationFrame(()=>e==null?void 0:e.focus())}close(){this._isOpen&&(this._isOpen=!1,this.removeListeners(),this.shadowRoot&&(this.shadowRoot.innerHTML=""),this.dispatchEvent(new CustomEvent("match-info-close",{bubbles:!0,composed:!0})))}toggle(){this._isOpen?this.close():this.open()}disconnectedCallback(){this.removeListeners()}position(){var h;let e=(h=this.shadowRoot)==null?void 0:h.querySelector(".popover-panel");if(!e||!this._triggerElement)return;let t=this._triggerElement.getBoundingClientRect(),i=360,r=window.innerWidth,o=window.innerHeight,s=8,c=t.bottom+s,l=t.left;l+i>r-8&&(l=r-i-8),l=Math.max(8,l);let d=e.offsetHeight||200;c+d>o-8&&(c=t.top-d-s),c=Math.max(8,c);let p=this.getContainingBlockOffset();e.style.top=`${c-p.y}px`,e.style.left=`${l-p.x}px`}addListeners(){this._onOutsideClick=e=>{let t=e.composedPath();!t.includes(this)&&this._triggerElement&&!t.includes(this._triggerElement)&&this.close()},document.addEventListener("click",this._onOutsideClick,!0),this._onKeyDown=e=>{e.key==="Escape"&&(this.classList.contains("packages-drawer-open")?this.closeDrawer():this.close())},document.addEventListener("keydown",this._onKeyDown)}removeListeners(){this._onOutsideClick&&(document.removeEventListener("click",this._onOutsideClick,!0),this._onOutsideClick=null),this._onKeyDown&&(document.removeEventListener("keydown",this._onKeyDown),this._onKeyDown=null),this.unbindScrollReposition()}getContainingBlockOffset(){let e=this.getNextComposedAncestor(this);for(;e instanceof HTMLElement;){let t=getComputedStyle(e);if(t.transform&&t.transform!=="none"||t.filter&&t.filter!=="none"||t.perspective!=="none"||t.willChange.includes("transform")||t.willChange.includes("perspective")){let i=e.getBoundingClientRect();return{x:i.left,y:i.top}}e=this.getNextComposedAncestor(e)}return{x:0,y:0}}bindScrollReposition(){let e=()=>{this._isOpen&&this.position()},t=r=>{r.addEventListener("scroll",e,{passive:!0}),this._scrollListeners.push({target:r,fn:e})};t(window);let i=this.getNextComposedAncestor(this);for(;i instanceof HTMLElement;){let{overflowY:r}=getComputedStyle(i);/(auto|scroll)/.test(r)&&t(i),i=this.getNextComposedAncestor(i)}}unbindScrollReposition(){this._scrollListeners.forEach(({target:e,fn:t})=>{e.removeEventListener("scroll",t)}),this._scrollListeners=[]}openDrawer(){var t;this.classList.add("packages-drawer-open");let e=(t=this.shadowRoot)==null?void 0:t.querySelector(".packages-drawer-close");requestAnimationFrame(()=>e==null?void 0:e.focus())}closeDrawer(){var r,o,s;let e=(r=this.shadowRoot)==null?void 0:r.querySelector(".packages-drawer"),t=(o=this.shadowRoot)==null?void 0:o.querySelector(".packages-drawer-overlay");e?(e.style.animation="drawer-slide-out-right 200ms ease-in forwards",t&&(t.style.animation="drawer-overlay-fade-out 150ms ease-in forwards"),e.addEventListener("animationend",()=>{this.classList.remove("packages-drawer-open"),e.style.animation="",t&&(t.style.animation="")},{once:!0})):this.classList.remove("packages-drawer-open");let i=(s=this.shadowRoot)==null?void 0:s.querySelector(".packages-btn");i==null||i.focus()}renderContent(){var m,x,b,A;if(!this.shadowRoot)return;let e=new Set(this._matchedFilters.map(v=>v.matchedFacetId)),t=this._packages.filter(v=>!e.has(v.code)),i=this._matchedFilters,r=i.map(v=>{var E;return`
${Ne}
${u((E=v.matchedFacetDescription)!=null?E:"")}
`}).join(""),o=this._substitutedFilters.filter(v=>typeof v.requested=="string"&&v.requested.trim()!==""),s=i.length>0&&o.length>0,c=o.some(v=>v.substituted),l=t.length>0,d=o.map(v=>`
${I}
${u(v.requested)} ${v.substituted?`${Be} ${u(v.substituted)} `:""}
`).join(""),p=l?`
Additional Packages
${D}
`:"",h=t.map(v=>`${u(v.description)} `).join(""),f=l?`
`:"";this.shadowRoot.innerHTML=`
${I}
${r}
${s?'
':""}
${d}
${p}
${f}
`,(m=this.shadowRoot.querySelector(".close-btn"))==null||m.addEventListener("click",()=>this.close()),(x=this.shadowRoot.querySelector(".packages-btn"))==null||x.addEventListener("click",()=>this.openDrawer()),(b=this.shadowRoot.querySelector(".packages-drawer-close"))==null||b.addEventListener("click",()=>this.closeDrawer()),(A=this.shadowRoot.querySelector(".packages-drawer-overlay"))==null||A.addEventListener("click",()=>this.closeDrawer())}};customElements.get("match-info-popover")||customElements.define("match-info-popover",ue);var me=6,Ct=n=>{var r,o,s,c,l,d,p;let a=[];(r=n.estimatedMPG)!=null&&r.name&&a.push({key:"estimatedMpg",value:n.estimatedMPG.name}),(o=n.rangeBEV)!=null&&o.name&&a.push({key:"rangeBEV",value:n.rangeBEV.name,iceDisclaimer:"estimatedMpg",evDisclaimer:"range"}),(s=n.driveType)!=null&&s.name&&a.push({key:"driveType",value:n.driveType.name}),(c=n.cabStyle)!=null&&c.name&&((l=n.boxSize)!=null&&l.name)&&a.push({key:"cabStyleBoxSize",value:`${n.cabStyle.name}, ${n.boxSize.name}`}),(d=n.interiorColor)!=null&&d.name&&a.push({key:"interiorColor",value:n.interiorColor.name,suffix:"Interior"});let e=n.maxConventional&&n.maxConventional>0,t=n.packages,i=e?me-a.length-1:me-a.length;if(t!=null&&t.length&&i>0){let f=[...t].sort((m,x)=>m.description.localeCompare(x.description)).map((m,x)=>({key:`package-${x}`,value:m.description})).slice(0,i);a.push(...f)}return e&&a.length{if(a==null?void 0:a.toLowerCase().includes("ca"))return{cardlabel:"Adjusted Price",pricingTableLabel:"Adjusted Price:"};let t="Est. Net Price",i="Estimated Net Price:",r=n.planType||"MSRP";return We.includes(r)?(t="Est. Net X-Plan Price",i="Est. Net X-Plan Price:"):Ke.includes(r)&&(t="Est. Net AZ-Plan Price",i="Est. Net AZ-Plan Price:"),{cardlabel:t,pricingTableLabel:i}},_t=(n,a)=>{let e=n.paymentMethod==="LEASE",t=n.planType||"MSRP",i="MSRP";We.includes(t)?i="X-Plan":Ke.includes(t)&&(i="AZ-Plan");let r=a==="ford",o=n;return[{label:"Base MSRP:",value:o.baseMSRP||0,disclosureKey:r?"baseMSRP":"disclaimerStartingMSRP"},{label:"Options:",value:o.optionsPrice||0,prefix:"+",disclosureKey:r?"totalOfOptions":"disclaimerPackages"},{label:"Destination:",value:o.destinationDeliveryCharge||0,prefix:"+",disclosureKey:r?"destinationAndDeliveryCharges":"disclaimerDestinationCharge"},...n.planType!=="MSRP"?[{label:`${n.planType} Discount:`,value:o.planDiscount||0,prefix:"-",disclosureKey:r?"planDiscount":"disclaimerPlanDiscount"}]:[],{label:`Total ${i}:`,value:o.pricingMsrp||0,prefix:"=",disclosureKey:r?t==="MSRP"?"totalMSRP":"totalAXZPlanPricing":"disclaimerTotalMSRP"},{label:"Incentives:",value:o.pricingAdjustments||0,prefix:"-",disclosureKey:r?"currentAvailableIncentives":"disclaimerOffers"},...e&&o.acquisitionFee?[{label:"Acquisition Fee:",value:o.acquisitionFee,prefix:"+",disclosureKey:"acquisitionFee"}]:[],{label:je(n).pricingTableLabel,value:n.price||0,prefix:"=",disclosureKey:"disclaimerNetPrice"}]},Et=(n,a)=>{let e=a==="ford",t=n;return[{label:"Base MSRP:",value:t.baseMSRP||0,disclosureKey:e?"disclaimerMSRP":"disclaimerOptionPrice"},{label:"Total Options:",value:t.optionsPrice||0,prefix:"+",disclosureKey:e?"disclaimerOptionPackagePrice":"disclaimerOptionPrice1"},{label:"Total Fees:",value:t.caTotalFees||0},{label:"Destination:",value:t.destinationDeliveryCharge||0,prefix:"+",isNestedPricingRow:!0},{label:"Green Levy Tax:",value:t.caGreenLevy||0,prefix:"+",isNestedPricingRow:!0},{label:"AC TAX:",value:t.caACTax||0,prefix:"+",isNestedPricingRow:!0},{label:"Incentives:",value:t.pricingAdjustments||0,prefix:"-"},{label:"Luxury Tax:",value:t.caLuxuryTax||0,prefix:"+",disclosureKey:e?"disclosure70":"LuxuryTax"},{label:"Adjusted Price:",value:n.price||0,prefix:"=",disclosureKey:"disclaimerAdjustedPrice",valueSuffix:"+ applicable sales tax"}]},kt=(n={})=>{let{eta:a}=n;if(a){let e=t=>{let i=new Date;return i.setMonth(new Date().getMonth()+t),i.toLocaleString("default",{month:"long"})};switch(a){case"ETA_FOUR_MONTHS":return`Available in ${e(4)}`;case"ETA_THREE_MONTHS":return`Available in ${e(3)}`;case"ETA_TWO_MONTHS":return`Available in ${e(2)}`;case"ETA_THREE_FOUR_WEEKS":return"Available in 3-4 Weeks";case"ETA_THIS_WEEK":return"Available in 10 days";case"ETA_NEXT_WEEK":return"Available in 1-2 Weeks";case"ETA_NEXT_DAY":return"In Stock";default:return null}}return null},ge=class extends S{constructor(){super();this._vehicle=null;this._disclosures={};this._isViewed=!1;this._preloadCleanup=null;this._vdpLcpCleanup=null;this._disclaimerDetail="";this._consumerApp="VDP";this.handleCtaClick=e=>{var r,o,s,c;e.preventDefault();let t=e.currentTarget,i=(t==null?void 0:t.getAttribute("data-cta-intent"))||"view-details";if(i==="get-quote"){if(!this._vehicle)return;let l={year:this._vehicle.year,PACode:this._vehicle.dealerPACode||"",vin:this._vehicle.vin};this.dispatchEvent(new CustomEvent(De.OPEN_GOLF_FORM,{detail:l,bubbles:!0,composed:!0}));return}if(i==="view-details"){let l=V("view-details",(o=(r=this._vehicle)==null?void 0:r.model)!=null?o:""),d=this.buildDetailsUrl({intcmp:l});if(!d)return;this.dispatchSummaryCardEvent("summary-card-view-details",d),B(d);return}if(i==="buy-now"){let l=V("buy-now",(c=(s=this._vehicle)==null?void 0:s.model)!=null?c:""),d=this.buildDetailsUrl({intcmp:l,TertiarySource:"Config"});if(!d)return;this.dispatchSummaryCardEvent("summary-card-buy-now",d),B(d);return}if(i==="view-payment"){let l=this.buildDetailsUrl({openCalc:"true",intcmp:"siResults-monthlyPayment-cta-siVdp-peOpen"});if(!l)return;B(l);return}}}static get observedAttributes(){return[...S.baseObservedAttributes,"nameplate","consumer-app","is-viewed","campaign-id"]}get vehicle(){return this._vehicle}set vehicle(e){this._vehicle=e,this.render(),this.scheduleImagePreload(),this._scheduleVdpLcpPrefetch()}get disclosures(){return this._disclosures}set disclosures(e){this._disclosures=e,this.render()}get isViewed(){return this._isViewed}set isViewed(e){this._isViewed=e,this.render()}get brand(){return this._brand}set brand(e){this.setAttribute("brand",e)}get locale(){return this._locale}set locale(e){this.setAttribute("locale",e)}get env(){return this._env}set env(e){this.setAttribute("env",e)}get consumerApp(){return this._consumerApp}set consumerApp(e){this._consumerApp=e,this.setAttribute("consumer-app",e)}get campaignId(){return this._campaignId}set campaignId(e){this._campaignId=e,e?this.setAttribute("campaign-id",e):this.removeAttribute("campaign-id")}get nameplate(){return this._nameplate}set nameplate(e){this._nameplate=e,e?this.setAttribute("nameplate",e):this.removeAttribute("nameplate")}connectedCallback(){super.connectedCallback(),this.scheduleImagePreload(),this._scheduleVdpLcpPrefetch()}disconnectedCallback(){var e,t;(e=this._preloadCleanup)==null||e.call(this),this._preloadCleanup=null,(t=this._vdpLcpCleanup)==null||t.call(this),this._vdpLcpCleanup=null}scheduleImagePreload(){var i,r;if((i=this._preloadCleanup)==null||i.call(this),this._preloadCleanup=null,!((r=this._vehicle)!=null&&r.imageToken))return;let t=["INT:1"].map(o=>{let[s,c]=o.split(":");return W({token:this._vehicle.imageToken,imwidth:600,locale:this._locale,env:this._env,view:s,angle:parseInt(c,10)})});this._preloadCleanup=Q(t)}_scheduleVdpLcpPrefetch(){var e,t;(e=this._vdpLcpCleanup)==null||e.call(this),this._vdpLcpCleanup=null,(t=this._vehicle)!=null&&t.imageToken&&(this._vdpLcpCleanup=J(this,this._vehicle.imageToken,this._locale,this._env))}attributeChangedCallback(e,t,i){t!==i&&(super.attributeChangedCallback(e,t,i),e==="nameplate"&&(this._nameplate=i||void 0),e==="consumer-app"&&(this._consumerApp=i),e==="is-viewed"&&(this._isViewed=i==="true"),e==="campaign-id"&&(this._campaignId=i||void 0),this.render())}buildDetailsUrl(e){var o,s;let t=typeof window!="undefined"?window.location.host||window.location.hostname:"";if(!t)return null;let i=(o=this._vehicle)==null?void 0:o.detailsUrl;if(i)return Z(t,i,e);let r=(s=this._vehicle)==null?void 0:s.vin;return this._nameplate&&r?Fe(t,this._nameplate,r,e):null}dispatchSummaryCardEvent(e,t){if(!this._vehicle)return;let i=M(this._brand,this._locale,this._env),r={type:e,context:i,vehicle:{modelYear:String(this._vehicle.year),nameplate:this._vehicle.model,trim:this._vehicle.trim},...t?{destinationUrl:t}:{}},o=`siwc:${e}`;this.dispatchEvent(new CustomEvent(o,{detail:r,bubbles:!0,composed:!0}))}getActionRowHtml(){var t;let e=(t=this._vehicle)==null?void 0:t.ecommEnrolled;return this._consumerApp==="FBC"?`
${e?"Buy Now":"View Details"}
Request Details
`:`
View Details${this._brand==="lincoln"?` ${D}`:""}
`}getMatchBadgeHtml(){var s,c,l;let e=(s=this._vehicle)==null?void 0:s.matchType;if(!e)return"";let i={Exact:"success",Great:"info",Good:"moderate"}[e],r=e!=="Exact",o=e+" Match";return r?((l=(c=this._vehicle)==null?void 0:c.substitutedFilters)!=null?l:[]).every(h=>!!h.requested&&!!h.substituted)?`${re(i,o,this._brand)} `:"":re(i,o)}getBrandStyles(){return this._brand==="lincoln"?`
/* \u2500\u2500 Lincoln brand overrides \u2500\u2500 */
.btn-primary {
border-color: var(--lincoln-interactive-color, #485b65);
border-radius: var(--lincoln-button-radius, 4px);
color: var(--lincoln-interactive-color, #485b65);
}
.btn-primary:hover {
background-color: rgba(72, 91, 101, 0.05);
}
.btn-primary:active {
background-color: rgba(72, 91, 101, 0.1);
}
.btn-primary:focus-visible {
outline-color: var(--lincoln-interactive-color, #485b65);
}
.btn-tertiary {
color: var(--lincoln-interactive-color, #485b65);
}
.btn-tertiary:hover {
color: var(--lincoln-interactive-color, #485b65);
opacity: 0.8;
}
`:""}render(){var q,ke,Ae,Le,Te;if(!this.shadowRoot)return;if(!this._vehicle){this.shadowRoot.innerHTML='
';return}let{year:e,model:t,trim:i,imageToken:r,dealer:o,vin:s,eta:c,displayStatus:l,dealerLabel:d}=this._vehicle,p=this.buildDetailsUrl({intcmp:this._campaignId})||"#",h=kt({eta:c})||l||c||null,f=(q=this._locale)==null?void 0:q.toLowerCase().includes("ca"),m=typeof this._vehicle.price=="number"&&this._vehicle.price>0,x=this._vehicle.price,b;if(!m&&((ke=this._vehicle.pricing)!=null&&ke.length)){let g=f?this._vehicle.pricing.find(w=>{var _;return((_=w.disclosure)==null?void 0:_.key)==="disclaimerAdjustedPrice"}):(Ae=this._vehicle.pricing.find(w=>{var _;return((_=w.disclosure)==null?void 0:_.key)==="estimatedEmployeeNetPrice"}))!=null?Ae:this._vehicle.pricing.find(w=>{var _;return((_=w.disclosure)==null?void 0:_.key)==="disclaimerNetPrice"});g&&(x=g.value,b=g.disclosure)}this._disclaimerDetail=(b==null?void 0:b.detail)||"";let A=m?f?Et(this._vehicle,this._brand):_t(this._vehicle,this._brand):[],v=!m&&((Le=this._vehicle.pricing)!=null&&Le.length)?this._vehicle.pricing:[],E=m?je(this._vehicle,this._locale):{cardlabel:f?"Adjusted Price":(b==null?void 0:b.key)==="estimatedEmployeeNetPrice"?"Est. Employee Net Price":"Estimated Net Price",pricingTableLabel:f?"Adjusted Price:":"Estimated Net Price:"},L=m&&!!this._vehicle.monthlyPayment&&(this._vehicle.planType==="MSRP"||!this._vehicle.planType),oe=["EXT:5","INT:1"],ae=0,[H,X]=oe[ae].split(":"),Y=r?W({token:r,imwidth:600,locale:this._locale,env:this._env,view:H,angle:parseInt(X,10)}):"https://via.placeholder.com/320x200?text=Vehicle+Image",U=m?Ct(this._vehicle):[],z=this._vehicle.highlightedFeatures||[],G=this._brand==="lincoln"?"var(--graphite-lite, #485b65)":"var(--text-interactive)",C=`
:host {
display: block;
width: 100%;
max-width: var(--richer-inventory-card-max-width, 440px);
min-width: 276px;
height: 100%;
--si-font-family: 'Ford F-1', sans-serif;
font-family: var(--font-body-1-regular-font-family, var(--caption-semibold-font-family, var(--si-font-family)));
--card-bg: var(--color-fill-onlight-subtlest, #fafafa);
--content-bg: var(--color-fill-onlight-highcontrast-default, white);
--border-color: var(--color-stroke-onlight-dividers-middlegray, #f0f0f0);
--text-strong: var(--color-text-onlight-strong, black);
--text-moderate: var(--color-text-onlight-moderate-default, #333);
--text-subtle: var(--color-text-onlight-subtle, #666);
--text-success: var(--color-text-onlight-success, #008200);
--text-interactive: var(--color-text-onlight-interactive, #0562d2);
--space-xs: 4px;
--space-md: 12px;
--space-lg: 16px;
--space-xl: 20px;
}
:host([brand="lincoln"]) {
--si-font-family: 'Lincoln Proxima Nova', sans-serif;
}
.card {
border: 1px solid var(--border-color);
border-radius: var(--border-radius-2xl, 24px);
overflow: hidden;
background: var(--card-bg);
display: flex;
flex-direction: column;
height: 100%;
}
.image-section {
position: relative;
background: var(--card-bg);
width: 100%;
max-height: 206px;
display: flex;
flex-direction: column;
align-items: center;
}
.image-link {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
padding: 0 24px;
box-sizing: border-box;
text-decoration: none;
}
.image-container {
position: relative;
width: 100%;
max-width: 320px;
aspect-ratio: 16/9;
padding-bottom: 37px;
}
.image-container img {
max-width: 100%;
object-fit: fill;
}
.content-section {
padding: calc(var(--semantic-space-xl, 24) * 1px) var(--space-xl);
background: var(--content-bg);
border: 1px solid var(--border-color);
border-radius: 0 0 var(--border-radius-2xl, 24px) var(--border-radius-2xl, 24px);
display: flex;
flex-direction: column;
gap: var(--space-lg);
}
.header-btn {
background: none;
border: none;
padding: 0;
text-align: left;
cursor: pointer;
display: flex;
flex-direction: column;
gap: var(--space-xs);
}
.header-title {
/* caption-semibold token: 12px/16px semibold */
font-family: var(--caption-semibold-font-family, var(--si-font-family));
font-size: var(--caption-semibold-font-size, 12px);
font-weight: var(--caption-semibold-font-weight, 600);
line-height: var(--caption-semibold-line-height, 16px);
color: var(--text-strong);
}
.header-trim {
/* title-semibold token: 24px/32px semibold */
font-family: var(--title-semibold-font-family, var(--si-font-family));
font-size: var(--title-semibold-font-size, 24px);
font-weight: var(--title-semibold-font-weight, 600);
line-height: var(--title-semibold-line-height, 32px);
color: var(--text-strong);
}
.divider {
height: 1px;
background: var(--border-color);
width: 100%;
}
.pricing-section {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: var(--space-md);
}
.pricing-block {
display: flex;
flex-direction: column;
}
.price-val {
/* body-1-bold token: 16px/24px bold */
font-family: var(--body-1-bold-font-family, var(--si-font-family));
font-size: var(--body-1-bold-font-size, 16px);
font-weight: var(--body-1-bold-font-weight, 700);
line-height: var(--body-1-bold-line-height, 24px);
color: var(--text-moderate);
margin-bottom: 2px;
}
.price-val .mo-suffix {
/* body-2-semibold token: 14px/20px semibold */
font-family: var(--body-2-semibold-font-family, var(--si-font-family));
font-size: var(--body-2-semibold-font-size, 14px);
font-weight: var(--body-2-semibold-font-weight, 600);
line-height: var(--body-2-semibold-line-height, 20px);
}
.price-label {
/* caption-regular token: 12px/16px regular */
font-family: var(--caption-regular-font-family, var(--si-font-family));
font-size: var(--caption-regular-font-size, 12px);
line-height: var(--caption-regular-line-height, 16px);
color: var(--text-subtle);
display: flex;
align-items: center;
gap: 0;
}
${ee}
.info-btn svg { color: ${G}; }
.monthly-btn {
background: var(--color-fill-onlight-informational-subtle, #e6f2fc);
color: var(--text-interactive);
padding: 4px 8px;
border-radius: var(--border-radius-sm, 4px);
border: none;
/* caption-medium token: 12px/16px medium */
font-family: var(--caption-medium-font-family, var(--si-font-family));
font-size: var(--caption-medium-font-size, 12px);
font-weight: var(--caption-medium-font-weight, 500);
line-height: var(--caption-medium-line-height, 16px);
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 4px;
align-self: flex-start;
}
.feature-list {
list-style-type: disc;
list-style-position: inside;
padding-left: 0;
margin: 0;
color: var(--text-moderate);
/* caption-regular token: 12px/16px regular */
font-family: var(--caption-regular-font-family, var(--si-font-family));
font-size: var(--caption-regular-font-size, 12px);
line-height: var(--caption-regular-line-height, 16px);
min-height: 120px;
}
.feature-list li {
padding-bottom: var(--space-xs);
display: flex;
align-items: center;
}
.feature-list li span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.dealer-details {
display: flex;
flex-direction: column;
gap: var(--space-xs);
/* caption-medium token: 12px/16px 500 */
font-family: var(--caption-medium-font-family, var(--si-font-family));
font-size: var(--caption-medium-font-size, 12px);
font-weight: var(--caption-medium-font-weight, 500);
line-height: var(--caption-medium-line-height, 16px);
color: var(--text-subtle);
}
.status-text {
/* caption-bold token: 12px/16px bold */
font-family: var(--caption-bold-font-family, var(--si-font-family));
font-size: var(--caption-bold-font-size, 12px);
font-weight: var(--caption-bold-font-weight, 700);
line-height: var(--caption-bold-line-height, 16px);
color: var(--text-success);
}
.action-row {
padding: var(--space-lg) var(--space-xl);
display: flex;
gap: var(--space-lg, 16px);
justify-content: space-between;
align-items: center;
margin-top: auto;
}
.btn-primary {
height: 40px;
border-radius: 9999px;
border: 1px solid var(--semantic-color-border-fill-onlight-interactive, #0562d2);
background-color: transparent;
cursor: pointer;
transition: all 0.2s ease-in-out;
box-sizing: border-box;
font-family: var(--font-body-2-bold-font-family, var(--si-font-family));
font-size: calc(var(--font-body-2-bold-font-size, 14) * 1px);
font-weight: var(--font-body-2-bold-font-weight, 700);
line-height: calc(var(--font-body-2-bold-line-height, 20) * 1px);
color: var(--semantic-color-text-onlight-interactive, #0562d2);
display: inline-flex;
align-items: center;
justify-content: center;
padding: calc(var(--semantic-space-sm, 8) * 1px) calc(var(--semantic-space-md, 12) * 1px);
}
.btn-primary:hover {
background-color: var(--semantic-color-background-onlight-hover, rgba(5, 98, 210, 0.05));
}
.btn-primary:active {
background-color: var(--semantic-color-background-onlight-pressed, rgba(5, 98, 210, 0.1));
}
.btn-primary:focus-visible {
outline: 2px solid var(--semantic-color-border-fill-onlight-interactive, #0562d2);
outline-offset: 2px;
}
.btn-tertiary {
background: none;
border: none;
font-family: var(--body-2-bold-font-family, var(--si-font-family));
font-size: var(--body-2-bold-font-size, 14px);
font-weight: 700;
line-height: var(--body-2-bold-line-height, 20px);
color: var(--semantic-color-text-onlight-interactive);
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
padding: calc(var(--semantic-space-sm, 8) * 1px) calc(var(--semantic-space-md, 12) * 1px);
}
.btn-tertiary:hover {
color: var(--semantic-color-text-onlight-interactive-hover);
}
.flex-1 {
flex: 1;
}
${qe}
${this.getBrandStyles()}
.match-badge-btn {
background: none;
border: none;
padding: 0;
cursor: pointer;
pointer-events: auto;
}
.badges-overlay {
position: absolute;
top: 16px;
left: 16px;
right: 16px;
z-index: 1;
display: flex;
align-items: center;
gap: 4px;
pointer-events: none;
}
@media (max-width: 767px) {
:host {
/* Use the variable when set by a parent carousel; fall back to 358px for standalone use */
max-width: var(--richer-inventory-card-max-width, 358px);
}
}
`,k=A.length>0?A.map(g=>{var _;let w=g.disclosureKey?(_=this._disclosures)==null?void 0:_[g.disclosureKey]:null;return{label:g.label,formattedValue:`${g.prefix==="-"&&g.value>0?"- ":""}${this.formatPrice(g.value)}${g.valueSuffix?" "+g.valueSuffix:""}`,disclosureKey:g.disclosureKey,disclosureId:w==null?void 0:w.id,disclosureTitle:w==null?void 0:w.title,bold:g.prefix==="="}}):v.map(g=>{var w,_,Ie;return{label:g.label,formattedValue:this.formatPrice(g.value),disclosureKey:((w=g.disclosure)==null?void 0:w.key)||void 0,disclosureId:((_=g.disclosure)==null?void 0:_.id)||void 0,disclosureTitle:((Ie=g.disclosure)==null?void 0:Ie.title)||void 0}}),T={};v.length>0&&v.forEach(g=>{var w,_;(w=g.disclosure)!=null&&w.key&&((_=g.disclosure)!=null&&_.id)&&(T[g.disclosure.key]={id:g.disclosure.id,title:g.disclosure.title||"",detail:g.disclosure.detail||""})}),this._disclosures&&Object.keys(this._disclosures).forEach(g=>{let w=this._disclosures[g];w!=null&&w.id&&(T[g]={id:w.id,title:w.title||"",detail:w.detail||""})}),this.shadowRoot.innerHTML=`
${this.getMatchBadgeHtml()}
${this._isViewed?re("success","Viewed"):""}
${x&&x>0?`
${u(this.formatPrice(x))}
${u(E.cardlabel)}${b!=null&&b.id?`${u(b.id)} `:""}
${L?"":`${F(this._brand)} `}
`:""}
${L?`
${u(this.formatPrice(this._vehicle.monthlyPayment))} /mo.
${this._vehicle.paymentMethod==="LEASE"?"Lease":"Financing"}
${F(this._brand)}
`:""}
${x&&x>0?"
":""}
${!f&&m?`
${L?"Edit Monthly Payment":"See Monthly Payment"} ${D}
`:""}
${U.length>0?`
${U.map(g=>`${u((g.prefix||"")+g.value+(g.suffix?" "+g.suffix:""))} `).join("")}
`:z.length>0?`
${z.map(g=>`${u(g.label)} `).join("")}
`:""}
${h?`
${u(h)}
`:""}
${u(d||o)}
${s?`
VIN: ${u(s)}
`:""}
${this.getActionRowHtml()}
`;let R=document.createElement("pricing-tooltip");R.sectionTitle=E.pricingTableLabel,R.rows=k,R.disclosureLookup=T,(Te=this.shadowRoot.querySelector(".content-section"))==null||Te.appendChild(R),this.setupListeners()}setupListeners(){var o,s,c;if(!this.shadowRoot)return;let e=this.shadowRoot.querySelector("pricing-tooltip"),t=this.shadowRoot.querySelector('[data-action="open-tooltip"]');this.shadowRoot.querySelectorAll('[data-action="cta-click"]').forEach(l=>{l.addEventListener("click",this.handleCtaClick)}),e&&t&&(e.triggerElement=t,t.addEventListener("click",l=>{l.stopPropagation(),this.dispatchSummaryCardEvent("summary-card-disclosure-open"),e.toggle()}),e.addEventListener("tooltip-close",()=>{requestAnimationFrame(()=>t.focus())}));let r=this.shadowRoot.querySelector('[data-action="open-match-info"]');if(r&&this._vehicle){let l=document.createElement("match-info-popover");l.matchedFilters=(o=this._vehicle.matchedFilters)!=null?o:[],l.substitutedFilters=(s=this._vehicle.substitutedFilters)!=null?s:[],l.packages=(c=this._vehicle.packages)!=null?c:[],l.triggerElement=r,this.shadowRoot.appendChild(l),r.addEventListener("click",d=>{d.stopPropagation(),l.toggle()}),l.addEventListener("match-info-close",()=>{requestAnimationFrame(()=>r.focus())})}te(this.shadowRoot,()=>this._disclaimerDetail)}};customElements.get("richer-inventory-card")||customElements.define("richer-inventory-card",ge);var fe=class extends HTMLElement{constructor(){super();this._vehicles=[];this._brand="ford";this._locale="en_us";this._env="prod";this._cardVariant="default";this._consumerApp="VDP";this._activeIndex=0;this._slideWidth=320;this._containerWidth=0;this._isMobile=!1;this._resizeObserver=null;this.handleResize=()=>{this.updateLayout(),this.updateControls(),this.renderPagination()};this.attachShadow({mode:"open"})}getNextComposedAncestor(e){if(!e)return null;if(e.parentElement)return e.parentElement;let t=e.getRootNode();return t instanceof ShadowRoot?t.host:null}static get observedAttributes(){return["brand","locale","env","nameplate","consumer-app","card-variant","campaign-id","marketing-cta-href","marketing-card-heading","marketing-card-body","marketing-card-cta-label"]}get vehicles(){return this._vehicles}set vehicles(e){this._vehicles=e,this.render()}get cardVariant(){return this._cardVariant}set cardVariant(e){this._cardVariant=e,this.render()}get campaignId(){return this._campaignId}set campaignId(e){this._campaignId=e,e?this.setAttribute("campaign-id",e):this.removeAttribute("campaign-id")}get marketingCtaHref(){return this._marketingCtaHref}set marketingCtaHref(e){this._marketingCtaHref=e,e?this.setAttribute("marketing-cta-href",e):this.removeAttribute("marketing-cta-href")}get marketingCardHeading(){return this._marketingCardHeading}set marketingCardHeading(e){this._marketingCardHeading=e,e?this.setAttribute("marketing-card-heading",e):this.removeAttribute("marketing-card-heading")}get marketingCardBody(){return this._marketingCardBody}set marketingCardBody(e){this._marketingCardBody=e,e?this.setAttribute("marketing-card-body",e):this.removeAttribute("marketing-card-body")}get marketingCardCtaLabel(){return this._marketingCardCtaLabel}set marketingCardCtaLabel(e){this._marketingCardCtaLabel=e,e?this.setAttribute("marketing-card-cta-label",e):this.removeAttribute("marketing-card-cta-label")}get env(){return this._env}set env(e){this.setAttribute("env",e)}get consumerApp(){return this._consumerApp}set consumerApp(e){this._consumerApp=e,this.setAttribute("consumer-app",e)}connectedCallback(){this.render(),this._resizeObserver=new ResizeObserver(this.handleResize),this._resizeObserver.observe(this)}disconnectedCallback(){var e;(e=this._resizeObserver)==null||e.disconnect(),this._resizeObserver=null}attributeChangedCallback(e,t,i){var r,o;if(t!==i){if(e==="brand"&&(this._brand=i),e==="locale"&&(this._locale=i),e==="env"&&(this._env=i),e==="nameplate"&&(this._nameplate=i||void 0),e==="consumer-app"&&(this._consumerApp=i),e==="marketing-cta-href"){this._marketingCtaHref=i||void 0,this.render();return}if(e==="marketing-card-heading"){this._marketingCardHeading=i||void 0,this.render();return}if(e==="marketing-card-body"){this._marketingCardBody=i||void 0,this.render();return}if(e==="marketing-card-cta-label"){this._marketingCardCtaLabel=i||void 0,this.render();return}if(e==="campaign-id"){this._campaignId=i||void 0;let l=this._cardVariant==="rich"?"richer-inventory-card":"inventory-card",d=(r=this.shadowRoot)==null?void 0:r.querySelectorAll(l);d==null||d.forEach(p=>{i?p.setAttribute("campaign-id",i):p.removeAttribute("campaign-id")});return}if(e==="card-variant"){this._cardVariant=i==="rich"?"rich":"default",this.render();return}let s=this._cardVariant==="rich"?"richer-inventory-card":"inventory-card",c=(o=this.shadowRoot)==null?void 0:o.querySelectorAll(s);c==null||c.forEach(l=>l.setAttribute(e,i))}}render(){if(!this.shadowRoot)return;let e=`
:host {
display: block;
width: 100%;
font-family: var(--font-body-1-regular-font-family, var(--caption-semibold-font-family, 'Ford F-1', sans-serif));
}
.carousel-wrapper {
position: relative;
width: 100%;
}
.list-container {
display: grid;
grid-auto-flow: column;
/* CSS grid sizes every column to --slide-width automatically;
no need to set inline styles on individual slides. */
grid-auto-columns: var(--slide-width, 320px);
gap: 16px; /* Figma: gap-[16px] */
overflow-x: auto;
padding-bottom: 16px;
scroll-behavior: smooth;
scrollbar-width: none;
scroll-snap-type: x mandatory;
overscroll-behavior-x: contain;
}
.slide {
scroll-snap-align: start;
}
/* Hide scrollbar for cleaner look */
.list-container::-webkit-scrollbar {
height: 6px;
}
.list-container::-webkit-scrollbar-thumb {
background-color: var(--color-fill-onlight-moderate, var(--semantic-color-fill-onlight-moderate, #999));
border-radius: 4px;
}
.nav-btn {
position: absolute;
top: 100px;
width: 40px;
height: 40px;
border-radius: 9999px;
background: #000;
display: none;
align-items: center;
justify-content: center;
border: 0;
cursor: pointer;
z-index: 2;
}
.nav-btn svg {
display: block;
}
.nav-btn[disabled] {
opacity: 0.4;
cursor: default;
visibility: hidden;
}
.nav-prev {
left: -24px;
}
.nav-next {
right: -24px;
}
.pagination {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
margin-top: 8px;
}
.pagination button {
border: 0;
background: transparent;
padding: 0;
cursor: pointer;
}
.dot {
width: 6px;
height: 6px;
border-radius: 9999px;
background: #cfcfcf;
display: block;
}
.dot.active {
width: 24px;
background: #111;
}
@media (min-width: 768px) {
.list-container {
/* Keep overflow-x scrollable so touch/trackpad swipe still works
alongside the arrow buttons; hide the scrollbar visually. */
overflow-x: auto;
padding-bottom: 0;
scroll-snap-type: x mandatory;
}
.list-container::-webkit-scrollbar {
display: none;
}
.nav-btn {
display: flex;
}
.pagination {
display: none !important;
}
}
`,t=`
`;this.shadowRoot.innerHTML=`
`;let i=this.shadowRoot.querySelector("#list");if(!i)return;if(this._vehicles.length===0){i.innerHTML="No similar vehicles found.
";return}i.innerHTML="";let r=this._cardVariant==="rich"?"richer-inventory-card":"inventory-card";if(this._vehicles.forEach(o=>{let s=document.createElement("div");s.className="slide";let c=document.createElement(r);c.vehicle=o,c.setAttribute("brand",this._brand),c.setAttribute("locale",this._locale),c.setAttribute("env",this._env),c.setAttribute("consumer-app",this._consumerApp),this._nameplate?c.setAttribute("nameplate",this._nameplate):c.removeAttribute("nameplate"),this._campaignId&&c.setAttribute("campaign-id",this._campaignId),s.appendChild(c),i.appendChild(s)}),this._consumerApp==="FBC"){let o=document.createElement("div");o.className="slide";let s=document.createElement("marketing-card");s.setAttribute("brand",this._brand),s.setAttribute("locale",this._locale),s.setAttribute("env",this._env),this._marketingCtaHref&&s.setAttribute("cta-href",this._marketingCtaHref),this._marketingCardHeading&&s.setAttribute("heading",this._marketingCardHeading),this._marketingCardBody&&s.setAttribute("body",this._marketingCardBody),this._marketingCardCtaLabel&&s.setAttribute("cta-label",this._marketingCardCtaLabel),o.appendChild(s),i.appendChild(o)}this.bindCarouselEvents(),this.updateLayout(),this.updateControls(),this.renderPagination()}bindCarouselEvents(){if(!this.shadowRoot)return;let e=this.shadowRoot.querySelector("#list");if(!e)return;let t=this.shadowRoot.querySelector('[data-action="prev"]'),i=this.shadowRoot.querySelector('[data-action="next"]');t==null||t.addEventListener("click",()=>this.scrollToIndex(this._activeIndex-1)),i==null||i.addEventListener("click",()=>this.scrollToIndex(this._activeIndex+1)),e.addEventListener("scroll",()=>{let o=this._slideWidth+16,s=Math.round(e.scrollLeft/o);this._activeIndex=Math.max(0,Math.min(s,this.getTotalSlideCount()-1)),this.updateControls(),this.renderPagination()}),e.addEventListener("wheel",r=>{if(Math.abs(r.deltaY)>Math.abs(r.deltaX)){r.preventDefault();let o=this.findScrollParent();o instanceof Window?o.scrollBy(0,r.deltaY):o.scrollTop+=r.deltaY}},{passive:!1})}findScrollParent(){let e=this.getNextComposedAncestor(this);for(;e instanceof HTMLElement;){let{overflowY:t}=getComputedStyle(e);if(/(auto|scroll)/.test(t)&&e.scrollHeight>e.clientHeight)return e;e=this.getNextComposedAncestor(e)}return window}updateLayout(){if(!this.shadowRoot)return;let e=this.shadowRoot.querySelector("#list"),t=this.shadowRoot.querySelector(".carousel-wrapper");if(!e||!t)return;let i=t.getBoundingClientRect().width||this.getBoundingClientRect().width;if(!i)return;let r=window.innerWidth<768,o=16,s=440,c=320,l;if(r)l=Math.min(i,s);else{let h=4;for(l=Math.floor((i-(h-1)*o)/h);l1;)h-=1,l=Math.floor((i-(h-1)*o)/h);l=Math.min(l,s)}this._containerWidth=i,this._slideWidth=l,this._isMobile=r,this.style.setProperty("--slide-width",`${l}px`),Array.from(e.querySelectorAll(".slide")).forEach(p=>{let h=p.querySelector("inventory-card");h==null||h.style.setProperty("--inventory-card-max-width",`${l}px`);let f=p.querySelector("richer-inventory-card");f==null||f.style.setProperty("--richer-inventory-card-max-width",`${l}px`);let m=p.querySelector("marketing-card");m==null||m.style.setProperty("--marketing-card-max-width",`${l}px`)})}getSlidesPerView(){return Math.max(1,Math.floor((this._containerWidth+16)/this._slideWidth))}getTotalSlideCount(){return this._vehicles.length+(this._consumerApp==="FBC"?1:0)}scrollToIndex(e){if(!this.shadowRoot)return;let t=this.shadowRoot.querySelector("#list");if(!t)return;let i=16,r=Math.max(0,this.getTotalSlideCount()-this.getSlidesPerView()),o=Math.max(0,Math.min(e,r));this._activeIndex=o,t.scrollTo({left:o*(this._slideWidth+i),behavior:"smooth"}),this.updateControls(),this.renderPagination()}updateControls(){if(!this.shadowRoot)return;let e=this.shadowRoot.querySelector('[data-action="prev"]'),t=this.shadowRoot.querySelector('[data-action="next"]'),i=Math.max(0,this.getTotalSlideCount()-this.getSlidesPerView());e&&(e.disabled=this._activeIndex<=0||this._isMobile),t&&(t.disabled=this._activeIndex>=i||this._isMobile)}renderPagination(){if(!this.shadowRoot)return;let e=this.shadowRoot.querySelector("#pagination");if(!e)return;if(!this._isMobile){e.innerHTML="";return}let t=this.getTotalSlideCount(),i=Math.max(1,t-this.getSlidesPerView()+1),o=Math.min(i,5),s=Math.max(0,Math.min(this._activeIndex-2,i-o)),c=s+o;e.innerHTML="";for(let l=s;lthis.scrollToIndex(l));let p=document.createElement("span");p.className=`dot ${l===this._activeIndex?"active":""}`,d.appendChild(p),e.appendChild(d)}}};customElements.get("inventory-list")||customElements.define("inventory-list",fe);async function Xe(n){let{url:a,signal:e}=n;try{let t=await fetch(a,{signal:e,cache:"no-store"});return t.ok?{ok:!0,data:await t.json()}:{ok:!1,reason:"http",message:`HTTP ${t.status}: Failed to fetch inventory`}}catch(t){return t instanceof Error&&t.name==="AbortError"?{ok:!1,reason:"abort",message:t.message}:{ok:!1,reason:"network",message:t instanceof Error?t.message:"Unknown fetch error"}}}var At={ford:{en_us:{local:"https://ford.local:3000/inventory",sbox:"https://www.sevo-sb.ford.com/inventory",dev:"https://wwwdev.search-inventory.ford.com/inventory",qa:"https://wwwqa.ford.com/inventory",stage:"https://wwwqa2.ford.com/inventory",perf:"https://wwwperf.search-inventory.ford.com/inventory",prod:"https://www.ford.com/inventory"},en_ca:{local:"https://ford.ca.local:3000/inventory",sbox:"https://www.sevo-sb.ford.com/inventory",dev:"https://wwwdev.search-inventory.ford.com/inventory",qa:"https://wwwqa.ford.ca/inventory",stage:"https://wwwqa2.ford.ca/inventory",perf:"https://wwwperf.search-inventory.ford.ca/inventory",prod:"https://www.ford.ca/inventory"},fr_ca:{local:"https://fr.ford.ca.local:3000/inventory",sbox:"https://www.sevo-sb.ford.com/inventory",dev:"https://wwwdev.search-inventory.ford.com/inventory",qa:"https://frqa.ford.ca/inventory",stage:"https://frqa2.ford.ca/inventory",perf:"https://wwwperf.search-inventory.ford.com/inventory",prod:"https://www.ford.ca/inventory"}},lincoln:{en_us:{local:"https://lincoln.local:3000/inventory",sbox:"https://www.sevo-sb.ford.com/inventory",dev:"https://wwwdev.search-inventory.ford.com/inventory",qa:"https://wwwqa.lincoln.com/inventory",stage:"https://wwwqa2.lincoln.com/inventory",perf:"https://wwwperf.search-inventory.ford.com/inventory",prod:"https://www.lincoln.com/inventory"},en_ca:{local:"https://lincolncanada.local:3000/inventory",sbox:"https://www.sevo-sb.ford.com/inventory",dev:"https://wwwdev.search-inventory.ford.com/inventory",qa:"https://wwwqa.lincolncanada.com/inventory",stage:"https://wwwqa2.lincolncanada.com/inventory",perf:"https://wwwperf.search-inventory.ford.com/inventory",prod:"https://www.lincolncanada.com/inventory"},fr_ca:{local:"https://fr.lincolncanada.local:3000/inventory",sbox:"https://www.sevo-sb.ford.com/inventory",dev:"https://wwwqa.lincolncanada.com/inventory",qa:"https://frqa.lincolncanada.com/inventory",stage:"https://frqa2.lincolncanada.com/inventory",perf:"https://wwwperf.search-inventory.ford.com/inventory",prod:"https://www.lincolncanada.com/inventory"}}},ve=class extends HTMLElement{constructor(){super();this._loading=!1;this._error=null;this._data=null;this._currentCounts=null;this._abortController=null;this._consumerApp="VDP";this._fetchDebounceTimer=null;this.handleViewMoreClick=()=>{let e=this.getAttribute("nameplate");if(!e)return;let t=this.getAttribute("brand")||"ford",i=this.getAttribute("locale")||"en_us",r=this.getAttribute("env")||"prod",s={type:"summary-card-view-more-inventory",context:M(t,i,r),vehicle:{modelYear:"",nameplate:e},destinationUrl:this.getResultsUrlWithCampaign()};this.dispatchEvent(new CustomEvent(N.VIEW_MORE_INVENTORY,{detail:s,bubbles:!0,composed:!0}))};this.attachShadow({mode:"open"})}static get observedAttributes(){return["nameplate","postal-code","radius","brand","locale","env","limit","results-campaign-id","config-token","dealers","is-dealer-mode","details-campaign-id","vin-to-exclude","consumer-app","heading","hide-footer","marketing-card-heading","marketing-card-body","marketing-card-cta-label"]}get nameplate(){return this.getAttribute("nameplate")}set nameplate(e){e?this.setAttribute("nameplate",e):this.removeAttribute("nameplate")}get postalCode(){return this.getAttribute("postal-code")}set postalCode(e){e?this.setAttribute("postal-code",e):this.removeAttribute("postal-code")}get radius(){return this.getAttribute("radius")}set radius(e){e?this.setAttribute("radius",String(e)):this.removeAttribute("radius")}get brand(){return this.getAttribute("brand")}set brand(e){e?this.setAttribute("brand",e):this.removeAttribute("brand")}get locale(){return this.getAttribute("locale")}set locale(e){e?this.setAttribute("locale",e):this.removeAttribute("locale")}get env(){return this.getAttribute("env")}set env(e){e?this.setAttribute("env",e):this.removeAttribute("env")}get limit(){return this.getAttribute("limit")}set limit(e){e?this.setAttribute("limit",String(e)):this.removeAttribute("limit")}get resultsCampaignId(){return this.getAttribute("results-campaign-id")}set resultsCampaignId(e){e?this.setAttribute("results-campaign-id",e):this.removeAttribute("results-campaign-id")}get detailsCampaignId(){return this.getAttribute("details-campaign-id")}set detailsCampaignId(e){e?this.setAttribute("details-campaign-id",e):this.removeAttribute("details-campaign-id")}get dealers(){return this.getAttribute("dealers")}set dealers(e){e?this.setAttribute("dealers",e):this.removeAttribute("dealers")}get isDealerMode(){return this.hasAttribute("is-dealer-mode")}set isDealerMode(e){e?this.setAttribute("is-dealer-mode",""):this.removeAttribute("is-dealer-mode")}get configToken(){return this.getAttribute("config-token")}set configToken(e){e?this.setAttribute("config-token",e):this.removeAttribute("config-token")}get vinToExclude(){return this.getAttribute("vin-to-exclude")}set vinToExclude(e){e?this.setAttribute("vin-to-exclude",e):this.removeAttribute("vin-to-exclude")}get heading(){return this.getAttribute("heading")}set heading(e){e===null?this.removeAttribute("heading"):this.setAttribute("heading",e)}get hideFooter(){return this.hasAttribute("hide-footer")}set hideFooter(e){e?this.setAttribute("hide-footer",""):this.removeAttribute("hide-footer")}get marketingCardHeading(){return this.getAttribute("marketing-card-heading")}set marketingCardHeading(e){e?this.setAttribute("marketing-card-heading",e):this.removeAttribute("marketing-card-heading")}get marketingCardBody(){return this.getAttribute("marketing-card-body")}set marketingCardBody(e){e?this.setAttribute("marketing-card-body",e):this.removeAttribute("marketing-card-body")}get marketingCardCtaLabel(){return this.getAttribute("marketing-card-cta-label")}set marketingCardCtaLabel(e){e?this.setAttribute("marketing-card-cta-label",e):this.removeAttribute("marketing-card-cta-label")}get consumerApp(){return this._consumerApp}set consumerApp(e){this._consumerApp=e,this.setAttribute("consumer-app",e)}get currentCounts(){return this._currentCounts}connectedCallback(){!this.hasAttribute("brand")&&typeof window!="undefined"&&this.setAttribute("brand",O(window.location.hostname)),this.scheduleFetch()}disconnectedCallback(){this._fetchDebounceTimer!==null&&(clearTimeout(this._fetchDebounceTimer),this._fetchDebounceTimer=null)}attributeChangedCallback(e,t,i){if(t!==i){if(e==="consumer-app"){this._consumerApp=i||"VDP";return}if(e==="heading"||e==="hide-footer"){this.render();return}this.scheduleFetch()}}scheduleFetch(){this._fetchDebounceTimer!==null&&clearTimeout(this._fetchDebounceTimer),this._fetchDebounceTimer=setTimeout(()=>{this._fetchDebounceTimer=null,this.fetchData()},0)}getMatchCountMsg(){if(!this._data||!this._data.counts)return"";let e=this._data.counts,t=this.getAttribute("radius")||"20",i=this.getAttribute("locale")||"en_us",r=this.getAttribute("postal-code")||"",o=i.includes("ca")?r:r.slice(0,5),s=i.includes("ca")?"km":"miles";return e.exact<=2?`${e.total} matching vehicles within ${t} ${s} of ${o}`:e.exact<=100?`${e.exact} matching vehicles within ${t} ${s} of ${o}`:`100+ matching vehicles within ${t} ${s} of ${o}`}getResultsUrlWithCampaign(){if(!this._data||!this._data.resultsUrl)return"";let e=this._data.resultsUrl,t=this.getAttribute("nameplate");if(t){let r=V("view-more-inventory",t);try{let o=new URL(e,"https://example.com"),s=new URLSearchParams(o.search);return s.set("intcmp",r),`${o.pathname}?${s.toString()}`}catch{return e}}let i=this.getAttribute("results-campaign-id");if(!i)return e;try{let r=new URL(e,"https://example.com"),o=new URLSearchParams(r.search);return o.set("intcmp",i),`${r.pathname}?${o.toString()}`}catch{return e}}async fetchData(){var m,x;this._abortController&&this._abortController.abort(),this._abortController=new AbortController;let e=this._abortController.signal,t=this.getAttribute("nameplate"),i=this.getAttribute("postal-code"),r=this.getAttribute("radius")||"20",o=this.getAttribute("brand")||"ford",s=this.getAttribute("locale")||"en_us",c=this.getAttribute("env")||"prod",l=this.getAttribute("limit")||"5",d=this.getAttribute("config-token"),p=this.getAttribute("dealers"),h=this.hasAttribute("is-dealer-mode");if(!t||!i){this._currentCounts=null;return}let f=s.includes("ca")?i:i.slice(0,5);this._loading=!0,this._error=null,this.render();try{let b=((x=(m=At[o])==null?void 0:m[s])==null?void 0:x[c])||"https://shop.ford.com",A=new URLSearchParams({postalCode:f,pageSize:String(parseInt(l,10)+1)});r&&A.set("radius",r),d&&A.set("configToken",d),p&&A.set("dealers",decodeURIComponent(p)),h&&(A.set("isDealerMode","true"),A.set("spotBuy","true"));let v=`${b}/api/${o}/${s}/${t}/results?${A.toString()}`;console.log("Fetching inventory:",v);let E=await Xe({url:v,signal:e});if(!E.ok){if(E.reason==="abort")return;throw new Error(E.message)}let L=E.data;e.aborted||(this._data=L,this._currentCounts=L.counts?{exact:L.counts.exact,similar:L.counts.similar}:null,this._loading=!1,this.dispatchCountsEvent(L),this.render())}catch(b){if(b.name==="AbortError")return;this._data||(this._currentCounts=null),this._error=b.message,this._loading=!1,this.render()}}getBrandStyles(){return(this.getAttribute("brand")||"ford")==="lincoln"?`
/* \u2500\u2500 Lincoln brand overrides \u2500\u2500 */
.view-more-btn {
border-color: var(--lincoln-interactive-color, #485b65);
border-radius: var(--lincoln-button-radius, 4px);
}
.view-more-btn:hover {
background-color: rgba(72, 91, 101, 0.05);
}
.view-more-btn:active {
background-color: rgba(72, 91, 101, 0.1);
}
.view-more-btn:focus-visible {
outline-color: var(--lincoln-interactive-color, #485b65);
}
.view-more-text {
color: var(--lincoln-interactive-color, #485b65);
}
.chevron-icon {
color: var(--lincoln-interactive-color, #485b65);
}
`:""}render(){if(!this.shadowRoot)return;let e=`
:host {
display: block;
font-family: var(--font-body-1-regular-font-family, 'FordF1', sans-serif);
}
.loading {
padding: calc(var(--semantic-space-xl, 24) * 1px);
text-align: center;
color: var(--semantic-color-text-onlight-moderate-default, #333);
}
.error {
color: var(--semantic-color-text-onlight-danger, #bf152c);
padding: calc(var(--semantic-space-xl, 24) * 1px);
}
h2 {
font-family: var(--font-headline-3-large-semibold-font-family, 'FordF1', sans-serif);
font-size: calc(var(--font-headline-3-large-semibold-font-size, 32) * 1px);
font-weight: var(--font-headline-3-large-semibold-font-weight, 600);
line-height: calc(var(--font-headline-3-large-semibold-line-height, 40) * 1px);
color: var(--semantic-color-text-onlight-strong, black);
margin: 0 0 calc(var(--semantic-space-xl, 24) * 1px) 0;
}
.footer-container {
display: flex;
align-items: center;
gap: calc(var(--semantic-space-xl, 24) * 1px);
margin-top: calc(var(--semantic-space-xl, 24) * 1px);
}
@media (max-width: 767px) {
.footer-container {
flex-direction: column;
align-items: flex-start;
}
}
.view-more-btn {
display: flex;
align-items: center;
justify-content: center;
gap: calc(var(--semantic-space-sm, 8) * 1px);
height: 40px;
padding: 0 calc(var(--semantic-space-lg, 16) * 1px);
border-radius: 9999px; /* rounded-full */
border: 1px solid var(--semantic-color-border-fill-onlight-interactive, #0562d2);
text-decoration: none;
background-color: transparent;
cursor: pointer;
transition: all 0.2s ease-in-out;
box-sizing: border-box;
}
.view-more-btn:hover {
background-color: var(--semantic-color-background-onlight-hover, rgba(5, 98, 210, 0.05));
}
.view-more-btn:active {
background-color: var(--semantic-color-background-onlight-pressed, rgba(5, 98, 210, 0.1));
}
.view-more-btn:focus-visible {
outline: 2px solid var(--semantic-color-border-fill-onlight-interactive, #0562d2);
outline-offset: 2px;
}
.view-more-text {
font-family: var(--font-body-2-bold-font-family, 'FordF1', sans-serif);
font-size: calc(var(--font-body-2-bold-font-size, 14) * 1px);
font-weight: var(--font-body-2-bold-font-weight, 700);
line-height: calc(var(--font-body-2-bold-line-height, 20) * 1px);
color: var(--semantic-color-text-onlight-interactive, #0562d2);
padding-left: calc(var(--semantic-space-sm, 8) * 1px); /* pl-sm */
}
.chevron-icon {
width: 16px;
height: 16px;
color: var(--semantic-color-icon-onlight-interactive, #0562d2);
display: block;
}
.match-count-text {
font-family: var(--font-body-1-regular-font-family, 'FordF1', sans-serif);
font-size: calc(var(--font-body-1-regular-font-size, 16) * 1px);
font-weight: var(--font-body-1-regular-font-weight, 400);
line-height: calc(var(--font-body-1-regular-line-height, 24) * 1px);
color: var(--semantic-color-text-onlight-moderate-default, #333);
}
${this.getBrandStyles()}
`,t=' ',i="";if(this._loading)i='Loading...
';else if(this._error&&!this._data)console.error("InventoryListWithFetch error:",this._error),i="";else if(this._data)if(this._error&&console.error("InventoryListWithFetch error:",this._error),this.getCombinedVehicles().length===0)i="No matching vehicles found.
";else{let s=this.getMatchCountMsg(),c=this.getResultsUrlWithCampaign(),l=this.getAttribute("heading"),d=l===null?"Similar Vehicles":l,p=d?`${u(d)} `:"",h=this.hasAttribute("hide-footer")?"":`
`;i=`
${p}
${h}
`}if(this.shadowRoot.innerHTML=`${i}`,this._data&&!this._loading&&!this._error){let o=this.shadowRoot.getElementById("list");if(o){o.vehicles=this.getCombinedVehicles(),o.setAttribute("brand",this.getAttribute("brand")||"ford"),o.setAttribute("locale",this.getAttribute("locale")||"en_us"),o.setAttribute("env",this.getAttribute("env")||"prod"),o.setAttribute("consumer-app",this._consumerApp);let s=this.getAttribute("nameplate");s?o.setAttribute("nameplate",s):o.removeAttribute("nameplate");let c=this.resolveCardVariant();o.setAttribute("card-variant",c);let l=this.getResultsUrlWithCampaign();l&&this._consumerApp==="FBC"?o.setAttribute("marketing-cta-href",l):o.removeAttribute("marketing-cta-href");let d=this.getAttribute("details-campaign-id");d?o.setAttribute("campaign-id",d):o.removeAttribute("campaign-id");let p=this.getAttribute("marketing-card-heading");p?o.setAttribute("marketing-card-heading",p):o.removeAttribute("marketing-card-heading");let h=this.getAttribute("marketing-card-body");h?o.setAttribute("marketing-card-body",h):o.removeAttribute("marketing-card-body");let f=this.getAttribute("marketing-card-cta-label");f?o.setAttribute("marketing-card-cta-label",f):o.removeAttribute("marketing-card-cta-label")}}let r=this.shadowRoot.querySelector('[data-action="view-more-inventory"]');r==null||r.addEventListener("click",this.handleViewMoreClick)}getCombinedVehicles(){if(!this._data)return[];let e=parseInt(this.getAttribute("limit")||"5",10),t=this._data.exactVehicles||[],i=this._data.similarVehicles||[],r=this.getAttribute("vin-to-exclude"),o=new Set,s=[];for(let c of[...t,...i]){if(s.length>=e)break;c.vin&&o.has(c.vin)||r&&c.vin===r||(c.vin&&o.add(c.vin),s.push(c))}return s}dispatchCountsEvent(e){let t=e.counts;if(!t)return;let i={exact:t.exact,similar:t.similar};this.dispatchEvent(new CustomEvent(K.COUNTS_UPDATED,{detail:i,bubbles:!0,composed:!0}))}resolveCardVariant(){return this._consumerApp==="FBC"||this.getCombinedVehicles().some(i=>{let r=i.highlightedFeatures;return r?Array.isArray(r)?r.length>0:typeof r=="object"?Object.keys(r).length>0:!1:!1})?"rich":"default"}};customElements.get("inventory-list-with-fetch")||customElements.define("inventory-list-with-fetch",ve);var be=class extends HTMLElement{constructor(){super();this._observer=null;this._sourceElement=null;this.attachShadow({mode:"open"}),this._handleUpdate=this._onCountsUpdated.bind(this)}static get observedAttributes(){return["match-type","for"]}get matchType(){return this.getAttribute("match-type")==="similar"?"similar":"exact"}set matchType(e){this.setAttribute("match-type",e)}get sourceId(){return this.getAttribute("for")}set sourceId(e){e?this.setAttribute("for",e):this.removeAttribute("for")}connectedCallback(){this._renderInitial(),this._refreshBinding(),this._startObserving(),queueMicrotask(()=>this._refreshBinding())}disconnectedCallback(){this._teardownObserver(),this._setSourceElement(null)}attributeChangedCallback(e,t,i){if(t!==i){if(e==="for"){this._refreshBinding();return}this._syncFromSourceOrReset()}}_renderInitial(){this.shadowRoot&&(this.shadowRoot.innerHTML='- ')}_setCount(e){var i;let t=(i=this.shadowRoot)==null?void 0:i.querySelector("span");t&&(t.textContent=String(e))}_startObserving(){let e=this.getRootNode(),t=e instanceof ShadowRoot?e:this.ownerDocument.body;t&&(this._observer=new MutationObserver(()=>{(!this._sourceElement||!this._sourceElement.isConnected)&&this._refreshBinding()}),this._observer.observe(t,{childList:!0,subtree:!0}))}_teardownObserver(){var e;(e=this._observer)==null||e.disconnect(),this._observer=null}_refreshBinding(){this._setSourceElement(this._resolveSourceElement()),this._syncFromSourceOrReset()}_setSourceElement(e){var t,i;this._sourceElement!==e&&((t=this._sourceElement)==null||t.removeEventListener(K.COUNTS_UPDATED,this._handleUpdate),this._sourceElement=e,(i=this._sourceElement)==null||i.addEventListener(K.COUNTS_UPDATED,this._handleUpdate))}_resolveSourceElement(){var r;let e=this.sourceId;if(e){let o=this.ownerDocument.getElementById(e);return this._isInventoryListWithFetch(o)?o:null}let t=(r=this.parentElement)==null?void 0:r.querySelectorAll("inventory-list-with-fetch");if((t==null?void 0:t.length)===1)return t[0];let i=this.getRootNode();if(i instanceof Document||i instanceof ShadowRoot){let o=i.querySelectorAll("inventory-list-with-fetch");if(o.length===1)return o[0]}return null}_isInventoryListWithFetch(e){return(e==null?void 0:e.tagName.toLowerCase())==="inventory-list-with-fetch"}_syncFromSourceOrReset(){var i;let e=(i=this._sourceElement)==null?void 0:i.currentCounts,t=e==null?void 0:e[this.matchType];if(typeof t=="number"&&Number.isFinite(t)){this._setCount(t>100?"100+":t);return}this._setCount("-")}_onCountsUpdated(e){let i=e.detail[this.matchType];typeof i=="number"&&isFinite(i)&&this._setCount(i>100?"100+":i)}};customElements.get("inventory-match-count")||customElements.define("inventory-match-count",be);var ye=n=>{let a=n.toLowerCase();return a==="lincolncanada.com"||a.endsWith(".lincolncanada.com")?"lnc":a==="lincoln.com"||a.endsWith(".lincoln.com")?"ln":a==="ford.ca"||a.endsWith(".ford.ca")?"foc":(a==="ford.com"||a.endsWith(".ford.com"),"fv")},Ye=n=>{if(!n)return!1;let a=n.toLowerCase();return a==="ford.com"||a.endsWith(".ford.com")||a==="ford.ca"||a.endsWith(".ford.ca")||a==="lincoln.com"||a.endsWith(".lincoln.com")||a==="lincolncanada.com"||a.endsWith(".lincolncanada.com")},Lt=(n,a)=>{let e=n==="lincoln",t=a.toLowerCase().includes("ca");return e?t?"lnc":"ln":t?"foc":"fv"};var xe={"summary-card-save-start":{primaryDirectCall:"save-start",secondaryDirectCall:"websdk-onclick"},"summary-card-unsave":{primaryDirectCall:"nfbc-globalOnclick",secondaryDirectCall:"websdk-onclick"},"summary-card-disclosure-open":{primaryDirectCall:"nfbc-globalOnclick",secondaryDirectCall:"websdk-onclick"},"summary-card-buy-now":null,"summary-card-view-details":null,"summary-card-view-more-inventory":null};var ne=n=>{let a=n!=null?n:typeof window!="undefined"?window.location.hostname:"",e=ye(a);return Ye(a)?{resolved:!0,locale:e}:{resolved:!1,locale:"fv",hostname:a}},Tt=(n,a)=>{let e=ne().locale,t=P(n.vehicle.nameplate);return{onclick:{onclickLinkName:`${e}:nfbc:save icon:${t}`,onclick:"nfbc:save icon:location:vehicle card"},vehicle:{modelYear:n.vehicle.modelYear,nameplate:t},page:{tool:"save",toolDescriptor:"bp"},event:{action:"tool"},target:{viewName:"tv-saveStart"}}},It=(n,a)=>{var i;let e=ne().locale,t=P(n.vehicle.nameplate);return{onclick:{onclickLinkName:`${e}:nfbc:unsave icon:${t}`,onclick:"nfbc:unsave icon:location:vehicle card"},vehicle:{modelYear:n.vehicle.modelYear,nameplate:t},user:{loginStatus:(i=a.loginStatus)!=null?i:"logged out"}}},St=(n,a)=>{var r;let e=ne().locale,t=P(n.vehicle.nameplate),i=n.vehicle.trim?P(n.vehicle.trim):void 0;return{onclick:{onclickLinkName:`${e}:nfbc:vehicle summary:content:action:${t}`,onclick:"nfbc:vehicle summary:content:vehicle card iball click:open"},vehicle:{modelYear:n.vehicle.modelYear,nameplate:t,...i!==void 0?{bodyModelTrim:i}:{}},user:{loginStatus:(r=a.loginStatus)!=null?r:"logged out"}}},Pt={"summary-card-save-start":Tt,"summary-card-unsave":It,"summary-card-disclosure-open":St},we=(n,a={})=>({...n,...a,brand:n.brand,locale:n.locale,region:n.region,environment:n.environment}),Ce=(n,a)=>{let e=xe[n.type];if(!e)return null;let t=Pt[n.type];if(!t)return null;let i=t(n,a),r=n.type==="summary-card-buy-now"||n.type==="summary-card-view-details"||n.type==="summary-card-view-more-inventory";return{directCall:e.primaryDirectCall,details:i,...e.secondaryDirectCall?{secondaryDirectCall:e.secondaryDirectCall}:{},...r?{navigatingAway:!0}:{}}},Ge=n=>ne(n);var Ee=()=>{var n;return typeof((n=globalThis==null?void 0:globalThis._satellite)==null?void 0:n.track)=="function"},Ze=n=>{globalThis._satellite.track(n)},Rt=n=>{var t;if(typeof globalThis=="undefined"||typeof globalThis.window=="undefined")return;let a=globalThis,e=(t=a.digitaldata)!=null?t:{};Object.keys(n).forEach(i=>{let r=n[i];r&&typeof r=="object"&&(e[i]={...typeof e[i]=="object"?e[i]:{},...r})}),a.digitaldata=e},et=n=>{Rt(n.details),Ze(n.directCall),n.secondaryDirectCall&&Ze(n.secondaryDirectCall)},$=[],j=null,Qe=!1,tt=(n=Date.now())=>{$=$.filter(a=>n-a.queuedAt<1e4)},it=()=>{if(tt(),$.length===0){_e();return}let n=[...$];$=[],_e(),n.forEach(a=>et(a.call))},Mt=()=>{j===null&&(j=setInterval(()=>{Ee()?it():(tt(),$.length===0&&_e())},200))},_e=()=>{j!==null&&(clearInterval(j),j=null)},Je=()=>{Ee()&&it()},Dt=()=>{Qe||typeof window=="undefined"||(window.addEventListener("beforeunload",Je),window.addEventListener("pagehide",Je),Qe=!0)},Ft=n=>{$.push({call:n,queuedAt:Date.now()}),Dt(),Mt()},rt=n=>{Ee()?et(n):Ft(n)};var nt=Object.values(N),$t=(n={})=>{let{target:a=typeof document!="undefined"?document:void 0,consentGate:e,onDroppedEvent:t,analyticsContext:i={}}=n;if(!a)return()=>{};let r=Ge();r.resolved||console.warn(`[shared-inventory-wc] Could not resolve metrics locale from hostname "${r.hostname}". Falling back to "fv". Analytics data may be mis-tagged.`);let o=s=>{let c=s,l=c.detail;if(!l||!l.type){t==null||t("missing-payload",c.type);return}if(e&&!e()){t==null||t("consent-denied",l.type);return}let d=we(l.context,i),p=Ce(l,d);p&&rt(p)};return nt.forEach(s=>{a.addEventListener(s,o)}),()=>{nt.forEach(s=>{a.removeEventListener(s,o)})}};export{ze as CAMPAIGN_PREFIXES,De as CARD_EVENTS,Re as CAROUSEL_LCP_IMAGE_CONFIG,de as DisclaimerPopover,K as INVENTORY_EVENTS,pe as InventoryCard,fe as InventoryList,ve as InventoryListWithFetch,be as InventoryMatchCount,he as MarketingCard,pt as PLAN_TYPES,ce as PricingTooltip,ge as RicherInventoryCard,xe as SUMMARY_CARD_DIRECT_CALL_MAP,N as SUMMARY_CARD_EVENTS,Be as arrowRightIcon,M as buildComponentContext,Ht as buildImageAltAttribute,W as buildImageUrl,V as buildSummaryCardIntcmp,Ce as buildTransportCall,Me as buildVdpLcpImageUrl,Ne as checkMarkIcon,He as chevronLeftIcon,D as chevronRightIcon,I as closeIcon,ee as disclosureStyles,F as getInfoIcon,dt as getLcpImagePrefetchUrl,Lt as getMetricsLocale,ye as getMetricsLocaleFromHostname,bt as infoIconFord,yt as infoIconLincoln,we as mergeAnalyticsContext,P as normalizeAnalyticsString,le as parseImageToken,te as setupCardFaceDisclosure,$t as setupSharedInventoryAnalytics};