news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6943],{25414:(e,l,t)=>{t.d(l,{default:()=>A});var a=t(95155),c=t(12115),h=t(66945),n=t(52596),r=t(36203),m=t(53005),i=t(16696),s=t(28700),d=t(2488),v=t(88041),o=t(49110),p=t(5036),u=t(1773),f=t.n(u),E=t(33374),q=t(5153),z=t(71269);let g=e=>{let{count:l}=e;return Array.from({length:l}).map((e,l)=>(0,a.jsxs)(h.Zp,{className:"pb-4",children:[(0,a.jsx)(h.EA,{height:m.SG,width:m.SG}),(0,a.jsxs)(h.Wu,{className:"flex flex-col gap-1",children:[(0,a.jsx)(h.EA,{height:m.IH}),(0,a.jsx)(h.EA,{height:m.IH}),(0,a.jsx)(h.EA,{height:m.IH})]})]},l))},M=e=>{let{count:l,currentTab:t,isFetching:c,trendingItems:n}=e;return(0,a.jsx)("div",{className:"divide-neutral-6 dark:divide-neutral-4 mx-1 mt-4 -mb-2 flex flex-col gap-4 divide-y",children:c?(0,a.jsx)(g,{count:l}):n.map((e,l)=>{var c;return(0,a.jsxs)(h.Zp,{as:z.NextLink,className:"pb-4","data-id":E.Co.TrendingWidgetCard,"data-nitrous-element-component":"".concat(null==(c=e.type)?void 0:c.toLowerCase(),"-card"),"data-parent":t?"".concat(E.Co.TrendingWidget,"-").concat(null==t?void 0:t.toLowerCase(),"-tab"):E.Co.TrendingWidget,href:e.link,orientation:"horizontal",children:[(0,a.jsx)(h.Vo,{as:q.EnhancedNextImage,aspectRatio:"1/1",src:e.thumbnailUrl,children:"video"===e.type&&(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center opacity-70 transition-opacity group-hover/card:opacity-100",children:(0,a.jsx)(f(),{className:"text-neutral-8 size-8",path:p.LPM})})}),(0,a.jsx)(h.Wu,{children:(0,a.jsx)(h.ZB,{title:e.title,titleTypographyProps:{maxLines:3,sm:"body3",variant:"body3"}})})]},l)})})};var y=t(69588),V=t(15012),B=t(70052);let A=(0,r.withErrorBoundary)(e=>{let{count:l=m.Di}=e,{brand:t}=(0,V.A)(B.Z),{hasConsent:r}=(0,d.S)({id:s.Ok.PERSONALIZATION,type:"category"}),{tabs:o,types:p}=m.c2[t]||m.B_,u=!!(o&&o.length>0),[f,E]=(0,c.useState)(p[0]),{isFetching:q,trendingItems:z}=(0,v.A)({brand:t,hasConsent:!!r,size:l,trendingType:f});return q||(null==z?void 0:z.length)||f!==i.m_.All?(0,a.jsxs)("section",{"aria-busy":q,"aria-label":y.AY.Heading,"aria-live":"off",className:"border-neutral-6 dark:bg-neutral-3 rounded-lg border p-3 shadow-[0px_4px_20px_0px_rgba(0,0,0,0.06)] dark:border-transparent dark:shadow-none",children:[(0,a.jsx)(h.o5,{as:"h2",className:(0,n.A)({"mb-4":!u}),lg:"h4",variant:"h5",children:y.AY.Heading}),u&&o?(0,a.jsxs)(h.tU,{defaultValue:f,onValueChange:e=>{E(e)},children:[(0,a.jsx)(h.j7,{children:o.map(e=>{let{label:l,type:t}=e;return(0,a.jsx)(h.OR,{value:t,children:l},t)})}),(0,a.jsx)(h.av,{value:f,children:(0,a.jsx)(M,{count:l,currentTab:f,isFetching:q,trendingItems:z})})]}):(0,a.jsx)(M,{count:l,isFetching:q,trendingItems:z})]}):null},{FallbackComponent:o.c})},26604:(e,l,t)=>{t.r(l),t.d(l,{default:()=>n});var a=t(95155),c=t(52596),h=t(43265);let n=e=>{let{adContainerProps:l,adProps:t,...n}=e;return(0,a.jsx)("div",{className:(0,c.A)("flex items-center justify-center overflow-hidden",null==l?void 0:l.className),...n,children:(0,a.jsx)(h.A,{...t})})}},29810:(e,l,t)=>{t.r(l),t.d(l,{default:()=>u});var a=t(95155),c=t(12115),h=t(66945),n=t(36203),r=t(93158),m=t(97893);let i=async e=>{if(!e)return null;try{let l=(e=>{let l=0;if(null===e||0===e.length)return l.toString();for(let t=0;t{var t,a,c,h,n,r,m,i;let s=null==e||null==(t=e.nodes)?void 0:t.find(e=>e.type===l);if((null==s?void 0:s.content)||"/"===window.location.pathname)return s;let d=(null==e||null==(h=e.config)||null==(c=h.page_groups)||null==(a=c.find(e=>{let l=e.include_rules;for(let e=0;ee.type===l);return(null==v?void 0:v.content)?v:null==e||null==(i=e.page_group_nodes)||null==(m=i["Editorial Content"])?void 0:m.find(e=>e.type===l)};var d=t(33374),v=t(9204),o=t(49110),p=t(69588);let u=(0,n.withErrorBoundary)(e=>{var l;let{className:t}=e,[n,r]=(0,c.useState)(),[o,u]=(0,c.useState)("");return(0,c.useEffect)(()=>{try{i(window.location.href).then(e=>{if(e){var l,t;let a=(null==(l=s(e,"bodystr"))?void 0:l.content)||"",c=a&&JSON.parse(a);r(c),u((null==(t=s(e,"headstr"))?void 0:t.content)||"")}})}catch(e){m.Y.log({error:e,level:"error",msg:"Error in BrightEdge"})}},[]),(null==n||null==(l=n.links)?void 0:l.length)&&(0,a.jsxs)("div",{className:t,children:[(0,a.jsx)(h.o5,{as:"h2",md:"h4",variant:"h5",children:p._3.Heading}),(0,a.jsx)(h.pV,{className:"pt-4 sm:pt-6",columns:2,lg:3,children:(()=>{var e;return null==n||null==(e=n.links)?void 0:e.map((e,l)=>(0,a.jsx)(h.Zp,{as:"a","data-id":d.Co.BrightEdgeLink,"data-parent":d.Co.BrightEdgeSection,href:(0,v.l2)({paths:[e.url]}),variant:"tile",children:(0,a.jsx)(h.Wu,{children:(0,a.jsx)(h.ZB,{title:e.anchor_text,titleTypographyProps:{as:"h3"}})})},"".concat(e.url,"_").concat(l)))})()}),(0,a.jsx)("div",{dangerouslySetInnerHTML:{__html:o}})]})},{FallbackComponent:o.c})},41391:(e,l,t)=>{t.d(l,{A:()=>a});function a(e){let{adSizes:l="{}",adTargeting:t="{}"}=e,a={},c={};if(t)try{a=JSON.parse(t),"string"==typeof a.pos&&(a.pos=a.pos.split(",").map(e=>e.trim()))}catch(e){}if(l)try{c=JSON.parse(l)}catch(e){}return Array.isArray(c)&&(c=c.reduce((e,l)=>{let[t,a]=l.id.split(":"),c=a.split("x").map(e=>+e);return e[t].push(c),"desktop"===t&&e.laptop.push(c),e},{desktop:[],laptop:[],mobile:[],tablet:[]})),{sizes:c,targeting:a}}},49660:(e,l,t)=>{t.r(l),t.d(l,{default:()=>E});var a,c,h,n,r,m,i,s,d,v,o,p=t(12115),u=["title","titleId"];function f(){return(f=Object.assign?Object.assign.bind():function(e){for(var l=1;l{t.d(l,{S:()=>h});var a=t(53005),c=t(16696);async function h(){let{filter:e={type:c.m_.All},fromDate:l,size:t=a.Di,toDate:h,type:n=c.m_.Article}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=await fetch("/nwapi/trending",{body:JSON.stringify({filter:e,fromDate:l,size:t,toDate:h,type:n}),headers:{"Content-Type":"application/json"},method:"POST"});if(!r.ok)throw Error("Failed to fetch trending data");return await r.json()}},53005:(e,l,t)=>{t.d(l,{B_:()=>i,Di:()=>h,IH:()=>r,SG:()=>n,c2:()=>m});var a=t(16696),c=t(69588);let h=5,n=83,r=20,m={[a.mz.Motortrend]:{tabs:[{label:c.AY.AllTab,type:a.m_.All},{label:c.AY.ArticlesTab,type:a.m_.Article},{label:c.AY.CarsTab,type:a.m_.Vehicle},{label:c.AY.VideosTab,type:a.m_.Video}],types:[a.m_.All,a.m_.Article,a.m_.Vehicle,a.m_.Video]},[a.mz.Hotrod]:{brands:[a.dQ.HotRod],types:[a.m_.Article]}},i=m[a.mz.Motortrend]},56325:(e,l,t)=>{t.d(l,{default:()=>d});var a=t(95155),c=t(36203),h=t(80624),n=t(66402);let r={desktop:"xl",laptop:"lg",mobile:"",tablet:"md"};var m=t(41391),i=t(26604),s=t(49110);(0,h.U)("\n fragment AdModule on CurationModules {\n options {\n adSizes\n adTargeting\n }\n }\n");let d=(0,c.withErrorBoundary)(e=>{let{options:l,pageTargeting:t}=e,{adSizes:c,adTargeting:h}=l||{},{sizes:s,targeting:d}=(0,m.A)({adSizes:c,adTargeting:h}),v={...d};return(0,a.jsx)(i.default,{adContainerProps:{className:(e=>{let l="min-h-[250px] min-w-[300px]";return Object.entries(e).forEach(e=>{let[t,a]=e,c=r[t],h=a.length?"block":"hidden";l+=" ".concat(c).concat(c?":":"").concat(h)}),l})(s)},adProps:{pageTargeting:t,sizes:s,slotIdPrefix:(0,n.e)(v),targeting:v}})},{FallbackComponent:s.c})},66402:(e,l,t)=>{t.d(l,{e:()=>c});var a=t(28885);let c=e=>{var l;let t=(null==(l=e.pos)?void 0:l[0])||"";switch(t){case"top":return a.B2.Top;case"middle":return a.B2.Middle;case"bottom":return a.B2.Bottom;case"carmatch":return a.B2.CarMatch;case"newsletter":return a.B2.NewsLetter;default:return t}}},70052:(e,l,t)=>{t.d(l,{Z:()=>c});var a=t(58273);let c=e=>e[a.w4]},74750:(e,l,t)=>{t.d(l,{default:()=>v});var a=t(95155),c=t(12115),h=t(52596),n=t(36203),r=t(28885),m=t(49110),i=t(15012),s=t(58273);let d=(0,t(68924).Mz)(e=>e[s.yL],e=>e.slotVisibilityChanged),v=(0,n.withErrorBoundary)(e=>{let{children:l,className:t="",delayTimeout:n=!1,slotIdPrefix:m,timeout:v=5e3}=e,[o,p]=(0,c.useState)(!0),u=(0,i.A)(d),f=(0,c.useMemo)(()=>((e,l)=>{if(e&&l&&Object.keys(e).length){for(let t in e)if(t.startsWith(l)||t.toLowerCase().includes(r.B2.ArticleTopAd))return e[t]}})(u,m),[m,u]);return(0,c.useEffect)(()=>{if(!o||n)return;let e=setTimeout(()=>{p(!1)},v);return()=>clearTimeout(e)},[n,o,v]),(0,c.useEffect)(()=>{if(s.q8.Visible!==f||!o||!n)return;let e=setTimeout(()=>{p(!1)},v);return()=>clearTimeout(e)},[n,o,f,v]),(0,a.jsx)("div",{className:(0,h.A)("top-12 lg:top-16",t,o&&"sticky z-40 [&>div]:backdrop-blur-xs"),children:l})},{FallbackComponent:m.c})},88041:(e,l,t)=>{t.d(l,{A:()=>s});var a=t(12115),c=t(50802),h=t(95838),n=t(28885),r=t(53005),m=t(9204),i=t(93819);let s=e=>{let{brand:l,enabled:t=!0,hasConsent:s=!0,size:d,trendingType:v}=e,o=(0,a.useCallback)(async()=>{var e,t,a;let{types:h}=r.c2[l]||r.B_,s={type:h.includes(v)?v:h[0]},o=null==(e=r.c2[l])?void 0:e.brands;o&&o.length>0&&(s.brands=o);let p=await (0,c.S)({filter:s,size:d,type:s.type});return null!=(a=null==p||null==(t=p.trending)?void 0:t.contents.map(e=>{var l,t,a,c,h,r,s,d,v,o,p,u,f,E,q,z,g,M,y,V,B,A,b,x;if(!e)return null;switch(e.__typename){case"Article":return{id:null!=(c=e.articleId)?c:"",link:null!=(h=(0,m.l2)({paths:[null==(l=e.seo)?void 0:l.canonicalUrl]}))?h:"",slug:null!=(r=null==(t=e.seo)?void 0:t.canonicalUrl)?r:"",thumbnailUrl:null!=(s=null==(a=e.teaseImage)?void 0:a.url)?s:"",title:null!=(d=e.hed)?d:"",type:"article"};case"Video":return{id:null!=(v=e.videoId)?v:"",link:(0,m.l2)({paths:[n.BV.Watch,e.videoId,e.slug]}),slug:null!=(o=e.slug)?o:"",thumbnailUrl:null!=(p=e.thumbnailUrl)?p:"",title:null!=(u=e.title)?u:"",type:"video"};case"Vehicle":return{id:null!=(V=null==(f=e.makeModelArticle)?void 0:f.vehicleId)?V:"",link:null!=(b=(0,m.l2)({paths:[n.BV.BuyersGuideHomepage,(0,i.A)(null!=(B=null==(q=e.make)||null==(E=q.name)?void 0:E.toLowerCase())?B:""),(0,i.A)(null!=(A=null==(g=e.model)||null==(z=g.name)?void 0:z.toLowerCase())?A:""),e.year]}))?b:"",thumbnailUrl:null!=(x=e.thumbnailUrl)?x:"",title:"".concat(e.year," ").concat(null==(M=e.make)?void 0:M.name," ").concat(null==(y=e.model)?void 0:y.name),type:"vehicle"};default:return null}}).filter(e=>null!==e))?a:[]},[l,v,d]),{data:p,isFetching:u}=(0,h.useQuery)({enabled:t&&s,queryFn:o,queryKey:["trending-widget",v,l,d],staleTime:e=>{var l;return(null==(l=e.state.data)?void 0:l.length)?n.wy:0}});return{isFetching:u,trendingItems:null!=p?p:[]}}},93819:(e,l,t)=>{t.d(l,{A:()=>a});let a=e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}}]); //# sourceMappingURL=6943-7ed351eca1c61ced.js.map