1import{w as G,r as l,j as e,L as y,c as L,M as v,U as A,A as M,a4 as E,a as O,u as W,a5 as T,o as D,b as w}from"./index-DShK1gGc.js";import{J as I}from"./JoinGroupModal-Bgeyxrnb.js";/** 2 * @license lucide-react v0.475.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Y=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],B=G("Wifi",Y),R={Men:"#1A3A4A",Women:"#8B5E83",Couples:"#4A1A1A","Young Adults":"#3D2B56",Seniors:"#2D6A4F",Mixed:"#3A2B1A",Spanish:"#e71d32",Portuguese:"#2B2B4A"},N=s=>(s||"").split(",").map(o=>o.trim()).filter(Boolean);function $({group:s,onMemberAdded:o}){const[u,d]=l.useState(!1),r=R[s.category]||"#e71d32",i=s.max_members&&s.current_count>=s.max_members;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"bg-white rounded-2xl border border-[#EAE4DD] overflow-hidden hover:shadow-lg transition-all group flex flex-col",children:[e.jsxs(y,{to:`/small-groups/${s.id}`,className:"relative h-40 bg-gradient-to-br from-[#1A1A1A] to-[#2A2A2A] overflow-hidden flex-shrink-0 block",children:[s.image_url?e.jsx("img",{src:s.image_url,alt:s.name,className:"w-full h-full object-cover opacity-60 group-hover:scale-105 transition-transform duration-500"}):e.jsx("div",{className:"absolute inset-0 opacity-30",style:{background:`radial-gradient(circle at 30% 50%, ${r}, transparent 70%)`}}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"}),e.jsxs("div",{className:"absolute bottom-3 left-4 right-4 flex items-end justify-between",children:[e.jsx("span",{className:"px-2.5 py-1 text-white text-xs font-semibold rounded-full",style:{backgroundColor:r},children:s.category}),e.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${s.open_for_new_members&&!i?"bg-green-500/80 text-white":"bg-white/20 text-white/70"}`,children:i?"Full":s.open_for_new_members?"Open":"Closed"})]})]}),e.jsxs("div",{className:"p-5 flex flex-col flex-1",children:[e.jsx(y,{to:`/small-groups/${s.id}`,className:"hover:text-[#e71d32] transition-colors",children:e.jsx("h3",{className:"text-[#1A1A1A] font-semibold text-lg leading-snug mb-1",children:s.name})}),e.jsxs("p",{className:"text-[#1A1A1A]/50 text-xs mb-3",children:["Led by ",s.leader_name]}),N(s.languages).length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:N(s.languages).map(n=>e.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-semibold bg-[#e71d32]/10 text-[#e71d32] border border-[#e71d32]/20",children:n},n))}),s.description&&e.jsx("p",{className:"text-[#1A1A1A]/60 text-sm leading-relaxed mb-4 line-clamp-3 flex-1",children:s.description}),e.jsxs("div",{className:"space-y-1.5 mb-4",children:[s.meeting_day&&e.jsxs("div",{className:"flex items-center gap-2 text-[#1A1A1A]/40 text-xs",children:[e.jsx(L,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsxs("span",{children:[s.meeting_day,s.meeting_time?` · ${s.meeting_time}`:""]})]}),s.location&&e.jsxs("div",{className:"flex items-center gap-2 text-[#1A1A1A]/40 text-xs",children:[s.location_type==="Online"?e.jsx(B,{className:"w-3.5 h-3.5 flex-shrink-0"}):e.jsx(v,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{children:s.location})]}),e.jsxs("div",{className:"flex items-center gap-2 text-[#1A1A1A]/40 text-xs",children:[e.jsx(A,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsxs("span",{children:[s.current_count||0," members",s.max_members?` · ${s.max_members} max`:""]})]})]}),e.jsxs("div",{className:"flex gap-2 mt-auto",children:[e.jsxs(y,{to:`/small-groups/${s.id}`,className:"flex-1 py-2.5 rounded-xl text-sm font-semibold transition-all text-center border border-[#EAE4DD] text-[#1A1A1A]/60 hover:text-[#1A1A1A] hover:border-[#1A1A1A] flex items-center justify-center gap-1",children:["Details ",e.jsx(M,{className:"w-3.5 h-3.5"})]}),e.jsx("button",{onClick:()=>d(!0),disabled:!s.open_for_new_members||i,className:"flex-1 py-2.5 rounded-xl text-sm font-semibold transition-all disabled:opacity-40 disabled:cursor-not-allowed text-white",style:{backgroundColor:s.open_for_new_members&&!i?r:"#ccc"},children:i?"Full":s.open_for_new_members?"JOIN THIS GROUP":"Closed"})]})]})]}),u&&e.jsx(I,{group:s,onClose:()=>d(!1),onSuccess:()=>{d(!1),o==null||o()}})]})}const H=["In-Person","Online","Hybrid"];function U({groups:s,onFilterChange:o}){const[u,d]=l.useState(!1),[r,i]=l.useState({age:"",interest:"",location:""}),n={"Young Adult (18-30)":"Young Adults","Parent (Children)":"Mixed",Couples:"Couples",Men:"Men",Women:"Women","Seniors (55+)":"Seniors"},b=a=>{const h=n[a];i({...r,age:a}),o({category:h,locationFilter:r.location||"all",dayFilter:"all"})},m=a=>{i({...r,location:a}),o({category:r.age?n[r.age]:"all",locationFilter:a,dayFilter:"all"})},x=s.filter(a=>!(r.age&&n[r.age]!=="All"&&a.category!==n[r.age]||r.location&&a.location_type!==r.location));return e.jsx("div",{className:"bg-gradient-to-br from-[#F9F8F6] to-white rounded-3xl border border-gray-200 overflow-hidden",children:u?e.jsxs("div",{className:"p-8 space-y-8",children:[e.jsxs("div",{children:[e.jsx("button",{onClick:()=>d(!1),className:"text-sm text-[#1A1A1A]/40 hover:text-[#1A1A1A] mb-6 font-medium",children:"â Back"}),e.jsx("h2",{className:"text-2xl font-light text-[#1A1A1A] mb-2",style:{fontFamily:"'Cormorant Garamond', serif"},children:"Find Your Perfect Small Group"}),e.jsx("p",{className:"text-[#1A1A1A]/50 text-sm",children:"Let us help you find a group that matches your life stage, interests, and schedule."})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-[#1A1A1A] mb-3 uppercase tracking-wider",children:"What's your life stage?"}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:Object.keys(n).map(a=>e.jsxs("button",{onClick:()=>b(a),className:`px-4 py-3 rounded-xl text-xs font-medium transition-all ${r.age===a?"bg-[#1A1A1A] text-white border border-[#1A1A1A]":"bg-white border border-gray-200 text-[#1A1A1A] hover:border-[#e71d32]"}`,children:[e.jsx(A,{className:"w-3.5 h-3.5 inline mr-1.5"}),a]},a))})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-[#1A1A1A] mb-3 uppercase tracking-wider",children:"How do you prefer to meet?"}),e.jsx("div",{className:"grid grid-cols-3 gap-3",children:H.map(a=>e.jsxs("button",{onClick:()=>m(a),className:`px-4 py-3 rounded-xl text-xs font-medium transition-all ${r.location===a?"bg-[#1A1A1A] text-white border border-[#1A1A1A]":"bg-white border border-gray-200 text-[#1A1A1A] hover:border-[#e71d32]"}`,children:[e.jsx(v,{className:"w-3.5 h-3.5 inline mr-1.5"}),a]},a))})]}),x.length>0&&e.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-2xl p-4",children:[e.jsxs("p",{className:"text-sm font-semibold text-green-900",children:["â We found ",e.jsx("strong",{children:x.length})," group",x.length!==1?"s":""," that match your preferences"]}),e.jsx("p",{className:"text-xs text-green-700 mt-1",children:"Scroll down to see the recommendations"})]}),e.jsx("button",{onClick:()=>d(!1),className:"w-full px-6 py-3 bg-[#1A1A1A] hover:bg-[#e71d32] text-white rounded-xl font-semibold text-sm transition-all",children:"View Matching Groups"})]}):e.jsxs("button",{onClick:()=>d(!0),className:"w-full px-6 py-6 flex items-center justify-between hover:bg-[#F9F8F6] transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-4 text-left",children:[e.jsx("div",{className:"w-14 h-14 bg-[#e71d32]/10 rounded-2xl flex items-center justify-center flex-shrink-0",children:e.jsx(E,{className:"w-6 h-6 text-[#e71d32]"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-[#1A1A1A] text-base",children:"Find Your Perfect Group"}),e.jsx("p",{className:"text-[#1A1A1A]/50 text-xs mt-0.5",children:"Answer a few questions to get personalized recommendations"})]})]}),e.jsx(O,{className:"w-5 h-5 text-[#1A1A1A]/30 flex-shrink-0"})]})})}const J=["Men","Women","Couples","Young Adults","Seniors","Mixed","Spanish","Portuguese"],z=["In-Person","Online","Hybrid"],q=[{id:"s1",name:"Men's Tuesday Brotherhood",leader_name:"Pastor David",leader_email:"[email protected]",category:"Men",meeting_day:"Tuesday",meeting_time:"7:00 PM",location:"Room 204",location_type:"In-Person",current_count:8,max_members:12,open_for_new_members:!0,description:"A brotherhood committed to accountability, prayer, and growing as godly men. We study the Word and sharpen each other."},{id:"s2",name:"Women of Grace",leader_name:"Sarah M.",leader_email:"[email protected]",category:"Women",meeting_day:"Thursday",meeting_time:"10:00 AM",location:"Fellowship Hall",location_type:"In-Person",current_count:11,max_members:15,open_for_new_members:!0,description:"A warm community of women growing in faith together. Bible study, worship, prayer, and deep conversations."},{id:"s3",name:"Young Adults Online",leader_name:"Marcus T.",leader_email:"[email protected]",category:"Young Adults",meeting_day:"Wednesday",meeting_time:"8:00 PM",location:"Zoom",location_type:"Online",current_count:14,max_members:20,open_for_new_members:!0,description:"For young adults 18â30 navigating life with faith. Discussions are real, honest, and rooted in the Word."},{id:"s4",name:"Couples Connection",leader_name:"Robert & Ana Lima",leader_email:"[email protected]",category:"Couples",meeting_day:"Friday",meeting_time:"7:30 PM",location:"104 Maple Ave",location_type:"In-Person",current_count:6,max_members:8,open_for_new_members:!1,description:"Strengthening marriages through God's Word and community. Currently at capacity â join the waitlist."},{id:"s5",name:"Grupo en Español",leader_name:"Pastor Carlos",leader_email:"[email protected]",category:"Spanish",meeting_day:"Sunday",meeting_time:"12:30 PM",location:"Room 110",location_type:"In-Person",current_count:9,max_members:15,open_for_new_members:!0,description:"Grupo de células en español para adorar, orar y crecer juntos en la fe."}];function K(){const[s,o]=l.useState([]),[u,d]=l.useState(J),[r,i]=l.useState(!0),[n,b]=l.useState(""),[m,x]=l.useState("all"),[a,h]=l.useState("all"),[p,j]=l.useState("all"),[g,C]=l.useState("all"),S=["Português","English","Español"],F=t=>(t||"").split(",").map(c=>
6c.trim()).filter(Boolean),_=async()=>{const[t,c]=await Promise.all([w.entities.SmallGroup.filter({active:!0}),w.entities.SmallGroupCategory.filter({active:!0})]);o(t.length>0?t:q),c.length>0&&d(c.map(P=>P.name)),i(!1)};l.useEffect(()=>{_()},[]);const k=t=>{t.category&&x(t.category),t.locationFilter!==void 0&&h(t.locationFilter),t.dayFilter!==void 0&&j(t.dayFilter)},f=l.useMemo(()=>s.filter(t=>{var c;return!(m!=="all"&&t.category!==m||a!=="all"&&t.location_type!==a||p!=="all"&&t.meeting_day!==p||g!=="all"&&!F(t.languages).includes(g)||n&&!t.name.toLowerCase().includes(n.toLowerCase())&&!((c=t.description)!=null&&c.toLowerCase().includes(n.toLowerCase())))}),[s,n,m,a,p,g]);return e.jsxs("div",{className:"min-h-screen bg-white",children:[e.jsx(W,{eyebrow:"Community",title:"Small Groups",subtitle:"Life is better together. Find a group of people to do faith, friendship, and real life with.",imageUrl:"https://images.unsplash.com/photo-1529156069898-49953e39b3ac?w=1600&q=80"}),e.jsx("div",{className:"bg-white border-b border-gray-200 px-6 md:px-10 py-4 sticky top-16 z-30",children:e.jsxs("div",{className:"max-w-7xl mx-auto flex flex-col md:flex-row gap-3",children:[e.jsxs("div",{className:"relative flex-1 max-w-sm",children:[e.jsx(T,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[#1A1A1A]/30"}),e.jsx("input",{value:n,onChange:t=>b(t.target.value),placeholder:"Search groupsâ¦",className:"w-full pl-9 pr-4 py-2.5 rounded-xl border border-gray-200 text-sm outline-none focus:border-[#e71d32]"})]}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs("select",{value:m,onChange:t=>x(t.target.value),className:"px-4 py-2.5 rounded-xl border border-gray-200 text-sm outline-none focus:border-[#e71d32] bg-white",children:[e.jsx("option",{value:"all",children:"All Categories"}),u.map(t=>e.jsx("option",{value:t,children:t},t))]}),e.jsxs("select",{value:a,onChange:t=>h(t.target.value),className:"px-4 py-2.5 rounded-xl border border-gray-200 text-sm outline-none focus:border-[#e71d32] bg-white",children:[e.jsx("option",{value:"all",children:"All Locations"}),z.map(t=>e.jsx("option",{value:t,children:t},t))]}),e.jsxs("select",{value:p,onChange:t=>j(t.target.value),className:"px-4 py-2.5 rounded-xl border border-gray-200 text-sm outline-none focus:border-[#e71d32] bg-white",children:[e.jsx("option",{value:"all",children:"Any Day"}),["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"].map(t=>e.jsx("option",{children:t},t))]}),e.jsxs("select",{value:g,onChange:t=>C(t.target.value),className:"px-4 py-2.5 rounded-xl border border-gray-200 text-sm outline-none focus:border-[#e71d32] bg-white",children:[e.jsx("option",{value:"all",children:"All Languages"}),S.map(t=>e.jsx("option",{value:t,children:t},t))]})]})]})}),e.jsx("div",{className:"max-w-7xl mx-auto px-6 md:px-10 py-8",children:e.jsx(U,{groups:s,onFilterChange:k})}),e.jsx("div",{className:"max-w-7xl mx-auto md:px-10 pr-6 pb-8 pl-6 pt-3",children:r?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx(D,{className:"w-7 h-7 text-[#e71d32] animate-spin"})}):f.length===0?e.jsxs("div",{className:"text-center py-20",children:[e.jsx(A,{className:"w-10 h-10 text-[#e71d32]/30 mx-auto mb-3"}),e.jsx("p",{className:"text-[#1A1A1A]/30 text-sm",children:"No groups match your search."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-[#1A1A1A]/40 text-sm mb-6",children:[f.length," group",f.length!==1?"s":""," found"]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-
65",children:f.map(t=>e.jsx($,{group:t,onMemberAdded:_},t.id))})]})})]})}export{K 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.