1import{g,j as t,L as a}from"./react-vendor-C-_weJGF.js";import p from"./purify.es-Dqc4LzU4.js";import{d as x,c as u,P as o}from"./index-DiEum5Ju.js";import{q as h}from"./icons-BZJMmL1V.js";import{f}from"./format-Cpjm9erV.js";import"./query-DA-B5yju.js";import"./radix-CMA3xQgM.js";import"./supabase-BppBjPB2.js";import"./motion-CfmjrLVm.js";function L(){var l;const{slug:n}=g(),{data:e,isLoading:d}=x(n||""),{data:c=[]}=u();if(d)return t.jsx(o,{title:"Loading...",children:t.jsx("div",{className:"pt-24 section-padding",children:t.jsx("div",{className:"container-narrow mx-auto text-center text-muted-foreground",children:"Loading..."})})});if(!e)return t.jsx(o,{title:"Post Not Found",children:t.jsx("div",{className:"pt-24 section-padding",children:t.jsxs("div",{className:"container-narrow mx-auto text-center",children:[t.jsx("h1",{className:"font-display text-3xl font-bold mb-4",children:"Post Not Found"}),t.jsx(a,{to:"/blog",className:"text-primary hover:underline",children:"Back to Blog"})]})})});const i=c.filter(r=>r.id!==e.id).slice(0,3);return t.jsxs(o,{title:e.seo_title||e.title,description:e.seo_description||e.excerpt||"",ogTitle:e.og_title||void 0,ogDescription:e.og_description||void 0,ogImage:e.og_image_url||e.featured_image_url||void 0,twitterTitle:e.twitter_title||void 0,twitterDescription:e.twitter_description||void 0,twitterImage:e.twitter_image_url||void 0,canonical:e.canonical_url||void 0,noindex:e.noindex||!1,nofollow:e.nofollow||!1,slug:`blog/${e.slug}`,type:"article",isBlogPost:!0,publishedAt:e.published_at||void 0,authorName:e.author_name,breadcrumbLabel:e.title,children:[t.jsx("article",{className:"pt-24 section-padding",children:t.jsxs("div",{className:"container-narrow mx-auto max-w-3xl",children:[t.jsxs(a,{to:"/blog",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mb-6",children:[t.jsx(h,{className:"w-4 h-4"})," Back to Blog"]}),e.featured_image_url&&t.jsx("div",{className:"rounded-lg overflow-hidden mb-8 aspect-video",children:t.jsx("img",{src:e.featured_image_url,alt:e.title,width:1200,height:630,className:"w-full h-full object-cover",decoding:"async",fetchpriority:"high"})}),t.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground mb-4",children:[((l=e.blog_categories)==null?void 0:l.name)&&t.jsx("span",{className:"text-primary",children:e.blog_categories.name}),e.published_at&&t.jsx("span",{children:f(new Date(e.published_at),"MMMM d, yyyy")}),t.jsxs("span",{children:["By ",e.author_name]})]}),t.jsx("h1",{className:"font-display text-3xl md:text-4xl font-bold mb-6",children:e.title}),e.content&&(()=>{const r=e.content,m=/<\/?(p|h[1-6]|ul|ol|li|blockquote|pre|figure|img|div|table)\b/i.test(r)?r:r.replace(/^## (.+)$/gm,"<h2>$1</h2>").replace(/^### (.+)$/gm,"<h3>$1</h3>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>\n?)+/g,s=>`<ul>${s}</ul>`).replace(/\[([^\]]+)\]\((https?:\/\/[^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>').replace(/\n\n/g,"</p><p>").replace(/^(?!<[hula])(.+)$/gm,s=>s.startsWith("<")?s:`<p>${s}</p>`);return t.jsx("div",{className:"prose prose-invert max-w-none text-muted-foreground leading-relaxed [&_a]:text-primary [&_a]:underline [&_a]:underline-offset-4 hover:[&_a]:text-primary/80",dangerouslySetInnerHTML:{__html:p.sanitize(m)}})})(),e.tags&&e.tags.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2 mt-8 pt-6 border-t border-border",children:e.tags.map(r=>t.jsx("span",{className:"text-xs bg-secondary px-2 py-1 rounded-full text-muted-foreground",children:r},r))})]})}),i.length>0&&t.jsx("section",{className:"section-padding bg-card/50",children:t.jsxs("div",{className:"container-narrow mx-auto",children:[t.jsx("h2",{className:"font-display text-2xl font-bold mb-6",children:"Related Posts"}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:i.map(r=>t.jsxs(a,{to:`/blog/${r.slug}`,className:"bg-card border border-border rounded-lg p-5 hover:border-primary/30 transition-colors",children:[t.jsx("h3",{className:"font-display font-semibold mb-2",children:r.title}),r.excerpt&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:r.excerpt})]},r.id))})]})})]})}export{L 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.