import{r as b,u as j,R as e,B as h,F as o,T as E,c as N,d as D,S as M,H as I,e as L,f as P,a as $,g as G,h as T,i as O}from"./index-BZu1nCCi.js";import A from"./SubPage-BjHeKDJt.js";import{M as K}from"./Metadata-wnpQSZ9h.js";import{A as U}from"./AllAlert-B0bHW0sX.js";import{L as q}from"./AdBanner-CefS1ze_.js";import{A as J,I as Q,C as V,N as X}from"./NewsContent-BQDkyndA.js";import{u as Y,a as F,R as Z,B as w,b as C,c as ee,C as te}from"./BlockContainer-De7fb_Yp.js";import{C as ne}from"./index-BYBcgV8Y.js";import{C as re}from"./index-FIv7feoD.js";import{L as ae}from"./Loading-BOFol9tm.js";import"./BannerGroup-Pap8n--D.js";import"./Navigation-XMsB4ogx.js";import"./Helmet-CczeUPFm.js";import"./index.esm-fjVsHvrh.js";function le({lgCards:n,mdCards:r,smCards:t}){const[p,c]=Y({slideChanged(){return l(c.current.track.details.rel)}},[]),[a,l]=b.useState(0),[s,u]=F(),g=a!==0,i=a<(n==null?void 0:n.length)-1,_=a<(r==null?void 0:r.length)-1,S=a<(t==null?void 0:t.length)-1;b.useEffect(()=>{u()},[]),window.addEventListener("resize",u);const m=j();if(s==="lg")return e.createElement(h,{pt:"24px"},e.createElement(o,{align:"center",p:"25px",border:" solid 1px",borderColor:(n==null?void 0:n.length)>1?m.colors.Grey100:"transparent",pl:(n==null?void 0:n.length)>1?"25px":"initial",borderRadius:"20px",gap:"24px"},g&&e.createElement(v,{current:a,setCurrent:l,instanceRef:c}),e.createElement(h,{ref:p,className:"keen-slider"},n==null?void 0:n.map((f,x)=>e.createElement(o,{className:"keen-slider__slide",key:x,gap:"24px"},f.map((y,d)=>e.createElement(o,{key:d,direction:"column",flex:1,pr:"28px",pl:d===0?"0":"28px",borderLeft:d===0?"none":`solid 2px ${m.colors.Grey100}`},e.createElement(E,{fontWeight:"600",letterSpacing:".03em",fontSize:"1.375rem",lineHeight:"1.875rem"},y.name),e.createElement(E,{fontWeight:"400",fontSize:"1rem",letterSpacing:".03em",lineHeight:"1.362rem",color:m.colors.Grey130},y.designations.join(", "))))))),i&&e.createElement(B,{current:a,setCurrent:l,instanceRef:c})),(n==null?void 0:n.length)>1&&e.createElement(o,{justify:"center",py:"24px",gap:".5rem"},n==null?void 0:n.map((f,x)=>e.createElement(h,{key:x,borderRadius:"full",minW:"10px",minH:"10px",border:`${m.colors.Black} solid 2px`,bgColor:a===x?m.colors.White:m.colors.Black}))));if(s==="md")return e.createElement(h,{pt:"24px"},e.createElement(o,{align:"center",p:"25px",border:" solid 1px",borderColor:(r==null?void 0:r.length)>1?m.colors.Grey100:"transparent",pl:(r==null?void 0:r.length)>1?"25px":"initial",borderRadius:"20px",gap:"24px"},g&&e.createElement(v,{current:a,setCurrent:l,instanceRef:c}),e.createElement(h,{ref:p,className:"keen-slider"},r==null?void 0:r.map((f,x)=>e.createElement(o,{className:"keen-slider__slide",key:x,gap:"24px"},f.map((y,d)=>e.createElement(o,{key:d,direction:"column",flex:1,pr:"28px",pl:d===0?"0":"28px",borderLeft:d===0?"none":`${m.colors.Grey70} solid 2px`},e.createElement(E,{fontWeight:"600",letterSpacing:".03em",fontSize:"1.125rem",lineHeight:"1.5rem"},y.name),e.createElement(E,{fontWeight:"400",fontSize:".875rem",letterSpacing:".03em",lineHeight:"1.25rem",color:m.colors.Grey100},y.designations.join(", "))))))),_&&e.createElement(B,{current:a,setCurrent:l,instanceRef:c})),(r==null?void 0:r.length)>1&&e.createElement(o,{justify:"center",py:"24px",gap:".5rem"},r==null?void 0:r.map((f,x)=>e.createElement(h,{key:x,borderRadius:"full",minW:"10px",minH:"10px",border:`${m.colors.Black} solid 2px`,bgColor:a===x?m.colors.White:m.colors.Black}))));if(s==="sm")return e.createElement(h,{py:"12px"},e.createElement(o,{align:"center",p:"25px",pl:(t==null?void 0:t.length)>1?"25px":"initial",border:" solid 1px",borderColor:(t==null?void 0:t.length)>1?m.colors.Grey100:"transparent",borderRadius:"20px",gap:"24px"},g&&e.createElement(v,{current:a,setCurrent:l,instanceRef:c}),e.createElement(h,{ref:p,className:"keen-slider"},t==null?void 0:t.map((f,x)=>e.createElement(o,{className:"keen-slider__slide",key:x,direction:"column",flex:1},e.createElement(E,{fontWeight:"600",letterSpacing:".03em",fontSize:"1rem",lineHeight:"1.25rem"},f.name),e.createElement(E,{fontWeight:"400",letterSpacing:".03em",fontSize:".75rem",lineHeight:"1rem",color:m.colors.Grey100},f.certifications)))),S&&e.createElement(B,{current:a,setCurrent:l,instanceRef:c})),(t==null?void 0:t.length)>1&&e.createElement(o,{justify:"center",py:"24px",gap:".5rem"},t.map((f,x)=>e.createElement(h,{key:x,borderRadius:"full",minW:"10px",minH:"10px",border:`${m.colors.Black} solid 2px`,bgColor:a===x?m.colors.White:m.colors.Black}))))}const B=({instanceRef:n})=>e.createElement(N,{onClick:()=>{var r;return(r=n.current)==null?void 0:r.next()},bg:"inherit"},e.createElement(re,null)),v=({instanceRef:n})=>e.createElement(N,{onClick:()=>{var r;return(r=n.current)==null?void 0:r.prev()},bg:"inherit"},e.createElement(ne,null));function z(){return z=Object.assign?Object.assign.bind():function(n){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var p in t)({}).hasOwnProperty.call(t,p)&&(n[p]=t[p])}return n},z.apply(null,arguments)}function ie(n){const{data:r}=n,t=b.memo(le),p=r,c=p.reduce((l,s,u)=>{const i=Math.floor(u/3);return l[i]||(l[i]=[]),l[i].push(s),l},[]),a=p.reduce((l,s,u)=>{const i=Math.floor(u/4);return l[i]||(l[i]=[]),l[i].push(s),l},[]);return e.createElement(e.Fragment,null," ",e.createElement(t,z({},n,{lgCards:a,mdCards:c,smCards:r})))}function oe({coPub:n,ctaGroup:r}){var t,p,c;return e.createElement(o,{justify:"space-between",direction:{base:"column",md:"row"},gap:{base:"20px",md:"0"},py:{base:"22px",md:"50px"}},n&&n!=="<p><span></span></p>"&&e.createElement(o,{justify:"start"},e.createElement(Z,{data:n,px:"inital",w:"100%"})),(r.cta_button_1||r.cta_button_2||r.cta_button_3)&&e.createElement(o,{gap:{base:"11px",md:"13px"},direction:{base:"column",md:"row"},flexWrap:"wrap",justify:n?{base:"initial",md:"end"}:"initial"},(t=r.cta_button_1)==null?void 0:t.map((a,l)=>e.createElement(w,{refData:a,key:l,mx:{lg:"12px"}})),(p=r.cta_button_2)==null?void 0:p.map((a,l)=>e.createElement(w,{refData:a,key:l,mx:{lg:"12px"}})),(c=r.cta_button_3)==null?void 0:c.map((a,l)=>e.createElement(w,{refData:a,key:l,mx:{lg:"12px"}}))))}function ce(n){var S,m,f,x,y,d,W;const{ct:r}=n,[t,p]=b.useState(),[c]=ee(),[a,l]=b.useState(),[s,u]=b.useState(),g=window.location.pathname,i=j();b.useEffect(()=>{_()},[r]);async function _(){var H;const R=await D.getArticle(r,g,"en-us","article_details.author,related_resources.resource_entry");p(R[0]),l(()=>{var k;return c(new Date((k=R[0].article_details)==null?void 0:k.date).getTime(),"month_year")}),((H=R[0].article_details)==null?void 0:H.date_updated)!=null?u(()=>{var k;return c(new Date((k=R[0].article_details)==null?void 0:k.date_updated).getTime(),"month_year")}):u(null)}return e.createElement("main",{id:"main"},e.createElement(M,null),t?e.createElement(h,{h:"100%"},t.seo&&e.createElement(K,{data:t.seo,override:t}),e.createElement(U,null),e.createElement(q,{data:{title:"All Resources",href:"/resources"}}),e.createElement(h,{maxW:"1220px",mx:"auto",h:"100%"},e.createElement(J,{data:t,ct:r}),((S=t.article_details)==null?void 0:S.headline)&&e.createElement(o,{ml:{base:"35px",md:"50px",lg:"62px"},mr:{base:"35px",md:"50px",lg:"76px"},mb:{base:"12px",md:"28px",lg:"35px"},h:{base:"128px",md:"225px",lg:"347px"},bgImage:(f=(m=t.headline_banner)==null?void 0:m.image)==null?void 0:f.url,bgPos:"center",bgSize:"cover",bgRepeat:"no-repeat",borderRadius:"15px",textOverflow:"ellipsis"},e.createElement(o,{align:"center",justify:"center",borderRadius:"inherit",h:"100%",w:"100%",bgGradient:(x=t.headline_banner)==null?void 0:x.image_gradient},e.createElement(E,{as:"h1",fontFamily:"Lato",fontWeight:"800",fontSize:{base:"1.5rem",md:"2.5rem"},lineHeight:"3rem",textAlign:"center",color:(y=t.headline_banner)!=null&&y.white_text?i.colors.White:i.colors.Black},(d=t.article_details)==null?void 0:d.headline))),t.entry_summary&&e.createElement(E,{ml:{base:"35px",md:"50px",lg:"62px"},mr:{base:"35px",md:"50px",lg:"76px"},fontFamily:"Lato",fontSize:{base:".75rem",md:"1.563rem"},lineHeight:"1.875rem",letterSpacing:".015em",fontWeight:"800"},t.entry_summary),e.createElement(o,{gap:{base:"5%",lg:"6%"},h:"100%",ml:{base:"35px",md:"50px",lg:"62px"},mr:{base:"35px",md:"50px",lg:"76px"},direction:{base:"column-reverse",md:"row"},mt:!t.main_image&&{base:"12px",md:"28px",lg:"69px"}},e.createElement(o,{h:"100%",maxW:"100%",flex:1,direction:"column"},e.createElement(o,{borderBottom:`solid ${i.colors.Black} 1px`,pb:{base:"29px",md:"17px",lg:"24px"}},e.createElement(o,{flex:1},e.createElement(o,{direction:"column",gap:"11px",letterSpacing:".03%"},e.createElement(o,{gap:"1rem"},e.createElement(E,{fontSize:{base:".75rem",md:"1.563rem"},lineHeight:"2.125rem",fontWeight:"600"},"Published:"),e.createElement(E,{fontSize:{base:".75rem",md:"1.563rem"},lineHeight:"2.125rem",letterSpacing:".03%"},a)),e.createElement(o,{gap:"1rem"},s&&e.createElement(E,{fontSize:{base:".75rem",md:"1.563rem"},lineHeight:"2.125rem",fontWeight:"600"},"Last updated:"),e.createElement(E,{fontSize:{base:".75rem",md:"1.563rem"},lineHeight:"2.125rem"},s)))),e.createElement(o,{flex:1,justify:"end"},e.createElement(Q,null))),e.createElement(ie,{data:(W=t.article_details)==null?void 0:W.author}),(t.co_published_field||t.resource_entry_cta_buttons_)&&e.createElement(oe,{coPub:t.co_published_field,ctaGroup:t.resource_entry_cta_buttons_}),e.createElement(h,{id:"article",className:"Article-Body",mt:"29px"},e.createElement(C,{data:t.article_body,rtecontainerpx:"initial",px:"initial",contained:"true"})),t.cpe_eligible&&e.createElement(V,{data:t,ct:r}))),t.related_resources.length===3&&e.createElement(me,{array:t.related_resources}))):e.createElement(ae,{minH:"100vh"}))}const me=({array:n,index:r})=>{const[t,p]=F();b.useEffect(()=>{p()},[]);let c=n.slice(0,2);return t==="lg"&&(c=n),window.addEventListener("resize",p),e.createElement(o,{key:r,direction:"column",ml:{base:"35px",md:"50px",lg:"62px"},mr:{base:"35px",md:"50px",lg:"76px"},my:{lg:"65px"},gap:{sm:"28px",md:"41px",lg:"48px"}},e.createElement(I,{fontWeight:"700",fontSize:{base:"1.5rem",md:"2.5rem"}},"Related Resources"),e.createElement(o,{gap:"4%",justify:"space-between",direction:{base:"column",md:"row"}},c==null?void 0:c.map(a=>{var l;return(l=a==null?void 0:a.resource_entry)==null?void 0:l.map((s,u)=>{var g,i;return e.createElement(te,{key:u,data:s,titleProp:(g=s.tags_group)==null?void 0:g.type,overrideAlt:a.override_image_alt,override:(i=a.override_image)==null?void 0:i.url,my:"8px"})})})))};function pe({contentType:n}){return n===L.newsArticle||n===L.newsBlurb?e.createElement(X,{contentType:n}):n===P?e.createElement(ce,{ct:n}):n?e.createElement(A,{ct:n}):null}function we(){const n=$(),r=b.useMemo(()=>{const i=n.pathname.split("/");return i.length>2?(i.splice(i.length-1,1,":title"),i.join("/")):i},[n]),{isError:t,isLoading:p,data:c,failureReason:a,isSuccess:l}=G(r),s=b.useMemo(()=>l?c.map(i=>i.uid):[],[c]),u=T(s,n.pathname),g=b.useMemo(()=>{if(u.every(_=>_.isSuccess)){let _;return u.forEach((S,m)=>{var f;((f=S.data)==null?void 0:f.length)>0&&(_=s[m])}),_}return null},[u,s]);if(p||u.some(i=>i.isLoading))return e.createElement(O,null);if(t||u.some(i=>i.isError))throw new Error("Error loading ContentTypeFilter: ",(a==null?void 0:a.message)||"checkResources");return s.length===1?e.createElement(A,{ct:g}):e.createElement(pe,{contentType:g})}export{we as default};