PageSourceSearch

https://chessagenda.com/assets/EventsMapContent-C_ML45K3.js

js chessagenda.com collected 2026-10-06 09:24:25 UTC 6,332 bytes, 9 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mapConfig-X9Kfymyg.js","assets/index-DoiMzrJI.js","assets/index-CrrzDeRr.css"])))=>i.map(i=>d[i]);
2import{r as x,j as e,M as v,c as b,_ as N,L as f,q as w,f as M,m as y,E as k,U as z,g as E,B as _}from"./index-DoiMzrJI.js";import{M as u,a as C,T as L,b as P,P as A}from"./mapConfig-X9Kfymyg.js";const I=async()=>(await N(()=>import("./mapConfig-X9Kfymyg.js").then(l=>l.l),__vite__mapDeps([0,1,2]))).divIcon({html:`
3      <div class="map-marker-icon">
4        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
5          <path d="M11.584 2.376a.75.75 0 01.832 0l9 6a.75.75 0 11-.832 1.248L12 3.901 3.416 9.624a.75.75 0 01-.832-1.248l9-6z" />
6          <path fill-rule="evenodd" d="M20.25 10.332v9.918H21a.75.75 0 010 1.5H3a.75.75 0 010-1.5h.75v-9.918a.75.75 0 01.634-.74A49.109 49.109 0 0112 9c2.59 0 5.134.202 7.616.592a.75.75 0 01.634.74zm-7.5 2.418a.75.75 0 00-1.5 0v6.75a.75.75 0 001.5 0v-6.75zm3-.75a.75.75 0 01.75.75v6.75a.75.75 0 01-1.5 0v-6.75a.75.75 0 01.75-.75zM9 12.75a.75.75 0 00-1.5 0v6.75a.75.75 0 001.5 0v-6.75z" clip-rule="evenodd" />
7        </svg>
8      </div>
9    `,className:"custom-map-marker",iconSize:[40,40],iconAnchor:[20,40],popupAnchor:[0,-40]});function S({group:t}){return e.jsxs("div",{className:"min-w-[280px] max-w-[320px]",children:[e.jsxs("div",{className:"pb-3 mb-3 border-b border-border",children:[e.jsx("h3",{className:"font-display font-semibold text-foreground text-lg",children:t.venueName}),e.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1 mt-1",children:[e.jsx(v,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:t.address})]})]}),e.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:t.events.map(l=>e.jsx(f,{to:`/events/${l.id}`,className:"block p-2.5 rounded-lg bg-muted/50 hover:bg-muted transition-colors group",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-foreground group-hover:text-primary transition-colors truncate text-sm",children:l.title}),e.jsxs("div",{className:"flex items-center gap-2 mt-1.5 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(w,{className:"w-3 h-3"}),M(new Date(l.event_date),"d MMM",{locale:y})]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(k,{className:"w-3 h-3"}),(l.price_cents/100).toFixed(0),"€"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(z,{className:"w-3 h-3"}),l.capacity]})]})]}),e.jsx(E,{className:"w-4 h-4 text-muted-foreground flex-shrink-0 mt-0.5"})]})},l.id))}),t.events.length>0&&e.jsx("div",{className:"pt-3 mt-3 border-t border-border",children:e.jsx(f,{to:`/venues/${t.venueSlug||t.venueId}`,children:e.jsx(_,{variant:"outline",size:"sm",className:"w-full text-xs",children:"Voir tous les tournois de ce lieu"})})})]})}function U({group:t}){const[l,i]=x.useState(null);return x.useEffect(()=>{I().then(i)},[]),l?e.jsx(P,{position:[t.latitude,t.longitude],icon:l,children:e.jsx(A,{className:"custom-popup",children:e.jsx(S,{group:t})})}):null}function G({events:t,className:l}){const i=t&&Array.isArray(t)?t:[],s=x.useMemo(()=>{const n={};return i.forEach(a=>{var m,d;if(!((m=a.venue)!=null&&m.latitude)||!((d=a.venue)!=null&&d.longitude))return;const o=a.venue.id;n[o]||(n[o]={venueId:o,venueSlug:a.venue.slug??null,venueName:a.venue.name,address:a.venue.address,city:a.venue.city,latitude:a.venue.latitude,longitude:a.venue.longitude,events:[]}),n[o].events.push(a)}),Object.values(n)},[i]),{center:g,zoom:j}=x.useMemo(()=>{if(s.length===0)return{center:u.defaultCenter,zoom:u.defaultZoom};if(s.length===1)return{center:[s[0].latitude,s[0].longitude],zoom:15};const n=s.reduce((r,p)=>r+p.latitude,0)/s.length,a=s.reduce((r,p)=>r+p.longitude,0)/s.length,o=Math.max(...s.map(r=>r.latitude))-Math.min(...s.map(r=>r.latitude)),m=Math.max(...s.map(r=>r.longitude))-Math.min(...s.map(r=>r.longitude)),d=Math.max(o,m);let c=12;return d>5?c=6:d>2?c=8:d>.5?c=10:d>.1?c=12:c=14,{center:[n,a],zoom:c}},[s]),h=i.filter(n=>{var a,o;return!((a=n.venue)!=null&&a.latitude)||!((o=n.venue)!=null&&o.longitude)}).length;return e.jsxs("div",{className:b("map-stack-isolate relative",l),children:[e.jsxs("div",{className:"relative rounded-2xl overflow-hidden border border-primary/20 bg-card/50 backdrop-blur-sm h-full",children:[e.jsxs(C,{center:g,zoom:j,...u.interactiveDefaults,className:"w-full h-full min-h-[400px]",style:{background:"hsl(var(--card))"},children:[e.jsx(L,{attribution:u.attribution,url:u.tileUrl}),s.map(n=>e.jsx(U,{group:n},n.venueId))]}),s.length===0&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-card/80 backdrop-blur-sm",children:e.jsxs("div",{className:"text-center p-6 max-w-sm",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-muted flex items-center justify-center mx-auto mb-4",children:e.jsx(v,{className:"w-8 h-8 text-muted-foreground"})}),e.jsx("h3",{className:"font-display text-lg font-semibold mb-2",children:"Aucun tournoi géolocalisé"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Les lieux de ces tournois n'ont pas encore de coordonnées GPS. Utilisez la vue liste pour voir tous les événements."}),i.length>
90&&e.jsxs("p",{className:"text-xs text-muted-foreground/70",children:[i.length," tournoi",i.length!==1?"s":""," disponible",i.length!==1?"s":""," en vue liste"]})]})})]}),h>0&&s.length>0&&e.jsx("div",{className:"absolute bottom-4 left-4 right-4 md:left-auto md:right-4 md:max-w-xs",children:e.jsxs("div",{className:"glass rounded-lg px-3 py-2 border border-border text-xs text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-foreground",children:h})," ","tournoi",h>1?"s":""," sans localisation (visible en liste)"]})}),e.jsx("div",{className:"absolute top-4 right-4 glass rounded-lg px-3 py-2 border border-border",children:e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("div",{className:"w-3 h-3 rounded-full bg-primary"}),e.jsxs("span",{className:"text-muted-foreground",children:[s.length," lieu",s.length!==1?"x":""]})]})})]})}export{G 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.