1import{a as re}from"/build/_shared/chunk-3EWJVGEU.js";import{g as Z,h as ee,i as te,j as ae,k as oe}from"/build/_shared/chunk-AQND356W.js";import{a as ke}from"/build/_shared/chunk-V6UO67VR.js";import{a as Y}from"/build/_shared/chunk-IDALNQZ2.js";import{c as H,d as Q}from"/build/_shared/chunk-ZF2KYRGX.js";import{a as X}from"/build/_shared/chunk-Z3VY5GFS.js";import{a as J}from"/build/_shared/chunk-7BF32AAM.js";import{a as q}from"/build/_shared/chunk-V2F6KG3P.js";import{b as V}from"/build/_shared/chunk-FVRD3VWZ.js";import{c as F}from"/build/_shared/chunk-2R5HCD25.js";import{b as f}from"/build/_shared/chunk-SCSH5XPI.js";import{b as W,k as M}from"/build/_shared/chunk-5FWG67EV.js";import{b as N,f as A}from"/build/_shared/chunk-V7M6LDMT.js";import{C as y,a as K,e as j,m as U,v as _,w as b,y as G}from"/build/_shared/chunk-WFNQTVCJ.js";import{a as we}from"/build/_shared/chunk-66RE6KXV.js";import{a as ve}from"/build/_shared/chunk-5TRFQBKG.js";import{d as c}from"/build/_shared/chunk-G5WX4PPA.js";var xe=c(ve(),1);var n=c(K(),1);var se=c(K(),1);var r=c(y(),1);function ne({labels:i,filterProps:a}){let g=b("root")?.siteLabels??{},m=(0,se.useMemo)(()=>a.checkedFilters.length,[a.checkedFilters]),u=(e,s)=>{let l=[...a.checkedFilters].filter(v=>v!==e);s&&l.push(e),a.handleFilterChange(l)};return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)(Z,{children:[(0,r.jsx)(ee,{className:"group/trigger shadow-card text-body-subhead text-left w-full py-3.5 px-5 bg-white flex justify-between items-center data-[state=closed]:rounded-xl data-[state=open]:rounded-t-xl",asChild:!0,children:(0,r.jsxs)("button",{children:[m>0&&(0,r.jsx)("span",{className:W("rounded-full w-8 h-8 bg-mint text-darkBlue text-category flex items-center justify-center"),children:m}),m>0?i.filterLabelSelected:i.filterLabelDefault,(0,r.jsx)(f,{size:"sm",name:"chevron",className:"p-1.5 rounded-full bg-mint transition-transform duration-[250ms] ease-in group-data-[state=open]/trigger:rotate-180"})]})}),(0,r.jsx)(te,{className:"data-[side=bottom]:rounded-b-xl shadow-dropdown dropdown-menu-content pt-3 pb-4 bg-white z-10 overflow-auto",side:"bottom",avoidCollisions:!1,children:a.pageFilters&&a.pageFilters.map((e,s)=>(0,r.jsxs)(ae,{className:"flex items-center justify-between mb-3 py-2 px-5 text-body-md data-[highlighted]:bg-extraLightGrey hover:outline-none",checked:a.checkedFilters.includes(e),onSelect:l=>l.preventDefault(),onCheckedChange:l=>u(e,l),children:[e,(0,r.jsx)("div",{className:"border rounded-md w-9 h-9",children:(0,r.jsx)(oe,{className:"flex items-center justify-center",children:(0,r.jsx)(f,{name:"check",className:"w-9 h-9"})})})]},s))})]}),m>0&&(0,r.jsxs)("div",{className:"flex flex-wrap gap-y-3 items-center pt-5 relative w-[92vw]",children:[a.checkedFilters.map((e,s)=>(0,r.jsx)(F,{size:"withIcon",variant:"outlineGrey",className:"mr-5","aria-label":`${i.filterLabelUncheck} ${e}`,onClick:()=>u(e,!1),children:(0,r.jsxs)("div",{className:"flex items-center py-3 pl-6 pr-3",children:[(0,r.jsx)("span",{className:"mr-3",children:e}),(0,r.jsx)(f,{size:"sm",name:"plus",className:"rotate-45 rounded-full bg-mint shrink-0"})]})},s)),(0,r.jsx)(F,{variant:"outlineGrey",className:"mr-5",onClick:()=>{a.handleFilterChange([])},children:g?.filterClear})]})]})}var B=c(ke(),1);var Fe=c(we(),1);var ie=c(K(),1),p=c(y(),1);function le({pageChips:i,filterProps:a}){let g=b("root")?.siteLabels??{},m=i.map(e=>{if(e.content.iconleft==="all")e.content.subline=`${a.pageFilters.find(s=>s.category===N)?.numberOfPages||0} ${g.posts}`;else{let s=a.pageFilters.find(l=>l.category===e.content.headline);e.content.subline=`${s?.numberOfPages||0} ${g.posts}`}return e}),u=(0,ie.useCallback)((e,s)=>{let l=[...a.checkedFilters].filter(v=>v!==e);s&&l.push(e),a.handleFilterChange(l)},[a]);return(0,p.jsx)("div",{className:"subgrid--mytt grid-cols-12 no-scrollbar col-span-12 -ml-3.75 -mr-3.75 flex snap-x snap-proximity content-start overflow-x-auto px-4 pt-4 md:grid md:ml-0 md:mr-0 md:px-0 md:pt-0",children:m.map(e=>(0,p.jsx)("div",{className:"md:col-span-6 lg:col-span-4 min-w-[80%] md:mr-0",children:(0,p.jsx)(V,{className:"w-full",checked:a.checkedFilters.includes(e.content.headline),onSelect:s=>s.preventDefault(),onCheckedChange:s=>{e.content.iconleft==="all"?a.handleFilterChange([]):u(e.content.headline,s)},children:(0,p.jsx)(J,{iconright:a.checkedFilters.includes(e.content.headline)?"check":"arrow",variant:"dark",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("div",{className:"text-heading-small",children:e.content.headline}),(0,p.jsx)("span",{className:"text-body-md",children:e.content.subline})]})})})},e.id))})}var t=c(y(),1);var Ce=8;var Le=i=>(0,t.jsxs)(t.Fragment,{children:[i.type==="advertisement"&&(0,t.jsx)(Q,{block:i}),i.type==="advertisementglobal"&&(0,t.jsx)(H,{block:i})]});function Ne({type:i,filterType:a}){let g=b("root")?.siteLabels??{},m=i&&i==="videoNews",u=a&&a==="chip",[e,s]=U(),{headerTitle:l,headerText:v,categorizedPages:T,partnerMobileAd:de,pageAds:C,pageChips:ce,pagePathname:S,nextTeasers:k}
1=_(),[w,I]=(0,n.useState)(()=>e.get("category")?.split(",")??[]),[L,z]=(0,n.useState)(k.data),[me,O]=(0,n.useState)(k.total??0),$=me>L.length,[pe,P]=(0,n.useState)(M(e)??1),ge=j();(0,n.useEffect)(()=>{P(M(e)??1),I(e.get("category")?.split(",")??[])},[ge.pathname,e]);let h=G(),he=()=>{if(!$)return;let o=S===A.news?A.allNews:S,d=pe+1;h.load(o+`?index&${w.length>0?`category=${w.join(",")}&`:""}page=${d}`),P(d)},E=o=>{P(1),I(o),s(d=>(o.length>0?d.set("category",o.join(",")):d.delete("category"),d))},D=(0,n.useCallback)(o=>{let d=[],x=1;return o.forEach((ye,fe)=>{d.push(ye),(fe+1)%2===0&&x<C.length&&(d.push(C[x]),x++)}),d},[C]);(0,n.useEffect)(()=>{h.data&&(z(o=>[...o,...h.data?.nextTeasers?.data||[]]),O(h.data?.nextTeasers?.total??0))},[h.data]);let[ue,be]=(0,n.useState)(D(L??[]));return(0,n.useEffect)(()=>{be(D(L))},[L,D]),(0,n.useEffect)(()=>{z(k.data??[]),O(k.total??0)},[k,w]),(0,t.jsxs)("div",{className:"pt-2 mb-24 md:pt-10",children:[(0,t.jsx)(re,{headerTitle:l,headerText:v,headerAd:C[0],partnerMobileAd:de}),T.length>2&&(0,t.jsx)("section",{className:"grid--mytt-md-gap mb-10",children:u?(0,t.jsx)(le,{pageChips:ce,filterProps:{pageFilters:T,checkedFilters:w,handleFilterChange:E}}):(0,t.jsx)("div",{className:"col-span-12 md:col-span-5 lg:col-span-4",children:(0,t.jsx)(ne,{filterProps:{pageFilters:T.filter(o=>o.category!==N).map(o=>o.category),checkedFilters:w,handleFilterChange:E},labels:g})})}),(0,t.jsx)("section",{className:"grid--mytt-md-gap",children:ue.map((o,d)=>{let x="type"in o&&(o.type==="advertisement"||o.type==="advertisementglobal");return(0,t.jsxs)(n.Fragment,{children:[d===Ce&&(0,t.jsx)("div",{className:"col-span-12 md:col-span-12 md:my-4",children:(0,t.jsx)(q,{id:"superbanner_1",className:"flex justify-center items-center"})}),(0,t.jsx)("div",{className:`${m?"md:col-span-4":"md:col-span-3"} col-span-12 mb-8 min-w-[80%]`,children:x?Le(o):m?(0,t.jsx)(Y,{block:o}):(0,t.jsx)(X,{block:o})})]},`${d}-${o.id}`)})}),$&&(0,t.jsx)("section",{className:"mb-40 grid--mytt-md-gap",children:(0,t.jsx)("div",{className:"col-span-12 text-center",children:(0,t.jsxs)(F,{variant:"link",onClick:he,disabled:h.state!=="idle",busy:h.state!=="idle",children:[(0,t.jsx)(f,{size:"sm",name:"chevron",className:"p-1.5 rounded-full bg-mint mr-3"}),(0,t.jsx)("span",{children:g.loadMore})]})})})]})}export{Ne as a};
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.