1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[894],{89894:function(e,s,a){a.d(s,{Z:function(){return eh}});var r=a(85893),l=a(67294),n=a(11163),t=a.n(n),i=a(11215),o=a(22793),d=a(93259),c=a(30238);function u(e,s){var a;let r=null===(a=e.query)||void 0===a?void 0:a[s];return Array.isArray(r)?r[0]:r}var m=a(89678),h=a(81862),p=a(11752),g=a.n(p),x=a(34051),f=a(31555),v=a(88375);let{publicRuntimeConfig:y}=g()(),{FORMED_APP_ORIGIN:b}=y;var j=e=>(0,r.jsxs)(r.Fragment,{children:[!e.alreadySubscribed&&(0,r.jsx)(x.Z,{id:"heading-row",className:"plan congratulations",children:(0,r.jsx)(f.Z,{children:(0,r.jsx)("h1",{children:"Congratulations!"})})}),(0,r.jsxs)("div",{id:"confirmation-page",className:"text-center",children:[e.orderNumber&&(0,r.jsx)(x.Z,{id:"order-number-row",children:(0,r.jsx)(f.Z,{children:(0,r.jsx)("div",{children:"ORDER NUMBER HERE"})})}),e.inviteError&&(0,r.jsx)(x.Z,{id:"invite-error-row",children:(0,r.jsx)(f.Z,{children:(0,r.jsxs)(v.Z,{variant:"warning",className:"text-left",children:[(0,r.jsxs)("p",{className:"mb-2",children:["Weâre sorry â ",e.inviteError.message]}),(0,r.jsx)("p",{className:"mb-0",children:(0,r.jsx)("a",{href:e.inviteError.url,target:"_blank",rel:"noreferrer",children:e.inviteError.url})})]})})}),!e.alreadySubscribed&&(0,r.jsx)(x.Z,{id:"mail-image-row",className:e.groupConfirmation?"group-confirmation":"",children:(0,r.jsx)(f.Z,{children:(0,r.jsx)("img",{src:"/static/images/icons/secret-key.svg"})})}),!e.alreadySubscribed&&e.groupConfirmation&&(0,r.jsx)(x.Z,{className:"mt-5 mb-3",children:(0,r.jsx)(f.Z,{children:(0,r.jsx)("h2",{style:{fontWeight:"bold"},children:"You have successfully registered your parish for Formed!"})})}),(0,r.jsx)(x.Z,{id:"check-your-mail-row",children:(0,r.jsx)(f.Z,{children:(0,r.jsx)("h1",{children:(0,r.jsx)("span",{children:e.alreadySubscribed?(0,r.jsx)(r.Fragment,{children:"It looks like your parish already has access to Formed."}):e.groupConfirmation?(0,r.jsxs)(r.Fragment,{children:["We just sent you an email",(0,r.jsx)("br",{}),"with tips on how to get started."]}):(0,r.jsxs)(r.Fragment,{children:["Check your inbox",(0,r.jsx)("br",{}),"for a Sign In link"]})})})})}),(0,r.jsx)(x.Z,{id:"email-info-row",children:(0,r.jsxs)(f.Z,{xs:12,children:[(0,r.jsx)("div",{children:e.alreadySubscribed?(0,r.jsxs)("div",{children:[(0,r.jsxs)("h3",{children:["Click ",(0,r.jsx)("a",{href:"/admin",children:"here"})," to access the admin website"]}),(0,r.jsxs)("p",{className:"mt-5 text-muted",style:{fontSize:"1rem"},children:["Not sure why your parish already has Formed? Contact us at ",(0,r.jsx)("a",{href:"mailto:[email protected]",children:"[email protected]"})]})]}):e.groupConfirmation?(0,r.jsx)("div",{className:"mt-4",children:(0,r.jsx)("a",{href:"".concat(b,"/login"),className:"btn btn-primary",style:{padding:"10px 40px",fontSize:"1.2rem"},children:"Start Watching Formed"})}):(0,r.jsxs)(r.Fragment,{children:["We just emailed a confirmation link to",(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"user-email",children:e.signupEmail}),". Click the button to",(0,r.jsx)("br",{}),"automatically Sign In."]})}),!e.alreadySubscribed&&!e.groupConfirmation&&(0,r.jsxs)("div",{children:["Or click ",(0,r.jsx)("a",{href:"/admin",children:"here"})," to access the admin website"]})]})})]})]}),C=a(35005),N=a(31328),A=a(62318),Z=a(94716),k=a(12960),S=a(67814),w=a(82175),F=a(37169),B=a(18610),R=a(97275),P=a(70896);let V=["Administrative Assistant/Secretary","Administrator","Adult Faith Formation/RCIA","Associate Pastor","Bible Study/Small Group Leader","Bishop","Bulletin Editor","Campus Minister","Chaplain","Communications","Confirmation Leader","Curriculum Coordinator","Deacon","Diocese Staff","Director of Evangelization","Director of Religious Education","IT/Data/Technology/Webmaster","Office/Business Manager","Parent","Parish/Finance Council","Parishioner","Pastor","Pastoral Associate","Principal","Religious/Sister","Superintendent","Teacher/Catechist","Volunteer","Youth Ministry","Other"];var E=e=>{let{disabled:s,values:a,errors:l,touched:n,handleChange:t,handleBlur:i,insideSales:o}=e;return(0,r.jsxs)(N.Z.Group,{children:[(0,r.jsxs)("div",{className:"form-label",children:[o?"The User's Roles in the Parish":"Your Roles in the Parish",(0,r.jsx)("span",{children:"*"})]}),(0,r.jsx)(A.Z,{className:(0,w.u9)(l,"user.parishRole")&&(0,w.u9)(n,"user.parishRole")?"error":"",children:(0,r.jsx)(N.Z.Control,{as:"select",id:"parish-role",name:"user.parishRole",value:a.user.parishRole||[],onChange:t,onBlur:i,disabled:s,multiple:!0,children:V.map(e=>(0,r.jsx)("option",{value:e,children:e},e))})}),(0,w.u9)(l,"user.parishRole")&&(0,w.u9)(n,"user.parishRole")?(0,r.jsx)("div",{className:"error-message",children:(0,w.u9)(l,"user.parishRole")}):null]})};a(90090);let _=/Household - [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,I={user:{name:"",email:"",parishRole:""},otherContact:{name:"",email:""},phone:"+1",orgName:"",orgAddress:"",familyCount:"",confirmAccuracy:!1,usingManualAddress:!1,type:""},T=e=>{let{handleChange:s,handleBlur:a,values:l,errors:n,touched:t,readOnly:o}=e,d=(0,i.aC)();return(0,r.jsxs)(r.Fragment,{children:[o&&(0,r.jsxs)("div",{className:"mb-3 p-3 border rounded bg-light",children:[(0,r.jsxs)("p",{className:"mb-1 text-muted small",children:["Signed in as ",(0,r.jsx)("strong",{children:l.user.email}),".",(0,r.jsx)("br",{}),"You will become an administrator of your parish under this account. If this is the wrong account, please log out and sign in with the correct one."]}),(0,r.jsx)(C.Z,{variant:"outline-secondary",size:"sm",onClick:()=>d.signoutRedirect({post_logout_redirect_uri:window.location.href}),children:"Log out"})]}),(0,r.jsxs)("div",{className:"form-label",children:[o?"Your Full Name":"Full Name",(0,r.jsx)("span",{children:"*"})]}),(0,r.jsxs)(N.Z.Group,{children:[(0,r.jsxs)(A.Z,{className:(0,w.u9)(n,"user.name")&&(0,w.u9)(t,"user.name")?"error":"",children:[(0,r.jsx)(Z.Z,{id:"full-name",className:"append",type:"text",name:"user.n
1ame",value:l.user.name,onChange:s,onBlur:a,placeholder:"Full Name",readOnly:o}),(0,r.jsx)(A.Z.Append,{children:(0,r.jsx)(A.Z.Text,{children:(0,r.jsx)("img",{src:"/static/images/icons/profile.svg"})})})]}),(0,w.u9)(n,"user.name")&&(0,w.u9)(t,"user.name")?(0,r.jsx)("div",{className:"error-message",children:(0,w.u9)(n,"user.name")}):null]}),(0,r.jsxs)("div",{className:"form-label",children:[o?"Your Email Address":"Email Address",(0,r.jsx)("span",{children:"*"})]}),(0,r.jsxs)(N.Z.Group,{children:[(0,r.jsxs)(A.Z,{className:(0,w.u9)(n,"user.email")&&(0,w.u9)(t,"user.email")?"error":"",children:[(0,r.jsx)(N.Z.Control,{id:"email",className:"append",type:"email",name:"user.email",value:l.user.email,onChange:s,onBlur:a,placeholder:"Email",readOnly:o}),(0,r.jsx)(A.Z.Append,{children:(0,r.jsx)(A.Z.Text,{children:(0,r.jsx)("img",{src:"/static/images/icons/envelope.svg"})})})]}),(0,w.u9)(n,"user.email")&&(0,w.u9)(t,"user.email")?(0,r.jsx)("div",{className:"error-message",children:(0,w.u9)(n,"user.email")}):null]})]})},O=e=>{let{values:s,errors:a,touched:l,setFieldTouched:n,setFieldValue:t}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"form-label",children:["Parish Main Telephone Number",(0,r.jsx)("span",{children:"*"})]}),(0,r.jsxs)(N.Z.Group,{children:[(0,r.jsxs)(A.Z,{className:(0,w.u9)(a,"phone")&&(0,w.u9)(l,"phone")?"error":"",children:[(0,r.jsx)(R.ZP,{id:"phone",placeholder:"Enter phone number",country:"US",className:"form-control append",name:"phone",value:s.phone,onBlur:()=>n("phone",!0),onChange:e=>t("phone",e)}),(0,r.jsx)(A.Z.Append,{children:(0,r.jsx)(A.Z.Text,{children:(0,r.jsx)("img",{src:"/static/images/icons/phone.svg"})})})]}),(0,w.u9)(a,"phone")&&(0,w.u9)(l,"phone")?(0,r.jsx)("div",{className:"error-message text-center",children:(0,w.u9)(a,"phone")}):null]})]})},G=[{value:"admin",label:"I'm the Primary Formed Admin"},{value:"billing",label:"I'm the Billing Contact"},{value:"both",label:"I'm both the Primary Formed Admin and the Billing Contact"},{value:"none",label:"None of these roles describe me"}],U=[{value:"admin",label:"This user is the Primary Formed Admin for this parish"},{value:"billing",label:"This user is the Billing Contact for this parish"},{value:"both",label:"This user is both the Primary Formed Admin and the Billing Contact for this parish"}],L={admin:"Billing Contact",billing:"Primary Formed Admin"},D={admin:"Primary Formed Admin",billing:"Billing Contact"},q=e=>{let{values:s,errors:a,touched:l,handleChange:n,handleBlur:t,insideSales:i}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"form-label",children:[i?"Please select the option below that best describes this userâs relation to Formed at their parish:":"Please select the option below that best describes your relation to Formed at your parish.",(0,r.jsx)("span",{children:"*"})]}),(0,r.jsx)("p",{className:"text-muted small",children:"The Primary Formed Admin owns the account and receives all notifications, including billing and account alerts. The Billing Contact only receives billing-related notifications."}),(0,r.jsxs)(N.Z.Group,{children:[(i?U:G).map(e=>{let{value:a,label:l}=e;return(0,r.jsx)(N.Z.Check,{type:"radio",id:"contact-role-".concat(a),name:"contactRole",label:l,value:a,checked:s.contactRole===a,onChange:n,onBlur:t},a)}),(0,w.u9)(a,"contactRole")&&(0,w.u9)(l,"contactRole")?(0,r.jsx)("div",{className:"error-message",children:(0,w.u9)(a,"contactRole")}):null]}),!i&&"none"===s.contactRole&&(0,r.jsx)(v.Z,{variant:"danger",className:"small mt-2 mb-3",children:"You must be either the Primary Formed Admin or the Billing Contact at your parish to proceed."}),("admin"===s.contactRole||"billing"===s.contactRole)&&(0,r.jsxs)("div",{className:"mb-3 p-3 border rounded bg-light",children:[(0,r.jsxs)("p",{className:"mb-2 text-success",children:[(0,r.jsx)(S.G,{icon:"check-circle",className:"mr-2"}),i?(0,r.jsxs)(r.Fragment,{children:["Great! This user is the ",D[s.contactRole],". Please provide their colleagueâs contact information below."]}):(0,r.jsxs)(r.Fragment,{children:["Great! Youâre the ",D[s.contactRole],". Please provide your colleagueâs contact information below."]})]}),(0,r.jsxs)("p",{className:"text-muted small mb-2",children:["Who is the ",L[s.c
1ontactRole],i?" for this parish":"","? Weâll send them a secure link to confirm their role.","billing"===s.contactRole&&(i?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("br",{}),"Until they accept, this user will temporarily also receive account notifications in addition to their billing notifications."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("br",{}),"Until they accept, youâll temporarily also receive account notifications in addition to your billing notifications."]}))]}),(0,r.jsxs)("div",{className:"form-label",children:[L[s.contactRole]," Full Name",(0,r.jsx)("span",{children:"*"})]}),(0,r.jsxs)(N.Z.Group,{children:[(0,r.jsx)(Z.Z,{id:"other-contact-name",type:"text",name:"otherContact.name",value:s.otherContact.name,onChange:n,onBlur:t,placeholder:"Full Name"}),(0,w.u9)(a,"otherContact.name")&&(0,w.u9)(l,"otherContact.name")?(0,r.jsx)("div",{className:"error-message",children:(0,w.u9)(a,"otherContact.name")}):null]}),(0,r.jsxs)("div",{className:"form-label",children:[L[s.contactRole]," Email Address",(0,r.jsx)("span",{children:"*"})]}),(0,r.jsxs)(N.Z.Group,{children:[(0,r.jsx)(Z.Z,{id:"other-contact-email",type:"email",name:"otherContact.email",value:s.otherContact.email,onChange:n,onBlur:t,placeholder:"Email"}),(0,w.u9)(a,"otherContact.email")&&(0,w.u9)(l,"otherContact.email")?(0,r.jsx)("div",{className:"error-message",children:(0,w.u9)(a,"otherContact.email")}):null]})]})]})},M=e=>{let{errors:s,onGroupSelect:a,values:l,groupTouched:n,setFieldValue:t,insideSales:i}=e;return(0,r.jsxs)("div",{id:"group-search-row",children:[(0,r.jsx)("label",{className:"form-label",children:i?"Find The Parish or Organization":"Find Your Parish"}),(0,r.jsxs)(N.Z.Group,{children:[(0,r.jsx)(P.Z,{onGroupSelect:a,onInputValueChange:e=>{e&&t("orgName",e)},formValues:l,initialValue:l.group||"",errors:s,groupTouched:n,searchParams:{netsuiteId:"1"},renderNotFoundItem:()=>(0,r.jsx)(H,{})}),s.selectedGroup||n?(0,r.jsx)("div",{className:"error-message",children:"Could not subscribe with this parish"}):null]})]})},z=e=>{let{existingGroups:s,initialResolvedGroup:a,onGroupResolved:n,onResolveBlocked:t,onSearchInstead:i}=e,d=(null==a?void 0:a.path)||1===s.length&&s[0]||"",[c,u]=(0,l.useState)(d),[m,h]=(0,l.useState)(!1),[p,g]=(0,l.useState)(!1),[x,f]=(0,l.useState)(!1);async function y(e){n(void 0),h(!0),g(!1),f(!1);try{var s;let a=await o.x.get("/search/groups",{params:{path:e,netsuiteId:"1"}}),r=((null===(s=a.data)||void 0===s?void 0:s.results)||[]).find(s=>s.path===e);r?n(r):f(!0)}catch(s){console.warn("Error resolving group: ".concat(e),s),g(!0)}finally{h(!1)}}return(0,l.useEffect)(()=>{t&&t(x)},[x,t]),(0,l.useEffect)(()=>{d&&(a&&a.path===d?n(a):y(d))},[]),(0,l.useEffect)(()=>{a&&(u(a.path),n(a))},[null==a?void 0:a.path]),(0,r.jsxs)("div",{id:"existing-groups-row",children:[(0,r.jsx)("label",{className:"form-label",children:"Your Parish"}),(0,r.jsxs)(N.Z.Group,{children:[(0,r.jsxs)(N.Z.Control,{as:"select",value:c,onChange:e=>{let s=e.target.value;if("__search__"===s){i();return}u(s),s&&y(s)},disabled:m,children:[s.length>1&&(0,r.jsx)("option",{value:"",disabled:!0,children:"Select your parish..."}),s.map(e=>(0,r.jsx)("option",{value:e,children:e.split("/").filter(Boolean).pop()||e},e)),(0,r.jsx)("option",{value:"__search__",children:"Subscribe a different parish..."})]}),m&&(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(k.Z,{color:"#1c8eec",size:8,margin:"2px"})}),p&&(0,r.jsxs)("div",{className:"error-message mt-1",children:["Could not find this parish. Please"," ",(0,r.jsx)("a",{className:"btn btn-link p-0",style:{verticalAlign:"baseline"},onClick:i,children:"search for it instead"}),"."]}),x&&(0,r.jsxs)(v.Z,{variant:"danger",className:"small mt-2 mb-3",children:["It looks like your organization is not a parish. Please contact us at"," ",(0,r.jsx)(v.Z.Link,{href:"mailto:[email protected]",children:"[email protected]"})," and we'll get you set up."]})]})]})},Y=e=>{let{values:s,errors:a,touched:l,handleChange:n,handleBlur:t,setFieldValue:i,insideSales:o}=e;return(0,r.jsxs)(N.Z.Group,{className:"family-count",children:[(0,r.jsxs)("div",{className:"form-label",children:[o?"Number of Registered Households The Parish Serves (not expected number of Formed users)":"Number of Registered Households Your Parish Serves (not expected number of Formed users)"," ",(0,r.jsx)("span",{children:"*"})]}),(0,r.jsx)(A.Z,{className:a.familyCount&&l.familyCount?"error":"",children:(0,r.jsx)(N.Z.Control,{id:"family-count",type:"number",min:1,step:1,name:"familyCount",value:s.familyCount||"",onChange:n,onBlur:t,placeholder:"E.g. 500"})}),a.familyCount&&l.familyCount?(0,r.jsx)("div",{className:"error-message",children:a.familyCount}):null,(0,r.jsxs)("div",{className:"text-muted small mt-2",children:[(0,r.jsx)("div",{className:"mt-1",children:"Need help finding it?"}),(0,r.jsx)("div",{children:"Look in your parish database under Registered Households, your annual report to the diocese, or your diocesan directory listing."})]}),(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsx)(N.Z.Check,{id:"confirm-accuracy",type:"checkbox",name:"confirmAccuracy",label:"I confirm this count is accurate to the best of my knowledge, and I will notify Customer Support if I later discover a different number.",className:"confirm-accuracy",onChange:()=>i("confirmAccuracy",!s.confirmAccuracy),onBlur:t,checked:s.confirmAccuracy}),a.confirmAccuracy&&l.confirmAccuracy?(0,r.jsx)("div",{className:"error-message",children:a.confirmAccuracy}):null]})]})};function W(e){var s,a;if(!e)return{blocked:!1,reason:null};if(e.groupType&&"parish"!==e.groupType.toLowerCase())return{blocked:!0,reason:"type"};let r=null===(a=e.address)||void 0===a?void 0:null===(s=a.country)||void 0===s?void 0:s.toUpperCase();return r&&B.r.has(r)?{blocked:!0,reason:"gdpr"}:{blocked:!1,reason:null}}let H=()=>(0,r.jsx)("a",{href:"mailto:[email protected]",className:"dropdown-item free-trial-item text-muted small",style:{textDecoration:"none"},onMouseDown:e=>e.preventDefault(),children:"Canât find your parish? Contact us at [email protected]."});var $=e=>{let{onSubmit:s,updateGooglePlace:a,initialFormValues:n,readOnlyUserFields:t,existingGroups:i,insideSales:o}=e,d=null==n?void 0:n.group,c=(0,l.useMemo)(()=>{let e=o?[]:(null==i?void 0:i.filter(e=>!_.test(e)))||[];return(null==d?void 0:d.path)&&!e.includes(d.path)?[d.path,...e]:e},[o,i,null==d?void 0:d.path]),[u,m]=(0,l.useState)(!1),[h,p]=(0,l.useState)(!1),g=c.length>0;return(0,r.jsx)(w.J9,{validationSchema:F.x_,initialValues:{...I,...n},onSubmit:s,enableReinitialize:!0,children:e=>{let{isValid:s,dirty:l,values:n,errors:i,touched:d,handleSubmit:y,isSubmitting:b,...j}=e;return(0,r.jsxs)(N.Z,{onSubmit:y,className:"group-info-form",children:[(0,r.jsx)(x.Z,{id:"heading-row",children:(0,r.jsx)(f.Z,{children:(0,r.jsx)("h1",{children:o?"Set Up a Parish or Organization":"Sign Up Your Parish"})})}),(0,r.jsx)(T,{...j,values:n,errors:i,touched:d,updateGooglePlace:a,readOnly:t}),(0,r.jsx)(E,{...j,values:n,errors:i,touched:d,handleChange:j.handleChange,handleBlur:j.handleBlur,disabled:b,insideSales:o}),(0,r.jsx)(q,{...j,values:n,errors:i,touched:d,handleChange:j.handleChange,handleBlur:j.handleBlur,insideSales:o}),g&&!u?(0,r.jsx)(z,{existingGroups:c,initialResolvedGroup:n.group,onGroupResolved:e=>{p(!1),e?(j.setValues(s=>({...s,group:e,orgName:e.name,usingManualAddress:!0,address:e.address,familyCount:"",confirmAccuracy:!1})),j.setFieldTouched("familyCount",!1),j.setFieldTouched("confirmAccuracy",!1)):j.setValues(e=>({...e,group:void 0,usingManualAddress:!1}))},onResolveBlocked:p,onSearchInstead:()=>{p(!1),m(!0),j.setValues(e=>({...e,group:void 0,usingManualAddress:!1}))}}):(0,r.jsxs)(r.Fragment,{children:[g&&(0,r.jsx)("div",{className:"mb-2",children:(0,r.jsxs)("a",{className:"btn btn-link btn-sm pl-0",onClick:()=>{m(!1)},children:["â Back to ",o?"selected parish":"your parishes"]})}),(0,r.jsx)(M,{...j,values:n,errors:i,touched:d,insideSales:o,selectedGroup:n.group,onGroupSelect:e=>{e&&(j.setValues(s=>({...s,group:e,orgName:e.name,usingManualAddress:!0,address:e.address,familyCount:"",confirmAccuracy:!1})),j.setFieldTouched("familyCount",!1),j.setFieldTouched("confirmAccuracy",!1))},groupTouched:(0,w.u9)(d,"selectedGroup")})]}),(()=>{if(h&&!o)return null;let{blocked:e,reason:s}=W(n.group);return e&&!o?(0,r.jsxs)(v.Z,{variant:"danger",className:"small mt-2 mb-3",children:["type"===s?"Only parishes can sign up for Formed through our website at this time.":"Only parishes in the United States can sign up for Formed through our website at this time."," Please contact us at ",(0,r.jsx)(v.Z.Link,{href:"mailto:[email protected]",children:"[email protected]"})," to register."]}):(0,r.jsxs)(v.Z,{variant:"warning",className:"small mt-2 mb-4",children:["Subscribing for a school or diocese? Please contact us at"," ",(0,r.jsx)(v.Z.Link,{href:"mailto:[email protected]",children:"[email protected]"})," ","and we'll get you set up."]})})(),(0,r.jsx)(O,{...j,values:n,errors:i,touched:d,setFieldTouched:j.setFieldTouched,setFieldValue:j.setFieldValue}),(0,r.jsx)(Y,{...j,values:n,errors:i,touched:d,setFieldValue:j.setFieldValue,insideSales:o}),(0,r.jsxs)(C.Z,{id:"group-create-submit",type:"submit",disabled:!s||b||Object.keys(i).some(e=>!(0,w.u9)(d,e))||!n.familyCount||!n.confirmAccuracy||"none"===n.contactRole||h||!o&&W(n.group).blocked,children:[!b&&"Next",b&&(0,r.jsx)(k.Z,{color:"#ffffff",size:10,margin:"2px"})]})]})}})},K=a(41664),X=a.n(K),J=a(19302),Q=a(69554),ee=a.n(Q),es=e=>(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("label",{className:"custom-radio"+(e.active?" active":"")+(e.disabled?" disabled":""),children:[(0,r.jsx)(Z.Z,{id:e.value,ref:e.forwardRef,type:e.type,name:e.formControlName,value:e.value,onChange:function(s){e.handleChange(s),e.handleSelect(e.value,e.setFieldValue)},checked:"radio"===e.type?e.value===e.formValues[e.formControlName]:void 0,disabled:e.disabled}),(0,r.jsx)("span",{className:"label "+e.value,children:e.label}),e.subLabel?(0,r.jsx)("span",{className:"sub-label",children:e.subLabel}):"",e.showDiscountBadge?(0,r.jsx)("div",{className:"discount-badge",children:(0,r.jsx)("div",{children:"Save 20%"})}):null,(0,r.jsx)("span",{className:"price-container",children:(0,r.jsx)("span",{className:"price",children:e.price})}),(0,r.jsx)("span",{className:"checkmark"}),(0,r.jsx)("div",{className:"radio-border ".concat(e.hideRadioBorder?"hidden":"")})]})}),ea=a(65172),er=a(62255),el=a(14794),en=a(73615);let et={base:{color:"#495057",letterSpacing:"1.5",textAlign:"center",fontFamily:"'Sailec', sans-serif",fontWeight:"400",fontSize:"14px","::placeholder":{color:"#a9b9d5"}}};var ei=e=>(0,r.jsxs)(en.Ak,{ref:e.cardRef,className:"cc-input-wrapper form-control",styles:et,children:[(0,r.jsx)(en.ZQ,{className:"cc-number",onChange:e.handleCardChange}),(0,r.jsx)(en.rw,{className:"cc-expiry",onChange:e.handleCardChange}),(0,r.jsx)(en.mX,{className:"cc-cvv",onChange:e.handleCardChange})]}),eo=e=>{let[s,a]=(0,l.useState)({errors:{},touched:{}}),n=Object.keys(s.errors).length>0||Object.keys(s.touched).length<3;return(0,l.useEffect)(()=>
1{n&&e.setFieldError("cc","invalidated")},[n]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"form-label text-center",children:(0,r.jsx)("h4",{children:"Enter your payment info"})}),(0,r.jsx)("div",{className:"form-label",children:"Name on card"}),(0,r.jsxs)(N.Z.Group,{children:[(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(N.Z.Control,{type:"text",name:"firstName",value:e.values.firstName,onChange:e.handleChange,onBlur:e.handleBlur,placeholder:"First Name",className:"hidden-field"}),(0,r.jsx)(N.Z.Control,{type:"text",name:"lastName",value:e.values.lastName,onChange:e.handleChange,onBlur:e.handleBlur,placeholder:"Last Name",className:"hidden-field"})]}),(0,r.jsx)(A.Z,{className:(0,w.u9)(e.errors,"firstName")&&(0,w.u9)(e.touched,"firstName")||(0,w.u9)(e.errors,"lastName")&&(0,w.u9)(e.touched,"lastName")||(0,w.u9)(e.errors,"fullName")&&(0,w.u9)(e.touched,"fullName")?"error":"",children:(0,r.jsx)(N.Z.Control,{type:"text",name:"fullName",value:e.values.fullName,onChange:e.handleChange,onBlur:e.handleBlur,placeholder:"Full name on card"})}),(0,w.u9)(e.errors,"firstName")&&(0,w.u9)(e.touched,"firstName")?(0,r.jsx)("div",{className:"error-message",children:(0,w.u9)(e.errors,"firstName")}):null,(0,w.u9)(e.errors,"lastName")&&(0,w.u9)(e.touched,"lastName")?(0,r.jsx)("div",{className:"error-message",children:(0,w.u9)(e.errors,"lastName")}):null,(0,w.u9)(e.errors,"fullName")&&(0,w.u9)(e.touched,"fullName")?(0,r.jsx)("div",{className:"error-message",children:(0,w.u9)(e.errors,"fullName")}):null]}),(0,r.jsx)("div",{className:"form-label",children:"Billing Address"}),(0,r.jsxs)(N.Z.Group,{className:"text-right",children:[(0,r.jsx)(el.Z,{onAddressSelect:e.onBillingAddressSelect,errors:e.errors,touched:e.touched,formValues:e.values,setFieldValue:e.setFieldValue,defaultValue:e.googlePlace?e.googlePlace.formatted_address:"",handleChange:e.handleChange,handleBlur:e.handleBlur}),(0,r.jsx)(N.Z.Control,{type:"hidden",value:e.values.billingAddress})]}),(0,r.jsxs)(N.Z.Group,{className:"cc-info",children:[(0,r.jsxs)(A.Z,{className:Object.keys(s.errors).length>0?"error":"",children:[(0,r.jsx)("div",{className:"form-label",children:"Credit Card"}),(0,r.jsx)(ei,{cardRef:e.cardRef,handleCardChange:function(s){a(a=>(a.touched["".concat(s.field)]=!0,s.error?(e.setFieldError("cc","invalidated"),a.errors["".concat(s.field)]=s.error.message):(delete a.errors["".concat(s.field)],0==Object.keys(a.errors).length&&3==Object.keys(a.touched).length&&e.setFieldError("cc",void 0)),{...a}))}})]}),Object.keys(s.errors).length>0&&Object.keys(s.errors).map(e=>(0,r.jsx)("div",{className:"error-message",children:s.errors[e]},e))]})]})},ed=e=>{let[s,a]=(0,l.useState)("0"),[n,t]=(0,l.useState)(!!e.values.couponCode);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.Z,{id:"group-payment-form",children:(0,r.jsxs)(f.Z,{children:[(0,r.jsx)(N.Z.Group,{className:"choose-plan",children:1===e.plans.length?function(){var s,a;let l=e.plans[0],n=e.addons&&e.addons.length>0,t=i(l),o=(null===(s=l.prices)||void 0===s?void 0:s[0])||l;return(0,r.jsxs)("div",{className:"jsx-68d877c70da69633 "+"single-plan-info toggle-container active ".concat(e.shouldDisableRadioOnLoad(l.item.id)?"disabled":""),children:[(0,r.jsx)(ee(),{id:"68d877c70da69633",children:".single-plan-info .checkmark{display:none!important}.single-plan-info .label{padding-left:20px!important}"}),(0,r.jsx)("div",{style:{pointerEvents:"none"},className:"jsx-68d877c70da69633 toggle py-3 px-4",children:(0,r.jsx)(es,{label:l.item.external_name||l.item.name,subLabel:o.trial_period?"(".concat(o.trial_period,"-").concat(o.trial_period_unit," free trial)"):"",price:"$".concat(t||"?","/").concat(o.period_unit),value:l.item.id,formControlName:"subscription",formValues:e.values,handleSelect:()=>{},handleChange:()=>{},setFieldValue:()=>{},active:!0,disabled:!1,showDiscountBadge:"year"===o.period_unit&&!(null===(a=o.tiers)||void 0===a?void 0:a.length),type:"radio",hideRadioBorder:!n})}),n&&(0,r.jsxs)("div",{className:"jsx-68d877c70da69633 pl-4 pr-4 pb-4",children:[(0,r.jsx)("h5",{style:{color:"#1B315A",fontSize:"1rem",fontWeight:"bold"},className:"jsx-68d877c70da69633 mb-3",children:"Additional Options"}),e.addons.map(s=>{var a;let l=(null===(a=s.prices)||void 0===a?void 0:a[0])||s;return(0,r.jsx)("div",{style:{pointerEvents:"auto"},className:"jsx-68d877c70da69633 mt-2",children:(0,r.jsx)(es,{forwardRef:e.addonRefs.current[s.item.id],label:s.item.external_name||s.item.name,price:"$".concat(l.price?l.price/100:"?","/").concat(l.period_unit),value:s.item.id,formControlName:s.item.id,formValues:e.values,handleSelect:e.handleAddonSelect,handleChange:e.handleChange,setFieldValue:e.setFieldValue,active:e.selectedAddons.includes(s.item.id),disabled:e.loadingTotals,showDiscountBadge:!1,type:"checkbox",hideRadioBorder:!0})},s.item.id)})]})]})}():(0,r.jsx)(ea.Z,{activeKey:s,defaultActiveKey:"0",children:e.plans.map((l,n)=>{var t,o;
1let d=n.toString(),c=e.addons&&e.addons.length>0,u=i(l),m=(null===(t=l.prices)||void 0===t?void 0:t[0])||l;return(0,r.jsxs)("div",{className:"toggle-container ".concat(d===s?"active":""," ").concat(e.shouldDisableRadioOnLoad(l.item.id)?"disabled":""),children:[(0,r.jsx)(ea.Z.Toggle,{className:"toggle",as:"div",eventKey:d,onClick:()=>a(d),children:(0,r.jsx)(es,{label:l.item.external_name||l.item.name,subLabel:m.trial_period?"(".concat(m.trial_period,"-").concat(m.trial_period_unit," free trial)"):"",price:"$".concat(u||"?","/").concat(m.period_unit),value:l.item.id,formControlName:"subscription",formValues:e.values,handleSelect:e.changeSelectedPlan,handleChange:e.handleChange,setFieldValue:e.setFieldValue,active:e.subscription===l.item.id,disabled:e.payByCheck&&"month"===m.period_unit||e.shouldDisableRadioOnLoad(l.item.id),showDiscountBadge:"year"===m.period_unit&&!(null===(o=m.tiers)||void 0===o?void 0:o.length),type:"radio",hideRadioBorder:!c})}),c&&(0,r.jsx)(ea.Z.Collapse,{eventKey:d,children:(0,r.jsx)(er.Z.Body,{children:e.addons.map(s=>{var a;let l=(null===(a=s.prices)||void 0===a?void 0:a[0])||s;return(0,r.jsx)("div",{children:(0,r.jsx)(es,{forwardRef:e.addonRefs.current[s.item.id],label:s.item.external_name||s.item.name,price:"$".concat(l.price?l.price/100:"?","/").concat(l.period_unit),value:s.item.id,formControlName:s.item.id,formValues:e.values,handleSelect:e.handleAddonSelect,handleChange:e.handleChange,setFieldValue:e.setFieldValue,active:e.selectedAddons.includes(s.item.id),disabled:e.loadingTotals,showDiscountBadge:!1,type:"checkbox",hideRadioBorder:!0})},s.item.id)})})})]},l.item.id)})})}),!e.payByCheck&&(0,r.jsx)(eo,{handleChange:e.handleChange,handleBlur:e.handleBlur,values:e.values,errors:e.errors,touched:e.touched,onBillingAddressSelect:e.onBillingAddressSelect,googlePlace:e.googlePlace,cardRef:e.cardRef,setFieldError:e.setFieldError,setFieldValue:e.setFieldValue}),!e.payByCheck&&!e.insideSales&&(0,r.jsxs)("p",{className:"text-muted small mt-2",children:["Wish to pay another way? Contact us at"," ",(0,r.jsx)("a",{href:"mailto:[email protected]",children:"[email protected]"}),"."]})]})}),(0,r.jsx)(N.Z.Group,{className:"exempt-and-coupon",children:(0,r.jsxs)(x.Z,{children:[e.touched.couponCode=!0,(0,r.jsx)(f.Z,{className:"col-coupon",children:n?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"form-label",children:"Coupon Code"}),(0,r.jsx)(A.Z,{className:(0,w.u9)(e.errors,"couponCode")&&(0,w.u9)(e.touched,"couponCode")?"error":"",children:(0,r.jsx)(N.Z.Control,{type:"text",name:"couponCode",value:e.values.couponCode,onChange:e.handleChange,onBlur:s=>{(0,w.u9)(e.errors,"couponCode")&&e.setFieldValue("couponCode",""),e.handleBlur(s)},placeholder:"Enter a coupon code",onKeyUp:()=>{e.setLoadingTotals(!0),e.handleCouponCodeChange(e.values.couponCode,e.setFieldError)}})}),(0,w.u9)(e.errors,"couponCode")&&(0,w.u9)(e.touched,"couponCode")?(0,r.jsx)("div",{className:"error-message",children:(0,w.u9)(e.errors,"couponCode")}):null,(0,w.u9)(e.errors,"couponCode")||e.loadingTotals||!e.validCoupon?null:(0,r.jsx)("div",{className:"valid-message",children:"Coupon is valid"})]}):(0,r.jsx)("a",{className:"btn btn-link btn-sm p-0",onClick:()=>t(!0),children:"Have a custom code?"})})]})}),e.insideSales&&(0,r.jsx)(N.Z.Group,{className:"mb-4",children:(0,r.jsx)(x.Z,{children:(0,r.jsxs)(f.Z,{children:[(0,r.jsx)("div",{className:"form-label",children:"HubSpot Deal ID"}),(0,r.jsx)(A.Z,{className:(0,w.u9)(e.errors,"hubspotDealId")&&(0,w.u9)(e.touched,"hubspotDealId")?"error":"",children:(0,r.jsx)(N.Z.Control,{id:"hubspot-deal-id",type:"text",name:"hubspotDealId",value:e.values.hubspotDealId||"",onChange:e.handleChange,onBlur:e.handleBlur,placeholder:"HubSpot Deal ID"})}),(0,w.u9)(e.errors,"hubspotDealId")&&(0,w.u9)(e.touched,"hubspotDealId")?(0,r.jsx)("div",{className:"error-message",children:(0,w.u9)(e.errors,"hubspotDealId")}):null]})})}),(0,r.jsx)(N.Z.Group,{className:"mb-4",children:(0,r.jsx)(x.Z,{children:(0,r.jsxs)(f.Z,{children:[(0,r.jsx)(N.Z.Check,{type:"checkbox",id:"taxExemptConsent",name:"taxExemptConsent",checked:e.values.taxExemptConsent,onChange:e.handleChange,onBlur:e.handleBlur,isInvalid:!!(0,w.u9)(e.errors,"taxExemptConsent")&&!!(0,w.u9)(e.touched,"taxExemptConsent"),label:(0,r.jsx)("span",{className:"text-dark",children:"I will provide a valid state sales tax exemption certificate after signup (not required to start the trial). If my exception is not approved before the trial ends, I consent to being charged applicable sales tax."}),className:"mb-3"}),(0,w.u9)(e.errors,"taxExemptConsent")&&(0,w.u9)(e.touched,"taxExemptConsent")&&(0,r.jsx)("div",{className:"error-message text-danger small mb-3",children:(0,w.u9)(e.errors,"taxExemptConsent")}),(0,r.jsxs)("div",{className:"mt-4",children:[(0,r.jsx)("h4",{style:{color:"#1B315A",fontWeight:"bold",fontSize:"1.25rem"},children:"Authorization"}),(0,r.jsxs)("div",{className:"p-3 mt-3",style:{backgroundColor:"#F0F4F8",border:"2px s
1olid #3470B2",borderRadius:"12px"},children:[(0,r.jsx)(N.Z.Check,{type:"checkbox",id:"certifyAuthority",name:"certifyAuthority",checked:e.values.certifyAuthority,onChange:e.handleChange,onBlur:e.handleBlur,isInvalid:!!(0,w.u9)(e.errors,"certifyAuthority")&&!!(0,w.u9)(e.touched,"certifyAuthority"),label:(0,r.jsxs)("div",{className:"ml-2",children:[(0,r.jsx)("strong",{style:{color:"#1B315A",display:"block",marginBottom:"0.5rem"},children:"I confirm that I have the authority to create this subscription on behalf of the parish"}),(0,r.jsx)("span",{className:"text-muted",style:{fontSize:"0.9rem",display:"block",color:"#6c757d"},children:"By checking this box, you certify that you are an authorized representative of the parish (Pastor, Parish Administrator, or designated staff member) and have permission to establish a Formed subscription for your parish community."})]}),style:{display:"flex",alignItems:"flex-start",margin:0},className:"certify-authority-checkbox"}),(0,w.u9)(e.errors,"certifyAuthority")&&(0,w.u9)(e.touched,"certifyAuthority")&&(0,r.jsx)("div",{className:"error-message text-danger small mt-2",children:(0,w.u9)(e.errors,"certifyAuthority")})]})]})]})})}),e.payByCheck&&(0,r.jsx)(x.Z,{id:"pay-by-check-text",children:(0,r.jsxs)(f.Z,{children:[(0,r.jsxs)("p",{children:[(0,r.jsx)("span",{className:"check-payable",children:"Make Check Payable to:"}),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),"Augustine Institute",(0,r.jsx)("br",{}),"16805 New Halls Ferry Road",(0,r.jsx)("br",{}),"Florissant, MO 63034"]}),(0,r.jsx)("p",{children:"Your account will be active today. If there is a problem receiving your check we'll contact you."}),(0,r.jsx)("hr",{})]})}),(0,r.jsx)(x.Z,{id:"total-row",children:(0,r.jsx)(f.Z,{children:(0,r.jsxs)("div",{className:"text-center total",children:[(0,r.jsx)("span",{className:"total-label",children:"Total due today: "}),!e.loadingTotals&&(0,r.jsxs)("span",{className:"total-value",children:["$",e.total]}),e.loadingTotals&&(0,r.jsx)("span",{children:(0,r.jsx)(k.Z,{color:"#1c8eec",size:10,margin:"2px"})})]})})})]});function i(s){var a;let r=(null===(a=s.prices)||void 0===a?void 0:a[0])||s;if(r.tiers&&r.tiers.length>0){let s=Number(e.values.familyCount);if(s>0){let e=r.tiers.find(e=>{let a=s>=e.starting_unit,r=void 0===e.ending_unit||s<=e.ending_unit;return a&&r});if(null==e?void 0:e.price)return e.price/100}let a=r.tiers[0].price,l=r.tiers[r.tiers.length-1].price;return a===l?a/100:"".concat(a/100,"â").concat(l/100)}return r.price?r.price/100:void 0}},ec=e=>{var s,a,n;let t={subscription:null===(s=e.initialValues)||void 0===s?void 0:s.subscription,total:"",loadingTotals:!1,billingAddress:e.billingAddress,payByCheck:!1,googlePlace:e.googlePlace,error:!1,couponCode:"",validCoupon:!1,taxExemptId:"",familyCount:(null===(a=e.initialValues)||void 0===a?void 0:a.familyCount)||"",selectedAddons:null===(n=e.initialValues)||void 0===n?void 0:n.selectedAddons,disablePayByCheck:!1,loadingSubscription:""},[i,d]=(0,l.useState)(t),c=(0,l.useRef)(i);(0,l.useEffect)(()=>{window.scrollTo(0,0),(async()=>{await y()})()},[]),(0,l.useEffect)(()=>{c.current=i},[i]);let u=(0,J.Z)(async(e,s)=>{try{await b({taxExemptId:e},"taxExemptId")}catch(e){await b({taxExemptId:null},"taxExemptId"),s("taxExemptId","Invalid Tax ID"),await d(e=>({...e,taxExemptId:"",loadingTotals:!1}))}},1e3),m=(0,J.Z)(async(e,s)=>{try{await b({couponCode:e},"couponCode")}catch(e){await b({couponCode:null},"couponCode"),s("couponCode","Invalid Coupon Code"),await d(e=>({...e,couponCode:"",validCoupon:!1,loadingTotals:!1}))}},1e3),h=(0,J.Z)(async e=>{await b({subscription:e})},700);function p(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";d(a=>({...a,loadingTotals:e,loadingSubscription:s}))}function g(e){return i.loadingSubscription!==e&&i.loadingTotals}async function v(e,s,a,r){d(s=>({...s,googlePlace:e,loadingTotals:!0})),r&&r("billingAddress",void 0);let l=(await Z(e.place_id)).data;l.givenName=s.billingAddress.givenName,l.familyName=s.billingAddress.familyName;try{await b({billingAddress:l,setFieldValue:a})}catch(e){r("billingAddress","Invalid billing address")}}async function y(){p(!0,e.initialValues.subscription);try{await b({subscription:e.initialValues.subscription})}catch(e){d(e=>({...e,error:!0,loadingTotals:!1}))}}async function b(s,a){let{subscription:r,billingAddress:l,couponCode:n,taxExemptId:t,familyCount:i,addonId:u,setFieldValue:m}=s,h=[...c.current.selectedAddons];if(r)h=function(s){let a=e.plans.find(e=>e.item.id===s);return eu(e.addons,a)}(r);else if(u){let e=h.indexOf(u);e>-1?h.splice(e,1):h.push(u)}let p={subscription:r||c.current.subscription,shippingAddress:e.address,billingAddress:l||c.current.billingAddress,couponCode:"couponCode"!==a||n?n||c.current.couponCode:"",taxExemptId:"taxExemptId"!==a||t?t||c.current.taxExemptId:"",familyCount:"familyCount"!==a||i?null!=i?i:c.current.familyCount:"",selectedAddons:h};try{let s=await o.x.post("/registration/estimate",p);delete p.shippingAddress,m&&(h&&m("selectedAddons",h),l&&m("billingAddress",l)),d(a=>({...a,...p,total:s.data.total,validCoupon:!!p.couponCode,loadingTotals:!1,loadingSubscription:"",selectedAddons:h,...r&&{disablePayByCheck:function(e,s){var a,r;let l=s.find(s=>s.item.id===e);return(null==l?void 0:null===(r=l.prices)||void 0===r?void 0:null===(a=r[0])||void 0===a?void 0:a.period_unit)==="month"}(r,e.plans)}}))}catch(e){throw d(e=>({...e,error:!1,loadingTotals:!1})),e}}async function j(s){p(!0,s),function(e){for(let s in e.current){let a=e.current[s].current;(null==a?void 0:a.checked)&&(a.checked=!1)}}(e.addonRefs),h.callback(s)}async function A(e,s){p(!0),await b({addonId:e,setFieldValue:s})}async function Z(e){try{return await o.x.get("/place/".concat(e))}catch(s){throw console.error("Could not find place for given id ".concat(e)),s}}return(0,r.jsxs)(r.Fragment,{children:[!i.error&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.Z,{id:"heading-row",className:"plan",children:(0,r.jsx)(f.Z,{children:(0,r.jsx)("h1",{children:1===e.plans.length?"Subscription Plan":"Cho
1ose a Plan"})})}),(0,r.jsx)(w.J9,{validationSchema:F.Ln,initialValues:e.initialValues,onSubmit:e.onSubmit,children:s=>{let{values:a,errors:l,touched:n,handleChange:t,handleBlur:o,handleSubmit:c,isSubmitting:h,setFieldTouched:y,setFieldValue:b,setFieldError:Z}=s;return(0,r.jsxs)(N.Z,{onSubmit:c,className:"group-info-form",children:[(0,r.jsx)(ed,{handleChange:t,handleBlur:o,values:a,errors:l,touched:n,setFieldError:Z,setFieldValue:b,shouldDisableRadioOnLoad:g,changeSelectedPlan:j,subscription:i.subscription,payByCheck:i.payByCheck,loadingTotals:i.loadingTotals,total:i.total,handleTaxExemptChange:u.callback,handleCouponCodeChange:m.callback,onBillingAddressSelect:(e,s)=>{v(e,s,void 0,Z)},googlePlace:i.googlePlace,setLoadingTotals:p,cardRef:e.cardRef,validCoupon:i.validCoupon,plans:e.plans,addons:e.addons,selectedAddons:i.selectedAddons,handleAddonSelect:A,addonRefs:e.addonRefs,insideSales:e.insideSales}),(0,r.jsxs)(C.Z,{type:"submit",disabled:h||Object.keys(l).length>0||Object.keys(n).length<1||i.loadingTotals,children:[!h&&"Purchase",h&&(0,r.jsx)(k.Z,{color:"#ffffff",size:10,margin:"2px"})]}),e.insideSales&&(0,r.jsx)(x.Z,{id:"check-link",className:"text-center",children:(0,r.jsxs)(f.Z,{children:[(0,r.jsxs)(C.Z,{variant:"link",onClick:()=>{b("payByCheck",!a.payByCheck),y("taxExemptId",!0),y("couponCode",!0),d(e=>({...e,payByCheck:!i.payByCheck}))},disabled:i.disablePayByCheck||i.loadingTotals,className:i.disablePayByCheck||i.loadingTotals?"text-muted":"",children:["Pay by ",i.payByCheck?"credit card":"check",(0,r.jsx)(S.G,{icon:"angle-right"})]}),(0,r.jsx)(N.Z.Control,{type:"checkbox",name:"payByCheck",value:a.payByCheck,onChange:t,className:"hidden-field"})]})})]})}}),(0,r.jsx)(x.Z,{className:"go-back-row text-center",children:(0,r.jsx)(f.Z,{children:(0,r.jsxs)(X(),{href:"?",children:["< ","Back"]})})})]}),i.error&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.Z,{id:"heading-row",className:"plan",children:(0,r.jsx)(f.Z,{children:(0,r.jsx)("h1",{children:"An Error Has Occurred"})})}),(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsxs)("p",{children:["Please ",(0,r.jsx)(X(),{href:"?",children:"click here"})," to restart"]}),(0,r.jsxs)("p",{children:["If the problem persists, please contact"," ",(0,r.jsx)("a",{href:"mailto:[email protected]",children:"Parish Care"}),"."]})]})]})]})};function eu(e,s){var a;let r=(null==s?void 0:null===(a=s.item.applicable_items)||void 0===a?void 0:a.map(e=>e.id))||[],l=[];for(let s of e)r.includes(s.item.id)&&l.push(s.item.id);return l}let em={payByCheck:!1,alreadySubscribed:!1,fullAddress:void 0,phone:void 0,errorType:"",plans:[],addons:[],isFromAdmin:!1};var eh=e=>{var s,a,p,g;let x=(null===(a=(0,i.aC)().user)||void 0===a?void 0:null===(s=a.profile)||void 0===s?void 0:s.sub)||"anon",[f,v]=(0,c.Xs)("groupCreateState:".concat(x),{...em}),y=(0,l.useCallback)(()=>{v({...em})},[v,em]),[b,C]=(0,l.useState)(f),{createdGroup:N,createdUser:A,firstStepValues:Z}=b,k=(0,l.useRef)(null),S=(0,l.useRef)({}),w=(0,n.useRouter)(),[F="org",B]=(g="step",[u((0,n.useRouter)(),g),(0,l.useCallback)(function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e instanceof Function&&(e=e(u(t(),g)));let a={...t().query};void 0===e?delete a[g]:a[g]=e,t().push({query:a},void 0,{shallow:s})},[g])]);(0,l.useEffect)(()=>{"confirmation"!==F&&"error"!==F?(console.debug("saved state",b),v(b)):y()},[F]),(0,l.useEffect)(()=>{if("org"===F&&e.group&&e.user){let s=e.group;M({adminUser:e.user,group:s})}},[F,e.group,e.user]);let R="org"!==F&&"error"!==F&&!b.secondStepInitialValues&&!("confirmation"===F&&b.alreadySubscribed);(0,l.useEffect)(()=>{R&&B(void 0,!0)},[R]),(0,l.useEffect)(()=>()=>B(void 0,!0),[B]);let P=e=>{let s=e.name.indexOf("-")-1;return e.name.substring(0,s)},E=(null===(p=e.initialUserValues)||void 0===p?void 0:p.parishRole)&&V.includes(e.initialUserValues.parishRole)?e.initialUserValues.parishRole:"",_=(0,l.useMemo)(()=>({name:"",email:"",parishRole:E,...A?{name:"".concat(A.firstName," ").concat(A.lastName),email:A.email}:e.initialUserValues}),[A,E,e.initialUserValues]),I=(0,l.useMemo)(()=>
1{if(N){var s,a,r;return{orgName:P(N),phone:null===(a=N.attributes)||void 0===a?void 0:null===(s=a.phone)||void 0===s?void 0:s[0],familyCount:(null===(r=b.secondStepInitialValues)||void 0===r?void 0:r.familyCount)||""}}return e.initialGroup?{group:e.initialGroup,orgName:e.initialGroup.name,phone:"+1"}:{phone:"+1"}},[N,e.initialGroup,b.secondStepInitialValues]),T=(0,l.useMemo)(()=>(console.log("initial values",{firstStepValues:Z,initialGroupValues:I,initialUserValues:_}),Z)?Z:{user:_,...I},[Z,I,_]),O=(0,l.useCallback)(e=>{C(s=>({...s,googlePlace:e}))},[C]);async function G(s,a){var r;let l,n;if(C(e=>({...e,firstStepValues:s})),s.group)return L(s.group,s,a);try{l=await U(s)}catch(e){console.warn("Failed to get address",e),a.setFieldError("orgAddress","Unable to get valid address"),a.setSubmitting(!1);return}let t={user:s.user,group:{place_id:s.orgAddress,name:s.orgName,address:l.data||void 0,phone:s.phone},clientName:e.clientName};try{n=await o.x.post("/registration",t)}catch(e){console.warn("Failed to created group",e),a.setFieldError("orgAddress","Unable to get valid address"),a.setSubmitting(!1);return}let{user:i,group:d,authUrl:c}=n.data,u=((null===(r=d.clientRoles)||void 0===r?void 0:r[e.clientName])||[]).length>0;if(c&&u){a.setSubmitting(!1),C(e=>({...e,magicLink:c,alreadySubscribed:!0})),B("confirmation");return}let m={...l.data,givenName:i.firstName,familyName:i.lastName};await q(d,i,m,s.familyCount)}async function U(e){let s;return e.usingManualAddress&&e.manualAddress?(s={data:{country:e.manualAddress.country,region:e.manualAddress.region,locality:e.manualAddress.locality,postalCode:e.manualAddress.postalCode,streetAddress:[e.manualAddress.streetAddress1],phone:e.phone}},e.manualAddress.streetAddress2&&s.data.streetAddress.push(e.manualAddress.streetAddress2)):(s=await o.x.get("/place/".concat(e.orgAddress)),delete s.data.formattedAddress),s}async function L(s,a,r){let l=a.contactRole||"both",n="billing"===l,t="admin"===l,i=n||"both"===l?a.user:a.otherContact||a.user,c=t||"both"===l?a.user:a.otherContact||a.user,u={billingContact:n||"both"===l?"user":"otherContact",primaryAdmin:t||"both"===l?"user":"otherContact"};try{let l=await o.x.post("/registration/admin/contacts",{billingContact:i,primaryAdmin:c,group_id:s.id,clientName:e.clientName}),{authUrl:t,pendingInvite:d,selfRoles:u}=l.data,m=n?l.data.billingAdmin:l.data.primaryAdmin,h="formed"===e.clientName?"FORMED":e.clientName,p=s.services&&s.services.includes(h);if(t&&p){r.setSubmitting(!1),C(e=>({...e,magicLink:t,alreadySubscribed:!0})),B("confirmation");return}let[g,x]=a.user.name.split(" ",2),{id:f,groupName:v,path:y,address:b,netsuiteId:j}=s;await q({id:f,name:v,path:y,attributes:{},realmRoles:[],clientRoles:{},subGroups:[],access:{view:!1,manage:!1,manageMembership:!1},netsuite_id:j},{...a.user,...m},{...b,givenName:g,familyName:x,phone:a.phone,streetAddress:"string"==typeof b.streetAddress?[b.streetAddress]:b.streetAddress},a.familyCount,d,u)}catch(e){if(e.response&&e.response.data&&e.response.data.message){let s=e.response.data.message;"string"==typeof s?(y(),C(e=>({...e,errorType:s}))):(y(),C(e=>({...e,errorType:""}))),B("error")}else e.response&&Array.isArray(e.response.data)&&e.response.data.every(e=>e.property in u)?d.W.processErrors(e.response.data.map(e=>({...e,property:u[e.property]})),r):(e.response&&e.response.data&&e.response.data.constraints&&e.response.data.constraints.duplicate?(y(),C(e=>({...e,errorType:"duplicate"}))):y(),B("error"));r.setSubmitting(!1)}}async function D(e,s){let a={country:s.attributes["address.country"][0],region:s.attributes["address.region"][0],locality:s.attributes["address.locality"][0],postalCode:s.attributes["address.postalCode"][0],streetAddress:s.attributes["address.streetAddress"],phone:s.attributes.phone};a.givenName=e.profile.given_name,a.familyName=e.profile.family_name;let r=(await o.x.request({url:"/users?keycloakFormat=true",method:"get",headers:{Authorization:"Bearer ".concat(e.access_token)}})).data;await q(s,r,a)}async function q(s,a,r,n,t,i){let d=(await o.x.get("/registration/items/SB-".concat(e.clientName.toUpperCase()))).data;if(!d||0===d.length){C(e=>({...e,errorType:"clientName"})),B("error");return}let c=d.filter(e=>{let{item:s}=e;return"plan"===s.type}),u=d.filter(e=>{let{item:s}=e;return"addon"===s.type});
1u.forEach(e=>{S.current[e.item.id]=(0,l.createRef)()}),C(e=>{var l,o;return{...e,secondStepInitialValues:{subscription:c[0].item.id,firstName:r.givenName,lastName:r.familyName,billingAddress:r,taxExemptId:"",couponCode:"",familyCount:n||"",fullName:"".concat(r.givenName," ").concat(r.familyName),payByCheck:!1,selectedAddons:eu(u,c[0]),taxExemptConsent:!1,certifyAuthority:!1},createdGroup:s,createdUser:a,pendingInvite:t,selfRoles:i,fullAddress:r,phone:(null===(o=s.attributes)||void 0===o?void 0:null===(l=o.phone)||void 0===l?void 0:l[0])||r.phone,plans:c,addons:u}}),B("payment")}async function M(e,s){try{if("adminUser"in e){let{adminUser:s,group:a}=e;await D(s,a)}else await G(e,s)}catch(e){e.response&&e.response.data?e.response.data.message?"string"==typeof e.response.data.message?B("error"):s?d.W.processErrors(e.response.data.message,s):(y(),B("error")):e.response.data.constraints&&s?d.W.processErrors(e.response.data,s):(y(),B("error")):B("error"),s&&s.setSubmitting(!1);return}}async function z(s,a){try{let a;if(s.payByCheck)a=!1;else{var r;let e={firstName:s.billingAddress.givenName,lastName:s.billingAddress.familyName,billingAddr1:s.billingAddress.streetAddress[0],...s.billingAddress.streetAddress[1]&&{billingAddr2:s.billingAddress.streetAddress[1]},billingCity:s.billingAddress.locality,billingState:s.billingAddress.region,billingZip:s.billingAddress.postalCode,billingCountry:s.billingAddress.country};a=await (null===(r=k.current)||void 0===r?void 0:r.tokenize(e))}let l={details:{...a&&{cardToken:a.token},subscription:s.subscription,shippingAddress:b.fullAddress,billingAddress:s.billingAddress,customer:b.createdUser,couponCode:s.couponCode,taxExemptId:s.taxExemptId,familyCount:s.familyCount?Number(s.familyCount):void 0,addons:s.selectedAddons},customer:{id:b.createdUser?b.createdUser.id:void 0,address:s.billingAddress},group:{id:b.createdGroup?b.createdGroup.id:"",taxExemption:s.taxExemptId||"",phone:b.phone||""},clientName:e.clientName,roleNames:function(e,s,a,r){let l=[];return e.forEach(e=>{e.item.id===a&&e.item.metadata&&e.item.metadata.role&&l.push(e.item.metadata.role)}),s.forEach(e=>{r.length>0&&r.includes(e.item.id)&&e.item.metadata&&e.item.metadata.role&&l.push(e.item.metadata.role)}),l}(b.plans,b.addons,s.subscription,s.selectedAddons),hubspotDealId:s.hubspotDealId,pendingInvite:b.pendingInvite,selfRoles:b.selfRoles},n=await o.x.post("/registration/order",l);if(y(),b.isFromAdmin){w.push({pathname:w.pathname,query:{group:l.group.id}});return}C(e=>({...e,magicLink:n.data.authUrl,inviteError:n.data.pendingInviteError})),B("confirmation")}catch(e){if(e.response&&e.response.data&&e.response.data.message){let s=e.response.data.message;"string"==typeof s?(y(),C(e=>({...e,errorType:s}))):(y(),C(e=>({...e,errorType:""}))),B("error")}else e.response&&e.response.constraints&&e.response.contraints.duplicate?(y(),C(e=>({...e,errorType:"duplicate"}))):y(),B("error");a.setSubmitting(!1);return}a.setSubmitting(!1)}return R?(0,r.jsx)(m.Z,{}):(0,r.jsx)("div",{id:"group-signup",children:"error"===F?(0,r.jsx)(h.Z,{type:b.errorType}):(0,r.jsxs)(r.Fragment,{children:["org"===F&&(0,r.jsx)($,{embed:e.embed,initialFormValues:T,onSubmit:M,updateGooglePlace:O,readOnlyUserFields:e.readOnlyUserFields,existingGroups:e.existingGroups,insideSales:e.insideSales}),"payment"===F&&(0,r.jsx)(ec,{embed:e.embed,initialValues:b.secondStepInitialValues,onSubmit:z,cardRef:k,addonRefs:S,address:b.fullAddress,user:b.createdUser,plans:b.plans,addons:b.addons,googlePlace:b.googlePlace,billingAddress:b.fullAddress,insideSales:e.insideSales}),"confirmation"===F&&(0,r.jsx)(j,{embed:e.embed,alreadySubscribed:b.alreadySubscribed,magicLink:b.magicLink,signupEmail:b.createdUser?b.createdUser.email:"",groupConfirmation:!0,inviteError:b.inviteError})]})})}},14794:function(e,s,a){a.d(s,{Z:function(){return y}});var r=a(85893),l=a(31328),n=a(62318),t=a(94716),i=a(81021),o=a(82175),d=a(67294),c=a(91901),u=a(9171),m=a(32737),h=a(12960),p=e=>{let[s,a]=(0,d.useState)(!1),[l,i]=(0,d.useState)(!0);return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(u.Z,{as:"div",show:s,children:(0,r.jsx)(c.ZP,{onChange:s=>{a(!1),e.onSelected(s,e.formValues,e.setFieldValue)},itemToString:e=>e?e.formatted_address:"",initialInputValue:e.defaultValue||"",onInputValueChange:function(e,s){e&&!(s.selectedItem&&s.selectedItem.formatted_address===e)?(a(!0),i(!1)):i(!0)},children:s=>{let{getInputProps:i,getItemProps:d,getMenuProps:c,isOpen:p,inputValue:g}=s;return(0,r.jsxs)("div",{children:[(0,r.jsxs)(u.Z.Toggle,{id:"addressLookupDropdown",as:"div",children:[(0,r.jsx)(n.Z,{className:(0,o.u9)(e.errors,"orgAddress")&&(0,o.u9)(e.touched,"orgAddress")||(0,o.u9)(e.errors,"billingAddress")?"error":"",children:(0,r.jsx)(t.Z,{type:"text",...i(),placeholder:"Enter Address",name:"orgAddress",id:"address",onBlur:()=>a(!1),onFocus:()=>a(!0),className:"no-append",onClick:e=>e.target.select()})}),(0,o.u9)(e.errors,"orgAddress")&&(0,o.u9)(e.touched,"orgAddress")?(0,r.jsx)("div",{className:"error-message",children:"There was a problem processing this address. Please enter address manually."}):null,(0,o.u9)(e.errors,"billingAddress")?(0,r.jsx)("div",{className:"error-message",children:"There was a problem processing this billing address. Please enter address manually."}):null]}),(0,r.jsx)(u.Z.Menu,{...c(),className:l?"hidden":"",children:p?g?(0,r.jsx)(m.Y,{url:"/place",params:{q:g},children:e=>{let{loading:s,error:a,data:l={}}=e,n="json"in l&&l.json.candidates?l.json.candidates:[];return s?(0,r.jsx)(u.Z.Item,{className:"loading-item",children:(0,r.jsx)(h.Z,{color:"#1c8eec",size:10,margin:"2px"})}
1):a?(0,r.jsxs)(u.Z.Item,{children:["Error! ",a]}):n.length?n.map((e,s)=>(0,r.jsx)(u.Z.Item,{...d({item:e,index:s}),children:(0,r.jsx)("span",{children:e.formatted_address})},e.place_id)):(0,r.jsx)(u.Z.Item,{children:"No matching address found"})}}):(0,r.jsx)(u.Z.Item,{children:"You have to enter a search query"}):null})]})}})})})},g=a(22793);async function x(e,s){if(s.orgAddress)try{var a,r;let{data:l}=await g.x.get("/place/".concat(s.orgAddress));e("manualAddress",{country:l.country||"",region:l.region||"",streetAddress1:(null===(a=l.streetAddress)||void 0===a?void 0:a[0])||"",streetAddress2:(null===(r=l.streetAddress)||void 0===r?void 0:r[1])||"",locality:l.locality||"",postalCode:l.postalCode||""})}catch(e){console.warn("Could not load address for place id",s.orgAddress)}e("usingManualAddress",!0)}function f(e){return"US"===e||"CA"===e}async function v(e){e("manualAddress",void 0),e("usingManualAddress",!1)}var y=e=>{var s,a,d,c,u,m,h,g,y,b,j,C,N,A,Z,k,S,w,F,B,R,P,V;return(0,r.jsxs)(r.Fragment,{children:[!e.formValues.usingManualAddress&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.Z.Group,{id:"address-lookup-group",className:"text-right",children:(0,r.jsx)(p,{setFieldValue:e.setFieldValue,errors:e.errors,touched:e.touched,onSelected:e.onAddressSelect,formValues:e.formValues,defaultValue:e.defaultValue})}),(0,r.jsx)("div",{className:"col-4 offset-8 pr-0 text-right",children:(0,r.jsx)("a",{className:"btn btn-link btn-sm "+(e.formValues.usingManualAddress?"open":""),onClick:()=>x(e.setFieldValue,e.formValues),children:"Edit Manually"})})]}),e.formValues.usingManualAddress&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"col-7 offset-5 pr-0 text-right",children:(0,r.jsx)("a",{className:"btn btn-link btn-sm "+(e.formValues.usingManualAddress?"open":""),onClick:()=>v(e.setFieldValue),children:"Look up address"})}),(0,r.jsx)("div",{className:"form-label",children:"Country"}),(0,r.jsx)(l.Z.Group,{children:(0,r.jsxs)(n.Z,{children:[(0,r.jsx)(i.Px,{id:"country-dropdown",classes:"form-control no-append",value:(null===(s=e.formValues.manualAddress)||void 0===s?void 0:s.country)||"US",valueType:"short",name:"manualAddress.country",defaultOptionLabel:"--",priorityOptions:["US"],onBlur:e.handleBlur,onChange:s=>{e.setFieldValue("manualAddress.country",s)}}),(0,r.jsx)(n.Z.Text,{className:"select-arrow",children:(0,r.jsx)("img",{className:"dropdown-icon",src:"/static/images/icons/angle-down.svg"})})]})}),(0,o.u9)(e.errors,"manualAddress.country")&&(0,o.u9)(e.touched,"manualAddress.country")?(0,r.jsx)("div",{className:"error-message text-center",children:(0,o.u9)(e.errors,"manualAddress.country")}):null,(0,r.jsx)("div",{className:"form-label",children:"Address Line 1"}),(0,r.jsx)(l.Z.Group,{children:(0,r.jsx)(n.Z,{className:(0,o.u9)(e.errors,"manualAddress.streetAddress1")&&(0,o.u9)(e.touched,"manualAddress.streetAddress1")?"error":"",children:(0,r.jsx)(t.Z,{className:"no-append",type:"text",placeholder:"Address Line 1",name:"manualAddress.streetAddress1",value:null===(a=e.formValues.manualAddress)||void 0===a?void 0:a.streetAddress1,onChange:e.handleChange,onBlur:e.handleBlur})})}),(0,o.u9)(e.errors,"manualAddress.streetAddress1")&&(0,o.u9)(e.touched,"manualAddress.streetAddress1")?(0,r.jsx)("div",{className:"error-message text-center",children:(0,o.u9)(e.errors,"manualAddress.streetAddress1")}):null,(0,r.jsx)("div",{className:"form-label",children:"Address Line 2"}),(0,r.jsx)(l.Z.Group,{children:(0,r.jsx)(n.Z,{className:(0,o.u9)(e.errors,"manualAddress.streetAddress2")&&(0,o.u9)(e.touched,"manualAddress.streetAddress2")?"error":"",children:(0,r.jsx)(t.Z,{type:"text",name:"manualAddress.streetAddress2",value:null===(d=e.formValues.manualAddress)||void 0===d?void 0:d.streetAddress2,onChange:e.handleChange,onBlur:e.handleBlur,placeholder:"Address Line 2"})})}),(0,r.jsxs)("div",{className:"address-row row",children:[(0,r.jsxs)("div",{className:"locality col-5",children:[(0,r.jsx)("div",{className:"form-label",children:f(null===(c=e.formValues.manualAddress)||void 0===c?void 0:c.country)?"City":"Locality"}),(0,r.jsx)(l.Z.Group,{children:(0,r.jsx)(n.Z,{className:(0,o.u9)(e.errors,"manualAddress.locality")&&(0,o.u9)(e.touched,"manualAddress.locality")?"error":"",children:(0,r.jsx)(t.Z,{type:"text",placeholder:f(null===(u=e.formValues.manualAddress)||void 0===u?void 0:u.country)?"City":"Locality",name:"manualAddress.locality",value:null===(m=e.formValues.manualAddress)||void 0===m?void 0:m.locality,onChange:e.handleChange,onBlur:e.handleBlur})})}),(0,o.u9)(e.errors,"manualAddress.locality")&&(0,o.u9)(e.touched,"manualAddress.locality")?(0,r.jsx)("div",{className:"error-message text-center",children:f(null===(h=e.formValues.manualAddress)||void 0===h?void 0:h.country)?"Please provide a city":(0,o.u9)(e.errors,"manualAddress.locality")}):null]}),(0,r.jsxs)("div",{className:"region col-3",children:[(null===(g=e.formValues.manualAddress)||void 0===g?void 0:g.country)==="US"&&(0,r.jsx)("div",{className:"form-label",children:"State"}),(null===(y=e.formValues.manualAddress)||void 0===y?void 0:y.country)==="CA"&&(0,r.jsx)("div",{className:"form-label",children:"Province"}),(null===(b=e.formValues.manualAddress)||void 0===b?void 0:b.country)!=="US"&&(null===(j=e.formValues.manualAddress)||void 0===j?void 0:j.country)!=="CA"&&(0,r.jsx)("div",{className:"form-label",children:"Region"}),(0,r.jsx)(l.Z.Group,{children:(0,r.jsxs)(n.Z,{children:[(0,r.jsx)(i.Xz,{classes:"form-control",country:(null===(C=e.formValues.manualAddress)||void 0===C?void 0:C.country)||"US",name:"manualAddress.region",value:(null===(N=e.formValues.manualAddress)||void 0===N?void 0:N.region)||"",countryValueType:"short",valueType:"short",labelType:"short",defaultOptionLabel:"--",onBlur:e.handleBlur,onChange:s=>{e.setFieldValue("manualAddress.region",s)}}),(0,r.jsx)(n.Z.Text,{className:"select-arrow",children:(0,r.jsx)("img",{className:"dropdown-icon",src:"/static/images/icons/angle-down.svg"})})]})}),(0,o.u9)(e.errors,"manualAddress.region")&&(0,o.u9)(e.touched,"manualAddress.region")?(0,r.jsxs)("div",{className:"error-message text-center",children:[(null===(A=e.formValues.manualAddress)||void 0===A?void 0:A.country)==="US"&&"Please select a state",(null===(Z=e.formValues.manualAddress)||void 0===Z?void 0:Z.country)==="CA"&&"Please select a province",(null===(k=e.formValues.manualAddress)||void 0===k?void 0:k.country)!=="US"&&(null===(S=e.formValues.manualAddress)||void 0===S?void 0:S.country)!=="CA"&&(0,o.u9)(e.errors,"manualAddress.region")]}):null]}),(0,r.jsxs)("div",{className:"postalCode col-4",children:[(null===(w=e.formValues.manualAddress)||void 0===w?void 0:w.country)==="US"&&(0,r.jsx)("div",{className:"form-label",children:"Zip Code"}),(null===(F=e.formValues.manualAddress)||void 0===F?void 0:F.country)!=="US"&&(0,r.jsx)("div",{className:"form-label",children:"Postal Code"}),(0,r.jsx)(l.Z.Group,{children:(0,r.jsx)(n.Z,{className:(0,o.u9)(e.errors,"manualAddress.postalCode")&&(0,o.u9)(e.touched,"manualAddress.postalCode")?"error":"",children:(0,r.jsx)(t.Z,{type:"text",placeholder:(null===(B=e.formValues.manualAddress)||void 0===B?void 0:B.country)==="US"?"Zip Code":"Postal Code",name:"manualAddress.postalCode",value:null===(R=e.formValues.manualAddress)||void 0===R?void 0:R.postalCode,onChange:e.handleChange,onBlur:e.handleBlur})})}),(0,o.u9)(e.errors,"manualAddress.postalCode")&&(0,o.u9)(e.touched,"manualAddress.postalCode")?(0,r.jsxs)("div",{className:"error-message text-center",children:[(null===(P=e.formValues.manualAddress)||void 0===P?void 0:P.country)==="US"&&"Please provide a zip code",(null===(V=e.formValues.manualAddress)||void 0===V?void 0:V.country)!=="US"&&(0,o.u9)(e.errors,"manualAddress.postalCode")]}):null]})]}),(0,r.jsx)(n.Z,{className:(0,o.u9)(e.errors,"orgAddress")&&(0,o.u9)(e.touched,"orgAddress")?"error":"",children:(0,r.jsx)(t.Z,{type:"hidden",name:"orgAddress"})}),(0,o.u9)(e.errors,"orgAddress")&&(0,o.u9)(e.touched,"orgAddress")?(0,r.jsx)("div",{className:"error-message text-center",children:"There was a problem processing this address. Please enter address manually."}):null]})]})}},30238:function(e,s,a){a.d(s,{Xs:function(){return l}});var r=a(67294);function l(e,s){return function(e,s,a){let[l,t]=(0,r.useState)(()=>{try{var r,l;let a=null===(l=window)||void 0===l?void 0:null===(r=l[e])||void 0===r?void 0:r.getItem(s);if(a){let r=JSON.parse(a);return console.debug('Loaded "'.concat(s,'" from ').concat(e),r),r}}catch(a){console.warn("Failed to load ".concat(s," from ").concat(e),a)}if(a instanceof Function){let r=a();return n(e,s,r),r}return a});return[l,(0,r.useCallback)(a=>{a instanceof Function?t(r=>{let l=a(r);return n(e,s,l),l}):(n(e,s,a),t(a))},[e,s])]}("sessionStorage",e,s)}function n(e,s,a){try{var r,l;null===(l=window)||void 0===l||null===(r=l[e])||void 0===r||r.setItem(s,JSON.stringify(a))}catch(a){console.warn("Failed to save ".concat(s," to ").concat(e),a)}}},37169:function(e,s,a){a.d(s,{Ln:function(){return l},fO:function(){return i},x_:function(){return t}});var r=a(7258);let l=r.Ry().shape({subscription:r.Z_().required("You must select a susbscription option"),payByCheck:r.O7(),fullName:r.Z_().when("payByCheck",{is:!1,then:r.Z_().required("Please provide a first and last name"),otherwise:r.Z_()}),cardNumber:r.Z_(),expiryDate:r.Z_(),cvc:r.Rx(),taxExemptId:r.Z_().nullable(),couponCode:r.Z_().nullable(),taxExemptConsent:r.O7().oneOf([!0],"You must agree to the tax exemption terms"),certifyAuthority:r.O7().oneOf([!0],"You must certify that you have authority to create this subscription"),hubspotDealId:r.Z_().notRequired().nullable()}),n={phone:r.Z_().required("Please enter a phone number").matches(/^(\+?\d{0,4})?\s?-?\s?(\(?\d{3}\)?)\s?-?\s?(\(?\d{3}\)?)\s?-?\s?(\(?\d{4}
1\)?)?$/,"Phone number is not valid"),orgAddress:r.Z_().when("usingManualAddress",{is:!1,then:r.Z_().required("Please select an address"),otherwise:r.Z_().notRequired().nullable()}),manualAddress:r.Vo(e=>void 0!==e?r.Ry().shape({country:r.Z_().required("Please select a country"),region:r.Z_().required("Please select a region"),streetAddress1:r.Z_().required("Please provide a street address"),streetAddress2:r.Z_().notRequired().nullable(),locality:r.Z_().required("Please provide a locality"),postalCode:r.Z_().required("Please provide a postal code")}):r.nK().notRequired())},t=r.Ry().shape({user:r.Ry().shape({name:r.Z_().required("Please provide a first and last name"),email:r.Z_().required("Please enter a valid email address").email("Please enter a valid email address"),parishRole:r.IX().of(r.Z_()).min(1,"Please select at least one role in the parish").required("Please select your role in the parish")}),contactRole:r.Z_().oneOf(["admin","billing","both","none"]).required("Please let us know which role(s) you'll be filling"),otherContact:r.Ry().when("contactRole",{is:e=>"admin"===e||"billing"===e,then:r.Ry().shape({name:r.Z_().required("Please provide a first and last name"),email:r.Z_().required("Please enter a valid email address").email("Please enter a valid email address")}),otherwise:r.Ry().notRequired().nullable()}),orgName:r.Z_().required("Please provide a name for your Organization").matches(/^[^\/]+$/,{message:"Please use an organization name that does not include a /"}),type:r.Z_().when("group",{is:void 0,then:r.Z_().required("Please provide a group type for your Organization"),otherwise:r.Z_().notRequired().nullable()}),familyCount:r.Rx().transform((e,s)=>""===s||Number.isNaN(e)?void 0:e).required("Please enter the number of households your parish serves").integer("Please enter a whole number").min(1,"Please enter at least 1 household"),confirmAccuracy:r.O7().oneOf([!0],"Please confirm that the count is accurate"),...n}).test("other-contact-not-same-as-user","This must be a different person than the one filling out this form",function(e){let{contactRole:s,user:a,otherContact:r}=e||{};if("admin"!==s&&"billing"!==s)return!0;let l=null==a?void 0:a.email,n=null==r?void 0:r.email;return!l||!n||l.trim().toLowerCase()!==n.trim().toLowerCase()||this.createError({path:"otherContact.email",message:"This must be a different person than the one filling out this form"})}),i=r.Ry().shape({shortName:r.Z_().required("Please provide a name for your Organization").matches(/^[^\/]+$/,{message:"Please use an organization name that does not include a /"}),...n})}}]);
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.