PageSourceSearch

https://boomo.io/assets/VenueMap-DpnX9lST.js

js boomo.io collected 2026-10-08 19:45:36 UTC 6,941 bytes, 33 lines download raw bytes

1import{a as i,j as d}from"./query-Cv7TMIMb.js";import{L as m,K as _,k as P,a as q}from"./kartenStil-BY9mzkBE.js";import{b as G}from"./react-vendor-CuxgGW6S.js";import{aG as W}from"./ui-vendor-seEETszD.js";import"./pdf-Bj1Od7c8.js";import"./maps-jBRwKcs2.js";import"./supabase-CUQpzalg.js";const U=s=>`data:image/svg+xml;utf8,${encodeURIComponent(`
2<svg xmlns="http://www.w3.org/2000/svg" width="52" height="68" viewBox="0 0 52 68">
3  <defs>
4    <filter id="ps" x="-30%" y="-10%" width="160%" height="140%">
5      <feDropShadow dx="0" dy="3" stdDeviation="3" flood-color="#1A1A1A" flood-opacity="0.42"/>
6    </filter>
7    <mask id="bcut">
8      <rect width="52" height="68" fill="white"/>
9      <circle cx="26" cy="27" r="7" fill="none" stroke="black" stroke-width="2.5"/>
10      <rect x="17.75" y="14" width="2.5" height="13" fill="black"/>
11    </mask>
12  </defs>
13  <path
14    d="M26 2 C 39.5 2, 50 12, 50 25 C 50 39, 36 49, 26 66 C 16 49, 2 39, 2 25 C 2 12, 12.5 2, 26 2 Z"
15    fill="${s}"
16    mask="url(#bcut)"
17    filter="url(#ps)"
18  />
19</svg>
20`)}`,D=U("#933E33"),K=U("#8C8780"),Z=m.icon({iconUrl:D,iconSize:[52,68],iconAnchor:[26,66],popupAnchor:[0,-62]}),H=m.icon({iconUrl:K,iconSize:[52,68],iconAnchor:[26,66],popupAnchor:[0,-62]}),V=`data:image/svg+xml;utf8,${encodeURIComponent(`
21<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12">
22  <circle cx="6" cy="6" r="5" fill="#FFFFFF" stroke="#1A1A1A" stroke-width="1"/>
23  <circle cx="6" cy="6" r="3.2" fill="#1A1A1A"/>
24</svg>
25`)}`,J=m.icon({iconUrl:V,iconSize:[12,12],iconAnchor:[6,6],popupAnchor:[0,-7],className:"boomo-user-location-marker"}),v={};async function X(s,g){const a=[s,g].filter(Boolean).join(", ");if(!a)return null;if(v[a]!==void 0)return v[a];try{const p=await(await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(a)}&limit=1`,{headers:{"Accept-Language":"de"}})).json();if(p&&p.length>0){const x=[parseFloat(p[0].lat),parseFloat(p[0].lon)];return v[a]=x,x}}catch{}return v[a]=null,null}const z=s=>String(s??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),it=({venues:s,selectedVenueId:g,onVenueSelect:a,userCoords:o})=>{const p=G(),x=i.useRef(p);x.current=p;const w=i.useRef(null),u=i.useRef(null),h=i.useRef(null),j=i.useRef(null),b=i.useRef(null),[$,B]=i.useState([]),E=[48.2082,16.3738],[T,N]=i.useState(!1);i.useEffect(()=>{let e=!1;async function f(){N(!0);const c=[];for(const n of s){if(e)break;if(n.latitude!=null&&n.longitude!=null){c.push({...n,coords:[n.latitude,n.longitude]});continue}if(n.address||n.city){const t=await X(n.address??"",n.city??"");if(t){c.push({...n,coords:t});continue}}}e||(B(c),N(!1))}return f(),()=>{e=!0}},[s]),i.useEffect(()=>{if(!w.current||u.current)return;const e=m.map(w.current,{center:E,zoom:10,zoomControl:!0,attributionControl:!0,maxZoom:_});let f=!1;P(e).then(r=>{if(f||u.current!==e){r.entfernen();return}b.current=r});const c=m.layerGroup().addTo(e);u.current=e,j.current=c;const n=()=>{var r;u.current===e&&(e.invalidateSize(),(r=b.current)==null||r.nachmessen())},t=window.setTimeout(n,200),y=window.setTimeout(n,500);let l=w.current.clientWidth>0;const A=new ResizeObserver(r=>{const k=r[0].contentRect.width>0;k&&!l&&n(),l=k});return A.observe(w.current),()=>{var r;window.clearTimeout(t),window.clearTimeout(y),A.disconnect(),c.clearLayers(),f=!0,(r=b.current)==null||r.entfernen(),b.current=null,q(e),u.current=null,j.current=null}},[]),i.useEffect(()=>{const e=u.current,f=j.current;if(!e||!f)return;f.clearLayers();const c=[];if($.forEach(t=>{var O,L;c.push(t.coords);const y=Array.isArray(t.nextSlots)&&t.nextSlots.length>0||typeof t.classCountWeek=="number"&&t.classCountWeek>0,l=m.marker(t.coords,{icon:y?Z:H}),A=t.sportTypes.map(I=>`<span class="inline-block">${z(I)}</span>`).join(" · "),r=[t.hasIndoor?"Indoor":null,t.hasOutdoor?"Outdoor":null].filter(Boolean).join(" · "),k=t.address?`${t.address}${t.city?`, ${t.city}`:""}`:t.city??"",F=`
26        <div style="min-width: 220px; font-family: 'Inter Variable', 'Inter', system-ui, sans-serif;">
27          <div style="font-weight: 700; font-size: 15px; margin-bottom: 2px; color: #1A1A1A;">${z(t.name)}</div>
28          <div style="opacity: .6; font-size: 12px; margin-bottom: 8px; color: #1A1A1A;">${z((O=t.organization)==null?void 0:O.name)}</div>
29          ${k?`<div style="opacity: .6; font-size: 12px; margin-bottom: 8px;">${z(k)}</div>`:""}
30          ${A||r?`<div style="opacity: .75; font-size: 12px; margin-bottom: 10px;">
30${[A,r].filter(Boolean).join(" • ")}</div>`:""}
31          ${(L=t.organization)!=null&&L.slug?`<a href="/o/${encodeURIComponent(t.organization.slug)}/${encodeURIComponent(t.slug)}/book" data-ziel="/o/${encodeURIComponent(t.organization.slug)}/${encodeURIComponent(t.slug)}/book" style="display:inline-block; font-size: 12px; font-weight: 600; color: #fff; background: #1A1A1A; padding: 6px 14px; border-radius: 8px; text-decoration: none;">Jetzt buchen →</a>`:""}
32        </div>
33      `;l.bindPopup(F),l.on("popupopen",I=>{var S;const R=(S=I.popup.getElement())==null?void 0:S.querySelector("a[data-ziel]");!R||R.dataset.gebunden||(R.dataset.gebunden="1",R.addEventListener("click",M=>{M.preventDefault(),x.current(R.dataset.ziel)}))}),l.on("click",()=>a==null?void 0:a(t.id)),l.addTo(f),g&&t.id===g&&requestAnimationFrame(()=>l.openPopup())}),c.length>0){const t=m.latLngBounds(c.map(([y,l])=>[y,l]));o&&t.extend([o.lat,o.lng]),e.fitBounds(t,{padding:[50,50],maxZoom:13})}else o?e.setView([o.lat,o.lng],11):e.setView(E,10);const n=window.setTimeout(()=>{var t;u.current===e&&(e.invalidateSize(),(t=b.current)==null||t.nachmessen())},100);return()=>window.clearTimeout(n)},[$,g,a,o]),i.useEffect(()=>{const e=u.current;if(e){if(!o){h.current&&(h.current.remove(),h.current=null);return}h.current?h.current.setLatLng([o.lat,o.lng]):h.current=m.marker([o.lat,o.lng],{icon:J,zIndexOffset:1e3,keyboard:!1}).addTo(e).bindPopup('<div style="font-size:12px;font-weight:600;">Dein Standort</div>',{closeButton:!1})}},[o]);const C=T&&$.length===0&&s.length>0;return d.jsxs("div",{className:"relative h-full w-full",children:[d.jsx("div",{ref:w,className:"h-full w-full"}),C&&d.jsx("div",{className:"absolute inset-0 z-[1000] flex items-center justify-center bg-background/80 backdrop-blur-sm",children:d.jsxs("div",{className:"text-center space-y-4 p-8",children:[d.jsx("div",{className:"h-20 w-20 rounded-full bg-primary/10 mx-auto flex items-center justify-center",children:d.jsx(W,{className:"h-10 w-10 text-primary"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"font-semibold text-lg",children:"Kartenansicht"}),d.jsxs("p",{className:"text-muted-foreground text-sm mt-1",children:[s.length," Standort",s.length!==1?"e":""," in der Liste"]}),d.jsx("p",{className:"text-muted-foreground text-xs mt-2",children:"Koordinaten werden geladen…"})]})]})})]})};export{it as VenueMap,z as maskiereHtml};

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.