PageSourceSearch

https://www.cscdavin.fr/assets/Courses-CfV1sWJ0.js

js cscdavin.fr collected 2026-10-08 10:03:57 UTC 12,187 bytes, 1 lines download raw bytes

1import{a as Q,b as O,r as b,d as m,j as e,H as W,S as G,C as J,g as X,c as Y,M as Z,e as ee,U as se,A as B,f as te,h as re,L as ae,i as le,k as ne,l as ie,F as oe}from"./index-pqxrMwdv.js";import{I as ce}from"./input-Yv9SzjbM.js";import{S as N,a as v,b as w,c as k,d,e as de}from"./select-BKFPK-NV.js";import{S as _}from"./search-3XLPf_KK.js";import"./index-DdvK4hCX.js";import"./check-DNpyGKa9.js";const C={musique:{href:"/culture-sport/musique-et-chant#cours",label:"Musique"},danse:{href:"/culture-sport/danse#cours",label:"Danse"},sport:{href:"/culture-sport/arts-martiaux#cours",label:"Arts martiaux"},arts:{href:"/culture-sport/art-et-culture#cours",label:"Art & culture"},"bien-etre":{href:"/culture-sport/detente#cours",label:"Bien-être"},famille:{href:"/enfance-jeunesse/enfance",label:"Famille"}},S=l=>l.toLocaleLowerCase("fr").normalize("NFD").replace(/[\u0300-\u036f]/g,""),me=l=>l.split(/\s+/).filter(Boolean).slice(0,2).map(o=>o[0]).join("").toUpperCase(),E=l=>{const o=new Map;return l.forEach(r=>{const n=`${r.category}:${S(r.title)}`,i=o.get(n);if(i){i.lessons.push(r);return}o.set(n,{key:n,lessons:[r],title:r.title})}),[...o.values()].map(r=>({...r,lessons:r.lessons.sort((n,i)=>m(n.day)-m(i.day)||n.start.localeCompare(i.start)||n.group.localeCompare(i.group,"fr"))})).sort((r,n)=>r.title.localeCompare(n.title,"fr"))},xe=(l,o)=>o?l===0?"Complet":`${l} place${l>1?"s":""}`:"À confirmer",je=()=>{Q();const{lessons:l,registrations:o}=O(),[r,n]=b.useState(""),[i,L]=b.useState("all"),[p,P]=b.useState("all"),[j,z]=b.useState("all"),h=new Map;o.forEach(s=>{if(s.status==="waitlist")return;const a=l.find(u=>u.id===s.lessonId);(a==null?void 0:a.occupiedPlaces)===void 0&&h.set(s.lessonId,(h.get(s.lessonId)??0)+1)});const x=l.filter(s=>s.status==="published"),F=E(x),U=[...new Set(x.map(s=>s.day))].sort((s,a)=>m(s)-m(a)),H=Object.keys(C).filter(s=>x.some(a=>a.category===s)),D=S(r.trim()),y=x.filter(s=>i==="all"||s.category===i).filter(s=>p==="all"||s.day===p).filter(s=>j==="all"||s.availabilityKnown!==!1&&s.capacity-(s.occupiedPlaces??h.get(s.id)??0)>0).filter(s=>!D||S([s.title,s.teacher,s.group,s.room,s.description].join(" ")).includes(D)).sort((s,a)=>s.title.localeCompare(a.title,"fr")||m(s.day)-m(a.day)||s.start.localeCompare(a.start)),f=E(y),A=()=>{n(""),L("all"),P("all"),z("all")};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(W,{}),e.jsxs("main",{children:[e.jsxs("section",{className:"relative overflow-hidden bg-[#123f49] pb-20 pt-40 text-white md:pb-24 md:pt-44",children:[e.jsx("div",{"aria-hidden":!0,className:"absolute -right-20 -top-20 h-96 w-96 rounded-full bg-primary/40 blur-3xl"}),e.jsx("div",{"aria-hidden":!0,className:"absolute -bottom-32 left-1/4 h-80 w-80 rounded-full bg-secondary/18 blur-3xl"}),e.jsxs("div",{className:"container-tight relative",children:[e.jsxs("span",{className:"hero-eyebrow",children:[e.jsx(G,{className:"h-4 w-4 text-accent"})," Programme à jour"]}),e.jsxs("div",{className:"mt-7 grid gap-8 lg:grid-cols-[1fr_auto] lg:items-end",children:[e.jsxs("div",{className:"max-w-4xl",children:[e.jsxs("h1",{className:"font-display text-5xl leading-[0.98] sm:text-6xl md:text-7xl",children:["Tous les cours,",e.jsx("span",{className:"block italic text-[hsl(78_55%_72%)]",children:"au même endroit."})]}),e.jsx("p",{className:"mt-6 max-w-2xl text-base leading-7 text-white/68 md:text-lg",children:"Recherchez une activité par jour, univers ou intervenant. Les horaires et places disponibles sont synchronisés avec l’équipe du centre."})]}),e.jsxs("div",{className:"rounded-[1.6rem] border border-white/12 bg-white/8 px-6 py-5 backdrop-blur-sm",children:[e.jsx("p",{className:"font-display text-5xl leading-none",children:F.length}),e.jsx("p",{className:"mt-2 text-xs font-semibold uppercase tracking-[0.2em] text-white/55",children:"activités"}),e.jsxs("p",{className:"mt-1 text-xs text-white/45",children:[x.length," créneaux au total"]})]})]})]})]}),e.jsxs("section",{className:"container-tight py-14 md:py-20",children:[e.jsxs("div",{className:"relative z-30 rounded-[1.7rem] border border-primary/10 bg-background/95 p-3 shadow-card backdrop-blur-xl md:sticky md:top-[100px] md:p-5",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2.5 md:gap-3 xl:grid-cols-[1.5fr_1fr_1fr_1fr]",children:[e.jsxs("label",{className:"relative col-span-2 xl:col-span-1",children:[e.jsx(_,{className:"absolute left-4 top-1/2 h-4 w-4 -translate-y-1/2 text-primary"}),e.jsx(ce,{value:r,onChange:s=>n(s.target.value),className:"h-12 rounded-full border-primary/12 bg-white pl-11",placeholder:"Cours, intervenant, salle…"})]}),e.jsxs(N,{value:i,onValueChange:s=>L(s),children:[e.jsx(v,{className:"h-12 rounded-full border-primary/12 bg-white px-4",children:e.jsx(w,{placeholder:"Tous les univers"})}),e.jsxs(k,{children:[e.jsx(d,{value:"all",children:"Tous les univers"}),H.map(s=>e.jsx(d,{value:s,children:C[s].label},s))]})]}),e.jsxs(N,{value:p,onValueChange:P,children:[e.jsx(v,{className:"h-12 rounded-full border-primary/12 bg-white px-4",children:e.jsx(w,{placeholder:"Tous les jours"})}),e.jsxs(k,{children:[e.jsx(d,{value:"all",children:"Tous les jours"}),U.map(s=>e.jsx(d,{value:s,children:s},s))]})]}),e.jsxs(N,{value:j,onValueChange:s=>
1z(s),children:[e.jsx(v,{className:"col-span-2 h-12 rounded-full border-primary/12 bg-white px-4 xl:col-span-1",children:e.jsx(w,{})}),e.jsxs(k,{children:[e.jsx(d,{value:"all",children:"Toutes les jauges"}),e.jsx(d,{value:"available",children:"Places disponibles"})]})]})]}),e.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3 px-1 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(de,{className:"h-4 w-4 text-primary"}),f.length," activité",f.length>1?"s":""," · ",y.length," créneau",y.length>1?"x":""]}),(r||i!=="all"||p!=="all"||j!=="all")&&e.jsx("button",{type:"button",onClick:A,className:"font-semibold text-primary hover:underline",children:"Effacer les filtres"})]})]}),e.jsx("div",{className:"mt-8 grid items-start gap-6 md:grid-cols-2",children:f.map((s,a)=>{var R,T;const u=s.lessons[0],I=C[u.category],c=[...new Set(s.lessons.map(t=>t.teacher))],M=((R=s.lessons.find(t=>t.teacherPhotoUrl))==null?void 0:R.teacherPhotoUrl)??"",$=((T=s.lessons.find(t=>t.description&&!t.description.startsWith("Créneau confirmé")))==null?void 0:T.description)??"",g=s.lessons.map(t=>{const K=t.occupiedPlaces??h.get(t.id)??0,V=Math.max(t.capacity-K,0),q=t.availabilityKnown!==!1;return e.jsxs("div",{className:"rounded-2xl border border-primary/9 bg-background/65 p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-semibold text-foreground",children:t.group}),e.jsxs("p",{className:"mt-1 flex items-start gap-2 text-sm leading-5 text-foreground/70",children:[e.jsx(J,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),X(t)]})]}),e.jsx("span",{className:Y("shrink-0 rounded-full px-2.5 py-1 text-[11px] font-semibold",q?V>
10?"bg-[#e6f4e7] text-secondary":"bg-foreground/8 text-foreground/65":"bg-primary/8 text-primary"),children:xe(V,q)})]}),e.jsxs("p",{className:"mt-2 flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(Z,{className:"h-3.5 w-3.5 shrink-0 text-primary/70"}),e.jsx("span",{className:"truncate",children:t.room})]}),t.excludedDates.length>0&&e.jsxs("p",{className:"mt-2 text-xs font-medium text-accent-foreground",children:[t.excludedDates.length," interruption",t.excludedDates.length>1?"s":""," signalée",t.excludedDates.length>1?"s":""]})]},t.id)});return e.jsxs("article",{className:"reveal-on-scroll group overflow-hidden rounded-[1.8rem] border border-primary/9 bg-white shadow-soft transition-all duration-500 hover:-translate-y-1 hover:shadow-card",style:{transitionDelay:`${Math.min(a,5)*50}ms`},children:[e.jsxs("div",{className:"relative aspect-[16/7] overflow-hidden",children:[e.jsx("img",{src:ee(u),alt:`Cours de ${s.title}`,className:"h-full w-full object-cover transition-transform duration-700 group-hover:scale-105",loading:"lazy"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-foreground
1/80 via-foreground/10 to-foreground/5"}),e.jsx("span",{className:"absolute left-4 top-4 rounded-full bg-white/90 px-3 py-1.5 text-[11px] font-bold uppercase tracking-[0.14em] text-primary backdrop-blur",children:I.label}),e.jsxs("span",{className:"absolute right-4 top-4 rounded-full bg-foreground/75 px-3 py-1.5 text-xs font-semibold text-white backdrop-blur",children:[s.lessons.length," créneau",s.lessons.length>1?"x":""]}),e.jsxs("div",{className:"absolute inset-x-5 bottom-4 text-white",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.17em] text-white/68",children:c.length>1?`${c.length} intervenants`:c[0]}),e.jsx("h2",{className:"mt-1 font-display text-3xl leading-tight",children:s.title})]})]}),e.jsxs("div",{className:"p-5 md:p-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[M&&c.length===1?e.jsx("img",{src:M,alt:`Portrait de ${c[0]}`,className:"h-12 w-12 rounded-full object-cover"}):e.jsx("span",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-bold text-primary",children:c.length===1?me(c[0]):e.jsx(se,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-primary/60",children:c.length>1?"Intervenants":"Intervenant"}),e.jsx("p",{className:"line-clamp-2 font-semibold text-foreground",children:c.join(" · ")})]})]}),$&&e.jsx("p",{className:"mt-4 line-clamp-2 text-sm leading-6 text-muted-foreground",children:$}),e.jsx("div",{className:"mt-5 space-y-3 border-t border-primary/8 pt-4",children:g.slice(0,3)}),g.length>3&&e.jsxs("details",{className:"group/more mt-3",children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between rounded-2xl border border-dashed border-primary/18 px-4 py-3 text-sm font-semibold text-primary transition-colors hover:bg-primary/5",children:["Voir les ",g.length-3," autres créneaux",e.jsx(B,{className:"h-4 w-4 transition-transform group-open/more:rotate-90"})]}),e.jsx("div",{className:"mt-3 space-y-3",children:g.slice(3)})]}),e.jsxs("p",{className:"mt-4 flex items-start gap-2.5 text-xs text-muted-foreground",children:[e.jsx(te,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),re(u)]}),e.jsxs(ae,{to:I.href,className:"mt-5 flex items-center justify-between rounded-full border border-primary/12 bg-background px-4 py-3 text-sm font-semibold text-foreground transition-colors hover:text-primary",children:["Voir la fiche détaillée ",e.jsx(B,{className:"h-4 w-4"})]})]})]},s.key)})}),f.length===0&&e.jsxs("div",{className:"mt-8 rounded-[2rem] border border-dashed border-primary/15 bg-gradient-soft p-10 text-center",children:[e.jsx(_,{className:"mx-auto h-8 w-8 text-primary/50"}),e.jsx("h2",{className:"mt-4 font-display text-3xl text-foreground",children:"Aucun cours ne correspond"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Modifiez les filtres ou contactez le centre pour être orienté."}),e.jsx(le,{type:"button",variant:"outline",onClick:A,className:"mt-5 rounded-full",children:"Voir tous les cours"})]}),e.jsxs("div",{className:"mt-12 flex flex-col gap-5 rounded-[2rem] bg-foreground p-6 text-white sm:flex-row sm:items-center sm:justify-between md:p-8",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.2em] text-accent",children:"Besoin d'un conseil ?"}),e.jsx("h2",{className:"mt-2 font-display text-3xl",children:"L'équipe vous aide à choisir."}),e.jsx("p",{className:"mt-2 text-sm text-white/65",children:"Pas d'inscription en ligne : échangez directement avec le centre."})]}),e.jsxs("a",{href:ne.emailHref,className:"inline-flex shrink-0 items-center justify-center rounded-full bg-accent px-5 py-3 text-sm font-bold text-accent-foreground transition-transform hover:-translate-y-0.5",children:[e.jsx(ie,{className:"mr-2 h-4 w-4"}),"Nous contacter"]})]})]})]}),e.jsx(oe,{})]})};export{je 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.