@geops/rvf-mobility-web-component 0.1.26 → 0.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.27](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.26...v0.1.27) (2025-02-11)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * remove tenant ([4799e9f](https://github.com/geops/rvf-mobility-web-component/commit/4799e9f344f6b09287d74152b36317ae153e0fcb))
11
+
5
12
  ### [0.1.26](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.25...v0.1.26) (2025-02-10)
6
13
 
7
14
 
package/index.js CHANGED
@@ -3021,7 +3021,7 @@ html {
3021
3021
  }
3022
3022
  }
3023
3023
 
3024
- `;var pU=U0(vU(),1);var Gi1=/{{(.*?)}}/g;function gU(r,t){return r.replace(Gi1,(e,a,n)=>{for(e=0,n=t,a=a.trim().split(".");n&&e<a.length;)n=n[a[e++]];return n??""})}function AU(r){var t="",e=r||{};return{set(a,n){e[a]=Object.assign(e[a]||{},n)},locale(a){return t=a||t},table(a){return e[a]},t(a,n,i){var h=(0,pU.default)(e[i||t],a,"");return typeof h=="function"?h(n):typeof h=="string"?gU(h,n):h}}}var ji1={de:{no_stops_found:"Keine Haltestellen gefunden",platform_ferry:"St.",platform_other:"Kan.",platform_rail:"Gl.",stops_search_placeholder:"Haltestellen suchen"},en:{no_stops_found:"No stops found",platform_ferry:"Pier",platform_other:"Std.",platform_rail:"Pl.",stops_search_placeholder:"Search for stop"},fr:{no_stops_found:"Aucun arr\xEAt trouv\xE9",platform_ferry:"Quai",platform_other:"Quai",platform_rail:"Voie",stops_search_placeholder:"Chercher un arr\xEAt"},it:{no_stops_found:"Nessuna fermata trovata",platform_ferry:"Imb.",platform_other:"Cor.",platform_rail:"Bin.",stops_search_placeholder:"Ricerca delle fermate"}},fU=ji1;var S_=AU(fU);S_.locale(navigator.languages.find(r=>S_.table(r.split("-")[0])!==void 0)?.split("-")[0]||"en");var Ep=S_;var F_=class extends Event{data;constructor(t,e,a={}){super(t,{...a,composed:!0}),this.data=e}logImportantData(){console.log(this.data)}},a8=F_;var mU=r=>r.properties.name;function qi1({apikey:r,bbox:t,countrycode:e,event:a,field:n,limit:i,mots:h,onselect:d,params:g,prefagencies:m,reflocation:z,url:w="https://api.geops.io/stops/v1/"}){let{t:b}=Ep,[_,P]=st(""),[R,U]=st(),[k,q]=st(void 0),Y=t5();q2(()=>{Y.current?.dispatchEvent(new a8("mwc:attribute",{apikey:r,bbox:t,countrycode:e,event:a,field:n,limit:i,mots:h,onselect:d,params:g,prefagencies:m,reflocation:z,url:w}))},[r,t,e,a,n,i,h,d,g,m,z,w]);let d1=St(()=>new XA({apiKey:r,url:w}),[r,w]),z1=f4(m1=>{let A1=new a8(a||"mwc:stopssearchselect",m1,{bubbles:!0});Y.current?.dispatchEvent(A1),d&&typeof d=="function"&&d(m1)},[a,d]),M1=St(()=>{let m1;return(0,zU.default)(async A1=>{m1?.abort(),m1=new AbortController,d1.search({bbox:t,field:n,limit:i,mots:h,prefagencies:m,q:A1,ref_location:z,...JSON.parse(g||"{}")},{signal:m1.signal}).then(_1=>{q(_1.features.filter(N1=>!e||N1.properties?.country_code===e))}).catch(_1=>{if(_1.code!==20){console.error("Failed to fetch stations",_1);return}})},150)},[d1,t,e,n,i,h,g,m,z]);return q2(()=>{if(!(R&&_===mU(R))){if(!_){U(void 0);return}return M1(_),()=>{M1.cancel()}}},[_,R,M1]),q2(()=>{q(void 0),R&&P(mU(R)),z1(R)},[z1,R]),X(ke,{children:[X("style",{children:Fp}),X("div",{className:"flex h-16 items-center gap-4 rounded-md bg-white p-4 pt-3.5 shadow",ref:Y,children:[X("div",{className:"flex items-center ",children:X(dU,{className:"size-4"})}),X("div",{className:"flex grow overflow-hidden border-b-2 border-solid",children:[X("input",{autoComplete:"off",className:"h-8 flex-1 outline-0 placeholder:text-zinc-400",id:"searchfield",onChange:m1=>{P(m1.target.value)},onKeyUp:m1=>{m1.key==="Enter"&&k?.length>0&&U(k[0])},placeholder:b("stops_search_placeholder"),type:"text",value:_}),_.length>0&&X("button",{className:"flex items-center",onClick:()=>{P(""),q(void 0)},children:X(uU,{className:"size-4"})})]})]}),X("div",{className:"-mt-4px flex grow overflow-auto rounded-md rounded-t-none bg-white shadow",children:[k&&k.length===0&&X("div",{className:"flex grow gap-3 border border-solid p-3 pt-2 text-zinc-400",style:{border:1},children:[X("div",{className:"size-6"}),X("div",{children:b("no_stops_found")})]}),k&&k.length>0&&X("ul",{className:"grow rounded-md rounded-t-none border border-solid bg-white p-0 ",style:{border:1},children:k?.map(m1=>X("li",{className:"border-b border-dashed border-slate-300 p-3 last:border-0",children:X("button",{className:"flex w-full items-center gap-3 text-left",onClick:()=>{U(m1)},children:[X("div",{className:"size-6"}),X("div",{className:"grow",children:m1.properties.name})]})},m1.properties.uid))})]})]})}var O9=ht(qi1);var Ki1=(r,t)=>{let e=r?.geometry?.coordinates;e&&t?.getView()?.animate({center:yo(e),duration:500,zoom:16})},MU=Ki1;function Wi1(){let{apikey:r,map:t,stopsurl:e}=Gt(),a=f4(n=>MU(n,t),[t]);return X(O9,{apikey:r,onselect:a,url:e})}var E_=ht(Wi1);var I_=new Ya;function Zi1(){let{baseLayer:r,map:t,realtimeLayer:e,setStationId:a,setTrainId:n,stationId:i,stationsLayer:h,tenant:d,trainId:g}=Gt(),{selectedFeature:m,setSelectedFeature:z,setSelectedFeatures:w}=cr();q2(()=>{t&&t.getTargetElement().dispatchEvent(new a8("selectedfeature",{feature:m?I_.writeFeatureObject(m):null}))},[t,m]);let b=f4(async P=>{let[R]=P.map.getFeaturesAtPixel(P.pixel,{layerFilter:Y=>Y===e});e?.highlight(R);let U=P.map.getFeaturesAtPixel(P.pixel,{layerFilter:Y=>Y===h}),[k]=U.filter(Y=>Y.get("tralis_network")?.includes(d)),q=P.map.getFeaturesAtPixel(P.pixel,{layerFilter:Y=>Y.get("isQueryable")});P.map.getTargetElement().style.cursor=R||k||q?.length?"pointer":"default"},[e,h,d]),_=f4(async P=>{if(!r.mapLibreMap)return;let[R]=P.map.getFeaturesAtPixel(P.pixel,{layerFilter:M1=>M1===e}),U=P.map.getFeaturesAtPixel(P.pixel,{layerFilter:M1=>M1===h}),[k]=U.filter(M1=>M1.get("tralis_network")?.includes(d)),q=k?.get("uid"),Y=R?.get("train_id");q&&i!==q?(a(q),n(null)):Y&&Y!==g?(n(R.get("train_id")),a(null)):(n(null),a(null));let d1=P.map.getFeaturesAtPixel(P.pixel,{layerFilter:M1=>M1.get("isQueryable")});(async M1=>{for(let m1 of M1){let A1=m1.get("cluster_id");if(A1){let c1=m1.get("vectorTileFeature").layer.source,o1=await r.mapLibreMap.getSource(c1)?.getClusterLeaves(A1,1e3,0)||[];m1.set("features",o1.map(F1=>I_.readFeature(F1)))}let _1=m?.get("station_id");if(_1){let N1=await xp(_1);m.setProperties(N1),m.set("provider_logo",C7[m?.get("feed_id")])}}P.map.getTargetElement().dispatchEvent(new a8("singleclick",{...P,features:I_.writeFeaturesObject(M1),lonlat:_o(P.coordinate)})),q||Y||!M1.length?(z(null),w([])):(w(M1),z(M1[0]))})(d1)},[r?.mapLibreMap,i,g,e,h,d,a,n,m,z,w]);return q2(()=>{let P=t?.on("singleclick",_);return()=>{B0(P)}},[t,_]),q2(()=>{let P=t?.on("pointermove",b);return()=>{B0(P)}},[t,b]),null}var Ip=Zi1;var O_=wi({index:null,departure:null}),Xi1=()=>{let r=e5(O_);if(!r)throw new Error("useDeparture must be used within a ContextProvider");return r},xU=Xi1;var T9=r=>`0${r}`.slice(-2),jo=(r,t=!1)=>{let e=new Date(r);return!r||Number.isNaN(e)?"unknown":[T9(e.getHours()),T9(e.getMinutes()),t?null:T9(e.getSeconds())].filter(a=>a).join(":")};function $i1(r){let t=ev(),{departure:e}=xU();if(!t)return null;let{arrivalTime:a,at_station_ds100:n,departureTime:i,fzo_estimated_time:h,has_fzo:d,last_boarding_time:g,min_arrival_time:m,ris_aimed_time:z,ris_estimated_time:w,state:b,station:_,stations_in_between:P,time:R,train_number:U}=e,k=new Date(z),q=Number.isNaN(k)?"":[k.getFullYear(),T9(k.getMonth()+1),T9(k.getDate())].join("-"),Y=["https://ris-info.bahn.de/rishttp/risinfo.xml?",`action=zuglauf&evanr=${_?.get("uic")}&`,`zugnummer=${U}&`,`ankunft=${q}T${jo(k,!0)}`].join("");return X("div",{className:"border-b p-4 text-left text-xs",...r,children:["Zugnummer:",X("a",{href:Y,rel:"noopener noreferrer",target:"_blank",children:U}),X("div",{children:[" State: ",X("b",{children:b}),X("br",{}),`Has fzo: ${d};`,X("br",{}),`Has realtime: ${e.has_realtime_journey};`,X("br",{}),`Time: ${jo(R)};`,X("br",{}),`Arrival time: ${jo(a)};`,X("br",{}),`Departure time: ${jo(i)};`,X("br",{}),`FzO-Estimated: ${jo(h)};`,X("br",{}),`RIS-Aimed: ${jo(z)};`,X("br",{}),`RIS-Estimated: ${jo(w)};`,X("br",{}),`Ref-Location: ${n};`,X("br",{}),`Normalized Distance: ${jo(m)};`,X("br",{}),`Last Boarding: ${jo(g)};`,X("br",{}),`Stationen until arrival: ${P};`]})]})}var T_=$i1;function Yi1({departure:r,index:t,...e}){let{setStationId:a,setTrainId:n}=Gt(),i=St(()=>({departure:r,index:t}),[r,t]);return X(O_.Provider,{value:i,children:[X("button",{className:"w-full border-b",onClick:()=>{n(r.train_id),a()},type:"button",...e,children:X("div",{className:"gap-4 py-4",style:{alignItems:"center",display:"flex",overflow:"hidden"},children:[X("div",{className:"pl-4",children:X(S7,{departure:r})}),X("div",{className:"grow text-left",children:[...new Set(r.to)].join("/")}),X("div",{className:"pr-4",children:E7(r.time)})]})}),X(T_,{})]})}var P_=ht(Yi1);function Ji1({children:r,station:t,...e}){let{name:a}=t?.properties||{};return X("div",{...e,children:[a,r]})}var R_=ht(Ji1);function t51(){let{station:r}=Gt();return X("div",{className:"flex items-center gap-x-4 bg-slate-100 p-4",children:X("div",{className:"flex grow flex-col",children:[X("span",{className:"font-bold",children:X(R_,{station:r})}),X(F7,{accessibility:!0,airport:!0,barAndRestaurants:!0,bathroom:!0,bikeStorage:!0,className:"flex gap-2",elevator:!0,police:!0,station:r,waitingAreas:!0})]})})}var D_=ht(t51);function e51(r){let{realtimeLayer:t,station:e}=Gt(),[a,n]=st(),i=t5(),{className:h}=r;return q2(()=>{if(!e||!t?.api)return;let d=jf(g=>(n(g),null),!1,180);return t.api.subscribeDepartures(e?.properties?.uid,d),()=>{n(null),t?.api?.unsubscribeDepartures(e?.properties.uid)}},[e,t?.api]),e?X(ke,{children:[X(D_,{}),X("div",{className:h,ref:i,children:(a||[]).map((d,g)=>X(P_,{departure:d,index:g},d.call_id))})]}):null}var k_=ht(e51);function r51(r){let{baseLayer:t,map:e,setStationsLayer:a}=Gt(),n=St(()=>t?new k4({layersFilter:({metadata:i})=>i?.["tralis.variable"]==="station",maplibreLayer:t,name:q4.haltestellen,...r||{}}):null,[t,r]);return q2(()=>{if(!(!e||!n))return e.addLayer(n),a(n),()=>{e.removeLayer(n)}},[e,a,n]),null}var U_=ht(r51);var a51=new o5({image:new l3({fill:new c3({color:"#000000"}),radius:5}),stroke:new h3({color:"#000000",width:6}),zIndex:2}),i51=(r,t,e)=>{let a="#ffffff",n=r.get("type"),i=r.get("stroke");return i&&i[0]!=="#"&&(i=`#${i}`),console.log(r.getProperties()),a=i||e?.getBgColor(n,{name:r.get("line_name")}),a=/#ffffff/i.test(a)?"#ff0000":a,[a51,new o5({image:new l3({fill:new c3({color:a}),radius:4}),stroke:new h3({color:a,width:4}),zIndex:3})]},wU=i51;var N_="Informations",n51=r=>{let e=r.get("features")?.[0]||r,{category:a,feed_id:n,long_name:i,tickets:h}=e.getProperties();return a?pS[a]||N_:n?gS[n]||N_:i?a4.liniennetz:h?a4.verkaufsstellen:N_},HU=n51;var o51=[[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,2,2,3,7,7,7,7,7,7,12,12,15],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,2,2,3,7,7,7,7,7,7,12,12,15]],yU=(r=0,t=0,e=!1)=>{try{let a=C6.getTypeIndex(r);return o51[a][t]*(e?2:1)}catch{return 1}};var _U=(r,t)=>{if(!!t.get("name")&&r!=null){let n=r&&r.split(",")||[],i=t.get("name"),h=n.includes(i);t.getVisible()!==h&&(t.setVisible(h),t.getLayers&&t.getLayers().getArray().forEach(d=>{d.setVisible(h)}))}t.getLayers&&t.getLayers().getArray().forEach(n=>{_U(r,n)})},Q_=_U;var c51=(r,t)=>(q2(()=>{if(!r)return;r8(r.getLayers().getArray()).forEach(a=>{Q_(t,a)});let e=r.getLayers().on("add",a=>{Q_(t,a.element)});return()=>{B0(e)}},[r,t]),null),VU=c51;var CU=U0(Oc(),1);var h51=(r,t=new URLSearchParams)=>{let e=r.getView().getZoom(),[a,n]=r.getView().getCenter(),i=r8(r.getLayers().getArray()).filter(h=>h.get("name")&&h.getVisible()).map(h=>h.get("name"));return t.set("layers",i.join(",")),t.set("x",a.toFixed(2)),t.set("y",n.toFixed(2)),t.set("z",e.toFixed(1)),t},BU=h51;var l51=(r,t)=>(q2(()=>{let e,a,n;return r&&t&&(Op(r),e=r?.on("moveend",i=>{Op(i.map)}),a=r.once("loadend",i=>{Op(i.map),n=r8(i.map.getLayers().getArray()).map(h=>h.on("change:visible",()=>{Op(i.map)}))})),()=>{B0(e),B0(a),B0(n)}},[r,t]),null),s51=r=>{let t=new URLSearchParams(window.location.search),e=BU(r,t);e.set("permalink","true"),window.history.replaceState(null,null,`?${e.toString()}`)},Op=(0,CU.default)(s51,1e3),bU=l51;var G_={},d51=(r,t,e)=>{let a=`${r}, ${t}, ${e}`;if(!G_[a]){let n=n3(r*2,r*2);if(n){let i=n.getContext("2d");if(!i)return null;i.beginPath(),i.arc(r,r,t,0,2*Math.PI,!1),i.fillStyle=e,i.filter="blur(1px)",i.fill(),G_[a]=n}}return G_[a]},j_={},u51=(r,t,e,a,n="#000",i=1)=>{let h=`${r}, ${e}, ${a}, ${n}, ${i}`;if(!j_[h]){let d=n3(Math.ceil(r.length*t),Math.ceil(t+8*i));if(d){let g=d.getContext("2d");if(!g)return null;g.font=e,g.textAlign="left",g.textBaseline="middle",g.font=e,g.fillStyle=a,g.strokeStyle=n,g.lineWidth=1.5*i,g.strokeText(r,0,t),g.fillText(r,0,t),j_[h]=d}}return j_[h]},q_={},v51=(r,t,e,a,n,i)=>{let h=`${r}, ${t}, ${e}, ${a}, ${n}, ${i}`;if(!q_[h]){let d=n3(r*2,r*2);if(d){let g=d.getContext("2d");if(!g)return null;g.fillStyle=e,a&&(g.lineWidth=1*i,g.strokeStyle="#000000"),g.beginPath(),g.arc(r,r,t,0,2*Math.PI,!1),g.fill(),n&&g.setLineDash([5,3]),a&&g.stroke(),q_[h]=d}}return q_[h]},K_={},g51=(r,t,e,a,n,i,h,d)=>{let g=`${r}, ${t}, ${e}, ${a},${n}, ${i}, ${h}`;if(!K_[g]){let m=n3(t*2,t*2);if(m){let z=m.getContext("2d");if(!z)return null;i&&(z.save(),z.textBaseline="middle",z.textAlign="center",z.font=d(e+2,r),z.strokeStyle=n,z.strokeText(r,t,t),z.restore()),z.textBaseline="middle",z.textAlign="center",z.fillStyle=a,z.font=d(e,r),z.strokeStyle=n,z.strokeText(r,t,t),z.fillText(r,t,t),K_[g]=m}}return K_[g]},W_={},p51=(r,t,e)=>{let{delayDisplay:a=3e5,delayOutlineColor:n="#000",getBgColor:i=()=>"#000",getDelayColor:h=()=>"#000",getDelayFont:d=t1=>`bold ${t1}px arial, sans-serif`,getDelayText:g=()=>null,getMaxRadiusForStrokeAndDelay:m=()=>7,getMaxRadiusForText:z=()=>10,getRadius:w=()=>0,getText:b=t1=>t1,getTextColor:_=()=>"#000",getTextFont:P=t1=>`bold ${t1}px arial, sans-serif`,getTextSize:R=()=>14,hoverVehicleId:U,selectedVehicleId:k,useDelayStyle:q}=e,{pixelRatio:Y=1,zoom:d1}=t,{type:z1}=r.properties,{delay:M1,line:m1,operator_provides_realtime_journey:A1,state:_1,train_id:N1}=r.properties,{color:c1,name:o1,text_color:F1}=m1||{};o1=b(o1);let B1=_1==="JOURNEY_CANCELLED";z1||(z1="Rail"),o1||(o1="I"),F1=_(z1),c1=i(z1,m1),c1&&!c1.startsWith("#")&&(c1=`#${c1}`),F1.startsWith("#")||(F1=`#${F1}`);let W1=Math.min(Math.floor(d1||1),16),G1=!!(U&&U===N1),Z1=!!(k&&k===N1),S1=w(z1,W1)*Y,X1=S1>=m()*Y;(G1||Z1)&&(S1=X1?S1+5*Y:14*Y);let i2=S1>z()*Y,z2=`${S1}${G1||Z1}`;if(q?z2+=`${A1}${M1}${B1}`:(z2+=`${c1||z1}`,X1&&(z2+=`${B1}${M1}`)),i2&&(z2+=`${o1}${F1}`),!W_[z2]){if(S1===0)return null;let t1=1*Y,y1=S1+2*Y,H1=S1*2,D1=y1*2+t1*2,q1=D1/2,l2=null;X1&&M1!==null&&(l2=d51(q1,y1,h(M1,B1)));let c2=null,u2=0;if(X1&&(G1||(M1||0)>=a||B1)){u2=Math.max(B1?19:14,Math.min(B1?19:17,S1*1.2))*Y;let E2=g(M1,B1);E2&&(c2=u51(E2,u2,d(u2,E2),h(M1,B1,!0),n,Y))}let _2;q?_2=h(M1,B1):_2=c1||i(z1,r);let U2=v51(q1,S1,_2,X1||G1||Z1,!!X1&&!!q&&M1===null&&A1==="yes",Y),K1=D1+(c2?.width||0)*2,I1=n3(K1,D1);if(I1){let E2=I1.getContext("2d");if(!E2)return null;let $2=c2?.width||0;l2&&E2.drawImage(l2,$2,0),U2&&E2.drawImage(U2,$2,0);let I2=null;if(i2){let P2=Math.max(S1,10),R2=R(E2,H1,o1,P2,P),Y2=q?"#000000":F1||_(z1);I2=g51(o1,q1,R2,Y2,_2,!!q&&M1===null&&A1==="yes",Y,P)}I2&&E2.drawImage(I2,$2,0),c2&&E2.drawImage(c2,$2+Math.ceil(q1+y1)+t1,Math.ceil(q1-u2)),W_[z2]=I1}}return W_[z2]},LU=p51;var SU="";var FU=Wu.join(","),A51={mapLibreOptions:{maxCanvasSize:[2e4,2e4],preserveDrawingBuffer:!0}},f51={},m51={style:{width:"calc(100% - 60px)"}},z51={bboxParameters:{line_tags:"RVF"},fullTrajectoryStyle:wU,style:LU,styleOptions:{getBgColor:gl,getRadius:yU,getTextColor:tv}};function M51({apikey:r="5cc87b12d7c5370001c1d655820abcc37dfd4d968d7bab5b2a74a935",baselayer:t="de.rvf",center:e=null,details:a="true",extent:n=FU,geolocation:i="true",layers:h=null,layertree:d="true",mapsurl:g="https://maps.geops.io",maxextent:m=FU,maxzoom:z="20",minzoom:w=null,mots:b=null,notification:_="true",notificationat:P=null,notificationbeforelayerid:R=null,notificationurl:U=null,permalink:k="false",print:q="true",realtime:Y="true",realtimeurl:d1="wss://api.geops.io/tracker-ws/v1/ws",search:z1="false",share:M1="true",stopsurl:m1="https://api.geops.io/stops/v1/",tenant:A1="de-gtfs-de",toolbar:_1="true",zoom:N1=null}){let c1=t5(),[o1,F1]=st(),[B1,W1]=st(!1),[G1,Z1]=st(!1),[S1,X1]=st(),[i2,z2]=st(),[t1,y1]=st(),[H1,D1]=st(),[q1,l2]=st(),[c2,u2]=st(),[_2,B2]=st(),[K2,U2]=st(!1),[K1,M2]=st(!1),[I1,E2]=st(),[$2,I2]=st(),[P2,R2]=st(!1),[Y2,ot]=st(),[ut,Pt]=st(),[Y1,L2]=st(),[Q2,G2]=st(),[dt,o2]=st(),W2=St(()=>_1==="true",[_1]),D2=St(()=>d==="true",[d]),de=St(()=>Y==="true",[Y]),Wt=St(()=>_==="true",[_]),nt=St(()=>i==="true",[i]),Xe=St(()=>z1==="true",[z1]),jt=St(()=>M1==="true",[M1]),Re=St(()=>q==="true",[q]),ce=St(()=>a==="true",[a]);VU(q1,h),bU(q1,k==="true");let E1=St(()=>({apikey:r,baselayer:t,baseLayer:o1,center:e,extent:n,geolocation:i,isFollowing:B1,isTracking:G1,layers:h,map:q1,mapsurl:g,maxextent:m,maxzoom:z,minzoom:w,mots:b,notification:_,notificationat:P,notificationbeforelayerid:R,notificationurl:U,permalink:k,realtimeLayer:H1,realtimeurl:d1,setBaseLayer:F1,setIsFollowing:W1,setIsTracking:Z1,setMap:l2,setRealtimeLayer:D1,setStation:y1,setStationId:u2,setStationsLayer:z2,setStopSequence:X1,setTrainId:B2,station:t1,stationId:c2,stationsLayer:i2,stopSequence:S1,stopsurl:m1,tenant:A1,trainId:_2,zoom:N1}),[r,t,o1,e,n,i,B1,G1,q1,g,m,h,z,w,b,_,P,R,U,k,H1,d1,t1,c2,i2,S1,m1,A1,_2,N1]);q2(()=>{c1.current?.dispatchEvent(new a8("mwc:attribute",{baselayer:t,center:e,details:a,extent:n,geolocation:i,layers:h,layertree:d,mapsurl:g,maxextent:m,maxzoom:z,minzoom:w,mots:b,notification:_,notificationat:P,notificationbeforelayerid:R,notificationurl:U,print:q,realtime:Y,realtimeurl:d1,search:z1,share:M1,tenant:A1,toolbar:_1,zoom:N1}))},[t,h,e,i,d,_1,g,z,w,b,_,P,U,R,Y,d1,z1,A1,N1,n,m,q,M1,a]);let a1=St(()=>({isExportMenuOpen:K2,isLayerTreeOpen:P2,isShareMenuOpen:K1,layertree:d,lineNetworkPlanLayer:Q2,poisLayer:Y1,selectedFeature:I1,selectedFeatures:$2,sellingPointsLayer:Y2,setIsExportMenuOpen:U2,setIsLayerTreeOpen:R2,setIsShareMenuOpen:M2,setLineNetworkPlanLayer:G2,setPoisLayer:L2,setSelectedFeature:E2,setSelectedFeatures:I2,setSellingPointsLayer:ot,setSharedMobilityLayerGroup:o2,setTarifZonenLayer:Pt,sharedMobilityLayerGroup:dt,tarifZonenLayer:ut}),[K2,d,P2,K1,Q2,Y1,I1,$2,Y2,dt,ut]),r1=f4(()=>{R2(!P2)},[P2]),v1=f4(()=>{U2(!1)},[]),C1=St(()=>({format:j1=>{let e2=[];return j1.forEach(P1=>{/(sbb|rvf)/i.test(P1)||e2.push(P1)}),e2.join("&nbsp;|&nbsp;")}}),[]),Q1=St(()=>({layersFilter:({metadata:j1})=>j1?.["rvf.filter"]==="netzplan_stations"}),[]);return q2(()=>{W2&&P2&&(U2(!1),R2(P2),E2(null),B2(null),u2(null),M2(!1))},[P2,W2]),q2(()=>{W2&&K2&&(R2(!1),U2(K2),E2(null),B2(null),M2(!1),u2(null))},[K2,W2]),q2(()=>{W2&&I1&&(R2(!1),U2(!1),B2(null),M2(!1),u2(null))},[I1,W2]),q2(()=>{W2&&c2&&(R2(!1),U2(!1),B2(null),M2(!1),E2(null))},[c2,W2]),q2(()=>{W2&&_2&&(R2(!1),U2(!1),u2(null),M2(!1),E2(null))},[_2,W2]),q2(()=>{W2&&K1&&(R2(!1),U2(!1),u2(null),B2(null),E2(null))},[K1,W2]),X(ZM.Provider,{value:Ep,children:[X("style",{children:Fp}),X("style",{children:SU}),X(wM.Provider,{value:E1,children:X(Ay.Provider,{value:a1,children:X("div",{className:"relative size-full border font-sans @container/main",ref:c1,style:f51,children:X("div",{className:"relative flex size-full flex-col text-base @lg/main:flex-row-reverse",children:[X(LM,{className:"relative flex-1 overflow-visible ",children:[X(HM,{...A51}),X(Ip,{}),X(Ny,{}),de&&X(DM,{title:a4.echtzeit,...z51}),X(U_,{minZoom:10,title:a4.haltestellen,...Q1}),Wt&&X(qu,{}),X(A_,{title:a4.tarifzonen}),X(qy,{isQueryable:!1,title:a4.verkaufsstellen}),X(Ry,{isQueryable:!1,minZoom:10,title:a4.liniennetz}),X(Uy,{title:a4.pois}),X(v_,{title:a4.sharedMobility}),X("div",{className:"pointer-events-none absolute inset-x-2 bottom-2 z-10 flex items-end justify-between gap-2 text-[10px]",children:[X(V_,{className:"bg-slate-50/70"}),X(yM,{className:"pointer-events-auto bg-slate-50/70",options:C1})]}),X("div",{className:"absolute right-2 top-2 z-10 flex flex-col gap-2",children:[nt&&X(bM,{}),!W2&&Re&&X(ip,{})]}),Xe&&X("div",{className:"absolute left-2 right-12 top-2 z-10 flex max-h-[90%] min-w-64 max-w-96 flex-col",children:X(E_,{})}),X("div",{className:"absolute bottom-10 right-2 z-10 flex flex-col justify-between gap-2",children:X(H_,{})}),!W2&&D2&&X(Oy,{isOpen:P2,onClick:r1,title:"Kartendaten",children:X(Cp,{className:"w-full px-2"})})]}),X(IM,{className:"z-50 bg-white",ScrollableHandlerProps:m51,children:[de&&_2&&X(ke,{children:[X(Jc,{onClose:()=>{B2(null)},title:a4.echtzeit}),X(sx,{className:"relative overflow-y-auto overflow-x-hidden"})]}),A1&&c2&&X(ke,{children:[X(Jc,{onClose:()=>{u2(null)},title:"Station"}),X(k_,{className:"relative flex flex-col overflow-y-auto overflow-x-hidden p-2"})]}),ce&&I1&&X(ke,{children:[X(Jc,{onClose:()=>{E2(null)},title:HU(I1)}),X(Iy,{className:"relative flex h-full flex-col gap-4 overflow-y-auto overflow-x-hidden p-4"})]}),W2&&Re&&K2&&X(ke,{children:[X(Jc,{onClose:()=>{U2(!1)},title:"Dr\xFCcken"}),X(ap,{className:"relative flex flex-col gap-8 overflow-y-auto overflow-x-hidden px-4 py-6"})]}),W2&&D2&&P2&&X(ke,{children:[X(Jc,{onClose:()=>{R2(!1)},title:"Layers"}),X(Cp,{className:" relative flex h-full flex-col overflow-y-auto overflow-x-hidden p-2"})]}),W2&&jt&&K1&&X(ke,{children:[X(Jc,{onClose:()=>{M2(!1)},title:"Share"}),X(e_,{className:"relative flex h-full flex-col gap-8 overflow-y-auto overflow-x-hidden px-4 py-6"})]})]}),W2&&X("div",{className:"z-[100] flex justify-around overflow-x-hidden border-t bg-white p-1 @lg/main:block @lg/main:border-r @lg/main:p-0 ",children:[D2&&X(Py,{className:"border-none",title:"Layers"}),Re&&X(ip,{className:"border-none",title:"Dr\xFCcken"}),jt&&X(p_,{className:"border-none",title:"Share"})]}),!W2&&Re&&K2&&X(Dy,{onClose:v1,children:X(ap,{className:"relative flex h-full flex-col overflow-y-auto overflow-x-hidden p-2"})})]})})})})]})}var Tp=ht(M51);OA(Tp,"geops-mobility",["apikey","baselayer","center","extent","maxextent","geolocation","details","layers","layertree","mapsurl","mots","notification","notificationat","notificationurl","notificationbeforelayerid","print","realtime","realtimeurl","search","share","tenant","zoom","permalink"],{shadow:!0});OA(O9,"geops-mobility-search",["apikey","bbox","countrycode","event","field","limit","mots","onselect","params","prefagencies","reflocation","url"],{shadow:!0});})();
3024
+ `;var pU=U0(vU(),1);var Gi1=/{{(.*?)}}/g;function gU(r,t){return r.replace(Gi1,(e,a,n)=>{for(e=0,n=t,a=a.trim().split(".");n&&e<a.length;)n=n[a[e++]];return n??""})}function AU(r){var t="",e=r||{};return{set(a,n){e[a]=Object.assign(e[a]||{},n)},locale(a){return t=a||t},table(a){return e[a]},t(a,n,i){var h=(0,pU.default)(e[i||t],a,"");return typeof h=="function"?h(n):typeof h=="string"?gU(h,n):h}}}var ji1={de:{no_stops_found:"Keine Haltestellen gefunden",platform_ferry:"St.",platform_other:"Kan.",platform_rail:"Gl.",stops_search_placeholder:"Haltestellen suchen"},en:{no_stops_found:"No stops found",platform_ferry:"Pier",platform_other:"Std.",platform_rail:"Pl.",stops_search_placeholder:"Search for stop"},fr:{no_stops_found:"Aucun arr\xEAt trouv\xE9",platform_ferry:"Quai",platform_other:"Quai",platform_rail:"Voie",stops_search_placeholder:"Chercher un arr\xEAt"},it:{no_stops_found:"Nessuna fermata trovata",platform_ferry:"Imb.",platform_other:"Cor.",platform_rail:"Bin.",stops_search_placeholder:"Ricerca delle fermate"}},fU=ji1;var S_=AU(fU);S_.locale(navigator.languages.find(r=>S_.table(r.split("-")[0])!==void 0)?.split("-")[0]||"en");var Ep=S_;var F_=class extends Event{data;constructor(t,e,a={}){super(t,{...a,composed:!0}),this.data=e}logImportantData(){console.log(this.data)}},a8=F_;var mU=r=>r.properties.name;function qi1({apikey:r,bbox:t,countrycode:e,event:a,field:n,limit:i,mots:h,onselect:d,params:g,prefagencies:m,reflocation:z,url:w="https://api.geops.io/stops/v1/"}){let{t:b}=Ep,[_,P]=st(""),[R,U]=st(),[k,q]=st(void 0),Y=t5();q2(()=>{Y.current?.dispatchEvent(new a8("mwc:attribute",{apikey:r,bbox:t,countrycode:e,event:a,field:n,limit:i,mots:h,onselect:d,params:g,prefagencies:m,reflocation:z,url:w}))},[r,t,e,a,n,i,h,d,g,m,z,w]);let d1=St(()=>new XA({apiKey:r,url:w}),[r,w]),z1=f4(m1=>{let A1=new a8(a||"mwc:stopssearchselect",m1,{bubbles:!0});Y.current?.dispatchEvent(A1),d&&typeof d=="function"&&d(m1)},[a,d]),M1=St(()=>{let m1;return(0,zU.default)(async A1=>{m1?.abort(),m1=new AbortController,d1.search({bbox:t,field:n,limit:i,mots:h,prefagencies:m,q:A1,ref_location:z,...JSON.parse(g||"{}")},{signal:m1.signal}).then(_1=>{q(_1.features.filter(N1=>!e||N1.properties?.country_code===e))}).catch(_1=>{if(_1.code!==20){console.error("Failed to fetch stations",_1);return}})},150)},[d1,t,e,n,i,h,g,m,z]);return q2(()=>{if(!(R&&_===mU(R))){if(!_){U(void 0);return}return M1(_),()=>{M1.cancel()}}},[_,R,M1]),q2(()=>{q(void 0),R&&P(mU(R)),z1(R)},[z1,R]),X(ke,{children:[X("style",{children:Fp}),X("div",{className:"flex h-16 items-center gap-4 rounded-md bg-white p-4 pt-3.5 shadow",ref:Y,children:[X("div",{className:"flex items-center ",children:X(dU,{className:"size-4"})}),X("div",{className:"flex grow overflow-hidden border-b-2 border-solid",children:[X("input",{autoComplete:"off",className:"h-8 flex-1 outline-0 placeholder:text-zinc-400",id:"searchfield",onChange:m1=>{P(m1.target.value)},onKeyUp:m1=>{m1.key==="Enter"&&k?.length>0&&U(k[0])},placeholder:b("stops_search_placeholder"),type:"text",value:_}),_.length>0&&X("button",{className:"flex items-center",onClick:()=>{P(""),q(void 0)},children:X(uU,{className:"size-4"})})]})]}),X("div",{className:"-mt-4px flex grow overflow-auto rounded-md rounded-t-none bg-white shadow",children:[k&&k.length===0&&X("div",{className:"flex grow gap-3 border border-solid p-3 pt-2 text-zinc-400",style:{border:1},children:[X("div",{className:"size-6"}),X("div",{children:b("no_stops_found")})]}),k&&k.length>0&&X("ul",{className:"grow rounded-md rounded-t-none border border-solid bg-white p-0 ",style:{border:1},children:k?.map(m1=>X("li",{className:"border-b border-dashed border-slate-300 p-3 last:border-0",children:X("button",{className:"flex w-full items-center gap-3 text-left",onClick:()=>{U(m1)},children:[X("div",{className:"size-6"}),X("div",{className:"grow",children:m1.properties.name})]})},m1.properties.uid))})]})]})}var O9=ht(qi1);var Ki1=(r,t)=>{let e=r?.geometry?.coordinates;e&&t?.getView()?.animate({center:yo(e),duration:500,zoom:16})},MU=Ki1;function Wi1(){let{apikey:r,map:t,stopsurl:e}=Gt(),a=f4(n=>MU(n,t),[t]);return X(O9,{apikey:r,onselect:a,url:e})}var E_=ht(Wi1);var I_=new Ya;function Zi1(){let{baseLayer:r,map:t,realtimeLayer:e,setStationId:a,setTrainId:n,stationId:i,stationsLayer:h,tenant:d,trainId:g}=Gt(),{selectedFeature:m,setSelectedFeature:z,setSelectedFeatures:w}=cr();q2(()=>{t&&t.getTargetElement().dispatchEvent(new a8("selectedfeature",{feature:m?I_.writeFeatureObject(m):null}))},[t,m]);let b=f4(async P=>{let[R]=P.map.getFeaturesAtPixel(P.pixel,{layerFilter:Y=>Y===e});e?.highlight(R);let U=P.map.getFeaturesAtPixel(P.pixel,{layerFilter:Y=>Y===h}),[k]=U.filter(Y=>Y.get("tralis_network")?.includes(d)),q=P.map.getFeaturesAtPixel(P.pixel,{layerFilter:Y=>Y.get("isQueryable")});P.map.getTargetElement().style.cursor=R||k||q?.length?"pointer":"default"},[e,h,d]),_=f4(async P=>{if(!r.mapLibreMap)return;let[R]=P.map.getFeaturesAtPixel(P.pixel,{layerFilter:M1=>M1===e}),U=P.map.getFeaturesAtPixel(P.pixel,{layerFilter:M1=>M1===h}),[k]=U.filter(M1=>M1.get("tralis_network")?.includes(d)),q=k?.get("uid"),Y=R?.get("train_id");q&&i!==q?(a(q),n(null)):Y&&Y!==g?(n(R.get("train_id")),a(null)):(n(null),a(null));let d1=P.map.getFeaturesAtPixel(P.pixel,{layerFilter:M1=>M1.get("isQueryable")});(async M1=>{for(let m1 of M1){let A1=m1.get("cluster_id");if(A1){let c1=m1.get("vectorTileFeature").layer.source,o1=await r.mapLibreMap.getSource(c1)?.getClusterLeaves(A1,1e3,0)||[];m1.set("features",o1.map(F1=>I_.readFeature(F1)))}let _1=m?.get("station_id");if(_1){let N1=await xp(_1);m.setProperties(N1),m.set("provider_logo",C7[m?.get("feed_id")])}}P.map.getTargetElement().dispatchEvent(new a8("singleclick",{...P,features:I_.writeFeaturesObject(M1),lonlat:_o(P.coordinate)})),q||Y||!M1.length?(z(null),w([])):(w(M1),z(M1[0]))})(d1)},[r?.mapLibreMap,i,g,e,h,d,a,n,m,z,w]);return q2(()=>{let P=t?.on("singleclick",_);return()=>{B0(P)}},[t,_]),q2(()=>{let P=t?.on("pointermove",b);return()=>{B0(P)}},[t,b]),null}var Ip=Zi1;var O_=wi({index:null,departure:null}),Xi1=()=>{let r=e5(O_);if(!r)throw new Error("useDeparture must be used within a ContextProvider");return r},xU=Xi1;var T9=r=>`0${r}`.slice(-2),jo=(r,t=!1)=>{let e=new Date(r);return!r||Number.isNaN(e)?"unknown":[T9(e.getHours()),T9(e.getMinutes()),t?null:T9(e.getSeconds())].filter(a=>a).join(":")};function $i1(r){let t=ev(),{departure:e}=xU();if(!t)return null;let{arrivalTime:a,at_station_ds100:n,departureTime:i,fzo_estimated_time:h,has_fzo:d,last_boarding_time:g,min_arrival_time:m,ris_aimed_time:z,ris_estimated_time:w,state:b,station:_,stations_in_between:P,time:R,train_number:U}=e,k=new Date(z),q=Number.isNaN(k)?"":[k.getFullYear(),T9(k.getMonth()+1),T9(k.getDate())].join("-"),Y=["https://ris-info.bahn.de/rishttp/risinfo.xml?",`action=zuglauf&evanr=${_?.get("uic")}&`,`zugnummer=${U}&`,`ankunft=${q}T${jo(k,!0)}`].join("");return X("div",{className:"border-b p-4 text-left text-xs",...r,children:["Zugnummer:",X("a",{href:Y,rel:"noopener noreferrer",target:"_blank",children:U}),X("div",{children:[" State: ",X("b",{children:b}),X("br",{}),`Has fzo: ${d};`,X("br",{}),`Has realtime: ${e.has_realtime_journey};`,X("br",{}),`Time: ${jo(R)};`,X("br",{}),`Arrival time: ${jo(a)};`,X("br",{}),`Departure time: ${jo(i)};`,X("br",{}),`FzO-Estimated: ${jo(h)};`,X("br",{}),`RIS-Aimed: ${jo(z)};`,X("br",{}),`RIS-Estimated: ${jo(w)};`,X("br",{}),`Ref-Location: ${n};`,X("br",{}),`Normalized Distance: ${jo(m)};`,X("br",{}),`Last Boarding: ${jo(g)};`,X("br",{}),`Stationen until arrival: ${P};`]})]})}var T_=$i1;function Yi1({departure:r,index:t,...e}){let{setStationId:a,setTrainId:n}=Gt(),i=St(()=>({departure:r,index:t}),[r,t]);return X(O_.Provider,{value:i,children:[X("button",{className:"w-full border-b",onClick:()=>{n(r.train_id),a()},type:"button",...e,children:X("div",{className:"gap-4 py-4",style:{alignItems:"center",display:"flex",overflow:"hidden"},children:[X("div",{className:"pl-4",children:X(S7,{departure:r})}),X("div",{className:"grow text-left",children:[...new Set(r.to)].join("/")}),X("div",{className:"pr-4",children:E7(r.time)})]})}),X(T_,{})]})}var P_=ht(Yi1);function Ji1({children:r,station:t,...e}){let{name:a}=t?.properties||{};return X("div",{...e,children:[a,r]})}var R_=ht(Ji1);function t51(){let{station:r}=Gt();return X("div",{className:"flex items-center gap-x-4 bg-slate-100 p-4",children:X("div",{className:"flex grow flex-col",children:[X("span",{className:"font-bold",children:X(R_,{station:r})}),X(F7,{accessibility:!0,airport:!0,barAndRestaurants:!0,bathroom:!0,bikeStorage:!0,className:"flex gap-2",elevator:!0,police:!0,station:r,waitingAreas:!0})]})})}var D_=ht(t51);function e51(r){let{realtimeLayer:t,station:e}=Gt(),[a,n]=st(),i=t5(),{className:h}=r;return q2(()=>{if(!e||!t?.api)return;let d=jf(g=>(n(g),null),!1,180);return t.api.subscribeDepartures(e?.properties?.uid,d),()=>{n(null),t?.api?.unsubscribeDepartures(e?.properties.uid)}},[e,t?.api]),e?X(ke,{children:[X(D_,{}),X("div",{className:h,ref:i,children:(a||[]).map((d,g)=>X(P_,{departure:d,index:g},d.call_id))})]}):null}var k_=ht(e51);function r51(r){let{baseLayer:t,map:e,setStationsLayer:a}=Gt(),n=St(()=>t?new k4({layersFilter:({metadata:i})=>i?.["tralis.variable"]==="station",maplibreLayer:t,name:q4.haltestellen,...r||{}}):null,[t,r]);return q2(()=>{if(!(!e||!n))return e.addLayer(n),a(n),()=>{e.removeLayer(n)}},[e,a,n]),null}var U_=ht(r51);var a51=new o5({image:new l3({fill:new c3({color:"#000000"}),radius:5}),stroke:new h3({color:"#000000",width:6}),zIndex:2}),i51=(r,t,e)=>{let a="#ffffff",n=r.get("type"),i=r.get("stroke");return i&&i[0]!=="#"&&(i=`#${i}`),console.log(r.getProperties()),a=i||e?.getBgColor(n,{name:r.get("line_name")}),a=/#ffffff/i.test(a)?"#ff0000":a,[a51,new o5({image:new l3({fill:new c3({color:a}),radius:4}),stroke:new h3({color:a,width:4}),zIndex:3})]},wU=i51;var N_="Informations",n51=r=>{let e=r.get("features")?.[0]||r,{category:a,feed_id:n,long_name:i,tickets:h}=e.getProperties();return a?pS[a]||N_:n?gS[n]||N_:i?a4.liniennetz:h?a4.verkaufsstellen:N_},HU=n51;var o51=[[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,2,2,3,7,7,7,7,7,7,12,12,15],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,2,2,3,7,7,7,7,7,7,12,12,15]],yU=(r=0,t=0,e=!1)=>{try{let a=C6.getTypeIndex(r);return o51[a][t]*(e?2:1)}catch{return 1}};var _U=(r,t)=>{if(!!t.get("name")&&r!=null){let n=r&&r.split(",")||[],i=t.get("name"),h=n.includes(i);t.getVisible()!==h&&(t.setVisible(h),t.getLayers&&t.getLayers().getArray().forEach(d=>{d.setVisible(h)}))}t.getLayers&&t.getLayers().getArray().forEach(n=>{_U(r,n)})},Q_=_U;var c51=(r,t)=>(q2(()=>{if(!r)return;r8(r.getLayers().getArray()).forEach(a=>{Q_(t,a)});let e=r.getLayers().on("add",a=>{Q_(t,a.element)});return()=>{B0(e)}},[r,t]),null),VU=c51;var CU=U0(Oc(),1);var h51=(r,t=new URLSearchParams)=>{let e=r.getView().getZoom(),[a,n]=r.getView().getCenter(),i=r8(r.getLayers().getArray()).filter(h=>h.get("name")&&h.getVisible()).map(h=>h.get("name"));return t.set("layers",i.join(",")),t.set("x",a.toFixed(2)),t.set("y",n.toFixed(2)),t.set("z",e.toFixed(1)),t},BU=h51;var l51=(r,t)=>(q2(()=>{let e,a,n;return r&&t&&(Op(r),e=r?.on("moveend",i=>{Op(i.map)}),a=r.once("loadend",i=>{Op(i.map),n=r8(i.map.getLayers().getArray()).map(h=>h.on("change:visible",()=>{Op(i.map)}))})),()=>{B0(e),B0(a),B0(n)}},[r,t]),null),s51=r=>{let t=new URLSearchParams(window.location.search),e=BU(r,t);e.set("permalink","true"),window.history.replaceState(null,null,`?${e.toString()}`)},Op=(0,CU.default)(s51,1e3),bU=l51;var G_={},d51=(r,t,e)=>{let a=`${r}, ${t}, ${e}`;if(!G_[a]){let n=n3(r*2,r*2);if(n){let i=n.getContext("2d");if(!i)return null;i.beginPath(),i.arc(r,r,t,0,2*Math.PI,!1),i.fillStyle=e,i.filter="blur(1px)",i.fill(),G_[a]=n}}return G_[a]},j_={},u51=(r,t,e,a,n="#000",i=1)=>{let h=`${r}, ${e}, ${a}, ${n}, ${i}`;if(!j_[h]){let d=n3(Math.ceil(r.length*t),Math.ceil(t+8*i));if(d){let g=d.getContext("2d");if(!g)return null;g.font=e,g.textAlign="left",g.textBaseline="middle",g.font=e,g.fillStyle=a,g.strokeStyle=n,g.lineWidth=1.5*i,g.strokeText(r,0,t),g.fillText(r,0,t),j_[h]=d}}return j_[h]},q_={},v51=(r,t,e,a,n,i)=>{let h=`${r}, ${t}, ${e}, ${a}, ${n}, ${i}`;if(!q_[h]){let d=n3(r*2,r*2);if(d){let g=d.getContext("2d");if(!g)return null;g.fillStyle=e,a&&(g.lineWidth=1*i,g.strokeStyle="#000000"),g.beginPath(),g.arc(r,r,t,0,2*Math.PI,!1),g.fill(),n&&g.setLineDash([5,3]),a&&g.stroke(),q_[h]=d}}return q_[h]},K_={},g51=(r,t,e,a,n,i,h,d)=>{let g=`${r}, ${t}, ${e}, ${a},${n}, ${i}, ${h}`;if(!K_[g]){let m=n3(t*2,t*2);if(m){let z=m.getContext("2d");if(!z)return null;i&&(z.save(),z.textBaseline="middle",z.textAlign="center",z.font=d(e+2,r),z.strokeStyle=n,z.strokeText(r,t,t),z.restore()),z.textBaseline="middle",z.textAlign="center",z.fillStyle=a,z.font=d(e,r),z.strokeStyle=n,z.strokeText(r,t,t),z.fillText(r,t,t),K_[g]=m}}return K_[g]},W_={},p51=(r,t,e)=>{let{delayDisplay:a=3e5,delayOutlineColor:n="#000",getBgColor:i=()=>"#000",getDelayColor:h=()=>"#000",getDelayFont:d=t1=>`bold ${t1}px arial, sans-serif`,getDelayText:g=()=>null,getMaxRadiusForStrokeAndDelay:m=()=>7,getMaxRadiusForText:z=()=>10,getRadius:w=()=>0,getText:b=t1=>t1,getTextColor:_=()=>"#000",getTextFont:P=t1=>`bold ${t1}px arial, sans-serif`,getTextSize:R=()=>14,hoverVehicleId:U,selectedVehicleId:k,useDelayStyle:q}=e,{pixelRatio:Y=1,zoom:d1}=t,{type:z1}=r.properties,{delay:M1,line:m1,operator_provides_realtime_journey:A1,state:_1,train_id:N1}=r.properties,{color:c1,name:o1,text_color:F1}=m1||{};o1=b(o1);let B1=_1==="JOURNEY_CANCELLED";z1||(z1="Rail"),o1||(o1="I"),F1=_(z1),c1=i(z1,m1),c1&&!c1.startsWith("#")&&(c1=`#${c1}`),F1.startsWith("#")||(F1=`#${F1}`);let W1=Math.min(Math.floor(d1||1),16),G1=!!(U&&U===N1),Z1=!!(k&&k===N1),S1=w(z1,W1)*Y,X1=S1>=m()*Y;(G1||Z1)&&(S1=X1?S1+5*Y:14*Y);let i2=S1>z()*Y,z2=`${S1}${G1||Z1}`;if(q?z2+=`${A1}${M1}${B1}`:(z2+=`${c1||z1}`,X1&&(z2+=`${B1}${M1}`)),i2&&(z2+=`${o1}${F1}`),!W_[z2]){if(S1===0)return null;let t1=1*Y,y1=S1+2*Y,H1=S1*2,D1=y1*2+t1*2,q1=D1/2,l2=null;X1&&M1!==null&&(l2=d51(q1,y1,h(M1,B1)));let c2=null,u2=0;if(X1&&(G1||(M1||0)>=a||B1)){u2=Math.max(B1?19:14,Math.min(B1?19:17,S1*1.2))*Y;let E2=g(M1,B1);E2&&(c2=u51(E2,u2,d(u2,E2),h(M1,B1,!0),n,Y))}let _2;q?_2=h(M1,B1):_2=c1||i(z1,r);let U2=v51(q1,S1,_2,X1||G1||Z1,!!X1&&!!q&&M1===null&&A1==="yes",Y),K1=D1+(c2?.width||0)*2,I1=n3(K1,D1);if(I1){let E2=I1.getContext("2d");if(!E2)return null;let $2=c2?.width||0;l2&&E2.drawImage(l2,$2,0),U2&&E2.drawImage(U2,$2,0);let I2=null;if(i2){let P2=Math.max(S1,10),R2=R(E2,H1,o1,P2,P),Y2=q?"#000000":F1||_(z1);I2=g51(o1,q1,R2,Y2,_2,!!q&&M1===null&&A1==="yes",Y,P)}I2&&E2.drawImage(I2,$2,0),c2&&E2.drawImage(c2,$2+Math.ceil(q1+y1)+t1,Math.ceil(q1-u2)),W_[z2]=I1}}return W_[z2]},LU=p51;var SU="";var FU=Wu.join(","),A51={mapLibreOptions:{maxCanvasSize:[2e4,2e4],preserveDrawingBuffer:!0}},f51={},m51={style:{width:"calc(100% - 60px)"}},z51={bboxParameters:{line_tags:"RVF"},fullTrajectoryStyle:wU,style:LU,styleOptions:{getBgColor:gl,getRadius:yU,getTextColor:tv}};function M51({apikey:r="5cc87b12d7c5370001c1d655820abcc37dfd4d968d7bab5b2a74a935",baselayer:t="de.rvf",center:e=null,details:a="true",extent:n=FU,geolocation:i="true",layers:h=null,layertree:d="true",mapsurl:g="https://maps.geops.io",maxextent:m=FU,maxzoom:z="20",minzoom:w=null,mots:b=null,notification:_="true",notificationat:P=null,notificationbeforelayerid:R=null,notificationurl:U=null,permalink:k="false",print:q="true",realtime:Y="true",realtimeurl:d1="wss://api.geops.io/tracker-ws/v1/ws",search:z1="false",share:M1="true",stopsurl:m1="https://api.geops.io/stops/v1/",tenant:A1=null,toolbar:_1="true",zoom:N1=null}){let c1=t5(),[o1,F1]=st(),[B1,W1]=st(!1),[G1,Z1]=st(!1),[S1,X1]=st(),[i2,z2]=st(),[t1,y1]=st(),[H1,D1]=st(),[q1,l2]=st(),[c2,u2]=st(),[_2,B2]=st(),[K2,U2]=st(!1),[K1,M2]=st(!1),[I1,E2]=st(),[$2,I2]=st(),[P2,R2]=st(!1),[Y2,ot]=st(),[ut,Pt]=st(),[Y1,L2]=st(),[Q2,G2]=st(),[dt,o2]=st(),W2=St(()=>_1==="true",[_1]),D2=St(()=>d==="true",[d]),de=St(()=>Y==="true",[Y]),Wt=St(()=>_==="true",[_]),nt=St(()=>i==="true",[i]),Xe=St(()=>z1==="true",[z1]),jt=St(()=>M1==="true",[M1]),Re=St(()=>q==="true",[q]),ce=St(()=>a==="true",[a]);VU(q1,h),bU(q1,k==="true");let E1=St(()=>({apikey:r,baselayer:t,baseLayer:o1,center:e,extent:n,geolocation:i,isFollowing:B1,isTracking:G1,layers:h,map:q1,mapsurl:g,maxextent:m,maxzoom:z,minzoom:w,mots:b,notification:_,notificationat:P,notificationbeforelayerid:R,notificationurl:U,permalink:k,realtimeLayer:H1,realtimeurl:d1,setBaseLayer:F1,setIsFollowing:W1,setIsTracking:Z1,setMap:l2,setRealtimeLayer:D1,setStation:y1,setStationId:u2,setStationsLayer:z2,setStopSequence:X1,setTrainId:B2,station:t1,stationId:c2,stationsLayer:i2,stopSequence:S1,stopsurl:m1,tenant:A1,trainId:_2,zoom:N1}),[r,t,o1,e,n,i,B1,G1,q1,g,m,h,z,w,b,_,P,R,U,k,H1,d1,t1,c2,i2,S1,m1,A1,_2,N1]);q2(()=>{c1.current?.dispatchEvent(new a8("mwc:attribute",{baselayer:t,center:e,details:a,extent:n,geolocation:i,layers:h,layertree:d,mapsurl:g,maxextent:m,maxzoom:z,minzoom:w,mots:b,notification:_,notificationat:P,notificationbeforelayerid:R,notificationurl:U,print:q,realtime:Y,realtimeurl:d1,search:z1,share:M1,tenant:A1,toolbar:_1,zoom:N1}))},[t,h,e,i,d,_1,g,z,w,b,_,P,U,R,Y,d1,z1,A1,N1,n,m,q,M1,a]);let a1=St(()=>({isExportMenuOpen:K2,isLayerTreeOpen:P2,isShareMenuOpen:K1,layertree:d,lineNetworkPlanLayer:Q2,poisLayer:Y1,selectedFeature:I1,selectedFeatures:$2,sellingPointsLayer:Y2,setIsExportMenuOpen:U2,setIsLayerTreeOpen:R2,setIsShareMenuOpen:M2,setLineNetworkPlanLayer:G2,setPoisLayer:L2,setSelectedFeature:E2,setSelectedFeatures:I2,setSellingPointsLayer:ot,setSharedMobilityLayerGroup:o2,setTarifZonenLayer:Pt,sharedMobilityLayerGroup:dt,tarifZonenLayer:ut}),[K2,d,P2,K1,Q2,Y1,I1,$2,Y2,dt,ut]),r1=f4(()=>{R2(!P2)},[P2]),v1=f4(()=>{U2(!1)},[]),C1=St(()=>({format:j1=>{let e2=[];return j1.forEach(P1=>{/(sbb|rvf)/i.test(P1)||e2.push(P1)}),e2.join("&nbsp;|&nbsp;")}}),[]),Q1=St(()=>({layersFilter:({metadata:j1})=>j1?.["rvf.filter"]==="netzplan_stations"}),[]);return q2(()=>{W2&&P2&&(U2(!1),R2(P2),E2(null),B2(null),u2(null),M2(!1))},[P2,W2]),q2(()=>{W2&&K2&&(R2(!1),U2(K2),E2(null),B2(null),M2(!1),u2(null))},[K2,W2]),q2(()=>{W2&&I1&&(R2(!1),U2(!1),B2(null),M2(!1),u2(null))},[I1,W2]),q2(()=>{W2&&c2&&(R2(!1),U2(!1),B2(null),M2(!1),E2(null))},[c2,W2]),q2(()=>{W2&&_2&&(R2(!1),U2(!1),u2(null),M2(!1),E2(null))},[_2,W2]),q2(()=>{W2&&K1&&(R2(!1),U2(!1),u2(null),B2(null),E2(null))},[K1,W2]),X(ZM.Provider,{value:Ep,children:[X("style",{children:Fp}),X("style",{children:SU}),X(wM.Provider,{value:E1,children:X(Ay.Provider,{value:a1,children:X("div",{className:"relative size-full border font-sans @container/main",ref:c1,style:f51,children:X("div",{className:"relative flex size-full flex-col text-base @lg/main:flex-row-reverse",children:[X(LM,{className:"relative flex-1 overflow-visible ",children:[X(HM,{...A51}),X(Ip,{}),X(Ny,{}),de&&X(DM,{title:a4.echtzeit,...z51}),X(U_,{minZoom:10,title:a4.haltestellen,...Q1}),Wt&&X(qu,{}),X(A_,{title:a4.tarifzonen}),X(qy,{isQueryable:!1,title:a4.verkaufsstellen}),X(Ry,{isQueryable:!1,minZoom:10,title:a4.liniennetz}),X(Uy,{title:a4.pois}),X(v_,{title:a4.sharedMobility}),X("div",{className:"pointer-events-none absolute inset-x-2 bottom-2 z-10 flex items-end justify-between gap-2 text-[10px]",children:[X(V_,{className:"bg-slate-50/70"}),X(yM,{className:"pointer-events-auto bg-slate-50/70",options:C1})]}),X("div",{className:"absolute right-2 top-2 z-10 flex flex-col gap-2",children:[nt&&X(bM,{}),!W2&&Re&&X(ip,{})]}),Xe&&X("div",{className:"absolute left-2 right-12 top-2 z-10 flex max-h-[90%] min-w-64 max-w-96 flex-col",children:X(E_,{})}),X("div",{className:"absolute bottom-10 right-2 z-10 flex flex-col justify-between gap-2",children:X(H_,{})}),!W2&&D2&&X(Oy,{isOpen:P2,onClick:r1,title:"Kartendaten",children:X(Cp,{className:"w-full px-2"})})]}),X(IM,{className:"z-50 bg-white",ScrollableHandlerProps:m51,children:[de&&_2&&X(ke,{children:[X(Jc,{onClose:()=>{B2(null)},title:a4.echtzeit}),X(sx,{className:"relative overflow-y-auto overflow-x-hidden"})]}),A1&&c2&&X(ke,{children:[X(Jc,{onClose:()=>{u2(null)},title:"Station"}),X(k_,{className:"relative flex flex-col overflow-y-auto overflow-x-hidden p-2"})]}),ce&&I1&&X(ke,{children:[X(Jc,{onClose:()=>{E2(null)},title:HU(I1)}),X(Iy,{className:"relative flex h-full flex-col gap-4 overflow-y-auto overflow-x-hidden p-4"})]}),W2&&Re&&K2&&X(ke,{children:[X(Jc,{onClose:()=>{U2(!1)},title:"Dr\xFCcken"}),X(ap,{className:"relative flex flex-col gap-8 overflow-y-auto overflow-x-hidden px-4 py-6"})]}),W2&&D2&&P2&&X(ke,{children:[X(Jc,{onClose:()=>{R2(!1)},title:"Layers"}),X(Cp,{className:" relative flex h-full flex-col overflow-y-auto overflow-x-hidden p-2"})]}),W2&&jt&&K1&&X(ke,{children:[X(Jc,{onClose:()=>{M2(!1)},title:"Share"}),X(e_,{className:"relative flex h-full flex-col gap-8 overflow-y-auto overflow-x-hidden px-4 py-6"})]})]}),W2&&X("div",{className:"z-[100] flex justify-around overflow-x-hidden border-t bg-white p-1 @lg/main:block @lg/main:border-r @lg/main:p-0 ",children:[D2&&X(Py,{className:"border-none",title:"Layers"}),Re&&X(ip,{className:"border-none",title:"Dr\xFCcken"}),jt&&X(p_,{className:"border-none",title:"Share"})]}),!W2&&Re&&K2&&X(Dy,{onClose:v1,children:X(ap,{className:"relative flex h-full flex-col overflow-y-auto overflow-x-hidden p-2"})})]})})})})]})}var Tp=ht(M51);OA(Tp,"geops-mobility",["apikey","baselayer","center","extent","maxextent","geolocation","details","layers","layertree","mapsurl","mots","notification","notificationat","notificationurl","notificationbeforelayerid","print","realtime","realtimeurl","search","share","tenant","zoom","permalink"],{shadow:!0});OA(O9,"geops-mobility-search",["apikey","bbox","countrycode","event","field","limit","mots","onselect","params","prefagencies","reflocation","url"],{shadow:!0});})();
3025
3025
  /*! Bundled license information:
3026
3026
 
3027
3027
  maplibre-gl/dist/maplibre-gl.js:
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@geops/rvf-mobility-web-component",
3
3
  "license": "UNLICENSED",
4
4
  "description": "Web components for rvf in the domains of mobility and logistics.",
5
- "version": "0.1.26",
5
+ "version": "0.1.27",
6
6
  "homepage": "https://rvf-mobility-web-component-geops.vercel.app/",
7
7
  "type": "module",
8
8
  "main": "index.js",
@@ -133,7 +133,7 @@ function RvfMobilityMap({
133
133
  search = "false",
134
134
  share = "true",
135
135
  stopsurl = "https://api.geops.io/stops/v1/",
136
- tenant = "de-gtfs-de",
136
+ tenant = null,
137
137
  toolbar = "true",
138
138
  zoom = null,
139
139
  }: RvfMobilityMapProps) {