1import{aJ as B,a as C,j as e,L as E,B as w,ag as g,aE as L,r as S,s as P}from"./index-DIinWBJp.js";import{B as v}from"./badge-CzxSdy2z.js";import{N as p}from"./Navigation-ChpOE1L0.js";import{F as _}from"./Footer-DWHyNqRl.js";import{H as $}from"./house-Btx2vnKZ.js";import{C as k}from"./dropdown-menu-xzQnnre3.js";import{C as M}from"./calendar-B5GJoZMa.js";import{C as T}from"./clock-BRkjCs0K.js";import"./use-mobile-5yjsjcRB.js";import"./ThemeToggle-BspBLUzl.js";import"./monitor-nZYT0ThD.js";import"./dollar-sign-lYBCXQMN.js";import"./book-open-CKN7LRhv.js";import"./circle-help-BpMvXmzU.js";import"./shield-C6ojBWS4.js";import"./credit-card-DsHCksMU.js";import"./log-out-DoEGeLqo.js";import"./twitter-ChCGphyM.js";import"./youtube-BkVbwft6.js";import"./proxy-F-bQsoVM.js";import"./arrow-up-right-DQA_3acn.js";const h="Tingu.ai";function A({post:t}){return S.useEffect(()=>{var b,f,j;const a=t.meta_title?`${t.meta_title} | ${h}`:`${t.title} | ${h} Blog`,n=t.meta_description||t.excerpt||"",l=`${window.location.origin}/blog/${t.slug}`,d=t.published_at??t.created_at,s=t.content.replace(/<[^>]+>/g," ").split(/\s+/).filter(Boolean).length,c=Math.max(1,Math.ceil(s/200));document.title=a;const r=(i,y,q=!1)=>{if(!y)return;const N=q?"property":"name";let m=document.querySelector(`meta[${N}="${i}"]`);m||(m=document.createElement("meta"),m.setAttribute(N,i),document.head.appendChild(m)),m.content=y};r("description",n),r("robots","index, follow"),r("author",t.author),(b=t.tags)!=null&&b.length&&r("keywords",t.tags.join(", ")),r("article:published_time",d,!0),r("article:modified_time",t.updated_at,!0),r("article:author",t.author,!0),(f=t.tags)==null||f.forEach(i=>r("article:tag",i,!0)),r("og:type","article",!0),r("og:title",a,!0),r("og:description",n,!0),r("og:url",l,!0),r("og:site_name",h,!0),t.hero_image_url&&(r("og:image",t.hero_image_url,!0),r("og:image:alt",t.hero_image_alt??t.title,!0)),r("twitter:card","summary_large_image"),r("twitter:title",a),r("twitter:description",n),t.hero_image_url&&r("twitter:image",t.hero_image_url);let o=document.querySelector('link[rel="canonical"]');o||(o=document.createElement("link"),o.rel="canonical",document.head.appendChild(o)),o.href=l,document.querySelectorAll('script[data-blog-post="true"]').forEach(i=>i.remove());const u=document.createElement("script");u.type="application/ld+json",u.setAttribute("data-blog-post","true"),u.textContent=JSON.stringify({"@context":"https://schema.org","@type":"Article","@id":l,headline:t.title,description:n,image:t.hero_image_url?[t.hero_image_url]:void 0,datePublished:d,dateModified:t.updated_at,author:{"@type":"Person",name:t.author},publisher:{"@type":"Organization",name:h,url:window.location.origin},mainEntityOfPage:{"@type":"WebPage","@id":l},keywords:(j=t.tags)==null?void 0:j.join(", "),wordCount:s,timeRequired:`PT${c}M`}),document.head.appendChild(u);const x=document.createElement("script");return x.type="application/ld+json",x.setAttribute("data-blog-post","true"),x.textContent=JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:window.location.origin},{"@type":"ListItem",position:2,name:"Blog",item:`${window.location.origin}/blog`},{"@type":"ListItem",position:3,name:t.title,item:l}]}),document.head.appendChild(x),()=>{document.querySelectorAll('script[data-blog-post="true"]').forEach(i=>i.remove())}},[t]),null}function oe(){var s,c;const{slug:t}=B(),{data:a,isLoading:n,error:l}=C({queryKey:["public-blog-post",t],queryFn:async()=>{const{data:r,error:o}=await P.from("blog_posts").select("*").eq("slug",t).eq("status","published").lte("published_at",new Date().toISOString()).single();if(o)throw o;return r},enabled:!!t}),d=a?Math.max(1,Math.ceil(a.content.replace(/<[^>]+>/g," ").split(/\s+/).filter(Boolean).length/200)):0;return n?e.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[e.jsx(p,{}),e.jsx("main",{className:"flex-1 mt-16 min-h-[60vh] flex items-center justify-center",children:e.jsx(E,{className:"h-8 w-8 animate-spin text-primary"})}),e.jsx(_,{})]}):l||!a?e.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[e.jsx(p,{}),e.jsxs("main",{className:"flex-1 mt-16 min-h-[60vh] flex flex-col items-center justify-center gap-4",children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Post not found"}),e.jsx("p",{className:"text-muted-foreground",children:"This post may have been removed or is not yet published."}),e.jsx(w,{asChild:!0,variant:"outline",children:e.jsx(g,{to:"/blog",children:"â Back to Blog"})})]}),e.jsx(_,{})]}):e.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[e.jsx(p,{}),e.jsxs("main",{className:"flex-1 mt-16",children:[e.jsx(A,{post:a}),e.jsx("nav",{"aria-label":"Breadcrumb",className:"container mx-auto px-4 pt-6 pb-2 max-w-4xl",children:e.jsxs("ol",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("li",{children:e.jsxs(g,{to:"/",className:"flex items-center gap-1 hover:text-foreground transition-colors",children:[e.jsx($,{className:"h-3.5 w-3.5"})," Home"]})}
1),e.jsx(k,{className:"h-3.5 w-3.5 text-muted-foreground/50 flex-shrink-0"}),e.jsx("li",{children:e.jsx(g,{to:"/blog",className:"hover:text-foreground transition-colors",children:"Blog"})}),e.jsx(k,{className:"h-3.5 w-3.5 text-muted-foreground/50 flex-shrink-0"}),e.jsx("li",{className:"text-foreground font-medium line-clamp-1 max-w-[300px]","aria-current":"page",children:a.title})]})}),e.jsxs("article",{className:"container mx-auto px-4 pt-6 pb-20 max-w-4xl",children:[((s=a.tags)==null?void 0:s.length)>0&&e.jsx("div",{className:"flex flex-wrap gap-2 mb-4",children:a.tags.map(r=>e.jsx(v,{variant:"secondary",className:"text-xs",children:r},r))}),e.jsx("h1",{className:"text-3xl md:text-4xl lg:text-5xl font-bold leading-tight tracking-tight mb-4",children:a.title}),a.excerpt&&e.jsx("p",{className:"text-lg text-muted-foreground leading-relaxed mb-6 border-l-2 border-primary/50 pl-4",children:a.excerpt}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 py-4 border-y border-border mb-8 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(L,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium text-foreground/80",children:a.author})]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(M,{className:"h-4 w-4"}),new Date(a.published_at??a.created_at).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(T,{className:"h-4 w-4"}),d," min read"]})]}),a.hero_image_url&&e.jsxs("figure",{className:"mb-10 rounded-2xl overflow-hidden border border-border",children:[e.jsx("img",{src:a.hero_image_url,alt:a.hero_image_alt??a.title,className:"w-full object-cover max-h-[480px]",loading:"eager"}),a.hero_image_alt&&e.jsx("figcaption",{className:"text-xs text-muted-foreground text-center py-2 px-4 bg-muted/30",children:a.hero_image_alt})]}),e.jsx("div",{className:["prose prose-invert max-w-none","[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:mt-10 [&_h1]:mb-4 [&_h1]:tracking-tight","[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:mt-10 [&_h2]:mb-4 [&_h2]:tracking-tight [&_h2]:border-b [&_h2]:border-border/40 [&_h2]:pb-2","[&_h3]:text-xl [&_h3]:font-semibold [&_h3]:mt-7 [&_h3]:mb-3","[&_h4]:text-lg [&_h4]:font-medium [&_h4]:mt-5 [&_h4]:mb-2","[&_p]:my-4 [&_p]:leading-7 [&_p]:text-foreground/90","[&_ul]:list-disc [&_ul]:pl-6 [&_ul]:my-4 [&_ul]:space-y-1.5","[&_ol]:list-decimal [&_ol]:pl-6 [&_ol]:my-4 [&_ol]:space-y-1.5","[&_li]:leading-7","[&_blockquote]:border-l-4 [&_blockquote]:border-primary [&_blockquote]:pl-5 [&_blockquote]:py-1 [&_blockquote]:italic [&_blockquote]:my-6 [&_blockquote]:text-muted-foreground [&_blockquote]:bg-primary/5 [&_blockquote]:rounded-r-lg","[&_pre]:bg-[#1e1e1e] [&_pre]:rounded-xl [&_pre]:p-5 [&_pre]:my-6 [&_pre]:overflow-x-auto [&_pre]:border [&_pre]:border-border/50","[&_code]:bg-muted [&_code]:rounded [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:text-sm [&_code]:font-mono [&_code]:text-primary","[&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-green-400","[&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2 [&_a:hover]:opacity-80 [&_a:hover]:no-underline","[&_img]:max-w-full [&_img]:rounded-xl [&_img]:my-6 [&_img]:border [&_img]:border-border/50","[&_figure]:my-6 [&_figcaption]:text-sm [&_figcaption]:text-muted-foreground [&_figcaption]:text-center [&_figcaption]:mt-2","[&_table]:w-full [&_table]:border-collapse [&_table]:my-6","[&_th]:border [&_th]:border-border [&_th]:px-4 [&_th]:py-2.5 [&_th]:bg-muted/50 [&_th]:text-left [&_th]:font-semibold [&_th]:text-sm","[&_td]:border [&_td]:border-border [&_td]:px-4 [&_td]:py-2.5 [&_td]:text-sm","[&_tr:hover_td
1]:bg-muted/20","[&_hr]:border-border [&_hr]:my-8","[&_strong]:font-semibold [&_strong]:text-foreground","[&_em]:italic [&_em]:text-foreground/90"].join(" "),dangerouslySetInnerHTML:{__html:a.content}}),((c=a.tags)==null?void 0:c.length)>0&&e.jsxs("div",{className:"mt-10 pt-6 border-t border-border",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-3 font-medium uppercase tracking-wide",children:"Tagged with"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:a.tags.map(r=>e.jsx(v,{variant:"outline",className:"text-xs",children:r},r))})]}),e.jsx("div",{className:"mt-10",children:e.jsx(w,{asChild:!0,variant:"outline",className:"glass-card",children:e.jsx(g,{to:"/blog",children:"â Back to all posts"})})})]})]}),e.jsx(_,{})]})}export{oe 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.