1import{i as z,a0 as G,j as E,b as P,q as B,g as m}from"./BnowyiiT.js";import{d as W}from"./Bh1tyPu7.js";import{_ as O}from"./BuFF0eT1.js";import{_ as R}from"./J49cOnTw.js";import{u as H}from"./Cj1uASeN.js";/* empty css */import{a2 as d,u as C,X as y,a3 as b,a6 as N,C as e,a5 as D,a8 as g,a7 as M,z as a,p as X,E as J,aj as K,j as w}from"./DGxlnW41.js";import{e as V}from"./p1QsUf6f.js";import{_ as Q}from"./B2YqjWf_.js";import"./_CHoJ0K5.js";import"./CbAtIVSG.js";import"./BirJEn2g.js";import"./CkMOyL3W.js";import"./C3C-A3Zu.js";import"./SxxlrK1N.js";import"./pggHmpmL.js";import"./nLQdF57q.js";import"./CwpJWcVn.js";import"./Dmq4J0nM.js";import"./BPQNzZIK.js";import"./cikaCsh0.js";const Y={key:1,class:"featured-latest-news-placeholder","aria-hidden":"true"},Z={__name:"FeaturedLatestNews",props:{title:{type:String,default:"Latest from GV"},eyebrowText:{type:String,default:"GV News"},viewAllText:{type:String,default:"View all"},newsUrl:{type:String,default:"/news"},isLoading:{type:Boolean,default:!1},featuredArticle:{type:Object,default:null},articles:{type:Array,default:()=>[]}},setup(r){const u=r,{isDesktop:v}=H(),k=a(()=>v?8:4),h=a(()=>Array.isArray(u.articles)&&u.articles.length>0),T=a(()=>!!u.featuredArticle),x=a(()=>h.value||T.value),p=a(()=>u.isLoading&&!x.value);return(U,A)=>{const n=G,i=z,f=W,l=O,L=R;return d(),C("div",null,[y(f,{class:"mb-1-5 mb-md-2 mb-xl-1"},{default:b(({addToTimeline:o})=>[y(i,{onUpdated:o,preset:"fadeUp",to:{delay:.1},class:"px-1 px-md-0-875 px-xl-2-25"},{default:b(()=>[y(n,{class:"bold text-uppercase",style:{"font-family":"GrotzecCond-Bold, Arial, Helvetica, sans-serif"},tag:"h2",text:r.title},null,8,["text"])]),_:1},8,["onUpdated"])]),_:1}),N("div",{class:M(["featured-series-wrapper px-1 px-md-0-875 px-xl-2-25 featured-latest-news-shell",{"is-loading":e(p)}])},[e(x)?(d(),D(f,{key:0,class:"featured-series-component featured-latest-news-component"},{default:b(({addToTimeline:o})=>[r.featuredArticle?(d(),D(i,{key:0,onUpdated:o,preset:"fadeUp",to:{delay:.2}},{default:b(()=>[y(l,{article:r.featuredArticle,"prioritize-image":!0,"flush-spacing":!0},null,8,["article"])]),_:1},8,["onUpdated"])):g("",!0),e(h)?(d(),D(L,{key:1,items:r.articles,"item-type":"internal","enable-slider":e(v),"animate-each-on-scroll-mobile":!0,"section-class":"featured-latest-news-slider","compact-bottom-spacing":!0,"no-horizontal-padding":!0,"max-items":e(k),"base-delay":.15,"stagger-delay":.06},null,8,["items","enable-slider","max-items"])):g("",!0)]),_:1})):e(p)?(d(),C("div",Y)):g("",!0)],2)])}}},ee={key:0,class:"mb-1 px-1 px-md-0-875 px-xl-2-25"},te={class:"mb-0"},ge={__name:"cms",props:{data:{type:Object,required:!0}},setup(r){const u=r,{title:v,eyebrowText:k,viewAllText:h,relatedPage:T,featuredArticleComponent:x}=E(u.data),{$cms:p}=P(),U=a(()=>m(x,"featuredArticle")||null),A=w([]),n=w(null),i=w(!1),f=w(!1),l=w(""),L=async()=>{if(!U.value)return;const t=U.value,c=B(t);if(!m(t,"title")&&c)try{const{items:S}=await p.fetchByType("newsArticle",{include:2,limit:1,"sys.id":c});n.value=S?.[0]||null}catch{l.value="We couldn't load the selected featured article."}else n.value=t},o=async()=>{if(!i.value){i.value=!0,await L();try{const t=await p.fetchByType("newsArticle",{include:2,includeTotal:!1,limit:8,order:"-fields.date"});A.value=t?.items||[],l.value=""}catch{l.value="We couldn't load the latest news right now."}finally{f.value=!0,i.value=!1}}},q=()=>{l.value="",i.value=!1,o()};let _=null;X(()=>{if(typeof window.requestIdleCallback=="function"){_=window.requestIdleCallback(()=>{o()},{timeout:2e3});return}_=window.setTimeout(()=>{o()},1)}),J(()=>{_!==null&&(typeof window.requestIdleCallback=="function"?window.cancelIdleCallback(_):clearTimeout(_))});const F=a(()=>n.value&&m(n.value,"date")?n.value:A.value?.find(c=>!!m(c,"date"))||null),I=a(()=>V(F.value)),$=a(()=>{const t=B(I.value);return(A.value?.filter(s=>!(B(s)===t||!m(s,"date")))||[]).map(s=>V(s))}),j=a(()=>Q(m(T,"page"))||"/news");return(t,c)=>{const s=Z;return d(),C("div",null,[e(l)?(d(),C("div",ee,[N("p",te,K(e(l)),1),N("button",{type:"button",class:"link mt-1",onClick:q}," Try again ")])):g("",!0),y(s,{title:e(v)||"Latest from GV",eyebrowText:e(k)||"GV News",viewAllText:e(h)||"View all",newsUrl:e(j),"is-loading":!e(f),featuredArticle:e(I),articles:e($)},null,8,["title","eyebrowText","viewAllText","newsUrl","is-loading","featuredArticle","articles"])])}}};export{ge as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.