corequery 0.29.0 → 0.30.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 (108) hide show
  1. package/package.json +1 -1
  2. package/server/dist/server/api/create-api-router.js +3 -1
  3. package/server/dist/server/api/create-api-router.js.map +1 -1
  4. package/server/dist/server/api/handlers/about-page/v1/index.d.ts +2 -2
  5. package/server/dist/server/api/handlers/about-page/v1/index.js.map +1 -1
  6. package/server/dist/server/api/handlers/departures/v0/index.d.ts +2 -2
  7. package/server/dist/server/api/handlers/departures/v0/index.js +16 -13
  8. package/server/dist/server/api/handlers/departures/v0/index.js.map +1 -1
  9. package/server/dist/server/api/handlers/foda-synced-handler.d.ts +5 -0
  10. package/server/dist/server/api/handlers/foda-synced-handler.js +6 -0
  11. package/server/dist/server/api/handlers/foda-synced-handler.js.map +1 -0
  12. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-foda.d.ts +11 -0
  13. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-foda.js +107 -0
  14. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-foda.js.map +1 -0
  15. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-entry-foda.d.ts +10 -0
  16. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-entry-foda.js +35 -0
  17. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-entry-foda.js.map +1 -0
  18. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-foda.d.ts +10 -0
  19. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-foda.js +23 -0
  20. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-foda.js.map +1 -0
  21. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-foda.d.ts +10 -0
  22. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-foda.js +30 -0
  23. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-foda.js.map +1 -0
  24. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-stop-foda.d.ts +10 -0
  25. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-stop-foda.js +33 -0
  26. package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-stop-foda.js.map +1 -0
  27. package/server/dist/server/api/handlers/foundational-data/v1/index.d.ts +2 -2
  28. package/server/dist/server/api/handlers/foundational-data/v1/index.js +6 -4
  29. package/server/dist/server/api/handlers/foundational-data/v1/index.js.map +1 -1
  30. package/server/dist/server/api/handlers/service/v0/index.d.ts +2 -2
  31. package/server/dist/server/api/handlers/service/v0/index.js +18 -15
  32. package/server/dist/server/api/handlers/service/v0/index.js.map +1 -1
  33. package/server/dist/server/api/handlers/version-check/v1/index.d.ts +2 -2
  34. package/server/dist/server/api/handlers/version-check/v1/index.js.map +1 -1
  35. package/server/dist/server/api/handlers/versions/v1/index.d.ts +2 -2
  36. package/server/dist/server/api/handlers/versions/v1/index.js +1 -3
  37. package/server/dist/server/api/handlers/versions/v1/index.js.map +1 -1
  38. package/server/dist/server/api/types.d.ts +8 -1
  39. package/server/dist/server/corequery.d.ts +2 -0
  40. package/server/dist/server/corequery.js +12 -0
  41. package/server/dist/server/corequery.js.map +1 -1
  42. package/server/dist/server/data/line-diagram-entry.d.ts +0 -3
  43. package/server/dist/server/data/line-diagram-entry.js +1 -18
  44. package/server/dist/server/data/line-diagram-entry.js.map +1 -1
  45. package/server/dist/server/data/line-diagram.d.ts +0 -3
  46. package/server/dist/server/data/line-diagram.js +0 -6
  47. package/server/dist/server/data/line-diagram.js.map +1 -1
  48. package/server/dist/server/data/line.d.ts +0 -3
  49. package/server/dist/server/data/line.js +1 -10
  50. package/server/dist/server/data/line.js.map +1 -1
  51. package/server/dist/server/data/location.d.ts +0 -3
  52. package/server/dist/server/data/location.js +0 -6
  53. package/server/dist/server/data/location.js.map +1 -1
  54. package/server/dist/server/data/stop.d.ts +0 -3
  55. package/server/dist/server/data/stop.js +0 -9
  56. package/server/dist/server/data/stop.js.map +1 -1
  57. package/server/dist/shared/apis/departures/v0/index.d.ts +20 -17
  58. package/server/dist/shared/apis/departures/v0/index.js +3 -47
  59. package/server/dist/shared/apis/departures/v0/index.js.map +1 -1
  60. package/server/dist/shared/apis/foda-synced-result.d.ts +5 -0
  61. package/server/dist/shared/apis/foda-synced-result.js +8 -0
  62. package/server/dist/shared/apis/foda-synced-result.js.map +1 -0
  63. package/server/dist/shared/apis/foundational-data/v1/foundational-data.d.ts +2 -5
  64. package/server/dist/shared/apis/foundational-data/v1/foundational-data.js +3 -7
  65. package/server/dist/shared/apis/foundational-data/v1/foundational-data.js.map +1 -1
  66. package/server/dist/shared/apis/foundational-data/v1/index.d.ts +1 -0
  67. package/server/dist/shared/apis/service/v0/index.d.ts +21 -18
  68. package/server/dist/shared/apis/service/v0/index.js +3 -4
  69. package/server/dist/shared/apis/service/v0/index.js.map +1 -1
  70. package/server/dist/shared/apis/types.d.ts +1 -3
  71. package/server/dist/shared/apis/types.js +1 -1
  72. package/server/dist/shared/apis/types.js.map +1 -1
  73. package/web/dist/assets/About-DpFLDTV_.js +1 -0
  74. package/web/dist/assets/{AdminControls-BRkz2H1D.js → AdminControls-BMTTV4kR.js} +1 -1
  75. package/web/dist/assets/Alert-k_U4L_j3.js +1 -0
  76. package/web/dist/assets/Debug-DGqHdl31.js +1 -0
  77. package/web/dist/assets/{Home-Bimr0Ebg.js → Home-LcK9TehM.js} +1 -1
  78. package/web/dist/assets/Line-ZicduquS.js +1 -0
  79. package/web/dist/assets/NotFound-zNBih-TR.js +1 -0
  80. package/web/dist/assets/NotFoundPage-DLkgQE3z.js +1 -0
  81. package/web/dist/assets/{Picker-B59cZ5e5.js → Picker-ByWHXE97.js} +1 -1
  82. package/web/dist/assets/Service-CqfnDpff.js +1 -0
  83. package/web/dist/assets/{Settings-CcUztzue.js → Settings-1Z6FXsgC.js} +1 -1
  84. package/web/dist/assets/{SimpleMobileHeaderContent-9gskaqRe.js → SimpleMobileHeaderContent-DnaUyjiU.js} +1 -1
  85. package/web/dist/assets/{Status-Brsavasr.js → Status-DIIRyqgr.js} +1 -1
  86. package/web/dist/assets/Stop-DKWaUN6o.js +1 -0
  87. package/web/dist/assets/{ZenMode-D8bVmCaS.js → ZenMode-qKwx-pZt.js} +1 -1
  88. package/web/dist/assets/index-CE8NAPhv.js +2 -0
  89. package/web/dist/assets/linear-CMwrWzQJ.js +1 -0
  90. package/web/dist/assets/use-api-BJomuYg6.js +55 -0
  91. package/web/dist/assets/use-foda-synced-query-BM-OPAql.js +1 -0
  92. package/web/dist/assets/{use-simple-headers-CovxFlVs.js → use-simple-headers-Bihzijd5.js} +1 -1
  93. package/web/dist/index.html +2 -2
  94. package/web/dist/sw.js +1 -1
  95. package/server/dist/server/api/handlers/foundational-data/v1/builder.d.ts +0 -11
  96. package/server/dist/server/api/handlers/foundational-data/v1/builder.js +0 -44
  97. package/server/dist/server/api/handlers/foundational-data/v1/builder.js.map +0 -1
  98. package/web/dist/assets/About-BFYcBory.js +0 -1
  99. package/web/dist/assets/Alert-D41vPACK.js +0 -1
  100. package/web/dist/assets/Debug-CdyB6z1N.js +0 -1
  101. package/web/dist/assets/Line-DG7fDqpF.js +0 -1
  102. package/web/dist/assets/NotFound-DS9pNgRR.js +0 -1
  103. package/web/dist/assets/NotFoundPage-rHyFGsin.js +0 -1
  104. package/web/dist/assets/Service-CscfW4h8.js +0 -1
  105. package/web/dist/assets/Stop-mET1TOC2.js +0 -1
  106. package/web/dist/assets/index-DapCozyq.js +0 -2
  107. package/web/dist/assets/linear-eK93gfBn.js +0 -1
  108. package/web/dist/assets/use-query-BRsiAaVY.js +0 -55
