1import{r as i,j as e,b as q}from"./DocumentFrame-TeeHRRHz.js";import{s as m}from"./supabase-DMm1jo3G.js";import{L as G}from"./loader-2-Ck2PDBXu.js";import{H,C as T}from"./wind-BM_BhXMQ.js";import{M as $}from"./map-pin-DAeJqdM5.js";import{P as L}from"./phone-BE8kbUQY.js";import{M as W}from"./mail-UCBpIIfq.js";import{W as z}from"./wifi-CxkvpttV.js";import{C as k}from"./calendar-CbgM_XQd.js";import{C as B}from"./clock-B6QkUUPx.js";import{A as D}from"./alert-circle-BLx0a4xr.js";import{e as Q}from"./marketingPageFamilies-qGkwviUq.js";import"./logger-DDhXc0sc.js";import"./createLucideIcon-DcerbgTD.js";function o(){return e.jsxs(q,{children:[e.jsx("meta",{name:"robots",content:"noindex, nofollow"}),e.jsx("meta",{name:"googlebot",content:"noindex, nofollow"}),e.jsx("meta",{name:"bingbot",content:"noindex, nofollow"})]})}function de(){const{slug:x}=Q(),[C,h]=i.useState(!0),[j,M]=i.useState(null),[s,F]=i.useState({}),[g,I]=i.useState([]),[u,R]=i.useState([]),[N,S]=i.useState([]);if(i.useEffect(()=>{(async()=>{h(!0);const t=decodeURIComponent(x||"").trim(),{data:a,error:n}=await m.from("medical_guides").select("id,title,theme,share_slug,essentials").eq("share_slug",t).maybeSingle(),r=a||null;if(M(r),F((r==null?void 0:r.essentials)||{}),r){const{data:p}=await m.from("medical_guide_sections").select("id,kind").eq("guide_id",r.id).order("sort_order",{ascending:!0}),v=(p||[]).map(d=>d.id),{data:A}=v.length?await m.from("medical_guide_items").select("id,section_id,content,sort_order").in("section_id",v).order("sort_order",{ascending:!0}):{data:[]},b=[],f=[],_=[];(p||[]).forEach(d=>{const E=(A||[]).filter(c=>c.section_id===d.id);let l=[];d.kind==="recovery_instructions"?l=b:d.kind==="pre_procedure"?l=f:d.kind==="post_procedure"&&(l=_),E.forEach(c=>{var w,P;return l.push({title:((w=c.content)==null?void 0:w.title)||"",starred:!!((P=c.content)!=null&&P.starred)})})}),I(b),R(f),S(_)}h(!1)})()},[x]),C)return e.jsxs(e.Fragment,{children:[e.jsx(o,{}),e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsx(G,{className:"w-8 h-8 animate-spin text-teal-600"})})]});if(!j)return e.jsxs(e.Fragment,{children:[e.jsx(o,{}),e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Medical Guide Not Found"}),e.jsx("p",{className:"text-gray-600",children:"The medical guide you're looking for doesn't exist or isn't published."})]})})]});const y=s.medication_schedule||[];return e.jsxs(e.Fragment,{children:[e.jsx(o,{}),e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-teal-50 to-white",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-teal-600 rounded-full mb-4",children:e.jsx(H,{className:"w-8 h-8 text-white"})}),e.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:j.title||"Medical Recovery Guide"}),e.jsx("p",{className:"text-teal-700",children:"Structured recovery information for your stay"})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-200 p-6 mb-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Property Information"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.address&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx($,{className:"w-5 h-5 text-teal-600 mt-0.5"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-gray-900",children:"Address"}),e.jsx("div",{className:"text-gray-600 text-sm",children:s.address})]})]}),s.phone&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(L,{className:"w-5 h-5 text-teal-600 mt-0.5"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-gray-900",children:"Contact Phone"}),e.jsx("div",{className:"text-gray-600 text-sm",children:s.phone})]})]}),s.email&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(W,{className:"w-5 h-5 text-teal-600 mt-0.5"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-gray-900",children:"Contact Email"}),e.jsx("div",{className:"text-gray-600 text-sm",children:s.email})]})]}),s.wifi_ssid&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(z,{className:"w-5 h-5 text-teal-600 mt-0.5"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-gray-900",children:"Wi-Fi"}),e.jsx("div",{className:"text-gray-600 text-sm",children:s.wifi_ssid}),s.wifi_password&&e.jsxs("div",{className:"text-gray-500 text-xs mt-1",children:["Password: ",s.wifi_password]})]})]}),s.checkin&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(k,{className:"w-5 h-5 text-teal-600 mt-0.5"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-gray-900",children:"Check-in"}),e.jsx("div",{className:"text-gray-600 text-sm",children:s.checkin})]})]}),s.checkout&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(k,{className:"w-5 h-5 text-teal-600 mt-0.5"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-gray-900",children:"Check-out"}),e.jsx("div",{className:"text-gray-600 text-sm",children:s.checkout})]})]})]})]}),y.length>0&&e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-teal-200 p-6 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(B,{className:"w-6 h-6 text-teal-600"}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Medication Schedule"})]}),e.jsx("div",{className:"space-y-3",children:y.map((t,a)=>{var n;return e.jsx("div",{className:"bg-teal-50 border border-teal-200 rounded-lg p-4",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-gray-700 mb-1",children:"Time"}),e.jsx("div",{className:"text-sm font-semibold text-gray-900",children:t.time||"Not set"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-gray-700 mb-1",children:"Medication"}),e.jsx("div",{className:"text-sm text-gray-900",children:t.name||"â"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-gray-700 mb-1",children:"Dosage"}),e.jsx("div",{className:"text-sm text-gray-900",children:t.dosage||"â"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-gray-700 mb-1",children:"Frequency"}),e.jsx("div",{className:"text-sm text-gray-900 capitalize",children:((n=t.frequency)==null?void 0:n.replace("_"," "))||"â"})]}),t.notes&&e.jsxs("div",{className:"md:col-span-4",children:[e.jsx("div",{className:"text-xs font-medium text-gray-700 mb-1",children:"Notes"}),e.jsx("div",{className:"text-sm text-gray-600",children:t.notes})]})]})},a)})})]}),(s.quiet_hours||s.activity_restrictions||s.bed_rest_periods)&&e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-teal-200 p-6 mb-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Rest & Activity Guidelines"}),e.jsxs("div",{className:"space-y-4",children:[s.quiet_hours&&e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-gray-900 mb-1",children:"Qu
1iet Hours"}),e.jsx("div",{className:"text-gray-700",children:s.quiet_hours})]}),s.activity_restrictions&&e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-gray-900 mb-1",children:"Activity Restrictions"}),e.jsx("div",{className:"text-gray-700 whitespace-pre-line",children:s.activity_restrictions})]}),s.bed_rest_periods&&e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-gray-900 mb-1",children:"Bed Rest Periods"}),e.jsx("div",{className:"text-gray-700 whitespace-pre-line",children:s.bed_rest_periods})]})]})]}),s.transport_medical&&e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-teal-200 p-6 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(T,{className:"w-6 h-6 text-teal-600"}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Transport to Medical Facilities"})]}),e.jsx("div",{className:"text-gray-700 whitespace-pre-line",children:s.transport_medical}),s.medical_facility_address&&e.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-200",children:[e.jsx("div",{className:"font-medium text-gray-900 mb-1",children:"Primary Medical Facility"}),e.jsx("div",{className:"text-gray-700",children:s.medical_facility_address})]})]}),(s.emergency_contact_name||s.emergency_contact_phone)&&e.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-xl shadow-sm p-6 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(D,{className:"w-6 h-6 text-red-600"}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Emergency Contact"})]}),e.jsxs("div",{className:"space-y-2",children:[s.emergency_contact_name&&e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-gray-900",children:"Name"}),e.jsx("div",{className:"text-gray-700",children:s.emergency_contact_name})]}),s.emergency_contact_phone&&e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-gray-900",children:"Phone"}),e.jsx("a",{href:`tel:${s.emergency_contact_phone}`,className:"text-red-600 hover:underline",children:s.emergency_contact_phone})]})]})]}),s.recovery_timeline&&e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-teal-200 p-6 mb-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Recovery Timeline"}),e.jsx("div",{className:"text-gray-700 whitespace-pre-line",children:s.recovery_timeline})]}),g.length>0&&e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-teal-200 p-6 mb-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Recovery Instructions"}),e.jsx("ul",{className:"space-y-2",children:g.map((t,a)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-teal-600 mt-1",children:"â¢"}),e.jsx("span",{className:`${t.starred?"font-semibold text-gray-900":"text-gray-700"}`,children:t.title})]},a))})]}),u.length>0&&e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-teal-200 p-6 mb-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Pre-Procedure Checklist"}),e.jsx("ul",{className:"space-y-2",children:u.map((t,a)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("input",{type:"checkbox",className:"mt-1",disabled:!0}),e.jsx("span",{className:`${t.starred?"font-semibold text-gray-900":"text-gray-700"}`,children:t.title})]},a))})]}),N.length>0&&e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-teal-200 p-6 mb-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Post-Procedure Checklist"}),e.jsx("ul",{className:"space-y-2",children:N.map((t,a)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("input",{type:"checkbox",className:"mt-1",disabled:!0}),e.jsx("span",{className:`${t.starred?"font-semibold text-gray-900":"text-gray-700"}`,children:t.title})]},a))})]}),e.jsx("div",{className:"text-center text-sm text-gray-500 mt-8",children:e.jsx("p",{children:"This medical guide is provided for your recovery stay. Follow all instructions carefully."})})]})})]})}export{de as PublicMedicalGuide};
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.