mongoku 2.6.0-compat → 2.7.0-compat

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 (453) hide show
  1. package/Dockerfile +1 -0
  2. package/README.md +25 -0
  3. package/build/client/_app/immutable/assets/0.CdYhspVa.css +1 -0
  4. package/build/client/_app/immutable/assets/0.CdYhspVa.css.br +0 -0
  5. package/build/client/_app/immutable/assets/0.CdYhspVa.css.gz +0 -0
  6. package/build/client/_app/immutable/chunks/{DdLT9cdj.js → B59nRjE7.js} +1 -1
  7. package/build/client/_app/immutable/chunks/B59nRjE7.js.br +2 -0
  8. package/build/client/_app/immutable/chunks/B59nRjE7.js.gz +0 -0
  9. package/build/client/_app/immutable/chunks/BBqIHhSl.js +1 -0
  10. package/build/client/_app/immutable/chunks/BBqIHhSl.js.br +0 -0
  11. package/build/client/_app/immutable/chunks/BBqIHhSl.js.gz +0 -0
  12. package/build/client/_app/immutable/chunks/{BJ-rqge0.js → BIUJX0Ps.js} +6 -6
  13. package/build/client/_app/immutable/chunks/BIUJX0Ps.js.br +0 -0
  14. package/build/client/_app/immutable/chunks/BIUJX0Ps.js.gz +0 -0
  15. package/build/client/_app/immutable/chunks/C6nv_pni.js +1 -0
  16. package/build/client/_app/immutable/chunks/C6nv_pni.js.br +0 -0
  17. package/build/client/_app/immutable/chunks/C6nv_pni.js.gz +0 -0
  18. package/build/client/_app/immutable/chunks/{C5cMJ08W.js → CETiZ6GF.js} +1 -1
  19. package/build/client/_app/immutable/chunks/CETiZ6GF.js.br +0 -0
  20. package/build/client/_app/immutable/chunks/CETiZ6GF.js.gz +0 -0
  21. package/build/client/_app/immutable/chunks/CX0xC2bt.js +1 -0
  22. package/build/client/_app/immutable/chunks/CX0xC2bt.js.br +0 -0
  23. package/build/client/_app/immutable/chunks/CX0xC2bt.js.gz +0 -0
  24. package/build/client/_app/immutable/chunks/CeXlKXQN.js +1 -0
  25. package/build/client/_app/immutable/chunks/CeXlKXQN.js.br +0 -0
  26. package/build/client/_app/immutable/chunks/CeXlKXQN.js.gz +0 -0
  27. package/build/client/_app/immutable/chunks/ChTiw7nk.js +4 -0
  28. package/build/client/_app/immutable/chunks/ChTiw7nk.js.br +0 -0
  29. package/build/client/_app/immutable/chunks/ChTiw7nk.js.gz +0 -0
  30. package/build/client/_app/immutable/chunks/Czyt1_Wc.js +1 -0
  31. package/build/client/_app/immutable/chunks/Czyt1_Wc.js.br +0 -0
  32. package/build/client/_app/immutable/chunks/Czyt1_Wc.js.gz +0 -0
  33. package/build/client/_app/immutable/chunks/{B5NTIIm5.js → DJHYr09v.js} +1 -1
  34. package/build/client/_app/immutable/chunks/DJHYr09v.js.br +0 -0
  35. package/build/client/_app/immutable/chunks/DJHYr09v.js.gz +0 -0
  36. package/build/client/_app/immutable/chunks/{BER7n7JT.js → DZxZehvI.js} +1 -1
  37. package/build/client/_app/immutable/chunks/DZxZehvI.js.br +0 -0
  38. package/build/client/_app/immutable/chunks/DZxZehvI.js.gz +0 -0
  39. package/build/client/_app/immutable/chunks/DaNl6Y92.js +2 -0
  40. package/build/client/_app/immutable/chunks/DaNl6Y92.js.br +0 -0
  41. package/build/client/_app/immutable/chunks/DaNl6Y92.js.gz +0 -0
  42. package/build/client/_app/immutable/chunks/Dbu5gl04.js +1 -0
  43. package/build/client/_app/immutable/chunks/Dbu5gl04.js.br +0 -0
  44. package/build/client/_app/immutable/chunks/Dbu5gl04.js.gz +0 -0
  45. package/build/client/_app/immutable/chunks/DczwA5Ds.js +1 -0
  46. package/build/client/_app/immutable/chunks/DczwA5Ds.js.br +0 -0
  47. package/build/client/_app/immutable/chunks/DczwA5Ds.js.gz +0 -0
  48. package/build/client/_app/immutable/chunks/DjlV9yev.js +1 -0
  49. package/build/client/_app/immutable/chunks/DjlV9yev.js.br +0 -0
  50. package/build/client/_app/immutable/chunks/DjlV9yev.js.gz +0 -0
  51. package/build/client/_app/immutable/chunks/DkIdyQoH.js +1 -0
  52. package/build/client/_app/immutable/chunks/DkIdyQoH.js.br +0 -0
  53. package/build/client/_app/immutable/chunks/DkIdyQoH.js.gz +0 -0
  54. package/build/client/_app/immutable/chunks/DskkUG-R.js +41 -0
  55. package/build/client/_app/immutable/chunks/DskkUG-R.js.br +0 -0
  56. package/build/client/_app/immutable/chunks/DskkUG-R.js.gz +0 -0
  57. package/build/client/_app/immutable/chunks/DtqR9xj2.js +16 -0
  58. package/build/client/_app/immutable/chunks/DtqR9xj2.js.br +0 -0
  59. package/build/client/_app/immutable/chunks/DtqR9xj2.js.gz +0 -0
  60. package/build/client/_app/immutable/chunks/{c-rWvg5T.js → Dv9wDVNU.js} +1 -1
  61. package/build/client/_app/immutable/chunks/Dv9wDVNU.js.br +0 -0
  62. package/build/client/_app/immutable/chunks/Dv9wDVNU.js.gz +0 -0
  63. package/build/client/_app/immutable/chunks/{Bl8s7Z6r.js → DwvJoC1a.js} +1 -1
  64. package/build/client/_app/immutable/chunks/DwvJoC1a.js.br +0 -0
  65. package/build/client/_app/immutable/chunks/DwvJoC1a.js.gz +0 -0
  66. package/build/client/_app/immutable/chunks/ULh2o3ji.js +1 -0
  67. package/build/client/_app/immutable/chunks/ULh2o3ji.js.br +0 -0
  68. package/build/client/_app/immutable/chunks/ULh2o3ji.js.gz +0 -0
  69. package/build/client/_app/immutable/chunks/V1mdyEl2.js +1 -0
  70. package/build/client/_app/immutable/chunks/V1mdyEl2.js.br +0 -0
  71. package/build/client/_app/immutable/chunks/V1mdyEl2.js.gz +0 -0
  72. package/build/client/_app/immutable/chunks/{DUw-I2kh.js → gjWX2x82.js} +1 -1
  73. package/build/client/_app/immutable/chunks/gjWX2x82.js.br +0 -0
  74. package/build/client/_app/immutable/chunks/gjWX2x82.js.gz +0 -0
  75. package/build/client/_app/immutable/chunks/{CxcplU4Q.js → y5L2Na-S.js} +1 -1
  76. package/build/client/_app/immutable/chunks/y5L2Na-S.js.br +0 -0
  77. package/build/client/_app/immutable/chunks/y5L2Na-S.js.gz +0 -0
  78. package/build/client/_app/immutable/entry/app.DSC3O-oq.js +2 -0
  79. package/build/client/_app/immutable/entry/app.DSC3O-oq.js.br +0 -0
  80. package/build/client/_app/immutable/entry/app.DSC3O-oq.js.gz +0 -0
  81. package/build/client/_app/immutable/entry/start.DXWFdQeQ.js +1 -0
  82. package/build/client/_app/immutable/entry/start.DXWFdQeQ.js.br +0 -0
  83. package/build/client/_app/immutable/entry/start.DXWFdQeQ.js.gz +0 -0
  84. package/build/client/_app/immutable/nodes/0.CMAlzqMw.js +1 -0
  85. package/build/client/_app/immutable/nodes/0.CMAlzqMw.js.br +0 -0
  86. package/build/client/_app/immutable/nodes/0.CMAlzqMw.js.gz +0 -0
  87. package/build/client/_app/immutable/nodes/1.B6Npt7WS.js +1 -0
  88. package/build/client/_app/immutable/nodes/1.B6Npt7WS.js.br +4 -0
  89. package/build/client/_app/immutable/nodes/1.B6Npt7WS.js.gz +0 -0
  90. package/build/client/_app/immutable/nodes/10.UKtNnnWx.js +2 -0
  91. package/build/client/_app/immutable/nodes/10.UKtNnnWx.js.br +0 -0
  92. package/build/client/_app/immutable/nodes/10.UKtNnnWx.js.gz +0 -0
  93. package/build/client/_app/immutable/nodes/11.DZQrIhD6.js +6 -0
  94. package/build/client/_app/immutable/nodes/11.DZQrIhD6.js.br +0 -0
  95. package/build/client/_app/immutable/nodes/11.DZQrIhD6.js.gz +0 -0
  96. package/build/client/_app/immutable/nodes/12.Bb2XzJJ4.js +1 -0
  97. package/build/client/_app/immutable/nodes/12.Bb2XzJJ4.js.br +0 -0
  98. package/build/client/_app/immutable/nodes/12.Bb2XzJJ4.js.gz +0 -0
  99. package/build/client/_app/immutable/nodes/13.B_EllgAJ.js +1 -0
  100. package/build/client/_app/immutable/nodes/13.B_EllgAJ.js.br +0 -0
  101. package/build/client/_app/immutable/nodes/13.B_EllgAJ.js.gz +0 -0
  102. package/build/client/_app/immutable/nodes/14.Ds1Cbw86.js +65 -0
  103. package/build/client/_app/immutable/nodes/14.Ds1Cbw86.js.br +0 -0
  104. package/build/client/_app/immutable/nodes/14.Ds1Cbw86.js.gz +0 -0
  105. package/build/client/_app/immutable/nodes/{2.AM8fesja.js → 2.C6NzDBVE.js} +1 -1
  106. package/build/client/_app/immutable/nodes/2.C6NzDBVE.js.br +2 -0
  107. package/build/client/_app/immutable/nodes/2.C6NzDBVE.js.gz +0 -0
  108. package/build/client/_app/immutable/nodes/{3.BShuoOz5.js → 3.CZJqJ4La.js} +1 -1
  109. package/build/client/_app/immutable/nodes/3.CZJqJ4La.js.br +0 -0
  110. package/build/client/_app/immutable/nodes/3.CZJqJ4La.js.gz +0 -0
  111. package/build/client/_app/immutable/nodes/{4.BD6QbApY.js → 4.CNe3XPNo.js} +1 -1
  112. package/build/client/_app/immutable/nodes/4.CNe3XPNo.js.br +0 -0
  113. package/build/client/_app/immutable/nodes/4.CNe3XPNo.js.gz +0 -0
  114. package/build/client/_app/immutable/nodes/{5.JM_dwz0R.js → 5.BWhhv567.js} +1 -1
  115. package/build/client/_app/immutable/nodes/5.BWhhv567.js.br +0 -0
  116. package/build/client/_app/immutable/nodes/5.BWhhv567.js.gz +0 -0
  117. package/build/client/_app/immutable/nodes/7.DrDdJlUZ.js +1 -0
  118. package/build/client/_app/immutable/nodes/7.DrDdJlUZ.js.br +0 -0
  119. package/build/client/_app/immutable/nodes/7.DrDdJlUZ.js.gz +0 -0
  120. package/build/client/_app/immutable/nodes/8.DY5fyf2p.js +2 -0
  121. package/build/client/_app/immutable/nodes/8.DY5fyf2p.js.br +0 -0
  122. package/build/client/_app/immutable/nodes/8.DY5fyf2p.js.gz +0 -0
  123. package/build/client/_app/immutable/nodes/9.DSZg3ucy.js +1 -0
  124. package/build/client/_app/immutable/nodes/9.DSZg3ucy.js.br +0 -0
  125. package/build/client/_app/immutable/nodes/9.DSZg3ucy.js.gz +0 -0
  126. package/build/client/_app/version.json +1 -1
  127. package/build/client/_app/version.json.br +0 -0
  128. package/build/client/_app/version.json.gz +0 -0
  129. package/build/client/robots.txt.br +0 -0
  130. package/build/client/robots.txt.gz +0 -0
  131. package/build/handler.js +290 -228
  132. package/build/server/chunks/0-94hvO2vX.js +31 -0
  133. package/build/server/chunks/0-94hvO2vX.js.map +1 -0
  134. package/build/server/chunks/1-DU2n-wa5.js +9 -0
  135. package/build/server/chunks/1-DU2n-wa5.js.map +1 -0
  136. package/build/server/chunks/{9-DgCY2nR6.js → 10-CA3VfgE7.js} +7 -6
  137. package/build/server/chunks/10-CA3VfgE7.js.map +1 -0
  138. package/build/server/chunks/{10-FW86ZAmq.js → 11-xh-tBR25.js} +8 -7
  139. package/build/server/chunks/11-xh-tBR25.js.map +1 -0
  140. package/build/server/chunks/{11-DOvRxt7n.js → 12-CHoThn5d.js} +8 -7
  141. package/build/server/chunks/12-CHoThn5d.js.map +1 -0
  142. package/build/server/chunks/{12-Bf51NZHg.js → 13-s3o-iKja.js} +8 -7
  143. package/build/server/chunks/13-s3o-iKja.js.map +1 -0
  144. package/build/server/chunks/{13-CcZ-9baj.js → 14-Ch_I9f3x.js} +7 -6
  145. package/build/server/chunks/14-Ch_I9f3x.js.map +1 -0
  146. package/build/server/chunks/{2-DaZMexAs.js → 2-BNTmkYSf.js} +2 -2
  147. package/build/server/chunks/{2-DaZMexAs.js.map → 2-BNTmkYSf.js.map} +1 -1
  148. package/build/server/chunks/{3-Dr4vFhF1.js → 3-ClKd4dXQ.js} +2 -2
  149. package/build/server/chunks/{3-Dr4vFhF1.js.map → 3-ClKd4dXQ.js.map} +1 -1
  150. package/build/server/chunks/{4-K2WnEwm7.js → 4-BSPVNKkN.js} +2 -2
  151. package/build/server/chunks/{4-K2WnEwm7.js.map → 4-BSPVNKkN.js.map} +1 -1
  152. package/build/server/chunks/{5-Be-Du8oZ.js → 5-BzxZlQk0.js} +2 -2
  153. package/build/server/chunks/{5-Be-Du8oZ.js.map → 5-BzxZlQk0.js.map} +1 -1
  154. package/build/server/chunks/{6-DsYzHmsZ.js → 6-Bw8JUxiD.js} +3 -2
  155. package/build/server/chunks/6-Bw8JUxiD.js.map +1 -0
  156. package/build/server/chunks/7-B_ur3ckj.js +9 -0
  157. package/build/server/chunks/7-B_ur3ckj.js.map +1 -0
  158. package/build/server/chunks/{7-B04juXwR.js → 8-BEcdRamT.js} +8 -7
  159. package/build/server/chunks/8-BEcdRamT.js.map +1 -0
  160. package/build/server/chunks/{8-CBDbW932.js → 9-CeMYWy9o.js} +7 -6
  161. package/build/server/chunks/9-CeMYWy9o.js.map +1 -0
  162. package/build/server/chunks/JsonValue-CTg4aH_w.js +320 -0
  163. package/build/server/chunks/JsonValue-CTg4aH_w.js.map +1 -0
  164. package/build/server/chunks/{Modal-fWUUqg69.js → Modal-yO0qzufQ.js} +2 -3
  165. package/build/server/chunks/Modal-yO0qzufQ.js.map +1 -0
  166. package/build/server/chunks/{Panel-BXokpC3w.js → Panel-D9GzVDDt.js} +7 -12
  167. package/build/server/chunks/Panel-D9GzVDDt.js.map +1 -0
  168. package/build/server/chunks/{PrettyJson-CV4qF02W.js → PrettyJson-CzzntSVh.js} +15 -10
  169. package/build/server/chunks/PrettyJson-CzzntSVh.js.map +1 -0
  170. package/build/server/chunks/{Tooltip-1tZ4BUxU.js → Tooltip-D2BX7dwq.js} +2 -2
  171. package/build/server/chunks/Tooltip-D2BX7dwq.js.map +1 -0
  172. package/build/server/chunks/{TooltipTable-B2QGp4YW.js → TooltipTable-91W9LxGR.js} +3 -4
  173. package/build/server/chunks/TooltipTable-91W9LxGR.js.map +1 -0
  174. package/build/server/chunks/{_layout.svelte-DAGMbkJX.js → _layout.svelte-BFxKanne.js} +28 -24
  175. package/build/server/chunks/_layout.svelte-BFxKanne.js.map +1 -0
  176. package/build/server/chunks/{_page.svelte-DgQxD9T8.js → _page.svelte-CQzzieEo.js} +16 -18
  177. package/build/server/chunks/_page.svelte-CQzzieEo.js.map +1 -0
  178. package/build/server/chunks/_page.svelte-CSuE9bVi.js +14 -0
  179. package/build/server/chunks/_page.svelte-CSuE9bVi.js.map +1 -0
  180. package/build/server/chunks/{_page.svelte-DfZ2COw_.js → _page.svelte-CnboYQ1K.js} +11 -73
  181. package/build/server/chunks/_page.svelte-CnboYQ1K.js.map +1 -0
  182. package/build/server/chunks/{_page.svelte-ClakOyno.js → _page.svelte-D41VQj4U.js} +17 -19
  183. package/build/server/chunks/_page.svelte-D41VQj4U.js.map +1 -0
  184. package/build/server/chunks/{_page.svelte-CB9ZXhBt.js → _page.svelte-Dg71nX8A.js} +117 -97
  185. package/build/server/chunks/_page.svelte-Dg71nX8A.js.map +1 -0
  186. package/build/server/chunks/{_page.svelte-BUqI0nM9.js → _page.svelte-DxlZXLVf.js} +17 -19
  187. package/build/server/chunks/_page.svelte-DxlZXLVf.js.map +1 -0
  188. package/build/server/chunks/{_page.svelte-Ccc0KJ66.js → _page.svelte-SZxwc25D.js} +45 -39
  189. package/build/server/chunks/_page.svelte-SZxwc25D.js.map +1 -0
  190. package/build/server/chunks/{_page.svelte-wmgrrvR7.js → _page.svelte-THKAhY4k.js} +48 -51
  191. package/build/server/chunks/_page.svelte-THKAhY4k.js.map +1 -0
  192. package/build/server/chunks/_server.ts-B3lXxheE.js +15 -0
  193. package/build/server/chunks/_server.ts-B3lXxheE.js.map +1 -0
  194. package/build/server/chunks/_server.ts-Bs5HC7Wf.js +46 -0
  195. package/build/server/chunks/_server.ts-Bs5HC7Wf.js.map +1 -0
  196. package/build/server/chunks/_server.ts-DRL9sDg4.js +34 -0
  197. package/build/server/chunks/_server.ts-DRL9sDg4.js.map +1 -0
  198. package/build/server/chunks/_server.ts-DqL5edUL.js +24 -0
  199. package/build/server/chunks/_server.ts-DqL5edUL.js.map +1 -0
  200. package/build/server/chunks/client-C7bEwskR.js +7 -0
  201. package/build/server/chunks/{client-BCfAqu0g.js.map → client-C7bEwskR.js.map} +1 -1
  202. package/build/server/chunks/{client2-B-hc4vU8.js → client2-DcCKOWWC.js} +6 -6
  203. package/build/server/chunks/client2-DcCKOWWC.js.map +1 -0
  204. package/build/server/chunks/error.svelte-Bk-0XnBt.js +18 -0
  205. package/build/server/chunks/error.svelte-Bk-0XnBt.js.map +1 -0
  206. package/build/server/chunks/exports-B5ORJhfK.js +65 -0
  207. package/build/server/chunks/exports-B5ORJhfK.js.map +1 -0
  208. package/build/server/chunks/{filters-CbFjTNFI.js → filters-B3U8Nh9P.js} +16 -6
  209. package/build/server/chunks/filters-B3U8Nh9P.js.map +1 -0
  210. package/build/server/chunks/hooks.server-Cq7ufuFU.js +79 -0
  211. package/build/server/chunks/hooks.server-Cq7ufuFU.js.map +1 -0
  212. package/build/server/chunks/{index2-CJE0QJlP.js → index-CC9WtE-y.js} +3 -13
  213. package/build/server/chunks/index-CC9WtE-y.js.map +1 -0
  214. package/build/server/chunks/index-wpIsICWW.js.map +1 -1
  215. package/build/server/chunks/{index3-CQyDuV4f.js → index2-DMabdSHV.js} +3 -3
  216. package/build/server/chunks/index2-DMabdSHV.js.map +1 -0
  217. package/build/server/chunks/{logger-KF6KpVP6.js → logger-PfH_grbh.js} +4 -3
  218. package/build/server/chunks/logger-PfH_grbh.js.map +1 -0
  219. package/build/server/chunks/{mongo-CpQtfvt6.js → mongo-B92d7zNj.js} +25 -24
  220. package/build/server/chunks/mongo-B92d7zNj.js.map +1 -0
  221. package/build/server/chunks/oauth-BfIECOev.js +178 -0
  222. package/build/server/chunks/oauth-BfIECOev.js.map +1 -0
  223. package/build/server/chunks/remote-xxtqbu-D0yn6nhQ.js +22 -0
  224. package/build/server/chunks/remote-xxtqbu-D0yn6nhQ.js.map +1 -0
  225. package/build/server/chunks/{routing-BdGCua8Q.js → routing-CYknP78v.js} +23 -4
  226. package/build/server/chunks/routing-CYknP78v.js.map +1 -0
  227. package/build/server/chunks/{server2-CkPmd3Rb.js → server2-uigtM6st.js} +3 -3
  228. package/build/server/chunks/server2-uigtM6st.js.map +1 -0
  229. package/build/server/chunks/{servers.remote-OwAA4KJJ.js → servers.remote-BhpVo4Zs.js} +67 -42
  230. package/build/server/chunks/servers.remote-BhpVo4Zs.js.map +1 -0
  231. package/build/server/chunks/shared-BqTYMAzZ.js +1027 -0
  232. package/build/server/chunks/shared-BqTYMAzZ.js.map +1 -0
  233. package/build/server/chunks/shared-server-BmU87nph.js +11 -0
  234. package/build/server/chunks/shared-server-BmU87nph.js.map +1 -0
  235. package/build/server/chunks/{state.svelte-BfzDwKMC.js → state.svelte-Dzb7Lf2r.js} +2 -3
  236. package/build/server/chunks/state.svelte-Dzb7Lf2r.js.map +1 -0
  237. package/build/server/chunks/url-hmE1zcJ6.js +4721 -0
  238. package/build/server/chunks/url-hmE1zcJ6.js.map +1 -0
  239. package/build/server/chunks/{utils-kjxf7BZO.js → utils2-kjxf7BZO.js} +1 -1
  240. package/build/server/chunks/utils2-kjxf7BZO.js.map +1 -0
  241. package/build/server/index.js +381 -3466
  242. package/build/server/index.js.map +1 -1
  243. package/build/server/manifest.js +52 -23
  244. package/build/server/manifest.js.map +1 -1
  245. package/cli.ts +4 -0
  246. package/dist/cli.js +3 -0
  247. package/ecosystem.config.js +3 -0
  248. package/package.json +2 -2
  249. package/src/api/servers.remote.ts +20 -8
  250. package/src/app.d.ts +5 -0
  251. package/src/hooks.server.ts +38 -17
  252. package/src/lib/actions/jsonTextarea.ts +24 -8
  253. package/src/lib/actions/portal.ts +12 -5
  254. package/src/lib/components/ExplainPanel.svelte +42 -14
  255. package/src/lib/components/JsonValue.svelte +12 -4
  256. package/src/lib/components/PrettyJson.svelte +12 -4
  257. package/src/lib/components/ReplicaSetSelector.svelte +3 -1
  258. package/src/lib/components/SearchBox.svelte +12 -4
  259. package/src/lib/components/Tooltip.svelte +1 -1
  260. package/src/lib/server/HostsManager.ts +8 -17
  261. package/src/lib/server/logger.ts +4 -4
  262. package/src/lib/server/mongo.ts +17 -12
  263. package/src/lib/server/oauth.ts +276 -0
  264. package/src/lib/utils/filters.ts +15 -5
  265. package/src/lib/utils/formatSignificantDigits.ts +3 -1
  266. package/src/lib/utils/formatTimeAgo.ts +3 -1
  267. package/src/lib/utils/hostnames.ts +15 -5
  268. package/src/lib/utils/jsonParser.ts +21 -7
  269. package/src/lib/utils/longestCommonSuffix.ts +3 -1
  270. package/src/routes/+layout.server.ts +5 -1
  271. package/src/routes/+layout.svelte +16 -1
  272. package/src/routes/.well-known/cimd.json/+server.ts +34 -0
  273. package/src/routes/auth/callback/+server.ts +57 -0
  274. package/src/routes/auth/login/+server.ts +29 -0
  275. package/src/routes/auth/logout/+page.svelte +9 -0
  276. package/src/routes/auth/logout/+server.ts +9 -0
  277. package/src/routes/servers/+page.svelte +9 -4
  278. package/src/routes/servers/[server]/databases/+page.svelte +3 -1
  279. package/src/routes/servers/[server]/databases/[database]/collections/+page.svelte +3 -1
  280. package/src/routes/servers/[server]/databases/[database]/collections/[collection]/documents/+page.svelte +3 -1
  281. package/src/routes/servers/[server]/databases/[database]/collections/[collection]/documents/[document]/+page.svelte +9 -6
  282. package/src/routes/servers/[server]/databases/[database]/collections/[collection]/indexes/+page.svelte +18 -6
  283. package/src/routes/servers/[server]/databases/[database]/collections/[collection]/mappings/+page.svelte +3 -1
  284. package/build/client/_app/immutable/assets/0.Bg-3Xsxo.css +0 -1
  285. package/build/client/_app/immutable/assets/0.Bg-3Xsxo.css.br +0 -0
  286. package/build/client/_app/immutable/assets/0.Bg-3Xsxo.css.gz +0 -0
  287. package/build/client/_app/immutable/chunks/2G5jukcB.js +0 -1
  288. package/build/client/_app/immutable/chunks/2G5jukcB.js.br +0 -0
  289. package/build/client/_app/immutable/chunks/2G5jukcB.js.gz +0 -0
  290. package/build/client/_app/immutable/chunks/7qKXf-oy.js +0 -1
  291. package/build/client/_app/immutable/chunks/7qKXf-oy.js.br +0 -0
  292. package/build/client/_app/immutable/chunks/7qKXf-oy.js.gz +0 -0
  293. package/build/client/_app/immutable/chunks/B5NTIIm5.js.br +0 -0
  294. package/build/client/_app/immutable/chunks/B5NTIIm5.js.gz +0 -0
  295. package/build/client/_app/immutable/chunks/B8-w38Ky.js +0 -1
  296. package/build/client/_app/immutable/chunks/B8-w38Ky.js.br +0 -0
  297. package/build/client/_app/immutable/chunks/B8-w38Ky.js.gz +0 -0
  298. package/build/client/_app/immutable/chunks/BER7n7JT.js.br +0 -0
  299. package/build/client/_app/immutable/chunks/BER7n7JT.js.gz +0 -0
  300. package/build/client/_app/immutable/chunks/BJ-rqge0.js.br +0 -0
  301. package/build/client/_app/immutable/chunks/BJ-rqge0.js.gz +0 -0
  302. package/build/client/_app/immutable/chunks/BUr91kOw.js +0 -1
  303. package/build/client/_app/immutable/chunks/BUr91kOw.js.br +0 -0
  304. package/build/client/_app/immutable/chunks/BUr91kOw.js.gz +0 -0
  305. package/build/client/_app/immutable/chunks/BYPjaq07.js +0 -1
  306. package/build/client/_app/immutable/chunks/BYPjaq07.js.br +0 -0
  307. package/build/client/_app/immutable/chunks/BYPjaq07.js.gz +0 -0
  308. package/build/client/_app/immutable/chunks/Bl8s7Z6r.js.br +0 -1
  309. package/build/client/_app/immutable/chunks/Bl8s7Z6r.js.gz +0 -0
  310. package/build/client/_app/immutable/chunks/BnpHJF5-.js +0 -2
  311. package/build/client/_app/immutable/chunks/BnpHJF5-.js.br +0 -0
  312. package/build/client/_app/immutable/chunks/BnpHJF5-.js.gz +0 -0
  313. package/build/client/_app/immutable/chunks/C5cMJ08W.js.br +0 -0
  314. package/build/client/_app/immutable/chunks/C5cMJ08W.js.gz +0 -0
  315. package/build/client/_app/immutable/chunks/C93uPVVn.js +0 -1
  316. package/build/client/_app/immutable/chunks/C93uPVVn.js.br +0 -0
  317. package/build/client/_app/immutable/chunks/C93uPVVn.js.gz +0 -0
  318. package/build/client/_app/immutable/chunks/CKS6pEQE.js +0 -16
  319. package/build/client/_app/immutable/chunks/CKS6pEQE.js.br +0 -0
  320. package/build/client/_app/immutable/chunks/CKS6pEQE.js.gz +0 -0
  321. package/build/client/_app/immutable/chunks/CXNtxrhs.js +0 -1
  322. package/build/client/_app/immutable/chunks/CXNtxrhs.js.br +0 -0
  323. package/build/client/_app/immutable/chunks/CXNtxrhs.js.gz +0 -0
  324. package/build/client/_app/immutable/chunks/CxcplU4Q.js.br +0 -0
  325. package/build/client/_app/immutable/chunks/CxcplU4Q.js.gz +0 -0
  326. package/build/client/_app/immutable/chunks/DDy-Kuac.js +0 -1
  327. package/build/client/_app/immutable/chunks/DDy-Kuac.js.br +0 -0
  328. package/build/client/_app/immutable/chunks/DDy-Kuac.js.gz +0 -0
  329. package/build/client/_app/immutable/chunks/DUw-I2kh.js.br +0 -0
  330. package/build/client/_app/immutable/chunks/DUw-I2kh.js.gz +0 -0
  331. package/build/client/_app/immutable/chunks/Da8SMsGA.js +0 -4
  332. package/build/client/_app/immutable/chunks/Da8SMsGA.js.br +0 -0
  333. package/build/client/_app/immutable/chunks/Da8SMsGA.js.gz +0 -0
  334. package/build/client/_app/immutable/chunks/DdLT9cdj.js.br +0 -0
  335. package/build/client/_app/immutable/chunks/DdLT9cdj.js.gz +0 -0
  336. package/build/client/_app/immutable/chunks/Dmf2jfOR.js +0 -41
  337. package/build/client/_app/immutable/chunks/Dmf2jfOR.js.br +0 -0
  338. package/build/client/_app/immutable/chunks/Dmf2jfOR.js.gz +0 -0
  339. package/build/client/_app/immutable/chunks/LkvVkcQJ.js +0 -1
  340. package/build/client/_app/immutable/chunks/LkvVkcQJ.js.br +0 -0
  341. package/build/client/_app/immutable/chunks/LkvVkcQJ.js.gz +0 -0
  342. package/build/client/_app/immutable/chunks/c-rWvg5T.js.br +0 -0
  343. package/build/client/_app/immutable/chunks/c-rWvg5T.js.gz +0 -0
  344. package/build/client/_app/immutable/entry/app.CzAgfWF-.js +0 -2
  345. package/build/client/_app/immutable/entry/app.CzAgfWF-.js.br +0 -0
  346. package/build/client/_app/immutable/entry/app.CzAgfWF-.js.gz +0 -0
  347. package/build/client/_app/immutable/entry/start.BqhvOHS7.js +0 -1
  348. package/build/client/_app/immutable/entry/start.BqhvOHS7.js.br +0 -2
  349. package/build/client/_app/immutable/entry/start.BqhvOHS7.js.gz +0 -0
  350. package/build/client/_app/immutable/nodes/0.CfQvam5O.js +0 -1
  351. package/build/client/_app/immutable/nodes/0.CfQvam5O.js.br +0 -0
  352. package/build/client/_app/immutable/nodes/0.CfQvam5O.js.gz +0 -0
  353. package/build/client/_app/immutable/nodes/1.CT1dqOys.js +0 -1
  354. package/build/client/_app/immutable/nodes/1.CT1dqOys.js.br +0 -0
  355. package/build/client/_app/immutable/nodes/1.CT1dqOys.js.gz +0 -0
  356. package/build/client/_app/immutable/nodes/10.sOAG3GOP.js +0 -6
  357. package/build/client/_app/immutable/nodes/10.sOAG3GOP.js.br +0 -0
  358. package/build/client/_app/immutable/nodes/10.sOAG3GOP.js.gz +0 -0
  359. package/build/client/_app/immutable/nodes/11.CCoUVDmP.js +0 -1
  360. package/build/client/_app/immutable/nodes/11.CCoUVDmP.js.br +0 -0
  361. package/build/client/_app/immutable/nodes/11.CCoUVDmP.js.gz +0 -0
  362. package/build/client/_app/immutable/nodes/12.DXYwBajj.js +0 -1
  363. package/build/client/_app/immutable/nodes/12.DXYwBajj.js.br +0 -0
  364. package/build/client/_app/immutable/nodes/12.DXYwBajj.js.gz +0 -0
  365. package/build/client/_app/immutable/nodes/13.D1BtshxC.js +0 -65
  366. package/build/client/_app/immutable/nodes/13.D1BtshxC.js.br +0 -0
  367. package/build/client/_app/immutable/nodes/13.D1BtshxC.js.gz +0 -0
  368. package/build/client/_app/immutable/nodes/2.AM8fesja.js.br +0 -0
  369. package/build/client/_app/immutable/nodes/2.AM8fesja.js.gz +0 -0
  370. package/build/client/_app/immutable/nodes/3.BShuoOz5.js.br +0 -0
  371. package/build/client/_app/immutable/nodes/3.BShuoOz5.js.gz +0 -0
  372. package/build/client/_app/immutable/nodes/4.BD6QbApY.js.br +0 -0
  373. package/build/client/_app/immutable/nodes/4.BD6QbApY.js.gz +0 -0
  374. package/build/client/_app/immutable/nodes/5.JM_dwz0R.js.br +0 -0
  375. package/build/client/_app/immutable/nodes/5.JM_dwz0R.js.gz +0 -0
  376. package/build/client/_app/immutable/nodes/7.B828lV2z.js +0 -1
  377. package/build/client/_app/immutable/nodes/7.B828lV2z.js.br +0 -0
  378. package/build/client/_app/immutable/nodes/7.B828lV2z.js.gz +0 -0
  379. package/build/client/_app/immutable/nodes/8.jIKg6tO8.js +0 -1
  380. package/build/client/_app/immutable/nodes/8.jIKg6tO8.js.br +0 -0
  381. package/build/client/_app/immutable/nodes/8.jIKg6tO8.js.gz +0 -0
  382. package/build/client/_app/immutable/nodes/9.C0kZQQIe.js +0 -2
  383. package/build/client/_app/immutable/nodes/9.C0kZQQIe.js.br +0 -0
  384. package/build/client/_app/immutable/nodes/9.C0kZQQIe.js.gz +0 -0
  385. package/build/server/chunks/0-Cc_wO2h7.js +0 -22
  386. package/build/server/chunks/0-Cc_wO2h7.js.map +0 -1
  387. package/build/server/chunks/1-DG8uwx4O.js +0 -9
  388. package/build/server/chunks/1-DG8uwx4O.js.map +0 -1
  389. package/build/server/chunks/10-FW86ZAmq.js.map +0 -1
  390. package/build/server/chunks/11-DOvRxt7n.js.map +0 -1
  391. package/build/server/chunks/12-Bf51NZHg.js.map +0 -1
  392. package/build/server/chunks/13-CcZ-9baj.js.map +0 -1
  393. package/build/server/chunks/6-DsYzHmsZ.js.map +0 -1
  394. package/build/server/chunks/7-B04juXwR.js.map +0 -1
  395. package/build/server/chunks/8-CBDbW932.js.map +0 -1
  396. package/build/server/chunks/9-DgCY2nR6.js.map +0 -1
  397. package/build/server/chunks/JsonValue-Dj3vYG5T.js +0 -366
  398. package/build/server/chunks/JsonValue-Dj3vYG5T.js.map +0 -1
  399. package/build/server/chunks/Modal-fWUUqg69.js.map +0 -1
  400. package/build/server/chunks/Panel-BXokpC3w.js.map +0 -1
  401. package/build/server/chunks/PrettyJson-CV4qF02W.js.map +0 -1
  402. package/build/server/chunks/Tooltip-1tZ4BUxU.js.map +0 -1
  403. package/build/server/chunks/TooltipTable-B2QGp4YW.js.map +0 -1
  404. package/build/server/chunks/_layout.svelte-DAGMbkJX.js.map +0 -1
  405. package/build/server/chunks/_page.svelte-BUqI0nM9.js.map +0 -1
  406. package/build/server/chunks/_page.svelte-CB9ZXhBt.js.map +0 -1
  407. package/build/server/chunks/_page.svelte-Ccc0KJ66.js.map +0 -1
  408. package/build/server/chunks/_page.svelte-ClakOyno.js.map +0 -1
  409. package/build/server/chunks/_page.svelte-DfZ2COw_.js.map +0 -1
  410. package/build/server/chunks/_page.svelte-DgQxD9T8.js.map +0 -1
  411. package/build/server/chunks/_page.svelte-wmgrrvR7.js.map +0 -1
  412. package/build/server/chunks/client-BCfAqu0g.js +0 -7
  413. package/build/server/chunks/client2-B-hc4vU8.js.map +0 -1
  414. package/build/server/chunks/context-8UI9xWgq.js +0 -92
  415. package/build/server/chunks/context-8UI9xWgq.js.map +0 -1
  416. package/build/server/chunks/error.svelte-hj6GNaOv.js +0 -19
  417. package/build/server/chunks/error.svelte-hj6GNaOv.js.map +0 -1
  418. package/build/server/chunks/event-DVH-6ISX.js +0 -64
  419. package/build/server/chunks/event-DVH-6ISX.js.map +0 -1
  420. package/build/server/chunks/exports-CtTNDGe5.js +0 -161
  421. package/build/server/chunks/exports-CtTNDGe5.js.map +0 -1
  422. package/build/server/chunks/filters-CbFjTNFI.js.map +0 -1
  423. package/build/server/chunks/hooks.server-DRPXFQlL.js +0 -53
  424. package/build/server/chunks/hooks.server-DRPXFQlL.js.map +0 -1
  425. package/build/server/chunks/index-DOCFW0vv.js +0 -1355
  426. package/build/server/chunks/index-DOCFW0vv.js.map +0 -1
  427. package/build/server/chunks/index2-CJE0QJlP.js.map +0 -1
  428. package/build/server/chunks/index3-CQyDuV4f.js.map +0 -1
  429. package/build/server/chunks/logger-KF6KpVP6.js.map +0 -1
  430. package/build/server/chunks/mongo-CpQtfvt6.js.map +0 -1
  431. package/build/server/chunks/remote-xxtqbu-CbTWQ3bq.js +0 -21
  432. package/build/server/chunks/remote-xxtqbu-CbTWQ3bq.js.map +0 -1
  433. package/build/server/chunks/routing-BdGCua8Q.js.map +0 -1
  434. package/build/server/chunks/server2-CkPmd3Rb.js.map +0 -1
  435. package/build/server/chunks/servers.remote-OwAA4KJJ.js.map +0 -1
  436. package/build/server/chunks/shared-w5gO1Cte.js +0 -446
  437. package/build/server/chunks/shared-w5gO1Cte.js.map +0 -1
  438. package/build/server/chunks/state.svelte-BfzDwKMC.js.map +0 -1
  439. package/build/server/chunks/utils-kjxf7BZO.js.map +0 -1
  440. package/build/server/chunks/utils2-DrnJY_bz.js +0 -91
  441. package/build/server/chunks/utils2-DrnJY_bz.js.map +0 -1
  442. /package/build/client/_app/immutable/assets/{10.Wc4MTSzM.css → 11.Wc4MTSzM.css} +0 -0
  443. /package/build/client/_app/immutable/assets/{10.Wc4MTSzM.css.br → 11.Wc4MTSzM.css.br} +0 -0
  444. /package/build/client/_app/immutable/assets/{10.Wc4MTSzM.css.gz → 11.Wc4MTSzM.css.gz} +0 -0
  445. /package/build/client/_app/immutable/assets/{11.CEtFGlZU.css → 12.CEtFGlZU.css} +0 -0
  446. /package/build/client/_app/immutable/assets/{11.CEtFGlZU.css.br → 12.CEtFGlZU.css.br} +0 -0
  447. /package/build/client/_app/immutable/assets/{11.CEtFGlZU.css.gz → 12.CEtFGlZU.css.gz} +0 -0
  448. /package/build/client/_app/immutable/assets/{12.I1sSDJ6i.css → 13.I1sSDJ6i.css} +0 -0
  449. /package/build/client/_app/immutable/assets/{12.I1sSDJ6i.css.br → 13.I1sSDJ6i.css.br} +0 -0
  450. /package/build/client/_app/immutable/assets/{12.I1sSDJ6i.css.gz → 13.I1sSDJ6i.css.gz} +0 -0
  451. /package/build/client/_app/immutable/assets/{7.CRKE8WvY.css → 8.CRKE8WvY.css} +0 -0
  452. /package/build/client/_app/immutable/assets/{7.CRKE8WvY.css.br → 8.CRKE8WvY.css.br} +0 -0
  453. /package/build/client/_app/immutable/assets/{7.CRKE8WvY.css.gz → 8.CRKE8WvY.css.gz} +0 -0
