1import{b as f,s as g,j as e}from"./index-Bi-eA3Wq.js";import{d as b,c as j,r as i}from"./vendor-GPGsv0WI.js";import{P as o}from"./PageWrapper-Cgfsujtc.js";import{F as x}from"./Footer-DWHGMHeN.js";import"./supabase-D2gm834s.js";function N(t){const r=["https:","http:"];try{const s=new URL(t);return r.includes(s.protocol)?t:"#"}catch{return t.startsWith("/")||t.startsWith("#")?t:"#"}}function u(t,r=150){if(!t)return"";if(t.type==="text")return t.text||"";if(!t.content)return"";const s=t.content.map(a=>u(a)).join(" ").replace(/\s+/g," ").trim();return s.length>r?s.slice(0,r).trimEnd()+"...":s}function m(t,r){var a,c;if(!t)return null;const s=(a=t.content)==null?void 0:a.map((l,n)=>m(l,n));switch(t.type){case"doc":return e.jsx(e.Fragment,{children:s});case"paragraph":return e.jsx("p",{className:"mb-4 text-slate-700 leading-relaxed",children:s},r);case"heading":{const l=((c=t.attrs)==null?void 0:c.level)||2,n="font-bold mt-8 mb-4 text-slate-900 "+(l===2?"text-xl":"text-lg");return l===2?e.jsx("h2",{className:n,children:s},r):e.jsx("h3",{className:n,children:s},r)}case"blockquote":return e.jsx("blockquote",{className:"border-l-4 border-blue-600 pl-4 my-8 italic text-lg text-slate-800 bg-slate-50 py-4 pr-4 rounded-r-lg",children:s},r);case"bulletList":return e.jsx("ul",{className:"list-disc pl-5 mb-4 text-slate-700 space-y-2",children:s},r);case"orderedList":return e.jsx("ol",{className:"list-decimal pl-5 mb-4 text-slate-700 space-y-2",children:s},r);case"listItem":return e.jsx("li",{children:s},r);case"horizontalRule":return e.jsx("hr",{className:"my-8 border-gray-200"},r);case"text":{let l=t.text;return t.marks&&t.marks.forEach(n=>{n.type==="bold"&&(l=e.jsx("strong",{children:l})),n.type==="italic"&&(l=e.jsx("em",{children:l})),n.type==="link"&&(l=e.jsx("a",{href:N(n.attrs.href),className:"text-blue-600 underline",target:"_blank",rel:"noopener noreferrer",children:l}))}),e.jsx("span",{children:l},r)}default:return e.jsx(e.Fragment,{children:s})}}function F(){const{slug:t}=b(),r=j(),{setForceDarkText:s}=f(),[a,c]=i.useState(null),[l,n]=i.useState(!0),[p,h]=i.useState(!1);return i.useEffect(()=>(s(!0),()=>s(!1)),[s]),i.useEffect(()=>{window.scrollTo(0,0),g.from("articles").select("*").eq("slug",t).eq("published",!0).single().then(({data:d})=>{d?c(d):h(!0),n(!1)})},[t]),l?e.jsxs(o,{children:[e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx("div",{className:"w-10 h-10 rounded-full border-[3px] border-brand-blue/20 border-t-brand-blue animate-spin"})}),e.jsx(x,{})]}):p?e.jsxs(o,{children:[e.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center gap-4",children:[e.jsx("p",{className:"text-gray-500",children:"Artikel tidak ditemukan."}),e.jsx("button",{onClick:()=>r("/resource"),className:"text-brand-blue text-sm font-medium hover:underline",children:"â Kembali ke Resource"})]}),e.jsx(x,{})]}):e.jsxs(o,{children:[e.jsx("div",{className:"w-full font-sans bg-white",children:e.jsxs("div",{className:"max-w-4xl mx-auto pt-36 pb-16 px-6 lg:px-8",children:[e.jsx("nav",{className:"mb-10","aria-label":"Breadcrumb",children:e.jsxs("button",{onClick:()=>r(-1),className:"inline-flex items-center gap-1.5 text-sm text-gray-400 hover:text-brand-blue cursor-pointer transition-colors duration-200 group",children:[e.jsxs("svg",{width:"16",height:"16",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"group-hover:-translate-x-0.5 transition-transform duration-200","aria-hidden":"true",children:[e.jsx("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),e.jsx("polyline",{points:"12 19 5 12 12 5"})]}),e.jsx("span",{children:"Resource"}),e.jsx("span",{className:"text-gray-300",children:"/"}),e.jsx("span",{children:"Article"})]})}),e.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold tracking-tight leading-tight text-slate-900 mb-6",children:a.title}),(a.excerpt||u(a.content))&&e.jsx("p",{className:"text-xl md:text-2xl text-gray-400 leading-relaxed mb-8 font-normal",children:a.excerpt||u(a.content)}),e.jsx("p",{className:"text-xs font-bold uppercase tracking-[0.15em] text-gray-300 mb-12",children:new Date(a.published_at||a.created_at).toLocaleStr
1ing("id-ID",{day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"})}),a.banner_image_url&&e.jsx("div",{className:"w-full aspect-[16/9] rounded-2xl shadow-[0_8px_40px_rgba(0,0,0,0.12)] mb-14 overflow-hidden bg-slate-100",children:e.jsx("img",{src:a.banner_image_url,alt:a.title,className:"w-full h-full object-cover",loading:"lazy",decoding:"async"})}),e.jsx("article",{className:"flex flex-col gap-4",children:m(a.content,0)})]})}),e.jsx(x,{})]})}export{F 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.