corequery 0.31.3 → 0.32.0

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.
Files changed (132) hide show
  1. package/package.json +1 -1
  2. package/server/dist/server/api/args-error.d.ts +3 -0
  3. package/server/dist/server/api/args-error.js +7 -0
  4. package/server/dist/server/api/args-error.js.map +1 -0
  5. package/server/dist/server/api/create-api-router.js +8 -6
  6. package/server/dist/server/api/create-api-router.js.map +1 -1
  7. package/server/dist/server/api/handlers/departures/v0/index.d.ts +5 -1
  8. package/server/dist/server/api/handlers/departures/v0/index.js +82 -39
  9. package/server/dist/server/api/handlers/departures/v0/index.js.map +1 -1
  10. package/server/dist/server/api/handlers/departures/v0/to-api-result.d.ts +4 -0
  11. package/server/dist/server/api/handlers/departures/v0/to-api-result.js +24 -0
  12. package/server/dist/server/api/handlers/departures/v0/to-api-result.js.map +1 -0
  13. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-stop-foda.js +24 -0
  14. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-stop-foda.js.map +1 -1
  15. package/server/dist/server/config/config.d.ts +7 -1
  16. package/server/dist/server/config/helpers/corequery-filters.d.ts +14 -0
  17. package/server/dist/server/config/helpers/corequery-filters.js +34 -0
  18. package/server/dist/server/config/helpers/corequery-filters.js.map +1 -0
  19. package/server/dist/server/config/helpers/create-canonical-lines-serving-stop-algorithm.d.ts +1 -1
  20. package/server/dist/server/config/helpers/index.d.ts +1 -0
  21. package/server/dist/server/config/helpers/index.js +1 -0
  22. package/server/dist/server/config/helpers/index.js.map +1 -1
  23. package/server/dist/server/config/linting/types.d.ts +3 -0
  24. package/server/dist/server/config/types/custom-filter-function-type.d.ts +8 -0
  25. package/server/dist/server/config/types/custom-filter-function-type.js +2 -0
  26. package/server/dist/server/config/types/custom-filter-function-type.js.map +1 -0
  27. package/server/dist/server/config/types/get-canonical-lines-serving-stop-config.js +2 -0
  28. package/server/dist/server/config/types/get-canonical-lines-serving-stop-config.js.map +1 -0
  29. package/server/dist/server/config/types/get-default-departure-feeds-for-stop-config.d.ts +7 -0
  30. package/server/dist/server/config/types/get-default-departure-feeds-for-stop-config.js +2 -0
  31. package/server/dist/server/config/types/get-default-departure-feeds-for-stop-config.js.map +1 -0
  32. package/server/dist/server/config/types/get-filters-for-stop-config.d.ts +15 -0
  33. package/server/dist/server/config/types/get-filters-for-stop-config.js +2 -0
  34. package/server/dist/server/config/types/get-filters-for-stop-config.js.map +1 -0
  35. package/server/dist/server/config/types/index.d.ts +4 -1
  36. package/server/dist/server/config/types/index.js +4 -1
  37. package/server/dist/server/config/types/index.js.map +1 -1
  38. package/server/dist/server/corequery.d.ts +2 -0
  39. package/server/dist/server/corequery.js +4 -1
  40. package/server/dist/server/corequery.js.map +1 -1
  41. package/server/dist/server/data/departure-filters/departure-filter-type.d.ts +9 -0
  42. package/server/dist/server/data/departure-filters/departure-filter-type.js +9 -0
  43. package/server/dist/server/data/departure-filters/departure-filter-type.js.map +1 -0
  44. package/server/dist/server/data/departure-filters/departure-filters.d.ts +31 -0
  45. package/server/dist/server/data/departure-filters/departure-filters.js +94 -0
  46. package/server/dist/server/data/departure-filters/departure-filters.js.map +1 -0
  47. package/server/dist/server/data/departure-filters/index.d.ts +2 -0
  48. package/server/dist/server/data/departure-filters/index.js +3 -0
  49. package/server/dist/server/data/departure-filters/index.js.map +1 -0
  50. package/server/dist/server/data/departure-filters/types/arrival.d.ts +6 -0
  51. package/server/dist/server/data/departure-filters/types/arrival.js +12 -0
  52. package/server/dist/server/data/departure-filters/types/arrival.js.map +1 -0
  53. package/server/dist/server/data/departure-filters/types/custom.d.ts +9 -0
  54. package/server/dist/server/data/departure-filters/types/custom.js +19 -0
  55. package/server/dist/server/data/departure-filters/types/custom.js.map +1 -0
  56. package/server/dist/server/data/departure-filters/types/line-tag.d.ts +6 -0
  57. package/server/dist/server/data/departure-filters/types/line-tag.js +17 -0
  58. package/server/dist/server/data/departure-filters/types/line-tag.js.map +1 -0
  59. package/server/dist/server/data/departure-filters/types/line.d.ts +6 -0
  60. package/server/dist/server/data/departure-filters/types/line.js +14 -0
  61. package/server/dist/server/data/departure-filters/types/line.js.map +1 -0
  62. package/server/dist/server/data/departure-filters/types/position.d.ts +6 -0
  63. package/server/dist/server/data/departure-filters/types/position.js +14 -0
  64. package/server/dist/server/data/departure-filters/types/position.js.map +1 -0
  65. package/server/dist/server/data/departure-filters/types/service-tag.d.ts +6 -0
  66. package/server/dist/server/data/departure-filters/types/service-tag.js +14 -0
  67. package/server/dist/server/data/departure-filters/types/service-tag.js.map +1 -0
  68. package/server/dist/server/data/departure-filters/types/set-down-only.d.ts +6 -0
  69. package/server/dist/server/data/departure-filters/types/set-down-only.js +12 -0
  70. package/server/dist/server/data/departure-filters/types/set-down-only.js.map +1 -0
  71. package/server/dist/server/data/index.d.ts +1 -0
  72. package/server/dist/server/data/index.js +1 -0
  73. package/server/dist/server/data/index.js.map +1 -1
  74. package/server/dist/server/data/stop-collection.d.ts +2 -2
  75. package/server/dist/server/data/stop-collection.js +2 -2
  76. package/server/dist/server/data/stop-collection.js.map +1 -1
  77. package/server/dist/server/data/stop-default-departure-feed.d.ts +15 -0
  78. package/server/dist/server/data/stop-default-departure-feed.js +21 -0
  79. package/server/dist/server/data/stop-default-departure-feed.js.map +1 -0
  80. package/server/dist/server/data/stop-departure-filters.d.ts +39 -0
  81. package/server/dist/server/data/stop-departure-filters.js +63 -0
  82. package/server/dist/server/data/stop-departure-filters.js.map +1 -0
  83. package/server/dist/server/data/stop-position.d.ts +13 -0
  84. package/server/dist/server/data/stop-position.js +18 -0
  85. package/server/dist/server/data/stop-position.js.map +1 -0
  86. package/server/dist/server/data/stop.d.ts +11 -2
  87. package/server/dist/server/data/stop.js +17 -1
  88. package/server/dist/server/data/stop.js.map +1 -1
  89. package/server/dist/shared/apis/departures/v0/departure.d.ts +19 -0
  90. package/server/dist/shared/apis/departures/v0/departure.js +48 -0
  91. package/server/dist/shared/apis/departures/v0/departure.js.map +1 -0
  92. package/server/dist/shared/apis/departures/v0/feed.d.ts +10 -0
  93. package/server/dist/shared/apis/departures/v0/feed.js +15 -0
  94. package/server/dist/shared/apis/departures/v0/feed.js.map +1 -0
  95. package/server/dist/shared/apis/departures/v0/index.d.ts +33 -18
  96. package/server/dist/shared/apis/departures/v0/index.js +12 -68
  97. package/server/dist/shared/apis/departures/v0/index.js.map +1 -1
  98. package/server/dist/shared/apis/foundational-data/v1/foundational-data.d.ts +42 -0
  99. package/server/dist/shared/apis/foundational-data/v1/foundational-data.js +42 -28
  100. package/server/dist/shared/apis/foundational-data/v1/foundational-data.js.map +1 -1
  101. package/server/dist/shared/apis/foundational-data/v1/index.d.ts +21 -0
  102. package/server/dist/shared/data/departure-filter-expression.d.ts +16 -0
  103. package/server/dist/shared/data/departure-filter-expression.js +82 -0
  104. package/server/dist/shared/data/departure-filter-expression.js.map +1 -0
  105. package/web/dist/assets/{About-DGmg1TM-.js → About-BdSlO-kD.js} +1 -1
  106. package/web/dist/assets/{AdminControls-T05hoDB-.js → AdminControls-DJo59RGN.js} +1 -1
  107. package/web/dist/assets/{Alert-DfpdtaOB.js → Alert-SQhECZag.js} +1 -1
  108. package/web/dist/assets/{Debug-Q4Vy4lZ_.js → Debug-5P9iSK2l.js} +1 -1
  109. package/web/dist/assets/{Home-C6T20k8G.js → Home-hrGQ5RvQ.js} +1 -1
  110. package/web/dist/assets/{Line-6nd7KD0E.js → Line-ClqpaOxi.js} +1 -1
  111. package/web/dist/assets/NotFound-D-nyY3X1.js +1 -0
  112. package/web/dist/assets/{NotFoundPage-UhXr10a9.js → NotFoundPage-qJ2To3wC.js} +1 -1
  113. package/web/dist/assets/{Picker-D-TjVZAI.js → Picker-di2TPJNV.js} +1 -1
  114. package/web/dist/assets/{Service-CkHxNopv.js → Service-CjcKHFQZ.js} +1 -1
  115. package/web/dist/assets/{Settings-Ccrmh7u8.js → Settings-Clz1x2Cr.js} +1 -1
  116. package/web/dist/assets/{SimpleMobileHeaderContent-Ja68XAJd.js → SimpleMobileHeaderContent-DJTkr_6C.js} +1 -1
  117. package/web/dist/assets/{Status-CO5w5a1E.js → Status-Bw3AMuJH.js} +1 -1
  118. package/web/dist/assets/Stop-hkgAICn9.js +1 -0
  119. package/web/dist/assets/{ZenMode-C3S7FmYt.js → ZenMode-CXXD5IBd.js} +1 -1
  120. package/web/dist/assets/index-DOvczcZF.js +2 -0
  121. package/web/dist/assets/{linear-CtNhjlrM.js → linear-BiU4teCm.js} +1 -1
  122. package/web/dist/assets/{use-api-BJomuYg6.js → use-api-Ft007Dfs.js} +1 -1
  123. package/web/dist/assets/{use-foda-synced-query-BM-OPAql.js → use-foda-synced-query-hrC70vJ_.js} +1 -1
  124. package/web/dist/assets/{use-simple-headers-Cbv0t_De.js → use-simple-headers-DM6VutL0.js} +1 -1
  125. package/web/dist/index.html +2 -2
  126. package/web/dist/sw.js +1 -1
  127. package/server/dist/server/config/types/get-canonical-lines-serving-stop-config-func.js +0 -2
  128. package/server/dist/server/config/types/get-canonical-lines-serving-stop-config-func.js.map +0 -1
  129. package/web/dist/assets/NotFound-BozS7u6u.js +0 -1
  130. package/web/dist/assets/Stop-BWZOcpvU.js +0 -1
  131. package/web/dist/assets/index-CrhwkQ9k.js +0 -2
  132. /package/server/dist/server/config/types/{get-canonical-lines-serving-stop-config-func.d.ts → get-canonical-lines-serving-stop-config.d.ts} +0 -0
