1import{j as e,cv as k,co as N,O as L,s as C,bk as P}from"./vendor-ui-fc56ca80.js";import{h as A,B as y,s as G}from"./index-90016d22.js";import{u as S}from"./vendor-utils-323b9898.js";import{f as B,e as R,r as v}from"./vendor-react-f9ccc48d.js";import"./vendor-firebase-a557f106.js";import"./vendor-charts-9af8b7c0.js";function U({groups:g,persons:x,categories:i,churchName:s,churchLogo:m}){const{t:a,i18n:d}=S("smallGroups"),p=r=>{const t=x.find(h=>h.id===r);if(!t)return a("report.unknown");const n=t.firstName||t.nombres||"",c=t.lastName||t.paterno||"";return`${n} ${c}`.trim()||a("report.noName")},u=r=>{const t=x.find(n=>n.id===r);return(t==null?void 0:t.telefono)||"-"},o=r=>{var t;return r&&((t=i.find(n=>n.id===r))==null?void 0:t.name)||""},f=[...g].sort((r,t)=>r.name.localeCompare(t.name,d.language||"es",{sensitivity:"base"})),b=r=>[...r].sort((t,n)=>{const c=p(t),h=p(n);return c.localeCompare(h,d.language||"es",{sensitivity:"base"})}),j=()=>new Date().toLocaleDateString(d.language||"es",{year:"numeric",month:"long",day:"numeric"}),w=()=>new Date().toLocaleTimeString(d.language||"es",{hour:"2-digit",minute:"2-digit"});return e.jsxs("div",{className:"print-container",children:[e.jsx("style",{children:` 2 @media print { 3 @page { 4 margin: 1.5cm; 5 size: A4; 6 } 7 8 body { 9 print-color-adjust: exact; 10 -webkit-print-color-adjust: exact; 11 } 12 13 .print-container { 14 width: 100%; 15 max-width: 100%; 16 } 17 18 .no-print { 19 display: none !important; 20 } 21 22 .group-item { 23 page-break-inside: avoid; 24 margin-bottom: 1.5rem; 25 } 26 27 .header-section { 28 border-bottom: 2px solid #1f2937; 29 padding-bottom: 1rem; 30 margin-bottom: 2rem; 31 } 32 33 .footer-section { 34 margin-top: 2rem; 35 padding-top: 1rem; 36 border-top: 1px solid #e5e7eb; 37 font-size: 0.75rem; 38 color: #6b7280; 39 } 40 } 41 42 @media screen { 43 .print-container { 44 background: white; 45 padding: 2rem; 46 max-width: 210mm; 47 margin: 0 auto; 48 box-shadow: 0 0 10px rgba(0,0,0,0.1); 49 } 50 } 51 `}),e.jsxs("div",{className:"header-section mb-8 pb-4 border-b-2 border-gray-800",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[m&&e.jsx("img",{src:m,alt:"Logo",className:"h-16 w-16 object-contain"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s}),e.jsx("h2",{className:"text-lg text-gray-700",children:a("report.title")})]})]}),e.jsxs("div",{className:"flex justify-between text-sm text-gray-600",children:[e.jsxs("span",{children:[a("report.date"),": ",j()]}),e.jsxs("span",{children:[a("report.totalGroups"),": ",f.length]})]})]}),e.jsx("div",{className:"groups-list space-y-6",children:f.map((r,t)=>{const n=b(r.leaders||[]),c=b(r.members||[]),h=o(r.categoryId);return e.jsxs("div",{className:"group-item border-b border-gray-200 pb-4",children:[e.jsxs("div",{className:"mb-3",children:[e.jsxs("h3",{className:"text-lg font-bold text-gray-900 uppercase",children:[t+1,". ",r.name]}),e.jsx("div",{className:"text-sm text-gray-600 mt-1",children:h&&e.jsxs("span",{children:[a("report.category"),": ",h]})})]}),n.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(k,{className:"h-4 w-4 text-amber-600"}),e.jsxs("h4",{className:"font-semibold text-gray-800",children:[a("report.leaders"),":"]})]}),e.jsx("div",{className:"ml-6 space-y-1",children:n.map(l=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{children:"â¢"}),e.jsx("span",{className:"font-medium",children:p(l)}),e.jsx(N,{className:"h-3 w-3 text-gray-400 ml-2"}),e.jsx("span",{className:"text-gray-600",children:u(l)})]},l))})]}),c.length>0&&e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(L,{className:"h-4 w-4 text-blue-600"}),e.jsxs("h4",{className:"font-semibold text-gray-800",children:[a("report.members")," (",c.length,"):"]})]}),e.jsx("div",{className:"ml-6 space-y-1",children:c.map(l=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{children:"â¢"}),e.jsx("span",{children:p(l)}),e.jsx(N,{className:"h-3 w-3 text-gray-400 ml-2"}),e.jsx("span",{className:"text-gray-600",children:u(l)})]},l))})]})]},r.id)})}),e.jsx("div",{className:"footer-section mt-8 pt-4 border-t border-gray-300 text-xs text-gray-500 text-center",children:e.jsx("p",{children:a("report.generatedAt",{date:j(),time:w()})})})]})}function $(){const g=B(),x=R(),{userData:i}=A(),s=g.state,[m,a]=v.useState(s==null?void 0:s.churchLogo);if(v.useEffect(()=>{(async()=>
51{if(!m&&i!=null&&i.churchId)try{const o=await G.getChurchById(i.churchId);o!=null&&o.logoUrl&&a(o.logoUrl)}catch(o){console.error("Error fetching church logo:",o)}})()},[i==null?void 0:i.churchId,m]),!s||!s.groups)return x("/app/grupos"),null;const d=()=>{window.print()},p=()=>{x("/app/grupos")};return e.jsxs("div",{className:"min-h-screen bg-gray-50 print:bg-white pt-16",children:[e.jsx("div",{className:"no-print bg-white border-b fixed top-0 left-0 right-0 z-[100] shadow-md h-16 flex items-center",children:e.jsx("div",{className:"w-full px-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(y,{variant:"ghost",onClick:p,className:"gap-2",children:[e.jsx(C,{className:"h-4 w-4"}),"Volver"]}),e.jsxs(y,{onClick:d,className:"gap-2",children:[e.jsx(P,{className:"h-4 w-4"}),"Imprimir / Guardar PDF"]})]})})}),e.jsx("div",{className:"container mx-auto py-8 print:p-0 print:max-w-none print:w-full",children:e.jsx(U,{groups:s.groups,persons:s.persons,types:s.types,categories:s.categories,churchName:s.churchName,churchLogo:m})}),e.jsx("style",{children:` 52 @media print { 53 /* Hide non-printable elements */ 54 .no-print, nav, aside, header { 55 display: none !important; 56 } 57 58 /* Reset all layout containers to allow full content flow */ 59 body, html, #root { 60 height: 100% !important; 61 margin: 0 !important; 62 overflow: visible !important; 63 } 64 65 /* Target the specific layout wrappers from AdminLayout */ 66 div[class*="h-screen"], 67 div[class*="overflow-hidden"], 68 main { 69 height: auto !important; 70 overflow: visible !important; 71 display: block !important; 72 position: relative !important; 73 flex: none !important; 74 margin: 0 !important; 75 padding: 0 !important; 76 } 77 78 /* Specific fix for the main scrollable area */ 79 main { 80 overflow-y: visible !important; 81 overflow-x: visible !important; 82 height: auto !important; 83 max-height: none !important; 84 } 85 86 /* Reset report page specific styles */ 87 .min-h-screen { 88 min-height: 0 !important; 89 padding-top: 0 !important; 90 } 91 92 .container { 93 max-width: 100% !important; 94 width: 100% !important; 95 margin: 0 !important; 96 padding: 20px !important; 97 } 98 99 /* Force background colors for readability */ 100 * { 101 -webkit-print-color-adjust: exact !important; 102 print-color-adjust: exact !important; 103 } 104 } 105 `})]})}export{$ 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.