1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4223],{64223:function(e,r,a){a.d(r,{ContactUsFormSection:function(){return g}});var s=a(26705),l=a(39343),t=a(61169),n=a(12445),i=a(92535),d=a(20955),o=a(34451),c=a(22490),u=a(45734),p=a(12901),x=a(54605),m=a(71129);let h=e=>{var r,a,u,h;let{backgroundImageUrl:b,instructions:y,firstName:g,lastName:v,email:f,phoneNumber:j,organization:N,inquiry:T,inquiryTypes:_,message:P,disclaimer:w,ctaLabel:q,privacyPolicyConsent:k,consent:E,onValidFormSubmit:C,isRecaptchaReady:A,thankyouMessageBody:U,thankyouMessageHeading:I,recaptchaNotReadyMessage:R}=e,{control:B,register:F,handleSubmit:S,setError:z,formState:{errors:M,isSubmitting:V,isSubmitSuccessful:Z}}=(0,l.cI)({mode:"onBlur"}),O=S(async e=>{try{let r=await C(e);(null==r?void 0:r.error)&&z("root.serverError",{type:"serverError",message:r.error})}catch(e){z("root.serverError",{type:"serverError",message:"There was an error submitting your form. Please try again later."})}}),Y=(0,d.useId)(),J=(0,d.useId)(),{mobileBgImageUrl:Q,desktopBgImageUrl:X}=(0,x.p)(b),$=Q||X;return(0,s.jsx)("section",{className:$?"bg-[image:var(--bg-mobile-url)] bg-cover bg-no-repeat lg:bg-[image:var(--bg-desktop-url)]":"",style:{...$&&{"--bg-mobile-url":"url(".concat(Q,")"),"--bg-desktop-url":"url(".concat(X,")")}},children:(0,s.jsx)("div",{className:"py-5 md:py-10",children:Z?(0,s.jsx)(p.i,{heading:I,body:U}):(0,s.jsxs)("form",{className:"mx-auto max-w-[800px] bg-neutrals-100 px-xl py-5 shadow-1 md:px-5",onSubmit:O,children:[y&&(0,s.jsx)("div",{className:"mb-5",children:y}),(0,s.jsxs)("div",{className:"w-full justify-evenly gap-3 md:flex",children:[(0,s.jsx)("div",{className:"grow",children:(0,s.jsx)(m.UP,{name:"firstName",fieldProps:g,register:F,inputType:"input",errors:M.firstName})}),(0,s.jsx)("div",{className:"grow",children:(0,s.jsx)(m.UP,{name:"lastName",fieldProps:v,inputType:"input",register:F,errors:M.lastName})})]}),(0,s.jsx)(m.UP,{name:"email",fieldProps:f,inputType:"input",pattern:m.V0,register:F,errors:M.email}),(0,s.jsx)(m.UP,{name:"phoneNumber",fieldProps:j,pattern:m.UR,inputType:"input",register:F,errors:M.phoneNumber}),(0,s.jsx)(m.UP,{name:"organization",fieldProps:N,register:F,inputType:"input",errors:M.organization}),(0,s.jsx)(c._,{inputId:Y,helperTextId:J,errors:M.inquiryType,label:T.label,helperText:T.helperText,required:T.required,requiredErrorMessage:T.requiredErrorMessage,invalidErrorMessage:T.invalidErrorMessage,children:(0,s.jsx)(l.Qr,{control:B,name:"inquiryType",rules:{required:!0},render:e=>{var r,a;let{field:l}=e;return(0,s.jsxs)(o.Ph,{onValueChange:l.onChange,children:[(0,s.jsx)(o.i4,{id:Y,className:"mb-md","aria-describedby":M.inquiryType||T.helperText?J:void 0,onBlur:l.onBlur,"aria-label":null!==(r=T.label)&&void 0!==r?r:"Select a category",children:(0,s.jsx)(o.ki,{placeholder:null!==(a=T.placeholder)&&void 0!==a?a:null})}),(0,s.jsx)(o.Bw,{children:_.map(e=>{var r;return(0,s.jsx)(o.Ql,{value:null!==(r=e.value)&&void 0!==r?r:"general-other",children:e.label},e._key)})})]})}})}),(0,s.jsx)(m.UP,{name:"message",fieldProps:P,inputType:"textarea",register:F,errors:M.message}),(0,s.jsxs)("div",{className:"mb-3 inline-flex gap-2",children:[(0,s.jsx)(m.UP,{name:"privacyPolicyConsent",fieldProps:{required:!0},inputType:"checkbox",register:F,errors:M.privacyPolicyConsent}),(0,s.jsxs)("label",{htmlFor:"privacyPolicyConsent",className:"text-md",children:["Privacy Policy: I have read and accept the\xa0",(0,s.jsx)("a",{className:"link text-md underline",href:"https://anitab.org/",target:"_blank",children:"AnitaB.org"}),"\xa0",(0,s.jsx)("a",{className:"link text-md underline",href:"https://anitab.org/privacy-policy/",target:"_blank",children:"Privacy Policy."}),(0,s.jsx)("span",{className:"text-red-500",children:"*"})," "]}),M.privacyPolicyConsent&&(0,s.jsx)("p",{className:"text-xs text-red-500",children:"This field is required"})]}),(0,s.jsxs)("div",{className:"mb-3 inline-flex gap-2",children:[(0,s.jsx)(m.UP,{name:"consent",fieldProps:{},inputType:"checkbox",register:F,errors:M.consent}),(0,s.jsx)("label",{htmlFor:"consent",className:"text-md ",children:"Yes! Please contact me at this email address about future products or services."}),M.consent&&(0,s.jsx)("p",{className:"text-xs text-red-500",children:"This field is required"})]}),(0,s.jsx)("div",{className:"mb-3",children:w&&(0,s.jsx)(i.YI,{value:w,components:n.w})}),(null==M?void 0:null===(a=M.root)||void 0===a?void 0:null===(r=a.serverError)||void 0===r?void 0:r.message)&&(0,s.jsx)("p",{"aria-live":"polite",className:"body-rg text-red-500",children:null==M?void 0:null===(h=M.root)||void 0===h?void 0:null===(u=h.serverError)||void 0===u?void 0:u.message}),!A&&(0,s.jsx)("p",{className:"body-rg text-red-500",children:R}),(0,s.jsx)("div",{className:"text-right",children:(0,s.jsx)(t.CtaButton,{type:"submit",variant:"primary",label:q,disabled:V||!A})})]})})})},b=e=>{let{executeRecaptcha:r}=(0,u.xX)(),a=async e=>{if(!r)return console.error("reCaptcha not initialized"),{error:"reCaptcha not initialized. Please try again in a moment."};let a=await r("submit"),s=JSON.stringify({...e,inquiryType:e.inquiryType,recaptchaToken:a}),l=null;try{l=await fetch("".concat("https://ghc.anitab.org","/api/contact"),{method:"POST",headers:{"content-type":"application/json"},body:s})}catch(e){return{error:"Error sending form request. Try again later."}}let t=null;try{t=await l.json()}catch(e){return{error:"Error parsing response. Try again later."}}return(null==t?void 0:t.success)&&scrollTo({top:0}),t};return(0,s.jsx)(h,{...e,onValidFormSubmit:a,isRecaptchaReady:!!r})};var y=a(13516);function g(e){return(0,s.jsx)(y.GoogleReCaptchaProviderWrapper,{children:(0,s.jsx)(b,{...e})})}},12901:function(e,r,a){a.d(r,{i:function(){return n}});var s=a(26705),l=a(92535),t=a(12445);let n=e=>{let{heading:r,body:a}=e;return(0,s.jsxs)("div",{className:"mx-auto max-w-[800px] space-y-5 rounded-lg bg-neutrals-100 px-xl py-5 text-center shadow-1",children:[(0,s.jsx)("h2",{className:"heading-3",children:r}),(0,s.jsx)(l.YI,{value:a,components:t.w})]})}},22490:function(e,r,a){a.d(r,{_:function(){return t}});var s=a(26705);a(20955);let l=(e,r,a,s)=>{if(e){if("required"===e.type&&r)return r;if("required"!==e.type)return null!=a?a:""}return s||""},t=e=>{let{inputId:r,helperTextId:a,label:t,helperText:n,requiredErrorMessage:i,invalidErrorMessage:d,required:o=!1,errors:c,children:u}=e;return(0,s.jsxs)("div",{className:"",children:[(0,s.jsxs)("label",{className:"mb-sm block",htmlFor:r,children:[t,o&&t&&(0,s.jsx)("span",{className:"dib text-red-500",children:"*"})]}),u,(0,s.jsx)("div",{id:a,className:"mb-md min-h-2 text-sm ".concat(c?"text-red-600":"text-neutrals-600"),children:(c||n)&&(0,s.jsx)("div",{children:l(c,i,d,n)})})]})}},13516:function(e,r,a){a.d(r,{GoogleReCaptchaProviderWrapper:function(){return n}});var s=a(26705),l=a(45734),t=a(25566);let n=e=>{let{children:r}=e;return(0,s.jsx)(l.pm,{reCaptchaKey:"6LcXOxMqAAAAAHJ27XgBvOaLUFQqFHm9eF6WvUk_",useEnterprise:"true"===t.env.NEXT_PUBLIC_RECAPTCHA_USE_ENTERPRISE,language:"en",children:r})}},71129:function(e,r,a){a.d(r,{UP:function(){return d},UR:function(){return n},V0:function(){return i}});var s=a(26705),l=a(20955),t=a(22490);let n=/^(\+\d{1,2}\s?)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$/,i=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]{2,}(\.[a-zA-Z0-9-]{2,})+$/;function d(e){var r,a,n,i,d,o,c;let{name:u,register:p,fieldProps:x,errors:m,pattern:h,inputType:b="input"}=e,y=(0,l.useId)(),g=(0,l.useId)();return(0,s.jsxs)(t._,{inputId:y,helperTextId:g,errors:m,label:x.label,helperText:x.helperText,required:x.required,requiredErrorMessage:x.requiredErrorMessage,invali
1dErrorMessage:x.invalidErrorMessage,children:["input"==b&&(0,s.jsx)("input",{id:y,"aria-describedby":m||x.helperText?g:void 0,placeholder:null!==(r=x.placeholder)&&void 0!==r?r:"",className:"mb-md w-full rounded-[6px] border focus:border-brand-500 focus:outline-brand-500 ".concat(m?"border-red-500":"border-neutrals-200"," p-lg"),...p(u,{required:null!==(a=x.required)&&void 0!==a&&a,pattern:h})}),"textarea"==b&&(0,s.jsx)("textarea",{id:y,rows:3,"aria-describedby":m||x.helperText?g:void 0,placeholder:null!==(n=x.placeholder)&&void 0!==n?n:"",className:"mb-md block w-full rounded-[6px] border border-neutrals-200 p-md",...p(u,{required:null!==(i=x.required)&&void 0!==i&&i,pattern:h})}),"checkbox"==b&&(0,s.jsx)("input",{type:"checkbox",id:y,"aria-describedby":m||x.helperText?g:void 0,className:"block rounded-[6px] border border-neutrals-200 p-sm",...p(u,{required:null!==(d=x.required)&&void 0!==d&&d})}),"radio"===b&&Array.isArray(x.options)&&(()=>{let e=x.options.length<3;return(0,s.jsx)("div",{className:e?"flex flex-wrap gap-4":"space-y-2",children:x.options.map((r,a)=>{var l;let t="".concat(y,"-").concat(a);return(0,s.jsxs)("label",{htmlFor:t,className:e?"inline-flex items-center gap-2":"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"radio",id:t,value:r,className:"rounded-full border ".concat(m?"border-red-500":"border-neutrals-200"),...p(u,{required:null!==(l=x.required)&&void 0!==l&&l})}),(0,s.jsx)("span",{children:r})]},t)})})})(),"select"===b&&Array.isArray(x.options)&&(0,s.jsxs)("select",{id:y,"aria-describedby":m||x.helperText?g:void 0,className:"mb-md w-full rounded-[6px] border focus:border-brand-500 focus:outline-brand-500 ".concat(m?"border-red-500":"border-neutrals-200"," p-lg"),defaultValue:"",...p(u,{required:null!==(o=x.required)&&void 0!==o&&o}),children:[(0,s.jsx)("option",{value:"",disabled:!0,children:null!==(c=x.placeholder)&&void 0!==c?c:"Select an option"}),x.options.map((e,r)=>(0,s.jsx)("option",{value:e,children:e},"".concat(y,"-").concat(r)))]}),"checkbox-multiple"===b&&Array.isArray(x.options)&&(0,s.jsx)("div",{className:"space-y-2",children:x.options.map((e,r)=>{var a;let l="".concat(y,"-").concat(r);return(0,s.jsxs)("label",{htmlFor:l,className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",id:l,value:e,"aria-describedby":m||x.helperText?g:void 0,className:"rounded border ".concat(m?"border-red-500":"border-neutrals-200"),...p(u,{required:null!==(a=x.required)&&void 0!==a&&a})}),(0,s.jsx)("span",{children:e})]},l)})}),m&&(0,s.jsx)("span",{className:"error-message",children:m.message})]})}},34451:function(e,r,a){a.d(r,{Bw:function(){return m},Ph:function(){return u},Ql:function(){return h},i4:function(){return x},ki:function(){return p}});var s=a(26705),l=a(20955),t=a(56800),n=a.n(t),i=a(48252),d=a(60880),o=a(84120),c=a(6005);let u=c.fC;u.displayName=c.fC.displayName,c.ZA.displayName=c.ZA.displayName;let p=c.B4;p.displayName=c.B4.displayName;let x=l.forwardRef((e,r)=>{let{className:a,children:l,...t}=e;return(0,s.jsxs)(c.xz,{ref:r,className:"body-rg inline-flex w-full items-center justify-between rounded-md border border-solid border-neutrals-200 bg-neutrals-100 p-lg text-neutrals-900 hover:bg-brand-100 focus:outline-brand-400 data-[placeholder]:text-neutrals-600",...t,children:[l,(0,s.jsx)(c.JO,{className:"text-neutrals-900 opacity-100",asChild:!0,children:(0,s.jsx)(i.p,{className:"h-4 w-4 opacity-50"})})]})});x.displayName=c.xz.displayName;let m=l.forwardRef((e,r)=>{let{className:a,children:l,position:t="popper",...n}=e;return(0,s.jsx)(c.h_,{children:(0,s.jsxs)(c.VY,{ref:r,className:"overflow-hidden rounded-md bg-neutrals-100 shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)]",...n,children:[(0,s.jsx)(c.u_,{className:"flex h-3 cursor-default items-center justify-center bg-neutrals-100 text-neutrals-900",children:(0,s.jsx)(d.U,{})}),(0,s.jsx)(c.l_,{className:"p-[5px]",children:l}),(0,s.jsx)(c.$G,{className:"flex h-3 cursor-default items-center justify-center bg-neutrals-100 text-neutrals-900",children:(0,s.jsx)(i.p,{})})]})})});m.displayName=c.VY.displayName;let h=l.forwardRef((e,r)=>{let{children:a,className:l,...t}=e;return(0,s.jsxs)(c.ck,{className:n()("body-md relative flex select-none items-center rounded-md bg-neutrals-100 py-lg pl-[25px] pr-[35px] leading-none text-neutrals-900 data-[disabled]:pointer-events-none data-[highlighted]:bg-brand-100 data-[disabled]:text-neutrals-200 data-[highlighted]:text-neutrals-900 data-[highlighted]:outline-none",l),...t,ref:r,children:[(0,s.jsx)(c.eT,{children:a}),(0,s.jsx)(c.wU,{className:"absolute left-0 inline-flex w-[25px] items-center justify-center",children:(0,s.jsx)(o.J,{})})]})});h.displayName=c.ck.displayName,l.forwardRef((e,r)=>{let{className:a,...l}=e;return(0,s.jsx)(c.__,{ref:r,className:"body-sm py-sm pl-[1.625rem] pr-2 font-semibold",...l})}).displayName=c.__.displayName,l.forwardRef((e,r)=>{let{className:a,...l}=e;return(0,s.jsx)(c.Z0,{ref:r,className:"-mx-1 my-1 h-2xs bg-neutrals-300",...l})}).displayName=c.Z0.displayName}}]);
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.