PageSourceSearch

https://freeflowhassleholm.lovable.app/assets/AreaMap-Ojr8quyK.js

js freeflowhassleholm.lovable.app collected 2026-10-03 03:31:50 UTC 9,764 bytes, 1 lines download raw bytes

1import{p as q,q as G,s as Y,t as J,v as Q,r as o,w as X,x as T,y as ee,j as e,M as se,a as te,b as ne,c as $,T as re,P as H,d as u,h as ie,f as p,g as Z,z as oe,A as le,l as ae,L as v,B as ce,C as de,u as w}from"./index-p_6J_02v.js";import{C as xe,a as me}from"./CircleMarker-DAkWmb5E.js";const ue=(r,t,n=32)=>v.divIcon({html:ce(r,t,n),className:"",iconSize:[n,n],iconAnchor:[n/2,n/2],popupAnchor:[0,-n/2]}),he=(r,t,n=22)=>v.divIcon({html:de(r,t,n),className:"",iconSize:[n,n],iconAnchor:[n/2,n/2]}),pe=({coordinates:r,fallbackCenter:t,fallbackZoom:n,skip:c=!1})=>{const d=w();return o.useEffect(()=>{c||(r&&r.length>1?d.fitBounds(v.latLngBounds(r),{padding:[24,24]}):d.setView(t,n))},[r,d]),null},fe=()=>{const r=w();return o.useEffect(()=>{const t=new ResizeObserver(()=>r.invalidateSize({pan:!1}));return t.observe(r.getContainer()),()=>t.disconnect()},[r]),null},ge=({position:r,flown:t})=>{const n=w();return o.useEffect(()=>{if(!r)return;const c=`${r[0]},${r[1]}`;t.current!==c&&(t.current=c,n.setView(r,Math.max(n.getZoom(),15),{animate:!0}))},[n,r,t]),null},je=({store:r})=>{const t=w();return o.useEffect(()=>{const n=()=>{const c=t.getCenter();r.current={center:[c.lat,c.lng],zoom:t.getZoom()}};return t.on("moveend",n),t.on("zoomend",n),()=>{t.off("moveend",n),t.off("zoomend",n)}},[t,r]),null},ve=(r,t=28)=>v.divIcon({html:`<div style="width:${t}px;height:${t}px;display:flex;align-items:center;justify-content:center;background:${r};border:2.5px solid #fff;border-radius:50%;box-shadow:0 2px 8px hsl(0 0% 0% / 0.35);color:#fff;font-size:${Math.round(t*.5)}px;line-height:1;">👷</div>`,className:"",iconSize:[t,t],iconAnchor:[t/2,t/2],popupAnchor:[0,-t/2]}),ye=({className:r="",stations:t=[],routesVisible:n=!0,extrasVisible:c=!0,focusRouteId:d=null})=>{var O,L;const{data:B=[]}=q(),{settings:l}=G(),{data:R}=Y(),g=J(R),C=Q(),j=o.useMemo(()=>X(l.previewMeters,l.routeOffsets,l.routeStartOverrides),[l.previewMeters,l.routeOffsets,l.routeStartOverrides]),b=T[l.mapStyle]??T.voyager,x=o.useMemo(()=>d?ee.find(s=>s.id===d)??null:null,[d]),E=l.showRoutes&&n&&!x,y=c?B.filter(s=>s.visible):[],[a,A]=o.useState(!1),[N,D]=o.useState(null),[_,k]=o.useState(!1),[P,M]=o.useState(null),f=o.useRef(null),K=o.useRef(null),F=o.useRef(void 0);F.current!==d&&(F.current=d,f.current=null);const U=f.current!=null,V=((O=f.current)==null?void 0:O.center)??l.viewCenter,z=((L=f.current)==null?void 0:L.zoom)??l.viewZoom;o.useEffect(()=>{if(!a)return;const s=m=>{m.key==="Escape"&&A(!1)},i=document.body.style.overflow;return document.body.style.overflow="hidden",window.addEventListener("keydown",s),()=>{document.body.style.overflow=i,window.removeEventListener("keydown",s)}},[a]);const W=o.useCallback(()=>{if(!navigator.geolocation){M("Din enhet stöder inte positionering.");return}k(!0),M(null),navigator.geolocation.getCurrentPosition(s=>{D([s.coords.latitude,s.coords.longitude]),k(!1)},()=>{k(!1),M("Kunde inte hämta din position. Tillåt platsåtkomst och försök igen.")},{enableHighAccuracy:!0,timeout:1e4})},[]),I=e.jsxs("div",{className:a?"fixed inset-0 z-[9999] flex flex-col overflow-hidden bg-background":`overflow-hidden rounded-lg border border-border ${r}`,style:a?{height:"100dvh",width:"100vw"}:void 0,children:[e.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-2 bg-muted/50 px-3 py-2 text-xs",children:[e.jsxs("button",{onClick:W,className:"inline-flex items-center gap-1 rounded-full bg-muted px-2.5 py-1 font-medium text-muted-foreground transition-colors hover:bg-muted-foreground/10",children:[e.jsx(xe,{className:"h-3.5 w-3.5"}),_?"Söker…":"Min position"]}),e.jsxs("button",{onClick:()=>A(s=>!s),className:"inline-flex items-center gap-1 rounded-full bg-muted px-2.5 py-1 font-medium text-muted-foreground transition-colors hover:bg-muted-foreground/10",children:[a?e.jsx(se,{className:"h-3.5 w-3.5"}):e.jsx(te,{className:"h-3.5 w-3.5"}),a?"Avsluta":"Helskärm"]})]}),P&&e.jsx("p",{className:"bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:P}),e.jsxs(ne,{center:V,zoom:z,scrollWheelZoom:!1,className:a?"w-full":"h-[400px] w-full md:h-[480px]",style:a?{zIndex:0,flex:"1 1 auto",minHeight:0,height:"100%"}:{zIndex:0},children:[e.jsx(fe,{}),e.jsx(je,{store:f}),e.jsx(ge,{position:N,flown:K}),N&&e.jsx(me,{center:N,radius:7,pathOptions:{color:"#2563eb",weight:3,fillColor:"#3b82f6",fillOpacity:.9},children:e.jsx($,{direction:"top",offset:[0,-10],children:"Du är här"})}),e.jsx(re,{attribution:b.attribution,url:b.url},b.id),e.jsx(pe,{coordinates:(x==null?void 0:x.coordinates)??null,fallbackCenter:l.viewCenter,fallbackZoom:l.viewZoom,ski
1p:U}),x&&n&&e.jsxs(e.Fragment,{children:[e.jsx(H,{positions:x.coordinates,pathOptions:{color:x.color,weight:5,opacity:.9},children:e.jsx($,{sticky:!0,children:x.name})}),(x.waterStations??[]).map((s,i)=>e.jsx(u,{position:s.position,icon:ie(26),children:e.jsx(p,{children:e.jsxs("strong",{children:["💧 ",s.label]})})},`water-${i}`)),e.jsx(u,{position:C,icon:Z(32),children:e.jsxs(p,{children:[e.jsx("strong",{children:"Mål — alla banor"}),e.jsx("br",{}),"Hässleholmsgården"]})})]}),E&&e.jsxs(e.Fragment,{children:[j.map(s=>e.jsx(H,{positions:s.preview,pathOptions:{color:s.color,weight:5,opacity:.85},children:e.jsxs($,{sticky:!0,children:[s.name," — start →"]})},`prev-${s.id}`)),j.map(s=>{var i,m;return e.jsx(u,{position:s.start,icon:ue(s.color,s.label),children:e.jsxs(p,{children:[e.jsxs("strong",{children:["Start ",((i=g.get(s.id))==null?void 0:i.name)??s.name]}),((m=g.get(s.id))==null?void 0:m.start_time)&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsxs("span",{className:"text-sm",children:["Kl. ",g.get(s.id).start_time]})]})]})},`start-${s.id}`)}),l.showArrow&&j.map(s=>{if(s.preview.length<2)return null;const i=s.preview[s.preview.length-1],m=s.preview[s.preview.length-2];return e.jsx(u,{position:i,icon:he(s.color,oe(m,i)),interactive:!1},`arrow-${s.id}`)}),e.jsx(u,{position:C,icon:Z(32),children:e.jsxs(p,{children:[e.jsx("strong",{children:"Mål — alla banor"}),e.jsx("br",{}),"Hässleholmsgården"]})})]}),y.map(s=>e.jsx(u,{position:[s.lat,s.lng],icon:le(s.emoji),children:e.jsxs(p,{children:[e.jsxs("strong",{children:[s.emoji," ",s.label]}),s.description&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx("span",{className:"text-sm",children:s.description})]})]})},s.id)),t.map(s=>{var i,m;return e.jsx(u,{position:[s.lat,s.lng],icon:ve(s.color),children:e.jsxs(p,{children:[e.jsx("strong",{children:s.label}),s.description&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx("span",{className:"text-sm",children:s.description})]}),(((i=s.people)==null?void 0:i.length)??0)>0?e.jsxs("div",{className:"mt-1",children:[e.jsxs("div",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:["Funktionärer",s.needed?` (${s.people.length}/${s.needed})`:""]}),e.jsx("ul",{className:"m-0 list-none p-0 text-sm",children:s.people.map((h,S)=>e.jsxs("li",{children:[h.isLead?"★ ":"",h.name]},`${s.id}-p-${S}`))})]}):e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["Ingen tilldelad",s.needed?` (0/${s.needed})`:""]}),(((m=s.passTimes)==null?void 0:m.length)??0)>0&&e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Ungefärlig passage"}),e.jsx("ul",{className:"m-0 list-none p-0 text-sm",children:s.passTimes.map((h,S)=>e.jsxs("li",{children:[h.label,": ",h.first,"–",h.last]},`${s.id}-t-${S}`))})]})]})},`station-${s.id}`)})]}),e.jsxs("div",{className:`space-y-4 border-t border-border bg-card px-4 py-3 ${a?"hidden":""}`,children:[E&&e.jsxs("div",{children:[e.jsx("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Banor"}),e.jsxs("ul",{className:"space-y-2",children:[j.map(s=>{const i=g.get(s.id);return e.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-bold text-white shadow",style:{backgroundColor:s.color},children:s.label}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 font-medium leading-tight",children:[e.jsx("span",{children:(i==null?void 0:i.name)??s.name}),(i==null?void 0:i.start_time)&&e.jsxs("span",{className:"text-xs font-semibold text-primary",children:["kl. ",i.start_time]})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:(i==null?void 0:i.description)??s.description})]})]},s.id)}),e.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-foreground text-xs text-background shadow",children:"🏁"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium leading-tight",children:"Gemensamt mål"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Alla banor avslutas vid Hässleholmsgården"})]})]})]})]}),y.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Service & information"}),e.jsx("ul",{className:"space-y-2",children:y.map(s=>e.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-border bg-background text-sm shadow-sm",children:s.emoji}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium leading-tight",children:s.label}),s.description&&e.jsx("div",{className:"text-xs text-muted-foreground",children:s.description})]})]},s.id))})]})]})]});return a?ae.createPortal(I,document.body):I};export{ye 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.