{"version":3,"file":"Auth_forms.Baai09Vs.mjs","names":["React.useState","e"],"sources":["https:/framerusercontent.com/modules/YGW5AIW7o3FlZIzz9uiD/OX4PFB30IgFS2r7CVcVt/Auth_forms.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";/** 👇 Paste your API endpoint from the CDK output (ApiEndpoint) */const API_BASE=\"https://f874xigp0l.execute-api.us-east-2.amazonaws.com\";const box={maxWidth:420,margin:\"40px auto\",fontFamily:\"Inter, system-ui, Segoe UI, Arial, sans-serif\"};const input={width:\"100%\",padding:12,borderRadius:8,border:\"1px solid #d0d5dd\",margin:\"8px 0\"};const btn={padding:\"12px 16px\",borderRadius:10,background:\"#0f172a\",color:\"#fff\",width:\"100%\",border:\"none\",cursor:\"pointer\",fontWeight:600};const note={fontSize:14,color:\"#475467\",marginTop:8};function isStrong(pw){return pw.length>=8&&/[A-Za-z]/.test(pw)&&/\\d/.test(pw);}/** Drop this on /forgot-password */export function ForgotPasswordForm(){const[churchId,setChurchId]=React.useState(\"\");const[email,setEmail]=React.useState(\"\");const[busy,setBusy]=React.useState(false);const[msg,setMsg]=React.useState(null);const[err,setErr]=React.useState(null);async function submit(e){e.preventDefault();setErr(null);setMsg(null);if(!churchId.trim()||!email.trim()){setErr(\"Please enter your Church ID and Admin Email.\");return;}setBusy(true);try{const r=await fetch(`${API_BASE}/auth/forgot-password`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({churchId:churchId.trim().toLowerCase(),adminEmail:email.trim().toLowerCase()})});// Endpoint always returns { sent: true } without leaking account existence\nif(!r.ok)throw new Error(\"Request failed\");setMsg(\"If that account exists, we’ve sent a reset link. Please check your email.\");}catch{setErr(\"Something went wrong. Please try again.\");}finally{setBusy(false);}}return /*#__PURE__*/_jsxs(\"form\",{style:box,onSubmit:submit,children:[/*#__PURE__*/_jsx(\"p\",{style:note,children:\"Enter the Church ID and admin email used for your account.\"}),/*#__PURE__*/_jsx(\"input\",{style:input,placeholder:\"Church ID (e.g. fpcanderson)\",value:churchId,onChange:e=>setChurchId(e.target.value)}),/*#__PURE__*/_jsx(\"input\",{style:input,type:\"email\",placeholder:\"Admin email\",value:email,onChange:e=>setEmail(e.target.value)}),/*#__PURE__*/_jsx(\"button\",{style:btn,disabled:busy,type:\"submit\",children:busy?\"Sending…\":\"Send reset link\"}),msg&&/*#__PURE__*/_jsx(\"p\",{style:{...note,color:\"#16a34a\"},children:msg}),err&&/*#__PURE__*/_jsx(\"p\",{style:{...note,color:\"#dc2626\"},children:err})]});}/** Drop this on /reset-password (email links go here with ?token=...) */export function ResetPasswordForm(){const params=new URLSearchParams(typeof window!==\"undefined\"?window.location.search:\"\");const token=params.get(\"token\")||\"\";const[pw1,setPw1]=React.useState(\"\");const[pw2,setPw2]=React.useState(\"\");const[busy,setBusy]=React.useState(false);const[msg,setMsg]=React.useState(null);const[err,setErr]=React.useState(null);async function submit(e){e.preventDefault();setErr(null);setMsg(null);if(!token){setErr(\"Missing or invalid reset link.\");return;}if(pw1!==pw2){setErr(\"Passwords don’t match.\");return;}if(!isStrong(pw1)){setErr(\"Password must be at least 8 characters and include a letter and a number.\");return;}setBusy(true);try{const r=await fetch(`${API_BASE}/auth/reset-password`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({token,newPassword:pw1})});const j=await r.json().catch(()=>({}));if(!r.ok)throw new Error(j?.error||\"Reset failed\");setMsg(\"Password updated. You can now log in.\");}catch(e){setErr(e?.message||\"Something went wrong. Please try again.\");}finally{setBusy(false);}}return /*#__PURE__*/_jsxs(\"form\",{style:box,onSubmit:submit,children:[!token&&/*#__PURE__*/_jsx(\"p\",{style:{...note,color:\"#dc2626\"},children:\"Missing or invalid reset link.\"}),/*#__PURE__*/_jsx(\"input\",{style:input,type:\"password\",placeholder:\"New password\",value:pw1,onChange:e=>setPw1(e.target.value)}),/*#__PURE__*/_jsx(\"input\",{style:input,type:\"password\",placeholder:\"Confirm new password\",value:pw2,onChange:e=>setPw2(e.target.value)}),/*#__PURE__*/_jsx(\"button\",{style:btn,disabled:busy||!token,type:\"submit\",children:busy?\"Updating…\":\"Set password\"}),msg&&/*#__PURE__*/_jsx(\"p\",{style:{...note,color:\"#16a34a\"},children:msg}),err&&/*#__PURE__*/_jsx(\"p\",{style:{...note,color:\"#dc2626\"},children:err})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"ForgotPasswordForm\":{\"type\":\"reactComponent\",\"name\":\"ForgotPasswordForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"ResetPasswordForm\":{\"type\":\"reactComponent\",\"name\":\"ResetPasswordForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Auth_forms.map"],"mappings":"0MAAwmB,SAAS,EAAS,EAAG,CAAC,OAAO,EAAG,QAAQ,GAAG,WAAW,KAAK,EAAG,EAAE,KAAK,KAAK,EAAG,CAAsC,SAAgB,GAAoB,CAAC,GAAK,CAAC,EAAS,GAAaA,EAAe,GAAG,CAAM,CAAC,EAAM,GAAUA,EAAe,GAAG,CAAM,CAAC,EAAK,GAASA,EAAe,GAAM,CAAM,CAAC,EAAI,GAAQA,EAAe,KAAK,CAAM,CAAC,EAAI,GAAQA,EAAe,KAAK,CAAC,eAAe,EAAO,EAAE,CAA8C,GAA7C,EAAE,gBAAgB,CAAC,EAAO,KAAK,CAAC,EAAO,KAAK,CAAI,CAAC,EAAS,MAAM,EAAE,CAAC,EAAM,MAAM,CAAC,CAAC,EAAO,+CAA+C,CAAC,OAAQ,EAAQ,GAAK,CAAC,GAAG,CAC1oC,GAAG,EADgpC,MAAM,MAAM,GAAG,EAAS,uBAAuB,CAAC,OAAO,OAAO,QAAQ,CAAC,eAAe,mBAAmB,CAAC,KAAK,KAAK,UAAU,CAAC,SAAS,EAAS,MAAM,CAAC,aAAa,CAAC,WAAW,EAAM,MAAM,CAAC,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