PageSourceSearch

https://my-commute-choice.lovable.app/assets/routes-wnlvZyGW.js

js my-commute-choice.lovable.app collected 2026-10-03 03:33:32 UTC 35,837 bytes, 1 lines download raw bytes

1import{C as e,S as t,T as n,_ as r,a as i,b as a,c as o,d as s,f as c,g as l,h as u,i as d,l as f,m as p,n as m,o as h,p as g,r as _,s as v,t as y,u as b,v as x,w as S,x as C,y as w}from"./index-QcHmDCQH.js";function T(e){if(Array.isArray(e))return e.flatMap(e=>T(e));if(typeof e!=`string`)return[];let t=[],n=0,r,i,a,o,s,c=()=>{for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length},l=()=>(i=e.charAt(n),i!==`=`&&i!==`;`&&i!==`,`);for(;n<e.length;){for(r=n,s=!1;c();)if(i=e.charAt(n),i===`,`){for(a=n,n+=1,c(),o=n;n<e.length&&l();)n+=1;n<e.length&&e.charAt(n)===`=`?(s=!0,n=o,t.push(e.slice(r,a)),r=n):n=a+1}else n+=1;(!s||n>=e.length)&&t.push(e.slice(r))}return t}function E(e){return e instanceof Headers?e:Array.isArray(e)||typeof e==`object`?new Headers(e):null}function D(...e){return e.reduce((e,t)=>{let n=E(t);if(!n)return e;for(let[t,r]of n.entries())t===`set-cookie`?T(r).forEach(t=>e.append(`set-cookie`,t)):e.set(t,r);return e},new Headers)}var O=n(S(),1);function k(e){let t=r();return O.useCallback(async(...n)=>{try{let t=await e(...n);if(a(t))throw t;return t}catch(e){if(a(e))return e.options._fromLocation=t.stores.location.get(),t.navigate(t.resolveRedirect(e).options);throw e}},[t,e])}function A(e){return e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}function j(e,t){let n=Object.create(null);if(e)for(let t of Object.keys(e))A(t)&&(n[t]=e[t]);if(t&&typeof t==`object`)for(let e of Object.keys(t))A(e)&&(n[e]=t[e]);return n}function M(e){if(!e)return Object.create(null);let t=Object.create(null);for(let n of Object.keys(e))A(n)&&(t[n]=e[n]);return t}var N=()=>{throw Error(`createServerOnlyFn() functions can only be called on the server!`)},P=(t,n)=>{let r=n||t||{};r.method===void 0&&(r.method=`GET`);let i=e=>P(void 0,{...r,validator:e,inputValidator:e});return Object.assign(e=>P(void 0,{...r,...e}),{options:r,middleware:t=>{let n=[...r.middleware||[]];t.map(t=>{e in t?t.options.middleware&&n.push(...t.options.middleware):n.push(t)});let i=P(void 0,{...r,middleware:n});return i[e]=!0,i},validator:i,inputValidator:i,handler:(...e)=>{let[t,n]=e,i={...r,extractedFn:t,serverFn:n},a=[...i.middleware||[],R(i)];return t.method=r.method,Object.assign(async e=>{let n=await F(a,`client`,{...t,...i,data:e?.data,headers:e?.headers,signal:e?.signal,fetch:e?.fetch,context:M()}),r=C(n.error);if(r)throw r;if(n.error)throw n.error;return n.result},{...t,method:r.method,__executeServer:async e=>{let n=N(),r=n.contextAfterGlobalMiddlewares;return await F(a,`server`,{...t,...e,serverFnMeta:t.serverFnMeta,context:j(e.context,r),request:n.request}).then(e=>({result:e.result,error:e.error,context:e.sendContext}))}})}})};async function F(e,n,r){let i=I([...t()?.functionMiddleware||[],...e]);if(n===`server`){let e=N({throwIfNotFound:!1});e?.executedRequestMiddlewares&&(i=i.filter(t=>!e.executedRequestMiddlewares.has(t)))}let o=async e=>{let t=i.shift();if(!t)return e;try{let r=`validator`in t.options?t.options.validator:void 0;!r&&`inputValidator`in t.options&&(r=t.options.inputValidator),r&&n===`server`&&(e.data=await L(r,e.data));let i;if(n===`client`?`client`in t.options&&(i=t.options.client):`server`in t.options&&(i=t.options.server),i){let t=async(t={})=>{let n=await o({...e,...t,context:j(e.context,t.context),sendContext:j(e.sendContext,t.sendContext),headers:D(e.headers,t.headers),_callSiteFetch:e._callSiteFetch,fetch:e._callSiteFetch??t.fetch??e.fetch,result:t.result===void 0?t instanceof Response?t:e.result:t.result,error:t.error??e.error});if(n.error)throw n.error;return n},n=await i({...e,next:t});if(a(n))return{...e,error:n};if(n instanceof Response)return{...e,result:n};if(!n)throw Error(`User middleware returned undefined. You must call next() or return a result in your middlewares.`);return n}return o(e)}catch(t){return{...e,error:t}}};return o({...r,headers:r.headers||{},sendContext:r.sendContext||{},context:r.context||M(),_callSiteFetch:r.fetch})}function I(e,t=100){let n=new Set,r=[],i=(e,a)=>{if(a>t)throw Error(`Middleware nesting depth exceeded maximum of ${t}. Check for circular references.`);e.forEach(e=>{e.options.middleware&&i(e.options.middleware,a+1),n.has(e)||(n.add(e),r.push(e))})};return i(e,0),r}async function L(e,t){if(e==null)return{};if(`~standard`in e){let n=await e[`~standard`].validate(t);if(n.issues)throw Error(JSON.stringify(n.issues,void 0,2));return n.value}if(`parse`in e)return e.parse(t);if(typeof e==`function`)return e(t);throw Error(`Invalid validator type!`)}function R(e){return{"~types":void 0,options:{inputValidator:e.validator??e.inputValidator,client:async({next:t,sendContext:n,fetch:r,...i})=>{let a={...i,context:n,fetch:r};return t(await e.extractedFn?.(a))},server:async({next:t,...n})=>{let r=await e.serverFn?.(n);return t({...n,result:r})}}}}var z=class extends l{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=d(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),V(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return H(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return H(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof f(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!s(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&U(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||f(this.options.enabled,this.#t)!==f(t.enabled,this.#t)||b(this.options.staleTime,this.#t)!==b(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||f(this.options.enabled,this.#t)!==f(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ee(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pen
1ding`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(v)),t}#g(){this.#b();let e=b(this.options.staleTime,this.#t);if(i.isServer()||this.#r.isStale||!h(e))return;let t=g(this.#r.dataUpdatedAt,e)+1;this.#d=p.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(i.isServer()||f(this.options.enabled,this.#t)===!1||!h(this.#p)||this.#p===0)&&(this.#f=p.setInterval(()=>{(this.options.refetchIntervalInBackground||u.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(p.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(p.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,s=this.#a,c=e===n?this.#n:e.state,{state:l}=e,u={...l},p=!1,h;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&V(e,t),o=i&&U(e,n,t,r);(a||o)&&(u={...u,...m(l.data,e.options)}),t._optimisticResults===`isRestoring`&&(u.fetchStatus=`idle`)}let{error:g,errorUpdatedAt:_,status:v}=u;h=u.data;let y=!1;if(t.placeholderData!==void 0&&h===void 0&&v===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=i.data,y=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(v=`success`,h=o(i?.data,e,t),p=!0)}if(t.select&&h!==void 0&&!y)if(i&&h===a?.data&&t.select===this.#c)h=this.#l;else try{this.#c=t.select,h=t.select(h),h=o(i?.data,h,t),this.#l=h,this.#s=null}catch(e){this.#s=e}this.#s&&(g=this.#s,h=this.#l,_=Date.now(),v=`error`);let b=u.fetchStatus===`fetching`,x=v===`pending`,S=v===`error`,C=x&&b,w=h!==void 0,T={status:v,fetchStatus:u.fetchStatus,isPending:x,isSuccess:v===`success`,isError:S,isInitialLoading:C,isLoading:C,data:h,dataUpdatedAt:u.dataUpdatedAt,error:g,errorUpdatedAt:_,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:S&&!w,isPaused:u.fetchStatus===`paused`,isPlaceholderData:p,isRefetchError:S&&w,isStale:W(e,t),refetch:this.refetch,promise:this.#o,isEnabled:f(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=T.data!==void 0,r=T.status===`error`&&!t,i=e=>{r?e.reject(T.error):t&&e.resolve(T.data)},a=()=>{let e=this.#o=T.promise=d();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||T.data!==o.value)&&a();break;case`rejected`:(!r||T.error!==o.reason)&&a()}}return T}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!s(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){_.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function B(e,t){return f(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||f(t.retryOn
1Mount,e)!==!1)}function V(e,t){return B(e,t)||e.state.data!==void 0&&H(e,t,t.refetchOnMount)}function H(e,t,n){if(f(t.enabled,e)!==!1&&b(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&W(e,t)}return!1}function U(e,t,n,r){return(e!==t||f(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&W(e,n)}function W(e,t){return f(t.enabled,e)!==!1&&e.isStaleByTime(b(t.staleTime,e))}function ee(e,t){return!s(e.getCurrentResult(),t)}var te=O.createContext(!1),ne=()=>O.useContext(te);te.Provider;var G=x();function re(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ie=O.createContext(re()),ae=()=>O.useContext(ie),oe=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?c(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},se=e=>{O.useEffect(()=>{e.clearReset()},[e])},ce=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||c(n,[e.error,r])),le=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ue=(e,t)=>
1e.isLoading&&e.isFetching&&!t,de=(e,t)=>e?.suspense&&t.isPending,fe=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function pe(e,t,n){let r=ne(),a=ae(),o=y(n),s=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(s);let c=o.getQueryCache().get(s.queryHash),l=e.subscribed!==!1;s._optimisticResults=r?`isRestoring`:l?`optimistic`:void 0,le(s),oe(s,a,c),se(a);let u=!o.getQueryCache().get(s.queryHash),[d]=O.useState(()=>new t(o,s)),f=d.getOptimisticResult(s),p=!r&&l;if(O.useSyncExternalStore(O.useCallback(e=>{let t=p?d.subscribe(_.batchCalls(e)):v;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),O.useEffect(()=>{d.setOptions(s)},[s,d]),de(s,f))throw fe(s,d,a);if(ce({result:f,errorResetBoundary:a,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw f.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(s,f),s.experimental_prefetchInRender&&!i.isServer()&&ue(f,r)&&(u?fe(s,d,a):c?.promise)?.catch(v).finally(()=>{d.updateResult()}),s.notifyOnChangeProps?f:d.trackResult(f)}function K(e,t){return pe(e,z,t)}var me=P({method:`GET`}).handler(w(`2ce2bd1cd7d08bb7d075aa00ff84caa69f2d90e5a3f053ec081cd5fd9fa93e21`)),he=P({method:`GET`}).handler(w(`20af918033db5a4ed20070ba5d3a278809817f83a8ad90ed0002aa8c0f5fdafe`)),ge=P({method:`GET`}).handler(w(`b7a02e8a4d4d1bae0b661db774c518b8b4b4189d84f374b8b6895c7f00ca2a5b`));function q(e,t){return typeof e==`number`&&Number.isFinite(e)?e.toFixed(t):`—`}function _e(e){let t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`}function ve(){let e=new Date(Date.now()+72e5);e.setSeconds(0,0),e.setMinutes(e.getMinutes()>30?60:30);let t=new Date(e.getTime()+288e5);return{outbound:_e(e),ret:_e(t)}}function ye(e){let t=new Date(e).getTime();return Number.isFinite(t)?t:null}function J(e){if(e===null||!Number.isFinite(e))return`—`;let t=Math.floor(e/60);return t>0?`${t}小时${e%60}分`:`${e}分钟`}function Y(e){let t=new Date(e);return Number.isNaN(t.getTime())?`—`:t.toLocaleString(`zh-CN`,{weekday:`short`,hour:`numeric`,minute:`2-digit`})}function X(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleTimeString(`zh-CN`,{hour:`2-digit`,minute:`2-digit`,hour12:!1})}function be(e){let t=[e.agency,e.line].filter(Boolean).join(` `)||`公共交通`,n=e.headsign&&e.headsign!==e.toStop?`(往 ${e.headsign})`:``,r=e.toStop?` ${e.toStop}`:``;return`${X(e.departISO)??`—`} ${t}${n} → ${X(e.arriveISO)??`—`}${r}`}function xe(e,t){if(e.length>1)return`公共交通(${e.length} 段,含换乘)`;let n=e[0];return n?`乘坐 ${[n.agency,n.line].filter(Boolean).join(` `)||t}`:`乘坐 ${t}`}
1var Se=`1931 S Rengstorff Ave, Mountain View, CA 94040`;function Ce(){let[e,t]=(0,O.useState)({preset:`sf`}),[n,r]=(0,O.useState)(``),[i,a]=(0,O.useState)(void 0),[o,s]=(0,O.useState)(``),[c,l]=(0,O.useState)(``),[u,d]=(0,O.useState)(`arrive`),[f,p]=(0,O.useState)(!0),[m,h]=(0,O.useState)(``),[g,_]=(0,O.useState)(`depart`),[v,y]=(0,O.useState)(!1),[b,x]=(0,O.useState)(null);(0,O.useEffect)(()=>{let e=ve();l(e.outbound),h(e.ret),y(!0);let t=()=>x(new Date().toLocaleTimeString(`zh-CN`,{hour:`2-digit`,minute:`2-digit`,hour12:!1}));t();let n=setInterval(t,3e4);return()=>clearInterval(n)},[]);let S=ye(c),C=ye(m),w=v?S===null?`请填写一个有效的去程时间。`:f&&C===null?`请填写一个有效的回程时间。`:f&&C!==null&&C<=S?`回程时间需要晚于去程时间。`:null:null,T=k(me),{data:E,isPending:D,error:A}=K({queryKey:[`verdict`,e.preset??e.address,i??`default-home`,c,u,f?m:null,g],queryFn:()=>T({data:{...e,...i?{originAddress:i}:{},outboundISO:new Date(S).toISOString(),outboundMode:u,...f&&C!==null?{returnISO:new Date(C).toISOString(),returnMode:g}:{}}}),enabled:v&&w===null,staleTime:6e4,retry:!1}),j=k(he),M=E?.destination.sublabel||E?.destination.label,N=S===null?``:new Date(S).toDateString(),P=K({queryKey:[`insights`,M,E?.transitName,N],queryFn:()=>j({data:{destination:M,transitName:E.transitName,dateLabel:N}}),enabled:!!(M&&E?.transitName&&N),staleTime:9e5,retry:!1}),F=k(ge),I=E?.parkingWindow?`${X(E.parkingWindow.start)}–${X(E.parkingWindow.end)}`:``,L=K({queryKey:[`spothero`,E?.destination.latitude,E?.destination.longitude,I],queryFn:()=>F({data:{latitude:E.destination.latitude,longitude:E.destination.longitude,startISO:E.parkingWindow.start,endISO:E.parkingWindow.end}}),enabled:!!(E?.parkingWindow&&E?.destination),staleTime:6e5,retry:!1}),R=e=>e?`rounded-full bg-accent-hot px-5 py-2.5 text-sm font-semibold text-frost shadow-lg`:`rounded-full border border-ink/15 bg-frost/60 px-5 py-2.5 text-sm font-semibold text-ink/80 transition-colors hover:bg-frost`,z=e=>e?`rounded-full bg-ink px-3.5 py-1.5 font-mono text-xs text-frost`:`rounded-full border border-ink/15 px-3.5 py-1.5 font-mono text-xs text-ink/60`,B=E?.outbound,V=E?.ret??null,H=E?.totals,U=(()=>{if(!H||H.transitMinutes==null)return null;let e=H.driveMinutes-H.transitMinutes;return e===0?`两种方式耗时相同`:e<0?`开车快 ${-e} 分钟`:`火车快 ${e} 分钟`})(),W=(()=>{if(!H||H.transitCost==null)return null;let e=H.driveCost-H.transitCost;return Math.abs(e)<.5?`两种方式花费差不多`:e>0?`火车便宜 $${e.toFixed(0)}`:`开车便宜 $${(-e).toFixed(0)}`})();return(0,G.jsxs)(`div`,{className:`page-wash relative min-h-screen overflow-hidden font-grotesk text-ink`,children:[(0,G.jsx)(`div`,{className:`beam pointer-events-none absolute -left-24 top-[-10%] h-[150%] w-[320px] opacity-70`}),(0,G.jsx)(`div`,{className:`beam pointer-events-none absolute right-[-6%] top-[-15%] h-[160%] w-[260px] opacity-50`}),(0,G.jsx)(`div`,{className:`pointer-events-none absolute right-10 top-24 h-72 w-72 rounded-full`,style:{background:`radial-gradient(circle, color-mix(in oklab, var(--accent-hot) 28%, transparent), transparent 70%)`}}),(0,G.jsx)(`div`,{className:`pointer-events-none absolute bottom-[-10%] left-1/3 h-80 w-80 rounded-full`,style:{background:`radial-gradient(circle, color-mix(in oklab, var(--brand) 22%, transparent), transparent 70%)`}}),(0,G.jsxs)(`div`,{className:`relative mx-auto max-w-6xl px-6 py-10`,children:[(0,G.jsxs)(`header`,{className:`flex items-center justify-between`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-11 place-items-center rounded-xl bg-ink font-mono text-lg font-bold text-frost`,children:`北`}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-lg font-bold leading-none tracking-tight`,children:`今天怎么走`}),(0,G.jsx)(`p`,{className:`mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-ink/50`,children:`开车 vs Caltrain 对比`})]})]}),(0,G.jsxs)(`div`,{className:`hidden items-center gap-2 rounded-full border border-frost/70 bg-frost/40 px-4 py-2 backdrop-blur sm:flex`,children:[(0,G.jsx)(`span`,{className:`size-2 roun
1ded-full bg-accent-hot`}),(0,G.jsxs)(`span`,{className:`font-mono text-xs text-ink/70`,children:[`山景城 · `,b??`--:--`]})]})]}),(0,G.jsxs)(`div`,{className:`mt-10 grid gap-6 lg:grid-cols-12`,children:[(0,G.jsxs)(`section`,{className:`panel rounded-3xl p-7 lg:col-span-7`,children:[(0,G.jsx)(`p`,{className:`font-mono text-[11px] uppercase tracking-[0.25em] text-brand`,children:`今天要去哪儿?`}),(0,G.jsx)(`h1`,{className:`mt-3 text-4xl font-bold leading-[1.02] tracking-tight sm:text-5xl`,children:E?.destination.label??(e.address?e.address:`旧金山市区`)}),(0,G.jsxs)(`p`,{className:`mt-2 text-ink/60`,children:[`出发地:`,E?.origin??Se,` ·`,` `,D?`正在获取实时路况…`:E?.destination.sublabel??`—`]}),(0,G.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2`,children:[(0,G.jsx)(`button`,{className:R(e.preset===`sf`),onClick:()=>t({preset:`sf`}),children:`旧金山市区`}),(0,G.jsx)(`button`,{className:R(e.preset===`berkeley`),onClick:()=>t({preset:`berkeley`}),children:`伯克利`})]}),(0,G.jsxs)(`form`,{className:`mt-4 flex gap-2`,onSubmit:e=>{e.preventDefault();let r=n.trim();r.length>=3&&t({address:r})},children:[(0,G.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:`或者直接输入具体地址、地点名称`,className:`min-w-0 flex-1 rounded-full border border-ink/15 bg-frost/70 px-5 py-2.5 text-sm text-ink outline-none placeholder:text-ink/40 focu
1s:border-brand`}),(0,G.jsx)(`button`,{type:`submit`,className:`rounded-full bg-ink px-5 py-2.5 text-sm font-semibold text-frost`,children:`用这个`})]}),(0,G.jsxs)(`div`,{className:`mt-5 rounded-2xl bg-frost/60 p-5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(`p`,{className:`font-mono text-[11px] uppercase tracking-[0.2em] text-ink/45`,children:`出发地`}),i&&(0,G.jsx)(`button`,{onClick:()=>{a(void 0),s(``)},className:`font-mono text-[11px] tracking-[0.15em] text-brand`,children:`回到我家`})]}),(0,G.jsxs)(`p`,{className:`mt-2 text-sm text-ink/70`,children:[i??Se,!i&&(0,G.jsx)(`span`,{className:`ml-2 font-mono text-[11px] tracking-[0.15em] text-ink/40`,children:`默认`})]}),(0,G.jsxs)(`form`,{className:`mt-3 flex gap-2`,onSubmit:e=>{e.preventDefault();let t=o.trim();t.length>=3&&a(t)},children:[(0,G.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:`换个出发地 — 输入地址`,className:`min-w-0 flex-1 rounded-full border border-ink/15 bg-frost px-5 py-2.5 text-sm text-ink outline-none placeholder:text-ink/40 focu
1s:border-brand`}),(0,G.jsx)(`button`,{type:`submit`,className:`rounded-full border border-ink/20 px-5 py-2.5 text-sm font-semibold text-ink`,children:`设为起点`})]})]}),(0,G.jsxs)(`div`,{className:`mt-6 grid gap-4 rounded-2xl bg-frost/60 p-5 sm:grid-cols-2`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`font-mono text-[11px] uppercase tracking-[0.2em] text-ink/45`,children:`去程`}),(0,G.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,G.jsx)(`button`,{className:z(u===`arrive`),onClick:()=>d(`arrive`),children:`几点到达`}),(0,G.jsx)(`button`,{className:z(u===`depart`),onClick:()=>d(`depart`),children:`几点出发`})]}),(0,G.jsx)(`input`,{type:`datetime-local`,value:c,onChange:e=>l(e.target.value),className:`mt-3 w-full rounded-xl border border-ink/15 bg-frost px-4 py-2.5 font-mono text-sm text-ink outline-none focus:border-brand`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(`p`,{className:`font-mono text-[11px] uppercase tracking-[0.2em] text-ink/45`,children:`回程`}),(0,G.jsx)(`button`,{onClick:()=>p(e=>!e),className:`font-mono text-[11px] tracking-[0.15em] text-brand`,children:f?`只看单程`:`加上回程`})]}),f?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,G.jsx)(`button`,{className:z(g===`depart`),onClick:()=>_(`depart`),children:`几点返程`}),(0,G.jsx)(`button`,{className:z(g===`arrive`),onClick:()=>_(`arrive`),children:`几点到家`})]}),(0,G.jsx)(`input`,{type:`datetime-local`,value:m,onChange:e=>h(e.target.value),className:`mt-3 w-full rounded-xl border border-ink/15 bg-frost px-4 py-2.5 font-mono text-sm text-ink outline-none focus:border-brand`})]}):(0,G.jsx)(`p`,{className:`mt-3 font-mono text-xs text-ink/50`,children:`当前只对比去程。`})]})]}),(0,G.jsxs)(`div`,{className:`mt-8 rounded-2xl bg-ink p-6 text-frost`,children:[(0,G.jsx)(`p`,{className:`font-mono text-[11px] uppercase tracking-[0.25em] text-frost/50`,children:`对比结果`}),w?(0,G.jsx)(`p`,{className:`mt-3 text-sm text-frost/80`,children:w}):A?(0,G.jsx)(`p`,{className:`mt-3 text-sm text-frost/80`,children:A instanceof Error?A.message:`暂时拿不到实时数据。`}):D||!E?(0,G.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,G.jsx)(`div`,{className:`h-12 w-48 animate-pulse rounded-lg bg-frost/10`}),(0,G.jsx)(`div`,{className:`h-4 w-full animate-pulse rounded bg-frost/10`})]}):(0,G.jsxs)(`div`,{className:`mt-4 animate-fade-in space-y-4`,children:[(0,G.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`font-mono text-[11px] tracking-[0.2em] text-frost/50`,children:`全程开车`}),(0,G.jsx)(`p`,{className:`mt-1 text-3xl font-bold leading-none`,children:J(H?.driveMinutes??null)}),(0,G.jsxs)(`p`,{className:`mt-1 font-mono text-xs text-frost/60`,children:[`$`,q(H?.driveCost,0),`(含目的地停车)`]})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`p`,{className:`font-mono text-[11px] tracking-[0.2em] text-frost/50`,children:[`开车+`,E.transitName]}),(0,G.jsx)(`p`,{className:`mt-1 text-3xl font-bold leading-none`,children:H?.transitMinutes==null?`无班次`:J(H.transitMinutes)}),(0,G.jsx)(`p`,{className:`mt-1 font-mono text-xs text-frost/60`,children:H?.transitCost==null?`这个时间段没有可用班次`:`约 $${q(H.transitCost,2)}(估算:车票、油钱、车站停车)`})]})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[U&&(0,G.jsx)(`span`,{className:`rounded-full bg-accent-hot px-3 py-1 font-mono text-xs font-bold`,children:U}),W&&(0,G.jsx)(`span`,{className:`rounded-full border border-frost/30 px-3 py-1 font-mono text-xs`,children:W}),(0,G.jsxs)(`span`,{className:`rounded-full border border-frost/30 px-3 py-1 font-mono text-xs`,children:[`开车找车位还要约 `,E.parkingHunt,` 分钟`]})]})]})]})]}),(0,G.jsxs)(`section`,{className:`panel rounded-3xl p-6 lg:col-span-5`,children:[(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,G.jsx)(Z,{label:V?`开车(往返)`:`开车`,value:H?J(H.driveMinutes):`—`,note:H?`$${q(H.driveCost,0)} 含停车`:`加载中`}),(0,G.jsx)(Z,{label:V?`换乘火车(往返)`:`换乘火车`,value:H?.transitMinutes==null?`—`:J(H.transitMinutes),note:H?.transitCost==null?E?`无班次`:`加载中`:`约 $${q(H.transitCost,2)} · ${E?.transitName??`公共交通`}`}),(0,G.jsx)(Z,{label:`目的地当前天气`,value:E?`${E.weather.tempC}°C`:`—`,note:E?`${E.weather.text},风速 ${E.weather.windKph} km/h`:`加载中`}),(0,G.jsx)(Z,{label:`找车位难度`,value:E?E.parkingHunt>=12?`高`:E.parkingHunt>
1=8?`中`:`低`:`—`,note:E?`约 ${E.parkingHunt} 分钟`:`加载中`})]}),E&&(0,G.jsxs)(`div`,{className:`mt-4 space-y-2 rounded-2xl bg-frost/60 p-4 font-mono text-xs text-ink/60`,children:[(0,G.jsxs)(`p`,{children:[`去程:`,B?`${B.spec.type===`arrive`?`要求`+Y(B.spec.iso)+`前到`:Y(B.spec.iso)+`出发`}`:`—`]}),(0,G.jsxs)(`p`,{children:[`回程:`,V?`${V.spec.type===`arrive`?`要求`+Y(V.spec.iso)+`前到家`:Y(V.spec.iso)+`从目的地出发`}`:`只看单程`]})]})]})]}),(0,G.jsxs)(`section`,{className:`mt-6 grid gap-3 lg:grid-cols-2`,children:[(0,G.jsxs)(`div`,{className:`panel rounded-3xl p-6`,children:[(0,G.jsx)(`p`,{className:`font-mono text-[11px] uppercase tracking-[0.25em] text-brand`,children:`方案 A · 开车到山景城站换乘`}),B?.transit&&(0,G.jsxs)(`p`,{className:`mt-3 text-lg font-bold tracking-tight`,children:[X(B.transit.departISO),` 从家出发`,(0,G.jsxs)(`span`,{className:`ml-2 font-mono text-xs font-normal text-ink/50`,children:[X(B.transit.boardISO),` 上车 · `,X(B.transit.arriveISO),` 到达`]})]}),(0,G.jsxs)(`ol`,{className:`mt-4 space-y-3`,children:[(0,G.jsx)(Q,{n:`1`,title:`开车到山景城 Caltrain 车站`,detail:B?.transit?`${X(B.transit.departISO)} 出发 · ${B.transit.stationDriveMin} 分钟 · ${B.transit.stationDriveMiles} 英里 · ${X(B.transit.stationISO)} 到站`:E?`这个时间段没有班次`:`查询中…`}),(0,G.jsx)(Q,{n:`2`,title:`在车站停车`,detail:E?`每日停车 $${q(E.stationParking,2)} · 停车加走到站台约 8 分钟${B?.transit?.waitMin?`,站台再等约 ${B.transit.waitMin} 分钟`:``}`:`查询中…`}),(0,G.jsx)(Q,{n:`3`,title:B?.transit?xe(B.transit.services,E?.transitName??`公共交通`):E?`乘坐 ${E.transitName}`:`乘坐火车`,lines:B?.transit?.services.map(be),detail:B?.transit?B.transit.scheduled?`公共交通段共 ${B.transit.transitSpanMinutes} 分钟(含换乘/等候)${B.transit.walkFromMin>0?` · 下车再走约 ${B.transit.walkFromMin} 分钟`:``} · 车票估算约 $${q(B.transit.fare,2)}${B.transit.candidates>1?` · 已从 ${B.transit.candidates} 个班次组合中选出${B.spec.type===`arrive`?`最晚出发`:`最早到达`}的一组`:``}`:`预估 ${X(B.transit.boardISO)} 发车 · 公共交通段约 ${B.transit.transitSpanMinutes} 分钟 · 车票估算约 $${q(B.transit.fare,2)}(未拿到时刻表)`:E?`这个时间段没有能按时到达的班次`:`查询中…`}),V?.transit&&(0,G.jsx)(Q,{n:`4`,title:`回程 · ${xe(V.transit.services,E?.transitName??`公共交通`)}`,lines:[`${X(V.transit.departISO)} 从${E?.destination.label??`目的地`}出发${V.transit.walkToMin>0?`(步行约 ${V.transit.walkToMin} 分钟到站)`:``}${V.transit.waitMin>0?`,等车约 ${V.transit.waitMin} 分钟`:``}`,...V.transit.services.map(be),`${X(V.transit.stationISO)} 到山景城站 · 取车再开 ${V.transit.stationDriveMin} 分钟 · ${X(V.transit.arriveISO)} 到家`],detail:V.transit.scheduled?`公共交通段共 ${V.transit.transitSpanMinutes} 分钟(含换乘/等候)· 车票估算约 $${q(V.transit.fare,2)}`:`预估 · 公共交通段约 ${V.transit.transitSpanMinutes} 分钟 · 车票估算约 $${q(V.transit.fare,2)}(未拿到时刻表)`}),V&&!V.transit&&B?.transit&&(0,G.jsx)(Q,{n:`4`,title:`回程`,detail:`回程这个时间点前后两小时内没有列车(多半太晚或太早),所以往返合计按无班次处理。`})]})]}),(0,G.jsxs)(`div`,{className:`panel rounded-3xl p-6`,children:[(0,G.jsx)(`p`,{className:`font-mono text-[11px] uppercase tracking-[0.25em] text-accent-hot`,children:`方案 B · 全程开车`}),B?.drive&&(0,G.jsxs)(`p`,{className:`mt-3 text-lg font-bold tracking-tight`,children:[X(B.drive.departISO),` 从家出发`,(0,G.jsxs)(`span`,{className:`ml-2 font-mono text-xs font-normal text-ink/50`,children:[X(B.drive.arriveISO),` 到达`,V?.drive?` · ${X(V.drive.departISO)} 返程`:``]})]}),(0,G.jsxs)(`ol`,{className:`mt-4 space-y-3`,children:[(0,G.jsx)(Q,{n:`1`,title:`开车到${E?.destination.label??`目的地`}`,detail:B?.drive?`${X(B.drive.departISO)} 出发 · ${B.drive.minutes} 分钟 · ${B.drive.miles} 英里(含路况)`:`查询中…`}
1),(0,G.jsx)(Q,{n:`2`,title:`在目的地停车`,detail:E?`全天约 $${E.parkingCost} · 找车位约 ${E.parkingHunt} 分钟`:`查询中…`}),(0,G.jsx)(Q,{n:`3`,title:V?`稍后开车回家`:`提前订好车位`,detail:V?.drive?`${X(V.drive.departISO)} 出发 · ${V.drive.minutes} 分钟 · ${V.drive.miles} 英里 · ${X(V.drive.arriveISO)} 到家`:`在 SpotHero 上先订车位,省得到处绕`})]}),(0,G.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-ink/10 bg-frost/50 p-4`,children:[(0,G.jsxs)(`p`,{className:`font-mono text-xs text-ink/50`,children:[`SpotHero 实时车位(按最低价排序)`,I?` · ${I} · 目的地:${E?.destination.sublabel||E?.destination.label}`:``]}),L.isPending&&I?(0,G.jsx)(`p`,{className:`mt-2 text-sm text-ink/60`,children:`正在 SpotHero 上搜索…`}):(L.data?.lots.length??0)>0?(0,G.jsx)(`ul`,{className:`mt-2 space-y-1.5 text-sm`,children:L.data.lots.map(e=>(0,G.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[(0,G.jsxs)(`span`,{className:`font-mono text-sm font-semibold text-accent-hot`,children:[`$`,e.price.toFixed(2)]}),(0,G.jsx)(`span`,{className:`font-semibold text-ink`,children:e.url?(0,G.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`underline decoration-ink/30 hover:decoration-ink`,children:e.name}):e.name}),(0,G.jsxs)(`span`,{className:`font-mono text-xs text-ink/45`,children:[`步行约 `,e.walkMinutes,` 分钟`,e.address?` · ${e.address}`:``]})]},e.name))}):(0,G.jsx)(`p`,{className:`mt-2 text-sm text-ink/60`,children:`暂时没抓到 SpotHero 的具体车位,可以点下面按钮直接看已填好时间的搜索结果。`})]}),(0,G.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3`,children:[(0,G.jsx)(`a`,{href:E?.spotHeroUrl??`https://spothero.com/`,target:`_blank`,rel:`noopener noreferrer`,className:`rounded-full bg-ink px-5 py-2.5 text-sm font-semibold text-frost transition-transform hover:-translate-y-0.5`,children:`在 SpotHero 打开这个时段 →`}),(0,G.jsxs)(`p`,{className:`font-mono text-xs text-ink/50`,children:[`门到门 · `,H&&E?J(H.driveMinutes+E.parkingHunt):`—`,` · 合计 $`,H?q(H.driveCost,0):`—`,H&&L.data?.lots[0]?`(若订最便宜的 $${L.data.lots[0].price.toFixed(2)} 车位,约 $${q(H.driveCost-(E?.parkingCost??0)+L.data.lots[0].price,0)})`:``]})]})]})]}),(0,G.jsxs)(`section`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[(0,G.jsx)($,{label:`目的地当前天气`,value:E?`${E.weather.text},${E.weather.tempC}°C`:`查询中…`}),(0,G.jsx)($,{label:`离开时目的地天气`,value:E?.weatherLeave?`${X(E.weatherLeave.iso)} · ${E.weatherLeave.text},${E.weatherLeave.tempC}°C,降雨 ${E.weatherLeave.rainChance}%`:E?`单程行程,无返程时间`:`查询中…`}),(0,G.jsx)($,{label:`当前降雨概率`,value:E?`${E.weather.rainChance}%`:`查询中…`})]}),(0,G.jsxs)(`section`,{className:`mt-3 grid gap-3 lg:grid-cols-2`,children:[(0,G.jsx)(we,{tag:`今日班次与路况提醒`,loading:P.isPending,failed:!!P.error,body:P.data?.alerts.answer,sources:P.data?.alerts.sources}),(0,G.jsx)(we,{tag:`今日真实停车价格`,loading:P.isPending,failed:!!P.error,body:P.data?.parking.answer,sources:P.data?.parking.sources})]})]})]})}function we({tag:e,loading:t,failed:n,body:r,sources:i}){return(0,G.jsxs)(`div`,{className:`panel rounded-3xl p-6`,children:[(0,G.jsx)(`p`,{className:`font-mono text-[11px] uppercase tracking-[0.25em] text-brand`,children:e}),(0,G.jsx)(`p`,{className:`mt-3 text-sm leading-relaxed text-ink/80`,children:t?`正在联网查询…`:n||!r?`暂时查不到这项信息。`:r}),i&&i.length>0&&(0,G.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:i.map(e=>(0,G.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`rounded-full border border-ink/15 px-3 py-1 font-mono text-[11px] text-ink/60 transition-colors hover:bg-frost`,children:e.name.slice(0,40)},e.url))})]})}function Z({label:e,value:t,unit:n,note:r}){return(0,G.jsxs)(`div`,{className:`rounded-2xl bg-frost/70 p-4`,children:[(0,G.jsx)(`p`,{className:`font-mono text-[10px] tracking-[0.2em] text-ink/45`,children:e}),(0,G.jsxs)(`p`,{className:`mt-1 text-3xl font-bold`,children:[t,n?(0,G.jsx)(`span`,{className:`text-lg`,children:n}):null]}),(0,G.jsx)(`p`,{className:`font-mono text-xs text-ink/50`,children:r})]})}
1function Q({n:e,title:t,detail:n,lines:r}){return(0,G.jsxs)(`li`,{className:`flex gap-3`,children:[(0,G.jsx)(`span`,{className:`mt-0.5 grid size-6 shrink-0 place-items-center rounded-full bg-ink font-mono text-[11px] font-bold text-frost`,children:e}),(0,G.jsxs)(`span`,{className:`min-w-0`,children:[(0,G.jsx)(`span`,{className:`block text-sm font-semibold leading-tight`,children:t}),r&&r.length>0&&(0,G.jsx)(`span`,{className:`mt-1 block space-y-0.5`,children:r.map((e,t)=>(0,G.jsx)(`span`,{className:`block font-mono text-xs text-ink/75`,children:e},`${t}-${e}`))}),(0,G.jsx)(`span`,{className:`font-mono text-xs text-ink/55`,children:n})]})]})}function $({label:e,value:t}){return(0,G.jsxs)(`div`,{className:`panel rounded-2xl p-4`,children:[(0,G.jsx)(`p`,{className:`font-mono text-[10px] tracking-[0.2em] text-ink/45`,children:e}),(0,G.jsx)(`p`,{className:`mt-1 font-semibold`,children:t})]})}export{Ce as component};

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.