1import{u as F,q as N,g as u,a as r,b as e,h as S,d as l,t as a,F as k,c as _,w as h,e as g,i as d,f as T,k as C,j as f,p as O,o as n}from"./app-CNKgUzaW.js";import{_ as P}from"./PublicLayout-D6HSmAED.js";import{_ as R}from"./PageHero-BhyAmpQm.js";import{_ as L}from"./PhoneInput-C4UDKRWv.js";import{s as x}from"./index--9dLFLch.js";import{s as p}from"./index-B_AtUfEK.js";import{s as w}from"./index-vfRulL0w.js";import{s as M}from"./index-Xw6pq-Ye.js";import{s as y}from"./index-BBAWD_Hx.js";/* empty css */import"./index-CgfGZUh-.js";import"./index-CEppecSx.js";import"./index-BPH3tE-z.js";import"./index-BafwodOj.js";import"./useFormatters-Dq7GKB1-.js";import"./index-1wqQM50o.js";import"./index-BKERpy5p.js";import"./index-D22kglcl.js";import"./index-D63QnEKA.js";import"./index-CGXP3aZr.js";import"./index-DIA4pxQs.js";import"./index-CS-TSdHE.js";import"./index-fdtwTZOg.js";import"./index-C0qc0oZN.js";import"./index-DmYb42GS.js";const A={class:"bg-warm-bg py-16"},D={class:"max-w-2xl mx-auto px-6"},I={class:"bg-white rounded-xl shadow-sm p-8"},J={key:0,class:"text-center py-4"},E={class:"text-2xl font-semibold text-primary"},Y={class:"mt-3 text-ink-700"},z={class:"mt-2 text-sm text-ink-subtle"},G={class:"mt-8 flex flex-col justify-center gap-3 sm:flex-row"},H={href:"/"},K={class:"grid grid-cols-1 sm:grid-cols-2 gap-4"},Q={class:"block text-sm font-medium text-ink-700 mb-1"},W={key:0,class:"text-danger"},X={class:"block text-sm font-medium text-ink-700 mb-1"},Z={key:0,class:"text-danger"},ee={class:"grid grid-cols-1 sm:grid-cols-2 gap-4"},te={class:"block text-sm font-medium text-ink-700 mb-1"},le={key:0,class:"text-danger"},se={class:"block text-sm font-medium text-ink-700 mb-1"},oe={class:"grid grid-cols-1 sm:grid-cols-2 gap-4"},ae={class:"block text-sm font-medium text-ink-700 mb-1"},ie={key:0,class:"text-danger"},re={key:0,class:"text-danger"},ne={class:"grid grid-cols-1 sm:grid-cols-2 gap-4"},ue={class:"block text-sm font-medium text-ink-700 mb-1"},de={key:0,class:"text-danger"},me={class:"block text-sm font-medium text-ink-700 mb-1"},ce={class:"block text-sm font-medium text-ink-700 mb-1"},pe={class:"pt-4"},Me=Object.assign({layout:P},{__name:"Join",props:{referralCode:String,association:Object,funding:Object,memberTypes:{type:Array,default:()=>[]},registered:{type:Object,default:null}},setup(m){const b=m,V=O(),$=f(()=>V.props.locale||"fr"),s=f(()=>$.value==="fr"),t=F({first_name:"",last_name:"",date_of_birth:null,place_of_birth:"",sex:null,type:"resident",phone:"",email:"",beneficiary:""}),j=f(()=>[{label:s.value?"Masculin":"Male",value:"M"},{label:s.value?"Féminin":"Female",value:"F"}]),B=f(()=>b.memberTypes),c=C(null);N(()=>b.registered,v=>{v&&(c.value=v,t.reset(),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"}))},{immediate:!0});const U=()=>{c.value=null},q=()=>{t.post(`/join/${b.referralCode}`)};return(v,o)=>(n(),u(k,null,[r(e(S),{title:s.value?"Rejoindre un compte":"Join an account"},null,8,["title"]),r(R,{title:s.value?"Rejoindre un compte":"Join an Account",subtitle:m.association?.name},null,8,["title","subtitle"]),l("section",A,[l("div",D,[l("div",I,[c.value?(n(),u("div",J,[o[9]||(o[9]=l("div",{class:"mx-auto mb-5 flex h-16 w-16 items-center justify-center rounded-full bg-green-50"},[l("i",{class:"pi pi-check text-2xl text-green-600"})],-1)),l("h2",E,a(s.value?"Inscription envoyée":"Registration sent"),1),l("p",Y,a(s.value?`Merci ${c.value.first_name}. Votre demande est parvenue au gestionnaire du compte « ${m.association?.name} », qui la validera sous peu.`:`Thank you ${c.value.first_name}. Your request has reached the manager of the account â${m.association?.name}â, who will review it shortly.`),1),l("p",z,a(c.value.notified?s.value?"Vous recevrez un courriel dès quâelle sera traitée.":"You will receive an email as soon as it has been dealt with.":s.value?"Aucune adresse courriel nâa été fournie : votre gestionnaire vous répondra directement.":"No email address was given: your manager will get back to you directly."),1),l("div",G,[r(e(x),{label:s.value?"Inscrire une autre personne":"Register someone else",icon:"pi pi-user-plus",outlined:"",onClick:U},null,8,["label"]),l("a",H,[r(e(x),{label:s.value?"Retour à lâaccueil":"Back to home",text:""},null,8,["label"])])])])):(n(),u(k,{key:1},[e(t).errors.duplicate?(n(),_(e(y),{key:0,severity:"warn",closable:!1,class:"mb-6"},{default:h(()=>[g(a(e(t).errors.duplicate),1)]),_:1})):d("",!0),e(t).errors.funding?(n(),_(e(y),{key:1,severity:"error",closable:!1,class:"mb-6"},{default:h(()=>[g(a(e(t).errors.funding),1)]),_:1})):d("",!0),m.funding&&!m.funding.can_register?(n(),_(e(y),{key:2,severity:"error",closable:!1,class:"mb-6"},{default:h(()=>[g(a(s.value?"Le compte n'a pas encore atteint le seuil financier requis pour accepter une nouvelle inscription.":"The account has not yet reached the required financial threshold to accept new registrations."),1)]),_:1})):d("",!0),l("form",{onSubmit:T(q,["prevent"]),class:"space-y-5"},[l("div",K,[l("div",null,[l("label",Q,a(s.value?"Nom":"Last Name")+" *",1),r(e(p),{modelValue:e(t).last_name,"onUpdate:modelValue":o[0]||(o[0]=i=>e(t).last_name=i),class:"w-full",required:""},null,8,["modelValue"]),e(t).errors.last_name?(n(),u("small",W,a(e(t).errors.last_name),1)):d("",!0)]),l("div",null,[l("label",X,a(s.value?"Prénom":"First Name")+" *",1),r(e(p),{modelValue:e(t).first_name,"onUpdate:modelValue":o[1]||(o[1]=i=>e(t).first_name=i),class:"w-full",required:""},null,8,["modelValue"]),e(t).errors.first_name?(n(),u("small",Z,a(e(t).errors.first_name),1)):d("",!0)])]),l("div",ee,[l("div",null,[l("label",te,a(s.value?"Date de naissance":"Date of Birth")+" *",1),r(e(M),{modelValue:e(t).date_of_birth,"onUpdate:modelValue":o[2]||(o[2]=i=>e(t).date_of_birth=i),dateFormat:"yy-mm-dd",showIcon:"",class:"w-full"},null,8,["modelValue"]),e(t).errors.date_of_birth?(n(),u("small",le,a(e(t).errors.date_of_birth),1
1)):d("",!0)]),l("div",null,[l("label",se,a(s.value?"Lieu de naissance":"Place of Birth"),1),r(e(p),{modelValue:e(t).place_of_birth,"onUpdate:modelValue":o[3]||(o[3]=i=>e(t).place_of_birth=i),class:"w-full"},null,8,["modelValue"])])]),l("div",oe,[l("div",null,[l("label",ae,a(s.value?"Sexe":"Sex")+" *",1),r(e(w),{modelValue:e(t).sex,"onUpdate:modelValue":o[4]||(o[4]=i=>e(t).sex=i),options:j.value,optionLabel:"label",optionValue:"value",placeholder:s.value?"Sélectionner":"Select",class:"w-full"},null,8,["modelValue","options","placeholder"]),e(t).errors.sex?(n(),u("small",ie,a(e(t).errors.sex),1)):d("",!0)]),l("div",null,[o[10]||(o[10]=l("label",{class:"block text-sm font-medium text-ink-700 mb-1"},"Type *",-1)),r(e(w),{modelValue:e(t).type,"onUpdate:modelValue":o[5]||(o[5]=i=>e(t).type=i),options:B.value,optionLabel:"label",optionValue:"value",class:"w-full"},null,8,["modelValue","options"]),e(t).errors.type?(n(),u("small",re,a(e(t).errors.type),1)):d("",!0)])]),l("div",ne,[l("div",null,[l("label",ue,a(s.value?"Téléphone":"Phone"),1),r(L,{phone:e(t).phone,"onUpdate:phone":o[6]||(o[6]=i=>e(t).phone=i),invalid:!!e(t).errors.phone},null,8,["phone","invalid"]),e(t).errors.phone?(n(),u("small",de,a(e(t).errors.phone),1)):d("",!0)]),l("div",null,[l("label",me,a(s.value?"Courriel":"Email"),1),r(e(p),{modelValue:e(t).email,"onUpdate:modelValue":o[7]||(o[7]=i=>e(t).email=i),type:"email",class:"w-full"},null,8,["modelValue"])])]),l("div",null,[l("label",ce,a(s.value?"Bénéficiaire":"Beneficiary"),1),r(e(p),{modelValue:e(t).beneficiary,"onUpdate:modelValue":o[8]||(o[8]=i=>e(t).beneficiary=i),class:"w-full",placeholder:s.value?"Personne à contacter en cas de décès":"Person to contact in case of death"},null,8,["modelValue","placeholder"])]),l("div",pe,[r(e(x),{type:"submit",label:s.value?"S'inscrire":"Register",icon:"pi pi-user-plus",class:"w-full",loading:e(t).processing,disabled:m.funding&&!m.funding.can_register},null,8,["label","loading","disabled"])])],32)],64))])])])],64))}});export{Me 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.