PageSourceSearch

https://ay-champagne.com/_next/static/chunks/pages/agenda-e1831bc8890110d6.js

js ay-champagne.com collected 2026-10-02 06:09:04 UTC 15,662 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[320],{717:(e,l,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/agenda",function(){return r(4038)}])},4038:(e,l,r)=>{"use strict";r.r(l),r.d(l,{__N_SSG:()=>c,default:()=>u});var t=r(7876),a=r(9051),i=r(8309),s=r(955),n=r(7025),o=r(9099),d=r(4232),c=!0;function u(e){let{globals:l,pages:r,home:c}=e,u=(0,o.useRouter)(),m="string"==typeof u.query.ville?u.query.ville:"",[x,p]=(0,d.useState)([]),[h,f]=(0,d.useState)(!0),[v,g]=(0,d.useState)(0),[y,b]=(0,d.useState)([]),[j,w]=(0,d.useState)({keyword:"",ville:"",date:""}),[N,_]=(0,d.useState)(1),[k,A]=(0,d.useState)([]),[C,S]=(0,d.useState)(!0),[E,L]=(0,d.useState)(0),[M,B]=(0,d.useState)(1),z=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";f(!0);try{var a;let i=new URLSearchParams({page:e.toString(),limit:"12",sort:"field_date",order:"ASC",scope:"upcoming"});l.trim()&&i.append("keyword",l.trim()),r.trim()&&i.append("date",r.trim()),t&&t.trim()&&i.append("ville",t.trim());let s=await fetch("/api/content/agenda?".concat(i.toString()));if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e.message||"Erreur ".concat(s.status," lors du chargement des agendas"))}let n=await s.json();p(n.agendas||[]),_(Number((null==(a=n.pagination)?void 0:a.totalPages)||1))}catch(e){console.error("Erreur lors du chargement des agendas:",e),p([])}finally{f(!1)}},D=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;S(!0);try{var l;let r=new URLSearchParams({page:e.toString(),limit:"12",sort:"field_date",order:"DESC",scope:"past"}),t=await fetch("/api/content/agenda?".concat(r.toString()));if(!t.ok)throw Error("Erreur ".concat(t.status));let a=await t.json();A(a.agendas||[]),B(Number((null==(l=a.pagination)?void 0:l.totalPages)||1))}catch(e){console.error("Erreur lors du chargement des agendas pass\xe9s:",e),A([]),B(1)}finally{S(!1)}};(0,d.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/content/ville");if(e.ok){let l=await e.json();b(Array.isArray(null==l?void 0:l.villes)?l.villes:[])}}catch(e){console.error("Erreur lors du chargement des villes:",e)}})()},[]),(0,d.useEffect)(()=>{z(v,j.keyword,j.date,m)},[v,j.keyword,j.date,m]),(0,d.useEffect)(()=>{g(0)},[m]),(0,d.useEffect)(()=>{w(e=>({...e,ville:m||""}))},[m]),(0,d.useEffect)(()=>{D(E)},[E]);let P=(e,l)=>{w(r=>({...r,[e]:l}))};return(0,t.jsxs)(s.A,{globals:l,home:0,image:r.homepage.field_medias[0].field_media_image,breadcrumbs:[{label:"Accueil",path:"/"},{label:"D\xe9couvrir",path:null},{label:"Agenda",path:null}],showBreadcrumbs:!0,title:"Agenda de vos communes",description:"Ne rien louper des sorties \xe0 venir !",children:[(0,t.jsx)("section",{className:"py-12",children:(0,t.jsxs)("div",{className:"container px-4 mx-auto",children:[(0,t.jsx)("h1",{className:" text-3xl font-bold text-primary lg:text-[50px]",children:"Agenda de vos communes"}),(0,t.jsx)("p",{className:"mb-8 text-[32px] text-primary",children:"Ne rien louper des sorties \xe0 venir !"}),(0,t.jsx)("form",{onSubmit:e=>{e.preventDefault(),g(0),z(0,j.keyword,j.date,j.ville)},className:"mb-8",children:(0,t.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-end",children:[(0,t.jsxs)("div",{className:"relative flex-1",children:[(0,t.jsx)("input",{type:"text",id:"keyword",value:j.keyword,onChange:e=>P("keyword",e.target.value),placeholder:"Rechercher un \xe9v\xe9nement...",className:"px-4 py-2 pr-10 w-full rounded-2xl border border-secondary focus:outline-none focus:ring-2 focus:ring-primary"}),j.keyword&&(0,t.jsx)("button",{type:"button",onClick:()=>P("keyword",""),className:"absolute right-3 top-1/2 text-gray-400 transition-colors -translate-y-1/2 hover:text-gray-600","aria-label":"Effacer la recherche",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsxs)("select",{id:"ville",value:j.ville,onChange:e=>{let l=e.target.value;P("ville",l),g(0),u.push({pathname:"/agenda",query:l?{ville:l}:{}},void 0,{shallow:!0})},className:"px-4 py-2 w-full bg-white rounded-2xl border appearance-none border-secondary focus:outline-none focus:ring-2 focus:ring-primary",children:[(0,t.jsx)("option",{value:"",children:"Tous les lieux"}),y.map(e=>(0,t.jsx)("option",{value:(0,n.Ai)(String(e.name||"")),children:e.name},e.id))]})}),(0,t.jsxs)("div",{className:"relative flex-1",children:[(0,t.jsx)("input",{type:"date",id:"date",value:j.date,onChange:e=>P("date",e.target.value),className:"px-4 py-2 pr-10 w-full rounded-2xl border border-secondary focus:outline-none focus:ring-2 focus:ring-primary"}),j.date&&(0,t.jsx)("button",{type:"button",onClick:()=>P("date",""),className:"absolute right-3 top-1/2 text-gray-400 transition-colors -translate-y-1/2 hover:text-gray-600","aria-label":"Effacer la date",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,t.jsx)("button",{type:"submit",className:"px-6 py-2 text-white rounded-2xl border transition-colors duration-200 border-secondary bg-secondary hover:bg-secondary/90 lg:mb-0",children:"Recherchez"})]})}),h?(0,t.jsx)("div",{className:"py-12 text-center",children:(0,t.jsx)("p",{className:"text-gray-400",children:"Chargement..."})}):0===x.length?(0,t.jsx)("div",{className:"py-12 text-center",children:(0,t.jsx)("p",{className:"text-gray-400",children:"Aucun \xe9v\xe9nement trouv\xe9 pour ces crit\xe8res."})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",children:x.map(e=>(0,t.jsx)(a.A,{item:e,home:c}
1,e.id))}),N>1&&(0,t.jsxs)("div",{className:"flex gap-2 justify-center items-center mt-8",children:[(0,t.jsx)("button",{onClick:()=>g(e=>Math.max(0,e-1)),disabled:0===v,className:"px-4 py-2 rounded-lg border transition-colors duration-200 text-primary border-primary disabled:opacity-50 disabled:cursor-not-allowed hover:bg-primary hover:text-white",children:"←"}),Array.from({length:N},(e,l)=>l).map(e=>(0,t.jsx)("button",{onClick:()=>g(e),className:"px-4 py-2 rounded-lg transition-colors duration-200 ".concat(v===e?"bg-primary text-white":"text-primary border border-primary hover:bg-primary hover:text-white"),children:e+1},e)),(0,t.jsx)("button",{onClick:()=>g(e=>Math.min(N-1,e+1)),disabled:v>=N-1,className:"px-4 py-2 rounded-lg border transition-colors duration-200 text-primary border-primary disabled:opacity-50 disabled:cursor-not-allowed hover:bg-primary hover:text-white",children:"→"})]})]})]})}),(0,t.jsx)("section",{className:"py-12 bg-gray-50",children:(0,t.jsxs)("div",{className:"container px-4 mx-auto",children:[(0,t.jsx)("h2",{className:"text-2xl font-bold text-primary lg:text-[35px] mb-8",children:"\xc9v\xe9nements pass\xe9s"}),C?(0,t.jsx)("div",{className:"py-12 text-center",children:(0,t.jsx)("p",{className:"text-gray-400",children:"Chargement..."})}):0===k.length?(0,t.jsx)("div",{className:"py-12 text-center",children:(0,t.jsx)("p",{className:"text-gray-400",children:"Aucun \xe9v\xe9nement pass\xe9."})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",children:k.map(e=>(0,t.jsx)(a.A,{item:e,home:c},e.id))}),M>1&&(0,t.jsxs)("div",{className:"flex gap-2 justify-center items-center mt-8",children:[(0,t.jsx)("button",{onClick:()=>L(e=>Math.max(0,e-1)),disabled:0===E,className:"px-4 py-2 rounded-lg border transition-colors duration-200 text-primary border-primary disabled:opacity-50 disabled:cursor-not-allowed hover:bg-primary hover:text-white",children:"←"}),Array.from({length:M},(e,l)=>l).map(e=>(0,t.jsx)("button",{onClick:()=>L(e),className:"px-4 py-2 rounded-lg transition-colors duration-200 ".concat(E===e?"bg-primary text-white":"text-primary border border-primary hover:bg-primary hover:text-white"),children:e+1},e)),(0,t.jsx)("button",{onClick:()=>L(e=>Math.min(M-1,e+1)),disabled:E>=M-1,className:"px-4 py-2 rounded-lg border transition-colors duration-200 text-primary border-primary disabled:opacity-50 disabled:cursor-not-allowed hover:bg-primary hover:text-white",children:"→"})]})]})]})}),(0,t.jsx)(i.A,{})]})}},8309:(e,l,r)=>{"use strict";r.d(l,{A:()=>x});var t=r(7876),a=r(7025),i=r(251),s=r(4587),n=r.n(s),o=r(8230),d=r.n(o),c=r(4232),u=r(1247),m=r(3349);let x=()=>{let[e,l]=(0,c.useState)([]),[r,s]=(0,c.useState)(!0),[o,x]=(0,c.useState)("");return((0,c.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/content/document?limit=100&sort=changed&order=DESC");if(!e.ok)return;let r=await e.json();l(Array.isArray(null==r?void 0:r.documents)?r.documents:[])}catch(e){console.error("Erreur lors du chargement des documents:",e)}finally{s(!1)}})()},[]),(0,c.useEffect)(()=>{(async()=>{try{var e,l;let r=await fetch("/api/content/basic?id=796fe2f5-cedd-4a72-a2b4-ec289df8d916");if(!r.ok)return;let t=await r.json(),a=null==t?void 0:t.basic,i=(null==a||null==(e=a.body)?void 0:e.processed)||(null==a||null==(l=a.body)?void 0:l.value)||(null==a?void 0:a.body)||"";"string"==typeof i&&x(i)}catch(e){console.error("Erreur lors du chargement du texte d'intro:",e)}})()},[]),r)?null:(0,t.jsxs)("section",{className:"container px-4 py-6 mx-auto relative grid grid-cols-1 lg:grid-cols-[40%_60%] gap-12 mt-32",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)(m._,{subtitle:"SOCIAL",iconClass:"ay-social",dotClassName:"bg-yellow-300"}),(0,t.jsx)("h2",{className:"mb-2 text-2xl font-bold text-primary",children:"Gardons le contact"}),o?(0,t.jsx)("div",{className:"mb-6 text-primary text-[16px]",children:(0,t.jsx)(u.A,{value:o,className:"text-primary text-[16px]"})}):null,(0,t.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>{var l,r,s,n,o,d;let c=(null==e?void 0:e.attributes)||e,u=(null==c?void 0:c.info)||"Document",m=null==c?void 0:c.field_icone,x=(null==c||null==(l=c.field_couleur)?void 0:l.color)||(null==c?void 0:c.field_couleur),p=(null==e?void 0:e.field_medias)||(null==e||null==(s=e.relationships)||null==(r=s.field_medias)?void 0:r.data)||[],h=null;if(null==c||null==(n=c.field_link)?void 0:n.uri)h=c.field_link.uri;else if(Array.isArray(p)&&p.length>0){let e=p[0];(null==e||null==(d=e.field_media_document)||null==(o=d.uri)?void 0:o.url)&&(h=(0,a.rf)(e.field_media_document.uri.url))}return(0,t.jsxs)("a",{href:h||"#",className:"flex gap-4 items-center p-2 bg-white rounded-2xl transition group hover:border-primary",target:h?"_blank":void 0,rel:h?"noreferrer":void 0,children:[(0,t.jsx)("span",{className:"flex justify-center items-center w-10 h-10 rounded-full text-white transition-all duration-300 ring-6 ring-primary/20 group-hover:scale-105 ".concat("#121B60"==x?"group-hover:!bg-secondary":"group-hover:!bg-primary"),style:{backgroundColor:x||"#121B60"},children:"fa-facebook"===m?(0,t.jsx)(i.A,{color:"#fff",size:22}):m?(0,t.jsx)("i",{className:"".concat(m," !text-white text-[22px]")}):"string"==typeof h&&h.toLowerCase().includes("facebook")?(0,t.jsx)(i.A,{color:"#fff",size:22}):(0,t.jsx)("i",{className:"ay-fichier !text-white text-[22px]"})}),(0,t.jsx)("span",{className:"font-bold ".concat("#121B60"==x?"group-hover:!text-secondary":"group-hover:!text-primary"),style:{color:x||"#121B60"},children:u})]},e.id)})})]}),(0,t.jsx)("div",{className:"flex relative gap-4 items-start h-full",children:e.map(e=>{var l,r,i,s,o,c,u;let m=(null==e?void 0:e.attributes)||e,x=(null==e?void 0:e.field_medias)||(null==e||null==(r=e.relationships)||null==(l=r.field_medias)?void 0:l.data)||[],p=Array.isArray(x)&&x.find(e=>{var l,r;return null==e||null==(r=e.field_media_image)||null==(l=r.uri)?void 0:l.url}),h=(null==p||null==(s=p.field_media_image)||null==(i=s.uri)?void 0:i.url)?(0,a.rf)(p.field_media_image.uri.url):null,f=null;if(null==m||null==(o=m.field_link)?void 0:o.uri)f=m.field_link.uri;else if(Array.isArray(x)&&x.length>0){let e=x[0];(null==e||null==(u=e.field_media_document)||null==(c=u.uri)?void 0:c.url)&&(f=(0,a.rf)(e.field_media_document.uri.url))}return h&&f?(0,t.jsx)(d(),{href:f,target:"_blank",rel:"noreferrer",className:"block w-full",children:(0,t.jsx)("div",{className:"flex overflow-hidden relative items-start w-full",children:(0,t.jsx)(n(),{src:h,alt:"Document",width:2e3,height:1056,className:"object-contain w-full rounded-[20px] transition-all duration-300 hover:scale-95 hover:border-4 hover:border-secondary"})})},e.id):null})})]})}},9051:(e,l,r)=>{"use strict";r.d(l,{A:()=>d});var t=r(7876),a=r(4587),i=r.n(a),s=r(7025),n=r(1247),o=r(5555);let d=e=>{var l,r,a,d,c,u,m,x,p,h,f,v;let{item:g,home:y=0}=e,b=(0,s.xt)(g.field_date,g.field_date_fin);return(0,t.jsxs)("div",{className:"overflow-hidden relative w-full h-full rounded-3xl shadow-lg aspect-square group",children:[(0,t.jsx)(i(),{src:(0,s.rf)(null==g||null==(a=g.field_media)||null==(r=a.field_media_image)||null==(l=r.uri)?void 0:l.url),fill:!0,alt:(null==g?void 0:g.title)||"\xc9v\xe9nement",className:"object-cover w-full h-full transition-transform duration-500 group-hover:scale-110"}),(0,t.jsx)("div",{className:"absolute flex z-[20]  ",children:(0,t.jsx)("div",{className:"w-full",children:(0,t.jsxs)("div",{className:"ml-12 relative w-[260px] h-[130px] mx-auto flex items-center justify-center",children:[(0,t.jsx)("div",{className:"absolute -top-[145px] left-1/2 -translate-x-1/2 w-[280px] h-[280px] rounded-full bg-white"}),(0,t.jsxs)("div",{className:"flex top-1/2 left-1/2 z-10 flex-col justify-center items-center px-4 py-2 leading-none text-center w-full  ".concat(y?"text-primary":"text-secondary"),children:[(0,t.jsx)("span",{className:"block text-[30px] font-bold",children:b}),g.field_heure&&(0,t.jsx)("span",{className:"block text-[20px] font-medium mt
1-1",children:g.field_heure})]})]})})}),(g.field_type||g.field_tag)&&(0,t.jsx)("div",{className:"absolute top-4 right-4 z-[20]",children:(0,t.jsx)("span",{className:"px-3 py-1 text-[16px] font-bold text-white rounded-full",style:{backgroundColor:(null==(c=g.field_type)||null==(d=c.field_couleur)?void 0:d.color)||(null==(u=g.field_type)?void 0:u.field_couleur)||(null==(x=g.field_tag)||null==(m=x.field_couleur)?void 0:m.color)||"#1e3a8a"},children:(null==(p=g.field_type)?void 0:p.name)||(null==(h=g.field_tag)?void 0:h.name)||""})}),(0,t.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-6 text-white bg-gradient-to-t to-transparent from-black/90 via-black/50",children:[(0,t.jsx)("span",{className:"text-xs font-bold  opacity-80 text-[20px]",children:(null==g||null==(f=g.field_adresse)?void 0:f.locality)||"A\xff-Champagne"}),(0,t.jsx)("h3",{className:"mt-1 text-[30px] font-black",children:(null==g?void 0:g.title)||"Titre de l'\xe9v\xe9nement"}),g.field_baseline&&(0,t.jsx)(n.A,{value:(0,s.IN)(g.field_baseline||g.field_baseline,200),className:"mb-6 text-sm text-white opacity-90 line-clamp-3"}),(0,t.jsx)(o.A,{title:"En savoir plus",link:(null==(v=g.path)?void 0:v.alias)||"#",className:"absolute text-white border-white opacity-0 transition-all duration-500  group-hover:!relative -translate-y-24 group-hover:translate-y-0 hover:bg-white hover:text-primary group-hover:opacity-100"}),(null==g?void 0:g.description)&&(0,t.jsx)("p",{className:"mt-2 text-xs opacity-70 line-clamp-2",children:g.description})]})]})}}},e=>{e.O(0,[599,304,636,593,792],()=>e(e.s=717)),_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.