1import{u as E,h as B,r as o,ch as S,j as t,b9 as T,I as k,X as A,B as R,ba as M,ci as O,cj as N}from"./index-B9m0jA0r.js";import{u as q,B as H}from"./BlogCard-CF90l0QQ.js";import{S as F}from"./search-DNBvS_5l.js";const G=["All",...N];function I(s){return s.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim()}const j=S.map(s=>({slug:s.slug,haystack:[s.title,s.excerpt,s.category,I(s.contentHtml)].join(" ").toLowerCase(),titleLower:s.title.toLowerCase()}));function D(){const s=E(),[m,u]=B(),[y,h]=o.useState(!1),p=o.useRef(!1);q({title:"The Care Plan Pro Blog | Practice Growth for Chiropractors",description:"Practice growth strategies for chiropractors who want better patient outcomes and more predictable revenue.",canonicalUrl:"https://careplanpro.ai/blog",ogType:"website"}),o.useEffect(()=>{if(window.matchMedia("(pointer: coarse)").matches)return;const e=a=>{a.clientY<=0&&!p.current&&(p.current=!0,h(!0))};return document.addEventListener("mouseleave",e),()=>document.removeEventListener("mouseleave",e)},[]);const g=m.get("cat");m.get("q");const d=g&&N.includes(g)?g:"All",[n,x]=o.useState(()=>m.get("q")??""),[c,f]=o.useState(n);o.useEffect(()=>{const e=setTimeout(()=>f(n),250);return()=>clearTimeout(e)},[n]),o.useEffect(()=>{u(e=>{const a=new URLSearchParams(e);return c.trim()?a.set("q",c):a.delete("q"),a},{replace:!0})},[c,u]);const C=e=>{u(a=>{const l=new URLSearchParams(a);return e==="All"?l.delete("cat"):l.set("cat",e),l},{replace:!0})},P=()=>{x(""),f(""),u({},{replace:!0})},b=o.useMemo(()=>{const e=c.trim().toLowerCase().split(/\s+/).filter(Boolean),a=new Set(j.filter(r=>e.every(i=>r.haystack.includes(i))).map(r=>r.slug)),l=e.length>0?new Set(j.filter(r=>e.every(i=>r.titleLower.includes(i))).map(r=>r.slug)):new Set,v=S.filter(r=>!(d!=="All"&&r.category!==d||e.length>0&&!a.has(r.slug)));return e.length>0&&v.sort((r,i)=>{const w=l.has(r.slug),L=l.has(i.slug);return w===L?0:w?-1:1}),v},[d,c]);return t.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[t.jsx(T,{variant:"blog",ctaLabel:"Start Free",onCtaClick:()=>s("/signup")}),t.jsxs("div",{className:"cpp-marketing",children:[t.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-16 pb-10 sm:pt-24 sm:pb-14",children:[t.jsx("h1",{className:"text-4xl sm:text-5xl leading-[1.1]",children:"The Care Plan Pro Blog"}),t.jsx("p",{className:"mt-5 text-lg text-muted-foreground max-w-2xl leading-relaxed",children:"Practice growth strategies for chiropractors who want better patient outcomes and more predictable revenue."})]}),t.jsxs("div",{className:"max-w-5xl mx-auto px-6",children:[t.jsxs("div",{className:"max-w-xl mx-auto mb-6 relative",children:[t.jsx(F,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),t.jsx(k,{type:"text",value:n,onChange:e=>x(e.target.value),placeholder:"Search articlesâ¦","aria-label":"Search blog articles",className:"pl-9 pr-9 rounded-full"}),n&&t.jsx("button",{type:"button",onClick:()=>x(""),"aria-label":"Clear search",className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:t.jsx(A,{className:"h-4 w-4"})})]}),t.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2 mb-10",children:G.map(e=>{const a=d===e;return t.jsx("button",{onClick:()=>C(e),className:`px-4 py-1.5 rounded-full text-sm transition-colors border ${a?"bg-foreground text-background border-foreground":"bg-transparent text-muted-foreground border-border hover:text-foreground hover:border-foreground
1/40"}`,children:e},e)})})]}),t.jsx("main",{className:"max-w-5xl mx-auto px-6 pb-20",children:b.length===0?t.jsxs("div",{className:"text-center py-20",children:[t.jsx("p",{className:"text-muted-foreground mb-6",children:"No articles match your search."}),t.jsx(R,{onClick:P,variant:"outline",className:"rounded-full",children:"Clear filters"})]}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:b.map(e=>t.jsx(H,{post:e},e.slug))})})]}),t.jsx(M,{}),t.jsx(O,{open:y,onClose:()=>h(!1),source:"blog"})]})}export{D 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.