@agent-profile/web 0.3.5 → 0.4.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 (305) hide show
  1. package/build/client/_app/immutable/chunks/Bjy-W4x2.js +81 -0
  2. package/build/client/_app/immutable/chunks/Bjy-W4x2.js.br +0 -0
  3. package/build/client/_app/immutable/chunks/Bjy-W4x2.js.gz +0 -0
  4. package/build/client/_app/immutable/chunks/{BcMnim1Z.js → BmxQso7w.js} +1 -1
  5. package/build/client/_app/immutable/chunks/BmxQso7w.js.br +3 -0
  6. package/build/client/_app/immutable/chunks/BmxQso7w.js.gz +0 -0
  7. package/build/client/_app/immutable/chunks/CY-inT3H.js +3 -0
  8. package/build/client/_app/immutable/chunks/CY-inT3H.js.br +0 -0
  9. package/build/client/_app/immutable/chunks/CY-inT3H.js.gz +0 -0
  10. package/build/client/_app/immutable/chunks/{DTBN031P.js → CyEm9M8C.js} +1 -1
  11. package/build/client/_app/immutable/chunks/CyEm9M8C.js.br +0 -0
  12. package/build/client/_app/immutable/chunks/CyEm9M8C.js.gz +0 -0
  13. package/build/client/_app/immutable/chunks/DYl5dUZ5.js +1 -0
  14. package/build/client/_app/immutable/chunks/DYl5dUZ5.js.br +0 -0
  15. package/build/client/_app/immutable/chunks/DYl5dUZ5.js.gz +0 -0
  16. package/build/client/_app/immutable/chunks/RwRNRscK.js +2 -0
  17. package/build/client/_app/immutable/chunks/RwRNRscK.js.br +0 -0
  18. package/build/client/_app/immutable/chunks/RwRNRscK.js.gz +0 -0
  19. package/build/client/_app/immutable/chunks/{D5fBh0I2.js → YBkAuHc6.js} +1 -1
  20. package/build/client/_app/immutable/chunks/YBkAuHc6.js.br +0 -0
  21. package/build/client/_app/immutable/chunks/YBkAuHc6.js.gz +0 -0
  22. package/build/client/_app/immutable/chunks/jSRqCab7.js +1 -0
  23. package/build/client/_app/immutable/chunks/jSRqCab7.js.br +2 -0
  24. package/build/client/_app/immutable/chunks/jSRqCab7.js.gz +0 -0
  25. package/build/client/_app/immutable/entry/app.WDp3PboB.js +2 -0
  26. package/build/client/_app/immutable/entry/app.WDp3PboB.js.br +0 -0
  27. package/build/client/_app/immutable/entry/app.WDp3PboB.js.gz +0 -0
  28. package/build/client/_app/immutable/entry/start.Rh_k7Qxe.js +1 -0
  29. package/build/client/_app/immutable/entry/start.Rh_k7Qxe.js.br +0 -0
  30. package/build/client/_app/immutable/entry/start.Rh_k7Qxe.js.gz +0 -0
  31. package/build/client/_app/immutable/nodes/0.-RAEeCLa.js +1 -0
  32. package/build/client/_app/immutable/nodes/0.-RAEeCLa.js.br +0 -0
  33. package/build/client/_app/immutable/nodes/0.-RAEeCLa.js.gz +0 -0
  34. package/build/client/_app/immutable/nodes/1.34MuZTH7.js +1 -0
  35. package/build/client/_app/immutable/nodes/1.34MuZTH7.js.br +0 -0
  36. package/build/client/_app/immutable/nodes/1.34MuZTH7.js.gz +0 -0
  37. package/build/client/_app/immutable/nodes/10.DplzwNzq.js +3 -0
  38. package/build/client/_app/immutable/nodes/10.DplzwNzq.js.br +0 -0
  39. package/build/client/_app/immutable/nodes/10.DplzwNzq.js.gz +0 -0
  40. package/build/client/_app/immutable/nodes/{11.3lkgWYOd.js → 11.DvcCox6n.js} +1 -1
  41. package/build/client/_app/immutable/nodes/11.DvcCox6n.js.br +0 -0
  42. package/build/client/_app/immutable/nodes/11.DvcCox6n.js.gz +0 -0
  43. package/build/client/_app/immutable/nodes/{12.p6ol8gkx.js → 12.Cb49Qjng.js} +1 -1
  44. package/build/client/_app/immutable/nodes/12.Cb49Qjng.js.br +0 -0
  45. package/build/client/_app/immutable/nodes/12.Cb49Qjng.js.gz +0 -0
  46. package/build/client/_app/immutable/nodes/{2.Clary1Ks.js → 2.DNGHCEWB.js} +2 -2
  47. package/build/client/_app/immutable/nodes/2.DNGHCEWB.js.br +0 -0
  48. package/build/client/_app/immutable/nodes/2.DNGHCEWB.js.gz +0 -0
  49. package/build/client/_app/immutable/nodes/{3.BBvN4Erf.js → 3.BEdWeod6.js} +1 -1
  50. package/build/client/_app/immutable/nodes/3.BEdWeod6.js.br +0 -0
  51. package/build/client/_app/immutable/nodes/3.BEdWeod6.js.gz +0 -0
  52. package/build/client/_app/immutable/nodes/{4.3VL8fZOS.js → 4.C4b1rN7s.js} +1 -1
  53. package/build/client/_app/immutable/nodes/4.C4b1rN7s.js.br +0 -0
  54. package/build/client/_app/immutable/nodes/4.C4b1rN7s.js.gz +0 -0
  55. package/build/client/_app/immutable/nodes/5.DrqRX385.js +2 -0
  56. package/build/client/_app/immutable/nodes/5.DrqRX385.js.br +0 -0
  57. package/build/client/_app/immutable/nodes/5.DrqRX385.js.gz +0 -0
  58. package/build/client/_app/immutable/nodes/{6.BRCCYakl.js → 6.BiWHXice.js} +1 -1
  59. package/build/client/_app/immutable/nodes/6.BiWHXice.js.br +0 -0
  60. package/build/client/_app/immutable/nodes/6.BiWHXice.js.gz +0 -0
  61. package/build/client/_app/immutable/nodes/{7._DA-s9Iz.js → 7.BNVGtd7p.js} +1 -1
  62. package/build/client/_app/immutable/nodes/7.BNVGtd7p.js.br +0 -0
  63. package/build/client/_app/immutable/nodes/7.BNVGtd7p.js.gz +0 -0
  64. package/build/client/_app/immutable/nodes/8.jIClO5FX.js +1 -0
  65. package/build/client/_app/immutable/nodes/8.jIClO5FX.js.br +0 -0
  66. package/build/client/_app/immutable/nodes/8.jIClO5FX.js.gz +0 -0
  67. package/build/client/_app/immutable/nodes/9.B7GOogsh.js +9 -0
  68. package/build/client/_app/immutable/nodes/9.B7GOogsh.js.br +0 -0
  69. package/build/client/_app/immutable/nodes/9.B7GOogsh.js.gz +0 -0
  70. package/build/client/_app/version.json +1 -1
  71. package/build/client/_app/version.json.br +0 -0
  72. package/build/client/_app/version.json.gz +0 -0
  73. package/build/env.js +9 -33
  74. package/build/env.js.map +1 -0
  75. package/build/handler.js +15 -1493
  76. package/build/handler.js.map +1 -0
  77. package/build/index.js +25 -231
  78. package/build/index.js.map +1 -0
  79. package/build/server/chunks/{0--J8MXU0r.js → 0-B6UIl8X0.js} +8 -8
  80. package/build/server/chunks/0-B6UIl8X0.js.map +1 -0
  81. package/build/server/chunks/1-Dq90EpGp.js +9 -0
  82. package/build/server/chunks/1-Dq90EpGp.js.map +1 -0
  83. package/build/server/chunks/{10-CX1ex2mH.js → 10-BM8QtjX8.js} +5 -4
  84. package/build/server/chunks/10-BM8QtjX8.js.map +1 -0
  85. package/build/server/chunks/11-FZmITmkZ.js +9 -0
  86. package/build/server/chunks/11-FZmITmkZ.js.map +1 -0
  87. package/build/server/chunks/{12-Dw1Y6Xen.js → 12-BlqEGyqp.js} +4 -4
  88. package/build/server/chunks/12-BlqEGyqp.js.map +1 -0
  89. package/build/server/chunks/{2-iIDfIUc5.js → 2-D9wmJrmC.js} +3 -3
  90. package/build/server/chunks/2-D9wmJrmC.js.map +1 -0
  91. package/build/server/chunks/3-C7b_e-a7.js +9 -0
  92. package/build/server/chunks/3-C7b_e-a7.js.map +1 -0
  93. package/build/server/chunks/{4-CKQYCTZo.js → 4-DC34JtHj.js} +6 -6
  94. package/build/server/chunks/4-DC34JtHj.js.map +1 -0
  95. package/build/server/chunks/5-vZTj2V8e.js +9 -0
  96. package/build/server/chunks/5-vZTj2V8e.js.map +1 -0
  97. package/build/server/chunks/6-ClsuiYR1.js +9 -0
  98. package/build/server/chunks/6-ClsuiYR1.js.map +1 -0
  99. package/build/server/chunks/{7-DT_D0EX1.js → 7-CdnU-whk.js} +6 -6
  100. package/build/server/chunks/7-CdnU-whk.js.map +1 -0
  101. package/build/server/chunks/8-DGCxm3TB.js +9 -0
  102. package/build/server/chunks/8-DGCxm3TB.js.map +1 -0
  103. package/build/server/chunks/{9-BVttRALh.js → 9-BcuWrd-q.js} +5 -5
  104. package/build/server/chunks/9-BcuWrd-q.js.map +1 -0
  105. package/build/server/chunks/{Badge-DCQxSQCS.js → Badge-C73znQSJ.js} +2 -2
  106. package/build/server/chunks/Badge-C73znQSJ.js.map +1 -0
  107. package/build/server/chunks/{SafetyBadge-BxEGojgX.js → SafetyBadge-DbpkfzSa.js} +2 -2
  108. package/build/server/chunks/SafetyBadge-DbpkfzSa.js.map +1 -0
  109. package/build/server/chunks/{_layout.svelte-BPfWfi5Y.js → _layout.svelte-1xu00yiw.js} +4 -6
  110. package/build/server/chunks/{_layout.svelte-BPfWfi5Y.js.map → _layout.svelte-1xu00yiw.js.map} +1 -1
  111. package/build/server/chunks/{_page.svelte-xTZOj1o8.js → _page.svelte-4Xfcj342.js} +3 -3
  112. package/build/server/chunks/_page.svelte-4Xfcj342.js.map +1 -0
  113. package/build/server/chunks/{_page.svelte-qnfxKUje.js → _page.svelte-8auIN7Qo.js} +24 -21
  114. package/build/server/chunks/_page.svelte-8auIN7Qo.js.map +1 -0
  115. package/build/server/chunks/{_page.svelte-wL3fdD1l.js → _page.svelte-BXtL3d0f.js} +4 -4
  116. package/build/server/chunks/_page.svelte-BXtL3d0f.js.map +1 -0
  117. package/build/server/chunks/{_page.svelte-B8jThscg.js → _page.svelte-BaxiAFdk.js} +4 -6
  118. package/build/server/chunks/_page.svelte-BaxiAFdk.js.map +1 -0
  119. package/build/server/chunks/{_page.svelte-D9DhnmQr.js → _page.svelte-BhsBxk6l.js} +3 -5
  120. package/build/server/chunks/_page.svelte-BhsBxk6l.js.map +1 -0
  121. package/build/server/chunks/{_page.svelte-1wUrXGW-.js → _page.svelte-Br7nreH-.js} +4 -5
  122. package/build/server/chunks/_page.svelte-Br7nreH-.js.map +1 -0
  123. package/build/server/chunks/{_page.svelte-B1i4IP2u.js → _page.svelte-C1ssMQqB.js} +4 -6
  124. package/build/server/chunks/_page.svelte-C1ssMQqB.js.map +1 -0
  125. package/build/server/chunks/{_page.svelte-D8ffqrO3.js → _page.svelte-CZMhLclS.js} +5 -7
  126. package/build/server/chunks/_page.svelte-CZMhLclS.js.map +1 -0
  127. package/build/server/chunks/{_page.svelte-NwgcXZfI.js → _page.svelte-DMwgbUjH.js} +6 -7
  128. package/build/server/chunks/_page.svelte-DMwgbUjH.js.map +1 -0
  129. package/build/server/chunks/{_page.svelte-B3CasgD8.js → _page.svelte-iNuDNlPL.js} +3 -3
  130. package/build/server/chunks/_page.svelte-iNuDNlPL.js.map +1 -0
  131. package/build/server/chunks/{_page.svelte-BikYFdJv.js → _page.svelte-pVxceXG3.js} +5 -5
  132. package/build/server/chunks/_page.svelte-pVxceXG3.js.map +1 -0
  133. package/build/server/chunks/{_server.ts-D7iLlRbM.js → _server.ts-B6p7ukMz.js} +4 -5
  134. package/build/server/chunks/_server.ts-B6p7ukMz.js.map +1 -0
  135. package/build/server/chunks/{_server.ts-C49ZrV0a.js → _server.ts-BRZfMXBh.js} +2 -2
  136. package/build/server/chunks/_server.ts-BRZfMXBh.js.map +1 -0
  137. package/build/server/chunks/{_server.ts-BBDD0W6t.js → _server.ts-CCCiUW1c.js} +3 -4
  138. package/build/server/chunks/_server.ts-CCCiUW1c.js.map +1 -0
  139. package/build/server/chunks/{_server.ts-BkOJmVFg.js → _server.ts-CXojCxes.js} +5 -6
  140. package/build/server/chunks/_server.ts-CXojCxes.js.map +1 -0
  141. package/build/server/chunks/{_server.ts-rJ_Ubi9D.js → _server.ts-CqIWzdWh.js} +2 -2
  142. package/build/server/chunks/_server.ts-CqIWzdWh.js.map +1 -0
  143. package/build/server/chunks/{_server.ts-CaVH9FSD.js → _server.ts-DAqw6tHI.js} +4 -5
  144. package/build/server/chunks/_server.ts-DAqw6tHI.js.map +1 -0
  145. package/build/server/chunks/{_server.ts-Dz9oKgWc.js → _server.ts-DFARp0QA.js} +5 -6
  146. package/build/server/chunks/_server.ts-DFARp0QA.js.map +1 -0
  147. package/build/server/chunks/{_server.ts-Dwe99x74.js → _server.ts-DcfqVMUN.js} +2 -2
  148. package/build/server/chunks/_server.ts-DcfqVMUN.js.map +1 -0
  149. package/build/server/chunks/{_server.ts-DPqZOGG_.js → _server.ts-DqBabNbA.js} +4 -5
  150. package/build/server/chunks/_server.ts-DqBabNbA.js.map +1 -0
  151. package/build/server/chunks/{_server.ts-C2WpZqPW.js → _server.ts-DrY2Ctqv.js} +4 -5
  152. package/build/server/chunks/_server.ts-DrY2Ctqv.js.map +1 -0
  153. package/build/server/chunks/client-C6wXHlmK.js +24 -0
  154. package/build/server/chunks/client-C6wXHlmK.js.map +1 -0
  155. package/build/server/chunks/{doctorSummary-BOtGdd9z.js → doctorSummary-De2PTQoD.js} +3 -3
  156. package/build/server/chunks/doctorSummary-De2PTQoD.js.map +1 -0
  157. package/build/server/chunks/{error.svelte-DWPum81Y.js → error.svelte-CcYVAQ1W.js} +3 -5
  158. package/build/server/chunks/error.svelte-CcYVAQ1W.js.map +1 -0
  159. package/build/server/chunks/handler-Hnwc-LvR.js +1473 -0
  160. package/build/server/chunks/handler-Hnwc-LvR.js.map +1 -0
  161. package/build/server/chunks/{hooks.server-Dva4z7fv.js → hooks.server-CB4nMIz1.js} +4 -5
  162. package/build/server/chunks/hooks.server-CB4nMIz1.js.map +1 -0
  163. package/build/server/chunks/index.js-BISNf3Ne.js +11542 -0
  164. package/build/server/chunks/index.js-BISNf3Ne.js.map +1 -0
  165. package/build/server/{manifest.js → chunks/manifest.js-C1tyaqvp.js} +26 -30
  166. package/build/server/chunks/manifest.js-C1tyaqvp.js.map +1 -0
  167. package/build/server/chunks/{marketingSeo-DqH0vHQa.js → marketingSeo-D0c8diM4.js} +2 -2
  168. package/build/server/chunks/marketingSeo-D0c8diM4.js.map +1 -0
  169. package/build/server/chunks/{migrationReport-f6NoxAVZ.js → migrationReport-BfHleN7g.js} +2 -2
  170. package/build/server/chunks/migrationReport-BfHleN7g.js.map +1 -0
  171. package/build/server/chunks/{profileApiHelpers-DCoI7zMU.js → profileApiHelpers-CKY0z-TD.js} +2 -2
  172. package/build/server/chunks/profileApiHelpers-CKY0z-TD.js.map +1 -0
  173. package/build/server/chunks/{projectContext-B1D-bieW.js → projectContext-BtPm3MFR.js} +1098 -53
  174. package/build/server/chunks/projectContext-BtPm3MFR.js.map +1 -0
  175. package/build/server/chunks/{src2-BtraGDB1.js → src2-DwXcz8UE.js} +2 -2
  176. package/build/server/chunks/src2-DwXcz8UE.js.map +1 -0
  177. package/build/server/chunks/{src3-BXch_OaJ.js → src3-DeQh3O0_.js} +379 -6
  178. package/build/server/chunks/src3-DeQh3O0_.js.map +1 -0
  179. package/build/server/chunks/tokenStore-CTHhmHsk.js.map +1 -1
  180. package/build/shims.js +1 -0
  181. package/build/shims.js.map +1 -0
  182. package/package.json +6 -6
  183. package/build/client/_app/immutable/chunks/BcMnim1Z.js.br +0 -0
  184. package/build/client/_app/immutable/chunks/BcMnim1Z.js.gz +0 -0
  185. package/build/client/_app/immutable/chunks/BqIBYAbW.js +0 -3
  186. package/build/client/_app/immutable/chunks/BqIBYAbW.js.br +0 -0
  187. package/build/client/_app/immutable/chunks/BqIBYAbW.js.gz +0 -0
  188. package/build/client/_app/immutable/chunks/CC808Z2X.js +0 -1
  189. package/build/client/_app/immutable/chunks/CC808Z2X.js.br +0 -2
  190. package/build/client/_app/immutable/chunks/CC808Z2X.js.gz +0 -0
  191. package/build/client/_app/immutable/chunks/D5fBh0I2.js.br +0 -2
  192. package/build/client/_app/immutable/chunks/D5fBh0I2.js.gz +0 -0
  193. package/build/client/_app/immutable/chunks/DJ5W1vn7.js +0 -3
  194. package/build/client/_app/immutable/chunks/DJ5W1vn7.js.br +0 -0
  195. package/build/client/_app/immutable/chunks/DJ5W1vn7.js.gz +0 -0
  196. package/build/client/_app/immutable/chunks/DTBN031P.js.br +0 -2
  197. package/build/client/_app/immutable/chunks/DTBN031P.js.gz +0 -0
  198. package/build/client/_app/immutable/chunks/O6-aNYLC.js +0 -1
  199. package/build/client/_app/immutable/chunks/O6-aNYLC.js.br +0 -0
  200. package/build/client/_app/immutable/chunks/O6-aNYLC.js.gz +0 -0
  201. package/build/client/_app/immutable/entry/app.Drm5SkSR.js +0 -2
  202. package/build/client/_app/immutable/entry/app.Drm5SkSR.js.br +0 -0
  203. package/build/client/_app/immutable/entry/app.Drm5SkSR.js.gz +0 -0
  204. package/build/client/_app/immutable/entry/start.BbRC1ryX.js +0 -1
  205. package/build/client/_app/immutable/entry/start.BbRC1ryX.js.br +0 -0
  206. package/build/client/_app/immutable/entry/start.BbRC1ryX.js.gz +0 -0
  207. package/build/client/_app/immutable/nodes/0.BP1kFxFY.js +0 -1
  208. package/build/client/_app/immutable/nodes/0.BP1kFxFY.js.br +0 -0
  209. package/build/client/_app/immutable/nodes/0.BP1kFxFY.js.gz +0 -0
  210. package/build/client/_app/immutable/nodes/1.CSvicVYN.js +0 -1
  211. package/build/client/_app/immutable/nodes/1.CSvicVYN.js.br +0 -0
  212. package/build/client/_app/immutable/nodes/1.CSvicVYN.js.gz +0 -0
  213. package/build/client/_app/immutable/nodes/10.LJrHMplF.js +0 -3
  214. package/build/client/_app/immutable/nodes/10.LJrHMplF.js.br +0 -0
  215. package/build/client/_app/immutable/nodes/10.LJrHMplF.js.gz +0 -0
  216. package/build/client/_app/immutable/nodes/11.3lkgWYOd.js.br +0 -0
  217. package/build/client/_app/immutable/nodes/11.3lkgWYOd.js.gz +0 -0
  218. package/build/client/_app/immutable/nodes/12.p6ol8gkx.js.br +0 -0
  219. package/build/client/_app/immutable/nodes/12.p6ol8gkx.js.gz +0 -0
  220. package/build/client/_app/immutable/nodes/2.Clary1Ks.js.br +0 -0
  221. package/build/client/_app/immutable/nodes/2.Clary1Ks.js.gz +0 -0
  222. package/build/client/_app/immutable/nodes/3.BBvN4Erf.js.br +0 -0
  223. package/build/client/_app/immutable/nodes/3.BBvN4Erf.js.gz +0 -0
  224. package/build/client/_app/immutable/nodes/4.3VL8fZOS.js.br +0 -0
  225. package/build/client/_app/immutable/nodes/4.3VL8fZOS.js.gz +0 -0
  226. package/build/client/_app/immutable/nodes/5.CiNtblYV.js +0 -2
  227. package/build/client/_app/immutable/nodes/5.CiNtblYV.js.br +0 -0
  228. package/build/client/_app/immutable/nodes/5.CiNtblYV.js.gz +0 -0
  229. package/build/client/_app/immutable/nodes/6.BRCCYakl.js.br +0 -0
  230. package/build/client/_app/immutable/nodes/6.BRCCYakl.js.gz +0 -0
  231. package/build/client/_app/immutable/nodes/7._DA-s9Iz.js.br +0 -0
  232. package/build/client/_app/immutable/nodes/7._DA-s9Iz.js.gz +0 -0
  233. package/build/client/_app/immutable/nodes/8.D0vCT-mT.js +0 -1
  234. package/build/client/_app/immutable/nodes/8.D0vCT-mT.js.br +0 -2
  235. package/build/client/_app/immutable/nodes/8.D0vCT-mT.js.gz +0 -0
  236. package/build/client/_app/immutable/nodes/9.DTFYsfKM.js +0 -9
  237. package/build/client/_app/immutable/nodes/9.DTFYsfKM.js.br +0 -0
  238. package/build/client/_app/immutable/nodes/9.DTFYsfKM.js.gz +0 -0
  239. package/build/server/chunks/0--J8MXU0r.js.map +0 -1
  240. package/build/server/chunks/1-BImzM_Nb.js +0 -9
  241. package/build/server/chunks/1-BImzM_Nb.js.map +0 -1
  242. package/build/server/chunks/10-CX1ex2mH.js.map +0 -1
  243. package/build/server/chunks/11-mzYblRmm.js +0 -9
  244. package/build/server/chunks/11-mzYblRmm.js.map +0 -1
  245. package/build/server/chunks/12-Dw1Y6Xen.js.map +0 -1
  246. package/build/server/chunks/2-iIDfIUc5.js.map +0 -1
  247. package/build/server/chunks/3-DjAsck26.js +0 -9
  248. package/build/server/chunks/3-DjAsck26.js.map +0 -1
  249. package/build/server/chunks/4-CKQYCTZo.js.map +0 -1
  250. package/build/server/chunks/5-BDp1sX0Q.js +0 -9
  251. package/build/server/chunks/5-BDp1sX0Q.js.map +0 -1
  252. package/build/server/chunks/6-CUIuzy6O.js +0 -9
  253. package/build/server/chunks/6-CUIuzy6O.js.map +0 -1
  254. package/build/server/chunks/7-DT_D0EX1.js.map +0 -1
  255. package/build/server/chunks/8-DK1BCf-b.js +0 -9
  256. package/build/server/chunks/8-DK1BCf-b.js.map +0 -1
  257. package/build/server/chunks/9-BVttRALh.js.map +0 -1
  258. package/build/server/chunks/Badge-DCQxSQCS.js.map +0 -1
  259. package/build/server/chunks/SafetyBadge-BxEGojgX.js.map +0 -1
  260. package/build/server/chunks/_page.svelte-1wUrXGW-.js.map +0 -1
  261. package/build/server/chunks/_page.svelte-B1i4IP2u.js.map +0 -1
  262. package/build/server/chunks/_page.svelte-B3CasgD8.js.map +0 -1
  263. package/build/server/chunks/_page.svelte-B8jThscg.js.map +0 -1
  264. package/build/server/chunks/_page.svelte-BikYFdJv.js.map +0 -1
  265. package/build/server/chunks/_page.svelte-D8ffqrO3.js.map +0 -1
  266. package/build/server/chunks/_page.svelte-D9DhnmQr.js.map +0 -1
  267. package/build/server/chunks/_page.svelte-NwgcXZfI.js.map +0 -1
  268. package/build/server/chunks/_page.svelte-qnfxKUje.js.map +0 -1
  269. package/build/server/chunks/_page.svelte-wL3fdD1l.js.map +0 -1
  270. package/build/server/chunks/_page.svelte-xTZOj1o8.js.map +0 -1
  271. package/build/server/chunks/_server.ts-BBDD0W6t.js.map +0 -1
  272. package/build/server/chunks/_server.ts-BkOJmVFg.js.map +0 -1
  273. package/build/server/chunks/_server.ts-C2WpZqPW.js.map +0 -1
  274. package/build/server/chunks/_server.ts-C49ZrV0a.js.map +0 -1
  275. package/build/server/chunks/_server.ts-CaVH9FSD.js.map +0 -1
  276. package/build/server/chunks/_server.ts-D7iLlRbM.js.map +0 -1
  277. package/build/server/chunks/_server.ts-DPqZOGG_.js.map +0 -1
  278. package/build/server/chunks/_server.ts-Dwe99x74.js.map +0 -1
  279. package/build/server/chunks/_server.ts-Dz9oKgWc.js.map +0 -1
  280. package/build/server/chunks/_server.ts-rJ_Ubi9D.js.map +0 -1
  281. package/build/server/chunks/client-BagBHERz.js +0 -23
  282. package/build/server/chunks/client-BagBHERz.js.map +0 -1
  283. package/build/server/chunks/dev-BdIdjvaY.js +0 -4692
  284. package/build/server/chunks/dev-BdIdjvaY.js.map +0 -1
  285. package/build/server/chunks/doctorSummary-BOtGdd9z.js.map +0 -1
  286. package/build/server/chunks/error.svelte-DWPum81Y.js.map +0 -1
  287. package/build/server/chunks/hooks.server-Dva4z7fv.js.map +0 -1
  288. package/build/server/chunks/index-CLnuRv4X.js +0 -134
  289. package/build/server/chunks/index-CLnuRv4X.js.map +0 -1
  290. package/build/server/chunks/index-DBqjc0Yf.js +0 -77
  291. package/build/server/chunks/index-DBqjc0Yf.js.map +0 -1
  292. package/build/server/chunks/internal-sR_8mnoa.js +0 -1998
  293. package/build/server/chunks/internal-sR_8mnoa.js.map +0 -1
  294. package/build/server/chunks/marketingSeo-DqH0vHQa.js.map +0 -1
  295. package/build/server/chunks/migrationReport-f6NoxAVZ.js.map +0 -1
  296. package/build/server/chunks/profileApiHelpers-DCoI7zMU.js.map +0 -1
  297. package/build/server/chunks/projectContext-B1D-bieW.js.map +0 -1
  298. package/build/server/chunks/src2-BtraGDB1.js.map +0 -1
  299. package/build/server/chunks/src3-BXch_OaJ.js.map +0 -1
  300. package/build/server/index.js +0 -4593
  301. package/build/server/index.js.map +0 -1
  302. package/build/server/manifest.js.map +0 -1
  303. /package/build/client/_app/immutable/chunks/{CP97kCR3.js → xihTtKlq.js} +0 -0
  304. /package/build/client/_app/immutable/chunks/{CP97kCR3.js.br → xihTtKlq.js.br} +0 -0
  305. /package/build/client/_app/immutable/chunks/{CP97kCR3.js.gz → xihTtKlq.js.gz} +0 -0
