import{E as j}from"./Event.api-De5loNTa.js";import{d as $,ak as J,aS as Y,c as y,ad as Z,u as ee,A as te,N as ae,R as s,C as ne,b8 as re,Q as x,O as U,T as se,U as I,G as oe,o as ie,aN as le,e as r,f as u,j as T,h as a,i as m,w as _,g as C,t as f,k as h,az as ue,L as ce,z as me,F as E,X as z,aP as _e,r as S,x as de,aA as pe,V as P,M as ve,m as fe}from"./index-bWjSJxiX.js";import{E as R}from"./EventCard-BSVPgQHS.js";import{E as Ee}from"./EmptyList-CeZ-LxYG.js";import{I as be}from"./InfinitePagination-iPrLF-jd.js";import{L as ge}from"./ListTransition-BB1cHVfW.js";import{C as O}from"./CardList-BQTQ6rS8.js";import{B as Te}from"./BaseBanner-CDSwAk6p.js";import{E as Le}from"./EventCardHighlighted-mJrFzP09.js";import"./CardWithBackgroundHeader-DD1xrxbX.js";import"./AvatarList-C97kkLS9.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new l.Error().stack;n&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[n]="89a3ef6f-79e1-4570-81dd-ad98c2d01359",l._sentryDebugIdIdentifier="sentry-dbid-89a3ef6f-79e1-4570-81dd-ad98c2d01359")}catch{}})();const Ne={class:"tab"},ye={key:0,class:"my-8"},Ie={class:"flex flex-col"},Ce={key:1,class:"my-8"},he={class:"tab__cta mt-10"},w=20,D=$({__name:"EventListTab",setup(l){const n=J(),{breadcrumb:e}=Y(),t=y(()=>n.query.categories),{analytics:L}=Z(),{t:c}=ee(),B=te(),{data:b}=ae(),N=y(()=>{switch(n.name){case s.EVENT_LIST_CLUB:return"CLUB";case s.EVENT_LIST_PUBLIC:return"PUBLIC";case s.EVENT_LIST_EXTERNAL:return"EXTERNAL";default:return}}),q=({pageParam:i=1})=>j.getNetworkingOrEvents({page:i,size:w,fromDate:pe(P.now().toISODate(),{locale:"fr",format:P.DATE_SHORT}),labels:t.value,isClub:N.value==="CLUB"}),F=ne(),{data:d,error:M,refetch:G,fetchNextPage:Q,hasNextPage:V,isFetching:H,isFetchingNextPage:K,isLoading:W,isError:X}=re({queryKey:[x.EVENTS_NETWORKING,N.value,t.value],queryFn:q,getNextPageParam:i=>{var p,o;return(o=(p=i==null?void 0:i.meta)==null?void 0:p.pager)==null?void 0:o.nextPage},initialPageParam:1}),k=y(()=>{var i,p,o,g;return(p=(i=b.value)==null?void 0:i.data.membership)!=null&&p.status&&[U.RUNNING,U.SHORT_LOST].includes(b.value.data.membership.status)?{to:{name:se.EVENTS_LISTING}}:(g=(o=b.value)==null?void 0:o.data.apply)!=null&&g.status&&[I.NEW,I.WAITING_VALIDATION,I.DONE].includes(b.value.data.apply.status)?{to:{name:s.EVENT_LIST_CLUB}}:null});return oe(()=>n.query,()=>{[s.EVENT_LIST_CLUB,s.EVENT_LIST_PUBLIC,s.EVENT_LIST_EXTERNAL].includes(n.name)&&ve(()=>{F.removeQueries({queryKey:[x.EVENTS_NETWORKING]}),G()})}),ie(()=>{n.name===s.EVENT_LIST&&(L==null||L.track(le.COMMUNITY_EVENT_HOME)),e.value=[{label:c("events"),to:{name:s.EVENT_LIST_PUBLIC}},{label:c(`events_${N.value}`)}]}),(i,p)=>(r(),u("div",Ne,[T(Le),a(n).name===a(s).EVENT_LIST_PUBLIC?(r(),u("div",ye,[k.value?(r(),m(Te,{key:0,icon:"info"},{default:_(()=>[C("div",Ie,[C("p",null,f(a(c)("get_all_events")),1),T(me,ue({class:"mt-2",theme:a(ce).IMPORTANT},k.value),{default:_(()=>[h(f(a(c)("see_all_events")),1)]),_:1},16,["theme"])])]),_:1})):(r(),u(E,{key:1},[h(f(a(c)("public_events")),1)],64))])):z("",!0),!a(B).isLoggedIn&&a(n).name===a(s).EVENT_LIST_CLUB?(r(),u("p",Ce,f(a(c)("club_events")),1)):z("",!0),a(X)?(r(),m(_e,{key:2,error:a(M)},null,8,["error"])):(r(),m(be,{key:3,"fetch-next-page":a(Q),"has-next-page":a(V),fetching:a(H)||a(K),loading:a(W)},{default:_(()=>[a(d)&&a(d).pages&&a(d).pages[0]&&a(d).pages[0].data&&a(d).pages[0].data.length===0?(r(),m(Ee,{key:0})):(r(),m(ge,{key:1,tag:O},{default:_(()=>{var o;return[(r(!0),u(E,null,S((o=a(d))==null?void 0:o.pages,g=>(r(),u(E,null,[(r(!0),u(E,null,S(g.data.map(v=>({...v,picture:v.image,publicUrl:v.url})),v=>(r(),m(R,{key:v.id,event:v,detailed:"",small:""},null,8,["event"]))),128))],64))),256))]}),_:1})),C("div",he,[!a(V)&&a(n).name===a(s).EVENT_LIST_PUBLIC&&!a(B).isLoggedIn?(r(),m(de,{key:0,to:{name:a(s).EVENT_LIST_CLUB}},{default:_(()=>[h(f(a(c)("more_club_events_cta")),1)]),_:1},8,["to"])):z("",!0)])]),loading:_(()=>[T(O,null,{default:_(()=>[(r(),u(E,null,S(w,o=>T(R,{key:o,detailed:"",loading:"",small:""})),64))]),_:1})]),_:1},8,["fetch-next-page","has-next-page","fetching","loading"]))]))}});function A(l){const n=l;n.__i18n=n.__i18n||[],n.__i18n.push({locale:"",resource:{fr:{more_club_events_cta:e=>{const{normalize:t}=e;return t(["Retrouver plus d’événements du Club privé"])},club_events:e=>{const{normalize:t}=e;return t(["Nos événements sont réservés aux membres du Club. Vous pouvez cependant demander à participer à l’un d’eux avant de déposer votre candidature. La participation sera alors payante et soumise à validation."])},public_events:e=>{const{normalize:t}=e;return t(["Nos événements publics sont ouverts à tous les membres de notre réseau."])},events:e=>{const{normalize:t}=e;return t(["Événements"])},events_PUBLIC:e=>{const{normalize:t}=e;return t(["Public"])},events_CLUB:e=>{const{normalize:t}=e;return t(["Club"])},get_all_events:e=>{const{normalize:t}=e;return t(["Retrouvez l'intégralité de nos événements réservés aux membres du Club privé."])},see_all_events:e=>{const{normalize:t}=e;return t(["Voir tous les événements du Club privé"])}},en:{more_club_events_cta:e=>{const{normalize:t}=e;return t(["Find more Private Club events"])},club_events:e=>{const{normalize:t}=e;return t(["Our events are reserved for Club members. However, you can request to participate in one of them before submitting your application. Participation will then be paid and subject to validation."])},public_events:e=>{const{normalize:t}=e;return t(["Our public events are open to everyone in our network. Join Frenchfounders for free to participate!"])},events:e=>{const{normalize:t}=e;return t(["Events"])},events_PUBLIC:e=>{const{normalize:t}=e;return t(["Public"])},events_CLUB:e=>{const{normalize:t}=e;return t(["Club"])},get_all_events:e=>{const{normalize:t}=e;return t(["Discover all of our events reserved to members on the private club page."])},see_all_events:e=>{const{normalize:t}=e;return t(["See all private Club events"])}}}})}typeof A=="function"&&A(D);const Ae=fe(D,[["__scopeId","data-v-3df1f982"]]);export{Ae as default};
//# sourceMappingURL=EventListTab-DwT578Dg.js.map