@@ -1 +1 @@
1
- import{_ as e,c as t,g as n,h as r,l as i,r as a,s as o,v as s,y as c}from"./use-nav-exemptions-QtGbfEPT.js";import"./use-api-BJomuYg6.js";import{t as l}from"./scope-B-e4l8Dr.js";import{d as u}from"./index-CrhwkQ9k.js";import{t as d}from"./ErrorMessage-CCAB4vXB.js";function f(e){if(!/^-?[0-9]+$/g.test(e))throw m(e);return parseInt(e,10)}function p(e){return/^-?[0-9]+$/g.test(e)?parseInt(e,10):null}var m=e=>Error(`"${e}" is not an integer.`),h=class{_canvasContainer;_canvas;ctx;_resizeListener;_resizeObserver;_data;_width;_height;_dpiRatio;_dirty;_running;constructor(e,t){this._canvasContainer=e,this._canvas=t;let n=this._canvas.getContext(`2d`);if(n==null)throw Error(`Failed to get 2D rendering context.`);this.ctx=n,this._resizeListener=this._onResize.bind(this),this._resizeObserver=new ResizeObserver(this._resizeListener),this._data=null,this._width=1,this._height=1,this._dpiRatio=1,this._dirty=!0,this._running=!1}get data(){if(this._data==null)throw Error(`Data not set.`);return this._data}get width(){return this._width}get height(){return this._height}setData(e){this._data=e,this.onDataUpdated(),this._dirty=!0,this._running||this._start()}_start(){this._fitCanvas(),this._running=!0,this._render(),window.addEventListener(`resize`,this._resizeListener),this._resizeObserver.observe(this._canvasContainer),this.onStart()}destroy(){this._running=!1,window.removeEventListener(`resize`,this._resizeListener),this._resizeObserver.unobserve(this._canvasContainer),this.onDestroy()}_render(){this._running&&(requestAnimationFrame(()=>{this._render()}),this._dirty&&(this._dirty=!1,this.ctx.save(),this.ctx.clearRect(0,0,this._width*this._dpiRatio,this._height*this._dpiRatio),this.ctx.scale(this._dpiRatio,this._dpiRatio),this.onRender(),this.ctx.restore()))}onStart(){}onDestroy(){}onDataUpdated(){}_onResize(){this._fitCanvas()}_fitCanvas(){let e=this._canvasContainer.getBoundingClientRect();this._width=e.width,this._height=e.height;let t=window.devicePixelRatio??1,n=this.ctx.backingStorePixelRatio??1;this._dpiRatio=t/n,this._canvas.style.width=`${this._width}px`,this._canvas.style.height=`${this._height}px`,this._canvas.width=this._width*this._dpiRatio,this._canvas.height=this._height*this._dpiRatio,this._dirty=!0}markDirty(){this._dirty=!0}};function g(e){let{data:a,createController:o}=e,c=n(null),l=n(null),[u,d]=s(null),f=e.interceptTouches??!1?{touchAction:`none`}:void 0;return r(()=>{if(c.current==null||l.current==null)return;let e=o(c.current,l.current);return d(e),()=>{e?.destroy()}},[o]),r(()=>{u?.setData(a)},[u,a]),i(`div`,{ref:c,className:t(e.class,`relative overflow-hidden`),children:i(`canvas`,{className:`absolute top-0 left-0`,ref:l,style:f})})}function _(){let e=window.getComputedStyle(document.body);return{bg:e.getPropertyValue(`--color-bg`),fg:e.getPropertyValue(`--color-fg`),"fg-strong":e.getPropertyValue(`--color-fg-strong`),"fg-weak":e.getPropertyValue(`--color-fg-weak`)}}var v=6,y=6,b=1,x=class extends h{_css;_prefersDark;constructor(e,t){super(e,t),this._css=_(),this._prefersDark=window.matchMedia(`(prefers-color-scheme: dark)`).matches}onRender(){this.ctx.strokeStyle=`#000000`,this._onRenderStructure(),this.ctx.globalCompositeOperation=`source-in`,this.ctx.fillStyle=this._getDiagramColor(),this.ctx.fillRect(0,0,this.width,this.height)}_renderSection({stops:e,x:t,yLevels:n,terminatesAtTop:r,terminatesAtBottom:i,notchSide:a}){if(e.length<1)throw Error(`Expecting at least one stop.`);if(e.length!==n.length)throw Error(`Bad length.`);let o=l(n[0]),s=l(n[n.length-1]);this._drawLine(e=>{e.moveTo(t,o-b),e.lineTo(t,s+b)}),e.forEach((o,s)=>{let c=l(n[s]),u=s===0&&r||s===e.length-1&&i;(o.drawMark??!0)&&this._drawMark(t,c,u,a)})}_drawLine(e){this.ctx.lineWidth=y,this.ctx.beginPath(),e(this.ctx),this.ctx.stroke()}_drawMark(e,t,n,r){let i={left:-1,right:1}[r];this.ctx.lineWidth=v,this.ctx.beginPath(),this.ctx.moveTo(n?e-8*i:e,t),this.ctx.lineTo(e+8*i,t),this.ctx.stroke()}_extractYLevels(e,t){let n=this._extractChildElements(t);if(e.length!==n.length)throw Error(`Bad length.`);return e.map((e,t)=>{let r=l(n[t]);return e.getOverriddenMarkYPosition==null?this._getDefaultMarkYPosition(r):e.getOverriddenMarkYPosition(r)})}_extractChildElements(e){let t=this._canvasContainer.parentElement?.querySelector(`.${e}`);if(t==null)throw Error(`Couldn't find "${e}".`);return Array.from(t.childNodes.values()).filter(e=>e instanceof HTMLElement)}_getDefaultMarkYPosition(e){let t=this._canvasContainer.getBoundingClientRect(),n=e.getBoundingClientRect();return n.top-t.top+n.height/2}_getDiagramColor(){let e={dark:`darkThemeColorHexCode`,light:`lightThemeColorHexCode`,auto:this._prefersDark?`darkThemeColorHexCode`:`lightThemeColorHexCode`}[this.data.colorTheme];return this.data[e]??this._css.fg}},S=class extends x{_onRenderStructure(){let e=this.data.structure;this._renderSection({stops:e.stops,x:this.width/2,yLevels:this._extractYLevels(e.stops,w),terminatesAtTop:!0,terminatesAtBottom:!0,notchSide:`right`})}};function C(e){return i(d,{class:e.class,text:`An error occurred while rendering this diagram`})}var w=`_diagram-stops`;function T(n){let{settings:r}=u(),s=e(()=>({structure:n.structure,lightThemeColorHexCode:n.lightThemeColorHexCode,darkThemeColorHexCode:n.darkThemeColorHexCode,colorTheme:r.theme}),[n.darkThemeColorHexCode,n.lightThemeColorHexCode,n.structure,r.theme]),l=c((e,t)=>new S(e,t),[]);return s.structure.stops.length<2?i(C,{}):i(o,{class:t(n.class,`grid-cols-[auto_1fr] gap-4`),children:[i(g,{class:`w-4`,createController:l,data:s}),i(a,{class:t(`gap-6`,w),children:n.structure.stops.map(e=>i(o,{children:e.content}))})]})}export{p as a,g as i,C as n,f as o,x as r,T as t};
1
+ import{_ as e,c as t,g as n,h as r,l as i,r as a,s as o,v as s,y as c}from"./use-nav-exemptions-QtGbfEPT.js";import"./use-api-Ft007Dfs.js";import{t as l}from"./scope-B-e4l8Dr.js";import{d as u}from"./index-DOvczcZF.js";import{t as d}from"./ErrorMessage-CCAB4vXB.js";function f(e){if(!/^-?[0-9]+$/g.test(e))throw m(e);return parseInt(e,10)}function p(e){return/^-?[0-9]+$/g.test(e)?parseInt(e,10):null}var m=e=>Error(`"${e}" is not an integer.`),h=class{_canvasContainer;_canvas;ctx;_resizeListener;_resizeObserver;_data;_width;_height;_dpiRatio;_dirty;_running;constructor(e,t){this._canvasContainer=e,this._canvas=t;let n=this._canvas.getContext(`2d`);if(n==null)throw Error(`Failed to get 2D rendering context.`);this.ctx=n,this._resizeListener=this._onResize.bind(this),this._resizeObserver=new ResizeObserver(this._resizeListener),this._data=null,this._width=1,this._height=1,this._dpiRatio=1,this._dirty=!0,this._running=!1}get data(){if(this._data==null)throw Error(`Data not set.`);return this._data}get width(){return this._width}get height(){return this._height}setData(e){this._data=e,this.onDataUpdated(),this._dirty=!0,this._running||this._start()}_start(){this._fitCanvas(),this._running=!0,this._render(),window.addEventListener(`resize`,this._resizeListener),this._resizeObserver.observe(this._canvasContainer),this.onStart()}destroy(){this._running=!1,window.removeEventListener(`resize`,this._resizeListener),this._resizeObserver.unobserve(this._canvasContainer),this.onDestroy()}_render(){this._running&&(requestAnimationFrame(()=>{this._render()}),this._dirty&&(this._dirty=!1,this.ctx.save(),this.ctx.clearRect(0,0,this._width*this._dpiRatio,this._height*this._dpiRatio),this.ctx.scale(this._dpiRatio,this._dpiRatio),this.onRender(),this.ctx.restore()))}onStart(){}onDestroy(){}onDataUpdated(){}_onResize(){this._fitCanvas()}_fitCanvas(){let e=this._canvasContainer.getBoundingClientRect();this._width=e.width,this._height=e.height;let t=window.devicePixelRatio??1,n=this.ctx.backingStorePixelRatio??1;this._dpiRatio=t/n,this._canvas.style.width=`${this._width}px`,this._canvas.style.height=`${this._height}px`,this._canvas.width=this._width*this._dpiRatio,this._canvas.height=this._height*this._dpiRatio,this._dirty=!0}markDirty(){this._dirty=!0}};function g(e){let{data:a,createController:o}=e,c=n(null),l=n(null),[u,d]=s(null),f=e.interceptTouches??!1?{touchAction:`none`}:void 0;return r(()=>{if(c.current==null||l.current==null)return;let e=o(c.current,l.current);return d(e),()=>{e?.destroy()}},[o]),r(()=>{u?.setData(a)},[u,a]),i(`div`,{ref:c,className:t(e.class,`relative overflow-hidden`),children:i(`canvas`,{className:`absolute top-0 left-0`,ref:l,style:f})})}function _(){let e=window.getComputedStyle(document.body);return{bg:e.getPropertyValue(`--color-bg`),fg:e.getPropertyValue(`--color-fg`),"fg-strong":e.getPropertyValue(`--color-fg-strong`),"fg-weak":e.getPropertyValue(`--color-fg-weak`)}}var v=6,y=6,b=1,x=class extends h{_css;_prefersDark;constructor(e,t){super(e,t),this._css=_(),this._prefersDark=window.matchMedia(`(prefers-color-scheme: dark)`).matches}onRender(){this.ctx.strokeStyle=`#000000`,this._onRenderStructure(),this.ctx.globalCompositeOperation=`source-in`,this.ctx.fillStyle=this._getDiagramColor(),this.ctx.fillRect(0,0,this.width,this.height)}_renderSection({stops:e,x:t,yLevels:n,terminatesAtTop:r,terminatesAtBottom:i,notchSide:a}){if(e.length<1)throw Error(`Expecting at least one stop.`);if(e.length!==n.length)throw Error(`Bad length.`);let o=l(n[0]),s=l(n[n.length-1]);this._drawLine(e=>{e.moveTo(t,o-b),e.lineTo(t,s+b)}),e.forEach((o,s)=>{let c=l(n[s]),u=s===0&&r||s===e.length-1&&i;(o.drawMark??!0)&&this._drawMark(t,c,u,a)})}_drawLine(e){this.ctx.lineWidth=y,this.ctx.beginPath(),e(this.ctx),this.ctx.stroke()}_drawMark(e,t,n,r){let i={left:-1,right:1}[r];this.ctx.lineWidth=v,this.ctx.beginPath(),this.ctx.moveTo(n?e-8*i:e,t),this.ctx.lineTo(e+8*i,t),this.ctx.stroke()}_extractYLevels(e,t){let n=this._extractChildElements(t);if(e.length!==n.length)throw Error(`Bad length.`);return e.map((e,t)=>{let r=l(n[t]);return e.getOverriddenMarkYPosition==null?this._getDefaultMarkYPosition(r):e.getOverriddenMarkYPosition(r)})}_extractChildElements(e){let t=this._canvasContainer.parentElement?.querySelector(`.${e}`);if(t==null)throw Error(`Couldn't find "${e}".`);return Array.from(t.childNodes.values()).filter(e=>e instanceof HTMLElement)}_getDefaultMarkYPosition(e){let t=this._canvasContainer.getBoundingClientRect(),n=e.getBoundingClientRect();return n.top-t.top+n.height/2}_getDiagramColor(){let e={dark:`darkThemeColorHexCode`,light:`lightThemeColorHexCode`,auto:this._prefersDark?`darkThemeColorHexCode`:`lightThemeColorHexCode`}[this.data.colorTheme];return this.data[e]??this._css.fg}},S=class extends x{_onRenderStructure(){let e=this.data.structure;this._renderSection({stops:e.stops,x:this.width/2,yLevels:this._extractYLevels(e.stops,w),terminatesAtTop:!0,terminatesAtBottom:!0,notchSide:`right`})}};function C(e){return i(d,{class:e.class,text:`An error occurred while rendering this diagram`})}var w=`_diagram-stops`;function T(n){let{settings:r}=u(),s=e(()=>({structure:n.structure,lightThemeColorHexCode:n.lightThemeColorHexCode,darkThemeColorHexCode:n.darkThemeColorHexCode,colorTheme:r.theme}),[n.darkThemeColorHexCode,n.lightThemeColorHexCode,n.structure,r.theme]),l=c((e,t)=>new S(e,t),[]);return s.structure.stops.length<2?i(C,{}):i(o,{class:t(n.class,`grid-cols-[auto_1fr] gap-4`),children:[i(g,{class:`w-4`,createController:l,data:s}),i(a,{class:t(`gap-6`,w),children:n.structure.stops.map(e=>i(o,{children:e.content}))})]})}export{p as a,g as i,C as n,f as o,x as r,T as t};
@@ -52,4 +52,4 @@ import{g as e,h as t}from"./use-nav-exemptions-QtGbfEPT.js";function n(e){let t=
52
52
 
53
53
  `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},s,c=ie,l=!k.jitless,u=l&&ae.value,d=t.catchall,f;e._zod.parse=(i,o)=>{f??=r.value;let p=i.value;return c(p)?l&&u&&o?.async===!1&&o.jitless!==!0?(s||=a(t.shape),i=s(i,o),d?_r([],p,i,o,f,e,o?.abortEarly===!0):i):n(i,o):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function br(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!x(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>C(e,r,A())))}),t)}var xr=D(`$ZodUnion`,(e,t)=>{M.init(e,t),E(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),E(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),E(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),E(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>c(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>br(t,r,e,i)):br(o,r,e,i)}}),Sr=D(`$ZodIntersection`,(e,t)=>{M.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>wr(e,t,n)):wr(e,i,a)}});function Cr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_(e)&&_(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Cr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Cr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wr(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Cr(t.value,n.value);if(!c.valid){if(x(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Tr=D(`$ZodEnum`,(e,t)=>{M.init(e,t);let r=n(t.entries),i=new Set(r);e._zod.values=i,E(e,`pattern`,e=>{let t=n(e.def.entries).filter(e=>se.has(typeof e));return RegExp(t.length?`^(${t.map(e=>v(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,n)=>{let a=t.value;return i.has(a)||t.issues.push({code:`invalid_value`,values:r,input:a,inst:e}),t}}),Er=D(`$ZodLiteral`,(e,t)=>{M.init(e,t);let n=new Set(t.values);e._zod.values=n,E(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?v(e):e?v(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Dr=D(`$ZodTransform`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,k.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new We(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new O;return n.value=i,n}});function Or(e,t){return e.value=t.issues.length?void 0:t.value,e}var kr=D(`$ZodOptional`,(e,t)=>{M.init(e,t),E(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,E(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),E(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${c(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Or(e,t)):Or(e,r)}return t.innerType._zod.run(e,n)}}),Ar=D(`$ZodExactOptional`,(e,t)=>{kr.init(e,t),E(e,`values`,e=>e.def.innerType._zod.values),E(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),jr=D(`$ZodNullable`,(e,t)=>{M.init(e,t),E(e,`optin`,e=>e.def.innerType._zod.optin),E(e,`optout`,e=>e.def.innerType._zod.optout),E(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${c(t.source)}|null)$`):void 0}),E(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Mr=D(`$ZodDefault`,(e,t)=>{M.init(e,t),e._zod.optin=`defaulted`,E(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Nr(e,t)):Nr(r,t)}});function Nr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Pr=D(`$ZodPrefault`,(e,t)=>{M.init(e,t),e._zod.optin=`defaulted`,E(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Fr=D(`$ZodNonOptional`,(e,t)=>{M.init(e,t),E(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Ir(t,e)):Ir(i,e)}});function Ir(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Lr(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>C(e,r,A()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Rr=D(`$ZodCatch`,(e,t)=>{M.init(e,t),E(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),E(e,`optout`,e=>e.def.innerType._zod.optout),E(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Lr(e,r,t,n)):Lr(e,r,t,n)}}),zr=D(`$ZodPipe`,(e,t)=>{M.init(e,t),E(e,`values`,e=>e.def.in._zod.values),E(e,`optin`,e=>e.def.in._zod.optin),E(e,`optout`,e=>e.def.out._zod.optout),E(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Br(e,t.in,n)):Br(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Br(e,t.out,n)):Br(r,t.out,n)}});function Br(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Vr=D(`$ZodReadonly`,(e,t)=>{M.init(e,t),E(e,`propValues`,e=>e.def.innerType._zod.propValues),E(e,`values`,e=>e.def.innerType._zod.values),E(e,`optin`,e=>e.def.innerType?._zod?.optin),E(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Hr):Hr(r)}});function Hr(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Ur=D(`$ZodCustom`,(e,t)=>{j.init(e,t),M.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Wr(t,n,r,e));Wr(i,n,r,e)}});function Wr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ke(e))}}var Gr=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Kr=`~memo`,qr=[];function Jr(e){return typeof e==`object`&&!!e}function Yr(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Xr=new WeakMap,P=0,Zr=1,F=2;function Qr(e,t,n){let r=Xr.get(e);if(r!==void 0)return r?F:P;if(t.has(e))return F;t.add(e);let i=P,a=e=>{if(i!==F&&e?._zod){let r=Qr(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=P;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Zr:o.value?._zod?Qr(o.value,t,n):P;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=d(c);s(e?o(e,!0):Zr),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Qr(r,t,!1):Zr);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),$r(e,i)}function $r(e,t){return t!==Zr&&Xr.set(e,t===F),t}function ei(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var ti,ni=[],ri={alloc(e,t,n){let r=ti;if(!r)return n;ti=void 0;let i={value:n,issues:null};return r.set(t.value,i),ni.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&ai(n,e.value))throw new Gr;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Qr(e,new Set,!1);if(i===P)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===F||r?n=!0:r=!0}let l=s.value;if(!Jr(l))return t(s,c);let u=c[Kr];u||(u={buckets:new WeakMap,backEdges:void 0},c[Kr]=u);let d;i===c?d=a:(d=ei(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Yr(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;ti=d;let p=ni.length,m=t(s,c);ti=void 0;let h=ni.length>p?ni.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Yr(e.issues):qr),e)):(h&&(h.issues=m.issues.length?Yr(m.issues):qr),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function ii(){return ri}function ai(e,t){let n=e[Kr]?.backEdges;return n!==void 0&&Jr(t)&&n.has(t)}var oi=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},i={nan:`NaN`};function a(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):i[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${a(e.expected)}, received ${a(Oe(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${ce(e.values[0])}`:`Invalid option: expected one of ${r(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${r(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function si(){return{localeError:oi()}}var ci,li=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ui(){return new li}(ci=globalThis).__zod_globalRegistry??(ci.__zod_globalRegistry=ui());var I=globalThis.__zod_globalRegistry;function di(e){return e.checks&&=[...e.checks],e}function fi(e,t){return new e(di({type:`string`,...b(t)}))}function pi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...b(t)})}function mi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...b(t)})}function hi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...b(t)})}function gi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...b(t)})}function _i(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...b(t)})}function vi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...b(t)})}function yi(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...b(t)})}function bi(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...b(t)})}function xi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...b(t)})}function Si(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...b(t)})}function Ci(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...b(t)})}function wi(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...b(t)})}function Ti(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...b(t)})}function Ei(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...b(t)})}function Di(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...b(t)})}function Oi(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...b(t)})}function ki(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...b(t)})}function Ai(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...b(t)})}function ji(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...b(t)})}function Mi(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...b(t)})}function Ni(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...b(t)})}function Pi(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...b(t)})}function Fi(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...b(t)})}function Ii(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...b(t)})}function Li(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...b(t)})}function Ri(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...b(t)})}function zi(e,t){return new e(di({type:`number`,checks:[],...b(t)}))}function Bi(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...b(t)})}function Vi(e,t){return new e({type:`boolean`,...b(t)})}function Hi(e){return new e({type:`unknown`})}function Ui(e,t){return new e({type:`never`,...b(t)})}function Wi(e,t){return new $t({check:`less_than`,...b(t),value:e,inclusive:!1})}function Gi(e,t){return new $t({check:`less_than`,...b(t),value:e,inclusive:!0})}function Ki(e,t){return new en({check:`greater_than`,...b(t),value:e,inclusive:!1})}function qi(e,t){return new en({check:`greater_than`,...b(t),value:e,inclusive:!0})}function Ji(e,t){return new tn({check:`multiple_of`,...b(t),value:e})}function Yi(e,t){return new rn({check:`max_length`,...b(t),maximum:e})}function Xi(e,t){return new an({check:`min_length`,...b(t),minimum:e})}function Zi(e,t){return new on({check:`length_equals`,...b(t),length:e})}function Qi(e,t){return new cn({check:`string_format`,format:`regex`,...b(t),pattern:e})}function $i(e){return new ln({check:`string_format`,format:`lowercase`,...b(e)})}function ea(e){return new un({check:`string_format`,format:`uppercase`,...b(e)})}function ta(e,t){return new dn({check:`string_format`,format:`includes`,...b(t),includes:e})}function na(e,t){return new fn({check:`string_format`,format:`starts_with`,...b(t),prefix:e})}function ra(e,t){return new pn({check:`string_format`,format:`ends_with`,...b(t),suffix:e})}function L(e){return new mn({check:`overwrite`,tx:e})}function ia(e){return L(t=>t.normalize(e))}function aa(){return L(e=>e.trim())}function oa(){return L(e=>e.toLowerCase())}function sa(){return L(e=>e.toUpperCase())}function ca(){return L(e=>ne(e))}function la(e,t,n){return new e({type:`array`,element:t,...b(n)})}function ua(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...b(n)})}function da(e,t){let n=fa(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(ke(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(ke(r))}},e(t.value,t)),t);return n}function fa(e,t){let n=new j({check:`custom`,...b(t)});return n._zod.check=e,n}function pa(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&u(e,t,n[t]);return e}function ma(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??I,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function R(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function z(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,z(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&pa(o.schema,c),t.io===`input`&&B(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ha(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function ga(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${ha(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+ha(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
54
54
 
55
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function _a(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;_a(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var va=new Set([`type`,`properties`,`required`,`additionalProperties`]),ya=[`oneOf`,`anyOf`];function ba(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function xa(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!va.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??ba(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}u(n,r,e.length===1?e[0]:xa(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=ba(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Sa(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of va)if(t in e)return;let n=t.filter(e=>ya.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=xa(t);else{let e=n[0],i=ya.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>xa([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,pa(e,r))}function Ca(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):pa(i,s),pa(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())_a(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Sa(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}pa(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,u(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Ta(t,`input`,e.processors),output:Ta(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function B(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return B(r.element,n);if(r.type===`set`)return B(r.valueType,n);if(r.type===`lazy`)return B(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return B(r.innerType,n);if(r.type===`intersection`)return B(r.left,n)||B(r.right,n);if(r.type===`record`||r.type===`map`)return B(r.keyType,n)||B(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:B(r.in,n)||B(r.out,n);if(r.type===`object`){for(let e in r.shape)if(B(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(B(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(B(e,n))return!0;return!!(r.rest&&B(r.rest,n))}return!1}var wa=(e,t={})=>n=>{let r=ma({...n,processors:t});return z(e,r),ga(r,e),Ca(r,e)},Ta=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ma({...i??{},target:a,io:t,processors:n});return z(e,o),ga(o,e),Ca(o,e)},V=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},H=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ea=(e,t)=>{V(e,`minimum`,t),H(e,`maximum`,t)},Da=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Oa=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},ka=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Aa=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},ja=(e,t)=>V(e,`minimum`,t.minimum),Ma=(e,t)=>H(e,`maximum`,t.maximum),Na=e=>(t,n)=>{Aa(t,n.format);let[r,i]=e[n.format];V(t,`minimum`,r),H(t,`maximum`,i)},Pa={greater_than:(e,t)=>V(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>H(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Da(e,t.value),number_format:Na(ue),bigint_format:Na(de),min_length:ja,max_length:Ma,length_equals:(e,t)=>Ea(e,t.length),min_size:ja,max_size:Ma,size_equals:(e,t)=>Ea(e,t.size),string_format:(e,t)=>{Aa(e,t.format),t.pattern&&Oa(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>ka(e,t.mime)};function U(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Pa[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&V(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&V(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&H(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&H(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Da(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&ka(t,i.mime);for(let e of i.patterns??[])Oa(t,e);return t}var Fa={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ia=new Map([[Zn,It],[$n,Lt]]),La=e=>Ia.get(e)??e,Ra=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=U(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Fa[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(La);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},za=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=U(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):R(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Ba=(e,t,n,r)=>{n.type=`boolean`},Va=(e,t,n,r)=>{n.not={}},Ha=(e,t,r,i)=>{let a=e._zod.def,o=n(a.entries);o.length===0?r.not={}:(o.every(e=>typeof e==`number`)&&(r.type=`number`),o.every(e=>typeof e==`string`)&&(r.type=`string`),r.enum=o)},Ua=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(R(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(R(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Wa=(e,t,n,r)=>{R(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Ga=(e,t,n,r)=>{R(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ka=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=U(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=z(a.element,t,{...r,path:[...r.path,`items`]})};function qa(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?qa(t.out):t.type===`catch`?qa(t.innerType):e._zod.optin}var Ja=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&R(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)u(i.properties,e,z(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?qa(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=z(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ya=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>z(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Xa=(e,t,n,r)=>{let i=e._zod.def,a=z(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=z(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Za=(e,t,n,r)=>{let i=e._zod.def,a=z(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Qa=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},$a=Symbol();function eo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(R(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),$a):JSON.parse(o)}var to=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=eo(i.defaultValue,e,t,n,r);o!==$a&&(n.default=o)},no=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=eo(i.defaultValue,e,t,n,r);o!==$a&&(n._prefault=o)},ro=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{R(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},io=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;z(o,t,r);let s=t.seen.get(e);s.ref=o},ao=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},oo=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},so=new WeakSet([Object.prototype,Error.prototype]);function co(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var W=D(`ZodError`,(e,t)=>{Xe.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);so.has(n)||(so.add(n),co(n,`format`,e=>t=>$e(e,t)),co(n,`flatten`,e=>t=>Qe(e,t)),co(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,i,2)}),co(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,i,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),lo=tt(W),uo=nt(W),fo=rt(W),po=at(W),mo=dt(W),ho=ft(W),go=pt(W),_o=mt(W),vo=ht(W),yo=gt(W),bo=_t(W),xo=vt(W);function So(){k.localeError||A(si())}function Co(){k.memoizer||A({memoizer:ii()})}var G=D(`ZodType`,(e,t)=>(So(),M.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(g(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return y(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ns(e,t))},superRefine(e,t){return this.check(Ps(e,t))},overwrite(e){return this.check(L(e))},optional(){return hs(this)},exactOptional(){return _s(this)},nullable(){return ys(this)},nullish(){return hs(ys(this))},nonoptional(e){return Ts(this,e)},array(){return as(this)},or(e){return X([this,e])},and(e){return ls(this,e)},transform(e){return ks(this,ps(e))},default(e){return xs(this,e)},prefault(e){return Cs(this,e)},catch(e){return Ds(this,e)},pipe(e){return ks(this,e)},readonly(){return js(this)},describe(e){let t=this.clone();return I.add(t,{description:e}),t},meta(...e){if(e.length===0)return I.get(this);let t=this.clone();return I.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return je(this,`~standard`,{...yn(this),jsonSchema:{input:Ta(this,`input`),output:Ta(this,`output`)}})},set"~standard"(e){w(this,`~standard`,e)},parse:function e(t,n){return lo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await uo(this,t,n,{callee:e})},safeParse(e,t){return fo(this,e,t)},async safeParseAsync(e,t){return po(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){w(this,`spa`,e)},validate(e,t){return ct(this,e,t)},validateAsync(e,t){return ut(this,e,t)},encode:function e(t,n){return mo(this,t,n,{callee:e})},decode:function e(t,n){return ho(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await go(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await _o(this,t,n,{callee:e})},safeEncode(e,t){return vo(this,e,t)},safeDecode(e,t){return yo(this,e,t)},async safeEncodeAsync(e,t){return bo(this,e,t)},async safeDecodeAsync(e,t){return xo(this,e,t)},toJSONSchema(e){return wa(this,{})(e)},get description(){return I.get(this)?.description},get _def(){return this._zod.def}}),wo=D(`_ZodString`,(e,t)=>{bn.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ra(e,t,n,r)},Me({format:e=>U(e).format??null,minLength:e=>U(e).minimum??null,maxLength:e=>U(e).maximum??null},{regex(...e){return this.check(Qi(...e))},includes(...e){return this.check(ta(...e))},startsWith(...e){return this.check(na(...e))},endsWith(...e){return this.check(ra(...e))},min(...e){return this.check(Xi(...e))},max(...e){return this.check(Yi(...e))},length(...e){return this.check(Zi(...e))},nonempty(...e){return this.check(Xi(1,...e))},lowercase(e){return this.check($i(e))},uppercase(e){return this.check(ea(e))},trim(){return this.check(aa())},normalize(...e){return this.check(ia(...e))},toLowerCase(){return this.check(oa())},toUpperCase(){return this.check(sa())},slugify(){return this.check(ca())}})),To=D(`ZodString`,(e,t)=>{bn.init(e,t),wo.init(e,t)},{email(e){return this.check(pi(Ao,e))},url(e){return this.check(yi(No,e))},jwt(e){return this.check(Pi(Jo,e))},emoji(e){return this.check(bi(Po,e))},guid(e){return this.check(mi(jo,e))},uuid(e){return this.check(hi(Mo,e))},uuidv4(e){return this.check(gi(Mo,e))},uuidv6(e){return this.check(_i(Mo,e))},uuidv7(e){return this.check(vi(Mo,e))},nanoid(e){return this.check(xi(Fo,e))},cuid(e){return this.check(Si(Io,e))},cuid2(e){return this.check(Ci(Lo,e))},ulid(e){return this.check(wi(Ro,e))},base64(e){return this.check(ji(Go,e))},base64url(e){return this.check(Mi(Ko,e))},xid(e){return this.check(Ti(zo,e))},ksuid(e){return this.check(Ei(Bo,e))},ipv4(e){return this.check(Di(Vo,e))},ipv6(e){return this.check(Oi(Ho,e))},cidrv4(e){return this.check(ki(Uo,e))},cidrv6(e){return this.check(Ai(Wo,e))},e164(e){return this.check(Ni(qo,e))},datetime(e){return this.check(Fi(Eo,e))},date(e){return this.check(Ii(Do,e))},time(e){return this.check(Li(Oo,e))},duration(e){return this.check(Ri(ko,e))}});function K(e){return fi(To,e)}var q=D(`ZodStringFormat`,(e,t)=>{N.init(e,t),wo.init(e,t)}),Eo=D(`ZodISODateTime`,(e,t)=>{zn.init(e,t),q.init(e,t)}),Do=D(`ZodISODate`,(e,t)=>{Bn.init(e,t),q.init(e,t)}),Oo=D(`ZodISOTime`,(e,t)=>{Vn.init(e,t),q.init(e,t)}),ko=D(`ZodISODuration`,(e,t)=>{Hn.init(e,t),q.init(e,t)}),Ao=D(`ZodEmail`,(e,t)=>{Cn.init(e,t),q.init(e,t)}),jo=D(`ZodGUID`,(e,t)=>{xn.init(e,t),q.init(e,t)}),Mo=D(`ZodUUID`,(e,t)=>{Sn.init(e,t),q.init(e,t)}),No=D(`ZodURL`,(e,t)=>{jn.init(e,t),q.init(e,t)}),Po=D(`ZodEmoji`,(e,t)=>{Mn.init(e,t),q.init(e,t)}),Fo=D(`ZodNanoID`,(e,t)=>{Nn.init(e,t),q.init(e,t)}),Io=D(`ZodCUID`,(e,t)=>{Pn.init(e,t),q.init(e,t)}),Lo=D(`ZodCUID2`,(e,t)=>{Fn.init(e,t),q.init(e,t)}),Ro=D(`ZodULID`,(e,t)=>{In.init(e,t),q.init(e,t)}),zo=D(`ZodXID`,(e,t)=>{Ln.init(e,t),q.init(e,t)}),Bo=D(`ZodKSUID`,(e,t)=>{Rn.init(e,t),q.init(e,t)}),Vo=D(`ZodIPv4`,(e,t)=>{Un.init(e,t),q.init(e,t)}),Ho=D(`ZodIPv6`,(e,t)=>{Kn.init(e,t),q.init(e,t)}),Uo=D(`ZodCIDRv4`,(e,t)=>{qn.init(e,t),q.init(e,t)}),Wo=D(`ZodCIDRv6`,(e,t)=>{Yn.init(e,t),q.init(e,t)}),Go=D(`ZodBase64`,(e,t)=>{Qn.init(e,t),q.init(e,t)}),Ko=D(`ZodBase64URL`,(e,t)=>{tr.init(e,t),q.init(e,t)}),qo=D(`ZodE164`,(e,t)=>{nr.init(e,t),q.init(e,t)}),Jo=D(`ZodJWT`,(e,t)=>{ir.init(e,t),q.init(e,t)}),Yo=D(`ZodNumber`,(e,t)=>{ar.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>za(e,t,n,r),e.isFinite=!0},Me({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=U(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=U(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=U(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>U(e).format??null},{gt(e,t){return this.check(Ki(e,t))},gte(e,t){return this.check(qi(e,t))},min(e,t){return this.check(qi(e,t))},lt(e,t){return this.check(Wi(e,t))},lte(e,t){return this.check(Gi(e,t))},max(e,t){return this.check(Gi(e,t))},int(e){return this.check(Zo(e))},safe(e){return this.check(Zo(e))},positive(e){return this.check(Ki(0,e))},nonnegative(e){return this.check(qi(0,e))},negative(e){return this.check(Wi(0,e))},nonpositive(e){return this.check(Gi(0,e))},multipleOf(e,t){return this.check(Ji(e,t))},step(e,t){return this.check(Ji(e,t))},finite(){return this}}));function J(e){return zi(Yo,e)}var Xo=D(`ZodNumberFormat`,(e,t)=>{or.init(e,t),Yo.init(e,t)});function Zo(e){return Bi(Xo,e)}var Qo=D(`ZodBoolean`,(e,t)=>{sr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ba(e,t,n,r)});function $o(e){return Vi(Qo,e)}var es=D(`ZodUnknown`,(e,t)=>{cr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ts(){return Hi(es)}var ns=D(`ZodNever`,(e,t)=>{lr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Va(e,t,n,r)});function rs(e){return Ui(ns,e)}var is=D(`ZodArray`,(e,t)=>{Co(),pr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ka(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Xi(e,t))},nonempty(e){return this.check(Xi(1,e))},max(e,t){return this.check(Yi(e,t))},length(e,t){return this.check(Zi(e,t))},unwrap(){return this.element}});function as(e,t){return la(is,e,t)}var os=D(`ZodObject`,(e,t)=>{Co(),yr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ja(e,t,n,r),Le(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Z(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(g(this._zod.def,{catchall:e}))},passthrough(){return this.clone(g(this._zod.def,{catchall:ts()}))},loose(){return this.clone(g(this._zod.def,{catchall:ts()}))},strict(){return this.clone(g(this._zod.def,{catchall:rs()}))},strip(){return this.clone(g(this._zod.def,{catchall:void 0}))},extend(e){return he(this,e)},safeExtend(e){return _e(this,e)},merge(e){return ve(this,e)},pick(e){return fe(this,e)},omit(e){return me(this,e)},partial(...e){return ye(ms,this,e[0])},exactPartial(...e){return ye(gs,this,e[0],`exactPartial`)},required(...e){return be(ws,this,e[0])}});function Y(e,t){return new os({type:`object`,shape:e??{},...b(t)})}var ss=D(`ZodUnion`,(e,t)=>{xr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ya(e,t,n,r),e.options=t.options});function X(e,t){return new ss({type:`union`,options:e,...b(t)})}var cs=D(`ZodIntersection`,(e,t)=>{Sr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r)});function ls(e,t){return new cs({type:`intersection`,left:e,right:t})}var us=D(`ZodEnum`,(e,t)=>{Tr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ha(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new us({...t,checks:[],...b(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new us({...t,checks:[],...b(r),entries:i})}});function Z(e,t){return new us({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...b(t)})}var ds=D(`ZodLiteral`,(e,t)=>{Er.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ua(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Q(e,t){return new ds({type:`literal`,values:Array.isArray(e)?e:[e],...b(t)})}var fs=D(`ZodTransform`,(e,t)=>{Co(),Dr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ga(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new We(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ke(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(ke(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function ps(e){return new fs({type:`transform`,transform:e})}var ms=D(`ZodOptional`,(e,t)=>{kr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hs(e){return new ms({type:`optional`,innerType:e})}var gs=D(`ZodExactOptional`,(e,t)=>{Ar.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _s(e){return new gs({type:`optional`,innerType:e})}var vs=D(`ZodNullable`,(e,t)=>{jr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ys(e){return new vs({type:`nullable`,innerType:e})}var bs=D(`ZodDefault`,(e,t)=>{Mr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function xs(e,t){return new bs({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():oe(t)}})}var Ss=D(`ZodPrefault`,(e,t)=>{Pr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cs(e,t){return new Ss({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():oe(t)}})}var ws=D(`ZodNonOptional`,(e,t)=>{Fr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ts(e,t){return new ws({type:`nonoptional`,innerType:e,...b(t)})}var Es=D(`ZodCatch`,(e,t)=>{Rr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ds(e,t){return new Es({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:ze(t)})}var Os=D(`ZodPipe`,(e,t)=>{zr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>io(e,t,n,r),e.in=t.in,e.out=t.out});function ks(e,t){return new Os({type:`pipe`,in:e,out:t})}var As=D(`ZodReadonly`,(e,t)=>{Vr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function js(e){return new As({type:`readonly`,innerType:e})}var Ms=D(`ZodCustom`,(e,t)=>{Ur.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wa(e,t,n,r)});function Ns(e,t={}){return ua(Ms,e,t)}function Ps(e,t){return da(e,t)}var Fs={path:`/about-page/v1`,argsSchema:Y({}),resultSchema:Y({primaryMarkdown:K()})};function Is(e){return Y({foundationalDataHash:K(),innerResult:e})}var Ls={path:`/departures/v0`,argsSchema:Y({stopId:J(),count:J()}),resultSchema:Is(Y({departures:Y({sourceId:K(),intrasourceId:K(),primaryDestinationText:K(),secondaryDestinationText:K().nullable(),lineIds:J().array().readonly(),color:Y({lightModeHexCode:K(),darkModeHexCode:K()}).nullable(),isCancelled:$o(),movement:Y({index:J(),positionId:J().nullable(),time:K(),formerTime:K().nullable()})}).array()}))},Rs=Y({latitude:J(),longitude:J()}),zs=Y({lightModeHexCode:K(),darkModeHexCode:K()}),Bs=Y({id:J(),name:K(),urlPath:K(),canonicalLinesServingStop:J().array().readonly(),location:Rs.nullable()}),$=Y({stopId:J(),type:Z([`regular`,`always-express`])}),Vs=X([Y({type:Q(`linear`),name:K().nullable(),color:zs.nullable(),stops:$.array().readonly()}),Y({type:Q(`branch`),name:K().nullable(),color:zs.nullable(),commonStops:$.array().readonly(),branchAStops:$.array().readonly(),branchBStops:$.array().readonly()}),Y({type:Q(`loop`),name:K().nullable(),color:zs.nullable(),loopLeftStops:$.array().readonly(),loopRightStops:$.array().readonly(),mainStops:$.array().readonly()})]),Hs={linear:!0,branch:!0,loop:!0};function Us(e){return e in Hs}var Ws=Y({entries:X([Vs,Y({type:K().refine(e=>!Us(e))})]).array().readonly(),fallbackStopList:J().array().readonly()}),Gs=Y({id:J(),name:K(),urlPath:K(),color:zs.nullable(),diagram:Ws}),Ks=Y({stop:Z([`stop`,`station`]),line:Z([`line`,`route`]),service:Z([`service`,`trip`,`train`,`tram`,`bus`])}),qs=Y({primaryMarkdown:K()}),Js=Y({primaryMarkdown:K()}),Ys=Y({metadata:Y({hash:K(),fodaApiVersion:Q(`1`),serverVersion:K()}),stops:Bs.array().readonly(),lines:Gs.array().readonly(),terminology:Ks,landingPage:qs,footer:Js}),Xs={path:`/foundational-data/v1`,argsSchema:Y({hash:K().nullable()}),resultSchema:X([Y({result:Q(`outdated`),foundationalData:Ys}),Y({result:Q(`up-to-date`)})])},Zs={path:`/service/v0`,argsSchema:Y({sourceId:K(),intrasourceId:K()}),resultSchema:Is(Y({service:Y({sourceId:K(),intrasourceId:K(),primaryDestinationText:K(),lineIds:J().array().readonly(),color:Y({lightModeHexCode:K(),darkModeHexCode:K()}).nullable(),isCancelled:$o(),movements:Y({stopId:J(),positionId:J().nullable(),arrivalTime:K().nullable(),formerArrivalTime:K().nullable(),departureTime:K().nullable(),formerDepartureTime:K().nullable()}).array().readonly()}).nullable()}))},Qs={path:`/version-check/v1`,argsSchema:Y({frontendVersion:K(),corequeryPackageVersion:K()}),resultSchema:Y({isForceUpdateOfServiceWorkerRequired:$o()})},$s={path:`/versions/v1`,argsSchema:Y({}),resultSchema:Y({serverVersion:K(),frontendVersion:K(),corequeryPackageVersion:K(),foundationalDataHash:K(),version:K().meta({deprecated:!0})})};function ec(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(typeof e!=`object`)return e===t;if(Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!ec(e[n],t[n]))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n)if(!r.includes(i)||!ec(e[i],t[i]))return!1;return!0}Object.freeze({status:`aborted`});function tc(e,n){let r=nc(n);t(e,r)}function nc(t){let n=e(void 0);return ec(t,n.current)||(n.current=t),n.current}function rc(){return{callApi:ic}}async function ic(e,t,n={}){let{timeout:r,debugDelay:i,debugError:a}=n;if(i!=null&&await new Promise(e=>setTimeout(e,i)),a??!1)throw Error(`Simulated API error`);let o=await fetch(`/api${e.path}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t),signal:r==null?void 0:AbortSignal.timeout(r)});if(!o.ok){let t=await o.text();throw Error(`Error ${o.status} calling /api${e.path}: ${t}`)}return e.resultSchema.parse(await o.json())}export{Qs as a,Ys as c,Fs as d,Z as f,ts as g,X as h,$s as i,Us as l,Y as m,tc as n,Zs as o,Q as p,ec as r,Xs as s,rc as t,Ls as u};
55
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function _a(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;_a(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var va=new Set([`type`,`properties`,`required`,`additionalProperties`]),ya=[`oneOf`,`anyOf`];function ba(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function xa(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!va.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??ba(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}u(n,r,e.length===1?e[0]:xa(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=ba(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Sa(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of va)if(t in e)return;let n=t.filter(e=>ya.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=xa(t);else{let e=n[0],i=ya.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>xa([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,pa(e,r))}function Ca(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):pa(i,s),pa(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())_a(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Sa(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}pa(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,u(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Ta(t,`input`,e.processors),output:Ta(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function B(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return B(r.element,n);if(r.type===`set`)return B(r.valueType,n);if(r.type===`lazy`)return B(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return B(r.innerType,n);if(r.type===`intersection`)return B(r.left,n)||B(r.right,n);if(r.type===`record`||r.type===`map`)return B(r.keyType,n)||B(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:B(r.in,n)||B(r.out,n);if(r.type===`object`){for(let e in r.shape)if(B(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(B(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(B(e,n))return!0;return!!(r.rest&&B(r.rest,n))}return!1}var wa=(e,t={})=>n=>{let r=ma({...n,processors:t});return z(e,r),ga(r,e),Ca(r,e)},Ta=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ma({...i??{},target:a,io:t,processors:n});return z(e,o),ga(o,e),Ca(o,e)},V=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},H=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ea=(e,t)=>{V(e,`minimum`,t),H(e,`maximum`,t)},Da=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Oa=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},ka=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Aa=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},ja=(e,t)=>V(e,`minimum`,t.minimum),Ma=(e,t)=>H(e,`maximum`,t.maximum),Na=e=>(t,n)=>{Aa(t,n.format);let[r,i]=e[n.format];V(t,`minimum`,r),H(t,`maximum`,i)},Pa={greater_than:(e,t)=>V(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>H(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Da(e,t.value),number_format:Na(ue),bigint_format:Na(de),min_length:ja,max_length:Ma,length_equals:(e,t)=>Ea(e,t.length),min_size:ja,max_size:Ma,size_equals:(e,t)=>Ea(e,t.size),string_format:(e,t)=>{Aa(e,t.format),t.pattern&&Oa(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>ka(e,t.mime)};function U(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Pa[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&V(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&V(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&H(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&H(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Da(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&ka(t,i.mime);for(let e of i.patterns??[])Oa(t,e);return t}var Fa={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ia=new Map([[Zn,It],[$n,Lt]]),La=e=>Ia.get(e)??e,Ra=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=U(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Fa[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(La);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},za=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=U(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):R(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Ba=(e,t,n,r)=>{n.type=`boolean`},Va=(e,t,n,r)=>{n.not={}},Ha=(e,t,r,i)=>{let a=e._zod.def,o=n(a.entries);o.length===0?r.not={}:(o.every(e=>typeof e==`number`)&&(r.type=`number`),o.every(e=>typeof e==`string`)&&(r.type=`string`),r.enum=o)},Ua=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(R(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(R(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Wa=(e,t,n,r)=>{R(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Ga=(e,t,n,r)=>{R(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ka=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=U(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=z(a.element,t,{...r,path:[...r.path,`items`]})};function qa(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?qa(t.out):t.type===`catch`?qa(t.innerType):e._zod.optin}var Ja=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&R(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)u(i.properties,e,z(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?qa(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=z(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ya=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>z(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Xa=(e,t,n,r)=>{let i=e._zod.def,a=z(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=z(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Za=(e,t,n,r)=>{let i=e._zod.def,a=z(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Qa=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},$a=Symbol();function eo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(R(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),$a):JSON.parse(o)}var to=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=eo(i.defaultValue,e,t,n,r);o!==$a&&(n.default=o)},no=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=eo(i.defaultValue,e,t,n,r);o!==$a&&(n._prefault=o)},ro=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{R(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},io=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;z(o,t,r);let s=t.seen.get(e);s.ref=o},ao=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},oo=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},so=new WeakSet([Object.prototype,Error.prototype]);function co(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var W=D(`ZodError`,(e,t)=>{Xe.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);so.has(n)||(so.add(n),co(n,`format`,e=>t=>$e(e,t)),co(n,`flatten`,e=>t=>Qe(e,t)),co(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,i,2)}),co(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,i,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),lo=tt(W),uo=nt(W),fo=rt(W),po=at(W),mo=dt(W),ho=ft(W),go=pt(W),_o=mt(W),vo=ht(W),yo=gt(W),bo=_t(W),xo=vt(W);function So(){k.localeError||A(si())}function Co(){k.memoizer||A({memoizer:ii()})}var G=D(`ZodType`,(e,t)=>(So(),M.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(g(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return y(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ns(e,t))},superRefine(e,t){return this.check(Ps(e,t))},overwrite(e){return this.check(L(e))},optional(){return hs(this)},exactOptional(){return _s(this)},nullable(){return ys(this)},nullish(){return hs(ys(this))},nonoptional(e){return Ts(this,e)},array(){return as(this)},or(e){return X([this,e])},and(e){return ls(this,e)},transform(e){return ks(this,ps(e))},default(e){return xs(this,e)},prefault(e){return Cs(this,e)},catch(e){return Ds(this,e)},pipe(e){return ks(this,e)},readonly(){return js(this)},describe(e){let t=this.clone();return I.add(t,{description:e}),t},meta(...e){if(e.length===0)return I.get(this);let t=this.clone();return I.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return je(this,`~standard`,{...yn(this),jsonSchema:{input:Ta(this,`input`),output:Ta(this,`output`)}})},set"~standard"(e){w(this,`~standard`,e)},parse:function e(t,n){return lo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await uo(this,t,n,{callee:e})},safeParse(e,t){return fo(this,e,t)},async safeParseAsync(e,t){return po(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){w(this,`spa`,e)},validate(e,t){return ct(this,e,t)},validateAsync(e,t){return ut(this,e,t)},encode:function e(t,n){return mo(this,t,n,{callee:e})},decode:function e(t,n){return ho(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await go(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await _o(this,t,n,{callee:e})},safeEncode(e,t){return vo(this,e,t)},safeDecode(e,t){return yo(this,e,t)},async safeEncodeAsync(e,t){return bo(this,e,t)},async safeDecodeAsync(e,t){return xo(this,e,t)},toJSONSchema(e){return wa(this,{})(e)},get description(){return I.get(this)?.description},get _def(){return this._zod.def}}),wo=D(`_ZodString`,(e,t)=>{bn.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ra(e,t,n,r)},Me({format:e=>U(e).format??null,minLength:e=>U(e).minimum??null,maxLength:e=>U(e).maximum??null},{regex(...e){return this.check(Qi(...e))},includes(...e){return this.check(ta(...e))},startsWith(...e){return this.check(na(...e))},endsWith(...e){return this.check(ra(...e))},min(...e){return this.check(Xi(...e))},max(...e){return this.check(Yi(...e))},length(...e){return this.check(Zi(...e))},nonempty(...e){return this.check(Xi(1,...e))},lowercase(e){return this.check($i(e))},uppercase(e){return this.check(ea(e))},trim(){return this.check(aa())},normalize(...e){return this.check(ia(...e))},toLowerCase(){return this.check(oa())},toUpperCase(){return this.check(sa())},slugify(){return this.check(ca())}})),To=D(`ZodString`,(e,t)=>{bn.init(e,t),wo.init(e,t)},{email(e){return this.check(pi(Ao,e))},url(e){return this.check(yi(No,e))},jwt(e){return this.check(Pi(Jo,e))},emoji(e){return this.check(bi(Po,e))},guid(e){return this.check(mi(jo,e))},uuid(e){return this.check(hi(Mo,e))},uuidv4(e){return this.check(gi(Mo,e))},uuidv6(e){return this.check(_i(Mo,e))},uuidv7(e){return this.check(vi(Mo,e))},nanoid(e){return this.check(xi(Fo,e))},cuid(e){return this.check(Si(Io,e))},cuid2(e){return this.check(Ci(Lo,e))},ulid(e){return this.check(wi(Ro,e))},base64(e){return this.check(ji(Go,e))},base64url(e){return this.check(Mi(Ko,e))},xid(e){return this.check(Ti(zo,e))},ksuid(e){return this.check(Ei(Bo,e))},ipv4(e){return this.check(Di(Vo,e))},ipv6(e){return this.check(Oi(Ho,e))},cidrv4(e){return this.check(ki(Uo,e))},cidrv6(e){return this.check(Ai(Wo,e))},e164(e){return this.check(Ni(qo,e))},datetime(e){return this.check(Fi(Eo,e))},date(e){return this.check(Ii(Do,e))},time(e){return this.check(Li(Oo,e))},duration(e){return this.check(Ri(ko,e))}});function K(e){return fi(To,e)}var q=D(`ZodStringFormat`,(e,t)=>{N.init(e,t),wo.init(e,t)}),Eo=D(`ZodISODateTime`,(e,t)=>{zn.init(e,t),q.init(e,t)}),Do=D(`ZodISODate`,(e,t)=>{Bn.init(e,t),q.init(e,t)}),Oo=D(`ZodISOTime`,(e,t)=>{Vn.init(e,t),q.init(e,t)}),ko=D(`ZodISODuration`,(e,t)=>{Hn.init(e,t),q.init(e,t)}),Ao=D(`ZodEmail`,(e,t)=>{Cn.init(e,t),q.init(e,t)}),jo=D(`ZodGUID`,(e,t)=>{xn.init(e,t),q.init(e,t)}),Mo=D(`ZodUUID`,(e,t)=>{Sn.init(e,t),q.init(e,t)}),No=D(`ZodURL`,(e,t)=>{jn.init(e,t),q.init(e,t)}),Po=D(`ZodEmoji`,(e,t)=>{Mn.init(e,t),q.init(e,t)}),Fo=D(`ZodNanoID`,(e,t)=>{Nn.init(e,t),q.init(e,t)}),Io=D(`ZodCUID`,(e,t)=>{Pn.init(e,t),q.init(e,t)}),Lo=D(`ZodCUID2`,(e,t)=>{Fn.init(e,t),q.init(e,t)}),Ro=D(`ZodULID`,(e,t)=>{In.init(e,t),q.init(e,t)}),zo=D(`ZodXID`,(e,t)=>{Ln.init(e,t),q.init(e,t)}),Bo=D(`ZodKSUID`,(e,t)=>{Rn.init(e,t),q.init(e,t)}),Vo=D(`ZodIPv4`,(e,t)=>{Un.init(e,t),q.init(e,t)}),Ho=D(`ZodIPv6`,(e,t)=>{Kn.init(e,t),q.init(e,t)}),Uo=D(`ZodCIDRv4`,(e,t)=>{qn.init(e,t),q.init(e,t)}),Wo=D(`ZodCIDRv6`,(e,t)=>{Yn.init(e,t),q.init(e,t)}),Go=D(`ZodBase64`,(e,t)=>{Qn.init(e,t),q.init(e,t)}),Ko=D(`ZodBase64URL`,(e,t)=>{tr.init(e,t),q.init(e,t)}),qo=D(`ZodE164`,(e,t)=>{nr.init(e,t),q.init(e,t)}),Jo=D(`ZodJWT`,(e,t)=>{ir.init(e,t),q.init(e,t)}),Yo=D(`ZodNumber`,(e,t)=>{ar.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>za(e,t,n,r),e.isFinite=!0},Me({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=U(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=U(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=U(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>U(e).format??null},{gt(e,t){return this.check(Ki(e,t))},gte(e,t){return this.check(qi(e,t))},min(e,t){return this.check(qi(e,t))},lt(e,t){return this.check(Wi(e,t))},lte(e,t){return this.check(Gi(e,t))},max(e,t){return this.check(Gi(e,t))},int(e){return this.check(Zo(e))},safe(e){return this.check(Zo(e))},positive(e){return this.check(Ki(0,e))},nonnegative(e){return this.check(qi(0,e))},negative(e){return this.check(Wi(0,e))},nonpositive(e){return this.check(Gi(0,e))},multipleOf(e,t){return this.check(Ji(e,t))},step(e,t){return this.check(Ji(e,t))},finite(){return this}}));function J(e){return zi(Yo,e)}var Xo=D(`ZodNumberFormat`,(e,t)=>{or.init(e,t),Yo.init(e,t)});function Zo(e){return Bi(Xo,e)}var Qo=D(`ZodBoolean`,(e,t)=>{sr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ba(e,t,n,r)});function $o(e){return Vi(Qo,e)}var es=D(`ZodUnknown`,(e,t)=>{cr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ts(){return Hi(es)}var ns=D(`ZodNever`,(e,t)=>{lr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Va(e,t,n,r)});function rs(e){return Ui(ns,e)}var is=D(`ZodArray`,(e,t)=>{Co(),pr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ka(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Xi(e,t))},nonempty(e){return this.check(Xi(1,e))},max(e,t){return this.check(Yi(e,t))},length(e,t){return this.check(Zi(e,t))},unwrap(){return this.element}});function as(e,t){return la(is,e,t)}var os=D(`ZodObject`,(e,t)=>{Co(),yr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ja(e,t,n,r),Le(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Z(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(g(this._zod.def,{catchall:e}))},passthrough(){return this.clone(g(this._zod.def,{catchall:ts()}))},loose(){return this.clone(g(this._zod.def,{catchall:ts()}))},strict(){return this.clone(g(this._zod.def,{catchall:rs()}))},strip(){return this.clone(g(this._zod.def,{catchall:void 0}))},extend(e){return he(this,e)},safeExtend(e){return _e(this,e)},merge(e){return ve(this,e)},pick(e){return fe(this,e)},omit(e){return me(this,e)},partial(...e){return ye(ms,this,e[0])},exactPartial(...e){return ye(gs,this,e[0],`exactPartial`)},required(...e){return be(ws,this,e[0])}});function Y(e,t){return new os({type:`object`,shape:e??{},...b(t)})}var ss=D(`ZodUnion`,(e,t)=>{xr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ya(e,t,n,r),e.options=t.options});function X(e,t){return new ss({type:`union`,options:e,...b(t)})}var cs=D(`ZodIntersection`,(e,t)=>{Sr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r)});function ls(e,t){return new cs({type:`intersection`,left:e,right:t})}var us=D(`ZodEnum`,(e,t)=>{Tr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ha(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new us({...t,checks:[],...b(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new us({...t,checks:[],...b(r),entries:i})}});function Z(e,t){return new us({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...b(t)})}var ds=D(`ZodLiteral`,(e,t)=>{Er.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ua(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Q(e,t){return new ds({type:`literal`,values:Array.isArray(e)?e:[e],...b(t)})}var fs=D(`ZodTransform`,(e,t)=>{Co(),Dr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ga(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new We(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ke(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(ke(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function ps(e){return new fs({type:`transform`,transform:e})}var ms=D(`ZodOptional`,(e,t)=>{kr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hs(e){return new ms({type:`optional`,innerType:e})}var gs=D(`ZodExactOptional`,(e,t)=>{Ar.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _s(e){return new gs({type:`optional`,innerType:e})}var vs=D(`ZodNullable`,(e,t)=>{jr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ys(e){return new vs({type:`nullable`,innerType:e})}var bs=D(`ZodDefault`,(e,t)=>{Mr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function xs(e,t){return new bs({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():oe(t)}})}var Ss=D(`ZodPrefault`,(e,t)=>{Pr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cs(e,t){return new Ss({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():oe(t)}})}var ws=D(`ZodNonOptional`,(e,t)=>{Fr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ts(e,t){return new ws({type:`nonoptional`,innerType:e,...b(t)})}var Es=D(`ZodCatch`,(e,t)=>{Rr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ds(e,t){return new Es({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:ze(t)})}var Os=D(`ZodPipe`,(e,t)=>{zr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>io(e,t,n,r),e.in=t.in,e.out=t.out});function ks(e,t){return new Os({type:`pipe`,in:e,out:t})}var As=D(`ZodReadonly`,(e,t)=>{Vr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function js(e){return new As({type:`readonly`,innerType:e})}var Ms=D(`ZodCustom`,(e,t)=>{Ur.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wa(e,t,n,r)});function Ns(e,t={}){return ua(Ms,e,t)}function Ps(e,t){return da(e,t)}var Fs={path:`/about-page/v1`,argsSchema:Y({}),resultSchema:Y({primaryMarkdown:K()})};function Is(e){return Y({foundationalDataHash:K(),innerResult:e})}var Ls=Y({sourceId:K(),intrasourceId:K(),primaryDestinationText:K(),secondaryDestinationText:K().nullable(),lineIds:J().array().readonly(),color:Y({lightModeHexCode:K(),darkModeHexCode:K()}).nullable(),isCancelled:$o(),movement:Y({index:J(),positionId:J().nullable(),time:K(),formerTime:K().nullable()})}),Rs=Y({stopId:J(),desiredCount:J(),filterExpression:K(),skips:Y({sourceId:K(),intrasourceId:K()}).array()}),zs={path:`/departures/v0`,argsSchema:Y({instant:K(),direction:Z([`forwards`,`backwards`]),feeds:Rs.array()}),resultSchema:Is(Y({feeds:Y({departures:Ls.array()}).array(),invalidFilterTokens:K().array()}))},Bs=Y({latitude:J(),longitude:J()}),Vs=Y({lightModeHexCode:K(),darkModeHexCode:K()}),Hs=Y({id:J(),name:K(),urlPath:K(),canonicalLinesServingStop:J().array().readonly(),positions:Y({id:J(),name:K()}).array().readonly(),location:Bs.nullable(),defaultDepartureFeeds:Y({name:K(),desiredCount:J(),filterExpression:K()}).array().readonly(),departureFilters:Y({lines:J().array().readonly(),positions:J().array().readonly(),customGroups:Y({label:K(),items:Y({name:K(),labelWithinGroup:K(),filterExpression:K()}).array().readonly()}).array().readonly()})}),$=Y({stopId:J(),type:Z([`regular`,`always-express`])}),Us=X([Y({type:Q(`linear`),name:K().nullable(),color:Vs.nullable(),stops:$.array().readonly()}),Y({type:Q(`branch`),name:K().nullable(),color:Vs.nullable(),commonStops:$.array().readonly(),branchAStops:$.array().readonly(),branchBStops:$.array().readonly()}),Y({type:Q(`loop`),name:K().nullable(),color:Vs.nullable(),loopLeftStops:$.array().readonly(),loopRightStops:$.array().readonly(),mainStops:$.array().readonly()})]),Ws={linear:!0,branch:!0,loop:!0};function Gs(e){return e in Ws}var Ks=Y({entries:X([Us,Y({type:K().refine(e=>!Gs(e))})]).array().readonly(),fallbackStopList:J().array().readonly()}),qs=Y({id:J(),name:K(),urlPath:K(),color:Vs.nullable(),diagram:Ks}),Js=Y({stop:Z([`stop`,`station`]),line:Z([`line`,`route`]),service:Z([`service`,`trip`,`train`,`tram`,`bus`])}),Ys=Y({primaryMarkdown:K()}),Xs=Y({primaryMarkdown:K()}),Zs=Y({metadata:Y({hash:K(),fodaApiVersion:Q(`1`),serverVersion:K()}),stops:Hs.array().readonly(),lines:qs.array().readonly(),terminology:Js,landingPage:Ys,footer:Xs}),Qs={path:`/foundational-data/v1`,argsSchema:Y({hash:K().nullable()}),resultSchema:X([Y({result:Q(`outdated`),foundationalData:Zs}),Y({result:Q(`up-to-date`)})])},$s={path:`/service/v0`,argsSchema:Y({sourceId:K(),intrasourceId:K()}),resultSchema:Is(Y({service:Y({sourceId:K(),intrasourceId:K(),primaryDestinationText:K(),lineIds:J().array().readonly(),color:Y({lightModeHexCode:K(),darkModeHexCode:K()}).nullable(),isCancelled:$o(),movements:Y({stopId:J(),positionId:J().nullable(),arrivalTime:K().nullable(),formerArrivalTime:K().nullable(),departureTime:K().nullable(),formerDepartureTime:K().nullable()}).array().readonly()}).nullable()}))},ec={path:`/version-check/v1`,argsSchema:Y({frontendVersion:K(),corequeryPackageVersion:K()}),resultSchema:Y({isForceUpdateOfServiceWorkerRequired:$o()})},tc={path:`/versions/v1`,argsSchema:Y({}),resultSchema:Y({serverVersion:K(),frontendVersion:K(),corequeryPackageVersion:K(),foundationalDataHash:K(),version:K().meta({deprecated:!0})})};function nc(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(typeof e!=`object`)return e===t;if(Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!nc(e[n],t[n]))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n)if(!r.includes(i)||!nc(e[i],t[i]))return!1;return!0}Object.freeze({status:`aborted`});function rc(e,n){let r=ic(n);t(e,r)}function ic(t){let n=e(void 0);return nc(t,n.current)||(n.current=t),n.current}function ac(){return{callApi:oc}}async function oc(e,t,n={}){let{timeout:r,debugDelay:i,debugError:a}=n;if(i!=null&&await new Promise(e=>setTimeout(e,i)),a??!1)throw Error(`Simulated API error`);let o=await fetch(`/api${e.path}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t),signal:r==null?void 0:AbortSignal.timeout(r)});if(!o.ok){let t=await o.text();throw Error(`Error ${o.status} calling /api${e.path}: ${t}`)}return e.resultSchema.parse(await o.json())}export{ec as a,Zs as c,Fs as d,Z as f,ts as g,X as h,tc as i,Gs as l,Y as m,rc as n,$s as o,Q as p,nc as r,Qs as s,ac as t,zs as u};
@@ -1 +1 @@
1
- import{v as e}from"./use-nav-exemptions-QtGbfEPT.js";import{n as t,t as n}from"./use-api-BJomuYg6.js";import{n as r}from"./use-foundational-data-BEVQRFj9.js";function i(i,a,o={}){let{callApi:s}=n(),{foda:c,forceFodaUpdate:l}=r(),[u,d]=e(null),[f,p]=e(!0),[m,h]=e(null);return t(()=>{let e=!1;async function t(){try{p(!0),h(null);let t=await s(i,a,o);if(e)return;let n=c.hash;if(t.foundationalDataHash!==n&&(n=await l(),e))return;if(t.foundationalDataHash!==n)throw Error(`Foundational data hash still mismatches after forced update.`);d(t.innerResult)}catch(t){if(e)return;console.warn(t),h(t)}finally{e||p(!1)}}return t(),()=>{e=!0}},[i,a,o]),{data:u,loading:f,error:m}}export{i as t};
1
+ import{v as e}from"./use-nav-exemptions-QtGbfEPT.js";import{n as t,t as n}from"./use-api-Ft007Dfs.js";import{n as r}from"./use-foundational-data-BEVQRFj9.js";function i(i,a,o={}){let{callApi:s}=n(),{foda:c,forceFodaUpdate:l}=r(),[u,d]=e(null),[f,p]=e(!0),[m,h]=e(null);return t(()=>{let e=!1;async function t(){try{p(!0),h(null);let t=await s(i,a,o);if(e)return;let n=c.hash;if(t.foundationalDataHash!==n&&(n=await l(),e))return;if(t.foundationalDataHash!==n)throw Error(`Foundational data hash still mismatches after forced update.`);d(t.innerResult)}catch(t){if(e)return;console.warn(t),h(t)}finally{e||p(!1)}}return t(),()=>{e=!0}},[i,a,o]),{data:u,loading:f,error:m}}export{i as t};
@@ -1 +1 @@
1
- import{c as e,i as t,l as n,n as r,r as i}from"./use-nav-exemptions-QtGbfEPT.js";import{f as a}from"./index-CrhwkQ9k.js";import{n as o,t as s}from"./SimpleMobileHeaderContent-Ja68XAJd.js";function c(c){return{mobileHeader:n(s,{title:c.title,backHref:c.back?.href??null}),desktopHeader:n(r,{children:n(i,{class:e(`mx-4 py-4 gap-8 border-b border-soft-border`,{"pt-8":c.back==null,"pt-6":c.back!=null}),children:[c.back!=null&&n(a,{text:c.back.text,href:c.back.href,icon:o,class:`self-start`,layout:`narrow-icon`}),n(t,{style:`megatitle`,children:c.title})]})})}}export{c as t};
1
+ import{c as e,i as t,l as n,n as r,r as i}from"./use-nav-exemptions-QtGbfEPT.js";import{f as a}from"./index-DOvczcZF.js";import{n as o,t as s}from"./SimpleMobileHeaderContent-DJTkr_6C.js";function c(c){return{mobileHeader:n(s,{title:c.title,backHref:c.back?.href??null}),desktopHeader:n(r,{children:n(i,{class:e(`mx-4 py-4 gap-8 border-b border-soft-border`,{"pt-8":c.back==null,"pt-6":c.back!=null}),children:[c.back!=null&&n(a,{text:c.back.text,href:c.back.href,icon:o,class:`self-start`,layout:`narrow-icon`}),n(t,{style:`megatitle`,children:c.title})]})})}}export{c as t};
@@ -15,9 +15,9 @@
15
15
  <link rel="mask-icon" href="/favicon.svg" color="#FFFFFF" />
16
16
  <meta name="theme-color" content="#242933" />
17
17
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
18
- <script type="module" crossorigin src="/assets/index-CrhwkQ9k.js"></script>
18
+ <script type="module" crossorigin src="/assets/index-DOvczcZF.js"></script>
19
19
  <link rel="modulepreload" crossorigin href="/assets/use-nav-exemptions-QtGbfEPT.js">
20
- <link rel="modulepreload" crossorigin href="/assets/use-api-BJomuYg6.js">
20
+ <link rel="modulepreload" crossorigin href="/assets/use-api-Ft007Dfs.js">
21
21
  <link rel="modulepreload" crossorigin href="/assets/use-foundational-data-BEVQRFj9.js">
22
22
  <link rel="modulepreload" crossorigin href="/assets/scope-B-e4l8Dr.js">
23
23
  <link rel="modulepreload" crossorigin href="/assets/LinkText-sdmJpshg.js">
package/web/dist/sw.js CHANGED
@@ -1 +1 @@
1
- if(!self.define){let s,e={};const l=(l,n)=>(l=new URL(l+".js",n).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(n,i)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let u={};const o=s=>l(s,r),a={module:{uri:r},exports:u,require:o};e[r]=Promise.all(n.map(s=>a[s]||o(s))).then(s=>(i(...s),u))}}define(["./workbox-2fbc6a65"],function(s){"use strict";self.addEventListener("message",s=>{s.data&&"SKIP_WAITING"===s.data.type&&self.skipWaiting()}),s.precacheAndRoute([{url:"pwa-maskable-512x512.png",revision:"9e859d049e78f70ddb5872a3bce2622b"},{url:"pwa-maskable-192x192.png",revision:"f1e5f837a116221b26c9cb9447db5e92"},{url:"pwa-512x512.png",revision:"e5560dba9f85e2959637abbb546643cd"},{url:"pwa-192x192.png",revision:"8b590313fc6296f57d609982dc21f302"},{url:"mona-sans.woff2",revision:"b96cc834af467cf02885a067356abae7"},{url:"index.html",revision:"84b50db4bfa19b3e82c26ab3bd2857ab"},{url:"favicon.svg",revision:"570c2a249bbd511b386a843cd96545e7"},{url:"apple-touch-icon.png",revision:"d5d6ea39bc40ffd5b045b9593da0c890"},{url:"assets/workbox-window.prod.es5-Bd17z0YL.js",revision:null},{url:"assets/use-simple-headers-Cbv0t_De.js",revision:null},{url:"assets/use-nav-exemptions-QtGbfEPT.js",revision:null},{url:"assets/use-foundational-data-BEVQRFj9.js",revision:null},{url:"assets/use-foda-synced-query-BM-OPAql.js",revision:null},{url:"assets/use-api-BJomuYg6.js",revision:null},{url:"assets/scope-B-e4l8Dr.js",revision:null},{url:"assets/linear-CtNhjlrM.js",revision:null},{url:"assets/index-DJPX60jz.css",revision:null},{url:"assets/index-CrhwkQ9k.js",revision:null},{url:"assets/ZenMode-C3S7FmYt.js",revision:null},{url:"assets/Strong-C0VDYprE.js",revision:null},{url:"assets/Stop-BWZOcpvU.js",revision:null},{url:"assets/Status-CO5w5a1E.js",revision:null},{url:"assets/SimpleMobileHeaderContent-Ja68XAJd.js",revision:null},{url:"assets/Settings-Ccrmh7u8.js",revision:null},{url:"assets/Service-CkHxNopv.js",revision:null},{url:"assets/Placeholder-BRnxNmKm.js",revision:null},{url:"assets/Picker-D-TjVZAI.js",revision:null},{url:"assets/Page-BMcxP_9m.js",revision:null},{url:"assets/NotFoundPage-UhXr10a9.js",revision:null},{url:"assets/NotFound-BozS7u6u.js",revision:null},{url:"assets/Nearby-BNDxZx1J.js",revision:null},{url:"assets/MingcuteAlertLine-CdthHQmK.js",revision:null},{url:"assets/Markdown-D5fQv556.js",revision:null},{url:"assets/LinkText-sdmJpshg.js",revision:null},{url:"assets/Line-6nd7KD0E.js",revision:null},{url:"assets/Home-C6T20k8G.js",revision:null},{url:"assets/ErrorMessage-CCAB4vXB.js",revision:null},{url:"assets/Divider-lz6Cf6K8.js",revision:null},{url:"assets/Debug-Q4Vy4lZ_.js",revision:null},{url:"assets/Alert-DfpdtaOB.js",revision:null},{url:"assets/AdminControls-T05hoDB-.js",revision:null},{url:"assets/About-DGmg1TM-.js",revision:null},{url:"pwa-192x192.png",revision:"8b590313fc6296f57d609982dc21f302"},{url:"pwa-512x512.png",revision:"e5560dba9f85e2959637abbb546643cd"},{url:"pwa-maskable-192x192.png",revision:"f1e5f837a116221b26c9cb9447db5e92"},{url:"pwa-maskable-512x512.png",revision:"9e859d049e78f70ddb5872a3bce2622b"},{url:"manifest.webmanifest",revision:"a39f5f893f233a6eed74e0ab828a668b"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html"),{denylist:[/^\/reset\/?$/]}))});
1
+ if(!self.define){let s,e={};const l=(l,n)=>(l=new URL(l+".js",n).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(n,i)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let u={};const o=s=>l(s,r),a={module:{uri:r},exports:u,require:o};e[r]=Promise.all(n.map(s=>a[s]||o(s))).then(s=>(i(...s),u))}}define(["./workbox-2fbc6a65"],function(s){"use strict";self.addEventListener("message",s=>{s.data&&"SKIP_WAITING"===s.data.type&&self.skipWaiting()}),s.precacheAndRoute([{url:"pwa-maskable-512x512.png",revision:"9e859d049e78f70ddb5872a3bce2622b"},{url:"pwa-maskable-192x192.png",revision:"f1e5f837a116221b26c9cb9447db5e92"},{url:"pwa-512x512.png",revision:"e5560dba9f85e2959637abbb546643cd"},{url:"pwa-192x192.png",revision:"8b590313fc6296f57d609982dc21f302"},{url:"mona-sans.woff2",revision:"b96cc834af467cf02885a067356abae7"},{url:"index.html",revision:"142f1d9c5b2249361fd1739d40838b87"},{url:"favicon.svg",revision:"570c2a249bbd511b386a843cd96545e7"},{url:"apple-touch-icon.png",revision:"d5d6ea39bc40ffd5b045b9593da0c890"},{url:"assets/workbox-window.prod.es5-Bd17z0YL.js",revision:null},{url:"assets/use-simple-headers-DM6VutL0.js",revision:null},{url:"assets/use-nav-exemptions-QtGbfEPT.js",revision:null},{url:"assets/use-foundational-data-BEVQRFj9.js",revision:null},{url:"assets/use-foda-synced-query-hrC70vJ_.js",revision:null},{url:"assets/use-api-Ft007Dfs.js",revision:null},{url:"assets/scope-B-e4l8Dr.js",revision:null},{url:"assets/linear-BiU4teCm.js",revision:null},{url:"assets/index-DOvczcZF.js",revision:null},{url:"assets/index-DJPX60jz.css",revision:null},{url:"assets/ZenMode-CXXD5IBd.js",revision:null},{url:"assets/Strong-C0VDYprE.js",revision:null},{url:"assets/Stop-hkgAICn9.js",revision:null},{url:"assets/Status-Bw3AMuJH.js",revision:null},{url:"assets/SimpleMobileHeaderContent-DJTkr_6C.js",revision:null},{url:"assets/Settings-Clz1x2Cr.js",revision:null},{url:"assets/Service-CjcKHFQZ.js",revision:null},{url:"assets/Placeholder-BRnxNmKm.js",revision:null},{url:"assets/Picker-di2TPJNV.js",revision:null},{url:"assets/Page-BMcxP_9m.js",revision:null},{url:"assets/NotFoundPage-qJ2To3wC.js",revision:null},{url:"assets/NotFound-D-nyY3X1.js",revision:null},{url:"assets/Nearby-BNDxZx1J.js",revision:null},{url:"assets/MingcuteAlertLine-CdthHQmK.js",revision:null},{url:"assets/Markdown-D5fQv556.js",revision:null},{url:"assets/LinkText-sdmJpshg.js",revision:null},{url:"assets/Line-ClqpaOxi.js",revision:null},{url:"assets/Home-hrGQ5RvQ.js",revision:null},{url:"assets/ErrorMessage-CCAB4vXB.js",revision:null},{url:"assets/Divider-lz6Cf6K8.js",revision:null},{url:"assets/Debug-5P9iSK2l.js",revision:null},{url:"assets/Alert-SQhECZag.js",revision:null},{url:"assets/AdminControls-DJo59RGN.js",revision:null},{url:"assets/About-BdSlO-kD.js",revision:null},{url:"pwa-192x192.png",revision:"8b590313fc6296f57d609982dc21f302"},{url:"pwa-512x512.png",revision:"e5560dba9f85e2959637abbb546643cd"},{url:"pwa-maskable-192x192.png",revision:"f1e5f837a116221b26c9cb9447db5e92"},{url:"pwa-maskable-512x512.png",revision:"9e859d049e78f70ddb5872a3bce2622b"},{url:"manifest.webmanifest",revision:"a39f5f893f233a6eed74e0ab828a668b"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html"),{denylist:[/^\/reset\/?$/]}))});
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=get-canonical-lines-serving-stop-config-func.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-canonical-lines-serving-stop-config-func.js","sourceRoot":"","sources":["../../../../config/types/get-canonical-lines-serving-stop-config-func.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- import{l as e}from"./use-nav-exemptions-QtGbfEPT.js";import{t}from"./NotFoundPage-UhXr10a9.js";function n(){return e(t,{afterConfirming:`frontend-version`})}export{n as default};
@@ -1 +0,0 @@
1
- import{_ as e,c as t,i as n,l as r,m as i,n as a,o,r as s,s as c}from"./use-nav-exemptions-QtGbfEPT.js";import{u as l}from"./use-api-BJomuYg6.js";import{n as u}from"./use-foundational-data-BEVQRFj9.js";import{_ as d,a as f,f as p,i as m,m as h,p as g,r as _}from"./index-CrhwkQ9k.js";import{t as v}from"./Page-BMcxP_9m.js";import{n as y,t as b}from"./SimpleMobileHeaderContent-Ja68XAJd.js";import{t as x}from"./NotFoundPage-UhXr10a9.js";import{t as S}from"./ErrorMessage-CCAB4vXB.js";import{t as C}from"./use-foda-synced-query-BM-OPAql.js";function w(e){return{hideMobileHeaderWhenScrolledToTop:!0,mobileHeader:r(b,{title:e.title,backHref:e.back?.href??null}),agnosticHeader:r(c,{class:`not-desktop:bg-bg-navbar not-desktop:border-b not-desktop:border-soft-border`,children:r(a,{children:r(c,{class:`not-desktop:px-4 desktop:mx-4 desktop:border-b desktop:border-soft-border`,children:r(s,{class:t(`gap-8`,{"pt-4 pb-6 desktop:pt-6":e.back!=null,"py-6 desktop:pt-8":e.back==null,"desktop:pb-4":e.additionalContent==null}),children:[e.back!=null&&r(p,{text:e.back.text,href:e.back.href,icon:y,class:`self-start`,layout:`narrow-icon`}),r(s,{class:`gap-4`,children:[r(n,{style:`megatitle`,children:e.title}),e.additionalContent]})]})})})})}}function T(e){return r(h,{class:t(e.class),children:r(n,{style:`strong`,dynamicColor:e.serviceColor,children:e.time})})}var E=3.5;function D(e){return r(s,{class:t(e.class,`h-14 min-w-0`),yAlign:`space-between`,children:[r(h,{xAlign:`space-between`,class:`gap-2 `,children:[r(h,{yAlign:`bottom`,class:`gap-1 shrink min-w-0`,children:[r(n,{style:`strong`,dynamicColor:e.departure.color,children:e.departure.primaryDestinationText}),r(n,{style:`small-narrow`,class:`shrink min-w-0`,dynamicColor:e.departure.color,oneLine:!0,children:`via Train Tracks`})]}),r(T,{time:e.departure.movement.time,formerTime:e.departure.movement.formerTime,serviceColor:e.departure.color})]}),r(h,{xAlign:`space-between`,yAlign:`bottom`,children:[r(s,{class:`gap-3 min-w-0 shrink`,children:[r(n,{style:`small-narrow`,oneLine:!0,children:`The stopping pattern goes here`}),r(h,{class:`gap-1`,children:[r(n,{style:`small-narrow-strong-success`,children:`Solid`}),r(n,{style:`small-narrow`,children:`•`}),r(n,{style:`small-narrow`,class:`shrink min-w-0`,oneLine:!0,children:`And then this row shows all sorts of stuff`})]})]}),r(s,{yAlign:`space-between`,class:`border-2 px-1.5 py-1 border-soft-border rounded-sm -mb-0.5 h-8.5`,children:[r(n,{style:`tiny-narrow`,align:`center`,children:`Platform`}),r(n,{style:`strong`,align:`center`,children:`X`})]})]})]})}function O(e){return r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:r(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9.343 6.343L15 12l-5.657 5.657`})})}var k=E+2;function A(e){return r(g,{class:t(e.class),href:j(e.departure),children:r(c,{class:`grid-cols-[1fr_auto] p-4 items-center pr-2 gap-2`,children:[r(D,{departure:e.departure}),r(O,{class:`text-icon-lg text-fg`})]})})}function j(e){return`/service/${encodeURIComponent(e.sourceId)}/${encodeURIComponent(e.intrasourceId)}?from=${encodeURIComponent(e.movement.index.toString())}`}function M(e){return r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:r(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M11 20H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v4H4m12-7v2M8 4v2m12.121 9.879L18 18m0 0l-2.121 2.121M18 18l-2.121-2.121M18 18l2.121 2.121`})})}function N(e){let{pluralServicesTerm:n}=f();return e.loading?r(P,{class:e.class,queryCount:e.queryCount,centerContent:!0,children:r(d,{})}):e.hadError?r(P,{class:t(e.class,`gap-2`),queryCount:e.queryCount,centerContent:!0,children:r(S,{text:`An error occurred while retrieving departures`})}):e.departures.length===0?r(P,{class:e.class,queryCount:e.queryCount,centerContent:!0,children:r(S,{text:`No ${n} scheduled`,icon:M})}):r(P,{class:e.class,queryCount:e.queryCount,children:e.departures.map((t,n)=>r(c,{class:`relative`,children:[r(A,{departure:t}),n<e.queryCount-1&&r(`hr`,{class:`border-soft-border absolute bottom-0 left-0 right-0 mx-4`})]},F(t)))})}function P(e){let t=e.centerContent??!1;return r(s,{class:e.class,xAlign:t?`center`:`stretch`,yAlign:t?`center`:`top`,dynamicMinHeightRem:k*e.queryCount,children:e.children})}function F(e){return`${e.sourceId}/${e.intrasourceId}/${e.movement.index}`}function I(e){return r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:r(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m4 20l5-5m0 0l3.956 3.956a1 1 0 0 0 1.626-.314l2.255-5.261a1 1 0 0 1 .548-.535l3.207-1.283a1 1 0 0 0 .336-1.635l-6.856-6.856a1 1 0 0 0-1.635.336l-1.283 3.207a1 1 0 0 1-.535.548L5.358 9.418a1 1 0 0 0-.314 1.626z`})})}function L(e){return r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:r(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 20H4v-5m0 5l6.5-6.5M15 4h5v5m0-5l-6.5 6.5`})})}function R(e){return r(s,{class:t(e.class,`min-w-0`),children:[r(h,{xAlign:`space-between`,yAlign:`center`,class:`gap-2 not-desktop:pl-4 not-desktop:pr-2 not-desktop:pt-6 pb-2`,children:[r(n,{style:`subtitle`,class:`shrink min-w-0`,oneLine:!0,children:e.feed.query.title}),r(h,{class:`gap-2`,children:[r(p,{theme:`hover`,icon:I}),r(p,{theme:`hover`,icon:L})]})]}),r(N,{class:`bg-bg-raised desktop:border not-desktop:border-y border-soft-border desktop:rounded-lg overflow-hidden box-content`,departures:e.feed.departures,queryCount:e.feed.query.count,loading:e.feed.loading,hadError:e.feed.hadError})]})}function z(e){return r(c,{class:t(e.class,`desktop:grid-cols-[1fr_1fr] desktop:gap-6 desktop:px-4 desktop:py-8`),children:e.feeds.map((e,t)=>r(R,{feed:e,class:`not-desktop:last:-mb-px`},t))})}function B(e){return r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:r(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M17.657 9.343L12 15L6.343 9.343`})})}function V(e){return r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:r(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 7v5l3 3m6-3a9 9 0 1 1-18 0a9 9 0 0 1 18 0`})})}function H(e){return r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:r(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19.5 4h-15a.5.5 0 0 0-.5.5v2.086a1 1 0 0 0 .293.707L10 13v5.691a.5.5 0 0 0 .276.447L14 21v-8l5.707-5.707A1 1 0 0 0 20 6.586V4.5a.5.5 0 0 0-.5-.5Z`})})}function U(e){return r(c,{class:`desktop:pt-6 desktop:px-4`,children:r(c,{class:t(e.class,`grid-cols-[1fr_1fr] desktop:max-w-150 bg-bg-raised divide-x divide-soft-border desktop:border not-desktop:border-b border-soft-border desktop:rounded-lg overflow-hidden`),children:[r(g,{children:r(h,{xAlign:`space-between`,yAlign:`center`,class:`p-4`,children:[r(h,{yAlign:`center`,class:`gap-2`,children:[r(_,{heightRem:o(`text-md`),children:r(V,{class:`text-icon-lg text-fg`})}),r(n,{children:`Now`})]}),r(_,{heightRem:o(`text-md`),children:r(B,{class:`text-icon-lg text-fg`})})]})}),r(g,{children:r(h,{xAlign:`space-between`,yAlign:`center`,class:`p-4`,children:[r(h,{yAlign:`center`,class:`gap-2`,children:[r(_,{heightRem:o(`text-md`),children:r(H,{class:`text-icon-lg text-fg`})}),r(n,{children:`All trains`})]}),r(_,{heightRem:o(`text-md`),children:r(B,{class:`text-icon-lg text-fg`})})]})})]})})}function W(){let{params:{id:t}}=i(),{foda:n}=u(),a=e(()=>n.stops.getByUrlPath(t??``),[n.stops,t]);return a==null?r(x,{afterConfirming:`foundational-data-version`}):r(G,{stop:a},a.id)}function G(t){let{data:n,loading:i,error:a}=C(l,{stopId:t.stop.id,count:5}),o=e(()=>[{query:{title:`Citybound trains`,count:5},departures:n?.departures??[],loading:i,hadError:a!=null},{query:{title:`Outbound trains`,count:5},departures:n?.departures??[],loading:i,hadError:a!=null}],[n?.departures,i,a]);return r(v,{...w({title:t.stop.name,back:{href:`/`,text:`Home`},additionalContent:r(m,{lineIds:t.stop.canonicalLinesServingStop,withLinks:!0})}),children:r(s,{children:[r(U,{}),r(z,{feeds:o})]})})}export{W as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/About-DGmg1TM-.js","assets/use-nav-exemptions-QtGbfEPT.js","assets/use-api-BJomuYg6.js","assets/use-foundational-data-BEVQRFj9.js","assets/Placeholder-BRnxNmKm.js","assets/Markdown-D5fQv556.js","assets/LinkText-sdmJpshg.js","assets/Strong-C0VDYprE.js","assets/Page-BMcxP_9m.js","assets/use-simple-headers-Cbv0t_De.js","assets/SimpleMobileHeaderContent-Ja68XAJd.js","assets/Divider-lz6Cf6K8.js","assets/Alert-DfpdtaOB.js","assets/MingcuteAlertLine-CdthHQmK.js","assets/AdminControls-T05hoDB-.js","assets/Debug-Q4Vy4lZ_.js","assets/Home-C6T20k8G.js","assets/Nearby-BNDxZx1J.js","assets/Service-CkHxNopv.js","assets/linear-CtNhjlrM.js","assets/scope-B-e4l8Dr.js","assets/ErrorMessage-CCAB4vXB.js","assets/use-foda-synced-query-BM-OPAql.js","assets/Settings-Ccrmh7u8.js","assets/Picker-D-TjVZAI.js","assets/Status-CO5w5a1E.js","assets/ZenMode-C3S7FmYt.js","assets/Stop-BWZOcpvU.js","assets/NotFoundPage-UhXr10a9.js","assets/Line-6nd7KD0E.js","assets/NotFound-BozS7u6u.js"])))=>i.map(i=>d[i]);
2
- import{C as e,S as t,T as n,_ as r,b as i,c as a,d as o,f as s,g as c,h as l,i as u,l as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v,v as y,w as b,x as ee,y as x}from"./use-nav-exemptions-QtGbfEPT.js";import{a as te,c as ne,f as re,g as ie,h as ae,m as S,n as oe,p as C,r as se,s as ce,t as le}from"./use-api-BJomuYg6.js";import{n as w,t as ue}from"./use-foundational-data-BEVQRFj9.js";import{n as de,t as T}from"./scope-B-e4l8Dr.js";import{t as fe}from"./LinkText-sdmJpshg.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var pe=n.__b;n.__b=e=>{e.type&&e.type._forwarded&&e.ref&&(e.props.ref=e.ref,e.ref=null),pe&&pe(e)};function E(e){let t,n,r=()=>e().then(e=>n=e&&e.default||e),i=e=>{let[,i]=y(0),a=c(n);if(t||=r(),n!==void 0)return b(n,e);throw a.current||=t.then(()=>i(1)),t};return i.preload=()=>(t||=r(),t),i._forwarded=!0,i}var D=n.__e;n.__e=(e,t,n)=>{if(e&&e.then){let r=t;for(;r=r.__;)if(r.__c&&r.__c.__c)return t.__e??(t.__c.__z=[n.__e],t.__e=n.__e,t.__k=n.__k),t.__k||=[],r.__c.__c(e,t)}D&&D(e,t,n)};function me(e){return this.__c=he,this.componentDidCatch=e.onError,e.children}function he(e){e.then(()=>this.forceUpdate())}var ge=`modulepreload`,_e=function(e){return`/`+e},ve={},ye=function(e){return e.pathname.endsWith(`.css`)},be=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},O=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=_e(t,n);let r=s(t),i=ye(r);return be(ve,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:ge,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},k=t(null);function A(){let e=i(k);if(e==null)throw Error(`Static data unavailable outside provider.`);return e}function xe(e){let{Provider:t}=k,n=r(()=>Se(document),[]);return d(t,{value:n,children:e.children})}function Se(e){function t(t){let n=e.querySelector(t);if(n==null)throw Error(`${t} tag not found.`);let r=n.getAttribute(`content`);if(r==null)throw Error(`${t} tag was empty.`);return r}return{appName:t(`meta[name="corequery-app-name"]`),frontendVersion:t(`meta[name="corequery-frontend-version"]`),versionsOnLastUpdate:{corequeryPackageVersion:t(`meta[name="corequery-package-version-on-last-update"]`),serverVersion:t(`meta[name="corequery-server-version-on-last-update"]`)}}}var j=class{_array;_map;constructor(e){this._array=e,this._map=new Map(e.map(e=>[this._getID(e),e]))}all(){return this._array}get(e){return this._map.get(e)??null}require(e){let t=this.get(e);if(t==null)throw this._getRequireFailError(e);return t}has(e){return this._map.has(e)}map(e){return this._array.map(e)}filter(e){return this._array.filter(e)}first(e){return this._array.find(e)??null}requireFirst(e){let t=this.first(e);if(t==null)throw this._getPredicateFailError();return t}},Ce=class extends j{_getID(e){return e.id}_getRequireFailError(e){return Error(`No stop with ID #${e}.`)}_getPredicateFailError(){return Error(`No matching stop.`)}getByUrlPath(e){return this.first(t=>t.urlPath===e)}},we=class extends j{_getID(e){return e.id}_getRequireFailError(e){return Error(`No line with ID #${e}.`)}_getPredicateFailError(){return Error(`No matching line.`)}getByUrlPath(e){return this.first(t=>t.urlPath===e)}},M=class e{_obj;stops;lines;constructor(e){this._obj=e,this.stops=new Ce(e.stops),this.lines=new we(e.lines)}static json=ne.transform(t=>new e(t));get hash(){return this._obj.metadata.hash}get fodaApiVersion(){return this._obj.metadata.fodaApiVersion}get serverVersion(){return this._obj.metadata.serverVersion}get footerPrimaryMarkdown(){return this._obj.footer.primaryMarkdown}get terminology(){return this._obj.terminology}get landingPage(){return this._obj.landingPage}},N=`corequery-local-cache`;function Te(e,t){let n=x(async()=>{try{let n=await(await caches.open(N)).match(P(e));return n==null?null:t.parse(await n.json())}catch(t){return console.warn(`Failed to parse "${e}" in browser cache.`,t),null}},[e,t]),i=x(async t=>{try{await(await caches.open(N)).put(P(e),Response.json(t))}catch(t){console.warn(`Failed to write "${e}" to browser cache.`,t)}},[e]);return r(()=>({get:n,set:i}),[n,i])}function P(e){return new URL(`/corequery-local-cache/${encodeURIComponent(e)}.json`,window.location.origin).href}var Ee={default:`text-icon-lg text-fg-weak`,large:`text-icon-xl text-fg-weak`};function F(e){return d(`svg`,{className:a(`_loading-spinner`,Ee[e.style??`default`],e.class),xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`,role:`img`,children:[d(`title`,{children:`Loading spinner`}),d(`circle`,{cx:`4`,cy:`4`,r:`2`,fill:`currentColor`}),d(`circle`,{cx:`12`,cy:`4`,r:`2`,fill:`currentColor`}),d(`circle`,{cx:`12`,cy:`12`,r:`2`,fill:`currentColor`}),d(`circle`,{cx:`4`,cy:`12`,r:`2`,fill:`currentColor`})]})}function I(e){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:d(`g`,{fill:`none`,children:[d(`path`,{d:`m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z`}),d(`path`,{fill:`currentColor`,d:`M20 9a1 1 0 0 1 1 1v1a8 8 0 0 1-8 8H9.414l.793.793a1 1 0 0 1-1.414 1.414l-2.496-2.496a1 1 0 0 1-.287-.567L6 17.991a1 1 0 0 1 .237-.638l.056-.06l2.5-2.5a1 1 0 0 1 1.414 1.414L9.414 17H13a6 6 0 0 0 6-6v-1a1 1 0 0 1 1-1m-4.793-6.207l2.5 2.5a1 1 0 0 1 0 1.414l-2.5 2.5a1 1 0 1 1-1.414-1.414L14.586 7H11a6 6 0 0 0-6 6v1a1 1 0 1 1-2 0v-1a8 8 0 0 1 8-8h3.586l-.793-.793a1 1 0 0 1 1.414-1.414`})]})})}function L(e){let t=a(`grid not-disabled:cursor-pointer select-none`,e.class);return e.onClick==null&&e.href!=null&&!(e.disabled??!1)?d(`a`,{class:t,href:e.href,onClick:e.onHrefClick,children:e.children}):d(`button`,{class:t,onClick:e.onClick,disabled:e.disabled,children:e.children})}var De={left:`justify-start`,center:`justify-center`,right:`justify-end`,"space-between":`justify-between`},Oe={top:`items-start`,center:`items-center`,bottom:`items-end`,stretch:`items-stretch`};function R(e){let t=e.as??`div`,n=De[e.xAlign??`left`],r=Oe[e.yAlign??`stretch`];return d(t,{class:a(`flex flex-row`,n,r,{"flex-wrap":e.wrap},e.class),children:e.children})}function z(e){return d(g,{class:a(`relative`,e.class),children:[d(g,{class:a({invisible:e.loading}),children:e.children}),e.loading&&d(R,{class:`absolute top-0 left-0 right-0 bottom-0`,xAlign:`center`,yAlign:`center`,children:d(F,{})})]})}var ke=a([`relative`,`group`,`not-disabled:[--color-fg:var(--color-on-accent)]`,`not-disabled:[--color-fg-strong:var(--color-on-accent)]`,`not-disabled:[--color-fg-weak:var(--color-on-accent)]`,`disabled:[--color-fg:var(--color-fg-weak)]`,`disabled:[--color-fg-strong:var(--color-fg-weak)]`]),Ae=a([`absolute`,`z-0`,`top-0`,`bottom-0`,`left-0`,`right-0`,`group-not-disabled:bg-accent`,`group-not-disabled:group-hover:bg-accent-hover`,`group-not-disabled:group-active:bg-accent-active`,`border`,`group-not-disabled:border-transparent`,`group-disabled:border-soft-border-disabled`]);function je(e){let t=e.rounded??!0;return d(L,{class:a(e.class,ke),onClick:e.onClick,href:e.href,onHrefClick:e.onHrefClick,disabled:(e.disabled??!1)||(e.loading??!1),children:[d(`div`,{class:a(Ae,{"rounded-sm":t})}),d(z,{class:`z-1`,loading:e.loading??!1,children:e.children})]})}function Me(e){return d(R,{class:a(e.class,`gap-2 h-8`,{"px-4":e.text!=null,"min-w-8":e.text==null}),yAlign:`center`,xAlign:`center`,children:[e.icon!=null&&d(e.icon,{class:`text-fg text-icon-lg`}),e.text!=null&&d(u,{children:e.text})]})}var Ne=a([`relative`,`group`,`disabled:[--color-fg:var(--color-fg-weak)]`,`disabled:[--color-fg-strong:var(--color-fg-weak)]`]),Pe=a([`absolute`,`z-0`,`top-0`,`bottom-0`,`left-0`,`right-0`,`rounded-sm`,`group-not-disabled:bg-soft`,`group-not-disabled:group-hover:bg-soft-hover`,`group-not-disabled:group-active:bg-soft-active`,`border`,`group-not-disabled:border-transparent`,`group-disabled:border-soft-border-disabled`]);function Fe(e){return d(L,{class:a(e.class,Ne),onClick:e.onClick,href:e.href,onHrefClick:e.onHrefClick,disabled:(e.disabled??!1)||(e.loading??!1),children:[d(`div`,{class:Pe}),d(z,{class:`z-1`,loading:e.loading??!1,children:e.children})]})}var Ie=a([`relative`,`group`,`disabled:[--color-fg:var(--color-fg-weak)]`,`disabled:[--color-fg-strong:var(--color-fg-weak)]`]),Le=a([`absolute`,`z-0`,`top-0`,`bottom-0`,`left-0`,`right-0`,`rounded-sm`,`group-not-disabled:bg-transparent`,`group-not-disabled:group-hover:bg-soft-hover`,`group-not-disabled:group-active:bg-soft-active`,`border`,`group-not-disabled:border-soft-border`,`group-disabled:border-soft-border-disabled`]);function Re(e){return d(L,{class:a(e.class,Ie),onClick:e.onClick,href:e.href,onHrefClick:e.onHrefClick,disabled:(e.disabled??!1)||(e.loading??!1),children:[d(`div`,{class:Le}),d(z,{class:`z-1`,loading:e.loading??!1,children:e.children})]})}var ze=a([`relative`,`group`,`disabled:[--color-fg:var(--color-fg-weak)]`,`disabled:[--color-fg-strong:var(--color-fg-weak)]`]),Be=a([`absolute`,`z-0`,`top-0`,`bottom-0`,`left-0`,`right-0`,`rounded-sm`,`group-not-disabled:bg-transparent`,`group-not-disabled:group-hover:bg-soft-hover`,`group-not-disabled:group-active:bg-soft-active`]);function B(e){return d(L,{class:a(e.class,ze),onClick:e.onClick,href:e.href,onHrefClick:e.onHrefClick,disabled:(e.disabled??!1)||(e.loading??!1),children:[d(`div`,{class:Be}),d(z,{class:`z-1`,loading:e.loading??!1,children:e.children})]})}var Ve=a([`relative`,`group`,`disabled:[--color-fg:var(--color-fg-weak)]`,`disabled:[--color-fg-strong:var(--color-fg-weak)]`]),He=a([`absolute`,`z-0`,`top-0`,`bottom-0`,`left-0`,`right-0`,`group-not-disabled:bg-transparent`,`group-not-disabled:group-hover:bg-soft-hover`,`group-not-disabled:group-active:bg-soft-active`]);function V(e){return d(L,{class:a(e.class,Ve),onClick:e.onClick,href:e.href,onHrefClick:e.onHrefClick,disabled:(e.disabled??!1)||(e.loading??!1),children:[d(`div`,{class:He}),d(z,{class:`z-1`,loading:e.loading??!1,children:e.children})]})}function H(e){let t=e.outerPadding??!1;return d(R,{class:a(e.class,`gap-2 min-w-0 py-2`,{"px-4":e.text!=null,"min-w-8":e.text==null,"min-h-10":!t,"min-h-12":t}),yAlign:`center`,children:[e.icon!=null&&d(e.icon,{class:`text-fg text-icon-lg`}),e.text!=null&&d(u,{class:`shrink min-w-0`,children:e.text})]})}var Ue=a([`relative`,`group`,`not-disabled:[--color-fg:var(--color-on-error)]`,`not-disabled:[--color-fg-strong:var(--color-on-error)]`,`not-disabled:[--color-fg-weak:var(--color-on-error)]`,`disabled:[--color-fg:var(--color-fg-weak)]`,`disabled:[--color-fg-strong:var(--color-fg-weak)]`]),We=a([`absolute`,`z-0`,`top-0`,`bottom-0`,`left-0`,`right-0`,`rounded-sm`,`group-not-disabled:bg-error`,`group-not-disabled:group-hover:bg-error-hover`,`group-not-disabled:group-active:bg-error-active`,`border`,`group-not-disabled:border-transparent`,`group-disabled:border-soft-border-disabled`]);function Ge(e){return d(L,{class:a(e.class,Ue),onClick:e.onClick,href:e.href,onHrefClick:e.onHrefClick,disabled:(e.disabled??!1)||(e.loading??!1),children:[d(`div`,{class:We}),d(z,{class:`z-1`,loading:e.loading??!1,children:e.children})]})}var Ke=a([`relative`,`group`,`not-disabled:[--color-fg:var(--color-on-warning)]`,`not-disabled:[--color-fg-strong:var(--color-on-warning)]`,`not-disabled:[--color-fg-weak:var(--color-on-warning)]`,`disabled:[--color-fg:var(--color-fg-weak)]`,`disabled:[--color-fg-strong:var(--color-fg-weak)]`]),qe=a([`absolute`,`z-0`,`top-0`,`bottom-0`,`left-0`,`right-0`,`rounded-sm`,`group-not-disabled:bg-warning`,`group-not-disabled:group-hover:bg-warning-hover`,`group-not-disabled:group-active:bg-warning-active`,`border`,`group-not-disabled:border-transparent`,`group-disabled:border-soft-border-disabled`]);function Je(e){return d(L,{class:a(e.class,Ke),onClick:e.onClick,href:e.href,onHrefClick:e.onHrefClick,disabled:(e.disabled??!1)||(e.loading??!1),children:[d(`div`,{class:qe}),d(z,{class:`z-1`,loading:e.loading??!1,children:e.children})]})}var Ye=a([`relative`,`group`,`not-disabled:[--color-fg:var(--color-on-success)]`,`not-disabled:[--color-fg-strong:var(--color-on-success)]`,`not-disabled:[--color-fg-weak:var(--color-on-success)]`,`disabled:[--color-fg:var(--color-fg-weak)]`,`disabled:[--color-fg-strong:var(--color-fg-weak)]`]),Xe=a([`absolute`,`z-0`,`top-0`,`bottom-0`,`left-0`,`right-0`,`rounded-sm`,`group-not-disabled:bg-success`,`group-not-disabled:group-hover:bg-success-hover`,`group-not-disabled:group-active:bg-success-active`,`border`,`group-not-disabled:border-transparent`,`group-disabled:border-soft-border-disabled`]);function Ze(e){return d(L,{class:a(e.class,Ye),onClick:e.onClick,href:e.href,onHrefClick:e.onHrefClick,disabled:(e.disabled??!1)||(e.loading??!1),children:[d(`div`,{class:Xe}),d(z,{class:`z-1`,loading:e.loading??!1,children:e.children})]})}function Qe(e){return d(R,{class:a(e.class,`gap-2 h-8 pl-2 pr-3`),yAlign:`center`,xAlign:`center`,children:[e.icon!=null&&d(e.icon,{class:`text-fg text-icon-lg`}),e.text!=null&&d(u,{children:e.text})]})}var $e={default:Fe,accent:je,outlined:Re,hover:B,"hover-square":V,error:Ge,warning:Je,success:Ze},et={simple:Me,"menu-item":H,"narrow-icon":Qe};function U(e){let t=$e[e.theme??`default`],n=et[e.layout??`simple`];return d(t,{class:e.class,onClick:e.onClick,href:e.href,onHrefClick:e.onHrefClick,disabled:e.disabled,loading:e.loading,children:d(n,{icon:e.icon,text:e.text})})}function tt(e){let{appName:t}=A();return d(g,{class:`w-svw h-svh items-center justify-center`,children:d(h,{class:`gap-12`,xAlign:`center`,children:[d(h,{class:`gap-6`,xAlign:`center`,children:[d(`img`,{class:`w-24 h-24`,src:`/favicon.svg`}),d(u,{style:`title`,children:t})]}),e.error?d(h,{class:`gap-4`,xAlign:`center`,children:[d(u,{children:`An error occurred while loading foundational data`}),d(U,{text:`Retry`,icon:I,onClick:e.onRetry})]}):d(F,{style:`large`})]})})}var W=t(null);function G(){let e=i(W);if(e==null)throw Error(`Settings unavailable outside provider.`);return e}var K=ce,nt=ae([S({result:C(`outdated`),foundationalData:ie()}),S({result:C(`up-to-date`)})]),rt=`corequery-foundational-data`,it=2e3;function at(e){let{Provider:t}=ue,{revalidateSettings:n}=G(),i=Te(rt,M.json),[a,o]=y(null),[s,c]=y(!1),u=x(e=>{o(e),n(e)},[n]),f=x(async e=>{let t=M.json.parse(e);return u(t),await i.set(e),t.hash},[u,i]),p=x(async()=>{let e=await q(null,null);if(e.result===`up-to-date`)throw Error();return await f(e.foundationalData)},[f]),m=x(()=>{c(!1),ot({getCachedData:async()=>await i.get(),onFreshFoda:async e=>await f(e),onUseCachedFoda:e=>u(e),onFailure:()=>c(!0)})},[i,f,u]);l(()=>{m()},[m]);let h=r(()=>a==null?null:{foda:a,forceFodaUpdate:p},[a,p]);return h==null?d(tt,{error:s,onRetry:m}):d(t,{value:h,children:e.children})}async function ot({getCachedData:e,onFreshFoda:t,onUseCachedFoda:n,onFailure:r}){let i=await e();if(i!=null)try{let e=await q(i.hash,it);e.result===`up-to-date`?n(i):await t(e.foundationalData)}catch(e){console.warn(`Foundational data refresh failed - using cache.`,e),n(i)}else try{let e=await q(null,null);if(e.result===`up-to-date`)throw Error();await t(e.foundationalData)}catch{r()}}async function q(e,t){let n=await fetch(`/api${K.path}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({hash:e}),signal:t==null?void 0:AbortSignal.timeout(t)});if(!n.ok){let e=await n.text();throw Error(`Error ${n.status} calling /api${K.path}: ${e}`)}return nt.parse(await n.json())}var J=class e{theme;constructor(e){this.theme=e.theme}static default=new e({theme:`auto`});static json=S({version:C(1),theme:re([`dark`,`light`,`auto`]).optional()}).transform(t=>new e({theme:t.theme??e.default.theme}));with(t){return new e({...this,...t})}toJson(){return{version:1,theme:this.theme}}validate(e){return this}equals(e){return se(this.toJson(),e.toJson())}},st=[`auto`,`light`,`dark`];function ct(){window.applyTheme?.()}function lt(e,t){let n=x(()=>{try{let n=localStorage.getItem(e);return n==null?null:t.parse(JSON.parse(n))}catch{return console.warn(`Failed to parse "${e}" in local storage.`),null}},[e,t]),i=x(t=>{try{let n=JSON.stringify(t);localStorage.setItem(e,n)}catch(t){console.warn(`Failed to write "${e}" to local storage.`,t)}},[e]);return r(()=>({get:n,set:i}),[n,i])}function ut(e){let{Provider:t}=W,n=lt(`corequery-settings`,J.json),[i,a]=y(()=>n.get()??(console.warn(`Failed to load settings, using defaults.`),J.default)),o=x((e,t)=>{a(r=>{let i=e(r);return(t?.persist??!0)&&n.set(i.toJson()),i}),ct()},[n]),s=x(e=>{o(t=>{let n=t.validate(e);return n.equals(t)||console.warn(`Settings updated due to foundational data changes.`),n},{persist:!1})},[o]),c=r(()=>({settings:i,updateSettings:o,revalidateSettings:s}),[i,o,s]);return d(t,{value:c,children:e.children})}function dt(e){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:d(`g`,{fill:`none`,fillRule:`evenodd`,children:[d(`path`,{d:`m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z`}),d(`path`,{fill:`currentColor`,d:`m13.414 2.807l7.778 7.779a2 2 0 0 1 0 2.828l-7.778 7.778a2 2 0 0 1-2.828 0l-7.778-7.778a2 2 0 0 1 0-2.828l7.778-7.779a2 2 0 0 1 2.828 0M12.002 15a1 1 0 0 0-.119 1.993l.12.007a1 1 0 0 0 0-2ZM12 8a1.44 1.44 0 0 0-1.44 1.485l.01.135l.438 3.504a1 1 0 0 0 1.964.113l.02-.113l.438-3.504A1.44 1.44 0 0 0 12 8`})]})})}function Y(e){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:d(`g`,{fill:`none`,children:[d(`path`,{d:`m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z`}),d(`path`,{fill:`currentColor`,d:`m13.414 2.808l7.778 7.778a2 2 0 0 1 0 2.829l-7.778 7.778a2 2 0 0 1-2.828 0l-7.778-7.778a2 2 0 0 1 0-2.829l7.778-7.778a2 2 0 0 1 2.828 0M12 4.222L4.222 12L12 19.78L19.778 12zM12.002 15a1 1 0 0 1 .117 1.993l-.117.007a1 1 0 0 1-.119-1.993zM12 8c.867 0 1.538.76 1.43 1.62l-.438 3.504a1 1 0 0 1-1.984 0L10.57 9.62A1.44 1.44 0 0 1 12 8`})]})})}function ft(e){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:d(`g`,{fill:`none`,children:[d(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),d(`path`,{fill:`currentColor`,d:`M13.2 2.65a2 2 0 0 0-2.4 0l-7 5.25A2 2 0 0 0 3 9.5V19a2 2 0 0 0 2 2h3.9a1.1 1.1 0 0 0 1.1-1.1V15a2 2 0 1 1 4 0v4.9a1.1 1.1 0 0 0 1.1 1.1H19a2 2 0 0 0 2-2V9.5a2 2 0 0 0-.8-1.6z`})]})})}function X(e){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:d(`g`,{fill:`none`,fillRule:`evenodd`,children:[d(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),d(`path`,{fill:`currentColor`,d:`M10.8 2.65a2 2 0 0 1 2.4 0l7 5.25a2 2 0 0 1 .8 1.6V19a2 2 0 0 1-2 2h-4.9a1.1 1.1 0 0 1-1.1-1.1V14a1 1 0 1 0-2 0v5.9A1.1 1.1 0 0 1 9.9 21H5a2 2 0 0 1-2-2V9.5a2 2 0 0 1 .8-1.6zm1.2 1.6L5 9.5V19h4v-5a3 3 0 1 1 6 0v5h4V9.5z`})]})})}function pt(e){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:d(`g`,{fill:`none`,fillRule:`evenodd`,children:[d(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),d(`path`,{fill:`currentColor`,d:`M7 7a5 5 0 1 1 6 4.9V17a1 1 0 1 1-2 0v-5.1A5 5 0 0 1 7 7m2.489 9.1a1 1 0 0 1-.838 1.14c-1.278.195-2.293.489-2.96.815c-.335.164-.534.313-.637.422l-.021.023c.033.039.09.096.19.169c.28.207.749.435 1.418.644C7.968 19.728 9.863 20 12 20s4.032-.272 5.359-.687c.67-.209 1.138-.437 1.418-.644c.1-.073.157-.13.19-.169l-.021-.023c-.103-.109-.302-.258-.637-.422c-.667-.326-1.682-.62-2.96-.815a1 1 0 1 1 .301-1.977c1.388.21 2.622.547 3.539.996c.457.224.884.5 1.208.842c.33.347.603.82.603 1.399c0 .811-.524 1.4-1.034 1.777c-.53.392-1.233.702-2.01.945c-1.57.49-3.674.778-5.956.778s-4.387-.288-5.955-.778c-.778-.243-1.48-.553-2.01-.945C3.524 19.9 3 19.311 3 18.5c0-.58.273-1.052.603-1.4c.325-.342.751-.617 1.208-.84c.917-.45 2.152-.786 3.538-.997a1 1 0 0 1 1.14.838Z`})]})})}function mt(e){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:d(`g`,{fill:`none`,fillRule:`evenodd`,children:[d(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),d(`path`,{fill:`currentColor`,d:`M12 4a3 3 0 1 0 0 6a3 3 0 0 0 0-6M7 7a5 5 0 1 1 6 4.9V17a1 1 0 1 1-2 0v-5.1A5 5 0 0 1 7 7m2.489 9.1a1 1 0 0 1-.838 1.14c-1.278.194-2.293.489-2.96.815c-1.22.597.206 1.026.95 1.258C7.968 19.728 9.863 20 12 20s4.032-.272 5.359-.687c.749-.234 2.17-.66.95-1.258c-.667-.326-1.682-.62-2.96-.815a1 1 0 1 1 .301-1.977c1.388.21 2.622.547 3.539.996c.884.433 1.811 1.162 1.811 2.241c0 .811-.524 1.4-1.034 1.777C17.816 21.865 14.536 22 12 22c-2.282 0-4.387-.288-5.955-.778C4.795 20.832 3 20.062 3 18.5c0-1.08.927-1.808 1.811-2.24c.917-.45 2.152-.786 3.538-.997a1 1 0 0 1 1.14.838Z`})]})})}function ht(e){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:d(`g`,{fill:`none`,children:[d(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),d(`path`,{fill:`currentColor`,d:`M20 18a1 1 0 0 1 .117 1.993L20 20H4a1 1 0 0 1-.117-1.993L4 18zm0-7a1 1 0 1 1 0 2H4a1 1 0 1 1 0-2zm0-7a1 1 0 1 1 0 2H4a1 1 0 0 1 0-2z`})]})})}function gt(e){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:d(`g`,{fill:`none`,fillRule:`evenodd`,children:[d(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),d(`path`,{fill:`currentColor`,d:`M5 10a5 5 0 1 1 10 0a5 5 0 0 1-10 0m5-7a7 7 0 1 0 4.192 12.606l5.1 5.101a1 1 0 0 0 1.415-1.414l-5.1-5.1A7 7 0 0 0 10 3`})]})})}function _t(e){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:d(`g`,{fill:`none`,fillRule:`evenodd`,children:[d(`path`,{d:`m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z`}),d(`path`,{fill:`currentColor`,d:`M5 5a1 1 0 0 0-2 0v14a1 1 0 0 0 1 1h16a1 1 0 1 0 0-2H5zm4 7a1 1 0 1 0-2 0v3a1 1 0 1 0 2 0zm3-6a1 1 0 0 1 1 1v8a1 1 0 1 1-2 0V7a1 1 0 0 1 1-1m5 4a1 1 0 1 0-2 0v5a1 1 0 1 0 2 0z`})]})})}function vt(e){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:d(`g`,{fill:`none`,fillRule:`evenodd`,children:[d(`path`,{d:`m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z`}),d(`path`,{fill:`currentColor`,d:`M12 2a1 1 0 0 1 1 1v1.062a8 8 0 0 1 2.104.562l.53-.918a1 1 0 1 1 1.732 1l-.531.92c.58.44 1.098.959 1.54 1.54l.92-.532a1 1 0 1 1 1 1.732l-.92.53c.279.661.471 1.367.563 2.104H21a1 1 0 1 1 0 2h-1.062a8 8 0 0 1-.562 2.104l.918.53a1 1 0 1 1-1 1.732l-.92-.531a8 8 0 0 1-1.54 1.54l.532.92a1 1 0 1 1-1.732 1l-.53-.92a8 8 0 0 1-2.104.563V21a1 1 0 1 1-2 0v-1.062a8 8 0 0 1-2.104-.562l-.53.918a1 1 0 1 1-1.732-1l.531-.92a8 8 0 0 1-1.54-1.54l-.92.532a1 1 0 1 1-1-1.732l.92-.53A8 8 0 0 1 4.061 13H3a1 1 0 1 1 0-2h1.062a8 8 0 0 1 .562-2.104l-.918-.53a1 1 0 0 1 1-1.732l.92.531c.44-.58.959-1.098 1.54-1.54l-.532-.92a1 1 0 0 1 1.732-1l.53.92A8 8 0 0 1 11 4.061V3a1 1 0 0 1 1-1m0 11.155l-4.624 2.67a6 6 0 0 0 1.588 1.351l.073.043A6 6 0 0 0 12 18c.97 0 1.886-.23 2.697-.639l.34-.185a6 6 0 0 0 1.587-1.352zm-1-7.072a6 6 0 0 0-1.703.559l-.26.14l-.073.042a6 6 0 0 0-1.978 1.88l-.162.26l-.042.073A6 6 0 0 0 6 12c0 .63.097 1.24.278 1.81l.097.283L11 11.423zm2 0v5.34l4.625 2.67A6 6 0 0 0 18 12c0-.97-.23-1.886-.639-2.697l-.143-.266l-.032-.055l-.01-.018a6 6 0 0 0-1.88-1.978l-.333-.205a6 6 0 0 0-1.664-.64z`})]})})}function yt(e){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:d(`path`,{fill:`currentColor`,d:`M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2m0 18a8 8 0 1 1 8-8a8.01 8.01 0 0 1-8 8m0-8.5a1 1 0 0 0-1 1v3a1 1 0 0 0 2 0v-3a1 1 0 0 0-1-1m0-4a1.25 1.25 0 1 0 1.25 1.25A1.25 1.25 0 0 0 12 7.5`})})}function bt(e){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:d(`g`,{fill:`none`,fillRule:`evenodd`,children:[d(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),d(`path`,{fill:`currentColor`,d:`M6.798 2.884a7.002 7.002 0 0 1 9.294 8.565l4.394 3.718a3.76 3.76 0 1 1-5.3 5.3l-3.717-4.394a7.002 7.002 0 0 1-8.565-9.295c.358-.894 1.48-1.007 2.063-.373L8.17 9.883l1.446-.288l.29-1.449l-3.48-3.198c-.634-.583-.522-1.706.373-2.064ZM8.805 4.42l2.763 2.54c.322.296.466.738.38 1.165l-.47 2.354a1.25 1.25 0 0 1-.982.981l-2.35.467a1.25 1.25 0 0 1-1.164-.38L4.438 8.785a5.002 5.002 0 0 0 6.804 5.25a1.26 1.26 0 0 1 1.422.355l4.05 4.786a1.76 1.76 0 1 0 2.48-2.48l-4.785-4.05a1.26 1.26 0 0 1-.355-1.422a5 5 0 0 0-5.25-6.804Z`})]})})}function xt(e){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:d(`g`,{fill:`none`,fillRule:`evenodd`,children:[d(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),d(`path`,{fill:`currentColor`,d:`M16 19a1 1 0 0 1 .117 1.993L16 21H8a1 1 0 0 1-.117-1.993L8 19zm4-15a2 2 0 0 1 1.995 1.85L22 6v10a2 2 0 0 1-1.85 1.995L20 18H4a2 2 0 0 1-1.995-1.85L2 16V6a2 2 0 0 1 1.85-1.995L4 4zm0 2H4v10h16z`})]})})}function St(){return[{name:`Home`,href:`/`,regularIcon:X,activeIcon:ft,isActive:e=>e===`/`},{name:`Status`,href:`/status`,regularIcon:Y,activeIcon:dt,isActive:e=>e===`/status`},{name:`Nearby`,href:`/nearby`,regularIcon:mt,activeIcon:pt,isActive:e=>e===`/nearby`},{name:`Search`,icon:gt,opensSearchDrawer:!0},{name:`More`,icon:ht,opensMoreDrawer:!0}]}function Ct(){let{appName:e}=A();return[{name:`About ${e}`,href:`/about`,icon:yt},{name:`Settings`,href:`/settings`,icon:vt},{name:`Developer info`,href:`/debug`,icon:_t},{name:`Admin controls`,href:`/admin`,icon:bt},{name:`Zen mode`,href:`/zen`,icon:xt}]}var wt=t(null);function Z(){let e=i(wt);if(e==null)throw Error(`Service worker data unavailable outside provider.`);return e}function Tt(e){let{isUpdateAvailable:t,update:n}=Z(),[r,i]=y(!1);return l(()=>{e.menuFullyClosed&&i(t)},[t,e.menuFullyClosed]),r?d(je,{rounded:!1,onClick:()=>void n(),children:d(f,{children:d(H,{icon:I,text:`Update available — click to refresh`,outerPadding:!0})})}):null}function Q(e,t){let[n,r]=y(!1);return l(()=>{if(!e){r(!1);return}let n=setTimeout(()=>{r(!0)},t);return()=>{clearTimeout(n)}},[e,t]),n}function Et(e){let t=Ct(),n=Q(!e.open,300);return d(`div`,{class:a(e.class,`relative transition-[opacity,visibility,translate] duration-100`,{invisible:!e.open,"opacity-0":!e.open,"not-desktop:translate-y-4":!e.open,"desktop:-translate-y-4":!e.open}),children:[d(`div`,{class:`z-0 absolute top-0 bottom-0 left-0 right-0 bg-bg-raised desktop:border-b not-desktop:border-t border-soft-border opacity-97`}),d(h,{class:`relative z-1 desktop:flex-col-reverse`,children:[d(f,{children:d(h,{class:`py-2`,children:t.map(t=>d(U,{icon:t.icon,text:t.name,href:t.href,onHrefClick:e.onClose,theme:`hover-square`,layout:`menu-item`},t.href))})}),d(Tt,{menuFullyClosed:n})]})]})}function Dt(e){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:d(`g`,{fill:`none`,fillRule:`evenodd`,children:[d(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),d(`path`,{fill:`currentColor`,d:`M12 2a9 9 0 0 1 9 9c0 3.074-1.676 5.59-3.442 7.395a20.4 20.4 0 0 1-2.876 2.416l-.426.29l-.2.133l-.377.24l-.336.205l-.416.242a1.87 1.87 0 0 1-1.854 0l-.416-.242l-.52-.32l-.192-.125l-.41-.273a20.6 20.6 0 0 1-3.093-2.566C4.676 16.589 3 14.074 3 11a9 9 0 0 1 9-9m0 2a7 7 0 0 0-7 7c0 2.322 1.272 4.36 2.871 5.996a18 18 0 0 0 2.222 1.91l.458.326q.222.155.427.288l.39.25l.343.209l.289.169l.455-.269l.367-.23q.293-.186.627-.417l.458-.326a18 18 0 0 0 2.222-1.91C17.728 15.361 19 13.322 19 11a7 7 0 0 0-7-7m0 3a4 4 0 1 1 0 8a4 4 0 0 1 0-8m0 2a2 2 0 1 0 0 4a2 2 0 0 0 0-4`})]})})}function Ot(e){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:d(`g`,{fill:`none`,fillRule:`evenodd`,children:[d(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),d(`path`,{fill:`currentColor`,d:`M12 2a1 1 0 0 1 1 1v5.126a4.002 4.002 0 0 1 0 7.748V21a1 1 0 1 1-2 0v-5.126a4.002 4.002 0 0 1 0-7.748V3a1 1 0 0 1 1-1m0 12a2 2 0 1 0 0-4a2 2 0 0 0 0 4`})]})})}var kt={stop:e=>e,station:e=>`${e} Station`},At={line:e=>`${e} Line`,route:e=>`Route ${e}`},jt={stop:`stops`,station:`stations`},Mt={line:`lines`,route:`routes`},Nt={service:`services`,trip:`trips`,train:`trains`,tram:`trams`,bus:`buses`};function Pt(){let{foda:e}=w();return r(()=>({formatStop:kt[e.terminology.stop],formatLine:At[e.terminology.line],pluralStopsTerm:jt[e.terminology.stop],pluralLinesTerm:Mt[e.terminology.line],pluralServicesTerm:Nt[e.terminology.service]}),[e.terminology])}function Ft(e){let t=e.withLinks??!1;return d(u,{class:a(e.class),style:e.style,children:d(It,{lineIds:e.lineIds,withLinks:t})})}function It({lineIds:t,withLinks:n}){let{foda:r}=w();if(t.length===0)return{line:`No lines`,route:`No routes`}[r.terminology.line];let i=d(Lt,{lineIds:t,withLinks:n});return{line:d(e,{children:[i,` `,t.length===1?`Line`:`lines`]}),route:d(e,{children:[t.length===1?`Route`:`Routes`,` `,i]})}[r.terminology.line]}function Lt({lineIds:t,withLinks:n}){let{foda:i}=w(),a=r(()=>t.map(e=>Rt(e,i)).sort((e,t)=>e.name.localeCompare(t.name)),[t,i]);return a.length===1?d($,{data:T(a[0]),withLink:n}):a.length===2?d(e,{children:[d($,{data:T(a[0]),withLink:n}),` and`,` `,d($,{data:T(a[1]),withLink:n})]}):d(e,{children:[a.slice(0,-1).map((t,r)=>d(e,{children:[d($,{data:T(t),withLink:n},r),`,`,` `]})),` and `,d($,{data:T(a[a.length-1]),withLink:n})]})}function $({data:t,withLink:n}){return n?d(fe,{href:t.href,style:`strong-subtle`,dynamicColor:t.color,children:t.name}):d(e,{children:t.name})}function Rt(e,t){let n=t.lines.require(e);return{name:n.name,href:`/line/${n.urlPath}`,color:n.color}}function zt(){let{foda:e}=w(),{formatStop:t,formatLine:n,pluralStopsTerm:i,pluralLinesTerm:a}=Pt();return{candidates:r(()=>{let r=e.stops.map(e=>({id:`stop-${e.id}`,primary:t(e.name),alternatives:[],data:{title:t(e.name),description:d(Ft,{lineIds:e.canonicalLinesServingStop,style:`small`}),url:`/stop/${e.urlPath}`,icon:Dt}})),i=e.lines.map(e=>({id:`line-${e.id}`,primary:n(e.name),alternatives:[],data:{title:n(e.name),description:null,url:`/line/${e.urlPath}`,icon:Ot}}));return[...r,...i]},[e.lines,e.stops,n,t]),placeholder:r(()=>`Search ${i}, ${a}, etc.`,[a,i])}}var Bt={regular:`text-fg text-md outline-none border-none placeholder:text-fg-weak`,search:`text-fg-strong text-xl desktop:text-md font-bold outline-none border-none placeholder:text-fg-weak placeholder:font-normal`};function Vt(e){let t=Bt[e.style??`regular`],n={class:a(e.class,t),value:e.value,onInput:t=>{t.target!=null&&`value`in t.target&&typeof t.target.value==`string`&&e.onChange(t.target.value)},placeholder:e.placeholder,ref:e.inputRef,autoComplete:`off`};return d(Ht,{onSubmit:e.onSubmit,children:e.search??!1?d(`input`,{type:`search`,...n}):d(`input`,{type:`text`,...n})})}function Ht(e){return e.onSubmit==null?e.children:d(`form`,{class:`grid`,autoComplete:`off`,onSubmit:t=>{t.preventDefault(),e.onSubmit?.()},children:e.children})}var Ut=class{_query;_candidates;_maxResults;_results;_candidatesNotRequiringExactMatch;constructor(e,t,n){this._query=e,this._candidates=t,this._maxResults=n,this._results=new Map,this._candidatesNotRequiringExactMatch=t.filter(e=>!(e.requiresExactMatch??!1))}getResults(){return Array.from(this._results.values()).slice(0,this._maxResults)}appendResults(e,{passCandidatesRequiringExactMatch:t=!1}={}){if(this._results.size>=this._maxResults)return;let n=t?this._candidates:this._candidatesNotRequiringExactMatch,r=e(this._query,n);for(let e of r)this._results.has(e.id)||this._results.set(e.id,e.data)}};function Wt(e,t){return t.filter(t=>t.primary===e||t.alternatives.includes(e))}function Gt(e,t){return t.filter(t=>t.primary.startsWith(e)).sort((e,t)=>e.primary.length-t.primary.length)}function Kt(e,t){return t.filter(t=>t.primary.includes(e)).sort((e,t)=>e.primary.length-t.primary.length)}function qt(e,t){return t.map(t=>{let n=t.alternatives.filter(t=>t.startsWith(e)).sort((e,t)=>e.length-t.length)[0];return n==null?null:{candidate:t,bestMatch:n,percentageMatched:e.length/n.length}}).filter(de).sort((e,t)=>t.percentageMatched-e.percentageMatched).map(({candidate:e})=>e)}function Jt(e,t){return t.map(t=>{let n=t.alternatives.filter(t=>t.includes(e)).sort((e,t)=>e.length-t.length)[0];return n==null?null:{candidate:t,bestMatch:n,percentageMatched:e.length/n.length}}).filter(de).sort((e,t)=>t.percentageMatched-e.percentageMatched).map(({candidate:e})=>e)}function Yt(e,t,{maxResults:n=5}={}){let r=e.trim().toLowerCase();if(r.length===0)return[];let i=new Ut(r,t.map(e=>({...e,primary:e.primary.toLowerCase(),alternatives:e.alternatives.map(e=>e.toLowerCase())})),n);return i.appendResults(Wt,{passCandidatesRequiringExactMatch:!0}),i.appendResults(Gt),i.appendResults(Kt),i.appendResults(qt),i.appendResults(Jt),i.getResults()}function Xt(e){return d(`div`,{class:a(e.class,`flex flex-col justify-center items-stretch`),style:{height:`${e.heightRem}rem`},children:e.children})}function Zt(e){return d(V,{href:e.href,onHrefClick:e.onHrefClick,class:a(e.class),children:d(R,{class:a(e.class,`gap-3 desktop:gap-2 min-w-0 py-3 px-4 min-h-10`),yAlign:`center`,children:[d(Xt,{heightRem:p(`text-md`),children:d(e.icon,{class:`text-fg text-icon-lg`})}),d(h,{class:`gap-3 shrink`,children:[d(u,{style:`strong`,children:e.title}),e.description]})]})})}function Qt(e){let[t,n]=y(``),{candidates:i,placeholder:o}=zt(),{route:s}=m(),p=r(()=>Yt(t,i,{maxResults:5}),[t,i]),_=Q(!e.open,300);l(()=>{_&&n(``)},[_]);let v=c(null),b=Q(e.open,100);l(()=>{b&&v.current?.focus()},[b]);function ee(){p.length>0&&(s(T(p[0]).url),e.onClose())}return d(`div`,{class:a(e.class,`relative transition-[opacity,visibility,translate] duration-100`,{invisible:!e.open,"opacity-0":!e.open,"-translate-y-4":!e.open}),children:[d(`div`,{class:`absolute top-0 bottom-0 left-0 right-0 bg-bg-raised border-b border-soft-border opacity-97`}),d(f,{class:`relative z-1`,children:d(h,{children:[d(g,{class:`relative py-2 border-b border-b-soft-border not-desktop:bg-bg-navbar`,children:[d(Vt,{style:`search`,value:t,onChange:n,class:`px-4 pl-12 h-10 desktop:h-8 desktop:pl-11`,placeholder:o,inputRef:v,onSubmit:ee,search:!0}),d(gt,{class:`absolute left-4 top-[50%] translate-y-[-50%] pointer-events-none text-fg-weak text-icon-xl desktop:text-icon-lg`})]}),d(h,{class:`max-h-[calc(100vh-12rem)] py-3 overflow-y-scroll`,children:[p.length===0&&d(g,{class:`h-32 items-center`,children:d(u,{class:`px-4`,style:`weak`,children:t.length===0?`Results will appear here.`:`No results.`})}),p.map(t=>d(Zt,{title:t.title,description:t.description,icon:t.icon,href:t.url,onHrefClick:e.onClose},t.url))]})]})})]})}function $t(e){let t=e.active??!1;return d(L,{class:a(e.class,`group`),onClick:e.onClick,href:e.href,children:d(h,{class:`gap-1 pb-1.5`,xAlign:`center`,yAlign:`center`,children:[d(g,{class:a(`px-3 py-1 rounded-full relative`,{"bg-soft-accent":t,"group-hover:bg-soft":!t,"group-active:bg-soft-active":!t}),children:[(e.showBadge??!1)&&d(`div`,{class:`h-2 w-2 absolute rounded-full bg-accent top-1 right-3`}),t===!0?d(e.activeIcon,{class:`text-accent-text text-icon-xl`}):d(e.regularIcon,{class:`text-fg text-icon-xl`})]}),d(u,{style:t?`small-strong-accent`:`small`,children:e.text})]})})}function en(e){let{url:t}=m(),n=St(),{isUpdateAvailable:r}=Z();return d(g,{class:a(e.class,`h-18 bg-bg-navbar grid-cols-[repeat(auto-fit,minmax(0,1fr))] border-t border-soft-border px-2`),children:n.map(n=>d($t,{text:n.name,regularIcon:`icon`in n?n.icon:n.regularIcon,activeIcon:`icon`in n?n.icon:n.activeIcon,active:`isActive`in n&&n.isActive(t),href:`href`in n?n.href:void 0,onClick:n.opensMoreDrawer?e.onOpenMoreDrawerRequest:n.opensSearchDrawer?e.onOpenSearchDrawerRequest:void 0,showBadge:r&&n.opensMoreDrawer},n.name))})}function tn(e){let t=e.active??!1;return d(g,{class:a(e.class,`border-y-2 border-y-transparent items-center`,{"border-b-accent":t}),children:d(B,{class:e.class,onClick:e.onClick,href:e.href,children:d(R,{class:`px-4 gap-2 h-8`,xAlign:`center`,yAlign:`center`,children:[d(g,{class:`relative`,children:[(e.showBadge??!1)&&d(`div`,{class:`h-2 w-2 absolute rounded-full bg-accent top-0 right-0`}),t===!0?d(e.activeIcon,{class:`text-fg-strong text-icon-lg`}):d(e.regularIcon,{class:`text-fg text-icon-lg`})]}),d(g,{class:`relative`,children:[d(u,{class:a(`absolute left-0 right-0`,{hidden:t}),style:`regular`,align:`center`,children:e.text}),d(u,{class:a({invisible:!t}),style:`strong`,children:e.text})]})]})})})}function nn(e){return d(`img`,{class:a(e.class,`w-[1em] h-[1em]`),src:`/favicon.svg`})}function rn(e){let{appName:t}=A(),{url:n}=m(),r=St(),{isUpdateAvailable:i}=Z();return d(f,{class:a(e.class,`h-12 bg-bg-navbar border-b border-soft-border`),children:d(R,{class:`gap-2`,children:[d(B,{class:`self-center`,href:`/`,children:d(R,{class:`px-4 gap-2 h-8`,xAlign:`center`,yAlign:`center`,children:[d(nn,{class:`text-icon-md`}),d(u,{style:`wordmark`,children:t})]})}),d(R,{children:r.map(t=>d(tn,{text:t.name,regularIcon:`icon`in t?t.icon:t.regularIcon,activeIcon:`icon`in t?t.icon:t.activeIcon,active:`isActive`in t&&t.isActive(n),href:`href`in t?t.href:void 0,onClick:t.opensMoreDrawer?e.onOpenMoreDrawerRequest:t.opensSearchDrawer?e.onOpenSearchDrawerRequest:void 0,showBadge:i&&t.opensMoreDrawer},t.name))})]})})}function an(e){let{showMobileNav:t,showDesktopNav:n}=_(),{url:r}=m(),[i,o]=y(!1),[s,c]=y(!1);function u(){c(!1),o(e=>!e)}function f(){o(!1),c(e=>!e)}function p(){o(!1),c(!1)}return l(()=>{o(!1),c(!1)},[r]),d(g,{class:a(e.class,`fixed top-0 bottom-0 left-0 right-0 desktop:grid-rows-[auto_1fr] not-desktop:grid-rows-[1fr_auto]`,{"pointer-events-none":!i&&!s}),children:[d(`div`,{class:`desktop:hidden row-2 pointer-events-auto relative z-1`,children:t&&d(en,{onOpenMoreDrawerRequest:u,onOpenSearchDrawerRequest:f})}),d(`div`,{class:`not-desktop:hidden row-1 pointer-events-auto relative z-1`,children:n&&d(rn,{onOpenMoreDrawerRequest:u,onOpenSearchDrawerRequest:f})}),d(`div`,{class:`relative z-0 h-full desktop:row-2 not-desktop:row-1`,children:[d(`div`,{class:a(`absolute desktop:top-0 not-desktop:bottom-0 left-0 right-0 z-1`,{"pointer-events-none":!i}),children:d(Et,{open:i,onClose:p})}),d(`div`,{class:a(`absolute top-0 left-0 right-0 z-1`,{"pointer-events-none":!s}),children:d(Qt,{open:s,onClose:p})}),d(`div`,{class:`absolute top-0 left-0 right-0 bottom-0 z-0`,onClick:p})]})]})}function on(e){return d(`div`,{class:e.class,children:[d(`div`,{class:`relative z-0`,children:e.children}),d(`div`,{class:`relative z-1`,children:d(an,{})})]})}var sn=`false`,cn=`false`,ln=sn===`true`,un=cn===`true`;function dn(e={}){let{immediate:t=!1,onNeedReload:n,onNeedRefresh:r,onOfflineReady:i,onRegistered:a,onRegisteredSW:o,onRegisterError:s}=e,c,l,u,d=async(e=!0)=>{await l,ln||u?.()};async function f(){if(`serviceWorker`in navigator){if(c=await O(async()=>{let{Workbox:e}=await import(`./workbox-window.prod.es5-Bd17z0YL.js`);return{Workbox:e}},[]).then(({Workbox:e})=>new e(`/sw.js`,{scope:`/`,type:`classic`})).catch(e=>{s?.(e)}),!c)return;if(u=()=>{c?.messageSkipWaiting()},!un){if(ln)c.addEventListener(`activated`,e=>{(e.isUpdate||e.isExternal)&&(n?n():window.location.reload())}),c.addEventListener(`installed`,e=>{e.isUpdate||i?.()});else{let e=!1,t=()=>{e=!0,c?.addEventListener(`controlling`,e=>{e.isUpdate&&(n?n():window.location.reload())}),r?.()};c.addEventListener(`installed`,n=>{n.isUpdate===void 0?n.isExternal===void 0?!e&&i?.():n.isExternal?t():!e&&i?.():n.isUpdate||i?.()}),c.addEventListener(`waiting`,t)}}c.register({immediate:t}).then(e=>{o?o(`/sw.js`,e):a?.(e)}).catch(e=>{s?.(e)})}}return l=f(),d}function fn(e){let{Provider:t}=wt,[n,i]=y(!1),[a,o]=y(!1),s=r(()=>dn({onRegisteredSW:()=>{},onRegisterError:e=>console.warn(`Service worker error:`,e),onNeedRefresh:()=>i(!0),onOfflineReady:()=>o(!0)}),[]),c=x(async()=>{try{let e=await navigator.serviceWorker.getRegistrations();for(let t of e)await t.unregister()}catch(e){console.warn(`Failed to unregister service worker:`,e)}},[]),l=r(()=>({isUpdateAvailable:n,isOfflineReady:a,update:s,unregister:c}),[n,a,s,c]);return d(t,{value:l,children:e.children})}function pn(e,t,n={}){let{callApi:r}=le(),[i,a]=y(null),[o,s]=y(!0),[c,l]=y(null);return oe(()=>{let i=!1;async function o(){try{s(!0),l(null);let o=await r(e,t,n);if(i)return;a(o)}catch(e){if(i)return;console.warn(e),l(e)}finally{i||s(!1)}}return o(),()=>{i=!0}},[e,t,n]),{data:i,loading:o,error:c}}function mn(){return{isHotReloadingEnabled:r(()=>!1,[])}}function hn(e){let{isHotReloadingEnabled:t}=mn(),{frontendVersion:n,versionsOnLastUpdate:r}=A(),{unregister:i}=Z(),{data:a,loading:o,error:s}=pn(te,{frontendVersion:n,corequeryPackageVersion:r.corequeryPackageVersion}),c=!t&&!o&&s==null&&a!=null&&a.isForceUpdateOfServiceWorkerRequired;return l(()=>{async function e(){c&&(await i(),window.location.reload())}e()},[c,i]),e.children}var gn=E(()=>O(()=>import(`./About-DGmg1TM-.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),_n=E(()=>O(()=>import(`./AdminControls-T05hoDB-.js`),__vite__mapDeps([14,1,8,9,10]))),vn=E(()=>O(()=>import(`./Debug-Q4Vy4lZ_.js`),__vite__mapDeps([15,1,2,3,4,8,9,10,11,12,13]))),yn=E(()=>O(()=>import(`./Home-C6T20k8G.js`),__vite__mapDeps([16,1,3,5,6,7,8,9,10]))),bn=E(()=>O(()=>import(`./Nearby-BNDxZx1J.js`),__vite__mapDeps([17,1,8]))),xn=E(()=>O(()=>import(`./Service-CkHxNopv.js`),__vite__mapDeps([18,1,2,3,19,20,21,13,6,8,9,10,22]))),Sn=E(()=>O(()=>import(`./Settings-Ccrmh7u8.js`),__vite__mapDeps([23,1,8,9,10,11,24]))),Cn=E(()=>O(()=>import(`./Status-CO5w5a1E.js`),__vite__mapDeps([25,1,8,9,10]))),wn=E(()=>O(()=>import(`./ZenMode-C3S7FmYt.js`),__vite__mapDeps([26,1,7,8,9,10]))),Tn=E(()=>O(()=>import(`./Stop-BWZOcpvU.js`),__vite__mapDeps([27,1,2,3,8,10,28,21,13,22]))),En=E(()=>O(()=>import(`./Line-6nd7KD0E.js`),__vite__mapDeps([29,1,2,3,20,19,21,13,6,8,9,10,12,28,24]))),Dn=E(()=>O(()=>import(`./NotFound-BozS7u6u.js`),__vite__mapDeps([30,1,28,2,3,8])));function On(){return d(fn,{children:d(xe,{children:d(hn,{children:d(ut,{children:d(at,{children:d(v,{children:d(on,{children:d(me,{children:d(s,{children:[d(o,{path:`/`,component:yn}),d(o,{path:`/about`,component:gn}),d(o,{path:`/admin`,component:_n}),d(o,{path:`/debug`,component:vn}),d(o,{path:`/line/:id`,component:En}),d(o,{path:`/nearby`,component:bn}),d(o,{path:`/service/:sourceId/:intrasourceId`,component:xn}),d(o,{path:`/settings`,component:Sn}),d(o,{path:`/status`,component:Cn}),d(o,{path:`/stop/:id`,component:Tn}),d(o,{path:`/zen`,component:wn}),d(o,{default:!0,component:Dn})]})})})})})})})})})}ee(d(On,{}),document.body);export{F as _,Pt as a,X as c,G as d,U as f,I as g,L as h,Ft as i,Y as l,R as m,pn as n,Z as o,V as p,Xt as r,yt as s,mn as t,st as u,A as v};