@@ -0,0 +1,1473 @@
1
+ import '../../shims.js';
2
+ import * as fs from 'node:fs';
3
+ import fs__default, { readdirSync, statSync, createReadStream } from 'node:fs';
4
+ import path, { resolve, sep, join, normalize } from 'node:path';
5
+ import process from 'node:process';
6
+ import http from 'node:http';
7
+ import { setImmediate } from 'node:timers';
8
+ import * as qs from 'node:querystring';
9
+ import { Readable } from 'node:stream';
10
+ import { q as splitCookiesString, S as SvelteKitError, r as Server } from './index.js-BISNf3Ne.js';
11
+ import { m as manifest } from './manifest.js-C1tyaqvp.js';
12
+ import { env, dir, env_prefix } from '../../env.js';
13
+ import { format } from 'node:url';
14
+
15
+ function totalist(dir, callback, pre='') {
16
+ dir = resolve('.', dir);
17
+ let arr = readdirSync(dir);
18
+ let i=0, abs, stats;
19
+ for (; i < arr.length; i++) {
20
+ abs = join(dir, arr[i]);
21
+ stats = statSync(abs);
22
+ stats.isDirectory()
23
+ ? totalist(abs, callback, join(pre, arr[i]))
24
+ : callback(join(pre, arr[i]), abs, stats);
25
+ }
26
+ }
27
+
28
+ /**
29
+ * @typedef ParsedURL
30
+ * @type {import('.').ParsedURL}
31
+ */
32
+
33
+ /**
34
+ * @typedef Request
35
+ * @property {string} url
36
+ * @property {ParsedURL} _parsedUrl
37
+ */
38
+
39
+ /**
40
+ * @param {Request} req
41
+ * @returns {ParsedURL|void}
42
+ */
43
+ function parse$1(req) {
44
+ let raw = req.url;
45
+ if (raw == null) return;
46
+
47
+ let prev = req._parsedUrl;
48
+ if (prev && prev.raw === raw) return prev;
49
+
50
+ let pathname=raw, search='', query;
51
+
52
+ if (raw.length > 1) {
53
+ let idx = raw.indexOf('?', 1);
54
+
55
+ if (idx !== -1) {
56
+ search = raw.substring(idx);
57
+ pathname = raw.substring(0, idx);
58
+ if (search.length > 1) {
59
+ query = qs.parse(search.substring(1));
60
+ }
61
+ }
62
+ }
63
+
64
+ return req._parsedUrl = { pathname, search, query, raw };
65
+ }
66
+
67
+ const mimes = {
68
+ "3g2": "video/3gpp2",
69
+ "3gp": "video/3gpp",
70
+ "3gpp": "video/3gpp",
71
+ "3mf": "model/3mf",
72
+ "aac": "audio/aac",
73
+ "ac": "application/pkix-attr-cert",
74
+ "adp": "audio/adpcm",
75
+ "adts": "audio/aac",
76
+ "ai": "application/postscript",
77
+ "aml": "application/automationml-aml+xml",
78
+ "amlx": "application/automationml-amlx+zip",
79
+ "amr": "audio/amr",
80
+ "apng": "image/apng",
81
+ "appcache": "text/cache-manifest",
82
+ "appinstaller": "application/appinstaller",
83
+ "appx": "application/appx",
84
+ "appxbundle": "application/appxbundle",
85
+ "asc": "application/pgp-keys",
86
+ "atom": "application/atom+xml",
87
+ "atomcat": "application/atomcat+xml",
88
+ "atomdeleted": "application/atomdeleted+xml",
89
+ "atomsvc": "application/atomsvc+xml",
90
+ "au": "audio/basic",
91
+ "avci": "image/avci",
92
+ "avcs": "image/avcs",
93
+ "avif": "image/avif",
94
+ "aw": "application/applixware",
95
+ "bdoc": "application/bdoc",
96
+ "bin": "application/octet-stream",
97
+ "bmp": "image/bmp",
98
+ "bpk": "application/octet-stream",
99
+ "btf": "image/prs.btif",
100
+ "btif": "image/prs.btif",
101
+ "buffer": "application/octet-stream",
102
+ "ccxml": "application/ccxml+xml",
103
+ "cdfx": "application/cdfx+xml",
104
+ "cdmia": "application/cdmi-capability",
105
+ "cdmic": "application/cdmi-container",
106
+ "cdmid": "application/cdmi-domain",
107
+ "cdmio": "application/cdmi-object",
108
+ "cdmiq": "application/cdmi-queue",
109
+ "cer": "application/pkix-cert",
110
+ "cgm": "image/cgm",
111
+ "cjs": "application/node",
112
+ "class": "application/java-vm",
113
+ "coffee": "text/coffeescript",
114
+ "conf": "text/plain",
115
+ "cpl": "application/cpl+xml",
116
+ "cpt": "application/mac-compactpro",
117
+ "crl": "application/pkix-crl",
118
+ "css": "text/css",
119
+ "csv": "text/csv",
120
+ "cu": "application/cu-seeme",
121
+ "cwl": "application/cwl",
122
+ "cww": "application/prs.cww",
123
+ "davmount": "application/davmount+xml",
124
+ "dbk": "application/docbook+xml",
125
+ "deb": "application/octet-stream",
126
+ "def": "text/plain",
127
+ "deploy": "application/octet-stream",
128
+ "dib": "image/bmp",
129
+ "disposition-notification": "message/disposition-notification",
130
+ "dist": "application/octet-stream",
131
+ "distz": "application/octet-stream",
132
+ "dll": "application/octet-stream",
133
+ "dmg": "application/octet-stream",
134
+ "dms": "application/octet-stream",
135
+ "doc": "application/msword",
136
+ "dot": "application/msword",
137
+ "dpx": "image/dpx",
138
+ "drle": "image/dicom-rle",
139
+ "dsc": "text/prs.lines.tag",
140
+ "dssc": "application/dssc+der",
141
+ "dtd": "application/xml-dtd",
142
+ "dump": "application/octet-stream",
143
+ "dwd": "application/atsc-dwd+xml",
144
+ "ear": "application/java-archive",
145
+ "ecma": "application/ecmascript",
146
+ "elc": "application/octet-stream",
147
+ "emf": "image/emf",
148
+ "eml": "message/rfc822",
149
+ "emma": "application/emma+xml",
150
+ "emotionml": "application/emotionml+xml",
151
+ "eps": "application/postscript",
152
+ "epub": "application/epub+zip",
153
+ "exe": "application/octet-stream",
154
+ "exi": "application/exi",
155
+ "exp": "application/express",
156
+ "exr": "image/aces",
157
+ "ez": "application/andrew-inset",
158
+ "fdf": "application/fdf",
159
+ "fdt": "application/fdt+xml",
160
+ "fits": "image/fits",
161
+ "g3": "image/g3fax",
162
+ "gbr": "application/rpki-ghostbusters",
163
+ "geojson": "application/geo+json",
164
+ "gif": "image/gif",
165
+ "glb": "model/gltf-binary",
166
+ "gltf": "model/gltf+json",
167
+ "gml": "application/gml+xml",
168
+ "gpx": "application/gpx+xml",
169
+ "gram": "application/srgs",
170
+ "grxml": "application/srgs+xml",
171
+ "gxf": "application/gxf",
172
+ "gz": "application/gzip",
173
+ "h261": "video/h261",
174
+ "h263": "video/h263",
175
+ "h264": "video/h264",
176
+ "heic": "image/heic",
177
+ "heics": "image/heic-sequence",
178
+ "heif": "image/heif",
179
+ "heifs": "image/heif-sequence",
180
+ "hej2": "image/hej2k",
181
+ "held": "application/atsc-held+xml",
182
+ "hjson": "application/hjson",
183
+ "hlp": "application/winhlp",
184
+ "hqx": "application/mac-binhex40",
185
+ "hsj2": "image/hsj2",
186
+ "htm": "text/html",
187
+ "html": "text/html",
188
+ "ics": "text/calendar",
189
+ "ief": "image/ief",
190
+ "ifb": "text/calendar",
191
+ "iges": "model/iges",
192
+ "igs": "model/iges",
193
+ "img": "application/octet-stream",
194
+ "in": "text/plain",
195
+ "ini": "text/plain",
196
+ "ink": "application/inkml+xml",
197
+ "inkml": "application/inkml+xml",
198
+ "ipfix": "application/ipfix",
199
+ "iso": "application/octet-stream",
200
+ "its": "application/its+xml",
201
+ "jade": "text/jade",
202
+ "jar": "application/java-archive",
203
+ "jhc": "image/jphc",
204
+ "jls": "image/jls",
205
+ "jp2": "image/jp2",
206
+ "jpe": "image/jpeg",
207
+ "jpeg": "image/jpeg",
208
+ "jpf": "image/jpx",
209
+ "jpg": "image/jpeg",
210
+ "jpg2": "image/jp2",
211
+ "jpgm": "image/jpm",
212
+ "jpgv": "video/jpeg",
213
+ "jph": "image/jph",
214
+ "jpm": "image/jpm",
215
+ "jpx": "image/jpx",
216
+ "js": "text/javascript",
217
+ "json": "application/json",
218
+ "json5": "application/json5",
219
+ "jsonld": "application/ld+json",
220
+ "jsonml": "application/jsonml+json",
221
+ "jsx": "text/jsx",
222
+ "jt": "model/jt",
223
+ "jxr": "image/jxr",
224
+ "jxra": "image/jxra",
225
+ "jxrs": "image/jxrs",
226
+ "jxs": "image/jxs",
227
+ "jxsc": "image/jxsc",
228
+ "jxsi": "image/jxsi",
229
+ "jxss": "image/jxss",
230
+ "kar": "audio/midi",
231
+ "ktx": "image/ktx",
232
+ "ktx2": "image/ktx2",
233
+ "less": "text/less",
234
+ "lgr": "application/lgr+xml",
235
+ "list": "text/plain",
236
+ "litcoffee": "text/coffeescript",
237
+ "log": "text/plain",
238
+ "lostxml": "application/lost+xml",
239
+ "lrf": "application/octet-stream",
240
+ "m1v": "video/mpeg",
241
+ "m21": "application/mp21",
242
+ "m2a": "audio/mpeg",
243
+ "m2v": "video/mpeg",
244
+ "m3a": "audio/mpeg",
245
+ "m4a": "audio/mp4",
246
+ "m4p": "application/mp4",
247
+ "m4s": "video/iso.segment",
248
+ "ma": "application/mathematica",
249
+ "mads": "application/mads+xml",
250
+ "maei": "application/mmt-aei+xml",
251
+ "man": "text/troff",
252
+ "manifest": "text/cache-manifest",
253
+ "map": "application/json",
254
+ "mar": "application/octet-stream",
255
+ "markdown": "text/markdown",
256
+ "mathml": "application/mathml+xml",
257
+ "mb": "application/mathematica",
258
+ "mbox": "application/mbox",
259
+ "md": "text/markdown",
260
+ "mdx": "text/mdx",
261
+ "me": "text/troff",
262
+ "mesh": "model/mesh",
263
+ "meta4": "application/metalink4+xml",
264
+ "metalink": "application/metalink+xml",
265
+ "mets": "application/mets+xml",
266
+ "mft": "application/rpki-manifest",
267
+ "mid": "audio/midi",
268
+ "midi": "audio/midi",
269
+ "mime": "message/rfc822",
270
+ "mj2": "video/mj2",
271
+ "mjp2": "video/mj2",
272
+ "mjs": "text/javascript",
273
+ "mml": "text/mathml",
274
+ "mods": "application/mods+xml",
275
+ "mov": "video/quicktime",
276
+ "mp2": "audio/mpeg",
277
+ "mp21": "application/mp21",
278
+ "mp2a": "audio/mpeg",
279
+ "mp3": "audio/mpeg",
280
+ "mp4": "video/mp4",
281
+ "mp4a": "audio/mp4",
282
+ "mp4s": "application/mp4",
283
+ "mp4v": "video/mp4",
284
+ "mpd": "application/dash+xml",
285
+ "mpe": "video/mpeg",
286
+ "mpeg": "video/mpeg",
287
+ "mpf": "application/media-policy-dataset+xml",
288
+ "mpg": "video/mpeg",
289
+ "mpg4": "video/mp4",
290
+ "mpga": "audio/mpeg",
291
+ "mpp": "application/dash-patch+xml",
292
+ "mrc": "application/marc",
293
+ "mrcx": "application/marcxml+xml",
294
+ "ms": "text/troff",
295
+ "mscml": "application/mediaservercontrol+xml",
296
+ "msh": "model/mesh",
297
+ "msi": "application/octet-stream",
298
+ "msix": "application/msix",
299
+ "msixbundle": "application/msixbundle",
300
+ "msm": "application/octet-stream",
301
+ "msp": "application/octet-stream",
302
+ "mtl": "model/mtl",
303
+ "musd": "application/mmt-usd+xml",
304
+ "mxf": "application/mxf",
305
+ "mxmf": "audio/mobile-xmf",
306
+ "mxml": "application/xv+xml",
307
+ "n3": "text/n3",
308
+ "nb": "application/mathematica",
309
+ "nq": "application/n-quads",
310
+ "nt": "application/n-triples",
311
+ "obj": "model/obj",
312
+ "oda": "application/oda",
313
+ "oga": "audio/ogg",
314
+ "ogg": "audio/ogg",
315
+ "ogv": "video/ogg",
316
+ "ogx": "application/ogg",
317
+ "omdoc": "application/omdoc+xml",
318
+ "onepkg": "application/onenote",
319
+ "onetmp": "application/onenote",
320
+ "onetoc": "application/onenote",
321
+ "onetoc2": "application/onenote",
322
+ "opf": "application/oebps-package+xml",
323
+ "opus": "audio/ogg",
324
+ "otf": "font/otf",
325
+ "owl": "application/rdf+xml",
326
+ "oxps": "application/oxps",
327
+ "p10": "application/pkcs10",
328
+ "p7c": "application/pkcs7-mime",
329
+ "p7m": "application/pkcs7-mime",
330
+ "p7s": "application/pkcs7-signature",
331
+ "p8": "application/pkcs8",
332
+ "pdf": "application/pdf",
333
+ "pfr": "application/font-tdpfr",
334
+ "pgp": "application/pgp-encrypted",
335
+ "pkg": "application/octet-stream",
336
+ "pki": "application/pkixcmp",
337
+ "pkipath": "application/pkix-pkipath",
338
+ "pls": "application/pls+xml",
339
+ "png": "image/png",
340
+ "prc": "model/prc",
341
+ "prf": "application/pics-rules",
342
+ "provx": "application/provenance+xml",
343
+ "ps": "application/postscript",
344
+ "pskcxml": "application/pskc+xml",
345
+ "pti": "image/prs.pti",
346
+ "qt": "video/quicktime",
347
+ "raml": "application/raml+yaml",
348
+ "rapd": "application/route-apd+xml",
349
+ "rdf": "application/rdf+xml",
350
+ "relo": "application/p2p-overlay+xml",
351
+ "rif": "application/reginfo+xml",
352
+ "rl": "application/resource-lists+xml",
353
+ "rld": "application/resource-lists-diff+xml",
354
+ "rmi": "audio/midi",
355
+ "rnc": "application/relax-ng-compact-syntax",
356
+ "rng": "application/xml",
357
+ "roa": "application/rpki-roa",
358
+ "roff": "text/troff",
359
+ "rq": "application/sparql-query",
360
+ "rs": "application/rls-services+xml",
361
+ "rsat": "application/atsc-rsat+xml",
362
+ "rsd": "application/rsd+xml",
363
+ "rsheet": "application/urc-ressheet+xml",
364
+ "rss": "application/rss+xml",
365
+ "rtf": "text/rtf",
366
+ "rtx": "text/richtext",
367
+ "rusd": "application/route-usd+xml",
368
+ "s3m": "audio/s3m",
369
+ "sbml": "application/sbml+xml",
370
+ "scq": "application/scvp-cv-request",
371
+ "scs": "application/scvp-cv-response",
372
+ "sdp": "application/sdp",
373
+ "senmlx": "application/senml+xml",
374
+ "sensmlx": "application/sensml+xml",
375
+ "ser": "application/java-serialized-object",
376
+ "setpay": "application/set-payment-initiation",
377
+ "setreg": "application/set-registration-initiation",
378
+ "sgi": "image/sgi",
379
+ "sgm": "text/sgml",
380
+ "sgml": "text/sgml",
381
+ "shex": "text/shex",
382
+ "shf": "application/shf+xml",
383
+ "shtml": "text/html",
384
+ "sieve": "application/sieve",
385
+ "sig": "application/pgp-signature",
386
+ "sil": "audio/silk",
387
+ "silo": "model/mesh",
388
+ "siv": "application/sieve",
389
+ "slim": "text/slim",
390
+ "slm": "text/slim",
391
+ "sls": "application/route-s-tsid+xml",
392
+ "smi": "application/smil+xml",
393
+ "smil": "application/smil+xml",
394
+ "snd": "audio/basic",
395
+ "so": "application/octet-stream",
396
+ "spdx": "text/spdx",
397
+ "spp": "application/scvp-vp-response",
398
+ "spq": "application/scvp-vp-request",
399
+ "spx": "audio/ogg",
400
+ "sql": "application/sql",
401
+ "sru": "application/sru+xml",
402
+ "srx": "application/sparql-results+xml",
403
+ "ssdl": "application/ssdl+xml",
404
+ "ssml": "application/ssml+xml",
405
+ "stk": "application/hyperstudio",
406
+ "stl": "model/stl",
407
+ "stpx": "model/step+xml",
408
+ "stpxz": "model/step-xml+zip",
409
+ "stpz": "model/step+zip",
410
+ "styl": "text/stylus",
411
+ "stylus": "text/stylus",
412
+ "svg": "image/svg+xml",
413
+ "svgz": "image/svg+xml",
414
+ "swidtag": "application/swid+xml",
415
+ "t": "text/troff",
416
+ "t38": "image/t38",
417
+ "td": "application/urc-targetdesc+xml",
418
+ "tei": "application/tei+xml",
419
+ "teicorpus": "application/tei+xml",
420
+ "text": "text/plain",
421
+ "tfi": "application/thraud+xml",
422
+ "tfx": "image/tiff-fx",
423
+ "tif": "image/tiff",
424
+ "tiff": "image/tiff",
425
+ "toml": "application/toml",
426
+ "tr": "text/troff",
427
+ "trig": "application/trig",
428
+ "ts": "video/mp2t",
429
+ "tsd": "application/timestamped-data",
430
+ "tsv": "text/tab-separated-values",
431
+ "ttc": "font/collection",
432
+ "ttf": "font/ttf",
433
+ "ttl": "text/turtle",
434
+ "ttml": "application/ttml+xml",
435
+ "txt": "text/plain",
436
+ "u3d": "model/u3d",
437
+ "u8dsn": "message/global-delivery-status",
438
+ "u8hdr": "message/global-headers",
439
+ "u8mdn": "message/global-disposition-notification",
440
+ "u8msg": "message/global",
441
+ "ubj": "application/ubjson",
442
+ "uri": "text/uri-list",
443
+ "uris": "text/uri-list",
444
+ "urls": "text/uri-list",
445
+ "vcard": "text/vcard",
446
+ "vrml": "model/vrml",
447
+ "vtt": "text/vtt",
448
+ "vxml": "application/voicexml+xml",
449
+ "war": "application/java-archive",
450
+ "wasm": "application/wasm",
451
+ "wav": "audio/wav",
452
+ "weba": "audio/webm",
453
+ "webm": "video/webm",
454
+ "webmanifest": "application/manifest+json",
455
+ "webp": "image/webp",
456
+ "wgsl": "text/wgsl",
457
+ "wgt": "application/widget",
458
+ "wif": "application/watcherinfo+xml",
459
+ "wmf": "image/wmf",
460
+ "woff": "font/woff",
461
+ "woff2": "font/woff2",
462
+ "wrl": "model/vrml",
463
+ "wsdl": "application/wsdl+xml",
464
+ "wspolicy": "application/wspolicy+xml",
465
+ "x3d": "model/x3d+xml",
466
+ "x3db": "model/x3d+fastinfoset",
467
+ "x3dbz": "model/x3d+binary",
468
+ "x3dv": "model/x3d-vrml",
469
+ "x3dvz": "model/x3d+vrml",
470
+ "x3dz": "model/x3d+xml",
471
+ "xaml": "application/xaml+xml",
472
+ "xav": "application/xcap-att+xml",
473
+ "xca": "application/xcap-caps+xml",
474
+ "xcs": "application/calendar+xml",
475
+ "xdf": "application/xcap-diff+xml",
476
+ "xdssc": "application/dssc+xml",
477
+ "xel": "application/xcap-el+xml",
478
+ "xenc": "application/xenc+xml",
479
+ "xer": "application/patch-ops-error+xml",
480
+ "xfdf": "application/xfdf",
481
+ "xht": "application/xhtml+xml",
482
+ "xhtml": "application/xhtml+xml",
483
+ "xhvml": "application/xv+xml",
484
+ "xlf": "application/xliff+xml",
485
+ "xm": "audio/xm",
486
+ "xml": "text/xml",
487
+ "xns": "application/xcap-ns+xml",
488
+ "xop": "application/xop+xml",
489
+ "xpl": "application/xproc+xml",
490
+ "xsd": "application/xml",
491
+ "xsf": "application/prs.xsf+xml",
492
+ "xsl": "application/xml",
493
+ "xslt": "application/xml",
494
+ "xspf": "application/xspf+xml",
495
+ "xvm": "application/xv+xml",
496
+ "xvml": "application/xv+xml",
497
+ "yaml": "text/yaml",
498
+ "yang": "application/yang",
499
+ "yin": "application/yin+xml",
500
+ "yml": "text/yaml",
501
+ "zip": "application/zip"
502
+ };
503
+
504
+ function lookup(extn) {
505
+ let tmp = ('' + extn).trim().toLowerCase();
506
+ let idx = tmp.lastIndexOf('.');
507
+ return mimes[!~idx ? tmp : tmp.substring(++idx)];
508
+ }
509
+
510
+ const noop$1 = () => {};
511
+
512
+ function isMatch(uri, arr) {
513
+ for (let i=0; i < arr.length; i++) {
514
+ if (arr[i].test(uri)) return true;
515
+ }
516
+ }
517
+
518
+ function toAssume(uri, extns) {
519
+ let i=0, x, len=uri.length - 1;
520
+ if (uri.charCodeAt(len) === 47) {
521
+ uri = uri.substring(0, len);
522
+ }
523
+
524
+ let arr=[], tmp=`${uri}/index`;
525
+ for (; i < extns.length; i++) {
526
+ x = extns[i] ? `.${extns[i]}` : '';
527
+ if (uri) arr.push(uri + x);
528
+ arr.push(tmp + x);
529
+ }
530
+
531
+ return arr;
532
+ }
533
+
534
+ function viaCache(cache, uri, extns) {
535
+ let i=0, data, arr=toAssume(uri, extns);
536
+ for (; i < arr.length; i++) {
537
+ if (data = cache[arr[i]]) return data;
538
+ }
539
+ }
540
+
541
+ function viaLocal(dir, isEtag, uri, extns) {
542
+ let i=0, arr=toAssume(uri, extns);
543
+ let abs, stats, name, headers;
544
+ for (; i < arr.length; i++) {
545
+ abs = normalize(
546
+ join(dir, name=arr[i])
547
+ );
548
+
549
+ if (abs.startsWith(dir) && fs.existsSync(abs)) {
550
+ stats = fs.statSync(abs);
551
+ if (stats.isDirectory()) continue;
552
+ headers = toHeaders(name, stats, isEtag);
553
+ headers['Cache-Control'] = isEtag ? 'no-cache' : 'no-store';
554
+ return { abs, stats, headers };
555
+ }
556
+ }
557
+ }
558
+
559
+ function is404(req, res) {
560
+ return (res.statusCode=404,res.end());
561
+ }
562
+
563
+ function send(req, res, file, stats, headers) {
564
+ let code=200, tmp, opts={};
565
+ headers = { ...headers };
566
+
567
+ for (let key in headers) {
568
+ tmp = res.getHeader(key);
569
+ if (tmp) headers[key] = tmp;
570
+ }
571
+
572
+ if (tmp = res.getHeader('content-type')) {
573
+ headers['Content-Type'] = tmp;
574
+ }
575
+
576
+ if (req.headers.range) {
577
+ code = 206;
578
+ let [x, y] = req.headers.range.replace('bytes=', '').split('-');
579
+ let end = opts.end = parseInt(y, 10) || stats.size - 1;
580
+ let start = opts.start = parseInt(x, 10) || 0;
581
+
582
+ if (end >= stats.size) {
583
+ end = stats.size - 1;
584
+ }
585
+
586
+ if (start >= stats.size) {
587
+ res.setHeader('Content-Range', `bytes */${stats.size}`);
588
+ res.statusCode = 416;
589
+ return res.end();
590
+ }
591
+
592
+ headers['Content-Range'] = `bytes ${start}-${end}/${stats.size}`;
593
+ headers['Content-Length'] = (end - start + 1);
594
+ headers['Accept-Ranges'] = 'bytes';
595
+ }
596
+
597
+ res.writeHead(code, headers);
598
+ fs.createReadStream(file, opts).pipe(res);
599
+ }
600
+
601
+ const ENCODING = {
602
+ '.br': 'br',
603
+ '.gz': 'gzip',
604
+ };
605
+
606
+ function toHeaders(name, stats, isEtag) {
607
+ let enc = ENCODING[name.slice(-3)];
608
+
609
+ let ctype = lookup(name.slice(0, enc && -3)) || '';
610
+ if (ctype === 'text/html') ctype += ';charset=utf-8';
611
+
612
+ let headers = {
613
+ 'Content-Length': stats.size,
614
+ 'Content-Type': ctype,
615
+ 'Last-Modified': stats.mtime.toUTCString(),
616
+ };
617
+
618
+ if (enc) headers['Content-Encoding'] = enc;
619
+ if (isEtag) headers['ETag'] = `W/"${stats.size}-${stats.mtime.getTime()}"`;
620
+
621
+ return headers;
622
+ }
623
+
624
+ function sirv (dir, opts={}) {
625
+ dir = resolve(dir || '.');
626
+
627
+ let isNotFound = opts.onNoMatch || is404;
628
+ let setHeaders = opts.setHeaders || noop$1;
629
+
630
+ let extensions = opts.extensions || ['html', 'htm'];
631
+ let gzips = opts.gzip && extensions.map(x => `${x}.gz`).concat('gz');
632
+ let brots = opts.brotli && extensions.map(x => `${x}.br`).concat('br');
633
+
634
+ const FILES = {};
635
+
636
+ let fallback = '/';
637
+ let isEtag = !!opts.etag;
638
+ let isSPA = !!opts.single;
639
+ if (typeof opts.single === 'string') {
640
+ let idx = opts.single.lastIndexOf('.');
641
+ fallback += !!~idx ? opts.single.substring(0, idx) : opts.single;
642
+ }
643
+
644
+ let ignores = [];
645
+ if (opts.ignores !== false) {
646
+ ignores.push(/[/]([A-Za-z\s\d~$._-]+\.\w+){1,}$/); // any extn
647
+ if (opts.dotfiles) ignores.push(/\/\.\w/);
648
+ else ignores.push(/\/\.well-known/);
649
+ [].concat(opts.ignores || []).forEach(x => {
650
+ ignores.push(new RegExp(x, 'i'));
651
+ });
652
+ }
653
+
654
+ let cc = opts.maxAge != null && `public,max-age=${opts.maxAge}`;
655
+ if (cc && opts.immutable) cc += ',immutable';
656
+ else if (cc && opts.maxAge === 0) cc += ',must-revalidate';
657
+
658
+ if (!opts.dev) {
659
+ totalist(dir, (name, abs, stats) => {
660
+ if (/\.well-known[\\+\/]/.test(name)) ; // keep
661
+ else if (!opts.dotfiles && /(^\.|[\\+|\/+]\.)/.test(name)) return;
662
+
663
+ let headers = toHeaders(name, stats, isEtag);
664
+ if (cc) headers['Cache-Control'] = cc;
665
+
666
+ FILES['/' + name.normalize().replace(/\\+/g, '/')] = { abs, stats, headers };
667
+ });
668
+ }
669
+
670
+ let lookup = opts.dev ? viaLocal.bind(0, dir + sep, isEtag) : viaCache.bind(0, FILES);
671
+
672
+ return function (req, res, next) {
673
+ let extns = [''];
674
+ let pathname = parse$1(req).pathname;
675
+ let val = req.headers['accept-encoding'] || '';
676
+ if (gzips && val.includes('gzip')) extns.unshift(...gzips);
677
+ if (brots && /(br|brotli)/i.test(val)) extns.unshift(...brots);
678
+ extns.push(...extensions); // [...br, ...gz, orig, ...exts]
679
+
680
+ if (pathname.indexOf('%') !== -1) {
681
+ try { pathname = decodeURI(pathname); }
682
+ catch (err) { /* malform uri */ }
683
+ }
684
+
685
+ let data = lookup(pathname, extns) || isSPA && !isMatch(pathname, ignores) && lookup(fallback, extns);
686
+ if (!data) return next ? next() : isNotFound(req, res);
687
+
688
+ if (isEtag && req.headers['if-none-match'] === data.headers['ETag']) {
689
+ res.writeHead(304);
690
+ return res.end();
691
+ }
692
+
693
+ if (gzips || brots) {
694
+ res.setHeader('Vary', 'Accept-Encoding');
695
+ }
696
+
697
+ setHeaders(res, pathname, data.stats);
698
+ send(req, res, data.abs, data.stats, data.headers);
699
+ };
700
+ }
701
+
702
+ /**
703
+ * @param {string|RegExp} input The route pattern
704
+ * @param {boolean} [loose] Allow open-ended matching. Ignored with `RegExp` input.
705
+ */
706
+ function parse(input, loose) {
707
+ if (input instanceof RegExp) return { keys:false, pattern:input };
708
+ var c, o, tmp, ext, keys=[], pattern='', arr = input.split('/');
709
+ arr[0] || arr.shift();
710
+
711
+ while (tmp = arr.shift()) {
712
+ c = tmp[0];
713
+ if (c === '*') {
714
+ keys.push(c);
715
+ pattern += tmp[1] === '?' ? '(?:/(.*))?' : '/(.*)';
716
+ } else if (c === ':') {
717
+ o = tmp.indexOf('?', 1);
718
+ ext = tmp.indexOf('.', 1);
719
+ keys.push( tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length) );
720
+ pattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)';
721
+ if (!!~ext) pattern += (!!~o ? '?' : '') + '\\' + tmp.substring(ext);
722
+ } else {
723
+ pattern += '/' + tmp;
724
+ }
725
+ }
726
+
727
+ return {
728
+ keys: keys,
729
+ pattern: new RegExp('^' + pattern + (loose ? '(?=$|\/)' : '\/?$'), 'i')
730
+ };
731
+ }
732
+
733
+ const MAP = {
734
+ "": 0,
735
+ GET: 1,
736
+ HEAD: 2,
737
+ PATCH: 3,
738
+ OPTIONS: 4,
739
+ CONNECT: 5,
740
+ DELETE: 6,
741
+ TRACE: 7,
742
+ POST: 8,
743
+ PUT: 9,
744
+ };
745
+
746
+ class Trouter {
747
+ constructor() {
748
+ this.routes = [];
749
+
750
+ this.all = this.add.bind(this, '');
751
+ this.get = this.add.bind(this, 'GET');
752
+ this.head = this.add.bind(this, 'HEAD');
753
+ this.patch = this.add.bind(this, 'PATCH');
754
+ this.options = this.add.bind(this, 'OPTIONS');
755
+ this.connect = this.add.bind(this, 'CONNECT');
756
+ this.delete = this.add.bind(this, 'DELETE');
757
+ this.trace = this.add.bind(this, 'TRACE');
758
+ this.post = this.add.bind(this, 'POST');
759
+ this.put = this.add.bind(this, 'PUT');
760
+ }
761
+
762
+ use(route, ...fns) {
763
+ let handlers = [].concat.apply([], fns);
764
+ let { keys, pattern } = parse(route, true);
765
+ this.routes.push({ keys, pattern, method: '', handlers, midx: MAP[''] });
766
+ return this;
767
+ }
768
+
769
+ add(method, route, ...fns) {
770
+ let { keys, pattern } = parse(route);
771
+ let handlers = [].concat.apply([], fns);
772
+ this.routes.push({ keys, pattern, method, handlers, midx: MAP[method] });
773
+ return this;
774
+ }
775
+
776
+ find(method, url) {
777
+ let midx = MAP[method];
778
+ let isHEAD = (midx === 2);
779
+ let i=0, j=0, k, tmp, arr=this.routes;
780
+ let matches=[], params={}, handlers=[];
781
+ for (; i < arr.length; i++) {
782
+ tmp = arr[i];
783
+ if (tmp.midx === midx || tmp.midx === 0 || (isHEAD && tmp.midx===1) ) {
784
+ if (tmp.keys === false) {
785
+ matches = tmp.pattern.exec(url);
786
+ if (matches === null) continue;
787
+ if (matches.groups !== void 0) for (k in matches.groups) params[k]=matches.groups[k];
788
+ tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]);
789
+ } else if (tmp.keys.length > 0) {
790
+ matches = tmp.pattern.exec(url);
791
+ if (matches === null) continue;
792
+ for (j=0; j < tmp.keys.length;) params[tmp.keys[j]]=matches[++j];
793
+ tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]);
794
+ } else if (tmp.pattern.test(url)) {
795
+ tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]);
796
+ }
797
+ } // else not a match
798
+ }
799
+
800
+ return { params, handlers };
801
+ }
802
+ }
803
+
804
+ function onError(err, req, res) {
805
+ let code = typeof err.status === 'number' && err.status;
806
+ code = res.statusCode = (code && code >= 100 ? code : 500);
807
+ if (typeof err === 'string' || Buffer.isBuffer(err)) res.end(err);
808
+ else res.end(err.message || http.STATUS_CODES[code]);
809
+ }
810
+
811
+ const mount = fn => fn instanceof Polka ? fn.attach : fn;
812
+
813
+ class Polka extends Trouter {
814
+ constructor(opts={}) {
815
+ super();
816
+ this.parse = parse$1;
817
+ this.server = opts.server;
818
+ this.handler = this.handler.bind(this);
819
+ this.onError = opts.onError || onError; // catch-all handler
820
+ this.onNoMatch = opts.onNoMatch || this.onError.bind(null, { status: 404 });
821
+ this.attach = (req, res) => setImmediate(this.handler, req, res);
822
+ }
823
+
824
+ use(base, ...fns) {
825
+ if (base === '/') {
826
+ super.use(base, fns.map(mount));
827
+ } else if (typeof base === 'function' || base instanceof Polka) {
828
+ super.use('/', [base, ...fns].map(mount));
829
+ } else {
830
+ super.use(base,
831
+ (req, _, next) => {
832
+ if (typeof base === 'string') {
833
+ let len = base.length;
834
+ base.startsWith('/') || len++;
835
+ req.url = req.url.substring(len) || '/';
836
+ req.path = req.path.substring(len) || '/';
837
+ } else {
838
+ req.url = req.url.replace(base, '') || '/';
839
+ req.path = req.path.replace(base, '') || '/';
840
+ }
841
+ if (req.url.charAt(0) !== '/') {
842
+ req.url = '/' + req.url;
843
+ }
844
+ next();
845
+ },
846
+ fns.map(mount),
847
+ (req, _, next) => {
848
+ req.path = req._parsedUrl.pathname;
849
+ req.url = req.path + req._parsedUrl.search;
850
+ next();
851
+ }
852
+ );
853
+ }
854
+ return this; // chainable
855
+ }
856
+
857
+ listen() {
858
+ (this.server = this.server || http.createServer()).on('request', this.attach);
859
+ this.server.listen.apply(this.server, arguments);
860
+ return this;
861
+ }
862
+
863
+ handler(req, res, next) {
864
+ let info = this.parse(req), path = info.pathname;
865
+ let obj = this.find(req.method, req.path=path);
866
+
867
+ req.url = path + info.search;
868
+ req.originalUrl = req.originalUrl || req.url;
869
+ req.query = info.query || {};
870
+ req.search = info.search;
871
+ req.params = obj.params;
872
+
873
+ if (path.length > 1 && path.indexOf('%', 1) !== -1) {
874
+ for (let k in req.params) {
875
+ try { req.params[k] = decodeURIComponent(req.params[k]); }
876
+ catch (e) { /* malform uri segment */ }
877
+ }
878
+ }
879
+
880
+ let i=0, arr=obj.handlers.concat(this.onNoMatch), len=arr.length;
881
+ let loop = async () => res.finished || (i < len) && arr[i++](req, res, next);
882
+ (next = next || (err => err ? this.onError(err, req, res, next) : loop().catch(next)))(); // init
883
+ }
884
+ }
885
+
886
+ function polka (opts) {
887
+ return new Polka(opts);
888
+ }
889
+
890
+ function noop() {}
891
+
892
+ /** @import { RemoteForm } from '@sveltejs/kit' */
893
+ /** @import { BinaryFormMeta, InternalRemoteFormIssue } from 'types' */
894
+ /** @import { StandardSchemaV1 } from '@standard-schema/spec' */
895
+
896
+
897
+ new TextDecoder();
898
+
899
+ /**
900
+ * Reads all `Set-Cookie` headers as separate values. `Headers.get('set-cookie')`
901
+ * collapses them into a single comma-joined string that browsers cannot parse, so
902
+ * we use `Headers.getSetCookie()` where available and fall back to splitting the
903
+ * joined string otherwise.
904
+ *
905
+ * TODO 3.0 `getSetCookie` is available in Node 19.7+; once we drop support for
906
+ * older versions we can use it directly and remove the `splitCookiesString` fallback
907
+ * @param {Headers} headers
908
+ * @returns {string[]}
909
+ */
910
+ function get_set_cookies(headers) {
911
+ if (typeof headers.getSetCookie === 'function') {
912
+ return headers.getSetCookie();
913
+ }
914
+
915
+ const set_cookie = headers.get('set-cookie');
916
+ return set_cookie ? splitCookiesString(set_cookie) : [];
917
+ }
918
+
919
+ /**
920
+ * @param {import('http').IncomingMessage} req
921
+ * @param {number} [body_size_limit]
922
+ */
923
+ function get_raw_body(req, body_size_limit) {
924
+ const h = req.headers;
925
+
926
+ if (!h['content-type']) {
927
+ return null;
928
+ }
929
+
930
+ const content_length = Number(h['content-length']);
931
+ const has_content_length = Number.isFinite(content_length);
932
+
933
+ // check if no request body
934
+ if (
935
+ (req.httpVersionMajor === 1 && !has_content_length && h['transfer-encoding'] == null) ||
936
+ content_length === 0
937
+ ) {
938
+ return null;
939
+ }
940
+
941
+ if (req.destroyed) {
942
+ const readable = new ReadableStream();
943
+ void readable.cancel();
944
+ return readable;
945
+ }
946
+
947
+ let size = 0;
948
+ let cancelled = false;
949
+
950
+ return new ReadableStream({
951
+ start(controller) {
952
+ if (body_size_limit !== undefined && has_content_length && content_length > body_size_limit) {
953
+ let message = `Content-length of ${content_length} exceeds limit of ${body_size_limit} bytes.`;
954
+
955
+ if (body_size_limit === 0) {
956
+ // https://github.com/sveltejs/kit/pull/11589
957
+ // TODO this exists to aid migration — remove in a future version
958
+ message += ' To disable body size limits, specify Infinity rather than 0.';
959
+ }
960
+
961
+ const error = new SvelteKitError(413, 'Payload Too Large', message);
962
+
963
+ controller.error(error);
964
+ return;
965
+ }
966
+
967
+ req.on('error', (error) => {
968
+ cancelled = true;
969
+ controller.error(error);
970
+ });
971
+
972
+ req.on('end', () => {
973
+ if (cancelled) return;
974
+ controller.close();
975
+ });
976
+
977
+ req.on('data', (chunk) => {
978
+ if (cancelled) return;
979
+
980
+ size += chunk.length;
981
+
982
+ if (body_size_limit !== undefined && size > body_size_limit) {
983
+ cancelled = true;
984
+
985
+ const message = `request body size exceeded BODY_SIZE_LIMIT of ${body_size_limit}`;
986
+
987
+ const error = new SvelteKitError(413, 'Payload Too Large', message);
988
+ controller.error(error);
989
+
990
+ return;
991
+ }
992
+
993
+ if (has_content_length && size > content_length) {
994
+ cancelled = true;
995
+
996
+ const message = `request body size exceeded content-length of ${content_length}`;
997
+
998
+ const error = new SvelteKitError(413, 'Payload Too Large', message);
999
+ controller.error(error);
1000
+
1001
+ return;
1002
+ }
1003
+
1004
+ controller.enqueue(chunk);
1005
+
1006
+ if (controller.desiredSize === null || controller.desiredSize <= 0) {
1007
+ req.pause();
1008
+ }
1009
+ });
1010
+ },
1011
+
1012
+ pull() {
1013
+ req.resume();
1014
+ },
1015
+
1016
+ cancel(reason) {
1017
+ cancelled = true;
1018
+ req.destroy(reason);
1019
+ }
1020
+ });
1021
+ }
1022
+
1023
+ /**
1024
+ * @param {{
1025
+ * request: import('http').IncomingMessage;
1026
+ * base: string;
1027
+ * bodySizeLimit?: number;
1028
+ * }} options
1029
+ * @returns {Promise<Request>}
1030
+ */
1031
+ // TODO 3.0 make the signature synchronous?
1032
+ // eslint-disable-next-line @typescript-eslint/require-await
1033
+ async function getRequest({ request, base, bodySizeLimit }) {
1034
+ let headers = /** @type {Record<string, string>} */ (request.headers);
1035
+ if (request.httpVersionMajor >= 2) {
1036
+ // the Request constructor rejects headers with ':' in the name
1037
+ headers = Object.assign({}, headers);
1038
+ // https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.3.5
1039
+ if (headers[':authority']) {
1040
+ headers.host = headers[':authority'];
1041
+ }
1042
+ delete headers[':authority'];
1043
+ delete headers[':method'];
1044
+ delete headers[':path'];
1045
+ delete headers[':scheme'];
1046
+ }
1047
+
1048
+ // TODO: Whenever Node >=22 is minimum supported version, we can use `request.readableAborted`
1049
+ // @see https://github.com/nodejs/node/blob/5cf3c3e24c7257a0c6192ed8ef71efec8ddac22b/lib/internal/streams/readable.js#L1443-L1453
1050
+ const controller = new AbortController();
1051
+ let errored = false;
1052
+ let end_emitted = false;
1053
+ request.once('error', () => (errored = true));
1054
+ request.once('end', () => (end_emitted = true));
1055
+ request.once('close', () => {
1056
+ if ((errored || request.destroyed) && !end_emitted) {
1057
+ controller.abort();
1058
+ }
1059
+ });
1060
+
1061
+ return new Request(base + request.url, {
1062
+ // @ts-expect-error
1063
+ duplex: 'half',
1064
+ method: request.method,
1065
+ headers: Object.entries(headers),
1066
+ signal: controller.signal,
1067
+ body:
1068
+ request.method === 'GET' || request.method === 'HEAD'
1069
+ ? undefined
1070
+ : get_raw_body(request, bodySizeLimit)
1071
+ });
1072
+ }
1073
+
1074
+ /**
1075
+ * @param {import('http').ServerResponse} res
1076
+ * @param {Response} response
1077
+ * @returns {Promise<void>}
1078
+ */
1079
+ // TODO 3.0 make the signature synchronous?
1080
+ // eslint-disable-next-line @typescript-eslint/require-await
1081
+ async function setResponse(res, response) {
1082
+ for (const [key, value] of response.headers) {
1083
+ try {
1084
+ res.setHeader(key, key === 'set-cookie' ? get_set_cookies(response.headers) : value);
1085
+ } catch (error) {
1086
+ res.getHeaderNames().forEach((name) => res.removeHeader(name));
1087
+ res.writeHead(500).end(String(error));
1088
+ return;
1089
+ }
1090
+ }
1091
+
1092
+ res.writeHead(response.status);
1093
+
1094
+ if (!response.body) {
1095
+ res.end();
1096
+ return;
1097
+ }
1098
+
1099
+ if (response.body.locked) {
1100
+ res.end(
1101
+ 'Fatal error: Response body is locked. ' +
1102
+ "This can happen when the response was already read (for example through 'response.json()' or 'response.text()')."
1103
+ );
1104
+ return;
1105
+ }
1106
+
1107
+ const reader = response.body.getReader();
1108
+
1109
+ if (res.destroyed) {
1110
+ void reader.cancel();
1111
+ return;
1112
+ }
1113
+
1114
+ const cancel = (/** @type {Error|undefined} */ error) => {
1115
+ res.off('close', cancel);
1116
+ res.off('error', cancel);
1117
+
1118
+ // If the reader has already been interrupted with an error earlier,
1119
+ // then it will appear here, it is useless, but it needs to be catch.
1120
+ reader.cancel(error).catch(noop);
1121
+ if (error) res.destroy(error);
1122
+ };
1123
+
1124
+ res.on('close', cancel);
1125
+ res.on('error', cancel);
1126
+
1127
+ void next();
1128
+ async function next() {
1129
+ try {
1130
+ for (;;) {
1131
+ const { done, value } = await reader.read();
1132
+
1133
+ if (done) break;
1134
+
1135
+ if (!res.write(value)) {
1136
+ res.once('drain', next);
1137
+ return;
1138
+ }
1139
+ }
1140
+ res.end();
1141
+ } catch (error) {
1142
+ cancel(error instanceof Error ? error : new Error(String(error)));
1143
+ }
1144
+ }
1145
+ }
1146
+
1147
+ /**
1148
+ * Converts a file on disk to a readable stream
1149
+ * @param {string} file
1150
+ * @returns {ReadableStream}
1151
+ * @since 2.4.0
1152
+ */
1153
+ function createReadableStream(file) {
1154
+ return /** @type {ReadableStream} */ (Readable.toWeb(createReadStream(file)));
1155
+ }
1156
+
1157
+ /**
1158
+ * Parses the given value into number of bytes.
1159
+ *
1160
+ * @param {string} value - Size in bytes. Can also be specified with a unit suffix kilobytes (K), megabytes (M), or gigabytes (G).
1161
+ * @returns {number}
1162
+ */
1163
+ function parse_as_bytes(value) {
1164
+ const multiplier =
1165
+ {
1166
+ K: 1024,
1167
+ M: 1024 * 1024,
1168
+ G: 1024 * 1024 * 1024
1169
+ }[value[value.length - 1]?.toUpperCase()] ?? 1;
1170
+ return Number(multiplier != 1 ? value.substring(0, value.length - 1) : value) * multiplier;
1171
+ }
1172
+
1173
+ /**
1174
+ * Parses and validates an origin URL.
1175
+ *
1176
+ * @param {string | undefined} value - Origin URL with http:// or https:// protocol
1177
+ * @returns {string | undefined} The validated origin, or undefined if value is undefined
1178
+ * @throws {Error} If value is provided but invalid
1179
+ */
1180
+ function parse_origin(value) {
1181
+ if (value === undefined) {
1182
+ return undefined;
1183
+ }
1184
+
1185
+ const trimmed = value.trim();
1186
+
1187
+ let url;
1188
+ try {
1189
+ url = new URL(trimmed);
1190
+ } catch (error) {
1191
+ throw new Error(
1192
+ `Invalid ORIGIN: '${trimmed}'. ` +
1193
+ `ORIGIN must be a valid URL with http:// or https:// protocol. ` +
1194
+ `For example: 'http://localhost:3000' or 'https://my.site'`,
1195
+ { cause: error }
1196
+ );
1197
+ }
1198
+
1199
+ if (url.protocol !== 'http:' && url.protocol !== 'https:') {
1200
+ throw new Error(
1201
+ `Invalid ORIGIN: '${trimmed}'. ` +
1202
+ `Only http:// and https:// protocols are supported. ` +
1203
+ `Received protocol: ${url.protocol}`
1204
+ );
1205
+ }
1206
+
1207
+ return url.origin;
1208
+ }
1209
+
1210
+ /**
1211
+ * Formats the address the server is listening on.
1212
+ *
1213
+ * @param {string | false} path
1214
+ * @param {string} host
1215
+ * @param {string | false} port
1216
+ * @param {import('node:net').AddressInfo | string | null} address
1217
+ * @returns {string}
1218
+ */
1219
+ function format_listening_address(path, host, port, address) {
1220
+ if (path) {
1221
+ return path;
1222
+ }
1223
+
1224
+ if (address && typeof address === 'object') {
1225
+ return format({
1226
+ protocol: 'http:',
1227
+ hostname: address.address,
1228
+ port: address.port
1229
+ });
1230
+ }
1231
+
1232
+ return format({
1233
+ protocol: 'http:',
1234
+ hostname: host,
1235
+ port: String(port)
1236
+ });
1237
+ }
1238
+
1239
+ const prerendered = new Set([]);
1240
+
1241
+ const server = new Server(manifest);
1242
+
1243
+ // parse_origin validates ORIGIN and throws descriptive errors for invalid values
1244
+ const origin = parse_origin(env('ORIGIN', undefined));
1245
+
1246
+ const xff_depth = parseInt(env('XFF_DEPTH', '1'));
1247
+ const address_header = env('ADDRESS_HEADER', '').toLowerCase();
1248
+ const protocol_header = env('PROTOCOL_HEADER', '').toLowerCase();
1249
+ const host_header = env('HOST_HEADER', '').toLowerCase();
1250
+ const port_header = env('PORT_HEADER', '').toLowerCase();
1251
+
1252
+ const body_size_limit = parse_as_bytes(env('BODY_SIZE_LIMIT', '512K'));
1253
+
1254
+ if (isNaN(body_size_limit)) {
1255
+ throw new Error(
1256
+ `Invalid BODY_SIZE_LIMIT: '${env('BODY_SIZE_LIMIT')}'. Please provide a numeric value.`
1257
+ );
1258
+ }
1259
+
1260
+ const asset_dir = `${dir}/client${""}`;
1261
+
1262
+ await server.init({
1263
+ env: /** @type {Record<string, string>} */ (process.env),
1264
+ read: (file) => createReadableStream(`${asset_dir}/${file}`)
1265
+ });
1266
+
1267
+ /**
1268
+ * @param {string} path
1269
+ * @param {boolean} client
1270
+ */
1271
+ function serve(path, client = false) {
1272
+ return fs__default.existsSync(path)
1273
+ ? sirv(path, {
1274
+ etag: true,
1275
+ gzip: true,
1276
+ brotli: true,
1277
+ setHeaders: client
1278
+ ? (res, pathname) => {
1279
+ // only apply to build directory, not e.g. version.json
1280
+ if (
1281
+ pathname.startsWith(`/${manifest.appPath}/immutable/`) &&
1282
+ res.statusCode === 200
1283
+ ) {
1284
+ res.setHeader('cache-control', 'public,max-age=31536000,immutable');
1285
+ }
1286
+ }
1287
+ : undefined
1288
+ })
1289
+ : undefined;
1290
+ }
1291
+
1292
+ // required because the static file server ignores trailing slashes
1293
+ /** @returns {import('polka').Middleware} */
1294
+ function serve_prerendered() {
1295
+ const handler = serve(path.join(dir, 'prerendered'));
1296
+
1297
+ return (req, res, next) => {
1298
+ let { pathname, search, query } = parse$1(req);
1299
+
1300
+ try {
1301
+ pathname = decodeURIComponent(pathname);
1302
+ } catch {
1303
+ // ignore invalid URI
1304
+ }
1305
+
1306
+ if (prerendered.has(pathname)) {
1307
+ return handler?.(req, res, next);
1308
+ }
1309
+
1310
+ // remove or add trailing slash as appropriate
1311
+ let location = pathname.at(-1) === '/' ? pathname.slice(0, -1) : pathname + '/';
1312
+ if (prerendered.has(location)) {
1313
+ if (query) location += search;
1314
+ res.writeHead(308, { location }).end();
1315
+ } else {
1316
+ void next();
1317
+ }
1318
+ };
1319
+ }
1320
+
1321
+ /** @type {import('polka').Middleware} */
1322
+ const ssr = async (req, res) => {
1323
+ /** @type {Request} */
1324
+ let request;
1325
+
1326
+ try {
1327
+ request = await getRequest({
1328
+ base: origin || get_origin(req.headers),
1329
+ request: req,
1330
+ bodySizeLimit: body_size_limit
1331
+ });
1332
+ } catch {
1333
+ res.statusCode = 400;
1334
+ res.end('Bad Request');
1335
+ return;
1336
+ }
1337
+
1338
+ const response = await server.respond(request, {
1339
+ platform: { req },
1340
+ getClientAddress: () => {
1341
+ if (address_header) {
1342
+ if (!(address_header in req.headers)) {
1343
+ throw new Error(
1344
+ `Address header was specified with ${
1345
+ env_prefix + 'ADDRESS_HEADER'
1346
+ }=${address_header} but is absent from request`
1347
+ );
1348
+ }
1349
+
1350
+ const value = /** @type {string} */ (req.headers[address_header]) || '';
1351
+
1352
+ if (address_header === 'x-forwarded-for') {
1353
+ const addresses = value.split(',');
1354
+
1355
+ if (xff_depth < 1) {
1356
+ throw new Error(`${env_prefix + 'XFF_DEPTH'} must be a positive integer`);
1357
+ }
1358
+
1359
+ if (xff_depth > addresses.length) {
1360
+ throw new Error(
1361
+ `${env_prefix + 'XFF_DEPTH'} is ${xff_depth}, but only found ${
1362
+ addresses.length
1363
+ } addresses`
1364
+ );
1365
+ }
1366
+ return addresses[addresses.length - xff_depth].trim();
1367
+ }
1368
+
1369
+ return value;
1370
+ }
1371
+
1372
+ return (
1373
+ req.connection?.remoteAddress ||
1374
+ // @ts-expect-error
1375
+ req.connection?.socket?.remoteAddress ||
1376
+ req.socket?.remoteAddress ||
1377
+ // @ts-expect-error
1378
+ req.info?.remoteAddress
1379
+ );
1380
+ }
1381
+ });
1382
+
1383
+ // Reverse proxies such as nginx buffer responses by default (ignoring
1384
+ // `cache-control`), which breaks streaming responses like server-sent events.
1385
+ // `X-Accel-Buffering: no` opts out of that buffering and is a no-op on proxies
1386
+ // that don't recognise it. See https://github.com/sveltejs/kit/issues/15790
1387
+ if (response.headers.get('content-type') === 'text/event-stream') {
1388
+ response.headers.set('x-accel-buffering', 'no');
1389
+ }
1390
+
1391
+ await setResponse(res, response);
1392
+ };
1393
+
1394
+ /** @param {import('polka').Middleware[]} handlers */
1395
+ function sequence(handlers) {
1396
+ /** @type {import('polka').Middleware} */
1397
+ return (req, res, next) => {
1398
+ /**
1399
+ * @param {number} i
1400
+ * @returns {ReturnType<import('polka').Middleware>}
1401
+ */
1402
+ function handle(i) {
1403
+ if (i < handlers.length) {
1404
+ return handlers[i](req, res, () => handle(i + 1));
1405
+ } else {
1406
+ return next();
1407
+ }
1408
+ }
1409
+
1410
+ return handle(0);
1411
+ };
1412
+ }
1413
+
1414
+ /**
1415
+ * @param {string} name
1416
+ * @param {string | string[] | undefined} value
1417
+ * @returns {string | undefined}
1418
+ */
1419
+ function normalise_header(name, value) {
1420
+ if (!name) return undefined;
1421
+ if (Array.isArray(value)) {
1422
+ if (value.length === 0) return undefined;
1423
+ if (value.length === 1) return value[0];
1424
+ throw new Error(
1425
+ `Multiple values provided for ${name} header where only one expected: ${value}`
1426
+ );
1427
+ }
1428
+ return value;
1429
+ }
1430
+
1431
+ /**
1432
+ * @param {import('http').IncomingHttpHeaders} headers
1433
+ * @returns {string}
1434
+ */
1435
+ function get_origin(headers) {
1436
+ const protocol = decodeURIComponent(
1437
+ normalise_header(protocol_header, headers[protocol_header]) || 'https'
1438
+ );
1439
+
1440
+ // this helps us avoid host injections through the protocol header
1441
+ if (protocol.includes(':')) {
1442
+ throw new Error(
1443
+ `The ${protocol_header} header specified ${protocol} which is an invalid because it includes \`:\`. It should only contain the protocol scheme (e.g. \`https\`)`
1444
+ );
1445
+ }
1446
+
1447
+ const host =
1448
+ normalise_header(host_header, headers[host_header]) ||
1449
+ normalise_header('host', headers['host']);
1450
+ if (!host) {
1451
+ const header_names = host_header ? `${host_header} or host headers` : 'host header';
1452
+ throw new Error(
1453
+ `Could not determine host. The request must have a value provided by the ${header_names}`
1454
+ );
1455
+ }
1456
+
1457
+ const port = normalise_header(port_header, headers[port_header]);
1458
+ if (port && isNaN(+port)) {
1459
+ throw new Error(
1460
+ `The ${port_header} header specified ${port} which is an invalid port because it is not a number. The value should only contain the port number (e.g. 443)`
1461
+ );
1462
+ }
1463
+
1464
+ return port ? `${protocol}://${host}:${port}` : `${protocol}://${host}`;
1465
+ }
1466
+
1467
+ const handler = sequence(
1468
+ /** @type {(import('sirv').RequestHandler | import('polka').Middleware)[]} */
1469
+ ([serve(path.join(dir, 'client'), true), serve_prerendered(), ssr].filter(Boolean))
1470
+ );
1471
+
1472
+ export { format_listening_address as f, handler as h, polka as p };
1473
+ //# sourceMappingURL=handler-Hnwc-LvR.js.map