PageSourceSearch

https://trains.fyi/_next/static/chunks/pages/networks/[networkSlug]/stations/[stopCode]-5de59377c1d69847.js

js trains.fyi collected 2026-09-24 09:55:05 UTC 17,295 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1137],{4402:()=>{},12107:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var r=s(14232);let a=r.forwardRef(function({title:e,titleId:t,...s},a){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},s),e?r.createElement("title",{id:t},e):null,r.createElement("path",{fillRule:"evenodd",d:"M8.161 2.58a1.875 1.875 0 0 1 1.678 0l4.993 2.498c.106.052.23.052.336 0l3.869-1.935A1.875 1.875 0 0 1 21.75 4.82v12.485c0 .71-.401 1.36-1.037 1.677l-4.875 2.437a1.875 1.875 0 0 1-1.676 0l-4.994-2.497a.375.375 0 0 0-.336 0l-3.868 1.935A1.875 1.875 0 0 1 2.25 19.18V6.695c0-.71.401-1.36 1.036-1.677l4.875-2.437ZM9 6a.75.75 0 0 1 .75.75V15a.75.75 0 0 1-1.5 0V6.75A.75.75 0 0 1 9 6Zm6.75 3a.75.75 0 0 0-1.5 0v8.25a.75.75 0 0 0 1.5 0V9Z",clipRule:"evenodd"}))})},28168:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});var r=s(31198),a=s.n(r);"unavailable"===a().getRTLTextPluginStatus()&&a().setRTLTextPlugin("/vendor/mapbox-gl-rtl-text/0.2.3.min.js",!0).catch(e=>console.error("Unable to initialize right-to-left map labels",e));let l=a()},34299:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var r=s(14232);let a=r.forwardRef(function({title:e,titleId:t,...s},a){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},s),e?r.createElement("title",{id:t},e):null,r.createElement("path",{fillRule:"evenodd",d:"M2.25 13.5a8.25 8.25 0 0 1 8.25-8.25.75.75 0 0 1 .75.75v6.75H18a.75.75 0 0 1 .75.75 8.25 8.25 0 0 1-16.5 0Z",clipRule:"evenodd"}),r.createElement("path",{fillRule:"evenodd",d:"M12.75 3a.75.75 0 0 1 .75-.75 8.25 8.25 0 0 1 8.25 8.25.75.75 0 0 1-.75.75h-7.5a.75.75 0 0 1-.75-.75V3Z",clipRule:"evenodd"}))})},59531:(e,t,s)=>{"use strict";s.d(t,{Ec:()=>a,pI:()=>r,z7:()=>l});let r=(e="light")=>`https://tiles.openfreemap.org/styles/${"dark"===e?"dark":"positron"}`,a=()=>({version:8,sources:{openmaptiles:{type:"vector",url:"https://tiles.openfreemap.org/planet"}},layers:[{id:"background",type:"background",paint:{"background-color":"#f2f3f0"}},{id:"water",type:"fill",source:"openmaptiles","source-layer":"water",paint:{"fill-color":"#a8d5e3"}}]}),l=e=>{try{let t=e.getStyle();if(!t)return;let s=t.layers?.find(e=>"symbol"===e.type&&e.layout&&e.layout["text-field"])?.id,r=Object.keys(t.sources||{}).find(e=>t.sources[e]?.type==="vector");if(!r)return;e.getLayer("3d-buildings")||e.addLayer({id:"3d-buildings",type:"fill-extrusion",source:r,"source-layer":"building",minzoom:15,paint:{"fill-extrusion-color":"#d1d5db","fill-extrusion-height":["coalesce",["get","render_height"],["get","height"],0],"fill-extrusion-base":["coalesce",["get","render_min_height"],["get","min_height"],0],"fill-extrusion-opacity":.6}},s)}catch(e){}}},60570:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var r=s(14232);let a=r.forwardRef(function({title:e,titleId:t,...s},a){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},s),e?r.createElement("title",{id:t},e):null,r.createElement("path",{fillRule:"evenodd",d:"M9.293 2.293a1 1 0 0 1 1.414 0l7 7A1 1 0 0 1 17 11h-1v6a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-6H3a1 1 0 0 1-.707-1.707l7-7Z",clipRule:"evenodd"}))})},66212:(e,t,s)=>{"use strict";s.r(t),s.d(t,{__N_SSP:()=>N,default:()=>_});var r=s(37876),a=s(28168),l=s(89099),n=s(14232),i=s(49915),o=s(85392),d=s(74),c=s(5876),m=s(93408),u=s(56785),x=s(49086);let p=n.forwardRef(function({title:e,titleId:t,...s},r){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},s),e?n.createElement("title",{id:t},e):null,n.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z",clipRule:"evenodd"}))}),h=n.forwardRef(function({title:e,titleId:t,...s},r){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
1currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},s),e?n.createElement("title",{id:t},e):null,n.createElement("path",{fillRule:"evenodd",d:"M12.97 3.97a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 1 1-1.06-1.06l6.22-6.22H3a.75.75 0 0 1 0-1.5h16.19l-6.22-6.22a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))});var f=s(48230),g=s.n(f);let b=({trip:e,stopCode:t})=>{let{networkSlug:s}=(0,l.useRouter)().query,a=e.stops[e.stops.length-1].stop_id===t,n=e.stops.findIndex(e=>e.stop_id===t),i=e.stops[e.stops.length-1].stop_name,o=e.stops[0].stop_name;return(0,r.jsx)(g(),{href:`/networks/${s}/trips/${e.trip.trip_id}/`,children:(0,r.jsxs)("div",{className:"bg-white shadow-md rounded-lg p-4 hover:shadow-lg transition-shadow duration-300 cursor-pointer",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,r.jsx)("h3",{className:"text-xl font-bold text-gray-800",children:a?`Train from ${o}`:`Train to ${i}`}),(0,r.jsx)("span",{className:"text-sm font-semibold bg-blue-100 text-blue-800 py-1 px-2 rounded",children:e.trip.trip_short_name})]}),(0,r.jsxs)("div",{className:"flex items-center text-gray-600 mb-3",children:[(0,r.jsx)(p,{className:"w-5 h-5 mr-2"}),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("span",{className:"font-bold text-lg text-gray-800",children:(e=>{let[t,s]=e.split(":"),r=new Date;r.setHours(parseInt(t,10)),r.setMinutes(parseInt(s,10));let a=r.toLocaleString("en-US",{hour:"numeric",minute:"numeric",hour12:!0}),l=Math.round((r-new Date)/6e4);return`${a} (in ${l} mins)`})(e.stop_time.departure_time)}),(0,r.jsx)("span",{className:"text-xs text-gray-500",children:a?"Scheduled Arrival":"Scheduled Departure"})]})]}),(0,r.jsxs)("div",{className:"flex items-center mb-3",children:[(0,r.jsx)("div",{className:"w-5/12 truncate",children:(0,r.jsx)("a",{href:`/networks/${s}/stations/${e.stops[0].stop_id}`,className:"text-blue-600 hover:underline",onClick:e=>e.stopPropagation(),children:e.stops[0].stop_name})}),(0,r.jsx)("div",{className:"w-2/12 flex justify-center",children:(0,r.jsx)(h,{className:"w-5 h-5 text-gray-400"})}),(0,r.jsx)("div",{className:"w-5/12 truncate text-right",children:(0,r.jsx)("a",{href:`/networks/${s}/stations/${e.stops[e.stops.length-1].stop_id}/`,className:"text-blue-600 hover:underline",onClick:e=>e.stopPropagation(),children:e.stops[e.stops.length-1].stop_name})})]}),(0,r.jsx)("div",{className:"relative pt-4",children:(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:e.stops.map((e,t)=>(0,r.jsx)("a",{href:`/networks/${s}/stations/${e.stop_id}/`,className:`text-xs px-2 py-1 rounded ${t===n?"bg-green-600 text-white":"bg-gray-50 text-gray-700 hover:bg-gray-300"}`,onClick:e=>e.stopPropagation(),children:e.stop_name},e.stop_id))})})]})})};var v=s(78240);let w=()=>{var e;let{networkSlug:t,stopCode:s}=(0,l.useRouter)().query,{stopDetails:a,isLoading:i,isError:o}=(0,v.kU)(t,s),[,d]=(0,n.useState)(null),[m,u]=(0,n.useState)([]),[x,p]=(0,n.useState)([]),[h,f]=(0,n.useState)("departures");if((0,n.useEffect)(()=>{if(a&&a.local_time&&d(new Date(a.local_time).toLocaleTimeString()),a&&a.upcoming_trips){let e=[],t=[];a.upcoming_trips.forEach(r=>{r.stops[r.stops.length-1].stop_id===s?e.push(r):t.push(r)}),u(e),p(t)}},[a,s]),i)return(0,r.jsx)(c.A,{text:"Loading upcoming trains..."});if(o)return(0,r.jsx)("div",{children:"Error loading upcoming trains"});if(!a||!a.upcoming_trips)return(0,r.jsx)("div",{children:"No upcoming trains found"});let g=[{name:"Departures",id:"departures"},{name:"Arrivals",id:"arrivals"}];return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"sm:hidden",children:[(0,r.jsx)("label",{htmlFor:"tabs",className:"sr-only",children:"Select a tab"}),(0,r.jsx)("select",{id:"tabs",name:"tabs",className:"block w-full rounded-md border-gray-300 py-2 pl-3 pr-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm",value:h,onChange:e=>f(e.target.value),children:g.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,r.jsx)("div",{className:"hidden sm:block",children:(0,r.jsx)("div",{className:"border-b border-gray-200",children:(0,r.jsx)("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:g.map(e=>(0,r.jsx)("a",{href:"#",onClick:t=>{t.preventDefault(),f(e.id)},className:`${h===e.id?"border-indigo-500 text-indigo-600":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"} whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm`,children:e.name},e.id))})})}),(0,r.jsx)("div",{className:"mt-4",children:0===(e="departures"===h?x:m).length?(0,r.jsx)("div",{className:"text-gray-500",children:"No trains found."}):(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-8",children:e.map((e,t)=>(0,r.jsx)(b,{trip:e,stopCode:s},t))})})]})};function j({networkSlug:e,stopId:t}){let s=(0,v.od)(e),{departures:a,localTime:l,isLoading:n,isError:i}=(0,v.wF)(e,t);return s&&t?i?(0,r.jsx)("p",{className:"text-sm text-red-600",children:"Could not load departures."}):n?(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"Loading departures…"}):(0,r.jsxs)("section",{className:"mt-4","aria-label":"Departures",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Departures"}),l&&(0,r.jsxs)("p",{className:"text-xs text-gray-500 mb-2",children:["Local time: ",l]}),a?.length?(0,r.jsx)("ul",{className:"space-y-2",children:a.slice(0,15).map((e,t)=>(0,r.jsxs)("li",{className:"flex justify-between items-center text-sm py-1 border-b border-gray-100",children:[(0,r.jsxs)("span",{className:"font-medium",children:[e.route_short_name," – ",e.trip_headsign||e.final_destination?.stop_name||"—"]}),(0,r.jsx)("span",{children:e.scheduled_departure}),e.delay_seconds>0&&(0,r.jsxs)("span",{className:"text-amber-600",children:["+",Math.round(e.delay_seconds/60)," min"]}),"delayed"===e.status&&(0,r.jsx)("span",{className:"text-amber-600 text-xs",children:"Delayed"})]},`${e.trip_id}-${e.scheduled_departure}-${t}`))}):(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"No upcoming departures."})]}):null}s(4402);var y=s(59531),N=!0;function _({network:e}){let t=(0,l.useRouter)(),{networkSlug:s,stopCode:p}=t.query,{stopDetails:h,isLoading:f,isError:g}
1=(0,v.kU)(s,p),[b,N]=(0,n.useState)(""),k=(0,u.A)({networkName:e?.name,networkSlug:s,network:e}),$=(0,n.useRef)(null),E=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(h?.stop&&$.current&&!E.current){let{stop_lat:t,stop_lon:s}=h.stop,r=new a.A.Map({container:$.current,style:(0,y.pI)(),center:[s,t],zoom:13,antialias:!0});E.current=r,r.dragPan.disable(),r.scrollZoom.disable(),r.boxZoom.disable(),r.doubleClickZoom.disable(),r.keyboard.disable(),r.touchZoomRotate.disable(),r.on("load",()=>{r.addSource("stop-point",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[s,t]},properties:{}}]}}),r.addLayer({id:"stop-point-layer",type:"circle",source:"stop-point",paint:{"circle-radius":6,"circle-color":e.color||"#2563eb","circle-stroke-width":2,"circle-stroke-color":e.darkerColor||"#1e40af"}})})}return()=>{E.current&&(E.current.remove(),E.current=null)}},[h?.stop,e.color,e.darkerColor]),(0,n.useEffect)(()=>{if(h?.stop?.stop_timezone){let e=()=>{let e=new Date,t={timeZone:h.stop.stop_timezone,hour:"numeric",minute:"2-digit",hour12:!0};N(e.toLocaleTimeString("en-US",t).replace(/^0/,""))};e();let t=setInterval(e,1e3);return()=>clearInterval(t)}},[h?.stop?.stop_timezone]);let R=(0,n.useMemo)(()=>[{name:"Networks",href:"/networks",current:!1},{name:e?.name,href:`/networks/${s}/`,current:!1},{name:"Stations",href:`/networks/${s}/stations/`,current:!1},{name:h?.stop?.stop_name||"Stop",href:`/networks/${s}/stations/${p}/`,current:!0}],[e?.name,s,p,h?.stop?.stop_name]);if(f)return(0,r.jsx)("div",{className:"flex items-center justify-center h-screen",children:(0,r.jsx)(c.A,{text:"Loading stop details..."})});if(g)return(0,r.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,r.jsx)(d.A,{networkNav:k}),(0,r.jsx)("main",{className:"flex-grow",children:(0,r.jsx)("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-8",children:(0,r.jsxs)("div",{className:"rounded-md bg-red-50 p-4",children:[(0,r.jsx)("h3",{className:"text-sm font-medium text-red-800",children:"Error Loading Data"}),(0,r.jsx)("p",{className:"mt-2 text-sm text-red-700",children:"There was an error loading the station data. Please try again later."})]})})}),(0,r.jsx)(o.A,{})]});if(!e)return(0,r.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,r.jsx)(d.A,{}),(0,r.jsx)("main",{className:"flex-grow",children:(0,r.jsx)("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-8",children:(0,r.jsxs)("div",{className:"rounded-md bg-yellow-50 p-4",children:[(0,r.jsx)("h3",{className:"text-sm font-medium text-yellow-800",children:"Network Not Found"}),(0,r.jsx)("p",{className:"mt-2 text-sm text-yellow-700",children:"The requested network could not be found."})]})})}),(0,r.jsx)(o.A,{})]});if(!h)return(0,r.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,r.jsx)(d.A,{networkNav:k}),(0,r.jsx)("main",{className:"flex-grow",children:(0,r.jsx)("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-8",children:(0,r.jsxs)("div",{className:"rounded-md bg-yellow-50 p-4",children:[(0,r.jsx)("h3",{className:"text-sm font-medium text-yellow-800",children:"Station Not Found"}),(0,r.jsx)("p",{className:"mt-2 text-sm text-yellow-700",children:"The requested station could not be found."})]})})}),(0,r.jsx)(o.A,{})]});let{stop:C}=h,S=`${C.stop_name} - ${e.name} Station`,A=`Real-time information for ${C.stop_name} station on the ${e.name} network.`,L=`/networks/${s}/stations/${p}/`,M=`${C.stop_name}, ${e.name}, station, stop, public transit, train station, real-time arrivals`,I=`/api/og?mode=station&network=${encodeURIComponent(e.name)}&station=${encodeURIComponent(C.stop_name)}&bg=${encodeURIComponent(e.color||"1e3a8a")}&tc=${encodeURIComponent(e.textColor||"ffffff")}`;return(0,r.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,r.jsx)(m.A,{title:S,description:A,canonical:L,image:I,keywords:M,type:"website"}),(0,r.jsx)(d.A,{networkNav:k}),(0,r.jsx)("main",{className:"flex-grow",children:(0,r.jsxs)("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:[(0,r.jsx)("div",{className:"py-4",children:(0,r.jsx)(i.A,{pages:R})}),(0,r.jsx)("div",{className:"bg-blue-800 shadow-lg rounded-lg overflow-hidden mb-8 mt-10 h-[300px]",children:(0,r.jsxs)("div",{className:"flex flex-col md:flex-row items-stretch h-full",children:[(0,r.jsxs)("div",{className:"p-6 flex-grow pr-0 md:pr-6 mb-6 md:mb-0 flex flex-col justify-center pl-8",children:[(0,r.jsx)("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold tracking-tight text-white mb-2",children:C.stop_name}),(0,r.jsxs)("p",{className:"text-base md:text-lg text-blue-100 mb-2",children:[e.name," station (",C.stop_code,")"]}),(0,r.jsx)("p",{className:"text-base md:text-lg text-blue-100 mb-4",children:b}),(0,r.jsx)("div",{className:"flex gap-2",children:[].map(e=>(0,r.jsx)("button",{onClick:()=>{var s;return s=e.href,void t.push(s)},className:function(...e){return e.filter(Boolean).join(" ")}(e.current?"bg-indigo-600 text-white":"bg-white text-gray-700 hover:bg-gray-50","px-4 py-2 rounded-md text-sm font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"),children:e.name},e.name))})]}),(0,r.jsxs)("div",{className:"w-full md:w-1/2 bg-white overflow-hidden relative h-full",children:[(0,r.jsx)("div",{className:"absolute inset-0 z-10",children:(0,r.jsx)("div",{ref:$,style:{height:"100%",width:"100%"}})}),(0,r.jsx)("div",{className:"absolute inset-0 bg-blue-800 opacity-50 z-20"}),(0,r.jsx)("div",{className:"absolute inset-0 z-30",style:{background:"linear-gradient(to right, rgba(30, 64, 175, 1) 0%, rgba(30, 64, 175, 0) 100%)"}})]})]})}),(0,r.jsx)(x.I,{networkSlug:s,stopIds:C?.stop_id?[C.stop_id]:[],className:"mb-6"}),s&&C?.stop_id&&(0,r.jsx)(j,{networkSlug:s,stopId:C.stop_id}),(0,r.jsx)(w,{})]})}),(0,r.jsx)(o.A,{})]})}},73188:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/networks/[networkSlug]/stations/[stopCode]",function(){return s(66212)}])},77808:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var r=s(14232);let a=r.forwardRef(function({title:e,titleId:t,...s},a){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},s),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18"}))})}},e=>{e.O(0,[6701,3368,3927,2325,1808,3990,8447,5392,4503,636,6593,8792],()=>e(e.s=73188)),_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.