1import{r as h,f as T,j as e,m as b,h as $,I as q,X as H,B as p,L,c as C}from"./index-QiiZ-xPT.js";import{N as P}from"./Navigation-r93ZBuy6.js";import{F as Q}from"./Footer-3JNsJayo.js";import{g as N,A as _,a as I}from"./article-categories-B10WQW6s.js";import{u as B}from"./useTranslation-XedzLvcK.js";import{C as A}from"./clock-Jb0c5sRN.js";import"./label-BA9Xin3m.js";import"./checkbox-CrGTwbPu.js";import"./index-DqZlRfV5.js";import"./check-KTa2Xihg.js";import"./select-B1P2Vx_w.js";import"./index-BMyKsIJE.js";import"./Combination-TP2Egp2x.js";import"./chevron-down-BWOHa16b.js";import"./dialog-D2VXyQJN.js";import"./save-BsB7cS8F.js";import"./dropdown-menu-D4zjGRmc.js";import"./index-Bj3iuRQR.js";import"./chevron-right-f4G5e4zR.js";import"./circle-2nw1jhuN.js";import"./globe-3tsuvpPT.js";import"./log-out-CqAuLeet.js";import"./building-2-Bz-h5bHH.js";import"./BrandSponsor-DEW6i_On.js";import"./card-DkXabqFf.js";import"./mail-Cr62Xklx.js";import"./twitter-BzZd48jL.js";const d=12;function g(t){return t?t.replace(/<[^>]*>/g,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/’/g,"'").replace(/‘/g,"'").replace(/“/g,'"').replace(/”/g,'"').replace(/–/g,"â").replace(/—/g,"â").replace(/ /g," ").replace(/\s+/g," ").trim():""}function x(t){const o=document.createElement("textarea");return o.innerHTML=t,o.value}function k(t){const o=g(t).split(/\s+/).length;return Math.max(1,Math.ceil(o/200))}function fe(){const{t}=B(),[o,c]=h.useState(d),[n,f]=h.useState(""),[i,j]=h.useState(null),{data:l,isLoading:E,error:F}=T({queryKey:["/api/wp/posts/all"],queryFn:async()=>{const s=await fetch("/api/wp/posts?all=true");if(!s.ok)throw new Error("Failed to fetch articles");return s.json()},staleTime:1e3*60*10}),v=h.useMemo(()=>l?l.filter(s=>{if(n){const a=n.toLowerCase(),m=x(s.title).toLowerCase(),r=g(s.excerpt||"").toLowerCase();if(!m.includes(a)&&!r.includes(a))return!1}return!(i&&N(s.slug).key!==i)}):[],[l,n,i]),u=v.slice(0,o),M=o<v.length,z=()=>{c(s=>s+d)},R=()=>{f(""),j(null),c(d)};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(P,{}),e.jsx("section",{className:"pt-32 pb-12 bg-gradient-to-br from-background via-background to-primary/5",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6",children:e.jsxs(b.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6},className:"text-center max-w-3xl mx-auto",children:[e.jsx("h1",{className:"font-serif text-4xl md:text-5xl font-bold mb-4","data-testid":"text-page-title",children:t("thoughtLeadership.title")}),e.jsx("div",{className:"w-16 h-px bg-primary/60 mx-auto mb-4","aria-hidden":"true"}),e.jsx("p",{className:"font-serif italic text-xl text-muted-foreground","data-testid":"text-page-subtitle",children:t("thoughtLeadership.subtitle")})]})})}),e.jsx("section",{className:"py-12",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6",children:[e.jsxs("div",{className:"mb-8 space-y-4",children:[e.jsxs("div",{className:"relative max-w-md",children:[e.jsx($,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",size:20}),e.jsx(q,{type:"text",placeholder:t("thoughtLeadership.searchPlaceholder"),value:n,onChange:s=>{f(s.target.value),c(d)},className:"pl-10 pr-10","data-testid":"input-search"}),n&&e.jsx("button",{onClick:()=>f(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","data-testid":"button-clear-search",children:e.jsx(H,{size:16})})]}),e.jsxs("div",{className:"flex gap-2 overflow-x-auto pb-2 -mx-6 px-6 md:mx-0 md:px-0 md:flex-wrap md:overflow-visible scrollbar-hide",children:[e.jsx(p,{variant:i===null?"default":"outline",size:"sm",onClick:()=>{j(null),c(d)},className:"shrink-0","data-testid":"button-filter-all",children:t("thoughtLeadership.filterAll")}),Object.entries(_).map(([s,{name:a,color:m}])=>e.jsx(p,{variant:i===s?"default":"outline",size:"sm",onClick:()=>{j(s),c(d)},className:`shrink-0 ${i!==s?m:""}`,"data-testid":`button-filter-${s}`,children:a},s))]}),(n||i)&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t("thoughtLeadership.resultsFound",{count:v.length})}),e.jsx(p,{variant:"ghost",size:"sm",onClick:R,"data-testid":"button-clear-filters",children:t("thoughtLeadership.clearFilters")})]})]}),E&&e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:[1,2,3,4,5,6].map(s=>e.jsxs("div",{className:"animate-pulse",children:[e.jsx("div",{className:"bg-muted rounded-2xl h-48 mb-4"}),e.jsx("div",{className:"h-4 bg-muted rounded w-1/4 mb-3"}),e.jsx("div",{className:"h-6 bg-muted rounded w-3/4 mb-2"}),e.jsx("div",{className:"h-4 bg-muted rounded w-full"})]},s))}),F&&e.jsx("div",{className:"text-center py-12","data-testid":"text-error",children:e.jsx("p",{className:"text-muted-foreground",children:t("thoughtLeadership.errorLoading")})}),l&&l.length===0&&e.jsx("div",{className:"text-center py-12","data-testid":"text-no-articles",children:e.jsx("p",{className:"text-muted-foreground",children:t("thoughtLeadership.noArticles")})}),l&&l.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-6 text-sm text-muted-foreground","data-testid":"text-showing-count",children:t("thoughtLeadership.showingCount",{visible:u.length,total:l.length})}),(()=>{const a=!!(n||i)?null:u[0],m=a?u.slice(1):u;return e.jsxs(e.Fragment,{children:[a&&e.jsx(b.article,{initial:{opacity:0,y:20}
1,animate:{opacity:1,y:0},transition:{duration:.5},className:"group mb-12","data-testid":`card-article-lead-${a.id}`,children:e.jsx(L,{href:`/thought-leadership/${a.slug}`,children:e.jsxs("div",{className:"grid md:grid-cols-2 gap-8 items-center bg-card rounded-2xl overflow-hidden border border-border hover:border-primary/50 transition-all duration-300 hover:shadow-xl p-0 md:pr-10",children:[e.jsx("div",{className:"aspect-video md:aspect-[4/3] overflow-hidden",children:(()=>{const r=I(a.slug)||a.featuredImage?.url;return r?e.jsx("img",{src:r,alt:x(a.title),className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-primary/20 to-primary/5 flex items-center justify-center",children:e.jsx("span",{className:"text-5xl font-bold text-primary/30",children:"LC"})})})()}),e.jsxs("div",{className:"p-6 md:p-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[(()=>{const r=N(a.slug);return e.jsx("span",{className:`text-xs uppercase tracking-[0.2em] px-3 py-1 rounded-full ${r.color}`,children:r.name})})(),e.jsxs("span",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx(A,{size:14}),t("thoughtLeadership.minRead",{count:k(a.content)})]})]}),e.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-bold leading-tight mb-3 group-hover:text-primary transition-colors",children:x(a.title)}),e.jsx("p",{className:"font-serif text-muted-foreground line-clamp-4 mb-4",children:g(a.excerpt)}),e.jsxs("div",{className:"flex items-center text-primary font-medium text-sm",children:[t("thoughtLeadership.readMore"),e.jsx(C,{size:16,className:"ml-1 group-hover:translate-x-1 transition-transform"})]})]})]})})}),e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:m.map((r,S)=>{const y=I(r.slug)||r.featuredImage?.url;return e.jsx(b.article,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:Math.min(S,11)*.1},className:"group","data-testid":`card-article-${r.id}`,children:e.jsx(L,{href:`/thought-leadership/${r.slug}`,children:e.jsxs("div",{className:"bg-card rounded-2xl overflow-hidden border border-border hover:border-primary/50 transition-all duration-300 hover:shadow-xl h-full flex flex-col",children:[y?e.jsx("div",{className:"aspect-video overflow-hidden",children:e.jsx("img",{src:y,alt:x(r.title),className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"})}):e.jsx("div",{className:"aspect-video bg-gradient-to-br from-primary/20 to-primary/5 flex items-center justify-center",children:e.jsx("span",{className:"text-4xl font-bold text-primary/30",children:"LC"})}),e.jsxs("div",{className:"p-6 flex flex-col flex-1",children:[e.jsx("div",{className:"flex items-center gap-4 text-sm text-muted-foreground mb-3",children:e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(A,{size:14}),t("thoughtLeadership.minRead",{count:k(r.content)})]})}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:(()=>{const w=N(r.slug);return e.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${w.color}`,children:w.name})})()}),e.jsx("h2",{className:"font-serif text-xl font-semibold mb-3 group-hover:text-primary transition-colors line-clamp-2",children:x(r.title)}),e.jsx("p",{className:"text-muted-foreground text-sm line-clamp-3 flex-1",children:g(r.excerpt)}),e.jsxs("div",{className:"mt-4 flex items-center text-primary font-medium text-sm",children:[t("thoughtLeadership.readMore"),e.jsx(C,{size:16,className:"ml-1 group-hover:translate-x-1 transition-transform"})]})]})]})})},r.id)})})]})})(),M&&e.jsx("div",{className:"mt-12 text-center",children:e.jsx(p,{onClick:z,size:"lg",variant:"outline",className:"px-8","data-testid":"button-load-more",children:t("thoughtLeadership.loadMore")})})]})]})}),e.jsx(Q,{})]})}export{fe 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.