import{d as A,u as D,E as x,e as M,i as E,w as l,k as u,t as a,h as t,g as z,j as _,aF as k,v as w,aL as T,aC as N,aM as U,a$ as F,m as R,p as Q,A as O,c as Y,a4 as j,Q as J,as as K,f as L,X}from"./index-0LqjRhnu.js";import{u as G}from"./useUpdateMemberMutation-Bspj0Gfg.js";import{_ as H}from"./FormGoogleLocation-tSLG5j8c.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new r.Error().stack;n&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[n]="890bcb99-8d51-49ca-ba70-797a4ab6c342",r._sentryDebugIdIdentifier="sentry-dbid-890bcb99-8d51-49ca-ba70-797a4ab6c342")}catch{}})();const W={class:"modal-profile__subtitle"},Z={class:"modal-profile__footer"},$=A({__name:"ModalCompleteProfile",props:{modelValue:{type:Boolean},member:{}},emits:["update:modelValue","refresh"],setup(r,{emit:n}){var m,i,p,d,V,B,I;const{t:e}=D(),o=r,s=n,{meta:h,handleSubmit:f}=x({initialValues:{position:(m=o.member)==null?void 0:m.position,company:(i=o.member)!=null&&i.company?(p=o.member)==null?void 0:p.company.name:"",location:(d=o.member)!=null&&d.location?(V=o.member)==null?void 0:V.location:null,businessCenter:(I=(B=o.member)==null?void 0:B.businessCenter)==null?void 0:I.id}}),{mutate:g,isPending:b}=G({onSuccess:async()=>{s("refresh"),s("update:modelValue",!1)}}),v=f(c=>{b.value||g({position:c.position,company:c.company,businessCenter:c.businessCenter,location:JSON.stringify(c.location)})});return(c,y)=>(M(),E(F,{"model-value":c.modelValue,"onUpdate:modelValue":y[1]||(y[1]=C=>s("update:modelValue",C))},{title:l(()=>[u(a(t(e)("title")),1)]),default:l(()=>[z("div",W,a(t(e)("subtitle")),1),z("form",{class:"modal-profile__form",onSubmit:y[0]||(y[0]=U((...C)=>t(v)&&t(v)(...C),["prevent"]))},[_(k,{type:"string",name:"position",rules:"required",class:"modal-profile__field",placeholder:t(e)("placeholder_position")},{default:l(()=>[u(a(t(e)("labels.position")),1)]),_:1},8,["placeholder"]),_(k,{type:"string",name:"company",rules:"required",class:"modal-profile__field",placeholder:t(e)("placeholder_company")},{default:l(()=>[u(a(t(e)("labels.company")),1)]),_:1},8,["placeholder"]),_(H,{name:"location",class:"modal-profile__field",rules:"required"},{label:l(()=>[u(a(t(e)("labels.city")),1)]),_:1}),z("div",Z,[_(N,{theme:t(w).PRIMARY,type:t(T).SUBMIT,block:!1,disabled:!t(h).valid,pending:t(b)},{default:l(()=>[u(a(t(e)("submit")),1)]),_:1},8,["theme","type","disabled","pending"])])],32)]),_:1},8,["model-value"]))}});function P(r){const n=r;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{fr:{title:e=>{const{normalize:o}=e;return o(["Complétez votre profil"])},subtitle:e=>{const{normalize:o}=e;return o(["Pour pouvoir vous inscrire à cet event vous devez avoir complété votre profil avec au moins : votre poste, votre entreprise et votre ville"])},placeholder_position:e=>{const{normalize:o}=e;return o(["Renseignez votre poste"])},placeholder_company:e=>{const{normalize:o}=e;return o(["Renseignez votre entreprise"])},labels:{position:e=>{const{normalize:o}=e;return o(["Poste"])},company:e=>{const{normalize:o}=e;return o(["Entreprise"])},city:e=>{const{normalize:o}=e;return o(["Ville"])},businessCenter:e=>{const{normalize:o}=e;return o(["Business hub"])}},submit:e=>{const{normalize:o}=e;return o(["Sauvegarder"])},cross_icon:e=>{const{normalize:o}=e;return o(["✕"])}}}})}typeof P=="function"&&P($);const ee=R($,[["__scopeId","data-v-fe56db3e"]]),oe={class:"content"},te={class:"content__description"},q=A({__name:"EventDetailsAsideNeedCompleteProfile",emits:["refresh"],setup(r,{emit:n}){const e=n,{t:o}=D(),s=Q(!1),h=O(),f=Y(()=>{var m;return(m=h.authentifiedUser)==null?void 0:m.id}),{data:g,refetch:b}=j({queryKey:[J.MEMBER_DATA,f.value],queryFn:()=>K.getMember(f.value)}),v=()=>{b(),e("refresh")};return(m,i)=>{var p;return M(),L("div",oe,[z("p",te,a(t(o)("description")),1),_(N,{theme:t(w).PRIMARY,onClick:i[0]||(i[0]=d=>s.value=!0)},{default:l(()=>[u(a(t(o)("complete_profile")),1)]),_:1},8,["theme"]),s.value?(M(),E(ee,{key:0,modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=d=>s.value=d),member:(p=t(g))==null?void 0:p.data,onRefresh:v},null,8,["modelValue","member"])):X("",!0)])}}});function S(r){const n=r;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{fr:{description:e=>{const{normalize:o}=e;return o(["Pour pouvoir vous inscrire à cet event vous devez avoir rempli votre profil avec au moins : votre poste, votre entreprise et votre ville"])},complete_profile:e=>{const{normalize:o}=e;return o(["Complétez votre profil"])}},en:{}}})}typeof S=="function"&&S(q);const ae=R(q,[["__scopeId","data-v-74b6e83c"]]);export{ae as E}; //# sourceMappingURL=EventDetailsAsideNeedCompleteProfile-C_aKqXoo.js.map