@@ -1,2 +1,2 @@
1
- import z, { ZodType } from "zod";
1
+ export {};
2
2
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../shared/apis/types.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../shared/apis/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ import{i as e,l as t,r as n}from"./use-nav-exemptions-QtGbfEPT.js";import{d as r}from"./use-api-BJomuYg6.js";import{n as i}from"./use-foundational-data-BEVQRFj9.js";import{n as a,v as o}from"./index-CE8NAPhv.js";import{t as s}from"./Placeholder-BRnxNmKm.js";import{n as c,t as l}from"./Markdown-D5fQv556.js";import{t as u}from"./Page-BMcxP_9m.js";import{t as d}from"./use-simple-headers-Bihzijd5.js";import{t as f}from"./Divider-lz6Cf6K8.js";import{t as p}from"./Alert-k_U4L_j3.js";function m(){let{appName:m}=o(),{foda:h}=i(),{data:g,loading:_,error:v}=a(r,{}),y=d({title:`About ${m}`});return _?t(u,{...y,children:t(n,{class:`px-4 py-8`,children:[t(s,{class:`w-[30%] text-xl`}),t(`div`,{class:`h-8`}),t(s,{class:`w-full text-md`}),t(`div`,{class:`h-3`}),t(s,{class:`w-full text-md`}),t(`div`,{class:`h-3`}),t(s,{class:`w-[60%] text-md`}),t(`div`,{class:`h-12`}),t(s,{class:`w-[40%] text-lg`}),t(`div`,{class:`h-8`}),t(s,{class:`w-full text-md`}),t(`div`,{class:`h-3`}),t(s,{class:`w-full text-md`}),t(`div`,{class:`h-3`}),t(s,{class:`w-[20%] text-md`}),t(`div`,{class:`h-12`}),t(s,{class:`w-[50%] text-lg`}),t(`div`,{class:`h-8`}),t(s,{class:`w-full text-md`}),t(`div`,{class:`h-3`}),t(s,{class:`w-[80%] text-md`})]})}):v!=null||g==null?t(u,{...y,children:t(n,{class:`px-4 py-8`,children:t(p,{type:`error`,children:t(e,{children:`Unable to load the about page.`})})})}):t(u,{...y,children:t(n,{class:`px-4 py-8 gap-12`,children:[t(l,{markdown:g.primaryMarkdown}),t(n,{class:`gap-8`,children:[t(f,{}),t(e,{as:`p`,style:`small-weak`,children:t(c,{markdown:h.footerPrimaryMarkdown})})]})]})})}export{m as default};
@@ -1 +1 @@
1
- import{i as e,l as t,r as n}from"./use-nav-exemptions-QtGbfEPT.js";import{t as r}from"./Page-BMcxP_9m.js";import{t as i}from"./use-simple-headers-CovxFlVs.js";function a(){return t(r,{...i({title:`Admin controls`}),children:t(n,{class:`px-4 py-8 gap-8`,children:t(e,{children:`Maybe the real admin controls were the friends we made along the way?`})})})}export{a as default};
1
+ import{i as e,l as t,r as n}from"./use-nav-exemptions-QtGbfEPT.js";import{t as r}from"./Page-BMcxP_9m.js";import{t as i}from"./use-simple-headers-Bihzijd5.js";function a(){return t(r,{...i({title:`Admin controls`}),children:t(n,{class:`px-4 py-8 gap-8`,children:t(e,{children:`Maybe the real admin controls were the friends we made along the way?`})})})}export{a as default};
@@ -0,0 +1 @@
1
+ import{c as e,l as t,o as n,s as r}from"./use-nav-exemptions-QtGbfEPT.js";import{l as i,r as a,s as o}from"./index-CE8NAPhv.js";import{t as s}from"./MingcuteAlertLine-CdthHQmK.js";function c(e){return t(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:t(`g`,{fill:`none`,fillRule:`evenodd`,children:[t(`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`}),t(`path`,{fill:`currentColor`,d:`M21.192 5.465a1 1 0 0 1 0 1.414L9.95 18.122a1.1 1.1 0 0 1-1.556 0l-5.586-5.586a1 1 0 1 1 1.415-1.415l4.95 4.95L19.777 5.465a1 1 0 0 1 1.414 0Z`})]})})}function l(l){let u={info:o,error:i,warning:s,success:c}[l.type],d=l.icon===void 0?u:l.icon,f={info:`bg-soft-accent`,error:`bg-soft-error`,warning:`bg-soft-warning`,success:`bg-soft-success`}[l.type],p={info:[`[--color-fg:var(--color-accent-text)]`,`[--color-fg-strong:var(--color-accent-text)]`,`[--color-fg-weak:var(--color-accent-text)]`],error:[`[--color-fg:var(--color-error-text)]`,`[--color-fg-strong:var(--color-error-text)]`,`[--color-fg-weak:var(--color-error-text)]`],warning:[`[--color-fg:var(--color-warning-text)]`,`[--color-fg-strong:var(--color-warning-text)]`,`[--color-fg-weak:var(--color-warning-text)]`],success:[`[--color-fg:var(--color-success-text)]`,`[--color-fg-strong:var(--color-success-text)]`,`[--color-fg-weak:var(--color-success-text)]`]}[l.type];return t(r,{class:e(l.class,f,p,`px-4 py-4.5 rounded-sm gap-2 items-start`,{"grid-cols-[auto_1fr]":d!=null}),children:[d!=null&&t(a,{heightRem:n(`text-md`),children:t(d,{class:`text-fg text-icon-lg`})}),l.children]})}export{l as t};
@@ -0,0 +1 @@
1
+ import{S as e,b as t,c as n,i as r,l as i,o as a,r as o,s}from"./use-nav-exemptions-QtGbfEPT.js";import{i as c}from"./use-api-BJomuYg6.js";import{n as l}from"./use-foundational-data-BEVQRFj9.js";import{_ as u,f as d,g as f,m as p,n as m,o as h,r as g,t as _,v}from"./index-CE8NAPhv.js";import{t as y}from"./Placeholder-BRnxNmKm.js";import{t as b}from"./Page-BMcxP_9m.js";import{t as x}from"./use-simple-headers-Bihzijd5.js";import{t as S}from"./Divider-lz6Cf6K8.js";import{t as C}from"./Alert-k_U4L_j3.js";var w=e(null);function T(){let e=t(w);if(e==null)throw Error(`Foundational data unavailable outside provider.`);return e}function E(e){let t={info:`bg-soft-accent`,error:`bg-soft-error`,warning:`bg-soft-warning`,success:`bg-soft-success`}[e.type],a={info:`[--color-fg:var(--color-accent-text)]`,error:`[--color-fg:var(--color-error-text)]`,warning:`[--color-fg:var(--color-warning-text)]`,success:`[--color-fg:var(--color-success-text)]`}[e.type];return i(s,{class:n(e.class,t,a,`px-2 py-1.5 rounded-full`),children:i(r,{style:`small`,children:e.text})})}function D(e){return i(p,{class:n(e.class,`gap-x-2 gap-y-3`),wrap:!0,children:[i(r,{style:`strong`,children:e.header}),e.loading&&i(y,{class:`w-[20%] text-md`}),!e.loading&&e.pillContent!=null&&i(g,{heightRem:a(`text-md`),children:i(E,{type:e.pillContent.type,text:e.pillContent.text})})]})}function O(e){return i(D,{class:e.class,header:e.header,pillContent:k(e.currentValue,e.latestValue),loading:e.loading})}function k(e,t){return t==null?null:{text:e===t?`Up to date`:`Outdated`,type:e===t?`success`:`error`}}function A(e){return e.loading?i(s,{class:e.class,children:i(y,{class:`w-[40%] text-md`})}):e.value==null?null:i(r,{class:e.class,children:[e.prefix,`: `,e.value]})}function j(e){return e==null?null:e.length<32||!/^[0-9a-f]+$/.test(e)?e:e.slice(0,7)}function M(e){let{isUpdateAvailable:t,update:o}=h();return t?i(d,{theme:`accent`,text:`Refresh & update`,class:`self-start`,icon:f,onClick:()=>void o()}):i(p,{class:n(e.class,`gap-2`),children:[i(g,{heightRem:a(`text-md`),children:i(u,{})}),i(r,{class:`min-w-0 shrink`,children:`Waiting for service worker to install update...`})]})}function N(e){let{isHotReloadingEnabled:t}=_();return i(t?P:F,{...e})}function P(e){let{data:t,loading:a}=T();return i(o,{class:n(e.class,`gap-6`),children:[i(D,{header:`App version`,pillContent:{text:`Development`,type:`info`},loading:!1}),i(r,{children:`All frontend code is being served with hot-reloading enabled, not through the PWA. (The below values are meaningless.)`}),i(I,{}),i(A,{prefix:`Latest version`,value:t?.frontendVersion.slice(0,8)??null,loading:a})]})}function F(e){let{frontendVersion:t}=v(),{data:r,loading:a}=T(),s=!a&&r!=null&&r?.frontendVersion!==t;return i(o,{class:n(e.class,`gap-8`),children:i(o,{class:`gap-6`,children:[i(O,{header:`App version`,currentValue:t,latestValue:r?.frontendVersion??null,loading:a}),i(I,{}),i(A,{prefix:`Latest version`,value:j(r?.frontendVersion),loading:a}),s&&i(M,{})]})})}function I(){let{frontendVersion:e,versionsOnLastUpdate:t}=v();return i(o,{class:`gap-4`,children:[i(r,{children:[`Current version: `,j(e)]}),i(o,{class:`gap-3`,children:[i(r,{style:`small-weak`,children:[`Server version: `,j(t.serverVersion)]}),i(r,{style:`small-weak`,children:[`CoreQuery version: `,t.corequeryPackageVersion]})]})]})}function L(e){let t=m(c,{});return i(w.Provider,{value:t,children:e.children})}function R(e){let{data:t,loading:a}=T(),{foda:s}=l();return i(o,{class:n(e.class,`gap-6`),children:[i(O,{header:`Foundational data`,currentValue:s.hash,latestValue:t?.foundationalDataHash??null,loading:a}),i(o,{class:`gap-4`,children:[i(r,{children:[`Current version: `,j(s.hash)]}),i(r,{style:`small-weak`,children:[`Server version: `,j(s.serverVersion)]})]}),i(A,{prefix:`Latest version`,value:j(t?.foundationalDataHash),loading:a})]})}function z(e){let{data:t,loading:a}=T();return i(o,{class:n(e.class,`gap-8`),children:i(o,{class:`gap-6`,children:[i(r,{style:`strong`,children:`Server`}),i(B,{}),i(o,{class:`gap-4`,children:[i(A,{prefix:`Server version`,value:j(t?.serverVersion),loading:a}),i(A,{prefix:`CoreQuery version`,value:t?.corequeryPackageVersion??null,loading:a})]})]})})}function B(){let{error:e}=T();return e==null?null:i(C,{type:`error`,children:i(r,{children:`Unable to fetch the latest version info from the server.`})})}function V(){return i(b,{...x({title:`Developer info`}),children:i(L,{children:i(o,{class:`px-4 py-8 gap-8`,children:[i(H,{}),i(N,{}),i(S,{}),i(R,{}),i(S,{}),i(z,{}),i(S,{})]})})})}function H(){let{error:e}=T();return e==null?null:i(C,{type:`error`,children:i(r,{children:`Unable to fetch the latest version info from the server.`})})}export{V as default};
@@ -1 +1 @@
1
- import{l as e,r as t}from"./use-nav-exemptions-QtGbfEPT.js";import{n}from"./use-foundational-data-BEVQRFj9.js";import{t as r}from"./Markdown-D5fQv556.js";import{t as i}from"./Page-BMcxP_9m.js";import{t as a}from"./use-simple-headers-CovxFlVs.js";function o(){let{foda:o}=n();return e(i,{...a({title:`Home`}),children:e(t,{class:`px-4 py-8 gap-12`,children:e(r,{markdown:o.landingPage.primaryMarkdown})})})}export{o as default};
1
+ import{l as e,r as t}from"./use-nav-exemptions-QtGbfEPT.js";import{n}from"./use-foundational-data-BEVQRFj9.js";import{t as r}from"./Markdown-D5fQv556.js";import{t as i}from"./Page-BMcxP_9m.js";import{t as a}from"./use-simple-headers-Bihzijd5.js";function o(){let{foda:o}=n();return e(i,{...a({title:`Home`}),children:e(t,{class:`px-4 py-8 gap-12`,children:e(r,{markdown:o.landingPage.primaryMarkdown})})})}export{o as default};
@@ -0,0 +1 @@
1
+ import{_ as e,c as t,i as n,l as r,m as i,r as a,s as o,v as s,y as c}from"./use-nav-exemptions-QtGbfEPT.js";import{l}from"./use-api-BJomuYg6.js";import{n as u}from"./use-foundational-data-BEVQRFj9.js";import{t as d}from"./scope-B-e4l8Dr.js";import{i as f,n as p,o as m,r as h,t as g}from"./linear-CMwrWzQJ.js";import{t as _}from"./LinkText-sdmJpshg.js";import{a as v,d as y,v as b}from"./index-CE8NAPhv.js";import{t as x}from"./Page-BMcxP_9m.js";import{t as S}from"./use-simple-headers-Bihzijd5.js";import{t as C}from"./Alert-k_U4L_j3.js";import{t as w}from"./NotFoundPage-DLkgQE3z.js";import{t as T}from"./Picker-ByWHXE97.js";function E(e){throw Error(`Unexpected value: ${String(e)}`)}function D(i){let{foda:o}=u(),{appName:s}=b(),c=e(()=>i.fallbackStopList.map(e=>o.stops.require(e)).sort((e,t)=>e.name.localeCompare(t.name)),[o.stops,i.fallbackStopList]);return r(a,{class:t(i.class,`gap-6`),children:[r(n,{style:`subtitle`,children:`Stops`}),r(C,{type:`info`,children:r(a,{class:`gap-6`,children:[r(n,{children:[`A neat little diagram is also available for this line, but it's of a new type, and so requires a newer version of `,s,` to be able to view.`,` `]}),r(n,{style:`strong`,children:r(_,{href:`/debug`,children:`Help me update`})})]})}),r(`ul`,{class:`flex-col flex list-disc list-inside gap-4`,children:c.map(e=>r(n,{children:r(`li`,{children:r(_,{href:`/stop/${e.urlPath}`,children:e.name})})}))})]})}function O(e,t){return t.map(t=>{let i=e.stops.require(t.stopId),a=`/stop/${i.urlPath}`;if(t.type===`regular`)return{content:r(n,{style:`strong`,children:r(_,{href:a,style:`subtle`,children:i.name})})};if(t.type===`always-express`)return{content:r(n,{style:`small-weak`,children:r(_,{href:a,style:`subtle`,children:[`Skips `,i.name]})}),drawMark:!1};E(t.type)})}function k(t){let{foda:n}=u(),i=e(()=>({type:`linear`,stops:O(n,t.diagram.stops)}),[n,t.diagram.stops]);return r(g,{class:t.class,structure:i,lightThemeColorHexCode:t.diagram.color?.lightModeHexCode??null,darkThemeColorHexCode:t.diagram.color?.darkModeHexCode??null})}var A=10,j=15,M=class extends h{_onRenderStructure(){let{commonStops:e,branchAStops:t,branchBStops:n}=this.data.structure,{x:r,y:i}=this._measure();this._renderSection({stops:e,x:r.common,yLevels:i.common.all,terminatesAtTop:!0,terminatesAtBottom:!1,notchSide:`right`}),this._renderSection({stops:t,x:r.branchA,yLevels:i.branchA.all,terminatesAtTop:!1,terminatesAtBottom:!0,notchSide:`left`}),this._renderSection({stops:n,x:r.branchB,yLevels:i.branchB.all,terminatesAtTop:!1,terminatesAtBottom:!0,notchSide:`right`}),this._drawLine(e=>{e.moveTo(r.common,i.common.bottom),e.lineTo(r.common,i.common.bottom+A),e.bezierCurveTo(r.common,i.common.bottom+j+A,r.branchA,i.branches.top-j,r.branchA,i.branches.top),e.lineTo(r.branchA,i.branchA.top),e.moveTo(r.common,i.common.bottom+A),e.bezierCurveTo(r.common,i.common.bottom+j+A,r.branchB,i.branches.top-j,r.branchB,i.branches.top),e.lineTo(r.branchB,i.branchA.top)})}_measure(){let{commonStops:e,branchAStops:t,branchBStops:n}=this.data.structure,r=this._extractYLevels(e,N),i=d(r[0]),a=d(r[r.length-1]),o=this._extractYLevels(t,P),s=d(o[0]),c=d(o[o.length-1]),l=this._extractYLevels(n,F),u=d(l[0]),f=d(l[l.length-1]);return{x:{common:this.width/2,branchA:8,branchB:this.width-8},y:{common:{all:r,top:i,bottom:a},branchA:{all:o,top:s,bottom:c},branchB:{all:l,top:u,bottom:f},branches:{top:Math.min(s,u),bottom:Math.max(c,f)}}}}},N=`_diagram-common-stops`,P=`_diagram-branch-a-stops`,F=`_diagram-branch-b-stops`;function I(n){let{settings:i}=y(),s=e(()=>({structure:n.structure,lightThemeColorHexCode:n.lightThemeColorHexCode,darkThemeColorHexCode:n.darkThemeColorHexCode,colorTheme:i.theme}),[n.darkThemeColorHexCode,n.lightThemeColorHexCode,n.structure,i.theme]),l=c((e,t)=>new M(e,t),[]);return s.structure.commonStops.length<1||s.structure.branchAStops.length<1||s.structure.branchBStops.length<1?r(p,{}):r(o,{class:t(n.class,`grid-cols-[auto_auto_auto] grid-rows-[auto_auto] gap-y-8 gap-x-4`),children:[r(f,{class:`w-12 col-2 row-span-full`,createController:l,data:s}),r(a,{class:t(`gap-6 col-3 row-1 -ml-4`,N),xAlign:`left`,children:n.structure.commonStops.map(e=>r(o,{children:e.content}))}),r(a,{class:t(`gap-6 col-1 row-2`,P),xAlign:`right`,children:n.structure.branchAStops.map(e=>r(o,{children:e.content}))}),r(a,{class:t(`gap-6 col-3 row-2`,F),xAlign:`left`,children:n.structure.branchBStops.map(e=>r(o,{children:e.content}))})]})}function L(t){let{foda:n}=u(),i=e(()=>({type:`branch`,commonStops:O(n,t.diagram.commonStops),branchAStops:O(n,t.diagram.branchAStops),branchBStops:O(n,t.diagram.branchBStops)}),[n,t.diagram]);return r(I,{class:t.class,structure:i,lightThemeColorHexCode:t.diagram.color?.lightModeHexCode??null,darkThemeColorHexCode:t.diagram.color?.darkModeHexCode??null})}var R=10,z=15,B=24,V=1,H=class extends h{_onRenderStructure(){let{loopLeftStops:e,loopRightStops:t,mainStops:n}=this.data.structure,{x:r,y:i}=this._measure();if(e.length>0?this._renderSection({stops:e,x:r.loopLeft,yLevels:i.loopLeft.all,terminatesAtTop:!1,terminatesAtBottom:!1,notchSide:`left`}):this._drawLine(e=>{e.moveTo(r.loopLeft,i.loopLeft.top-V),e.lineTo(r.loopLeft,i.loopLeft.bottom+V)}),t.length>0?this._renderSection({stops:t,x:r.loopRight,yLevels:i.loopRight.all,terminatesAtTop:!1,terminatesAtBottom:!1,notchSide:`right`}):this._drawLine(e=>{e.moveTo(r.loopRight,i.loopRight.top-V),e.lineTo(r.loopRight,i.loopRight.bottom+V)}),n.length>0){let e=d(i.main.top);this._renderSection({stops:n,x:r.main,yLevels:i.main.all,terminatesAtTop:!1,terminatesAtBottom:!0,notchSide:`right`}),this._drawLine(t=>{t.moveTo(r.main,e),t.lineTo(r.main,e-R),t.bezierCurveTo(r.main,e-z-R,r.loopLeft,i.loop.bottom+z,r.loopLeft,i.loop.bottom),t.lineTo(r.loopLeft,i.loopLeft.bottom),t.moveTo(r.main,e-R),t.bezierCurveTo(r.main,e-z-R,r.loopRight,i.loop.bottom+z,r.loopRight,i.loop.bottom),t.lineTo(r.loopRight,i.loopRight.bottom)}),this.ctx.stroke()}else this._drawLine(e=>{e.moveTo(r.loopLeft,i.loopLeft.bottom),e.lineTo(r.loopLeft,i.loop.bottom),e.bezierCurveTo(r.loopLeft,i.loop.bottom+B,r.loopRight,i.loop.bottom+B,r.loopRight,i.loop.bottom),e.lineTo(r.loopRight,i.loopRight.bottom)});this._drawLine(e=>{e.moveTo(r.loopLeft,i.loopLeft.top),e.lineTo(r.loopLeft,i.loop.top),e.bezierCurveTo(r.loopLeft,i.loop.top-B,r.loopRight,i.loop.top-B,r.loopRight,i.loop.top),e.lineTo(r.loopRight,i.loopRight.top)})}_measure(){let{loopLeftStops:e,loopRightStops:t,mainStops:n}=this.data.structure,r=this._extractYLevels(e,W),i=this._extractYLevels(t,G),a=this._extractYLevels(n,U),o=r[0],s=i[0],c=r[r.length-1],l=i[i.length-1],u=d(o??s),f=d(s??o),p=d(c??l),m=d(l??c);return{x:{loopLeft:8,loopRight:this.width-8,main:this.width/2},y:{loopLeft:{all:r,top:u,bottom:p},loopRight:{all:i,top:f,bottom:m},main:{all:a,top:a[0]??null,bottom:a[a.length-1]??null},loop:{top:Math.min(u,f),bottom:Math.max(p,m)}}}}},U=`_diagram-main-stops`,W=`_diagram-loop-left-stops`,G=`_diagram-loop-right-stops`;function K(n){let{settings:i}=y(),s=e(()=>({structure:n.structure,lightThemeColorHexCode:n.lightThemeColorHexCode,darkThemeColorHexCode:n.darkThemeColorHexCode,colorTheme:i.theme}),[n.darkThemeColorHexCode,n.lightThemeColorHexCode,n.structure,i.theme]),l=c((e,t)=>new H(e,t),[]),{loopLeftStops:u,loopRightStops:d}=s.structure;return u.length+d.length<1?r(p,{}):r(o,{class:t(n.class,`grid-cols-[auto_auto_auto] grid-rows-[auto_auto] gap-x-4`),children:[r(f,{class:`w-12 col-2 row-span-full`,createController:l,data:s}),r(a,{class:t(`gap-6 col-1 row-1 py-4`,W),xAlign:`right`,yAlign:`center`,children:n.structure.loopLeftStops.map(e=>r(o,{children:e.content}))}),r(a,{class:t(`gap-6 col-3 row-1 py-4`,G),xAlign:`left`,yAlign:`center`,children:n.structure.loopRightStops.map(e=>r(o,{children:e.content}))}),r(a,{class:t(`gap-6 col-3 row-2 -ml-4`,U,{"pt-4":n.structure.mainStops.length>0}),xAlign:`left`,children:n.structure.mainStops.map(e=>r(o,{children:e.content}))})]})}function q(t){let{foda:n}=u(),i=e(()=>({type:`loop`,loopLeftStops:O(n,t.diagram.loopLeftStops),loopRightStops:O(n,t.diagram.loopRightStops),mainStops:O(n,t.diagram.mainStops)}),[n,t.diagram]);return r(K,{class:t.class,structure:i,lightThemeColorHexCode:t.diagram.color?.lightModeHexCode??null,darkThemeColorHexCode:t.diagram.color?.darkModeHexCode??null})}function J(e){return r(o,{class:t(e.class,`bg-bg-raised px-4 py-8 justify-center rounded-sm border border-soft-border`),children:r(Y,{diagram:e.diagram})})}function Y(e){if(e.diagram.type===`linear`)return r(k,{diagram:e.diagram});if(e.diagram.type===`branch`)return r(L,{diagram:e.diagram});if(e.diagram.type===`loop`)return r(q,{diagram:e.diagram});E(e.diagram)}function X(e){let i=e.diagram.entries.filter(e=>l(e.type));return i.length<e.diagram.entries.length?r(D,{fallbackStopList:e.diagram.fallbackStopList}):r(a,{class:t(e.class,`gap-6`),children:[r(n,{style:`subtitle`,children:`Diagram`}),i.length===1?r(J,{diagram:d(i[0])}):r(Z,{entries:i},i.length)]})}function Z(t){let[n,i]=s(0),o=e(()=>t.entries.map((e,t)=>({value:t.toFixed(),label:e.name??`Route ${t+1}`})),[t.entries]);return r(a,{class:`gap-4`,children:[r(T,{class:`self-start`,value:n.toFixed(),options:o,onChange:e=>{i(m(e))}}),r(J,{diagram:d(t.entries[n])})]})}function Q(){let{params:{id:t}}=i(),{foda:n}=u(),a=e(()=>n.lines.getByUrlPath(t??``),[n.lines,t]);return a==null?r(w,{afterConfirming:`foundational-data-version`}):r($,{line:a},a.id)}function $(e){let{formatLine:t}=v();return r(x,{...S({title:t(e.line.name),back:{href:`/`,text:`Home`}}),children:r(a,{class:`px-4 py-8 gap-8`,children:e.line.diagram.entries.length>0&&r(X,{diagram:e.line.diagram})})})}export{Q as default};
@@ -0,0 +1 @@
1
+ import{l as e}from"./use-nav-exemptions-QtGbfEPT.js";import{t}from"./NotFoundPage-DLkgQE3z.js";function n(){return e(t,{afterConfirming:`frontend-version`})}export{n as default};
@@ -0,0 +1 @@
1
+ import{h as e,i as t,l as n,r,v as i}from"./use-nav-exemptions-QtGbfEPT.js";import{i as a}from"./use-api-BJomuYg6.js";import{n as o}from"./use-foundational-data-BEVQRFj9.js";import{_ as s,c,f as l,n as u,o as d,t as f,v as p}from"./index-CE8NAPhv.js";import{t as m}from"./Page-BMcxP_9m.js";function h(e){let t=u(a,{}),n=g(e===`frontend-version`,t),r=_(e===`foundational-data-version`,t);return t.loading||n||r}function g(t,n){let{isHotReloadingEnabled:r}=f(),{frontendVersion:i}=p(),{unregister:a}=d(),o=t&&!r&&!n.loading&&n.error==null&&n.data!=null&&n.data.frontendVersion!==i;return e(()=>{if(!o)return;async function e(){await a(),window.location.reload()}e()},[o,a]),o}function _(t,n){let{foda:r,forceFodaUpdate:a}=o(),[s,c]=i(!1),[l,u]=i(!1),d=t&&!n.loading&&n.error==null&&n.data!=null&&n.data.foundationalDataHash!==r.hash;return e(()=>{if(!d)return;async function e(){u(!0);try{await a()}catch{console.warn(`Foundational data is outdated, but force update failed.`)}finally{c(!0),u(!1)}}e()},[d,a]),d&&!s||l}function v({afterConfirming:e}){return h(e)?n(m,{mobileHeader:null,desktopHeader:null,children:n(r,{xAlign:`center`,yAlign:`center`,children:n(s,{})})}):n(m,{mobileHeader:null,desktopHeader:null,children:n(r,{class:`px-4 py-8 gap-8`,xAlign:`center`,yAlign:`center`,children:[n(t,{style:`title`,align:`center`,children:`Page not found`}),n(t,{align:`center`,children:`This page doesn't exist, at least not anymore!`}),n(l,{href:`/`,text:`Go home`,icon:c})]})})}export{v as t};
@@ -1 +1 @@
1
- import{c as e,i as t,l as n}from"./use-nav-exemptions-QtGbfEPT.js";import{m as r,p as i}from"./index-DapCozyq.js";var a=[`bg-transparent`,`group-hover:bg-soft-hover`,`group-active:bg-soft-active`],o=[`bg-accent`,`group-hover:bg-accent-hover`,`group-active:bg-accent-active`],s=[`[--color-fg:var(--color-on-accent)]`,`[--color-fg-strong:var(--color-on-accent)]`,`[--color-fg-weak:var(--color-on-accent)]`],c=e(a),l=e(o),u=e(s);function d(t){return n(i,{class:e(t.class,`overflow-hidden rounded-sm border border-accent max-w-full`),children:t.options.map((e,r)=>n(f,{class:`shrink`,label:e.label,active:e.value===t.value,last:r===t.options.length-1,onClick:()=>t.onChange(e.value)},e.value))})}function f(a){return n(r,{class:e(a.class,`relative group min-h-8`,{[u]:a.active,"border-r border-accent":!a.last}),onClick:a.onClick,children:[n(`div`,{class:e(`absolute z-0 top-0 bottom-0 left-0 right-0`,{[c]:!a.active,[l]:a.active})}),n(i,{class:`relative z-1 px-6 py-2 min-w-0`,xAlign:`center`,yAlign:`center`,children:n(t,{class:`shrink min-w-min`,align:`center`,children:a.label})})]})}export{d as t};
1
+ import{c as e,i as t,l as n}from"./use-nav-exemptions-QtGbfEPT.js";import{h as r,m as i}from"./index-CE8NAPhv.js";var a=[`bg-transparent`,`group-hover:bg-soft-hover`,`group-active:bg-soft-active`],o=[`bg-accent`,`group-hover:bg-accent-hover`,`group-active:bg-accent-active`],s=[`[--color-fg:var(--color-on-accent)]`,`[--color-fg-strong:var(--color-on-accent)]`,`[--color-fg-weak:var(--color-on-accent)]`],c=e(a),l=e(o),u=e(s);function d(t){return n(i,{class:e(t.class,`overflow-hidden rounded-sm border border-accent max-w-full`),children:t.options.map((e,r)=>n(f,{class:`shrink`,label:e.label,active:e.value===t.value,last:r===t.options.length-1,onClick:()=>t.onChange(e.value)},e.value))})}function f(a){return n(r,{class:e(a.class,`relative group min-h-8`,{[u]:a.active,"border-r border-accent":!a.last}),onClick:a.onClick,children:[n(`div`,{class:e(`absolute z-0 top-0 bottom-0 left-0 right-0`,{[c]:!a.active,[l]:a.active})}),n(i,{class:`relative z-1 px-6 py-2 min-w-0`,xAlign:`center`,yAlign:`center`,children:n(t,{class:`shrink min-w-min`,align:`center`,children:a.label})})]})}export{d as t};
@@ -0,0 +1 @@
1
+ import{_ as e,c as t,i as n,l as r,m as i,r as a,s as o}from"./use-nav-exemptions-QtGbfEPT.js";import{o as s}from"./use-api-BJomuYg6.js";import{n as c}from"./use-foundational-data-BEVQRFj9.js";import{a as l,t as u}from"./linear-CMwrWzQJ.js";import{t as d}from"./LinkText-sdmJpshg.js";import{_ as f,c as p,f as m,m as h}from"./index-CE8NAPhv.js";import{t as g}from"./Page-BMcxP_9m.js";import{t as _}from"./use-simple-headers-Bihzijd5.js";import{t as v}from"./use-foda-synced-query-BM-OPAql.js";function y(n){let{foda:i}=c(),a=e(()=>({type:`linear`,stops:b(i,n.service.movements)}),[i,n.service.movements]);return r(o,{class:t(n.class),children:r(u,{class:n.class,structure:a,lightThemeColorHexCode:n.service.color?.lightModeHexCode??null,darkThemeColorHexCode:n.service.color?.darkModeHexCode??null})})}function b(e,t){return t.map(t=>{let i=e.stops.require(t.stopId),a=`/stop/${i.urlPath}`,o=t.arrivalTime==null?null:new Date(Date.parse(t.arrivalTime)).toLocaleString(),s=t.departureTime==null?null:new Date(Date.parse(t.departureTime)).toLocaleString();if(o==null&&s==null)return{content:r(n,{style:`small-weak`,children:r(d,{href:a,style:`subtle`,children:[`Skips `,i.name]})}),drawMark:!1};let c=s??o;return{content:r(h,{class:`gap-2 min-w-0`,children:[r(n,{style:`strong`,children:r(d,{href:a,style:`subtle`,children:i.name})}),r(n,{children:`•`}),r(n,{class:`shrink min-w-0`,oneLine:!0,children:c})]})}})}function x(){let{params:{sourceId:e,intrasourceId:t},query:{from:n}}=i(),{data:a,loading:o,error:c}=v(s,{sourceId:e??``,intrasourceId:t??``}),u=l(n??``);return o?r(C,{}):c!=null||a==null||u==null||u<0||a.service!=null&&u>a.service.movements.length-1?r(w,{}):a.service==null?r(T,{}):r(S,{service:a.service,movementIndex:u},`${e}/${t}`)}function S(e){return r(g,{..._({title:`${e.service.primaryDestinationText} service`,back:{href:`/`,text:`Home`}}),children:r(a,{class:`px-4 py-8 gap-8`,children:[r(y,{service:e.service}),r(n,{style:`small-narrow`,children:`(Real-time data has not been provided for all stops. Times marked with * are estimates, extrapolated from the available data.)`})]})})}function C(){return r(g,{..._({title:`Loading...`,back:{href:`/`,text:`Home`}}),children:r(f,{})})}function w(){return r(g,{..._({title:`Error`,back:{href:`/`,text:`Home`}}),children:r(n,{children:`Failed to load service.`})})}function T(){return r(g,{mobileHeader:null,desktopHeader:null,children:r(a,{class:`px-4 py-8 gap-8`,xAlign:`center`,yAlign:`center`,children:[r(n,{style:`title`,align:`center`,children:`Service not found`}),r(n,{align:`center`,children:`This can happen if the service was cancelled, or the timetable changed since this link was generated. You might be able to find it again by searching for one of the stops it departed from.`}),r(m,{href:`/`,text:`Go home`,icon:p})]})})}export{x as default};
@@ -1 +1 @@
1
- import{i as e,l as t,r as n}from"./use-nav-exemptions-QtGbfEPT.js";import{l as r,u as i}from"./index-DapCozyq.js";import{t as a}from"./Page-BMcxP_9m.js";import{t as o}from"./use-simple-headers-CovxFlVs.js";import{t as s}from"./Divider-lz6Cf6K8.js";import{t as c}from"./Picker-B59cZ5e5.js";var l={auto:`Auto`,light:`Light`,dark:`Dark`},u=r.map(e=>({value:e,label:l[e]}));function d(e){let{settings:n,updateSettings:r}=i();return t(c,{class:e.class,value:n.theme,options:u,onChange:e=>{r(t=>t.with({theme:e}))}})}function f(){return t(a,{...o({title:`Settings`}),children:t(n,{class:`px-4 py-8 gap-8`,children:[t(n,{class:`gap-6`,children:[t(e,{style:`strong`,children:`Theme`}),t(e,{children:`"Auto" means the colour theme should follow your device's/browser's settings.`}),t(d,{class:`self-start`})]}),t(s,{}),t(e,{style:`small-weak`,children:`(Settings are saved to your device's/browser's local storage.)`})]})})}export{f as default};
1
+ import{i as e,l as t,r as n}from"./use-nav-exemptions-QtGbfEPT.js";import{d as r,u as i}from"./index-CE8NAPhv.js";import{t as a}from"./Page-BMcxP_9m.js";import{t as o}from"./use-simple-headers-Bihzijd5.js";import{t as s}from"./Divider-lz6Cf6K8.js";import{t as c}from"./Picker-ByWHXE97.js";var l={auto:`Auto`,light:`Light`,dark:`Dark`},u=i.map(e=>({value:e,label:l[e]}));function d(e){let{settings:n,updateSettings:i}=r();return t(c,{class:e.class,value:n.theme,options:u,onChange:e=>{i(t=>t.with({theme:e}))}})}function f(){return t(a,{...o({title:`Settings`}),children:t(n,{class:`px-4 py-8 gap-8`,children:[t(n,{class:`gap-6`,children:[t(e,{style:`strong`,children:`Theme`}),t(e,{children:`"Auto" means the colour theme should follow your device's/browser's settings.`}),t(d,{class:`self-start`})]}),t(s,{}),t(e,{style:`small-weak`,children:`(Settings are saved to your device's/browser's local storage.)`})]})})}export{f as default};
@@ -1 +1 @@
1
- import{c as e,i as t,l as n}from"./use-nav-exemptions-QtGbfEPT.js";import{d as r,p as i}from"./index-DapCozyq.js";function a(e){return n(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:n(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M14.657 17.657L9 12l5.657-5.657`})})}function o(o){return n(i,{class:e(o.class,`gap-2`,{"px-4":o.backHref==null,"pl-2 pr-4":o.backHref!=null}),yAlign:`center`,children:[o.backHref!=null&&n(r,{href:o.backHref,icon:a,theme:`hover`}),n(t,{style:`title`,children:o.title})]})}export{a as n,o as t};
1
+ import{c as e,i as t,l as n}from"./use-nav-exemptions-QtGbfEPT.js";import{f as r,m as i}from"./index-CE8NAPhv.js";function a(e){return n(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:n(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M14.657 17.657L9 12l5.657-5.657`})})}function o(o){return n(i,{class:e(o.class,`gap-2`,{"px-4":o.backHref==null,"pl-2 pr-4":o.backHref!=null}),yAlign:`center`,children:[o.backHref!=null&&n(r,{href:o.backHref,icon:a,theme:`hover`}),n(t,{style:`title`,children:o.title})]})}export{a as n,o as t};
@@ -1 +1 @@
1
- import{i as e,l as t,r as n}from"./use-nav-exemptions-QtGbfEPT.js";import{t as r}from"./Page-BMcxP_9m.js";import{t as i}from"./use-simple-headers-CovxFlVs.js";function a(){return t(r,{...i({title:`Status`}),children:t(n,{class:`px-4 py-8 gap-8`,children:t(e,{children:`LGTM`})})})}export{a as default};
1
+ import{i as e,l as t,r as n}from"./use-nav-exemptions-QtGbfEPT.js";import{t as r}from"./Page-BMcxP_9m.js";import{t as i}from"./use-simple-headers-Bihzijd5.js";function a(){return t(r,{...i({title:`Status`}),children:t(n,{class:`px-4 py-8 gap-8`,children:t(e,{children:`LGTM`})})})}export{a as default};
@@ -0,0 +1 @@
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-CE8NAPhv.js";import{t as v}from"./Page-BMcxP_9m.js";import{n as y,t as b}from"./SimpleMobileHeaderContent-DnaUyjiU.js";import{t as x}from"./NotFoundPage-DLkgQE3z.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.isError?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,isError:e.feed.isError})]})}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,isError:a!=null},{query:{title:`Outbound trains`,count:5},departures:n?.departures??[],loading:i,isError: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 +1 @@
1
- import{i as e,l as t,r as n}from"./use-nav-exemptions-QtGbfEPT.js";import{t as r}from"./Strong-C0VDYprE.js";import{t as i}from"./Page-BMcxP_9m.js";import{t as a}from"./use-simple-headers-CovxFlVs.js";function o(){return t(i,{...a({title:`Zen mode`}),children:t(n,{class:`px-4 py-8 gap-8`,children:t(e,{children:[t(r,{children:`✨`}),` Zen! `,t(r,{children:`✨`})]})})})}export{o as default};
1
+ import{i as e,l as t,r as n}from"./use-nav-exemptions-QtGbfEPT.js";import{t as r}from"./Strong-C0VDYprE.js";import{t as i}from"./Page-BMcxP_9m.js";import{t as a}from"./use-simple-headers-Bihzijd5.js";function o(){return t(i,{...a({title:`Zen mode`}),children:t(n,{class:`px-4 py-8 gap-8`,children:t(e,{children:[t(r,{children:`✨`}),` Zen! `,t(r,{children:`✨`})]})})})}export{o as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/About-DpFLDTV_.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-Bihzijd5.js","assets/SimpleMobileHeaderContent-DnaUyjiU.js","assets/Divider-lz6Cf6K8.js","assets/Alert-k_U4L_j3.js","assets/MingcuteAlertLine-CdthHQmK.js","assets/AdminControls-BMTTV4kR.js","assets/Debug-DGqHdl31.js","assets/Home-LcK9TehM.js","assets/Nearby-BNDxZx1J.js","assets/Service-CqfnDpff.js","assets/linear-CMwrWzQJ.js","assets/scope-B-e4l8Dr.js","assets/ErrorMessage-CCAB4vXB.js","assets/use-foda-synced-query-BM-OPAql.js","assets/Settings-1Z6FXsgC.js","assets/Picker-ByWHXE97.js","assets/Status-DIIRyqgr.js","assets/ZenMode-qKwx-pZt.js","assets/Stop-DKWaUN6o.js","assets/NotFoundPage-DLkgQE3z.js","assets/Line-ZicduquS.js","assets/NotFound-zNBih-TR.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,y as S}from"./use-nav-exemptions-QtGbfEPT.js";import{a as ee,c as te,f as ne,g as re,h as ie,m as C,n as ae,p as w,r as oe,s as se,t as ce}from"./use-api-BJomuYg6.js";import{n as T,t as le}from"./use-foundational-data-BEVQRFj9.js";import{n as E,t as D}from"./scope-B-e4l8Dr.js";import{t as ue}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 de=n.__b;n.__b=e=>{e.type&&e.type._forwarded&&e.ref&&(e.props.ref=e.ref,e.ref=null),de&&de(e)};function O(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 fe=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)}fe&&fe(e,t,n)};function pe(e){return this.__c=me,this.componentDidCatch=e.onError,e.children}function me(e){e.then(()=>this.forceUpdate())}var he=`modulepreload`,ge=function(e){return`/`+e},_e={},ve=function(e){return e.pathname.endsWith(`.css`)},ye=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},k=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=ge(t,n);let r=s(t),i=ve(r);return ye(_e,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`:he,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)})},A=t(null);function j(){let e=i(A);if(e==null)throw Error(`Static data unavailable outside provider.`);return e}function be(e){let{Provider:t}=A,n=r(()=>xe(document),[]);return d(t,{value:n,children:e.children})}function xe(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 M=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}},Se=class extends M{_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)}},Ce=class extends M{_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)}},N=class e{_obj;stops;lines;constructor(e){this._obj=e,this.stops=new Se(e.stops),this.lines=new Ce(e.lines)}static json=te.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}};function P(e,t){let n=S(()=>{let n=localStorage.getItem(e);if(n==null)return null;try{return t.parse(JSON.parse(n))}catch{return null}},[e,t]),i=S(t=>{let n=JSON.stringify(t);localStorage.setItem(e,n)},[e]);return r(()=>({get:n,set:i}),[n,i])}var we={default:`text-icon-lg text-fg-weak`,large:`text-icon-xl text-fg-weak`};function F(e){return d(`svg`,{className:a(`_loading-spinner`,we[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 Te={left:`justify-start`,center:`justify-center`,right:`justify-end`,"space-between":`justify-between`},Ee={top:`items-start`,center:`items-center`,bottom:`items-end`,stretch:`items-stretch`};function R(e){let t=e.as??`div`,n=Te[e.xAlign??`left`],r=Ee[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 De=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)]`]),Oe=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 B(e){let t=e.rounded??!0;return d(L,{class:a(e.class,De),onClick:e.onClick,href:e.href,onHrefClick:e.onHrefClick,disabled:(e.disabled??!1)||(e.loading??!1),children:[d(`div`,{class:a(Oe,{"rounded-sm":t})}),d(z,{class:`z-1`,loading:e.loading??!1,children:e.children})]})}function ke(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 Ae=a([`relative`,`group`,`disabled:[--color-fg:var(--color-fg-weak)]`,`disabled:[--color-fg-strong:var(--color-fg-weak)]`]),je=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 Me(e){return d(L,{class:a(e.class,Ae),onClick:e.onClick,href:e.href,onHrefClick:e.onHrefClick,disabled:(e.disabled??!1)||(e.loading??!1),children:[d(`div`,{class:je}),d(z,{class:`z-1`,loading:e.loading??!1,children:e.children})]})}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-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 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`]);function V(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 Re=a([`relative`,`group`,`disabled:[--color-fg:var(--color-fg-weak)]`,`disabled:[--color-fg-strong:var(--color-fg-weak)]`]),ze=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 H(e){return d(L,{class:a(e.class,Re),onClick:e.onClick,href:e.href,onHrefClick:e.onHrefClick,disabled:(e.disabled??!1)||(e.loading??!1),children:[d(`div`,{class:ze}),d(z,{class:`z-1`,loading:e.loading??!1,children:e.children})]})}function U(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 Be=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)]`]),Ve=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 He(e){return d(L,{class:a(e.class,Be),onClick:e.onClick,href:e.href,onHrefClick:e.onHrefClick,disabled:(e.disabled??!1)||(e.loading??!1),children:[d(`div`,{class:Ve}),d(z,{class:`z-1`,loading:e.loading??!1,children:e.children})]})}var Ue=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)]`]),We=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 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-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)]`]),qe=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 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})]})}function Ye(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 Xe={default:Me,accent:B,outlined:Fe,hover:V,"hover-square":H,error:He,warning:Ge,success:Je},Ze={simple:ke,"menu-item":U,"narrow-icon":Ye};function W(e){let t=Xe[e.theme??`default`],n=Ze[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 Qe(e){let{appName:t}=j();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(W,{text:`Retry`,icon:I,onClick:e.onRetry})]}):d(F,{style:`large`})]})})}var G=t(null);function K(){let e=i(G);if(e==null)throw Error(`Settings unavailable outside provider.`);return e}var q=se,$e=ie([C({result:w(`outdated`),foundationalData:re()}),C({result:w(`up-to-date`)})]),et=`corequery-foundational-data`,tt=2e3;function nt(e){let{Provider:t}=le,{revalidateSettings:n}=K(),i=P(et,N.json),[a]=y(()=>i.get()),[o,s]=y(null),[c,u]=y(!1),f=S(e=>{s(e),n(e)},[n]),p=S(e=>{let t=N.json.parse(e);return f(t),i.set(e),t.hash},[f,i]),m=S(async()=>{let e=await J(null,null);if(e.result===`up-to-date`)throw Error();return p(e.foundationalData)},[p]),h=S(()=>{u(!1),rt({cachedData:a,onFreshFoda:e=>p(e),onUseCachedFoda:e=>f(e),onFailure:()=>u(!0)})},[a,p,f]);l(()=>{h()},[h]);let g=r(()=>o==null?null:{foda:o,forceFodaUpdate:m},[o,m]);return g==null?d(Qe,{error:c,onRetry:h}):d(t,{value:g,children:e.children})}async function rt({cachedData:e,onFreshFoda:t,onUseCachedFoda:n,onFailure:r}){if(e!=null)try{let r=await J(e.hash,tt);r.result===`up-to-date`?n(e):t(r.foundationalData)}catch(t){console.warn(`Foundational data refresh failed - using cache.`,t),n(e)}else try{let e=await J(null,null);if(e.result===`up-to-date`)throw Error();t(e.foundationalData)}catch{r()}}async function J(e,t){let n=await fetch(`/api${q.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${q.path}: ${e}`)}return $e.parse(await n.json())}var Y=class e{theme;constructor(e){this.theme=e.theme}static default=new e({theme:`auto`});static json=C({version:w(1),theme:ne([`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 oe(this.toJson(),e.toJson())}},it=[`auto`,`light`,`dark`];function at(){window.applyTheme?.()}function ot(e){let{Provider:t}=G,n=P(`corequery-settings`,Y.json),[i,a]=y(()=>n.get()??(console.warn(`Failed to load settings, using defaults.`),Y.default)),o=S((e,t)=>{a(r=>{let i=e(r);return(t?.persist??!0)&&n.set(i.toJson()),i}),at()},[n]),s=S(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 st(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 ct(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 lt(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 ut(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 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:`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 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`,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 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`,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 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:`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 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`,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 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.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 _t(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 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.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 yt(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 bt(){return[{name:`Home`,href:`/`,regularIcon:ut,activeIcon:lt,isActive:e=>e===`/`},{name:`Status`,href:`/status`,regularIcon:ct,activeIcon:st,isActive:e=>e===`/status`},{name:`Nearby`,href:`/nearby`,regularIcon:ft,activeIcon:dt,isActive:e=>e===`/nearby`},{name:`Search`,icon:mt,opensSearchDrawer:!0},{name:`More`,icon:pt,opensMoreDrawer:!0}]}function xt(){let{appName:e}=j();return[{name:`About ${e}`,href:`/about`,icon:_t},{name:`Settings`,href:`/settings`,icon:gt},{name:`Developer info`,href:`/debug`,icon:ht},{name:`Admin controls`,href:`/admin`,icon:vt},{name:`Zen mode`,href:`/zen`,icon:yt}]}var St=t(null);function X(){let e=i(St);if(e==null)throw Error(`Service worker data unavailable outside provider.`);return e}function Ct(e){let{isUpdateAvailable:t,update:n}=X(),[r,i]=y(!1);return l(()=>{e.menuFullyClosed&&i(t)},[t,e.menuFullyClosed]),r?d(B,{rounded:!1,onClick:()=>void n(),children:d(f,{children:d(U,{icon:I,text:`Update available — click to refresh`,outerPadding:!0})})}):null}function Z(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 wt(e){let t=xt(),n=Z(!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(W,{icon:t.icon,text:t.name,href:t.href,onHrefClick:e.onClose,theme:`hover-square`,layout:`menu-item`},t.href))})}),d(Ct,{menuFullyClosed:n})]})]})}function Tt(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 Et(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 Dt={stop:e=>e,station:e=>`${e} Station`},Ot={line:e=>`${e} Line`,route:e=>`Route ${e}`},kt={stop:`stops`,station:`stations`},At={line:`lines`,route:`routes`},jt={service:`services`,trip:`trips`,train:`trains`,tram:`trams`,bus:`buses`};function Mt(){let{foda:e}=T();return r(()=>({formatStop:Dt[e.terminology.stop],formatLine:Ot[e.terminology.line],pluralStopsTerm:kt[e.terminology.stop],pluralLinesTerm:At[e.terminology.line],pluralServicesTerm:jt[e.terminology.service]}),[e.terminology])}function Nt(e){let t=e.withLinks??!1;return d(u,{class:a(e.class),style:e.style,children:d(Pt,{lineIds:e.lineIds,withLinks:t})})}function Pt({lineIds:t,withLinks:n}){let{foda:r}=T();if(t.length===0)return{line:`No lines`,route:`No routes`}[r.terminology.line];let i=d(Ft,{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 Ft({lineIds:t,withLinks:n}){let{foda:i}=T(),a=r(()=>t.map(e=>It(e,i)).sort((e,t)=>e.name.localeCompare(t.name)),[t,i]);return a.length===1?d(Q,{data:D(a[0]),withLink:n}):a.length===2?d(e,{children:[d(Q,{data:D(a[0]),withLink:n}),` and`,` `,d(Q,{data:D(a[1]),withLink:n})]}):d(e,{children:[a.slice(0,-1).map((t,r)=>d(e,{children:[d(Q,{data:D(t),withLink:n},r),`,`,` `]})),` and `,d(Q,{data:D(a[a.length-1]),withLink:n})]})}function Q({data:t,withLink:n}){return n?d(ue,{href:t.href,style:`strong-subtle`,dynamicColor:t.color,children:t.name}):d(e,{children:t.name})}function It(e,t){let n=t.lines.require(e);return{name:n.name,href:`/line/${n.urlPath}`,color:n.color}}function Lt(){let{foda:e}=T(),{formatStop:t,formatLine:n,pluralStopsTerm:i,pluralLinesTerm:a}=Mt();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(Nt,{lineIds:e.canonicalLinesServingStop,style:`small`}),url:`/stop/${e.urlPath}`,icon:Tt}})),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:Et}}));return[...r,...i]},[e.lines,e.stops,n,t]),placeholder:r(()=>`Search ${i}, ${a}, etc.`,[a,i])}}var Rt={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 zt(e){let t=Rt[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(Bt,{onSubmit:e.onSubmit,children:e.search??!1?d(`input`,{type:`search`,...n}):d(`input`,{type:`text`,...n})})}function Bt(e){return e.onSubmit==null?e.children:d(`form`,{class:`grid`,autoComplete:`off`,onSubmit:t=>{t.preventDefault(),e.onSubmit?.()},children:e.children})}var Vt=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 Ht(e,t){return t.filter(t=>t.primary===e||t.alternatives.includes(e))}function Ut(e,t){return t.filter(t=>t.primary.startsWith(e)).sort((e,t)=>e.primary.length-t.primary.length)}function Wt(e,t){return t.filter(t=>t.primary.includes(e)).sort((e,t)=>e.primary.length-t.primary.length)}function Gt(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(E).sort((e,t)=>t.percentageMatched-e.percentageMatched).map(({candidate:e})=>e)}function Kt(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(E).sort((e,t)=>t.percentageMatched-e.percentageMatched).map(({candidate:e})=>e)}function qt(e,t,{maxResults:n=5}={}){let r=e.trim().toLowerCase();if(r.length===0)return[];let i=new Vt(r,t.map(e=>({...e,primary:e.primary.toLowerCase(),alternatives:e.alternatives.map(e=>e.toLowerCase())})),n);return i.appendResults(Ht,{passCandidatesRequiringExactMatch:!0}),i.appendResults(Ut),i.appendResults(Wt),i.appendResults(Gt),i.appendResults(Kt),i.getResults()}function Jt(e){return d(`div`,{class:a(e.class,`flex flex-col justify-center items-stretch`),style:{height:`${e.heightRem}rem`},children:e.children})}function Yt(e){return d(H,{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(Jt,{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 Xt(e){let[t,n]=y(``),{candidates:i,placeholder:o}=Lt(),{route:s}=m(),p=r(()=>qt(t,i,{maxResults:5}),[t,i]),_=Z(!e.open,300);l(()=>{_&&n(``)},[_]);let v=c(null),b=Z(e.open,100);l(()=>{b&&v.current?.focus()},[b]);function x(){p.length>0&&(s(D(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(zt,{style:`search`,value:t,onChange:n,class:`px-4 pl-12 h-10 desktop:h-8 desktop:pl-11`,placeholder:o,inputRef:v,onSubmit:x,search:!0}),d(mt,{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(Yt,{title:t.title,description:t.description,icon:t.icon,href:t.url,onHrefClick:e.onClose},t.url))]})]})})]})}function Zt(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 Qt(e){let{url:t}=m(),n=bt(),{isUpdateAvailable:r}=X();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(Zt,{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 $t(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(V,{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 en(e){return d(`img`,{class:a(e.class,`w-[1em] h-[1em]`),src:`/favicon.svg`})}function tn(e){let{appName:t}=j(),{url:n}=m(),r=bt(),{isUpdateAvailable:i}=X();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(V,{class:`self-center`,href:`/`,children:d(R,{class:`px-4 gap-2 h-8`,xAlign:`center`,yAlign:`center`,children:[d(en,{class:`text-icon-md`}),d(u,{style:`wordmark`,children:t})]})}),d(R,{children:r.map(t=>d($t,{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 nn(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(Qt,{onOpenMoreDrawerRequest:u,onOpenSearchDrawerRequest:f})}),d(`div`,{class:`not-desktop:hidden row-1 pointer-events-auto relative z-1`,children:n&&d(tn,{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(wt,{open:i,onClose:p})}),d(`div`,{class:a(`absolute top-0 left-0 right-0 z-1`,{"pointer-events-none":!s}),children:d(Xt,{open:s,onClose:p})}),d(`div`,{class:`absolute top-0 left-0 right-0 bottom-0 z-0`,onClick:p})]})]})}function rn(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(nn,{})})]})}var an=`false`,on=`false`,sn=an===`true`,cn=on===`true`;function ln(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,sn||u?.()};async function f(){if(`serviceWorker`in navigator){if(c=await k(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()},!cn){if(sn)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 un(e){let{Provider:t}=St,[n,i]=y(!1),[a,o]=y(!1),s=r(()=>ln({onRegisteredSW:()=>{},onRegisterError:e=>console.warn(`Service worker error:`,e),onNeedRefresh:()=>i(!0),onOfflineReady:()=>o(!0)}),[]),c=S(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 dn(e,t,n={}){let{callApi:r}=ce(),[i,a]=y(null),[o,s]=y(!0),[c,l]=y(null);return ae(()=>{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 $(){return{isHotReloadingEnabled:r(()=>!1,[])}}function fn(e){let{isHotReloadingEnabled:t}=$(),{frontendVersion:n,versionsOnLastUpdate:r}=j(),{unregister:i}=X(),{data:a,loading:o,error:s}=dn(ee,{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 pn=O(()=>k(()=>import(`./About-DpFLDTV_.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),mn=O(()=>k(()=>import(`./AdminControls-BMTTV4kR.js`),__vite__mapDeps([14,1,8,9,10]))),hn=O(()=>k(()=>import(`./Debug-DGqHdl31.js`),__vite__mapDeps([15,1,2,3,4,8,9,10,11,12,13]))),gn=O(()=>k(()=>import(`./Home-LcK9TehM.js`),__vite__mapDeps([16,1,3,5,6,7,8,9,10]))),_n=O(()=>k(()=>import(`./Nearby-BNDxZx1J.js`),__vite__mapDeps([17,1,8]))),vn=O(()=>k(()=>import(`./Service-CqfnDpff.js`),__vite__mapDeps([18,1,2,3,19,20,21,13,6,8,9,10,22]))),yn=O(()=>k(()=>import(`./Settings-1Z6FXsgC.js`),__vite__mapDeps([23,1,8,9,10,11,24]))),bn=O(()=>k(()=>import(`./Status-DIIRyqgr.js`),__vite__mapDeps([25,1,8,9,10]))),xn=O(()=>k(()=>import(`./ZenMode-qKwx-pZt.js`),__vite__mapDeps([26,1,7,8,9,10]))),Sn=O(()=>k(()=>import(`./Stop-DKWaUN6o.js`),__vite__mapDeps([27,1,2,3,8,10,28,21,13,22]))),Cn=O(()=>k(()=>import(`./Line-ZicduquS.js`),__vite__mapDeps([29,1,2,3,20,19,21,13,6,8,9,10,12,28,24]))),wn=O(()=>k(()=>import(`./NotFound-zNBih-TR.js`),__vite__mapDeps([30,1,28,2,3,8])));function Tn(){return d(un,{children:d(be,{children:d(fn,{children:d(ot,{children:d(nt,{children:d(v,{children:d(rn,{children:d(pe,{children:d(s,{children:[d(o,{path:`/`,component:gn}),d(o,{path:`/about`,component:pn}),d(o,{path:`/admin`,component:mn}),d(o,{path:`/debug`,component:hn}),d(o,{path:`/line/:id`,component:Cn}),d(o,{path:`/nearby`,component:_n}),d(o,{path:`/service/:sourceId/:intrasourceId`,component:vn}),d(o,{path:`/settings`,component:yn}),d(o,{path:`/status`,component:bn}),d(o,{path:`/stop/:id`,component:Sn}),d(o,{path:`/zen`,component:xn}),d(o,{default:!0,component:wn})]})})})})})})})})})}x(d(Tn,{}),document.body);export{F as _,Mt as a,ut as c,K as d,W as f,I as g,L as h,Nt as i,ct as l,R as m,dn as n,X as o,H as p,Jt as r,_t as s,$ as t,it as u,j as v};
@@ -0,0 +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-CE8NAPhv.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};
@@ -0,0 +1,55 @@
1
+ import{g as e,h as t}from"./use-nav-exemptions-QtGbfEPT.js";function n(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function r(e,t=`|`){return e.map(e=>ce(e)).join(t)}function i(e,t){return typeof t==`bigint`?t.toString():t}var a=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function o(e){return new a(e)}function s(e){return e==null}function c(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function l(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function u(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function d(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function f(e){return d(e._zod.def)??e._zod.def.shape}function p(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return u(this,t,e),e},enumerable:!0,configurable:!0})}function m(e,t,n){t in e?u(e,t,n):e[t]=n}function h(e,t,n,r){let i=f(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?p(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):m(e,a,r?r(n.value,a):n.value))}}function ee(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?p(e,n,()=>t[n]):m(e,n,r.value))}}function g(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function te(e){return JSON.stringify(e)}function ne(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var re=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ie(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ae=o(()=>{if(k.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function _(e){if(ie(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ie(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function oe(e){return _(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var se=new Set([`string`,`number`,`symbol`]);function v(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function y(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function b(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ce(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function le(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var ue={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},de={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function fe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return h(i,e,pe(e,t)),y(e,g(n,{shape:i,checks:[]}))}function pe(e,t){let n=f(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function me(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(pe(e,t)),a={};return h(a,e,Reflect.ownKeys(f(e)).filter(e=>!i.has(e))),y(e,g(n,{shape:a,checks:[]}))}function he(e,t){if(!_(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=f(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return y(e,g(e._zod.def,{shape:ge(e,t)}))}function ge(e,t){let n={};return h(n,e,Reflect.ownKeys(f(e))),ee(n,t),n}function _e(e,t){if(!_(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return y(e,g(e._zod.def,{shape:ge(e,t)}))}function ve(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return h(n,e,Reflect.ownKeys(f(e))),h(n,t,Reflect.ownKeys(f(t))),y(e,g(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function ye(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(pe(t,n)):void 0,o={};return h(o,t,Reflect.ownKeys(f(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),y(t,g(t._zod.def,{shape:o,checks:[]}))}function be(e,t,n){let r=n?new Set(pe(t,n)):void 0,i={};return h(i,t,Reflect.ownKeys(f(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),y(t,g(t._zod.def,{shape:i}))}function x(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function xe(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Se(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function S(e){return typeof e==`string`?e:e?.message}function Ce(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function we(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function C(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:S(e.inst?._zod.def?.error?.(e))??S(a?.(e))??S(t?.error?.(e))??S(n.customError?.(e))??S(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var Te=/[\uD800-\uDBFF]/;function Ee(e){let t=e.length;if(!Te.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function De(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Oe(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function ke(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Ae(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Ne(e,n,r.value)}}function w(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function je(e,t,n){return w(e,t,n,!1)}function Me(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return w(this,n,r(this))},set(e){w(this,n,e)}})}return t}function Ne(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:w(this,t,n.bind(this))},set(e){w(this,t,e)}})}function Pe(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Fe,T=!1,Ie={configurable:!0,get(){T=!0}};function E(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Fe!==e._zod?Fe=void 0:(Fe=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Ie);let e=T;T=!1;try{let r=n(this);return T?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),T||=e,r}catch(n){throw delete this[t],T||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function Le(e,t,n,r){let i=Pe(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Re=`~constantCatch`;function ze(e){let t=()=>e;return t[Re]=!0,t}var Be,Ve={value:void 0,enumerable:!1},He=`captureStackTrace`in Error?Error:null;function Ue(e){let t=He;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return He=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function D(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Ve.value=new a(r);try{Object.defineProperty(n,"_zod",Ve)}finally{Ve.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Ae(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Ue(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var O=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},We=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Be=globalThis).__zod_globalConfig??(Be.__zod_globalConfig={});var k=globalThis.__zod_globalConfig;function A(e){return e&&Object.assign(k,e),k}function Ge(){let e=this._zod;return e.message??=JSON.stringify(e.def,i,2),e.message}function Ke(e){this._zod.message=e}var qe={get:Ge,set:Ke,enumerable:!0,configurable:!0},Je={value:void 0,enumerable:!1},Ye=new WeakSet([Object.prototype,Error.prototype]),Xe=D(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Je.value=t,Object.defineProperty(e,"issues",Je),Je.value=void 0,Object.defineProperty(e,"message",qe);let n=Object.getPrototypeOf(e);Ye.has(n)||(Ye.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function Ze(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Qe(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Ze(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function $e(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function et(e,t){return{callee:t?.callee??e,Err:t?.Err}}var tt=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new O;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>C(e,o,A())));throw re(n,a?.callee??t),n}return s.value};return t},nt=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>C(e,o,A())));throw re(n,a?.callee??t),n}return s.value};return t},rt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new O;return a.issues.length?it(e,a.issues,i):{success:!0,data:a.value}};function it(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>C(e,n,A()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var at=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?it(e,a.issues,i):{success:!0,data:a.value}},ot=Symbol.for(`zod.compile.invalid`),st=Symbol.for(`zod.compile.fallback`),ct=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==ot)return!0;if(r.definite===!0&&n===void 0)return!1}return lt(e,t,n)});function lt(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[st]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new O;return a.issues.length===0}var ut=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},dt=e=>{let t=tt(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,et(n,a))};return n},ft=e=>{let t=tt(e),n=(e,r,i,a)=>t(e,r,i,et(n,a));return n},pt=e=>{let t=nt(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,et(n,a))};return n},mt=e=>{let t=nt(e),n=async(e,r,i,a)=>await t(e,r,i,et(n,a));return n},ht=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return rt(e)(t,n,i)},gt=e=>(t,n,r)=>rt(e)(t,n,r),_t=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return at(e)(t,n,i)},vt=e=>async(t,n,r)=>at(e)(t,n,r),yt=/^[cC][0-9a-z]{6,}$/,bt=/^[0-9a-z]+$/,xt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,St=/^[0-9a-vA-V]{20}$/,Ct=/^[A-Za-z0-9]{27}$/,wt=/^[a-zA-Z0-9_-]{21}$/;function Tt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Et=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Dt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ot=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,kt=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,At=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function jt(){return new RegExp(At,`u`)}var Mt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Nt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Pt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ft=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,It=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Lt=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Rt=/^https?$/,zt=/^\+[1-9]\d{6,14}$/,Bt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Vt(e){return RegExp(`^${e}$`)}var Ht=Vt(Bt);function Ut(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Wt(e){return RegExp(`^${Ut(e)}$`)}function Gt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Ut({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Ut({precision:e.precision})}`:n;return RegExp(`^${Bt}T(?:${r})$`)}var Kt=/^[\s\S]{0,}$/,qt=/^-?\d+(?:\.\d+)?$/,Jt=/^(?:true|false)$/i,Yt=/^[^A-Z]*$/,Xt=/^[^a-z]*$/,j=D(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Zt=e=>{let t=e.value;return!s(t)&&t.length!==void 0},Qt={number:`number`,bigint:`bigint`,object:`date`},$t=D(`$ZodCheckLessThan`,(e,t)=>{j.init(e,t);let n=Qt[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Qt[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),en=D(`$ZodCheckGreaterThan`,(e,t)=>{j.init(e,t);let n=Qt[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Qt[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tn=D(`$ZodCheckMultipleOf`,(e,t)=>{j.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):l(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),nn=D(`$ZodCheckNumberFormat`,(e,t)=>{j.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ue[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),rn=D(`$ZodCheckMaxLength`,(e,t)=>{var n;j.init(e,t),(n=e._zod.def).when??(n.when=Zt),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Ee(r):i)<=t.maximum)return;let a=De(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),an=D(`$ZodCheckMinLength`,(e,t)=>{var n;j.init(e,t),(n=e._zod.def).when??(n.when=Zt),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Ee(r):i)>=t.minimum)return;let a=De(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),on=D(`$ZodCheckLengthEquals`,(e,t)=>{var n;j.init(e,t),(n=e._zod.def).when??(n.when=Zt),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Ee(r):i;if(a===t.length)return;let o=De(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),sn=D(`$ZodCheckStringFormat`,(e,t)=>{var n,r;j.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),cn=D(`$ZodCheckRegex`,(e,t)=>{sn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ln=D(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Yt,sn.init(e,t)}),un=D(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Xt,sn.init(e,t)}),dn=D(`$ZodCheckIncludes`,(e,t)=>{j.init(e,t);let n=v(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),fn=D(`$ZodCheckStartsWith`,(e,t)=>{j.init(e,t);let n=RegExp(`^${v(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),pn=D(`$ZodCheckEndsWith`,(e,t)=>{j.init(e,t);let n=RegExp(`.*${v(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),mn=D(`$ZodCheckOverwrite`,(e,t)=>{j.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),hn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
2
+ `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
3
+ `)}\n};`)(...Object.values(this.closed))}},gn={major:4,minor:6,patch:7},M=D(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gn;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=x(t),a;for(let o of n){if(o._zod.def.when){if(xe(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new O;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(we(t.issues,n,e),i||=x(t,n))});else{if(t.issues.length===n)continue;we(t.issues,n,e),i||=x(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(x(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new O;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new O;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return je(this,`~standard`,yn(this))},set"~standard"(e){w(this,`~standard`,e)}}),_n=(e,t)=>e.issues.length?{issues:e.issues.map(e=>C(e,t,A()))}:{value:e.value};async function vn(e,t){let n={async:!0};return _n(await e._zod.run({value:t,issues:[]},n),n)}function yn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return _n(r,n)}catch{}return vn(e,t)},vendor:`zod`,version:1}}var bn=D(`$ZodString`,(e,t)=>{M.init(e,t),e._zod.pattern=t.pattern??Kt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),N=D(`$ZodStringFormat`,(e,t)=>{sn.init(e,t),bn.init(e,t)}),xn=D(`$ZodGUID`,(e,t)=>{t.pattern??=Dt,N.init(e,t)}),Sn=D(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Ot(e)}else t.pattern??=Ot();N.init(e,t)}),Cn=D(`$ZodEmail`,(e,t)=>{t.pattern??=kt,N.init(e,t)});function wn(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Tn(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?wn(e)||2:En(e,t)}function En(e,t){if(!t.normalize&&t.protocol?.source===Rt.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var Dn=/[\t\n\r]/g;function On(e){return e.replace(Dn,``)}function kn(e,t){return t.lastIndex=0,t.test(e.hostname)}function An(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var jn=D(`$ZodURL`,(e,t)=>{N.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Tn(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=On(r);return}t.hostname&&!kn(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!An(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:On(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Mn=D(`$ZodEmoji`,(e,t)=>{t.pattern??=jt(),N.init(e,t)}),Nn=D(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?wt:Tt(t.length),N.init(e,t)}),Pn=D(`$ZodCUID`,(e,t)=>{t.pattern??=yt,N.init(e,t)}),Fn=D(`$ZodCUID2`,(e,t)=>{t.pattern??=bt,N.init(e,t)}),In=D(`$ZodULID`,(e,t)=>{t.pattern??=xt,N.init(e,t)}),Ln=D(`$ZodXID`,(e,t)=>{t.pattern??=St,N.init(e,t)}),Rn=D(`$ZodKSUID`,(e,t)=>{t.pattern??=Ct,N.init(e,t)}),zn=D(`$ZodISODateTime`,(e,t)=>{t.pattern??=Gt(t),N.init(e,t)}),Bn=D(`$ZodISODate`,(e,t)=>{t.pattern??=Ht,N.init(e,t)}),Vn=D(`$ZodISOTime`,(e,t)=>{t.pattern??=Wt(t),N.init(e,t)}),Hn=D(`$ZodISODuration`,(e,t)=>{t.pattern??=Et,N.init(e,t)}),Un=D(`$ZodIPv4`,(e,t)=>{t.pattern??=Mt,N.init(e,t)}),Wn=/^[0-9a-fA-F:.]+$/;function Gn(e){return Wn.test(e)?wn(`http://[${e}]`):!1}var Kn=D(`$ZodIPv6`,(e,t)=>{t.pattern??=Nt,N.init(e,t),e._zod.check=n=>{Gn(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),qn=D(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Pt,N.init(e,t)});function Jn(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Gn(n)}var Yn=D(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Ft,N.init(e,t),e._zod.check=n=>{Jn(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Xn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Zn=/^[0-9a-zA-Z+/]*={0,2}$/,Qn=D(`$ZodBase64`,(e,t)=>{t.pattern??=Zn,N.init(e,t),e._zod.check=n=>{Xn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),$n=/^[A-Za-z0-9_-]*$/;function er(e){if(!$n.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Xn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var tr=D(`$ZodBase64URL`,(e,t)=>{t.pattern??=$n,N.init(e,t),e._zod.check=n=>{er(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),nr=D(`$ZodE164`,(e,t)=>{t.pattern??=zt,N.init(e,t)});function rr(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var ir=D(`$ZodJWT`,(e,t)=>{N.init(e,t),e._zod.check=n=>{rr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),ar=D(`$ZodNumber`,(e,t)=>{M.init(e,t),e._zod.pattern=qt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),or=D(`$ZodNumberFormat`,(e,t)=>{nn.init(e,t),ar.init(e,t)}),sr=D(`$ZodBoolean`,(e,t)=>{M.init(e,t),e._zod.pattern=Jt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),cr=D(`$ZodUnknown`,(e,t)=>{M.init(e,t),e._zod.parse=e=>e}),lr=D(`$ZodNever`,(e,t)=>{M.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function ur(e,t){let n=Ce(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of Ce(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,we(n.issues,t,e),n}}return i(n,a)}}var dr=e=>Array.isArray(e)?e.length:-1;function fr(e,t,n){e.issues.length&&t.issues.push(...Se(n,e.issues)),t.value[n]=e.value}var pr=D(`$ZodArray`,(e,t)=>{M.init(e,t);let n=k.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>fr(t,r,e)));else if(fr(c,r,e),s&&c.issues.length!==0&&x(c))break}return o.length?Promise.all(o).then(()=>r):r},ur(e,dr)});function mr(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Se(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var hr=[];function gr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:hr,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=le(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function _r(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(x(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>mr(e,n,i,t,d,f))):mr(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var vr=D(`$ZodObject`,(e,t)=>{M.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=o(()=>gr(t));E(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||u(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=ie,s=t.catchall,c,l=k.memoizer;l?.attach(e),e._zod.parse=(t,n)=>{c??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=l?l.alloc(e,t,{},n):{};let o=[],u=c.shape,d=n?.abortEarly,f=t.issues.length;for(let e of c.allKeys){if(d&&t.issues.length!==f){if(x(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,s=i._zod.optout,c=i._zod.run({value:r[e],issues:[]},n);c instanceof Promise?o.push(c.then(n=>mr(n,t,e,r,a,s))):mr(c,t,e,r,a,s)}return s?_r(o,r,t,n,i.value,e,d===!0):o.length?Promise.all(o).then(()=>t):t}}),yr=D(`$ZodObjectJIT`,(e,t)=>{vr.init(e,t);let n=e._zod.parse,r=o(()=>gr(t)),i=k.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new hn([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
4
+ let ${e}_ab = false;
5
+ for (let i = 0; i < ${e}.issues.length; i++) {
6
+ const iss = ${e}.issues[i];
7
+ iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
8
+ payload.issues.push(iss);
9
+ if (iss.continue !== true) ${e}_ab = true;
10
+ }
11
+ if (${e}_ab && ctx && ctx.abortEarly) {
12
+ payload.value = newResult;
13
+ return payload;
14
+ }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:te(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
15
+ const ${n}_present = ${i};
16
+ if (!${n}.issues.length || ${n}_present) {
17
+ if (${n}.issues.length) {${c(n,r)}
18
+ }
19
+
20
+ if (${e}) {
21
+ newResult[${r}] = ${n}.value;
22
+ }
23
+ }
24
+
25
+ `)}else f?(o.write(`
26
+ if (${n}.issues.length) {${c(n,r)}
27
+ }
28
+ `),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
29
+ if (${n}.value !== undefined || ${i}) {
30
+ newResult[${r}] = ${n}.value;
31
+ }
32
+ `)):o.write(`
33
+ const ${n}_present = ${i};
34
+ if (${n}.issues.length) {${c(n,r)}
35
+ }
36
+ if (!${n}_present && !${n}.issues.length) {
37
+ payload.issues.push({
38
+ code: "invalid_type",
39
+ expected: "nonoptional",
40
+ input: undefined,
41
+ path: [${r}]
42
+ });
43
+ if (ctx && ctx.abortEarly) {
44
+ payload.value = newResult;
45
+ return payload;
46
+ }
47
+ }
48
+
49
+ if (${n}_present) {
50
+ newResult[${r}] = ${n}.value;
51
+ }
52
+
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
+
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};
@@ -0,0 +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 +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{d as a}from"./index-DapCozyq.js";import{n as o,t as s}from"./SimpleMobileHeaderContent-9gskaqRe.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-CE8NAPhv.js";import{n as o,t as s}from"./SimpleMobileHeaderContent-DnaUyjiU.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-DapCozyq.js"></script>
18
+ <script type="module" crossorigin src="/assets/index-CE8NAPhv.js"></script>
19
19
  <link rel="modulepreload" crossorigin href="/assets/use-nav-exemptions-QtGbfEPT.js">
20
- <link rel="modulepreload" crossorigin href="/assets/use-query-BRsiAaVY.js">
20
+ <link rel="modulepreload" crossorigin href="/assets/use-api-BJomuYg6.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">