1import{w as $,r as d,b as l,j as e,a9 as T,l as W,L as E,A as _,k as J,p as R,o as k,y as Y,E as S}from"./index-DShK1gGc.js";import{G as w}from"./growthSteps-CyFzS6eR.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 q=[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]],F=$("Coffee",q);function H({userEmail:o}){const[v,i]=d.useState([]);d.useEffect(()=>{o&&l.entities.GrowthProgress.filter({user_email:o}).then(i).catch(()=>{})},[o]);const m=r=>v.find(s=>s.step_slug===r),N=w.filter(r=>{var s;return(s=m(r.slug))==null?void 0:s.completed}).length,p=Math.round(N/w.length*100),u=w.find(r=>{var s;return!((s=m(r.slug))!=null&&s.completed)});return e.jsxs("div",{className:"bg-white rounded-2xl border-2 border-gray-200 p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("p",{className:"font-bold text-[#1A1A1A] text-lg",children:"Growth Track Progress"}),e.jsxs("span",{className:"text-[#E71D32] font-bold",children:[p,"%"]})]}),e.jsx("div",{className:"w-full bg-gray-100 rounded-full h-2 mb-4 overflow-hidden",children:e.jsx("div",{className:"h-full bg-[#E71D32] rounded-full transition-all duration-700",style:{width:`${p}%`}})}),e.jsx("div",{className:"flex items-center justify-between mb-5",children:w.map((r,s)=>{var g;const f=(g=m(r.slug))==null?void 0:g.completed;return e.jsxs("div",{className:"flex items-center flex-1",children:[e.jsxs("div",{className:"flex flex-col items-center flex-shrink-0",children:[e.jsx("div",{className:`w-9 h-9 rounded-full flex items-center justify-center font-bold text-sm ${f?"bg-[#E71D32] text-white":"bg-gray-100 text-gray-400 border-2 border-gray-200"}`,children:f?e.jsx(T,{className:"w-4 h-4"}):r.number}),e.jsx("p",{className:"text-[10px] text-[#1A1A1A]/50 mt-1 text-center w-16 truncate",children:r.title})]}),s<w.length-1&&e.jsx("div",{className:`flex-1 h-0.5 mx-1 -mt-4 ${f?"bg-[#E71D32]":"bg-gray-200"}`})]},r.slug)})}),u?e.jsxs("div",{className:"p-4 bg-[#F9F8F6] rounded-xl border border-gray-100 flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs font-semibold text-[#E71D32] uppercase tracking-wider mb-0.5",children:["Next Up: ",u.title]}),u.nextSession&&e.jsxs("p",{className:"text-sm text-[#1A1A1A] flex items-center gap-1.5",children:[e.jsx(W,{className:"w-3.5 h-3.5 text-[#1A1A1A]/40"})," ",u.nextSession]})]}),e.jsxs(E,{to:"/growth-track",className:"flex items-center gap-1.5 px-4 py-2 bg-[#1A1A1A] hover:bg-[#E71D32] text-white rounded-xl text-xs font-semibold transition-all flex-shrink-0",children:["View ",e.jsx(_,{className:"w-3.5 h-3.5"})]})]}):e.jsx("div",{className:"p-4 bg-green-50 border border-green-200 rounded-xl text-center",children:e.jsx("p",{className:"text-green-700 text-sm font-semibold",children:"ð You've completed the entire Growth Track!"})})]})}const C=[{name:"Max Souza",title:"Senior Pastor",available:"Sundays after service"},{name:"Bruno Costa",title:"Associate Pastor",available:"Tuesdays 2-5 PM"},{name:"Daniel Flores",title:"Youth & Spanish Pastor",available:"Wednesdays after service"}],j=[{id:"step_profile",icon:J,label:"Complete Your Profile",desc:"Add your photo, bio, and ministry interests so the community can connect with you."},{id:"step_coffee",icon:F,label:"Coffee with a Pastor",desc:"Schedule a one-on-one to hear your story and help you find your place in the community."},{id:"step_foundations",icon:R,label:"Enroll in Foundations",desc:"Our 6-week intro to the Christian faith â the perfect next step."}];function O(){const[o,v]=d.useState(null),[i,m]=d.useState(null),[N,p]=d.useState(null),[u,r]=d.useState(!0),[s,f]=d.useState({pastor:C[0].name,date:""}),[g,M]=d.useState(!1),[b,P]=d.useState(null);d.useEffect(()=>{l.auth.me().catch(()=>null).then(async t=>{var h;if(!t){r(!1);return}v(t);const n=await l.entities.NewcomerJourney.filter({user_email:t.email});if(n[0])m(n[0]),p(n[0].id);else{const y=await l.entities.NewcomerJourney.create({user_email:t.email,full_name:t.full_name||t.email,welcome_email_sent:!0});
6m(y),p(y.id),l.functions.invoke("sendMemberEmail",{subject:"Welcome to MPChurch â Your Journey Starts Here ð",body:`<div style="font-family:sans-serif;max-width:560px;background:#F9F8F6;padding:40px;border-radius:16px;"><h2 style="color:#E71D32;font-family:Georgia,serif;font-weight:300;font-size:28px;">Welcome Home, ${((h=t.full_name)==null?void 0:h.split(" ")[0])||"friend"}!</h2><p style="color:#1A1A1A;line-height:1.7;">We're so glad you're here. MPChurch is a community of real people growing in faith together â and there's a place for you.</p><p style="color:#1A1A1A;line-height:1.7;">Here are your <strong>3 next steps</strong> to get connected:</p><ol style="color:#1A1A1A;line-height:1.8;"><li>â
<strong>Complete your profile</strong> â help us get to know you</li><li>â <strong>Coffee with a Pastor</strong> â a personal welcome just for you</li><li>ð <strong>Foundations</strong> â our 6-week intro to Christian faith</li></ol><p>Head to <a href="https://mpchurch.us/newcomer" style="color:#E71D32;">mpchurch.us/newcomer</a> to get started.</p><p style="color:#999;font-size:12px;">With love â MPChurch Family</p></div>`,from_name:"MPChurch"}).catch(()=>{}),setTimeout(()=>{var a;l.functions.invoke("sendMemberEmail",{subject:"MPChurch â Have you scheduled your coffee chat yet? â",body:`<div style="font-family:sans-serif;max-width:560px;background:#F9F8F6;padding:40px;border-radius:16px;"><h2 style="color:#E71D32;font-family:Georgia,serif;font-weight:300;">Hey ${((a=t.full_name)==null?void 0:a.split(" ")[0])||"friend"}, we'd love to meet you!</h2><p style="color:#1A1A1A;line-height:1.7;">One of the best ways to get connected at MPChurch is a simple 30-minute coffee chat with one of our pastors. No agenda â just a chance to hear your story.</p><a href="https://mpchurch.us/newcomer" style="display:inline-block;background:#E71D32;color:white;padding:12px 24px;border-radius:12px;text-decoration:none;font-weight:600;margin-top:16px;">Schedule Coffee â</a><p style="color:#999;font-size:12px;margin-top:24px;">â MPChurch</p></div>`,from_name:"MPChurch"}).catch(()=>{})},500)}r(!1)})},[]);const A=async t=>{var a,c;P(t);const n={[t]:!0};t==="step_coffee"&&(n.coffee_date=s.date,n.coffee_pastor=s.pastor);const h={...i,...n};h.step_profile&&h.step_coffee&&h.step_foundations&&(n.completed=!0),await l.entities.NewcomerJourney.update(N,n),m(x=>({...x,...n})),t==="step_coffee"&&(M(!1),l.functions.invoke("sendMemberEmail",{subject:"â Coffee Meeting Requested â MPChurch",body:`<div style="font-family:sans-serif;max-width:560px;background:#F9F8F6;padding:40px;border-radius:16px;"><h2 style="color:#E71D32;font-family:Georgia,serif;font-weight:300;">You're all set!</h2><p style="color:#1A1A1A;line-height:1.7;">Your coffee meeting request has been received. <strong>${s.pastor}</strong> will be in touch to confirm your date on <strong>${s.date}</strong>.</p><p style="color:#1A1A1A;line-height:1.7;">While you wait, consider signing up for <strong>Foundations</strong> â our 6-week intro to the Christian faith.</p><a href="https://mpchurch.us/newcomer" style="display:inline-block;background:#E71D32;color:white;padding:12px 24px;border-radius:12px;text-decoration:none;font-weight:600;margin-top:16px;">View My Journey â</a></div>`,from_name:"MPChurch"}).catch(()=>{}),C.find(x=>x.name===s.pastor),l.functions.invoke("notifyChurchAdmins",{type:"coffee_meeting_request",subject:`Coffee Meeting Request â ${o.full_name||o.email}`,body:`<div style="font-family:sans-serif;padding:24px;"><h3 style="color:#E71D32;">New Coffee Meeting Request</h3><p><strong>Member:</strong> ${o.full_name||o.email} (${o.email})</p><p><strong>Requested Pastor:</strong> ${s.pastor}</p><p><strong>Preferred Date:</strong> ${s.date}</p></div>`}).catch(()=>{})),t==="step_foundations"&&((c=(a=l.entities.GrowthProgress)==null?void 0:a.create)==null||c.call(a,{user_email:o.email,step_index:0,step_id:"foundations",completed:!1}).catch(()=>{}),l.functions.invoke("sendMemberEmail",{subject:"ð You're enrolled in Foundations! â MPChurch",body:`<div style="font-family:sans-serif;max-width:560px;background:#F9F8F6;padding:40px;border-radius:16px;"><h2 style="color:#E71D32;font-family:Georgia,serif;font-weight:300;">Welcome to Foundations!</h2><p style="color:#1A1A1A;line-height:1.7;">Foundations is our 6-week journey through the essentials of the Christian faith â from knowing God to finding your purpose.</p><p style="color:#1A1A1A;line-height:1.7;">Sessions run every Sunday. We're excited to grow with you!</p><a href="https://mpchurch.us/growth-track" style="display:inline-block;background:#E71D32;color:white;padding:12px 24px;border-radius:12px;text-decoration:none;font-weight:600;margin-top:16px;">View Growth Track â</a></div>`,from_name:"MPChurch"}).catch(()=>{})),P(null)},D=i?j.filter(t=>i[t.id]).length:0,G=Math.round(D/j.length*100);return u?e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx(k,{className:"w-7 h-7 text-[#E71D32] animate-spin"})}):o?e.jsxs("div",{className:"min-h-screen bg-[#F9F8F6]",children:[e.jsx("div",{className:"bg-[#1A1A1A] px-6 md:px-16 py-16",children:e.jsxs("div",{className:"max-w-3xl mx-auto",children:[e.jsx("p",{className:"text-[#E71D32] text-xs font-semibold uppercase tracking-widest mb-3",children:"Welcome"}),e.jsx("h1",{className:"text-4xl md:text-5xl font-light text-white mb-3",style:{fontFamily:"'Cormorant Garamond', serif"},children:"Your Newcomer Journey"}),e.jsx("p",{className:"text-white/50 text-base mb-6 leading-relaxed",children:"3 simple steps to find your home at MPChurch. No rush â take it at your own pace."}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex-1 bg-white/10 rounded-full h-2",children:e.jsx("div",{className:"h-full bg-[#E71D32] rounded-full transition-all duration-700",style:{width:`${G}%`}})}),e.jsxs("span",{className:"text-white/60 text-sm flex-shrink-0",children:[D,"/",j.length," complete"]})]})]})}),e.jsxs("div",{className:"max-w-3xl mx-auto px-6 py-12 pb-20 space-y-5",children:[(i==null?void 0:i.completed)&&e.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-2xl p-5 flex items-center gap-4",children:[e.jsx(S,{className:"w-8 h-8 text-green-500 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-green-800",children:"Journey Completed! ð"}),e.jsx("p",{className:"text-green-700 text-sm",children:"You've taken every step. Welcome to the MPChurch family!"})]})]}),e.jsx(H,{userEmail:o==null?void 0:o.email}),j.map(({id:t,icon:n,label:h,desc:y})=>{const a=i==null?void 0:i[t];return e.jsx("div",{className:`bg-white rounded-2xl border-2 p-6 transition-all ${a?"border-green-200":"border-gray-200 hover:border-[#
6E71D32]/30"}`,children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:`w-12 h-12 rounded-xl flex items-center justify-center flex-shrink-0 ${a?"bg-green-100":"bg-[#E71D32]/10"}`,children:a?e.jsx(S,{className:"w-6 h-6 text-green-500"}):e.jsx(n,{className:"w-6 h-6 text-[#E71D32]"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-bold text-[#1A1A1A] text-lg",children:h}),e.jsx("p",{className:"text-[#1A1A1A]/50 text-sm leading-relaxed mt-1",children:y}),t==="step_coffee"&&!a&&g&&e.jsxs("div",{className:"mt-4 space-y-3 p-4 bg-[#F9F8F6] rounded-xl border border-gray-100",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-[#1A1A1A]/50 mb-1 block",children:"Choose a Pastor"}),e.jsx("select",{value:s.pastor,onChange:c=>f(x=>({...x,pastor:c.target.value})),className:"w-full px-4 py-2.5 rounded-xl border border-gray-200 text-sm outline-none focus:border-[#E71D32] bg-white",children:C.map(c=>e.jsxs("option",{value:c.name,children:[c.name," â ",c.available]},c.name))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-[#1A1A1A]/50 mb-1 block",children:"Preferred Date"}),e.jsx("input",{type:"date",value:s.date,onChange:c=>f(x=>({...x,date:c.target.value})),className:"w-full px-4 py-2.5 rounded-xl border border-gray-200 text-sm outline-none focus:border-[#E71D32]"})]}),e.jsx("button",{onClick:()=>A(t),disabled:!s.date||b===t,className:"flex items-center gap-2 px-5 py-2 bg-[#E71D32] text-white rounded-xl text-sm font-semibold transition-all disabled:opacity-40",children:b===t?e.jsx(k,{className:"w-4 h-4 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(F,{className:"w-4 h-4"})," Request Coffee Meeting"]})})]}),!a&&e.jsxs("div",{className:"mt-4 flex gap-2",children:[t==="step_profile"&&e.jsxs(E,{to:"/my-profile",className:"flex items-center gap-2 px-5 py-2.5 bg-[#1A1A1A] hover:bg-[#E71D32] text-white rounded-xl text-sm font-semibold transition-all",children:["Go to My Profile ",e.jsx(_,{className:"w-4 h-4"})]}),t==="step_profile"&&e.jsx("button",{onClick:()=>A(t),disabled:b===t,className:"px-5 py-2.5 border border-gray-200 text-[#1A1A1A]/60 hover:border-[#E71D32] rounded-xl text-sm transition-all",children:b===t?e.jsx(k,{className:"w-4 h-4 animate-spin"}):"Mark Complete"}),t==="step_coffee"&&!g&&e.jsxs("button",{onClick:()=>M(!0),className:"flex items-center gap-2 px-5 py-2.5 bg-[#1A1A1A] hover:bg-[#E71D32] text-white rounded-xl text-sm font-semibold transition-all",children:[e.jsx(F,{className:"w-4 h-4"})," Schedule Coffee"]}),t==="step_foundations"&&e.jsxs(E,{to:"/growth-track",className:"flex items-center gap-2 px-5 py-2.5 bg-[#1A1A1A] hover:bg-[#E71D32] text-white rounded-xl text-sm font-semibold transition-all",children:["View Growth Track ",e.jsx(_,{className:"w-4 h-4"})]}),t==="step_foundations"&&e.jsx("button",{onClick:()=>A(t),disabled:b===t,className:"px-5 py-2.5 border border-gray-200 text-[#1A1A1A]/60 hover:border-[#E71D32] rounded-xl text-sm transition-all",children:"Mark Enrolled"})]})]})]})},t)})]})]}):e.jsx("div",{className:"min-h-screen bg-[#F9F8F6] flex items-center justify-center",children:e.jsxs("div",{className:"text-center max-w-sm px-6",children:[e.jsx(Y,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-semibold text-[#1A1A1A] mb-2",children:"Sign in to start your journey"}),e.jsx("button",{onClick:()=>l.auth.redirectToLogin(window.location.href),className:"mt-4 px-6 py-2.5 bg-[#E71D32] text-white rounded-xl text-sm font-bold",children:"Get Started"})]})})}export{O 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.