PageSourceSearch

https://www.exploremaricopacountyparks.org/_next/static/chunks/pag…/registration/checkout-536175840e43a6dd.js

js exploremaricopacountyparks.org collected 2026-10-10 01:02:00 UTC 68,110 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8771,9310],{1625:(e,t,l)=>{"use strict";l.d(t,{b:()=>r});var i=l(72788);function r(e,t){var r;let{data:a,refetch:n,loading:s}=(0,i.NWN)({variables:{household_id:e,order_by:t},onError:t=>{l.g.console.error("Unable to fetch household members for household ID: ".concat(e,"."),t)},fetchPolicy:"cache-first",skip:!e});return{householdMembers:null!=(r=null==a?void 0:a.household_member)?r:[],refetchHouseholdMembers:n,loadingHouseholdMembers:s}}},3885:(e,t,l)=>{"use strict";l.d(t,{Ay:()=>I});var i=l(32839),r=l(74410),a=l(81204),n=l(9281),s=l(17497),o=l(24809),d=l(28104),c=l(37369),m=l(18917),u=l(74308),p=l(8050),h=l(28923),f=l(94031),x=l(42455);function v(e){return(0,x.Ay)("MuiDrawer",e)}(0,f.A)("MuiDrawer",["root","docked","paper","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);var _=l(78488);let y=["BackdropProps"],g=["anchor","BackdropProps","children","className","elevation","hideBackdrop","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"],b=(e,t)=>{let{ownerState:l}=e;return[t.root,("permanent"===l.variant||"persistent"===l.variant)&&t.docked,t.modal]},j=(0,h.Ay)(o.A,{name:"MuiDrawer",slot:"Root",overridesResolver:b})(e=>{let{theme:t}=e;return{zIndex:(t.vars||t).zIndex.drawer}}),A=(0,h.Ay)("div",{shouldForwardProp:h.ep,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:b})({flex:"0 0 auto"}),N=(0,h.Ay)(c.A,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{let{ownerState:l}=e;return[t.paper,t["paperAnchor".concat((0,m.A)(l.anchor))],"temporary"!==l.variant&&t["paperAnchorDocked".concat((0,m.A)(l.anchor))]]}})(e=>{let{theme:t,ownerState:l}=e;return(0,r.A)({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(t.vars||t).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},"left"===l.anchor&&{left:0},"top"===l.anchor&&{top:0,left:0,right:0,height:"auto",maxHeight:"100%"},"right"===l.anchor&&{right:0},"bottom"===l.anchor&&{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},"left"===l.anchor&&"temporary"!==l.variant&&{borderRight:"1px solid ".concat((t.vars||t).palette.divider)},"top"===l.anchor&&"temporary"!==l.variant&&{borderBottom:"1px solid ".concat((t.vars||t).palette.divider)},"right"===l.anchor&&"temporary"!==l.variant&&{borderLeft:"1px solid ".concat((t.vars||t).palette.divider)},"bottom"===l.anchor&&"temporary"!==l.variant&&{borderTop:"1px solid ".concat((t.vars||t).palette.divider)})}),w={left:"right",right:"left",top:"down",bottom:"up"},I=a.forwardRef(function(e,t){var l,o;let c=(0,p.A)({props:e,name:"MuiDrawer"}),h=(0,u.A)(),f={enter:h.transitions.duration.enteringScreen,exit:h.transitions.duration.leavingScreen},{anchor:x="left",BackdropProps:b,children:I,className:S,elevation:C=16,hideBackdrop:E=!1,ModalProps:{BackdropProps:P}={},onClose:D,open:k=!1,PaperProps:M={},SlideProps:B,TransitionComponent:F=d.A,transitionDuration:O=f,variant:R="temporary"}=c,T=(0,i.A)(c.ModalProps,y),Y=(0,i.A)(c,g),H=a.useRef(!1);a.useEffect(()=>{H.current=!0},[]);let L=(l=h,o=x,"rtl"===l.direction&&-1!==["left","right"].indexOf(o)?w[o]:o),z=(0,r.A)({},c,{anchor:x,elevation:C,open:k,variant:R},Y),V=(e=>{let{classes:t,anchor:l,variant:i}=e,r={root:["root"],docked:[("permanent"===i||"persistent"===i)&&"docked"],modal:["modal"],paper:["paper","paperAnchor".concat((0,m.A)(l)),"temporary"!==i&&"paperAnchorDocked".concat((0,m.A)(l))]};return(0,s.A)(r,v,t)})(z),q=(0,_.jsx)(N,(0,r.A)({elevation:"temporary"===R?C:0,square:!0},M,{className:(0,n.A)(V.paper,M.className),ownerState:z,children:I}));if("permanent"===R)return(0,_.jsx)(A,(0,r.A)({className:(0,n.A)(V.root,V.docked,S),ownerState:z,ref:t},Y,{children:q}));let U=(0,_.jsx)(F,(0,r.A)({in:k,direction:w[L],timeout:O,appear:H.current},B,{children:q}));return"persistent"===R?(0,_.jsx)(A,(0,r.A)({className:(0,n.A)(V.root,V.docked,S),ownerState:z,ref:t},Y,{children:U})):(0,_.jsx)(j,(0,r.A)({BackdropProps:(0,r.A)({},b,P,{transitionDuration:O}),className:(0,n.A)(V.root,V.modal,S),open:k,ownerState:z,onClose:D,hideBackdrop:E,ref:t},Y,T,{children:U}))})},13130:(e,t,l)=>{"use strict";l.d(t,{A:()=>f});var i=l(78488),r=l(35848),a=l(44924),n=l(59174);l(81204);var s=l(61277),o=l(96045),d=l.n(o),c=l(18713),m=l(42155),u=l.n(m);let p=e=>{let{children:t,ignoreMaxWidth:l,className:r,...a}=e;return(0,i.jsx)(c.A,{maxWidth:!l&&"xl",...a,className:u()({"lg:px-16":!l},r),children:t})},h=()=>{let{notifications:e}=(0,s.t)();return(0,i.jsx)(i.Fragment,{children:e.map(e=>(0,i.jsxs)("div",{className:"fex-row flex items-center space-x-2 py-4 md:px-8 mmd:px-4",style:{backgroundColor:"#FFEBE1",borderBottom:"1px solid #FFD4B8"},children:[(0,i.jsx)(a.A,{className:"h-6 w-6",style:{color:"#8B2E00"}}),(0,i.jsx)(n.A,{className:"font-medium",style:{color:"#8B2E00"},children:e.message})]},e.id))})},f=e=>{let{title:t,children:l,banner:a,disableGutters:s,header:o,footer:c,mainClassName:m,containerClassName:u,ignoreMaxWidth:f,pageBackgroun
1dColor:x}=e;return(0,i.jsxs)("div",{className:(0,r.cn)("flex min-h-screen flex-col","primary"===x&&"bg-primary","secondary"===x&&"bg-secondary"),children:[(0,i.jsx)(h,{}),(0,i.jsx)("header",{className:"".concat(d().hideOnPrint," contents"),children:o}),(0,i.jsxs)("main",{id:"main-content",className:(0,r.cn)("flex flex-grow flex-col",m),children:[a,(0,i.jsxs)(p,{ignoreMaxWidth:f,disableGutters:!!f||s,className:(0,r.cn)("flex-grow",u),children:[t&&(0,i.jsx)(n.A,{variant:"h2",className:"mb-6 mt-10 text-3xl",children:t}),l]})]}),c]})}},20975:(e,t,l)=>{"use strict";l.d(t,{A:()=>m});var i=l(78488),r=l(26011),a=l(95649),n=l(32833),s=l(59174),o=l(43755),d=l(42155),c=l.n(d);l(81204);let m=e=>{let{id:t,title:l,ariaName:d,children:m,accordionDetailsClassName:u}=e;return(0,i.jsxs)(a.A,{id:t,variant:"outlined",className:"mt-4 rounded-md",defaultExpanded:!0,sx:{"& .MuiAccordionSummary-root":{borderRadius:"5px"},"& .Mui-expanded":{borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},"&::before":{height:"0px"}},children:[(0,i.jsx)(n.A,{expandIcon:(0,i.jsx)(r.A,{}),"aria-controls":"".concat(d,"-content"),id:"".concat(d,"-header"),className:"border-b-1 border-[#D4D4D4] bg-[#F4F5FF]",children:(0,i.jsx)(s.A,{component:"h2",className:"text-18 font-medium",children:l})}),(0,i.jsx)(o.A,{className:c()(u,"p-4 md:p-8"),children:m})]})}},31366:(e,t,l)=>{"use strict";var i=l(61576);t.A=void 0;var r=i(l(23691)),a=l(78488);t.A=(0,r.default)((0,a.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDownOutlined")},32945:(e,t,l)=>{"use strict";var i=l(61576);t.A=void 0;var r=i(l(23691)),a=l(78488);t.A=(0,r.default)((0,a.jsx)("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2m0 14H4v-6h16zm0-10H4V6h16z"}),"CreditCard")},33193:(e,t,l)=>{"use strict";var i=l(61576);t.A=void 0;var r=i(l(23691)),a=l(78488);t.A=(0,r.default)((0,a.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu")},34776:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/[org]/registration/checkout",function(){return l(78166)}])},38200:(e,t,l)=>{"use strict";l.d(t,{P:()=>s,d:()=>n});var i=l(45738),r=l(72788),a=l(1599),n=function(e){return e.AccountDetails="accountDetails",e.AdditionalMembershipDetails="additionalMembershipDetails",e.BoatCommercialAccountDetails="boatCommercialAccountDetails",e.Disclaimers="disclaimers",e.Documents="documents",e.SchemaForms="schema-forms",e.PaymentDetails="paymentDetails",e.BillingDetails="billingDetails",e}({});async function s(e,t,l,n){var s,o;let{firstName:d,lastName:c}=(0,i.F8S)(l.name),m={first_name:d,last_name:c,phone_number:l.phone_number};n&&(m.is_low_income=l.is_low_income),await a.A.client.mutate({mutation:r.soQ,variables:{user_id:e,object:m}}),await a.A.client.mutate({mutation:r.eTy,variables:{object:{id:t,address_line_1:l.address_line_1,address_line_2:l.address_line_2,administrative_area:l.administrative_area,country:l.country,locality:l.locality,postal_code:l.postal_code,latitude:null!=(s=l.latitude)?s:null,longitude:null!=(o=l.longitude)?o:null,user_id:e,type:r.Fyb.Physical}}})}},39240:(e,t,l)=>{"use strict";var i=l(61576);t.A=void 0;var r=i(l(23691)),a=l(78488);t.A=(0,r.default)((0,a.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutlineOutlined")},44197:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});var i=l(78488),r=l(26209),a=l(81204),n=l(88018);let s=a.forwardRef((e,t)=>{let{href:l}=e,a="string"==typeof l&&/^\//.test(l);return(0,i.jsx)(r.A,{component:a?n.A:l?"a":"button",ref:t,...e})})},44924:(e,t,l)=>{"use strict";var i=l(61576);t.A=void 0;var r=i(l(23691)),a=l(78488);t.A=(0,r.default)((0,a.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined")},49921:(e,t,l)=>{"use strict";l.d(t,{$:()=>n,d:()=>a});var i=l(3212),r=l(24846);function a(e){return{feeCents:e.fee_cents,feeType:e.fee_type}}function n(e){let{response:t,getNameForLineItem:l,getDescriptionForLineItem:n}=e;return{lineItems:(0,i.oE)(t.line_items.map(e=>{var i,a;return e.household_member_id?{originalPriceCents:e.original_price_cents,appliedModifiers:null!=(i=e.applied_modifiers)?i:void 0,priceCents:e.price_cents,name:null==l?void 0:l(e),description:null==n?void 0:n(e),householdMemberId:e.household_member_id,membershipTierId:null!=(a=e.membership_tier_id)?a:void 0,key:e.membership_tier_id?"".concat(e.household_member_id,":").concat(e.membership_tier_id):e.household_member_id,priceGroupType:e.price_group_type}:(r.A.error("Missing household member ID in registration price evaluation response line item",e,t),null)})),fees:t.fees.map(a),subtotalPriceCents:t.subtotal_price_cents,totalPriceCents:t.total_price_cents}}},52875:(e,t,l)=>{"use strict";l.d(t,{A:()=>a});var i=l(72788),r=l(3212);let a=function(e){var t;let{householdMemberMediaJunctions:a}=function(e,t){let{data:r,refetch:a,loading:n}=(0,i.aps)({variables:{where:{household_member_id:{_eq:e}},order_by:void 0},onError:e=>{l.g.console.error("Unable to fetch household member media junctions.",e)}
1,fetchPolicy:"network-only"});return{householdMemberMediaJunctions:null==r?void 0:r.household_member_media_junction,refetchHouseholdMemberMediaJunctions:a,loadingHouseholdMemberMediaJunctions:n}}(e.id);return(0,r.oE)(null!=(t=null==a?void 0:a.map(e=>e.media_info))?t:[])}},61135:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var i=l(39457),r=l(90132),a=l(40418);function n(e,t){(0,a.A)(2,arguments);var l=(0,i.A)(t);return(0,r.A)(e,-l)}},61277:(e,t,l)=>{"use strict";l.d(t,{W:()=>s,t:()=>n});var i=l(60766),r=l(72788),a=l(68513);function n(){var e;let t=(0,i.d4)(a.Cf),{data:l,refetch:n,loading:s}=(0,r.izi)({variables:{organization_id:t},fetchPolicy:"network-only"});return{notifications:null!=(e=null==l?void 0:l.global_application_notifications)?e:[],refetchNotifications:n,loadingNotifications:s}}function s(){var e;let t=(0,i.d4)(a.Cf),{data:l,refetch:n,loading:s}=(0,r.nhi)({variables:{organization_id:t},fetchPolicy:"network-only"});return{notifications:null!=(e=null==l?void 0:l.global_application_notifications)?e:[],refetchNotifications:n,loadingNotifications:s}}},62522:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var i=l(78488),r=l(94589),a=l(59174);l(81204);let n=e=>{let{member:t}=e;return(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)(r.A,{className:"text-20 text-[#5B5757]"}),(0,i.jsxs)(a.A,{className:"ml-2 text-16",children:[t.first_name," ",t.last_name]})]})}},66133:(e,t,l)=>{"use strict";l.d(t,{N:()=>a});var i=l(74308),r=l(69060);function a(){let e=(0,i.A)();return(0,r.A)(e.breakpoints.down("md"),{noSsr:!0})}},77012:(e,t,l)=>{"use strict";l.d(t,{G:()=>d});var i=l(61135),r=l(81204),a=l(72788),n=l(68513),s=l(1625),o=l(50596);let d=()=>{let{userData:e,household_id:t}=(0,o.u)(),l=(0,n.hV)(),[d,c]=(0,r.useState)(null),{householdMembers:m,loadingHouseholdMembers:u}=(0,s.b)(null!=t?t:""),[p]=(0,a.Z$k)({fetchPolicy:"network-only"});(0,r.useEffect)(()=>{u||c(m.find(e=>e.privilege_type===a.k1M.HeadOfHousehold)||null)},[u]);let h=(0,r.useCallback)(async r=>{var n;if(d||u||!e)return null;let{firstName:s,lastName:o,phoneNumber:m}=r,h=(null==(n=(await p({variables:{object:{privilege_type:a.k1M.HeadOfHousehold,household_id:t,organization_id:l,first_name:s,last_name:o,date_of_birth:(0,i.A)(new Date,21).toISOString(),gender:a.pV7.None,phone_number:m,email:e.email}}})).data)?void 0:n.insert_household_member_one)||null;return c(h),h},[u,e,l]);return{headOfHousehold:d,createHeadOfHousehold:h}}},78166:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>to});var i=l(78488),r=l(17563),a=l(81204),n=l(35959),s=l(13130),o=l(48339),d=l(57179),c=l(26154),m=l(42155),u=l.n(m),p=l(72788),h=l(63378),f=l(26287),x=l(23268),v=l(27833),_=l(33702),y=l(33237),g=l(48113);function b(e){let{address:t,loadingAddress:l,userData:i,loadingUserData:r}=e,n=(0,y.mN)({mode:"onChange",reValidateMode:"onChange",shouldUnregister:!1,defaultValues:{}}),s=n.reset,o=n.formState.isDirty;return(0,a.useEffect)(()=>{let e=(null==i?void 0:i.first_name)&&(null==i?void 0:i.last_name)?(0,g.G)(i):"";if(!r&&!l&&!o){var a,n,d,c,m,u,p,h,f,x;s({name:e,email:null!=(a=null==i?void 0:i.email)?a:"",address_line_1:null!=(n=null==t?void 0:t.address_line_1)?n:"",address_line_2:null!=(d=null==t?void 0:t.address_line_2)?d:"",country:null!=(c=null==t?void 0:t.country)?c:"us",postal_code:null!=(m=null==t?void 0:t.postal_code)?m:"",administrative_area:null!=(u=null==t?void 0:t.administrative_area)?u:"",locality:null!=(p=null==t?void 0:t.locality)?p:"",phone_number:null!=(h=null==i?void 0:i.phone_number)?h:"",is_low_income:void 0,latitude:null!=(f=null==t?void 0:t.latitude)?f:null,longitude:null!=(x=null==t?void 0:t.longitude)?x:null})}},[t,i,l,r,s,o]),n}var j=l(50596),A=l(38688),N=l(26458),w=l(41312),I=l(38200),S=l(24846),C=l(51138),E=l(64722),P=l(81881),D=l(59174),k=l(67214),M=l(85585),B=l(35633),F=l(45439),O=l(20975);let R=e=>{var t,l;let{form:r,title:n,showAgencyAndTitle:s,id:d,collectLowIncomeInformation:m=!1}=e,[u,p]=(0,a.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(O.A,{id:null!=d?d:I.d.AccountDetails,title:null!=n?n:"Confirm account details",ariaName:null!=n?n:"confirm-account-details",children:(0,i.jsx)(c.Ay,{container:!0,spacing:2,children:(0,i.jsxs)(y.Op,{...r,children:[(null==(t=r.formState.errors.root)?void 0:t.message)&&(0,i.jsx)(o.vM.Negative,{label:null==(l=r.formState.errors.root)?void 0:l.message,className:"ml-4 w-full"}),(0,i.jsx)(B.Ay,{lockEmail:!0!==s,showAgencyAndTitle:s,showNameAndEmail:!0,showPhoneNumber:!0,showAddressLine2:!0,fieldVariant:"outlined"}),m&&(0,i.jsxs)("div",{className:"flex flex-col p-4 text-left",children:[(0,i.jsx)(F.iA,{name:"is_low_income",label:"My household qualifies for the Assistance Qualified Discount"}),(0,i.jsx)(P.A,{className:"ml-6 w-fit min-w-0",onClick:()=>p(!0),children:(0,i.jsx)(D.A,{className:"cursor-pointer text-14 text-brand-primary underline underline-offset-4",children:"How do I know if I qualify?"})})]})]})})}),(0,i.jsx)(k.A,{open:u,onClose:()=>{p(!1)},children:(0,i.jsxs)(k.A,{open:u,onClose:()=>p(!1),PaperProps:{sx:{borderRadius:2,padding:0,maxWidth:600}},children:[(0,i.jsx)(o.c7,{title:"Assistance Qualified Discount Requirements",onClose:()=>p(!1)}),(0,i.jsx)(M.A,{className:"space-y-8 px-8 py-6",children:(0,i.jsx)(D.A,{className:"my-6 text-16",children:"Families on any of the following low income programs qualify for the discounted fees: SNAP benefits, Free/reduced school lunch (for schools that require you to qualify for free/reduced lunch and provide a qualification letter), TANF, AHCCCS, Section 8, foster children, SSI or SSD, CHIP (Childs Health Insurance Program)."})})]})})]})};var T=l(7018),Y=l(60),H=l(44098),L=l(10907),z=l(60766),V=l(65382),q=l(49191),U=l(84975),$=l(95749),W=l(1599),G=l(65925),Q=l(27685),Z=l(68513),J=l(73045),K=l(3212),X=l(15410),ee=l(37650),et=l(80553),el=l(32447);let ei=e=>"You must reside in the ".concat(e," area to continue."),er="There are issues with your cart that must be addressed before placing this order",ea=e=>{var t,l;let{buttonText:n,userData:s,className:d,membershipTier:c,isResidentPricing:m,accountForm:f,isFreeCheckout:x,getPaymentMethodIdOnSubmit:v,address:_,membershipRegistrants:y,getSelectedOptInModifiersForHHMember:g,discountCode:b}=e,j=(0,z.wA)(),E=(0,q.Z5)(),P=(0,h.qN)(),D=(0,G.ME)(),[k,M]=(0,a.useState)(!1),B=(0,r.useRouter)(),{createOrgRoute:F}=(0,U.x)(),O=(0,Z.hV)(),R=(0,A.t$)(),T=e=>{f.setError("root",{message:e})},Y=c.membership_booking_info.resident_pricing_option,H=null!=(l=null==(t=E.settings)?void 0:t.shouldBypassMembershipResidencyValidation)&&l,ea=c.membership_booking_info.associated_membership_booking_info_price_modifiers.map(e=>e.associated_price_modifier),[en,{loading:es}]=(0,p.f4x)({...W.D,onCompleted:e=>{var t;if(!(null==(t=e.insertMembershipBooking)?void 0:t.membership_bookings.length))throw Error("No membership booking data found after succesfully inserting new booking for membership tier ID: ".concat(c.id))}}),eo=async()=>{let e;if(k)return;if(M(!0),!await f.trigger()){T(er),M(!1),(0,et.hT)(I.d.AccountDetails);return}let t=ea.filter(e=>{let{condition:t}=e;return(null==t?void 0:t.type)===L.Zy.RESIDES_IN});if(t.length>0)for(let e of t){let{data:t}=L.E8.safeParse(e.condition);if(null==t?void 0:t.residency_zones){for(let e of t.residency_zones)if(!(0,J.f3)(f.getValues(),{resident_zip_codes:e.resident_zip_codes,resident_area:e.resident_area})){T(ei(e.zone_name)),M(!1),(0,et.hT)(I.d.AccountDetails);return}}}let l=(0,el.q)({user:s,organization:E}),i=(0,J.f3)(f.getValues(),E);if(!l&&Y&&m&&!H&&!i){T("You must provide a resident address to continue."),M(!1),(0,et.hT)(I.d.AccountDetails);return}let r=(0,C.AI)(c),a=(0,K.oE)(r.map($.uP));if(!(0,ee.Np)(a,D,y)){T("Please submit all required files and disclaimers before checking out."),M(!1);return}
1if(!x&&!(e=await v())){T(er),M(!1),(0,et.hT)(I.d.PaymentDetails);return}let{membership_booking_info_id:n,start_date_trigger:o,custom_start_date:d,end_date_trigger:u,custom_end_date:h,parent_membership:A,term_length_days:z,term_length_months:q}=c,U={organization_id:O,purchasing_user_id:s.id,payment_status:p.QLe.PaidInFull,stripe_payment_method_id:x?void 0:e,order_origin:p.JwZ.Online,discount_code:b,membership_registration_requests:y.map(e=>{let{id:t,type:l}=e;return{membership_booking_info_id:n,membership_id:A.id,membership_tier_id:c.id,end_date_trigger:u,custom_end_date:h,start_date_trigger:o,custom_start_date:d,registration_status:p.J6I.Active,is_resident_pricing:m,term_length_days:z,term_length_months:q,form_submission_inputs:D.filter(e=>e.registrantId===t).map(e=>(0,$.br)(e.formSubmission)),...c.membership_group.group_type===p.TJy.Household&&{household_id:s.household_id},...c.membership_group.for_household_member&&l==w.YJ.HouseholdMember&&{household_member_id:t},selected_opt_in_modifiers:g(t)}})};try{await en({fetchPolicy:"network-only",variables:{input_object:U}}),await (0,I.P)(R,null==_?void 0:_.id,f.getValues(),!1),M(!1),j((0,Q.g0)({title:"Thank you for registering with us!",message:"Your transaction has been submitted! Please check your email for a confirmation message.",approveLabel:"View my memberships",cancelLabel:"Go back home",allowCancel:!0,fullWidth:!1,disableClose:!0,onApprove:()=>{B.push(F("/my-account/memberships")),j((0,N.Lq)()),j((0,G.HZ)())},onCancel:()=>{B.push(F("/"))}}))}catch(e){(0,X._r)(e=>{let{error:t,errorCode:l}=e;if(l===X.oY){var i;P((null==(i=t.message)?void 0:i.trim())||"Your card was declined. Try another card.")}else S.A.error("Failed to process membership booking:",t),P(V.h1)})(e),M(!1)}};return(0,i.jsx)(o.nO.Primary,{loading:k,disabled:!(!es&&1),onClick:eo,className:u()("ml-auto mr-12 flex px-8 py-3",d),children:n})};var en=l(30803),es=l(97860);let eo=e=>{var t,l,r,n;let{membershipTierId:s,isResidentPricing:m}=e,y=(0,x.o)(),P=(0,A.t$)(),D=(0,h.qN)(),[k,M]=(0,a.useState)(),[B,F]=(0,a.useState)(),[O,z]=(0,a.useState)(!1),{userData:V,loadingUserData:q}=(0,j.u)(),{address:U,loadingAddress:$}=(0,_.i)(),W=(0,N.hR)(),{membershipTier:G,loadingMembershipTier:Q}=(0,f.J)(s),Z=G?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=arguments.length>2?arguments[2]:void 0;return l.membership_group.for_household_member?t.map(e=>({id:e,type:w.YJ.HouseholdMember})):e?[{id:e,type:w.YJ.User}]:(S.A.error("No user ID or household member IDs found for membership checkout"),[])}(null==V?void 0:V.id,W,G):[],J=b({userData:V,loadingUserData:q,address:U,loadingAddress:$}),K=(0,A.Aq)(),{data:X,loading:ee}=(0,p.Q34)({skip:K.loading,variables:{where:{id:{_in:W}},limit:null!=(l=null==W?void 0:W.length)?l:0}}),et=null!=(r=null==X?void 0:X.household_member)?r:[],{allOptInFees:el,allOptInDiscounts:ei,selectedDiscountId:er,setSelectedDiscountId:eo,getFeeQuantity:ed,updateFeeQuantity:ec,getSelectedModifiers:em}=function(e){let{membershipTier:t,headOfHouseholdId:l}=e,[i,r]=(0,a.useState)(),[n,s]=(0,a.useState)({}),{allOptInFees:o,allOptInDiscounts:d}=(0,a.useMemo)(()=>{var e;return null!=(e=null==t?void 0:t.membership_booking_info.associated_membership_booking_info_price_modifiers.reduce((e,t)=>{let{allOptInFees:l,allOptInDiscounts:i}=e,{associated_price_modifier:r}=t,a=L.Oy.safeParse(r.condition);return a.success&&a.data.type===L.Zy.OPT_IN&&(r.type===p.iaS.Fee?l.push({...r,condition:a.data,type:r.type}):r.type===p.iaS.Discount&&i.push({...r,condition:a.data,type:r.type})),{allOptInFees:l,allOptInDiscounts:i}},{allOptInFees:[],allOptInDiscounts:[]}))?e:{allOptInFees:[],allOptInDiscounts:[]}},[t]);return{allOptInFees:o,allOptInDiscounts:d,selectedDiscountId:i,setSelectedDiscountId:r,getFeeQuantity:e=>{var t;let{householdMemberId:l,feeId:i}=e;return null==(t=n[l])?void 0:t[i]},updateFeeQuantity:(0,a.useCallback)(e=>{let{householdMemberId:t,feeId:l,quantity:i}=e;s(e=>({...e,[t]:{...e[t],[l]:i}}))},[]),getSelectedModifiers:e=>{var t;return[...Object.entries(null!=(t=n[e])?t:{}).filter(e=>{let[t,l]=e;return!!l}).map(e=>{let[t,l]=e;return{id:t,quantity:l}}),...e===l&&i?[{id:i}]:[]]}}}({membershipTier:G,headOfHouseholdId:null!=(n=null==(t=et.find(e=>e.privilege_type===p.k1M.HeadOfHousehold))?void 0:t.id)?n:null==W?void 0:W[0]}),{priceBreakdown:eu,isShowingPreviousPricePreview:ep}=(0,v.l)({householdMembersAndBookingInputs:et.map(e=>({householdMember:e,selectedOptInModifiers:em(e.id)})),membershipTier:G,stripePaymentMethodId:k,isNoCost:!1,isCash:!1,isCheck:!1,isResident:m,userId:P,discountCode:B});if(!V||!G||Q)return(0,i.jsx)("div",{className:"flex h-[calc(100vh_-_68px)] w-full items-center justify-center",children:(0,i.jsx)(d.A,{size:64})});let eh=(null==eu?void 0:eu.subtotalPriceCents)===0,ef=!!B&&!!(null==eu?void 0:eu.lineItems.some(e=>{var t;return null==(t=e.appliedModifiers)?void 0:t.some(e=>e.discount_code===B)})),ex=!!B&&!ep&&!!eu&&!ef,ev=(0,C.AI)(G),e_=Z.map(e=>({...e,name:(e=>{if(e.type!==w.YJ.HouseholdMember)return(0,g.G)(V);{let t=et.find(t=>
1t.id===e.id);return t||ee||S.A.error("Could not find household member data for ID ".concat(e.id)),t?(0,g.G)(t):"N/A"}})(e)}));return(0,i.jsxs)("div",{className:"w-full bg-white",children:[(0,i.jsxs)(c.Ay,{container:!0,children:[(0,i.jsxs)(c.Ay,{item:!0,md:8,xs:12,className:"mb-8 px-4 pb-12 pt-8 sm:mb-0 md:h-[calc(100vh_-_68px)] md:overflow-scroll md:pl-12 md:pr-24 xl:pr-48",children:[(0,i.jsx)(o.EY.TitleLarge,{children:"Checkout"}),(0,i.jsx)(R,{form:J}),(0,i.jsxs)("div",{className:"mt-14 flex flex-col gap-14",children:[el.length>0&&(0,i.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,i.jsx)(o.EY.BodyLargeSemiBold,{children:"Membership add-ons"}),(0,i.jsx)(en.U,{householdMembers:et,allOptInFees:el,getFeeQuantity:ed,onQuantityChange:ec})]}),!!ev.length&&(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(o.EY.BodyLargeSemiBold,{children:"Documents"}),(0,i.jsx)(E.W,{formProps:{membershipForms:ev,type:"memberships"},registrants:e_})]}),!eh&&(0,i.jsxs)("div",{className:"flex flex-col items-start gap-4",id:I.d.PaymentDetails,children:[(0,i.jsx)(o.EY.BodyLargeSemiBold,{children:"Payment method"}),(0,i.jsx)(H.RU,{purchasingUserId:P,selectedPaymentMethodOption:k?{id:k,type:p.QLU.StripeManualEntry}:void 0,onPaymentMethodOptionChange:e=>{let{id:t,type:l}=e;l===p.QLU.StripeManualEntry&&M(t)}}),(0,i.jsx)(es.l,{allOptInDiscounts:ei,currentDiscountId:er,onApply:e=>eo(e)})]})]})]}),(0,i.jsxs)(c.Ay,{item:!0,md:4,xs:12,className:u()("right-0 w-full border-l-1 border-l-[#D4D4D4] pt-8 md:fixed md:h-[calc(100vh_-_68px)]",{"my-12":y}),children:[(0,i.jsx)("div",{className:"h-[calc(100%_-_88px)] overflow-scroll",children:eu&&(0,i.jsxs)("div",{className:"flex flex-col gap-10 px-6 pb-6",children:[(0,i.jsx)("div",{className:"flex flex-col gap-4",children:(0,i.jsx)(o.EY.TitleSmall,{fontSize:"24px",children:"Order Summary"})}),(0,i.jsx)(Y.X,{householdMembers:et,membershipTier:G,priceBreakdown:eu,isModifierDeletable:e=>e===er,onModifierDelete:()=>eo(void 0)}),ex&&(0,i.jsxs)(o.EY.BodySmall,{color:"secondary",children:["Code ",B," was accepted, but it doesn't apply to this membership tier. Any applicable discount would appear in the order summary above."]}),(0,i.jsxs)("div",{className:"flex items-center gap-4",children:[(0,i.jsx)(o.$n.Tertiary,{onClick:()=>z(!0),children:B?"Change discount code":"Have a discount code?"}),B&&(0,i.jsx)(o.$n.Tertiary,{onClick:()=>F(void 0),children:"Remove code"})]})]})}),(0,i.jsx)("div",{className:"flex h-[88px] items-center border-t-1 border-t-[#D4D4D4]",children:(0,i.jsx)(ea,{buttonText:"Place order",membershipTier:G,userData:V,isResidentPricing:m,accountForm:J,isFreeCheckout:eh,discountCode:B,getPaymentMethodIdOnSubmit:async()=>k||void D("No payment method selected"),address:U,membershipRegistrants:Z,getSelectedOptInModifiersForHHMember:e=>em(e)})})]})]}),(0,i.jsx)(T.d$,{open:O,onClose:()=>z(!1),onDiscountApply:e=>{F(e),z(!1)}})]})};var ed=l(45738),ec=l(89794),em=l(44728),eu=l.n(em),ep=l(40367),eh=l(33384),ef=l(1625),ex=l(65754);ex.Ik({addonOptions:ex.YO(ex.Ik({price_modifier_id:ex.Yj(),quantity:ex.ai()}))});var ev=l(19712),e_=l(45075),ey=l(73593),eg=l(9679),eb=l(72848),ej=l(38422),eA=l(99015);let eN=e=>{let{optInFee:t,quantity:l,onQuantityChange:r}=e,a=t.id,n=l>0,s=L.Oy.safeParse(null==t?void 0:t.condition),d=s.success&&s.data.quantity_based,c=e=>{e>=0&&r(a,e)};return(0,i.jsxs)("div",{className:"flex flex-col gap-2 p-2",children:[(0,i.jsx)(eb.A,{control:(0,i.jsx)(ej.A,{checked:n,onChange:e=>{r(a,+!!e.target.checked)}}),label:(0,i.jsxs)("div",{className:"flex flex-col items-start",children:[(0,i.jsx)(o.EY.BodySmall,{children:"".concat(t.name," (").concat((0,ey.$5)(t.amount),")")}),(0,i.jsx)(o.EY.BodySmall,{color:"secondary",children:t.description})]})}),n&&d&&(0,i.jsxs)("div",{className:"flex-start flex flex-col gap-2 pl-8",children:[(0,i.jsx)(o.EY.BodySmall,{children:"Quantity:"}),(0,i.jsx)(eA.B,{value:l,onChange:e=>{if(""===e)return void c(0);c(Number(e))},onIncrement:()=>{c(l+1)},onDecrement:()=>{c(l-1)},isDecrementDisabled:l<=1,descriptor:"",fieldProps:{variant:"filled",InputProps:{classes:{input:"p-0 text-[#767171] text-center",root:"p-0"}},style:{textAlign:"center",width:90,padding:0}}})]})]})},ew=e=>{let{optInFees:t,selectedAddonOptions:l,handleAddonOptionsChange:r}=e,n=(0,a.useMemo)(()=>l.reduce((e,t)=>
1{let{price_modifier_id:l,quantity:i}=t;return e[l]=i,e},{}),[l]),s=(e,t)=>{t>=0&&r(Object.entries({...n,[e]:t}).filter(e=>{let[,t]=e;return t>0}).map(e=>{let[t,l]=e;return{price_modifier_id:t,quantity:l}}))};return(0,i.jsx)(O.A,{id:I.d.PaymentDetails,title:"Add-ons",ariaName:"opt-in-fees",accordionDetailsClassName:"px-0 py-0",children:(0,i.jsx)("div",{className:"flex flex-col gap-4",children:null==t?void 0:t.map(e=>{let t=e.id,l=n[t]||0;return(0,i.jsx)(eN,{optInFee:e,quantity:l,onQuantityChange:s},t)})})})};var eI=l(92754),eS=l(88),eC=l(98737),eE=l.n(eC),eP=l(43569),eD=l(27143),ek=l(57636);let eM="full",eB=(e,t,l)=>{var i;let r=e.installments,a=null!=(i=null==r?void 0:r.length)?i:0,n=eF(null==r?void 0:r[0]);return"Pay ".concat(a," payments of ").concat((0,ey.$5)(Math.floor(t/(a||1)))," ").concat(l?"":"starting ".concat(e.first_installment_due_at_checkout?"today":"on ".concat(n)))},eF=e=>e?eS.c9.fromISO(e.due_date,{zone:"utc"}).toFormat("M/dd/yyyy"):"",eO=e=>{var t,l;let{cartItem:r}=e,{data:a}=(0,p.Rd6)({variables:{programId:r.programId,programGroupId:r.programGroupId,registrableUnitId:r.registrableUnitId,householdMemberIds:r.selectedHouseholdMemberIds}});return(0,i.jsx)("div",{className:"flex items-center gap-4",children:(0,i.jsx)(o.EY.BodySmall,{children:"".concat(null==a||null==(t=a.program)?void 0:t.name," - ").concat(null==a||null==(l=a.registrableUnit)?void 0:l.name)})})},eR=e=>{var t;let{cartItem:l,unavailableRegistrableUnitIds:r}=e,{data:a}=(0,p.Q98)({variables:{programId:l.programId,householdMemberId:l.selectedHouseholdMemberId,registrableUnitIds:l.registrableUnits.map(e=>e.id)}}),n=null==a?void 0:a.registrableUnits.filter(e=>null==r?void 0:r.includes(e.id));return(0,i.jsx)("div",{className:"flex items-center gap-4",children:(0,i.jsxs)(o.EY.BodySmall,{children:[null==a||null==(t=a.program)?void 0:t.name," -"," ",null==n?void 0:n.map(e=>e.name).join(", ")]})})},eT=e=>{var t;let{cartItem:l,unavailableRegistrableUnitIds:r}=e,{data:a}=(0,p.yrm)({variables:{programId:l.programId,registrableUnitIds:l.registrableUnits.map(e=>e.id)}}),n=null==a?void 0:a.registrableUnits.filter(e=>null==r?void 0:r.includes(e.id));return(0,i.jsx)("div",{className:"flex items-center gap-4",children:(0,i.jsxs)(o.EY.BodySmall,{children:[null==a||null==(t=a.program)?void 0:t.name," -"," ",null==n?void 0:n.map(e=>e.name).join(", ")]})})},eY=e=>{var t,l,r;let{paymentPlan:n,price:s,unavailableCartItems:d,unavailableRegistrableUnitIdsByCartItemId:c}=e,m=(0,z.wA)(),[u,h]=(0,a.useState)(!1),f=(e,t)=>{e&&"preventDefault"in e&&(e.preventDefault(),e.stopPropagation()),h(!1)};if(!n.interval_frequency||!n.interval_frequency_unit)return null;let x=(0,ey.$5)(((e,t)=>{var l,i;return Math.floor(t/(null!=(i=null==(l=e.installments)?void 0:l.length)?i:1))})(n,s)),v=n.installments,_=null!=(l=null==v?void 0:v.length)?l:0,y=(0,ek.kB)(n.interval_frequency,_),g=(0,ek.hS)(n.interval_frequency_unit).toLowerCase(),b="unavailable"===n.type,j=b&&n.unavailability_reason===p.Zy2.IneligibleRegistrableUnit;return(0,i.jsxs)("div",{children:[(0,i.jsx)(o.EY.BodySmallSemiBold,{className:"cursor-pointer text-brand-primary",onClick:e=>{e.preventDefault(),e.stopPropagation(),h(!0)},children:b?"Why is this unavailable?":"Details"}),(0,i.jsx)(o.lG,{open:u,onClose:f,headerProps:{title:b?"Unavailable Payment Plan":"Payment Plan Details",onClose:f},contentProps:{content:(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[j&&(0,i.jsxs)("div",{className:"mb-4 flex flex-col gap-2",children:[(0,i.jsx)(o.EY.BodySmall,{children:"This payment plan is currently unavailable because at least one activity in your cart does not support it or you are registering for a waitlist."}),(0,i.jsx)(o.EY.BodySmall,{children:"You can remove the following from this cart to enable this payment plan."}),!!(null==d?void 0:d.length)&&(0,i.jsx)("ul",{className:"flex list-disc flex-col gap-2 pl-4",children:d.map(e=>{let t;return t=e.programType===p.j_6.Camp?(0,i.jsx)(eR,{cartItem:e,unavailableRegistrableUnitIds:null==c?void 0:c[e.id]}):e.programType===p.j_6.TicketedEvent?(0,i.jsx)(eT,{cartItem:e,unavailableRegistrableUnitIds:null==c?void 0:c[e.id]}):(0,i.jsx)(eO,{cartItem:e}),(0,i.jsx)("li",{children:t},e.id)})})]}),!b&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(o.EY.BodyLargeSemiBold,{children:["Your card will be automatically charged"," ",x," every"," ",1!==n.interval_frequency&&"".concat(n.interval_frequency," "),eE()(g,n.interval_frequency)," ","for ",y," ",eE()(g,y)]}),(0,i.jsx)("ul",{children:null==(t=n.installments)?void 0:t.map((e,t)=>(0,i.jsxs)("li",{children:["Payment ",t+1,":"," ",eS.c9.fromISO(e.due_date).startOf("day").toISO()===eS.c9.now().startOf("day").toISO()?"Today":eF(e)]},e.due_date))})]})]})},footerProps:{confirmButtonText:"Done",onConfirm:f,onCancel:void 0,alignment:j?"between":void 0,onTertiaryButtonClick:j?()=>{var e,t;let l=null==d?void 0:d.filter(e=>e.programType===p.j_6.Class),i=null==d?void 0:d.filter(e=>e.programType!==p.j_6.Class),r=[(0,ev.G$)(null!=(e=null==l?void 0:l.map(e=>e.id))?e:[]),...null!=(t=null==i?void 0:i.map(e=>{var t;return(0,ev.xz)({cartItemId:e.id,registrableUnitIds:null!=(t=null==c?void 0:c[e.id])?t:[]})}))?t:[]];m((0,eP.y)(r))}:void 0,tertiaryButtonText:j?"Remove ".concat(eE()("item",null!=(r=null==d?void 0:d.length)?r:0)," from cart"):void 0,tertiaryButtonIntent:j?"danger":void 0}})]})},eH=e=>{var t,l;let{cartItems:r,priceComponents:n,availablePaymentPlans:s,unavailablePaymentPlans:d,selectedPaymentPlanId:c,setSelectedPaymentPlanId:m}=e,u=(0,a.useMemo)(()=>{let e={};return d.forEach(t=>{var l;e[t.payment_plan_configuration_id]=null!=(l=null==r?void 0:r.filter(e=>(0,eD.EC)(e)?t.unavailable_registrable_unit_ids.includes(e.registrableUnitId):e.registrableUnits.some(e=>t.unavailable_registrable_unit_ids.includes(e.id))))?l:[]}),e},[d,r]),h=(0,a.useMemo)(()=>{let e={};return Object.values(u).forEach(t=>{t.forEach(t=>{if((0,eD.EC)(t))e[t.id]=[t.registrableUnitId];else{let l=t.registrableUnits,i=d.flatMap(e=>e.unavailable_registrable_unit_ids),r=l.filter(e=>i.includes(e.id));e[t.id]=r.map(e=>e.id)}})}),e},[u,d]),f=n.order_subtotal,x=[...s].sort((e,t)=>
1{var l,i,r,a;return(null!=(r=null==(l=e.installments)?void 0:l.length)?r:0)-(null!=(a=null==(i=t.installments)?void 0:i.length)?a:0)}),v=[...d].sort((e,t)=>{var l,i,r,a;return(null!=(r=null==(l=e.installments)?void 0:l.length)?r:0)-(null!=(a=null==(i=t.installments)?void 0:i.length)?a:0)}),_=[{value:eM,label:"Pay in full (".concat((0,ey.$5)(f),")")},...null!=(t=x.map(e=>({value:e.payment_plan_configuration_id,label:eB(e,f),description:(0,i.jsx)(eY,{paymentPlan:{...e,type:"available"},price:f})})))?t:[],...null!=(l=v.filter(e=>e.unavailability_reason===p.Zy2.IneligibleRegistrableUnit).map(e=>({value:e.payment_plan_configuration_id,label:eB(e,f,!0),disabled:!0,description:(0,i.jsx)(eY,{paymentPlan:{...e,type:"unavailable"},price:f,unavailableCartItems:u[e.payment_plan_configuration_id],unavailableRegistrableUnitIdsByCartItemId:h})})))?l:[]];return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(O.A,{id:I.d.PaymentDetails,title:"Payment options",ariaName:"payment-options",children:(0,i.jsx)("div",{className:"flex flex-col gap-12",children:(0,i.jsx)("div",{className:"flex flex-col gap-2",children:(0,i.jsx)(o.b1,{name:"payment-plan-select",label:"Select from available payment plans",shouldHideLabel:!0,horizontalLabelRegion:!0,options:_,value:c||eM,onValueChange:e=>m(e)})})})})})};var eL=l(22908);let ez="VALIDATE_SUBMISSIONS_SNACKBAR";var eV=l(6538),eq=l(5708),eU=l(86806),e$=l(63127),eW=l(82417);let eG=e=>{let{selectedAddonOptions:t,evaluations:l,onDelete:r,className:a}=e,n=(0,e_.Mg)(l,[L.Zy.OPT_IN]);return n.length?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"flex flex-col gap-2 p-6 md:pl-[96px] md:pr-[60px]",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(o.EY.BodySmallBold,{children:"Add ons"}),(0,i.jsx)(e$.A,{className:u()("flex w-full flex-col space-y-8",a),children:n.map(e=>{var l;let a=null==(l=t.find(t=>t.price_modifier_id===e.modifier_id))?void 0:l.quantity;return a?(0,i.jsxs)(eW.Ay,{className:"flex flex-col gap-2 p-0",components:{Root:"div"},children:[(0,i.jsxs)("div",{className:"flex items-end justify-between",children:[(0,i.jsx)(o.EY.BodySmall,{children:e.name}),(0,i.jsx)(eU.A,{role:"button",className:"cursor-pointer text-20 text-secondary",onClick:()=>r(e.modifier_id)})]}),(0,i.jsxs)("div",{className:"flex items-end justify-between",children:[(0,i.jsxs)(o.EY.BodySmall,{children:["Qty: ",a]}),(0,i.jsx)(o.EY.BodySmall,{children:(0,ey.$5)(e.amount_modified)})]})]},e.modifier_id):null})})]})}),(0,i.jsx)(eL.A,{className:"border-low"})]}):null},eQ=e=>{let{evaluations:t,className:l}=e,r=(0,e_.Mg)(t,[L.Zy.ORDER_LEVEL]);return r.length?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"flex flex-col gap-2 p-6 md:pl-[96px] md:pr-[60px]",children:(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)(o.EY.BodySmallBold,{children:"Cart fees"}),(0,i.jsx)(e$.A,{className:u()("flex w-full flex-col space-y-8",l),children:r.map(e=>(0,i.jsx)(eW.Ay,{className:"flex flex-col gap-2 p-0",components:{Root:"div"},children:(0,i.jsxs)("div",{className:"flex items-end justify-between",children:[(0,i.jsx)(o.EY.BodySmall,{children:e.name}),(0,i.jsx)(o.EY.BodySmall,{children:(0,ey.$5)(e.amount_modified)})]})},e.modifier_id))})]})}),(0,i.jsx)(eL.A,{className:"border-low"})]}):null};var eZ=l(15573),eJ=l(77012);function eK(e,t,l,i){return e.every(e=>{let r=t.find(t=>{let{id:l}=t;return l===e.programId}),a=(0,eD.EC)(e)?[e.registrableUnitId]:e.registrableUnits.map(e=>e.id);if(!r)return!0;let n=[];return a.forEach(e=>{let{forms:t}=(0,eV.Vq)(r,e);t.filter(e=>{var t;return(null==(t=e.associated_form_definition)?void 0:t.type)===l&&!e.is_optional_at_checkout}).forEach(e=>{-1===n.findIndex(t=>{var l,i;return(null==(l=t.associated_form_definition)?void 0:l.id)===(null==(i=e.associated_form_definition)?void 0:i.id)})&&n.push(e)})}),!n.length||((0,eD.$v)(e)||(0,eD.Bu)(e)?[e.selectedHouseholdMemberId]:e.selectedHouseholdMemberIds).every(e=>n.every(t=>{var l;return!!(null==i||null==(l=i[e])?void 0:l[t.associated_form_definition.id])}))})}async function eX(e){var t,l,i,r,a,n;let{organizationId:s,userId:o,accountForm:d,paymentMethodId:c,isResident:m,isLowIncome:u,cartItems:h,formSubmissions:f,residency_coords:x,discount_code:v,selectedPaymentPlanId:_,selectedOptInFees:y,presaleCodes:g}=e,b=[];for(let e in f)for(let r in f[e]){let a=f[e][r];(null==(t=a.uploadedDocument)?void 0:t.id)&&b.push({input_type:p.dqc.E
1xistingFamilyMemberDocument,form_definition_id:a.formDefinitionId,program_form_id:a.formId,household_member_id:e,existing_media_info_id:null==(l=a.uploadedDocument)?void 0:l.id});let n=await (0,eV.hZ)(a.formId);if(a.newDocument){let t=a.disclaimerDataUrl?p.dqc.NewGenericDocument:p.dqc.NewFamilyMemberDocument;b.push({input_type:t,program_form_id:a.formId,household_member_id:e,form_definition_id:a.formDefinitionId,media_info:{content_type:a.newDocument.contentType,alt:a.newDocument.alt,storage_url:a.newDocument.tempSignedUrl,index:0,name:a.newDocument.name,description:null==(i=n.associated_form_definition)?void 0:i.name,original_file_name:a.newDocument.originalFileName}})}a.schemaFormData&&b.push({input_type:p.dqc.SchemaFormDocument,form_definition_id:a.formDefinitionId,program_form_id:a.formId,household_member_id:e,schema_form_definition_id:a.schemaFormDefinitionId,schema_form_document:a.schemaFormData})}return{organization_id:s,stripe_payment_method_id:c,cart_items:h.map(eV.$R),form_submissions:b,billing_details:{billing_user_id:o,billing_user_name:d.name,billing_user_email:null!=(r=d.email)?r:"",billing_user_phone_number:null!=(a=d.phone_number)?a:"",billing_user_is_resident:m,billing_user_address_line_1:d.address_line_1,billing_user_address_line_2:d.address_line_2,billing_user_city:d.locality,billing_user_state:null!=(n=d.administrative_area)?n:"",billing_user_postal_code:d.postal_code,billing_user_country:d.country},form_fields:[{field_name:"is_low_income",value:u||d.is_low_income}],residency_coords:x,discount_code:v,selected_opt_in_fees:y,selected_payment_plan_configuration_id:_&&_!==eM?_:void 0,presale_codes:Object.entries(g).map(e=>{let[t,l]=e;return{programId:t,presaleCode:l}})}}let e0=e=>{let{programs:t,userData:l,className:n,startPolling:s,stopPolling:d,accountForm:c,paymentForm:m,optionalFeesForm:f,address:x,collectLowIncomeInformation:v=!1,discount_code:_,selectedPaymentPlanId:y}=e,g=(0,h.qN)(),b=(0,r.useRouter)(),{createOrgRoute:j}=(0,U.x)(),N=(0,z.wA)(),w=(0,z.d4)(ev.wF),S=(0,z.d4)(ev.$B),C=(0,z.d4)(ev.ic),E=(0,Z.hV)(),P=(0,A.t$)(),[D]=(0,p.avA)(),{headOfHousehold:k,createHeadOfHousehold:M}=(0,eJ.G)(),[B,F]=(0,a.useState)(!1);(0,a.useEffect)(()=>()=>{N((0,ev.Sk)(!1))},[N]);let O=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];b.push(j(e)).then(()=>{t&&N((0,ev.Ol)())})},R=async()=>{let e=!0,l=null;return w.some(e=>{var t;return(0,eD.EC)(e)&&(null==(t=e.validationError)?void 0:t.valid)===!1})&&(e=!1),await c.trigger()||(l=null!=l?l:I.d.AccountDetails,e=!1),eK(w,t,p.NRE.Disclaimer,S)||(l=null!=l?l:I.d.Disclaimers,e=!1,N((0,ev.Sk)(!0))),eK(w,t,p.NRE.File,S)||(l=null!=l?l:I.d.Documents,e=!1,N((0,ev.Sk)(!0))),eK(w,t,p.NRE.SchemaForm,S)||(l=null!=l?l:I.d.SchemaForms,e=!1,N((0,ev.Sk)(!0))),await m.trigger()||(l=null!=l?l:I.d.PaymentDetails,e=!1),{isValid:e,scrollElement:l}},T=async()=>{var e,t;F(!0),d();let i=w,{isValid:r,scrollElement:a}=await R();if(!r){g("There are issues with your cart that must be addressed before placing this order"),a&&(0,et.hT)(a),F(!1),s();return}if(i.filter(e=>(0,eD.Bu)(e)).map(e=>e.selectedHouseholdMemberId).filter(e=>"-"===e).length){let e=k;if(!e){let{firstName:t,lastName:l}=(0,ed.F8S)(c.getValues().name);e=await M({firstName:t,lastName:null!=l?l:"",phoneNumber:c.getValues().phone_number})}if(!e)return void g("We were unable to find a household member to register. If this issue persists, please contact an administrator.");i=w.map(t=>t.programType!==p.j_6.TicketedEvent?t:{...t,selectedHouseholdMemberId:e.id}),N((0,ev.QA)({selectedMemberId:e.id}))}await (0,I.P)(P,null==x?void 0:x.id,c.getValues(),v);let n=m.getValues().payment_method_id,o=f.getValues("addonOptions")||[],u=c.watch("latitude"),h=c.watch("longitude"),b=await D({variables:{payload:await eX({organizationId:E,accountForm:c.getValues(),paymentMethodId:null!=n?n:"",userId:l.id,isResident:l.is_resident,isLowIncome:!!l.is_low_income,cartItems:i,formSubmissions:S,residency_coords:u&&h?{latitude:u,longitude:h}:void 0,discount_code:_,selectedPaymentPlanId:y,selectedOptInFees:o,presaleCodes:C})}}),j=!!(null==(e=b.data)?void 0:e.programsCheckout.success),A=null==(t=b.data)?void 0:t.programsCheckout.errors;if(j){Y(),F(!1);return}N((0,ev.rN)(A)),function(e){return null==e?void 0:e.some(e=>e.reason===p.xFd.ScheduledPaymentLapsed)}(null!=A?A:[])?g("The payment deadline has passed for one or more selected activities"):function(e){return null==e?void 0:e.some(e=>e.reason===p.xFd.WaitlistPaymentPlanConflict)}(null!=A?A:[])?g("Payment plans are not available for waitlist registrations"):g("We were unable to successfully process your registration. Please scroll up to see relevant errors. If this issue persists, please contact an administrator."),F(!1),s()},Y=()=>
1{N((0,Q.g0)({title:"Thank you for registering with us!",message:"Your transaction has been submitted! Please check your email for a confirmation message.",approveLabel:"View my registrations",cancelLabel:"Go back home",allowCancel:!0,fullWidth:!1,disableClose:!0,onApprove:()=>{O("/my-account/programs")},onCancel:()=>{O("/")}}))};return(0,i.jsx)(o.nO.Primary,{loading:B,disabled:!1,onClick:T,className:u()("mx-4 w-full px-8 md:mx-auto md:ml-auto md:mr-12 md:w-auto",n),children:"Place order"})},e1=e=>{let{cartItems:t,programs:l,userData:r,accountForm:n,paymentForm:s,optionalFeesForm:d,address:c,evaluations:m,loadingEvaluations:u,priceComponents:f,selectedAddonOptions:x,collectLowIncomeInformation:v=!1,refetchEvaluations:_,discountCode:y,selectedPaymentPlanId:g,handleAddonDelete:b,setSelectedPaymentPlanId:j}=e,[A,N]=a.useState(!1),{pass_kaizen_fee_to_customers:w}=(0,q.Z5)(),{startPolling:I,stopPolling:S}=function(e){let{cartItems:t}=e,l=(0,z.wA)(),[r,n]=(0,a.useState)(!1),{organizationID:s}=(0,q.Z5)(),o=(0,h.xk)("error",{persist:!0,key:ez,action:e=>(0,i.jsx)(P.A,{onClick:()=>{l((0,Q.SQ)(e)),n(!1)},children:(0,i.jsx)(D.A,{className:"text-white",children:"Dismiss"})})});(0,a.useEffect)(()=>()=>{l((0,Q.SQ)(ez))},[l]),(0,a.useEffect)(()=>{t.every(e=>e.programType===p.j_6.Camp||e.programType===p.j_6.TicketedEvent||void 0===e.validationError)&&l((0,Q.SQ)(ez))},[l,t]);let d=(0,a.useMemo)(()=>(0,K.oE)(t.map(e=>e.programType===p.j_6.Camp||e.programType===p.j_6.TicketedEvent?null:{cart_item_id:e.id,registrable_unit_id:e.registrableUnitId,household_member_ids:e.selectedHouseholdMemberIds,registering_for_waitlist:e.registeringForWaitlist})),[t]),c=!!s&&d.length>0,{startPolling:m,stopPolling:u}=(0,p.tLW)({pollInterval:3e4,notifyOnNetworkStatusChange:!0,skip:!c,variables:{organization_id:s,submissions:d},onCompleted(e){var i,a;let s,d=(a=null==e||null==(i=e.validateRegistrableUnitSubmissions)?void 0:i.results,s={},null==a||a.forEach(e=>{var l,i;let r=t.find(t=>t.id===e.cart_item_id);if(!r||(0,eD.$v)(r)||(0,eD.Bu)(r))return;if(!1===(null==(l=r.validationError)?void 0:l.valid)&&e.valid){s[r.id]=void 0;return}if(!e.valid)(null==(i=r.validationError)?void 0:i.rejection_reason)!==e.rejection_reason&&(s[r.id]=e)}),s),c=Object.keys(d);if(c.length<1)return;l((0,ev.Hp)(d));let m=c.filter(e=>{var t;return(null==(t=d[e])?void 0:t.valid)===!1});!r&&m.length>0&&(o("There's an issue with some of the items in your cart"),n(!0))}});return{startPolling:()=>{c&&m(3e4)},stopPolling:u}}({cartItems:t}),C=(0,K.oE)(m.map(e=>e.scheduled_payment_on)),E=C.length>0||!!g&&g!==eM,k=function(e){if(!e.length)return null;if(1===e.length)return(0,eV.oh)(e[0]);let t=e.toSorted(eq.dl),l=(0,eV.oh)(t[0]),i=(0,eV.oh)(t[t.length-1]);return"".concat(l," - ").concat(i)}(C),{due_now_subtotal:M,due_now_fees:B,due_now_platform_fee:F,due_now_total:O,scheduled_subtotal:R}=f,Y=(0,e_.DK)(m,[L.Zy.OPT_IN,L.Zy.ORDER_LEVEL]),H=m.some(e=>e.registering_for_waitlist);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"flex h-[calc(100%_-_88px)] flex-col justify-between overflow-scroll pt-8",children:[(0,i.jsxs)("div",{className:"mb-4 px-6",children:[(0,i.jsx)(o.EY.BodyLargeBold,{className:"mb-2",children:"Order Summary"}),(0,i.jsx)(eZ.A,{className:"border-low",cartItems:t,evaluations:Y,loadingEvaluations:!m.length&&u,requireDeleteConfirmation:!0,setSelectedPaymentPlanId:j})]}),!u&&(0,i.jsxs)("div",{className:"ml-6 mr-6 flex flex-col border-t-1 border-low md:mr-0",children:[(0,i.jsx)(eG,{selectedAddonOptions:x,evaluations:m,onDelete:b}),(0,i.jsx)(eQ,{evaluations:m}),(0,i.jsxs)("div",{className:"flex flex-col gap-2 p-6 md:pl-[96px] md:pr-[60px]",children:[(0,i.jsxs)("div",{className:"flex items-end justify-between",children:[(0,i.jsx)(o.EY.BodySmallSemiBold,{children:"Subtotal"}),(0,i.jsx)(o.EY.BodySmall,{children:(0,ey.$5)(M+R)})]}),!E&&(0,i.jsxs)(i.Fragment,{children:[F>0&&(0,i.jsxs)("div",{className:"flex items-end justify-between",children:[(0,i.jsx)(o.EY.BodySmallSemiBold,{children:"Service fee"}),(0,i.jsx)(o.EY.BodySmall,{children:(0,ey.$5)(F)})]}),(0,i.jsxs)("div",{className:"flex items-end justify-between",children:[(0,i.jsx)(o.EY.BodySmallSemiBold,{children:"Processing fees"}),(0,i.jsx)(o.EY.BodySmall,{children:(0,ey.$5)(B)})]}),(0,i.jsxs)("div",{className:"flex items-end justify-between",children:[(0,i.jsx)(o.EY.BodyLargeBold,{children:H?"Total due today":"Total"}),(0,i.jsx)(o.EY.BodyLargeBold,{children:(0,ey.$5)(O)})]})]}),(0,i.jsx)("div",{className:"flex items-center justify-between",children:(0,i.jsx)(o.$n.Tertiary,{onClick:()=>N(!0),children:"Have a discount code?"})})]}),(0,i.jsx)(eL.A,{className:"border-low"}),E&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"flex flex-col gap-2 p-6 md:pl-[96px] md:pr-[60px]",children:[(0,i.jsx)(o.EY.Label,{color:"secondary",children:"Due today"}),(0,i.jsxs)("div",{className:"flex items-end justify-between",children:[(0,i.jsx)(o.EY.BodySmallSemiBold,{children:"Subtotal"}),(0,i.jsx)(o.EY.BodySmall,{children:(0,ey.$5)(M)})]}),F>0&&(0,i.jsxs)("div",{className:"flex items-end justify-between",children:[(0,i.jsx)(o.EY.BodySmallSemiBold,{children:"Service fee"}),(0,i.jsx)(o.EY.BodySmall,{children:(0,ey.$5)(F)})]}),(0,i.jsxs)("div",{className:"flex items-end justify-between",children:[(0,i.jsx)(o.EY.BodySmallSemiBold,{children:"Processing fees"}),(0,i.jsx)(o.EY.BodySmall,{children:(0,ey.$5)(B)})]}),(0,i.jsxs)("div",{className:"flex items-end justify-between",children:[(0,i.jsx)(o.EY.BodyLargeBold,{children:"Total due today"}),(0,i.jsx)(o.EY.BodyLargeBold,{children:(0,ey.$5)(O)})]})]}),(0,i.jsx)(eL.A,{className:"border-low"}),(0,i.jsxs)("div",{className:"flex flex-col gap-2 p-6 md:pl-[96px] md:pr-[60px]",children:[(0,i.jsxs)("div",{className:"flex items-end justify-between",children:[(0,i.jsxs)(o.EY.BodySmall,{children:["Total scheduled*"," ",k?"(".concat(k,")"):""]}),(0,i.jsx)(o.EY.BodySmall,{children:(0,ey.$5)(R||0)})]}),(0,i.jsx)(o.EY.Label,{color:"secondary",children:w?"*plus service and processing fees":"*plus processing fees"})]})]})]})]}),(0,i.jsx)("div",{className:"flex h-[88px] items-center md:border-t-1 md:border-t-[#D4D4D4]",children:(0,i.jsx)(e0,{programs:l,userData:r,startPolling:I,stopPolling:S,accountForm:n,paymentForm:s,optionalFeesForm:d,address:c,
1collectLowIncomeInformation:v,discount_code:y,selectedPaymentPlanId:g})}),(0,i.jsx)(T.d$,{open:A,onClose:()=>{N(!1)},onDiscountApply:e=>{_(e),N(!1)}})]})};var e2=l(94589),e8=l(66423),e4=l.n(e8),e6=l(54346),e5=l(39240),e7=l(27374),e9=l(28497),e3=l(38315),te=l(93009),tt=l(59880),tl=l(52875),ti=l(62522);let tr=e=>{var t;let{form:l,householdMember:r,programForms:n}=e,[s,d]=(0,a.useState)(!1),c=(0,z.wA)(),m=(0,z.d4)(ev.gv),h=(0,z.d4)(e=>(0,ev.OE)(e,r.id,l.id)),f=(0,z.d4)(e=>(0,ev.Mt)(e,l.id)),x=!!h,v=(0,e9.v)(l.type),_=(0,tl.A)(r),y=(null==(t=n.find(e=>{var t;return(null==(t=e.associated_form_definition)?void 0:t.id)===l.id}))?void 0:t.is_optional_at_checkout)==!1,b=y&&!x&&m,j=(0,a.useMemo)(()=>x||(null==f?void 0:f.created_at)?te.Gt.CONFIRM:y?te.Gt.ERROR:te.Gt.INACTIVE,[x,f,y]),A=()=>{if(!x&&!f)return y?"Required":"Optional";let e=(null==h?void 0:h.created_at)||(null==f?void 0:f.created_at);return l.type===p.NRE.Disclaimer?e?"Signed on "+(0,g.kz)(e):"Signed":l.type===p.NRE.File?e?"Added on "+(0,g.kz)(e):"Added":e?"Completed on "+(0,g.kz)(e):"Completed"},N=!y&&!x;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(e7.A,{variant:"outlined",className:u()("relative flex h-[168px] flex-col rounded-md p-4",{"border-1 border-failure":b,"border-dashed":N}),children:[(0,i.jsxs)("div",{children:[j===te.Gt.CONFIRM&&(0,i.jsx)(o.vw.Positive,{label:A()}),j===te.Gt.INACTIVE&&(0,i.jsx)(o.vw.Neutral,{label:A()}),j===te.Gt.ERROR&&(0,i.jsx)(o.vw.Negative,{label:A()}),(0,i.jsx)(D.A,{className:"mt-2 text-16",children:l.name})]}),(0,i.jsx)("div",{className:"absolute bottom-0 left-0 right-0 bg-white p-4 pt-1",children:(0,i.jsx)(tt.A,{className:"p-0 text-left text-brand-primary",onClick:()=>{d(!0)},children:(0,e3.A)(l.type,x,!!f)})})]}),b&&(0,i.jsxs)("div",{className:"mt-1 flex items-center gap-1",children:[(0,i.jsx)(e5.A,{className:"text-20 text-failure"}),(0,i.jsx)(o.EY.LabelSemiBold,{className:"text-sm",color:"failure",children:"This form is required"})]}),(0,i.jsx)(v,{open:s,form:l,existingDocuments:_,existingFormSubmission:h,extraHeaderContent:(0,i.jsx)(ti.A,{member:r}),onClose:()=>{d(!1)},onSubmit:e=>{n.forEach(t=>{var i,a;(null==(i=t.associated_form_definition)?void 0:i.id)===l.id&&c((0,ev.du)({...e,formId:t.id,householdMemberId:r.id,schemaFormDefinitionId:null==(a=l.associated_schema_form_definition)?void 0:a.id,formDefinitionId:l.id}))})},onRemove:()=>{n.forEach(e=>{var t;(null==(t=e.associated_form_definition)?void 0:t.id)===l.id&&c((0,ev.xI)({formId:e.id,householdMemberId:r.id}))})}})]})},ta=e=>{let{householdMembers:t,cartItems:l,programs:r,formType:a,id:n}=e,{title:s,ariaName:o}=(0,e6.YW)(a).with(p.NRE.Disclaimer,()=>({title:"Sign disclaimers",ariaName:"sign-disclaimers"})).with(p.NRE.File,()=>({title:"Add file uploads",ariaName:"add-file-uploads"})).with(p.NRE.SchemaForm,()=>({title:"Add registration details",ariaName:"add-registration-details"})).with(p.NRE.ExternalForm,()=>{throw Error("External forms are not supported")}).exhaustive(),d=function(e,t,l,i){let r=[];for(let a of e){let e=t.filter(e=>(0,eD.$v)(e)||(0,eD.Bu)(e)?e.selectedHouseholdMemberId===a.id:e.selectedHouseholdMemberIds.includes(a.id));if(!(null==e?void 0:e.length))continue;let n=[];e.forEach(e=>{let t=(0,eD.EC)(e)?[e.registrableUnitId]:e.registrableUnits.map(e=>e.id),r=l.find(t=>t.id===e.programId);r&&t.forEach(e=>{let{forms:t}=(0,eV.Vq)(r,e);t.filter(e=>{var t;return(null==(t=e.associated_form_definition)?void 0:t.type)===i}).forEach(e=>{let t=n.findIndex(t=>{var l,i;return(null==(l=t.associated_form_definition)?void 0:l.id)===(null==(i=e.associated_form_definition)?void 0:i.id)});-1===t?n.push(e):!e.is_optional_at_checkout&&n[t].is_optional_at_checkout&&(n[t]=e)})})});let s=(0,K.oE)(n.flatMap(e=>e.associated_form_definition)),o=e4()(s,"id");(null==o?void 0:o.length)&&r.push({member:a,forms:o.sort((e,t)=>e.id.localeCompare(t.id)),programForms:n})}return r}(t,l,r,a);return d.length?(0,i.jsx)(O.A,{id:n,title:s,ariaName:o,children:d.map(e=>(0,i.jsxs)("div",{className:"mb-4",children:[(0,i.jsxs)("div",{className:"mb-4 flex items-center",children:[(0,i.jsx)(e2.A,{}),(0,i.jsxs)(D.A,{className:"ml-6",children:[e.member.first_name," ",e.member.last_name]})]}),(0,i.jsx)(c.Ay,{container:!0,columnGap:2,rowGap:2,className:"md:pl-12",children:e.forms.map(t=>(0,i.jsx)(c.Ay,{item:!0,xs:12,className:"max-w-56 p-0",children:(0,i.jsx)(tr,{form:t,householdMember:e.member,programForms:e.programForms})},"".concat(e.member.id,"-").concat(t.id)))})]},"".concat(e.member.id)))}):null},tn=()=>(0,i.jsxs)("div",{className:"flex h-[calc(100vh_-_68px)] w-full flex-col items-center justify-center text-center",children:[(0,i.jsx)(ec.A,{className:"text-64"}),(0,i.jsx)(D.A,{className:"mt-2",children:"Your cart is currently empty"}),(0,i.jsx)(eg.L,{href:"/",children:(0,i.jsx)(D.A,{component:"span",className:"mb-22 mt-1 cursor-pointer text-15 text-brand-primary underline underline-offset-4",children:"Click here to browse our offerings"})})]}),ts=()=>{var e;let t=(0,ep.Tp)(ed.sKG.enablePaymentPlans),l=(0,ep.Tp)(ed.sKG.enablePaymentPlansCheckout),[r,n]=(0,a.useState)("card"),[s,m]=(0,a.useState)(),[u,h]=(0,a.useState)(""),[f,x]=(0,a.useState)([]),v=(0,z.d4)(ev.wF),{programs:g}=function(e){let{data:t,refetch:l,loading:i}=(0,p.ujP)({variables:{ids:e},fetchPolicy:"network-only"});return{programs:null==t?void 0:t.programs,refetchPrograms:l,loadingPrograms:i}}(v.map(e=>e.programId)),N=(0,z.d4)(A.Sj),w=(0,z.wA)(),{userData:S,loadingUserData:C,fullName:E,household_id:P}=(0,j.u)(),{address:k,loadingAddress:M}=(0,_.i)(),{householdMembers:B}=(0,ef.b)(P,{first_name:p.V47.Asc,last_name:p.V47.Asc,created_at:p.V47.Asc}),{data:F}=(0,p.kWx)({variables:{form_definition_ids:eu()(null==g?void 0:g.flatMap(e=>{var t;return null==(t=e.associated_program_forms)?void 0:t.flatMap(e=>{var t;return null==(t=e.associated_form_definition)?void 0:t.id})})),user_id:N},onCompleted:e=>
1{let t=null==e?void 0:e.schema_form_submissions.reduce((e,t)=>{var l,i,r,a;let n=null==(l=e[t.form_definition_id])?void 0:l.created_at;return(!(t.form_definition_id in e)||t.created_at&&n&&new Date(t.created_at)>new Date(n))&&(e[t.form_definition_id]={schemaFormData:t.form_data,formId:t.id,formDefinitionId:t.form_definition_id,created_at:null!=(i=t.created_at)?i:void 0,updated_at:null!=(r=t.updated_at)?r:void 0,updated_by:null!=(a=t.updated_by)?a:void 0}),e},{});w((0,ev.Vt)(t))}}),O=(null==F||null==(e=F.schema_form_submissions)?void 0:e.some(e=>e.form_data))||!1,T=b({userData:S,loadingUserData:C,address:k,loadingAddress:M}),{paymentForm:Y}={paymentForm:(0,y.mN)({mode:"onChange",reValidateMode:"onChange"})},{optionalFeesForm:H}={optionalFeesForm:(0,y.mN)({mode:"onChange",reValidateMode:"onChange",defaultValues:{addonOptions:[]}})},{setValue:L,register:V}=H;V("addonOptions");let q=T.watch("latitude"),U=T.watch("longitude"),$=T.watch("postal_code"),W=u&&u!==eM?u:void 0,{evaluations:G,priceComponents:Q,availablePaymentPlans:Z,unavailablePaymentPlans:J,selectedPaymentPlan:K,loadingEvaluations:X,refetchEvaluations:ee}=(0,eh.u)({cartItems:v,userData:S,isLowIncome:(null==S?void 0:S.is_low_income)||T.watch("is_low_income"),usingACH:(0,ey.X)(r),residencyCoords:q&&U?{latitude:q,longitude:U}:void 0,postalCode:$,discountCode:s,selectedPaymentPlanId:W,selectedOptInFees:f});if((0,a.useEffect)(()=>{L("addonOptions",f)},[f,L]),(null==v?void 0:v.length)<=0)return(0,i.jsx)(tn,{});if(!g||!S||!G||!Q)return(0,i.jsx)("div",{className:"flex h-[calc(100vh_-_68px)] w-full items-center justify-center",children:(0,i.jsx)(d.A,{size:64})});let et=!!(null==Z?void 0:Z.length)||!!(null==J?void 0:J.length),el=0===Q.order_subtotal,ei=v.some(e=>"b7977f01-5f03-46e3-b684-b06dad31f5fd"===e.programId),er=(0,e_.od)(g),ea=(0,e_.OP)(G,p.iaS.Fee).reduce((e,t)=>e+t.totalAmountModified,0);return(0,i.jsx)("div",{className:"w-full bg-white",children:(0,i.jsxs)(c.Ay,{container:!0,children:[(0,i.jsxs)(c.Ay,{item:!0,md:7,xs:12,id:"checkoutContainer",className:"rounded-md px-4 pb-4 pt-8 md:h-[calc(100vh_-_68px)] md:overflow-scroll md:rounded-none md:pb-12 md:pl-12 md:pr-8 md:pt-12 xl:pr-24",children:[ea>0&&(0,i.jsx)("div",{className:"mb-10",children:(0,i.jsx)(o.vM.Neutral,{label:"Additional fees apply to this registration"})}),(0,i.jsx)(D.A,{className:"text-24 font-medium",children:"Checkout"}),(0,i.jsx)(R,{form:T,collectLowIncomeInformation:ei}),O&&(0,i.jsx)(o.vM.Neutral,{label:"Some forms are pre-filled based on previous submissions. Review details before proceeding."}),(0,i.jsx)(ta,{householdMembers:B,programs:g,cartItems:v,formType:p.NRE.Disclaimer,id:I.d.Disclaimers}),(0,i.jsx)(ta,{householdMembers:B,programs:g,cartItems:v,formType:p.NRE.File,id:I.d.Documents}),(0,i.jsx)(ta,{householdMembers:B,programs:g,cartItems:v,formType:p.NRE.SchemaForm,id:I.d.SchemaForms}),t&&l&&!el&&et&&(0,i.jsx)(eH,{cartItems:v,priceComponents:Q,selectedPaymentPlanId:(null==K?void 0:K.payment_plan_configuration_id)||u,availablePaymentPlans:Z,unavailablePaymentPlans:J,setSelectedPaymentPlanId:h}),!el&&(0,i.jsx)(eI.A,{cartItems:v,form:Y,userData:S,fullName:E,selectedPaymentPlan:K,priceComponents:Q,onPaymentTypeChange:n}),er.length>0&&(0,i.jsx)(ew,{optInFees:er,selectedAddonOptions:f,handleAddonOptionsChange:e=>{x(e)}})]}),(0,i.jsx)(c.Ay,{item:!0,md:5,xs:12,className:"right-0 m-4 w-full rounded border-1 border-[#D4D4D4] md:fixed md:mr-0 md:mt-0 md:h-[calc(100vh_-_68px)] md:rounded-none md:border-y-0 md:border-r-0",children:(0,i.jsx)(e1,{cartItems:v,householdMembers:B,programs:g,userData:S,accountForm:T,paymentForm:Y,optionalFeesForm:H,address:k,evaluations:G,loadingEvaluations:X,priceComponents:Q,selectedAddonOptions:f,paymentType:r,collectLowIncomeInformation:ei,discountCode:s,selectedPaymentPlanId:u,refetchEvaluations:e=>{m(e),ee()},handleAddonDelete:e=>{x(t=>t.filter(t=>t.price_modifier_id!==e))},setSelectedPaymentPlanId:h})})]})})},to=()=>{let{query:{mtid:e,rp:t}}=(0,r.useRouter)();return e&&"string"==typeof e?(0,i.jsx)(s.A,{header:(0,i.jsx)(n.A,{}),ignoreMaxWidth:!0,children:(0,i.jsx)(eo,{membershipTierId:e,isResidentPricing:"true"===t})}):(0,i.jsx)(s.A,{header:(0,i.jsx)(n.A,{}),ignoreMaxWidth:!0,children:(0,i.jsx)(ts,{})})}},89794:(e,t,l)=>{"use strict";var i=l(61576);t.A=void 0;var r=i(l(23691)),a=l(78488);t.A=(0,r.default)((0,a.jsx)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2zM6.16 6h12.15l-2.76 5H8.53zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2m10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2"}),"ShoppingCartOutlined")}
1,92754:(e,t,l)=>{"use strict";l.d(t,{A:()=>M,N:()=>k});var i=l(78488),r=l(48339),a=l(93463),n=l(32945),s=l(67214),o=l(85585),d=l(59174),c=l(23110),m=l(72848),u=l(5958),p=l(25268),h=l(88),f=l(81204),x=l(33237),v=l(60766),_=l(65382),y=l(61733),g=l(27143),b=l(63378),j=l(90911),A=l(60455),N=l(68513),w=l(38200),I=l(24846),S=l(54972),C=l(97191),E=l(59880),P=l(20975);let D=e=>{let{cartItems:t,includesScheduledPayments:l}=e,[a,n]=(0,f.useState)(!1),c=(null==t?void 0:t.some(e=>(0,g.EC)(e)?e.registeringForWaitlist:e.registrableUnits.every(e=>e.registeringForWaitlist)))||!1;return l||c?(0,i.jsxs)("div",{className:"px-8 pb-8",children:[(0,i.jsx)(E.A,{className:"p-0 text-16 text-brand-primary",onClick:()=>n(!0),children:"Why are we asking for this?"}),(0,i.jsxs)(s.A,{open:a,onClose:()=>n(!1),maxWidth:"sm",PaperProps:{sx:{borderRadius:2,p:0}},children:[(0,i.jsx)(r.c7,{title:"Why are we asking for this?",onClose:()=>n(!1)}),(0,i.jsxs)(o.A,{className:"space-y-8 py-6",children:[c&&(0,i.jsxs)("div",{className:"space-y-2",children:[l&&(0,i.jsx)(d.A,{className:"font-medium",children:"Waitlist seats"}),(0,i.jsx)(d.A,{className:"text-16",children:"You won’t be charged to join the waitlist, but we still need your payment information so we can charge you when a seat opens up. We’ll contact you to confirm before we charge you."})]}),l&&(0,i.jsxs)("div",{className:"space-y-2",children:[c&&(0,i.jsx)(d.A,{className:"font-medium",children:"Scheduled payments"}),(0,i.jsx)(d.A,{className:"text-16",children:"We need your payment information to process your scheduled payments. We’ll charge you on the scheduled payment date indicated."})]})]})]})]}):null};function k(e){let t=[];for(let i of e){var l;if(!((l=i).exp_month&&l.exp_year&&h.c9.local().endOf("month")>h.c9.local(l.exp_year,l.exp_month).endOf("month"))){if(!i.fingerprint){t.push(i);continue}-1===t.findIndex(e=>{let{fingerprint:t}=e;return t===i.fingerprint})&&t.push(i)}}return t}let M=e=>{let{cartItems:t,form:l,userData:s,fullName:o,selectedPaymentPlan:h,priceComponents:g,onPaymentTypeChange:E}=e,{control:M,formState:{errors:B}}=l,[F,O]=(0,f.useState)(),[R,T]=(0,f.useState)(!1),Y=(0,v.d4)(N.Cf),{paymentMethods:H,refetchPaymentMethods:L}=(0,j.t)(s.id,Y),z=k(H||[]),V=e=>{let t=e.target.value;E(z.find(e=>e.id===t).type||"card"),l.setValue("payment_method_id",t),l.clearErrors("payment_method_id")},q=(0,b.qN)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(P.A,{id:w.d.PaymentDetails,title:"Pay with",ariaName:"pay-with",accordionDetailsClassName:"px-0 py-0",children:[B.payment_method_id&&(0,i.jsx)(r.vM.Negative,{className:"mb-4",label:"Add or select a valid payment method"}),(0,i.jsx)(x.xI,{rules:{required:!0},control:M,defaultValue:"",name:"payment_method_id",render:e=>{let{field:t}=e;return(0,i.jsx)(c.A,{"aria-labelledby":"payment-method-options",...t,onChange:V,children:null==z?void 0:z.map(e=>(0,i.jsx)(m.A,{className:"m-0 border-1 p-4",value:e.id,control:(0,i.jsx)(u.A,{}),label:(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsxs)("div",{className:"flex flex-row items-center space-x-2",children:["Bank Account"===e.type?(0,i.jsx)(a.A,{}):(0,i.jsx)(n.A,{}),(0,i.jsxs)(d.A,{className:"m-0 p-0 text-15",children:[e.type," ending in ",e.last4]})]}),e.notes&&(0,i.jsx)(d.A,{className:"mt-1 text-13 text-[#5B5757]",children:e.notes})]})},e.id))})}}),(0,i.jsx)("div",{className:"m-0 flex cursor-pointer items-center p-6",children:(0,i.jsx)(r.nO.Primary,{loading:R,onClick:async()=>{var e,t,l,i;T(!0);let r=await (0,S.Ir)(Y,null!=(l=null!=o?o:null==s?void 0:s.email)?l:"N/A",null!=(i=null==s?void 0:s.email)?i:"N/A",!!s.id,s.id);(null==r||null==(e=r.createReservationSetupIntent)?void 0:e.error)&&(I.A.error("Error creating setup intent",r.createReservationSetupIntent.error),q(_.h1));let a=null==r||null==(t=r.createReservationSetupIntent)?void 0:t.client_secret;a&&O(a),T(!1)},children:"Add new payment method"})}),(0,i.jsx)(D,{cartItems:t,includesScheduledPayments:!!(null==g?void 0:g.scheduled_subtotal)&&!(h&&h.first_installment_due_at_checkout)})]}),F&&(0,i.jsx)(p.S8,{stripe:A.A.stripe,options:{clientSecret:F,fonts:y.l,appearance:y.$,loader:"always"},children:(0,i.jsx)(C.A,{clientSecret:F,onClose:()=>O(void 0),onPaymentTypeChange:E,onConfirm:async e=>{var t,i,r;let a=null==(r=e.setupIntent)||null==(i=r.payment_method)||null==(t=i.toString)?void 0:t.call(i);a&&(l.setValue("payment_method_id",a),l.clearErrors("payment_method_id")),L()}})})]})}},93463:(e,t,l)=>{"use strict";var i=l(61576);t.A=void 0;var r=i(l(23691)),a=l(78488);t.A=(0,r.default)((0,a.jsx)("path",{d:"M4 10h3v7H4zm6.5 0h3v7h-3zM2 19h20v3H2zm15-9h3v7h-3zm-5-9L2 6v2h20V6z"}),"AccountBalance")},94589:(e,t,l)=>{"use strict";var i=l(61576);t.A=void 0;var r=i(l(23691)),a=l(78488);t.A=(0,r.default)((0,a.jsx)("path",{d:"M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4"}),"PersonOutlineOutlined")},96045:e=>{e.exports={hideOnPrint:"Print_hideOnPrint__8rVAS"}},97191:(e,t,l)=>{"use strict";l.d(t,{A:()=>f});var i=l(78488),r=l(48339),a=l(26154),n=l(57179),s=l(66598),o=l(25268),d=l(17563),c=l(81204),m=l(63378),u=l(23268),p=l(24846);let h="We were unable to add your payment method. If this issue persists, please contact an administrator.",f=e=>{let{onClose:t,clientSecret:l,onConfirm:f,onPaymentTypeChange:x,stripeReturnPath:v,DialogProps:_}=e,y=(0,o.t2)(),g=(0,o.HH)(),b=(0,u.o)(),[j,A]=(0,c.useState)(),[N,w]=(0,c.useState)(!1),[I,S]=(0,c.useState)(!0),[C,E]=(0,c.useState)(!1),P=(0,m.xN)(),D=(0,m.qN)(),k=(0,d.useRouter)().asPath;async function M(){if(w(!0),!y||!g)return w(!1),null;try{let e=await y.confirmSetup({elements:g,confirmParams:{return_url:window.location.origin+v},redirect:"if_required"});if(e.error){w(!1),A(h);let t=e.error.message;p.A.error("Stripe error response adding payment method: ".concat(t),e.error);return}w(!1),P("Successfully added payment method."),f(e),t()}catch(e){p.A.error("Stripe error thrown adding payment method",e),w(!1),A(h)}}return v=null!=v?v:k,(0,i.jsx)(r.lG,{..._,open:!!l,size:"lg",fullScreen:b,headerProps:{title:"Add Payment Method",onClose:t},contentProps:{content:(0,i.jsxs)(a.Ay,{container:!0,spacing:2,children:[(0,i.jsxs)(a.Ay,{item:!0,xs:12,children:[I&&!C&&(0,i.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,i.jsx)(n.A,{className:"text-brand-primary",size:30})}),(0,i.jsx)(o.He,{onLoaderStart:()=>E(!0),onLoadError:e=>{p.A.error("Error loading PaymentElement",e),D("Error connecting to payments provider, please check your network connection and try again.")},onReady:()=>S(!1),onChange:e=>{x&&x(e.value.type)}})]}),j&&(0,i.jsx)(a.Ay,{item:!0,xs:12,children:(0,i.jsx)(s.A,{error:!0,className:"text-16",children:j})})]}),className:"flex flex-col pt-4 pb-10 px-6 md:min-w-[600px]"},footerProps:{loading:N,onCancel:t,onConfirm:M,isConfirmDisabled:N||I||!y||!g,cancelButtonText:"Close",confirmButtonText:"Confirm"}})}},99015:(e,t,l)=>{"use strict";l.d(t,{B:()=>m});var i=l(78488),r=l(35848),a=l(60461),n=l(33610),s=l(13743),o=l(59174),d=l(81204),c=l(12428);let m=e=>{let{name:t,inputRef:l,label:m,value:u,disabled:p,required:h,fieldProps:f,isDecrementDisabled:x,isIncrementDisabled:v,onChange:_,onDecrement:y,onIncrement:g,descriptor:b="person(s)"}=e,j=(0,d.useMemo)(()=>(0,i.jsx)(s.A,{size:"small",disabled:p||x,onClick:y,children:(0,i.jsx)(n.A,{})}),[p,x,y]),A=(0,d.useMemo)(()=>(0,i.jsx)(s.A,{size:"small",disabled:p||v,onClick:g,children:(0,i.jsx)(a.A,{})}),[p,v,g]),N=(0,d.useMemo)(()=>{var e;let t={startAdornment:j,endAdornment:A,className:"rounded-md",disableUnderline:!0,classes:{input:"py-0 h-[53px] text-[#767171] text-center"}},l=(null==f?void 0:f.InputProps)||{},i={...t,...l,classes:{input:(0,r.cn)(t.classes.input,null==l||null==(e=l.classes)?void 0:e.input),...null==l?void 0:l.classes},startAdornment:j,endAdornment:A};return{variant:"filled",value:u,onChange:e=>{_(parseInt(e.target.value,10)||"")},style:{width:146},...f,InputProps:i}},[f,u,_,j,A]);return(0,i.jsxs)("div",{className:"flex items-center justify-start gap-x-4",children:[(0,i.jsx)(c.A,{required:h,disabled:p,name:t,inputRef:l,label:m,fieldProps:N}),(0,i.jsx)(o.A,{className:"text-base font-normal leading-snug text-stone-500",children:b})]})}}},e=>{e.O(0,[9869,4098,5959,3762,636,6593,8792],()=>e(e.s=34776)),_N_E=e.O()}]);

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.