1import{j as e,B as c,y as p}from"./index-BdieqSwJ.js";import{F as u}from"./FoundationHero-D3hrtfRt.js";import{c as b,L as _}from"./vendor-C5KulfiR.js";import{F as h,a as f,c as x,b as q,d as t,e as j,f as g}from"./index.esm-Dg1hOYvk.js";import{F as n,T as r,Y as y,a as o,b as w,s as v,A as R,M as z}from"./foundationApplication-DMsL8nzb.js";import"./TextField-ByhV9hvI.js";import"./Select-CQ598FsW.js";import"./index-BiLMdtVQ.js";import"./useTheme-C6NpOf-5.js";import"./Paper-DBXxxtrv.js";import"./RadioGroup-BSJLHgQZ.js";import"./Radio-BFlBD6BC.js";import"./Typography-Dv-g4Ybv.js";const B={organization_name:"",contact_person:"",contact_email:"",contact_phone:"",website:"",date_funding_required:"",area_served:"",is_sports_org:"",organization_does:"",requested_amount:"",how_funds_used:"",anything_else:"",documents:[]},E=x({organization_name:t().required("Required"),contact_person:t().required("Required"),contact_email:t().email("Enter a valid email").required("Required"),contact_phone:t().required("Required"),website:t().url("Enter a valid URL (include https://)"),date_funding_required:g().required("Required"),area_served:t().required("Required"),is_sports_org:t().oneOf(["yes","no"]).required("Required"),organization_does:t().required("Required"),requested_amount:j().typeError("Enter an amount").positive("Must be greater than 0").max(3e3,"Stream 'Better' is for requests under $3000 â use 'Way Better' for more").required("Required"),how_funds_used:t().max(500,"Limit 500 characters").required("Required"),anything_else:t().max(200,"Limit 200 characters"),documents:q().max(3,"Max 3 files").test("type","Only jpg or pdf files are allowed",i=>(i??[]).every(a=>R.includes(a.type)||/\.(jpe?g|pdf)$/i.test(a.name))).test("size","Each file must be 256 MB or less",i=>(i??[]).every(a=>a.size<=z))}),O=()=>{const[i,a]=b.useState(!1);return i?e.jsxs("div",{className:"bwf",children:[e.jsx(u,{}),e.jsxs("div",{className:"mw-1280 bwf-form__success",children:[e.jsx("h1",{children:"Application submitted"}),e.jsx("p",{children:"Thank you. The Foundation team will review your Stream âBetterâ application."}),e.jsx(_,{className:"bwf-btn bwf-btn--outline",to:"/better-way",children:"Back to Better Way Foundation"})]})]}):e.jsxs("div",{className:"bwf",children:[e.jsx(u,{}),e.jsxs("div",{className:"mw-1280 bwf-form",children:[e.jsx("h1",{children:"Application Stream âBetterâ"}),e.jsxs("p",{className:"bwf-form__intro",children:["This application is for funding requests ",e.jsx("b",{children:"under $3000"}),". All sections are required unless marked optional."]}),e.jsx(h,{initialValues:B,validationSchema:E,onSubmit:async(s,{setSubmitting:d})=>{const{documents:l,...m}=s;try{await v("better",m,l),a(!0)}catch{p.error("Could not submit right now. Please try again later.")}finally{d(!1)}},children:({isSubmitting:s})=>e.jsxs(f,{noValidate:!0,children:[e.jsxs(n,{title:"Organization",children:[e.jsx(r,{name:"organization_name",label:"Name of organization",required:!0}),e.jsx(r,{name:"contact_person",label:"Contact person",required:!0}),e.jsx(r,{name:"contact_email",label:"Contact email",type:"email",required:!0}),e.jsx(r,{name:"contact_phone",label:"Contact phone number",required:!0}),e.jsx(r,{name:"website",label:"Website address (if you have one)"}),e.jsx(y,{name:"is_sports_org",label:"Are you a sports team or sports related organization?",required:!0}),e.jsx(o,{name:"organization_does",label:"What does your organization do?",required:!0})]}),e.jsxs(n,{title:"Request",children:[e.jsx(r,{name:"requested_amount",label:"Requested amount ($)",type:"number",required:!0}),e.jsx(r,{name:"date_funding_required",label:"Date funding is required",type:"date",required:!0}),e.jsx(r,{name:"area_served",label:"What specific area of our province do you serve? (town, city, region, or province as a whole)",required:!0,full:!0}),e.jsx(o,{name:"how_funds_used",label:"How will the funds be used?",maxLength:500,required:!0}),e.jsx(o,{name:"anything_else",label:"Is there anything else we should know about your organization or your project? (optional)",maxLength:200})]}),e.jsx(n,{title:"Supporting documents (optional)",children:e.jsx(w,{name:"documents",label:"Upload supporting documents"})}),e.jsx("div",{className:"bwf-form__submit",children:e.jsx(c,{type:"submit",variant:"contained",disabled:s,className:"bwf-btn bwf-btn--solid",children:s?"Submittingâ¦":"Submit application"})})]})})]})]})};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.