@@ -1,1355 +0,0 @@
1
- import { s as set_ssr_context, a as ssr_context, p as push, b as pop, n as noop, d as deferred, e as escape_html, i as is_promise } from './context-8UI9xWgq.js';
2
- import { a as async_mode_flag } from './async-lVJA8xJZ.js';
3
- import { i as is_primitive, g as get_type, D as DevalueError, a as is_plain_object, e as enumerable_symbols, s as stringify_key, b as stringify_string, c as escaped } from './utils2-DrnJY_bz.js';
4
-
5
- const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$";
6
- const unsafe_chars = /[<\b\f\n\r\t\0\u2028\u2029]/g;
7
- const reserved = /^(?:do|if|in|for|int|let|new|try|var|byte|case|char|else|enum|goto|long|this|void|with|await|break|catch|class|const|final|float|short|super|throw|while|yield|delete|double|export|import|native|return|switch|throws|typeof|boolean|default|extends|finally|package|private|abstract|continue|debugger|function|volatile|interface|protected|transient|implements|instanceof|synchronized)$/;
8
- function uneval(value, replacer) {
9
- const counts = /* @__PURE__ */ new Map();
10
- const keys = [];
11
- const custom = /* @__PURE__ */ new Map();
12
- function walk(thing) {
13
- if (!is_primitive(thing)) {
14
- if (counts.has(thing)) {
15
- counts.set(thing, counts.get(thing) + 1);
16
- return;
17
- }
18
- counts.set(thing, 1);
19
- if (replacer) {
20
- const str2 = replacer(thing, (value2) => uneval(value2, replacer));
21
- if (typeof str2 === "string") {
22
- custom.set(thing, str2);
23
- return;
24
- }
25
- }
26
- if (typeof thing === "function") {
27
- throw new DevalueError(`Cannot stringify a function`, keys, thing, value);
28
- }
29
- const type = get_type(thing);
30
- switch (type) {
31
- case "Number":
32
- case "BigInt":
33
- case "String":
34
- case "Boolean":
35
- case "Date":
36
- case "RegExp":
37
- case "URL":
38
- case "URLSearchParams":
39
- return;
40
- case "Array":
41
- thing.forEach((value2, i) => {
42
- keys.push(`[${i}]`);
43
- walk(value2);
44
- keys.pop();
45
- });
46
- break;
47
- case "Set":
48
- Array.from(thing).forEach(walk);
49
- break;
50
- case "Map":
51
- for (const [key, value2] of thing) {
52
- keys.push(
53
- `.get(${is_primitive(key) ? stringify_primitive(key) : "..."})`
54
- );
55
- walk(value2);
56
- keys.pop();
57
- }
58
- break;
59
- case "Int8Array":
60
- case "Uint8Array":
61
- case "Uint8ClampedArray":
62
- case "Int16Array":
63
- case "Uint16Array":
64
- case "Int32Array":
65
- case "Uint32Array":
66
- case "Float32Array":
67
- case "Float64Array":
68
- case "BigInt64Array":
69
- case "BigUint64Array":
70
- walk(thing.buffer);
71
- return;
72
- case "ArrayBuffer":
73
- return;
74
- case "Temporal.Duration":
75
- case "Temporal.Instant":
76
- case "Temporal.PlainDate":
77
- case "Temporal.PlainTime":
78
- case "Temporal.PlainDateTime":
79
- case "Temporal.PlainMonthDay":
80
- case "Temporal.PlainYearMonth":
81
- case "Temporal.ZonedDateTime":
82
- return;
83
- default:
84
- if (!is_plain_object(thing)) {
85
- throw new DevalueError(
86
- `Cannot stringify arbitrary non-POJOs`,
87
- keys,
88
- thing,
89
- value
90
- );
91
- }
92
- if (enumerable_symbols(thing).length > 0) {
93
- throw new DevalueError(
94
- `Cannot stringify POJOs with symbolic keys`,
95
- keys,
96
- thing,
97
- value
98
- );
99
- }
100
- for (const key in thing) {
101
- keys.push(stringify_key(key));
102
- walk(thing[key]);
103
- keys.pop();
104
- }
105
- }
106
- }
107
- }
108
- walk(value);
109
- const names = /* @__PURE__ */ new Map();
110
- Array.from(counts).filter((entry) => entry[1] > 1).sort((a, b) => b[1] - a[1]).forEach((entry, i) => {
111
- names.set(entry[0], get_name(i));
112
- });
113
- function stringify2(thing) {
114
- if (names.has(thing)) {
115
- return names.get(thing);
116
- }
117
- if (is_primitive(thing)) {
118
- return stringify_primitive(thing);
119
- }
120
- if (custom.has(thing)) {
121
- return custom.get(thing);
122
- }
123
- const type = get_type(thing);
124
- switch (type) {
125
- case "Number":
126
- case "String":
127
- case "Boolean":
128
- return `Object(${stringify2(thing.valueOf())})`;
129
- case "RegExp":
130
- return `new RegExp(${stringify_string(thing.source)}, "${thing.flags}")`;
131
- case "Date":
132
- return `new Date(${thing.getTime()})`;
133
- case "URL":
134
- return `new URL(${stringify_string(thing.toString())})`;
135
- case "URLSearchParams":
136
- return `new URLSearchParams(${stringify_string(thing.toString())})`;
137
- case "Array":
138
- const members = (
139
- /** @type {any[]} */
140
- thing.map(
141
- (v, i) => i in thing ? stringify2(v) : ""
142
- )
143
- );
144
- const tail = thing.length === 0 || thing.length - 1 in thing ? "" : ",";
145
- return `[${members.join(",")}${tail}]`;
146
- case "Set":
147
- case "Map":
148
- return `new ${type}([${Array.from(thing).map(stringify2).join(",")}])`;
149
- case "Int8Array":
150
- case "Uint8Array":
151
- case "Uint8ClampedArray":
152
- case "Int16Array":
153
- case "Uint16Array":
154
- case "Int32Array":
155
- case "Uint32Array":
156
- case "Float32Array":
157
- case "Float64Array":
158
- case "BigInt64Array":
159
- case "BigUint64Array": {
160
- let str2 = `new ${type}`;
161
- if (counts.get(thing.buffer) === 1) {
162
- const array = new thing.constructor(thing.buffer);
163
- str2 += `([${array}])`;
164
- } else {
165
- str2 += `([${stringify2(thing.buffer)}])`;
166
- }
167
- const a = thing.byteOffset;
168
- const b = a + thing.byteLength;
169
- if (a > 0 || b !== thing.buffer.byteLength) {
170
- const m = +/(\d+)/.exec(type)[1] / 8;
171
- str2 += `.subarray(${a / m},${b / m})`;
172
- }
173
- return str2;
174
- }
175
- case "ArrayBuffer": {
176
- const ui8 = new Uint8Array(thing);
177
- return `new Uint8Array([${ui8.toString()}]).buffer`;
178
- }
179
- case "Temporal.Duration":
180
- case "Temporal.Instant":
181
- case "Temporal.PlainDate":
182
- case "Temporal.PlainTime":
183
- case "Temporal.PlainDateTime":
184
- case "Temporal.PlainMonthDay":
185
- case "Temporal.PlainYearMonth":
186
- case "Temporal.ZonedDateTime":
187
- return `${type}.from(${stringify_string(thing.toString())})`;
188
- default:
189
- const keys2 = Object.keys(thing);
190
- const obj = keys2.map((key) => `${safe_key(key)}:${stringify2(thing[key])}`).join(",");
191
- const proto = Object.getPrototypeOf(thing);
192
- if (proto === null) {
193
- return keys2.length > 0 ? `{${obj},__proto__:null}` : `{__proto__:null}`;
194
- }
195
- return `{${obj}}`;
196
- }
197
- }
198
- const str = stringify2(value);
199
- if (names.size) {
200
- const params = [];
201
- const statements = [];
202
- const values = [];
203
- names.forEach((name, thing) => {
204
- params.push(name);
205
- if (custom.has(thing)) {
206
- values.push(
207
- /** @type {string} */
208
- custom.get(thing)
209
- );
210
- return;
211
- }
212
- if (is_primitive(thing)) {
213
- values.push(stringify_primitive(thing));
214
- return;
215
- }
216
- const type = get_type(thing);
217
- switch (type) {
218
- case "Number":
219
- case "String":
220
- case "Boolean":
221
- values.push(`Object(${stringify2(thing.valueOf())})`);
222
- break;
223
- case "RegExp":
224
- values.push(thing.toString());
225
- break;
226
- case "Date":
227
- values.push(`new Date(${thing.getTime()})`);
228
- break;
229
- case "Array":
230
- values.push(`Array(${thing.length})`);
231
- thing.forEach((v, i) => {
232
- statements.push(`${name}[${i}]=${stringify2(v)}`);
233
- });
234
- break;
235
- case "Set":
236
- values.push(`new Set`);
237
- statements.push(
238
- `${name}.${Array.from(thing).map((v) => `add(${stringify2(v)})`).join(".")}`
239
- );
240
- break;
241
- case "Map":
242
- values.push(`new Map`);
243
- statements.push(
244
- `${name}.${Array.from(thing).map(([k, v]) => `set(${stringify2(k)}, ${stringify2(v)})`).join(".")}`
245
- );
246
- break;
247
- case "ArrayBuffer":
248
- values.push(
249
- `new Uint8Array([${new Uint8Array(thing).join(",")}]).buffer`
250
- );
251
- break;
252
- default:
253
- values.push(
254
- Object.getPrototypeOf(thing) === null ? "Object.create(null)" : "{}"
255
- );
256
- Object.keys(thing).forEach((key) => {
257
- statements.push(
258
- `${name}${safe_prop(key)}=${stringify2(thing[key])}`
259
- );
260
- });
261
- }
262
- });
263
- statements.push(`return ${str}`);
264
- return `(function(${params.join(",")}){${statements.join(
265
- ";"
266
- )}}(${values.join(",")}))`;
267
- } else {
268
- return str;
269
- }
270
- }
271
- function get_name(num) {
272
- let name = "";
273
- do {
274
- name = chars[num % chars.length] + name;
275
- num = ~~(num / chars.length) - 1;
276
- } while (num >= 0);
277
- return reserved.test(name) ? `${name}0` : name;
278
- }
279
- function escape_unsafe_char(c) {
280
- return escaped[c] || c;
281
- }
282
- function escape_unsafe_chars(str) {
283
- return str.replace(unsafe_chars, escape_unsafe_char);
284
- }
285
- function safe_key(key) {
286
- return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key) ? key : escape_unsafe_chars(JSON.stringify(key));
287
- }
288
- function safe_prop(key) {
289
- return /^[_$a-zA-Z][_$a-zA-Z0-9]*$/.test(key) ? `.${key}` : `[${escape_unsafe_chars(JSON.stringify(key))}]`;
290
- }
291
- function stringify_primitive(thing) {
292
- if (typeof thing === "string") return stringify_string(thing);
293
- if (thing === void 0) return "void 0";
294
- if (thing === 0 && 1 / thing < 0) return "-0";
295
- const str = String(thing);
296
- if (typeof thing === "number") return str.replace(/^(-)?0\./, "$1.");
297
- if (typeof thing === "bigint") return thing + "n";
298
- return str;
299
- }
300
- const DERIVED = 1 << 1;
301
- const EFFECT = 1 << 2;
302
- const RENDER_EFFECT = 1 << 3;
303
- const MANAGED_EFFECT = 1 << 24;
304
- const BLOCK_EFFECT = 1 << 4;
305
- const BRANCH_EFFECT = 1 << 5;
306
- const ROOT_EFFECT = 1 << 6;
307
- const BOUNDARY_EFFECT = 1 << 7;
308
- const CONNECTED = 1 << 9;
309
- const CLEAN = 1 << 10;
310
- const DIRTY = 1 << 11;
311
- const MAYBE_DIRTY = 1 << 12;
312
- const INERT = 1 << 13;
313
- const DESTROYED = 1 << 14;
314
- const EFFECT_RAN = 1 << 15;
315
- const EFFECT_TRANSPARENT = 1 << 16;
316
- const EAGER_EFFECT = 1 << 17;
317
- const HEAD_EFFECT = 1 << 18;
318
- const EFFECT_PRESERVED = 1 << 19;
319
- const USER_EFFECT = 1 << 20;
320
- const WAS_MARKED = 1 << 15;
321
- const REACTION_IS_UPDATING = 1 << 21;
322
- const ASYNC = 1 << 22;
323
- const ERROR_VALUE = 1 << 23;
324
- const STATE_SYMBOL = /* @__PURE__ */ Symbol("$state");
325
- const LEGACY_PROPS = /* @__PURE__ */ Symbol("legacy props");
326
- const STALE_REACTION = new class StaleReactionError extends Error {
327
- name = "StaleReactionError";
328
- message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
329
- }();
330
- const COMMENT_NODE = 8;
331
- const HYDRATION_START = "[";
332
- const HYDRATION_START_ELSE = "[!";
333
- const HYDRATION_END = "]";
334
- const HYDRATION_ERROR = {};
335
- const ELEMENT_IS_NAMESPACED = 1;
336
- const ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1;
337
- const ELEMENT_IS_INPUT = 1 << 2;
338
- const UNINITIALIZED = /* @__PURE__ */ Symbol();
339
- const DOM_BOOLEAN_ATTRIBUTES = [
340
- "allowfullscreen",
341
- "async",
342
- "autofocus",
343
- "autoplay",
344
- "checked",
345
- "controls",
346
- "default",
347
- "disabled",
348
- "formnovalidate",
349
- "indeterminate",
350
- "inert",
351
- "ismap",
352
- "loop",
353
- "multiple",
354
- "muted",
355
- "nomodule",
356
- "novalidate",
357
- "open",
358
- "playsinline",
359
- "readonly",
360
- "required",
361
- "reversed",
362
- "seamless",
363
- "selected",
364
- "webkitdirectory",
365
- "defer",
366
- "disablepictureinpicture",
367
- "disableremoteplayback"
368
- ];
369
- function is_boolean_attribute(name) {
370
- return DOM_BOOLEAN_ATTRIBUTES.includes(name);
371
- }
372
- const PASSIVE_EVENTS = ["touchstart", "touchmove"];
373
- function is_passive_event(name) {
374
- return PASSIVE_EVENTS.includes(name);
375
- }
376
- function r(e) {
377
- var t, f, n = "";
378
- if ("string" == typeof e || "number" == typeof e) n += e;
379
- else if ("object" == typeof e) if (Array.isArray(e)) {
380
- var o = e.length;
381
- for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
382
- } else for (f in e) e[f] && (n && (n += " "), n += f);
383
- return n;
384
- }
385
- function clsx$1() {
386
- for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
387
- return n;
388
- }
389
- const replacements = {
390
- translate: /* @__PURE__ */ new Map([
391
- [true, "yes"],
392
- [false, "no"]
393
- ])
394
- };
395
- function attr(name, value, is_boolean = false) {
396
- if (name === "hidden" && value !== "until-found") {
397
- is_boolean = true;
398
- }
399
- if (value == null || !value && is_boolean) return "";
400
- const normalized = name in replacements && replacements[name].get(value) || value;
401
- const assignment = is_boolean ? "" : `="${escape_html(normalized, true)}"`;
402
- return ` ${name}${assignment}`;
403
- }
404
- function clsx(value) {
405
- if (typeof value === "object") {
406
- return clsx$1(value);
407
- } else {
408
- return value ?? "";
409
- }
410
- }
411
- const whitespace = [..." \n\r\f \v\uFEFF"];
412
- function to_class(value, hash, directives) {
413
- var classname = value == null ? "" : "" + value;
414
- if (hash) {
415
- classname = classname ? classname + " " + hash : hash;
416
- }
417
- if (directives) {
418
- for (var key in directives) {
419
- if (directives[key]) {
420
- classname = classname ? classname + " " + key : key;
421
- } else if (classname.length) {
422
- var len = key.length;
423
- var a = 0;
424
- while ((a = classname.indexOf(key, a)) >= 0) {
425
- var b = a + len;
426
- if ((a === 0 || whitespace.includes(classname[a - 1])) && (b === classname.length || whitespace.includes(classname[b]))) {
427
- classname = (a === 0 ? "" : classname.substring(0, a)) + classname.substring(b + 1);
428
- } else {
429
- a = b;
430
- }
431
- }
432
- }
433
- }
434
- }
435
- return classname === "" ? null : classname;
436
- }
437
- function append_styles(styles, important = false) {
438
- var separator = important ? " !important;" : ";";
439
- var css = "";
440
- for (var key in styles) {
441
- var value = styles[key];
442
- if (value != null && value !== "") {
443
- css += " " + key + ": " + value + separator;
444
- }
445
- }
446
- return css;
447
- }
448
- function to_css_name(name) {
449
- if (name[0] !== "-" || name[1] !== "-") {
450
- return name.toLowerCase();
451
- }
452
- return name;
453
- }
454
- function to_style(value, styles) {
455
- if (styles) {
456
- var new_style = "";
457
- var normal_styles;
458
- var important_styles;
459
- if (Array.isArray(styles)) {
460
- normal_styles = styles[0];
461
- important_styles = styles[1];
462
- } else {
463
- normal_styles = styles;
464
- }
465
- if (value) {
466
- value = String(value).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
467
- var in_str = false;
468
- var in_apo = 0;
469
- var in_comment = false;
470
- var reserved_names = [];
471
- if (normal_styles) {
472
- reserved_names.push(...Object.keys(normal_styles).map(to_css_name));
473
- }
474
- if (important_styles) {
475
- reserved_names.push(...Object.keys(important_styles).map(to_css_name));
476
- }
477
- var start_index = 0;
478
- var name_index = -1;
479
- const len = value.length;
480
- for (var i = 0; i < len; i++) {
481
- var c = value[i];
482
- if (in_comment) {
483
- if (c === "/" && value[i - 1] === "*") {
484
- in_comment = false;
485
- }
486
- } else if (in_str) {
487
- if (in_str === c) {
488
- in_str = false;
489
- }
490
- } else if (c === "/" && value[i + 1] === "*") {
491
- in_comment = true;
492
- } else if (c === '"' || c === "'") {
493
- in_str = c;
494
- } else if (c === "(") {
495
- in_apo++;
496
- } else if (c === ")") {
497
- in_apo--;
498
- }
499
- if (!in_comment && in_str === false && in_apo === 0) {
500
- if (c === ":" && name_index === -1) {
501
- name_index = i;
502
- } else if (c === ";" || i === len - 1) {
503
- if (name_index !== -1) {
504
- var name = to_css_name(value.substring(start_index, name_index).trim());
505
- if (!reserved_names.includes(name)) {
506
- if (c !== ";") {
507
- i++;
508
- }
509
- var property = value.substring(start_index, i).trim();
510
- new_style += " " + property + ";";
511
- }
512
- }
513
- start_index = i + 1;
514
- name_index = -1;
515
- }
516
- }
517
- }
518
- }
519
- if (normal_styles) {
520
- new_style += append_styles(normal_styles);
521
- }
522
- if (important_styles) {
523
- new_style += append_styles(important_styles, true);
524
- }
525
- new_style = new_style.trim();
526
- return new_style === "" ? null : new_style;
527
- }
528
- return value == null ? null : String(value);
529
- }
530
- const BLOCK_OPEN = `<!--${HYDRATION_START}-->`;
531
- const BLOCK_OPEN_ELSE = `<!--${HYDRATION_START_ELSE}-->`;
532
- const BLOCK_CLOSE = `<!--${HYDRATION_END}-->`;
533
- const EMPTY_COMMENT = `<!---->`;
534
- let controller = null;
535
- function abort() {
536
- controller?.abort(STALE_REACTION);
537
- controller = null;
538
- }
539
- function async_local_storage_unavailable() {
540
- const error = new Error(`async_local_storage_unavailable
541
- The node API \`AsyncLocalStorage\` is not available, but is required to use async server rendering.
542
- https://svelte.dev/e/async_local_storage_unavailable`);
543
- error.name = "Svelte error";
544
- throw error;
545
- }
546
- function await_invalid() {
547
- const error = new Error(`await_invalid
548
- Encountered asynchronous work while rendering synchronously.
549
- https://svelte.dev/e/await_invalid`);
550
- error.name = "Svelte error";
551
- throw error;
552
- }
553
- function html_deprecated() {
554
- const error = new Error(`html_deprecated
555
- The \`html\` property of server render results has been deprecated. Use \`body\` instead.
556
- https://svelte.dev/e/html_deprecated`);
557
- error.name = "Svelte error";
558
- throw error;
559
- }
560
- function invalid_csp() {
561
- const error = new Error(`invalid_csp
562
- \`csp.nonce\` was set while \`csp.hash\` was \`true\`. These options cannot be used simultaneously.
563
- https://svelte.dev/e/invalid_csp`);
564
- error.name = "Svelte error";
565
- throw error;
566
- }
567
- function server_context_required() {
568
- const error = new Error(`server_context_required
569
- Could not resolve \`render\` context.
570
- https://svelte.dev/e/server_context_required`);
571
- error.name = "Svelte error";
572
- throw error;
573
- }
574
- function unresolved_hydratable(key, stack) {
575
- {
576
- console.warn(`https://svelte.dev/e/unresolved_hydratable`);
577
- }
578
- }
579
- let current_render = null;
580
- let context = null;
581
- function get_render_context() {
582
- const store = context ?? als?.getStore();
583
- if (!store) {
584
- server_context_required();
585
- }
586
- return store;
587
- }
588
- async function with_render_context(fn) {
589
- context = {
590
- hydratable: {
591
- lookup: /* @__PURE__ */ new Map(),
592
- comparisons: [],
593
- unresolved_promises: /* @__PURE__ */ new Map()
594
- }
595
- };
596
- if (in_webcontainer()) {
597
- const { promise, resolve } = deferred();
598
- const previous_render = current_render;
599
- current_render = promise;
600
- await previous_render;
601
- return fn().finally(resolve);
602
- }
603
- try {
604
- if (als === null) {
605
- async_local_storage_unavailable();
606
- }
607
- return als.run(context, fn);
608
- } finally {
609
- context = null;
610
- }
611
- }
612
- let als = null;
613
- let als_import = null;
614
- function init_render_context() {
615
- als_import ??= import('node:async_hooks').then((hooks) => {
616
- als = new hooks.AsyncLocalStorage();
617
- }).then(noop, noop);
618
- return als_import;
619
- }
620
- function in_webcontainer() {
621
- return !!globalThis.process?.versions?.webcontainer;
622
- }
623
- let text_encoder;
624
- let crypto;
625
- async function sha256(data) {
626
- text_encoder ??= new TextEncoder();
627
- crypto ??= globalThis.crypto?.subtle?.digest ? globalThis.crypto : (
628
- // @ts-ignore - we don't install node types in the prod build
629
- (await import('node:crypto')).webcrypto
630
- );
631
- const hash_buffer = await crypto.subtle.digest("SHA-256", text_encoder.encode(data));
632
- return base64_encode(hash_buffer);
633
- }
634
- function base64_encode(bytes) {
635
- if (globalThis.Buffer) {
636
- return globalThis.Buffer.from(bytes).toString("base64");
637
- }
638
- let binary = "";
639
- for (let i = 0; i < bytes.length; i++) {
640
- binary += String.fromCharCode(bytes[i]);
641
- }
642
- return btoa(binary);
643
- }
644
- class Renderer {
645
- /**
646
- * The contents of the renderer.
647
- * @type {RendererItem[]}
648
- */
649
- #out = [];
650
- /**
651
- * Any `onDestroy` callbacks registered during execution of this renderer.
652
- * @type {(() => void)[] | undefined}
653
- */
654
- #on_destroy = void 0;
655
- /**
656
- * Whether this renderer is a component body.
657
- * @type {boolean}
658
- */
659
- #is_component_body = false;
660
- /**
661
- * The type of string content that this renderer is accumulating.
662
- * @type {RendererType}
663
- */
664
- type;
665
- /** @type {Renderer | undefined} */
666
- #parent;
667
- /**
668
- * Asynchronous work associated with this renderer
669
- * @type {Promise<void> | undefined}
670
- */
671
- promise = void 0;
672
- /**
673
- * State which is associated with the content tree as a whole.
674
- * It will be re-exposed, uncopied, on all children.
675
- * @type {SSRState}
676
- * @readonly
677
- */
678
- global;
679
- /**
680
- * State that is local to the branch it is declared in.
681
- * It will be shallow-copied to all children.
682
- *
683
- * @type {{ select_value: string | undefined }}
684
- */
685
- local;
686
- /**
687
- * @param {SSRState} global
688
- * @param {Renderer | undefined} [parent]
689
- */
690
- constructor(global, parent) {
691
- this.#parent = parent;
692
- this.global = global;
693
- this.local = parent ? { ...parent.local } : { select_value: void 0 };
694
- this.type = parent ? parent.type : "body";
695
- }
696
- /**
697
- * @param {(renderer: Renderer) => void} fn
698
- */
699
- head(fn) {
700
- const head2 = new Renderer(this.global, this);
701
- head2.type = "head";
702
- this.#out.push(head2);
703
- head2.child(fn);
704
- }
705
- /**
706
- * @param {Array<Promise<void>>} blockers
707
- * @param {(renderer: Renderer) => void} fn
708
- */
709
- async_block(blockers, fn) {
710
- this.#out.push(BLOCK_OPEN);
711
- this.async(blockers, fn);
712
- this.#out.push(BLOCK_CLOSE);
713
- }
714
- /**
715
- * @param {Array<Promise<void>>} blockers
716
- * @param {(renderer: Renderer) => void} fn
717
- */
718
- async(blockers, fn) {
719
- let callback = fn;
720
- if (blockers.length > 0) {
721
- const context2 = ssr_context;
722
- callback = (renderer) => {
723
- return Promise.all(blockers).then(() => {
724
- const previous_context = ssr_context;
725
- try {
726
- set_ssr_context(context2);
727
- return fn(renderer);
728
- } finally {
729
- set_ssr_context(previous_context);
730
- }
731
- });
732
- };
733
- }
734
- this.child(callback);
735
- }
736
- /**
737
- * @param {Array<() => void>} thunks
738
- */
739
- run(thunks) {
740
- const context2 = ssr_context;
741
- let promise = Promise.resolve(thunks[0]());
742
- const promises = [promise];
743
- for (const fn of thunks.slice(1)) {
744
- promise = promise.then(() => {
745
- const previous_context = ssr_context;
746
- set_ssr_context(context2);
747
- try {
748
- return fn();
749
- } finally {
750
- set_ssr_context(previous_context);
751
- }
752
- });
753
- promises.push(promise);
754
- }
755
- return promises;
756
- }
757
- /**
758
- * Create a child renderer. The child renderer inherits the state from the parent,
759
- * but has its own content.
760
- * @param {(renderer: Renderer) => MaybePromise<void>} fn
761
- */
762
- child(fn) {
763
- const child = new Renderer(this.global, this);
764
- this.#out.push(child);
765
- const parent = ssr_context;
766
- set_ssr_context({
767
- ...ssr_context,
768
- p: parent,
769
- c: null,
770
- r: child
771
- });
772
- const result = fn(child);
773
- set_ssr_context(parent);
774
- if (result instanceof Promise) {
775
- if (child.global.mode === "sync") {
776
- await_invalid();
777
- }
778
- result.catch(() => {
779
- });
780
- child.promise = result;
781
- }
782
- return child;
783
- }
784
- /**
785
- * Create a component renderer. The component renderer inherits the state from the parent,
786
- * but has its own content. It is treated as an ordering boundary for ondestroy callbacks.
787
- * @param {(renderer: Renderer) => MaybePromise<void>} fn
788
- * @param {Function} [component_fn]
789
- * @returns {void}
790
- */
791
- component(fn, component_fn) {
792
- push();
793
- const child = this.child(fn);
794
- child.#is_component_body = true;
795
- pop();
796
- }
797
- /**
798
- * @param {Record<string, any>} attrs
799
- * @param {(renderer: Renderer) => void} fn
800
- * @param {string | undefined} [css_hash]
801
- * @param {Record<string, boolean> | undefined} [classes]
802
- * @param {Record<string, string> | undefined} [styles]
803
- * @param {number | undefined} [flags]
804
- * @returns {void}
805
- */
806
- select(attrs, fn, css_hash, classes, styles, flags) {
807
- const { value, ...select_attrs } = attrs;
808
- this.push(`<select${attributes(select_attrs, css_hash, classes, styles, flags)}>`);
809
- this.child((renderer) => {
810
- renderer.local.select_value = value;
811
- fn(renderer);
812
- });
813
- this.push("</select>");
814
- }
815
- /**
816
- * @param {Record<string, any>} attrs
817
- * @param {string | number | boolean | ((renderer: Renderer) => void)} body
818
- * @param {string | undefined} [css_hash]
819
- * @param {Record<string, boolean> | undefined} [classes]
820
- * @param {Record<string, string> | undefined} [styles]
821
- * @param {number | undefined} [flags]
822
- */
823
- option(attrs, body, css_hash, classes, styles, flags) {
824
- this.#out.push(`<option${attributes(attrs, css_hash, classes, styles, flags)}`);
825
- const close = (renderer, value, { head: head2, body: body2 }) => {
826
- if ("value" in attrs) {
827
- value = attrs.value;
828
- }
829
- if (value === this.local.select_value) {
830
- renderer.#out.push(" selected");
831
- }
832
- renderer.#out.push(`>${body2}</option>`);
833
- if (head2) {
834
- renderer.head((child) => child.push(head2));
835
- }
836
- };
837
- if (typeof body === "function") {
838
- this.child((renderer) => {
839
- const r2 = new Renderer(this.global, this);
840
- body(r2);
841
- if (this.global.mode === "async") {
842
- return r2.#collect_content_async().then((content) => {
843
- close(renderer, content.body.replaceAll("<!---->", ""), content);
844
- });
845
- } else {
846
- const content = r2.#collect_content();
847
- close(renderer, content.body.replaceAll("<!---->", ""), content);
848
- }
849
- });
850
- } else {
851
- close(this, body, { body });
852
- }
853
- }
854
- /**
855
- * @param {(renderer: Renderer) => void} fn
856
- */
857
- title(fn) {
858
- const path = this.get_path();
859
- const close = (head2) => {
860
- this.global.set_title(head2, path);
861
- };
862
- this.child((renderer) => {
863
- const r2 = new Renderer(renderer.global, renderer);
864
- fn(r2);
865
- if (renderer.global.mode === "async") {
866
- return r2.#collect_content_async().then((content) => {
867
- close(content.head);
868
- });
869
- } else {
870
- const content = r2.#collect_content();
871
- close(content.head);
872
- }
873
- });
874
- }
875
- /**
876
- * @param {string | (() => Promise<string>)} content
877
- */
878
- push(content) {
879
- if (typeof content === "function") {
880
- this.child(async (renderer) => renderer.push(await content()));
881
- } else {
882
- this.#out.push(content);
883
- }
884
- }
885
- /**
886
- * @param {() => void} fn
887
- */
888
- on_destroy(fn) {
889
- (this.#on_destroy ??= []).push(fn);
890
- }
891
- /**
892
- * @returns {number[]}
893
- */
894
- get_path() {
895
- return this.#parent ? [...this.#parent.get_path(), this.#parent.#out.indexOf(this)] : [];
896
- }
897
- /**
898
- * @deprecated this is needed for legacy component bindings
899
- */
900
- copy() {
901
- const copy = new Renderer(this.global, this.#parent);
902
- copy.#out = this.#out.map((item) => item instanceof Renderer ? item.copy() : item);
903
- copy.promise = this.promise;
904
- return copy;
905
- }
906
- /**
907
- * @param {Renderer} other
908
- * @deprecated this is needed for legacy component bindings
909
- */
910
- subsume(other) {
911
- if (this.global.mode !== other.global.mode) {
912
- throw new Error(
913
- "invariant: A renderer cannot switch modes. If you're seeing this, there's a compiler bug. File an issue!"
914
- );
915
- }
916
- this.local = other.local;
917
- this.#out = other.#out.map((item) => {
918
- if (item instanceof Renderer) {
919
- item.subsume(item);
920
- }
921
- return item;
922
- });
923
- this.promise = other.promise;
924
- this.type = other.type;
925
- }
926
- get length() {
927
- return this.#out.length;
928
- }
929
- /**
930
- * Only available on the server and when compiling with the `server` option.
931
- * Takes a component and returns an object with `body` and `head` properties on it, which you can use to populate the HTML when server-rendering your app.
932
- * @template {Record<string, any>} Props
933
- * @param {Component<Props>} component
934
- * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp }} [options]
935
- * @returns {RenderOutput}
936
- */
937
- static render(component, options = {}) {
938
- let sync;
939
- let async;
940
- const result = (
941
- /** @type {RenderOutput} */
942
- {}
943
- );
944
- Object.defineProperties(result, {
945
- html: {
946
- get: () => {
947
- return (sync ??= Renderer.#render(component, options)).body;
948
- }
949
- },
950
- head: {
951
- get: () => {
952
- return (sync ??= Renderer.#render(component, options)).head;
953
- }
954
- },
955
- body: {
956
- get: () => {
957
- return (sync ??= Renderer.#render(component, options)).body;
958
- }
959
- },
960
- hashes: {
961
- value: {
962
- script: ""
963
- }
964
- },
965
- then: {
966
- value: (
967
- /**
968
- * this is not type-safe, but honestly it's the best I can do right now, and it's a straightforward function.
969
- *
970
- * @template TResult1
971
- * @template [TResult2=never]
972
- * @param { (value: SyncRenderOutput) => TResult1 } onfulfilled
973
- * @param { (reason: unknown) => TResult2 } onrejected
974
- */
975
- (onfulfilled, onrejected) => {
976
- if (!async_mode_flag) {
977
- const result2 = sync ??= Renderer.#render(component, options);
978
- const user_result = onfulfilled({
979
- head: result2.head,
980
- body: result2.body,
981
- html: result2.body,
982
- hashes: { script: [] }
983
- });
984
- return Promise.resolve(user_result);
985
- }
986
- async ??= init_render_context().then(
987
- () => with_render_context(() => Renderer.#render_async(component, options))
988
- );
989
- return async.then((result2) => {
990
- Object.defineProperty(result2, "html", {
991
- // eslint-disable-next-line getter-return
992
- get: () => {
993
- html_deprecated();
994
- }
995
- });
996
- return onfulfilled(
997
- /** @type {SyncRenderOutput} */
998
- result2
999
- );
1000
- }, onrejected);
1001
- }
1002
- )
1003
- }
1004
- });
1005
- return result;
1006
- }
1007
- /**
1008
- * Collect all of the `onDestroy` callbacks registered during rendering. In an async context, this is only safe to call
1009
- * after awaiting `collect_async`.
1010
- *
1011
- * Child renderers are "porous" and don't affect execution order, but component body renderers
1012
- * create ordering boundaries. Within a renderer, callbacks run in order until hitting a component boundary.
1013
- * @returns {Iterable<() => void>}
1014
- */
1015
- *#collect_on_destroy() {
1016
- for (const component of this.#traverse_components()) {
1017
- yield* component.#collect_ondestroy();
1018
- }
1019
- }
1020
- /**
1021
- * Performs a depth-first search of renderers, yielding the deepest components first, then additional components as we backtrack up the tree.
1022
- * @returns {Iterable<Renderer>}
1023
- */
1024
- *#traverse_components() {
1025
- for (const child of this.#out) {
1026
- if (typeof child !== "string") {
1027
- yield* child.#traverse_components();
1028
- }
1029
- }
1030
- if (this.#is_component_body) {
1031
- yield this;
1032
- }
1033
- }
1034
- /**
1035
- * @returns {Iterable<() => void>}
1036
- */
1037
- *#collect_ondestroy() {
1038
- if (this.#on_destroy) {
1039
- for (const fn of this.#on_destroy) {
1040
- yield fn;
1041
- }
1042
- }
1043
- for (const child of this.#out) {
1044
- if (child instanceof Renderer && !child.#is_component_body) {
1045
- yield* child.#collect_ondestroy();
1046
- }
1047
- }
1048
- }
1049
- /**
1050
- * Render a component. Throws if any of the children are performing asynchronous work.
1051
- *
1052
- * @template {Record<string, any>} Props
1053
- * @param {Component<Props>} component
1054
- * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string }} options
1055
- * @returns {AccumulatedContent}
1056
- */
1057
- static #render(component, options) {
1058
- var previous_context = ssr_context;
1059
- try {
1060
- const renderer = Renderer.#open_render("sync", component, options);
1061
- const content = renderer.#collect_content();
1062
- return Renderer.#close_render(content, renderer);
1063
- } finally {
1064
- abort();
1065
- set_ssr_context(previous_context);
1066
- }
1067
- }
1068
- /**
1069
- * Render a component.
1070
- *
1071
- * @template {Record<string, any>} Props
1072
- * @param {Component<Props>} component
1073
- * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp }} options
1074
- * @returns {Promise<AccumulatedContent & { hashes: { script: Sha256Source[] } }>}
1075
- */
1076
- static async #render_async(component, options) {
1077
- const previous_context = ssr_context;
1078
- try {
1079
- const renderer = Renderer.#open_render("async", component, options);
1080
- const content = await renderer.#collect_content_async();
1081
- const hydratables = await renderer.#collect_hydratables();
1082
- if (hydratables !== null) {
1083
- content.head = hydratables + content.head;
1084
- }
1085
- return Renderer.#close_render(content, renderer);
1086
- } finally {
1087
- set_ssr_context(previous_context);
1088
- abort();
1089
- }
1090
- }
1091
- /**
1092
- * Collect all of the code from the `out` array and return it as a string, or a promise resolving to a string.
1093
- * @param {AccumulatedContent} content
1094
- * @returns {AccumulatedContent}
1095
- */
1096
- #collect_content(content = { head: "", body: "" }) {
1097
- for (const item of this.#out) {
1098
- if (typeof item === "string") {
1099
- content[this.type] += item;
1100
- } else if (item instanceof Renderer) {
1101
- item.#collect_content(content);
1102
- }
1103
- }
1104
- return content;
1105
- }
1106
- /**
1107
- * Collect all of the code from the `out` array and return it as a string.
1108
- * @param {AccumulatedContent} content
1109
- * @returns {Promise<AccumulatedContent>}
1110
- */
1111
- async #collect_content_async(content = { head: "", body: "" }) {
1112
- await this.promise;
1113
- for (const item of this.#out) {
1114
- if (typeof item === "string") {
1115
- content[this.type] += item;
1116
- } else if (item instanceof Renderer) {
1117
- await item.#collect_content_async(content);
1118
- }
1119
- }
1120
- return content;
1121
- }
1122
- async #collect_hydratables() {
1123
- const ctx = get_render_context().hydratable;
1124
- for (const [_, key] of ctx.unresolved_promises) {
1125
- unresolved_hydratable(key, ctx.lookup.get(key)?.stack ?? "<missing stack trace>");
1126
- }
1127
- for (const comparison of ctx.comparisons) {
1128
- await comparison;
1129
- }
1130
- return await this.#hydratable_block(ctx);
1131
- }
1132
- /**
1133
- * @template {Record<string, any>} Props
1134
- * @param {'sync' | 'async'} mode
1135
- * @param {import('svelte').Component<Props>} component
1136
- * @param {{ props?: Omit<Props, '$$slots' | '$$events'>; context?: Map<any, any>; idPrefix?: string; csp?: Csp }} options
1137
- * @returns {Renderer}
1138
- */
1139
- static #open_render(mode, component, options) {
1140
- const renderer = new Renderer(
1141
- new SSRState(mode, options.idPrefix ? options.idPrefix + "-" : "", options.csp)
1142
- );
1143
- renderer.push(BLOCK_OPEN);
1144
- if (options.context) {
1145
- push();
1146
- ssr_context.c = options.context;
1147
- ssr_context.r = renderer;
1148
- }
1149
- component(renderer, options.props ?? {});
1150
- if (options.context) {
1151
- pop();
1152
- }
1153
- renderer.push(BLOCK_CLOSE);
1154
- return renderer;
1155
- }
1156
- /**
1157
- * @param {AccumulatedContent} content
1158
- * @param {Renderer} renderer
1159
- * @returns {AccumulatedContent & { hashes: { script: Sha256Source[] } }}
1160
- */
1161
- static #close_render(content, renderer) {
1162
- for (const cleanup of renderer.#collect_on_destroy()) {
1163
- cleanup();
1164
- }
1165
- let head2 = content.head + renderer.global.get_title();
1166
- let body = content.body;
1167
- for (const { hash, code } of renderer.global.css) {
1168
- head2 += `<style id="${hash}">${code}</style>`;
1169
- }
1170
- return {
1171
- head: head2,
1172
- body,
1173
- hashes: {
1174
- script: renderer.global.csp.script_hashes
1175
- }
1176
- };
1177
- }
1178
- /**
1179
- * @param {HydratableContext} ctx
1180
- */
1181
- async #hydratable_block(ctx) {
1182
- if (ctx.lookup.size === 0) {
1183
- return null;
1184
- }
1185
- let entries = [];
1186
- let has_promises = false;
1187
- for (const [k, v] of ctx.lookup) {
1188
- if (v.promises) {
1189
- has_promises = true;
1190
- for (const p of v.promises) await p;
1191
- }
1192
- entries.push(`[${uneval(k)},${v.serialized}]`);
1193
- }
1194
- let prelude = `const h = (window.__svelte ??= {}).h ??= new Map();`;
1195
- if (has_promises) {
1196
- prelude = `const r = (v) => Promise.resolve(v);
1197
- ${prelude}`;
1198
- }
1199
- const body = `
1200
- {
1201
- ${prelude}
1202
-
1203
- for (const [k, v] of [
1204
- ${entries.join(",\n ")}
1205
- ]) {
1206
- h.set(k, v);
1207
- }
1208
- }
1209
- `;
1210
- let csp_attr = "";
1211
- if (this.global.csp.nonce) {
1212
- csp_attr = ` nonce="${this.global.csp.nonce}"`;
1213
- } else if (this.global.csp.hash) {
1214
- const hash = await sha256(body);
1215
- this.global.csp.script_hashes.push(`sha256-${hash}`);
1216
- }
1217
- return `
1218
- <script${csp_attr}>${body}<\/script>`;
1219
- }
1220
- }
1221
- class SSRState {
1222
- /** @readonly @type {Csp & { script_hashes: Sha256Source[] }} */
1223
- csp;
1224
- /** @readonly @type {'sync' | 'async'} */
1225
- mode;
1226
- /** @readonly @type {() => string} */
1227
- uid;
1228
- /** @readonly @type {Set<{ hash: string; code: string }>} */
1229
- css = /* @__PURE__ */ new Set();
1230
- /** @type {{ path: number[], value: string }} */
1231
- #title = { path: [], value: "" };
1232
- /**
1233
- * @param {'sync' | 'async'} mode
1234
- * @param {string} id_prefix
1235
- * @param {Csp} csp
1236
- */
1237
- constructor(mode, id_prefix = "", csp = { hash: false }) {
1238
- this.mode = mode;
1239
- this.csp = { ...csp, script_hashes: [] };
1240
- let uid = 1;
1241
- this.uid = () => `${id_prefix}s${uid++}`;
1242
- }
1243
- get_title() {
1244
- return this.#title.value;
1245
- }
1246
- /**
1247
- * Performs a depth-first (lexicographic) comparison using the path. Rejects sets
1248
- * from earlier than or equal to the current value.
1249
- * @param {string} value
1250
- * @param {number[]} path
1251
- */
1252
- set_title(value, path) {
1253
- const current = this.#title.path;
1254
- let i = 0;
1255
- let l = Math.min(path.length, current.length);
1256
- while (i < l && path[i] === current[i]) i += 1;
1257
- if (path[i] === void 0) return;
1258
- if (current[i] === void 0 || path[i] > current[i]) {
1259
- this.#title.path = path;
1260
- this.#title.value = value;
1261
- }
1262
- }
1263
- }
1264
- const INVALID_ATTR_NAME_CHAR_REGEX = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
1265
- function render(component, options = {}) {
1266
- if (options.csp?.hash && options.csp.nonce) {
1267
- invalid_csp();
1268
- }
1269
- return Renderer.render(
1270
- /** @type {Component<Props>} */
1271
- component,
1272
- options
1273
- );
1274
- }
1275
- function head(hash, renderer, fn) {
1276
- renderer.head((renderer2) => {
1277
- renderer2.push(`<!--${hash}-->`);
1278
- renderer2.child(fn);
1279
- renderer2.push(EMPTY_COMMENT);
1280
- });
1281
- }
1282
- function attributes(attrs, css_hash, classes, styles, flags = 0) {
1283
- if (styles) {
1284
- attrs.style = to_style(attrs.style, styles);
1285
- }
1286
- if (attrs.class) {
1287
- attrs.class = clsx(attrs.class);
1288
- }
1289
- if (css_hash || classes) {
1290
- attrs.class = to_class(attrs.class, css_hash, classes);
1291
- }
1292
- let attr_str = "";
1293
- let name;
1294
- const is_html = (flags & ELEMENT_IS_NAMESPACED) === 0;
1295
- const lowercase = (flags & ELEMENT_PRESERVE_ATTRIBUTE_CASE) === 0;
1296
- const is_input = (flags & ELEMENT_IS_INPUT) !== 0;
1297
- for (name in attrs) {
1298
- if (typeof attrs[name] === "function") continue;
1299
- if (name[0] === "$" && name[1] === "$") continue;
1300
- if (INVALID_ATTR_NAME_CHAR_REGEX.test(name)) continue;
1301
- var value = attrs[name];
1302
- if (lowercase) {
1303
- name = name.toLowerCase();
1304
- }
1305
- if (is_input) {
1306
- if (name === "defaultvalue" || name === "defaultchecked") {
1307
- name = name === "defaultvalue" ? "value" : "checked";
1308
- if (attrs[name]) continue;
1309
- }
1310
- }
1311
- attr_str += attr(name, value, is_html && is_boolean_attribute(name));
1312
- }
1313
- return attr_str;
1314
- }
1315
- function stringify(value) {
1316
- return typeof value === "string" ? value : value == null ? "" : value + "";
1317
- }
1318
- function attr_class(value, hash, directives) {
1319
- var result = to_class(value, hash, directives);
1320
- return result ? ` class="${escape_html(result, true)}"` : "";
1321
- }
1322
- function attr_style(value, directives) {
1323
- var result = to_style(value, directives);
1324
- return result ? ` style="${escape_html(result, true)}"` : "";
1325
- }
1326
- function bind_props(props_parent, props_now) {
1327
- for (const key in props_now) {
1328
- const initial_value = props_parent[key];
1329
- const value = props_now[key];
1330
- if (initial_value === void 0 && value !== void 0 && Object.getOwnPropertyDescriptor(props_parent, key)?.set) {
1331
- props_parent[key] = value;
1332
- }
1333
- }
1334
- }
1335
- function await_block(renderer, promise, pending_fn, then_fn) {
1336
- if (is_promise(promise)) {
1337
- renderer.push(BLOCK_OPEN);
1338
- promise.then(null, noop);
1339
- if (pending_fn !== null) {
1340
- pending_fn();
1341
- }
1342
- } else if (then_fn !== null) {
1343
- renderer.push(BLOCK_OPEN_ELSE);
1344
- then_fn(promise);
1345
- }
1346
- }
1347
- function ensure_array_like(array_like_or_iterator) {
1348
- if (array_like_or_iterator) {
1349
- return array_like_or_iterator.length !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator);
1350
- }
1351
- return [];
1352
- }
1353
-
1354
- export { ASYNC as A, BOUNDARY_EFFECT as B, CONNECTED as C, DERIVED as D, ERROR_VALUE as E, EAGER_EFFECT as F, STALE_REACTION as G, HYDRATION_START as H, INERT as I, HYDRATION_END as J, HYDRATION_START_ELSE as K, LEGACY_PROPS as L, MAYBE_DIRTY as M, USER_EFFECT as N, uneval as O, RENDER_EFFECT as R, STATE_SYMBOL as S, UNINITIALIZED as U, WAS_MARKED as W, attr as a, attr_class as b, clsx as c, await_block as d, ensure_array_like as e, bind_props as f, attr_style as g, head as h, COMMENT_NODE as i, HYDRATION_ERROR as j, DIRTY as k, CLEAN as l, EFFECT as m, MANAGED_EFFECT as n, BLOCK_EFFECT as o, is_passive_event as p, BRANCH_EFFECT as q, render as r, stringify as s, ROOT_EFFECT as t, DESTROYED as u, HEAD_EFFECT as v, REACTION_IS_UPDATING as w, EFFECT_RAN as x, EFFECT_PRESERVED as y, EFFECT_TRANSPARENT as z };
1355
- //# sourceMappingURL=index-DOCFW0vv.js.map