1import{j as e,L as S}from"./index-Ca8Qthj3.js";import{P as T}from"./PageHead-BV4JoAsM.js";import{B as q,g as F}from"./hadithGrade-CSLjmdBk.js";import{g as U,b as D,a as E}from"./schema-yPQl4twP.js";import{a as M,g as Q,i as z,h as G,d as K}from"./useHadith-e3GNINbx.js";import{u as O}from"./citationHref-CLrSouJ1.js";import{f as W,e as I,N as J,L as $}from"./react-vendor-Coattl4B.js";import{Q as V}from"./quote-BsQ0lXEE.js";import{M as A}from"./index-BghV_Vjv.js";import{A as X}from"./arrow-left-B17NHGqa.js";import{B as Y}from"./book-open-BURQUvBE.js";import{A as Z}from"./arrow-right-4d7EzfYP.js";import"./house-DC9943nn.js";import"./supabase-B_M_3bCE.js";import"./supabase-D56URzBO.js";import"./index-C3vmPVCj.js";function i({title:s,children:t}){return e.jsxs("section",{className:"mb-9",children:[e.jsx("h2",{className:"text-[17px] md:text-[18px] font-bold tracking-wide uppercase text-emerald-800 mb-4 pb-2 border-b-2 border-emerald-100",children:s}),t]})}const C={h3:({children:s})=>e.jsx("h3",{className:"mt-6 mb-2 text-[15px] font-bold text-emerald-700 first:mt-0",children:s}),ul:({children:s})=>e.jsx("ul",{className:"list-disc pl-5 space-y-1 my-2",children:s}),ol:({children:s})=>e.jsx("ol",{className:"list-decimal pl-5 space-y-1 my-2",children:s}),li:({children:s})=>e.jsx("li",{className:"text-[15px] text-gray-700 leading-relaxed",children:s}),p:({children:s})=>e.jsx("p",{className:"text-[15px] text-gray-700 leading-relaxed my-2",children:s}),a:({href:s,children:t})=>{const d=Array.isArray(t)?t.join(""):String(t??""),x=O(s||"",d);return e.jsx("a",{href:x.href,className:"text-emerald-700 underline underline-offset-2 hover:text-emerald-900",...x.newTab?{target:"_blank",rel:"noopener noreferrer"}:{},children:t})}};function ge({slug:s}){const t=M(s),{hadithParam:d}=W(),{number:x,sub:H}=Q(d),j=I(),{hadith:a,book:r,chapter:n,prevPath:p,nextPath:h,loading:P,error:B}=z(t?.collection,x,H);if(!t)return e.jsx(J,{to:"/hadith",replace:!0});if(P)return e.jsx("div",{className:"min-h-screen bg-[#fafafa] flex items-center justify-center",children:e.jsx(S,{className:"w-8 h-8 animate-spin text-emerald-600"})});if(B||!a)return e.jsxs("div",{className:"min-h-screen bg-[#fafafa] flex flex-col items-center justify-center gap-3 px-6 text-center",children:[e.jsx("p",{className:"text-gray-600",children:"Hadith not found."}),e.jsxs($,{to:`/${t.slug}`,className:"text-emerald-700 font-semibold hover:underline",children:["Back to ",t.name]})]});const u=Array.isArray(a.key_lessons)?a.key_lessons:[],y=Array.isArray(a.fiqh_rulings)?a.fiqh_rulings:[],N=Array.isArray(a.cross_references)?a.cross_references:[],v=Array.isArray(a.tags)?a.tags:[],c=a.sub_number?`${a.number}.${a.sub_number}`:`${a.number}`,f=r?G(t.slug,r,a):`/${t.slug}`,o=r?K(t.slug,r):`/${t.slug}`,g=r&&n?`${o}#chapter-${n.number}`:o,_=n?.name_en?.trim()||"",b=n?.name_ar?.trim()||"",R=b&&b!=="باب",L=_||r?.name_en||t.name,w=R?b:r?.name_ar||"",k=_||(n?`Chapter ${n.number}`:"");return e.jsxs("div",{className:"min-h-screen bg-[#fafafa] font-sans pt-20",children:[e.jsx(T,{title:`${t.name} ${c}, ${r?.name_en||""}`,description:(a.translation_en||"").slice(0,160),path:f,type:"article",noindex:!0,schema:U(E({title:`${t.name} ${c}`,description:(a.translation_en||"").slice(0,200),path:f,type:"CreativeWork"}),D([{name:"Home",path:"/"},{name:t.name,path:`/${t.slug}`},...r?[{name:r.name_en,path:o}]:[],...n?[{name:k,path:g}]:[],{name:`Hadith ${c}`,path:f}]))}),e.jsx("header",{className:"bg-gradient-to-b from-emerald-50/70 via-emerald-50/40 to-white border-b border-gray-200",children:e.jsxs("div",{className:"max-w-[820px] mx-auto px-6 pt-6 pb-9",children:[e.jsx(q,{items:[{name:"Hadith",to:"/hadith"},{name:t.name,to:`/${t.slug}`},...r?[{name:r.name_en,to:o}]:[],...n?[{name:k,to:g}]:[],{name:`Hadith ${c}`}]}),e.jsxs("div",{className:"mt-7 mb-5 flex items-stretch justify-center divide-x divide-gray-200 text-center",children:[e.jsxs("div",{className:"flex flex-col px-5",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-gray-400",children:"Reference"}),e.jsxs("span",{className:"mt-0.5 text-[14px] font-bold text-emerald-700",children:[t.name," ",c]})]}),a.grade&&e.jsxs("div",{className:"flex flex-col px-5",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-gray-400",children:"Grade"}),e.jsx("span",{className:`mt-0.5 text-[14px] font-semibold ${F(a.grade)}`,children:a.grade})]}),r?.number!=null&&e.jsxs("div",{className:"flex flex-col px-5",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-gray-400",children:"Book"}),e.jsx("span",{className:"mt-0.5 text-[14px] font-semibold text-gray-800",children:r.number})]}),n?.number&&e.jsxs("div",{className:"flex flex-col px-5",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-gray-400",children:"Chapter"}),e.jsx("span",{className:"mt-0.5 text-[14px] font-semibold text-gray-800",children:n.number})]})]}),e.jsx("h1",{className:"mx-auto max-w-2xl text-center text-[21px] md:text-[25px] font-bold text-[#111827] leading-snug tracking-tight",children:L}),w&&e.jsx("p",{className:"mx-auto mt-3 max-w-2xl text-center text-[22px] leading-loose text-emerald-800",dir:"rtl",lang:"ar",style:{fontFamily:"var(--font-arabic)"},children:w})]})}),e.jsxs("article",{className:"max-w-[820px] mx-auto px-6 py-10",children:[(a.arabic_full||a.arabic_matn)&&e.jsx("div",{className:"bg-white border border-gray-200 shadow-sm p-7 mb-8 text-right leading-[2.4]",dir:"rtl",lang:"ar",children:e.jsx("p",{className:"text-[26px] text-gray-900",style:{fontFamily:"var(--font-arabic)"},children:a.arabic_full||a.arabic_matn})}),a.transliteration&&e.jsx(i,{title:"Transliteration",children:e.jsx("p",{className:"text-[15px] italic text-gray-600 leading-relaxed",children:a.transliteration})}),a.translation_en&&e.jsx(i,{title:"Translation",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(V,{className:"w-5 h-5 text-emerald-300 shrink-0 mt-1"}),e.jsx("p",{className:"text-[17px] text-gray-800 leading-relaxed whitespace-pre-line",children:a.translation_en})]})}),(a.narrator_primary||a.narrator_chain)&&e.jsxs(i,{title:"Chain of Narration",children:[a.narrator_primary&&e.jsxs("p",{className:"text-[14px] text-gray-700 mb-1",children:[e.jsx("span",{className:"text-gray-400",children:"Narrated by "}),e.jsx("span",{className:"font-semibold",children:a.narrator_primary})]}),a.narrator_chain&&e.jsx("div",{className:"text-gray-600",children:e.jsx(A,{components:C,children:a.narrator_chain})})]}),a.commentary&&e.jsx(i,{title:"Commentary",children:e.jsx(A,{components:C,children:a.commentary})}),u.length>0&&e.jsx(i,{title:"Key Lessons",children:e.jsx("ul",{className:"space-y-2",children:u.map((l,m)=>e.jsxs("li",{className:"flex gap-2 text-[15px] text-gray-700",children:[e.jsx("span",{className:"text-emerald-500 font-bold",children:"â¢"}),e.jsx("span",{children:l})]},m))})}),y.length>0&&e.jsx(i,{title:"Derived Rulings (Fiqh)",children:e.jsx("ul",{className:"space-y-2",children:y.map((l,m)=>e.jsxs("li",{className:"flex gap-2 text-[15px] text-gray-700",children:[e.jsx("span",{className:"text-amber-500 font-bold",children:"â¢"}),e.jsx("span",{children:l})]},m))})}),N.length>0&&e.jsx(i,{title:"Cross-References",children:e.jsx("div",{className:"flex flex-wrap gap-2",children:N.map((l,m)=>e.jsxs("span",{className:"text-[12px] text-gray-600 bg-white border border-gray-200 px-2.5 py-1",children:[l.collection," ",l.ref]},m))})}),v.length>0&&e.jsx(i,{title:"Topics",children:e.jsx("div",{className:"flex flex-wrap gap-2",children:v.map(l=>e.jsx("span",{className:"text-[12px] text-emerald-700 bg-emerald-50 px-2.5 py-1 capitalize",children:l.replace(/-/g," ")},l))})}),e.jsxs("div",{className:"mt-10 pt-6 border-t border-gray-200 flex items-center justify-between",children:[e.jsxs("button",{disabled:!p,onClick:()=>p&&j(p),className:"inline-flex items-center gap-1.5 text-[14px] font-semibold text-gray-600 hover:text-emerald-700 disabled:opacity-30 disabled:cursor-not-allowed",children:[e.jsx(X,{className:"w-4 h-4"})," Previous"]}),e.jsx($,{to:g,className:"text-gray-400 hover:text-emerald-700",children:e.jsx(Y,{className:"w-5 h-5"})}),e.jsxs("button",{disabled:!h,onClick:()=>h&&j(h),className:"inline-flex items-center gap-1.5 text-[14px] font-semibold text-gray-600 hover:text-emerald-700 disabled:opacity-30 disabled:cursor-not-allowed",children:["Next ",e.jsx(Z,{className:"w-4 h-4"})]})]})]})]})}export{ge 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.