@axium/server 0.15.2 → 0.15.3

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 (186) hide show
  1. package/build/client/_app/immutable/assets/3.C2J9FN5q.css +1 -0
  2. package/build/client/_app/immutable/assets/3.C2J9FN5q.css.br +0 -0
  3. package/build/client/_app/immutable/assets/3.C2J9FN5q.css.gz +0 -0
  4. package/build/client/_app/immutable/chunks/B3bf7yrh.js +1 -0
  5. package/build/client/_app/immutable/chunks/B3bf7yrh.js.br +0 -0
  6. package/build/client/_app/immutable/chunks/B3bf7yrh.js.gz +0 -0
  7. package/build/client/_app/immutable/chunks/D5lcOOwR.js +1 -0
  8. package/build/client/_app/immutable/chunks/D5lcOOwR.js.br +0 -0
  9. package/build/client/_app/immutable/chunks/D5lcOOwR.js.gz +0 -0
  10. package/build/client/_app/immutable/chunks/DCs3KlJy.js +1 -0
  11. package/build/client/_app/immutable/chunks/DCs3KlJy.js.br +0 -0
  12. package/build/client/_app/immutable/chunks/DCs3KlJy.js.gz +0 -0
  13. package/build/client/_app/immutable/chunks/{yW8Db6jf.js → DUyppgAg.js} +1 -1
  14. package/build/client/_app/immutable/chunks/DUyppgAg.js.br +0 -0
  15. package/build/client/_app/immutable/chunks/DUyppgAg.js.gz +0 -0
  16. package/build/client/_app/immutable/chunks/DsnmJJEf.js +1 -0
  17. package/build/client/_app/immutable/chunks/DsnmJJEf.js.br +2 -0
  18. package/build/client/_app/immutable/chunks/DsnmJJEf.js.gz +0 -0
  19. package/build/client/_app/immutable/chunks/{svwy5d_q.js → DwXHBAd8.js} +1 -1
  20. package/build/client/_app/immutable/chunks/DwXHBAd8.js.br +0 -0
  21. package/build/client/_app/immutable/chunks/DwXHBAd8.js.gz +0 -0
  22. package/build/client/_app/immutable/chunks/Pr6n9c6V.js +3 -0
  23. package/build/client/_app/immutable/chunks/Pr6n9c6V.js.br +0 -0
  24. package/build/client/_app/immutable/chunks/Pr6n9c6V.js.gz +0 -0
  25. package/build/client/_app/immutable/chunks/WzlfQ8yv.js +33 -0
  26. package/build/client/_app/immutable/chunks/WzlfQ8yv.js.br +0 -0
  27. package/build/client/_app/immutable/chunks/WzlfQ8yv.js.gz +0 -0
  28. package/build/client/_app/immutable/chunks/ct9jA5hl.js +1 -0
  29. package/build/client/_app/immutable/chunks/ct9jA5hl.js.br +0 -0
  30. package/build/client/_app/immutable/chunks/ct9jA5hl.js.gz +0 -0
  31. package/build/client/_app/immutable/entry/app.CQj5eQsA.js +2 -0
  32. package/build/client/_app/immutable/entry/app.CQj5eQsA.js.br +0 -0
  33. package/build/client/_app/immutable/entry/app.CQj5eQsA.js.gz +0 -0
  34. package/build/client/_app/immutable/entry/start.Ds_ebP1Q.js +1 -0
  35. package/build/client/_app/immutable/entry/start.Ds_ebP1Q.js.br +2 -0
  36. package/build/client/_app/immutable/entry/start.Ds_ebP1Q.js.gz +0 -0
  37. package/build/client/_app/immutable/nodes/0.BbGefPez.js +1 -0
  38. package/build/client/_app/immutable/nodes/0.BbGefPez.js.br +0 -0
  39. package/build/client/_app/immutable/nodes/0.BbGefPez.js.gz +0 -0
  40. package/build/client/_app/immutable/nodes/1.9recSJsX.js +1 -0
  41. package/build/client/_app/immutable/nodes/1.9recSJsX.js.br +0 -0
  42. package/build/client/_app/immutable/nodes/1.9recSJsX.js.gz +0 -0
  43. package/build/client/_app/immutable/nodes/{2.B9G2lbYt.js → 2._Jmh03he.js} +1 -1
  44. package/build/client/_app/immutable/nodes/2._Jmh03he.js.br +0 -0
  45. package/build/client/_app/immutable/nodes/2._Jmh03he.js.gz +0 -0
  46. package/build/client/_app/immutable/nodes/3.C5M9K6mm.js +1 -0
  47. package/build/client/_app/immutable/nodes/3.C5M9K6mm.js.br +0 -0
  48. package/build/client/_app/immutable/nodes/3.C5M9K6mm.js.gz +0 -0
  49. package/build/client/_app/immutable/nodes/{4.C0ASCCKJ.js → 4.DEuGpCAL.js} +1 -1
  50. package/build/client/_app/immutable/nodes/4.DEuGpCAL.js.br +0 -0
  51. package/build/client/_app/immutable/nodes/4.DEuGpCAL.js.gz +0 -0
  52. package/build/client/_app/immutable/nodes/5.paM-fbnX.js +1 -0
  53. package/build/client/_app/immutable/nodes/5.paM-fbnX.js.br +0 -0
  54. package/build/client/_app/immutable/nodes/5.paM-fbnX.js.gz +0 -0
  55. package/build/client/_app/immutable/nodes/{6.YOGJfU-M.js → 6.CBEgo3To.js} +1 -1
  56. package/build/client/_app/immutable/nodes/6.CBEgo3To.js.br +0 -0
  57. package/build/client/_app/immutable/nodes/6.CBEgo3To.js.gz +0 -0
  58. package/build/client/_app/version.json +1 -1
  59. package/build/client/_app/version.json.br +0 -0
  60. package/build/client/_app/version.json.gz +0 -0
  61. package/build/handler.js +23 -25
  62. package/build/server/chunks/0-CUfr8UwD.js +9 -0
  63. package/build/server/chunks/{0-7meuaxFL.js.map → 0-CUfr8UwD.js.map} +1 -1
  64. package/build/server/chunks/1-BJ42wyLK.js +9 -0
  65. package/build/server/chunks/{1-BbUBgmrG.js.map → 1-BJ42wyLK.js.map} +1 -1
  66. package/build/server/chunks/2-c1bljkMr.js +9 -0
  67. package/build/server/chunks/{2-D6R7j0yL.js.map → 2-c1bljkMr.js.map} +1 -1
  68. package/build/server/chunks/3-BuBncH7z.js +9 -0
  69. package/build/server/chunks/{3-DZ8mi-cG.js.map → 3-BuBncH7z.js.map} +1 -1
  70. package/build/server/chunks/4-D8HYZ-ac.js +9 -0
  71. package/build/server/chunks/{4-Dc6Dzrm7.js.map → 4-D8HYZ-ac.js.map} +1 -1
  72. package/build/server/chunks/5-EzdGznQP.js +9 -0
  73. package/build/server/chunks/{5-Chvceoq8.js.map → 5-EzdGznQP.js.map} +1 -1
  74. package/build/server/chunks/6-BQgl5_JT.js +9 -0
  75. package/build/server/chunks/{6-Cbl0SopN.js.map → 6-BQgl5_JT.js.map} +1 -1
  76. package/build/server/chunks/{Logout-DUflDKOi.js → Logout-4Od8dYV1.js} +9 -9
  77. package/build/server/chunks/Logout-4Od8dYV1.js.map +1 -0
  78. package/build/server/chunks/{_page.svelte-BbkaV9bg.js → _page.svelte-B_EP3jbH.js} +74 -69
  79. package/build/server/chunks/_page.svelte-B_EP3jbH.js.map +1 -0
  80. package/build/server/chunks/{_page.svelte-DDKUcB-D.js → _page.svelte-BcjlHMhi.js} +10 -9
  81. package/build/server/chunks/_page.svelte-BcjlHMhi.js.map +1 -0
  82. package/build/server/chunks/_page.svelte-D1_WJoyP.js +6 -0
  83. package/build/server/chunks/_page.svelte-D1_WJoyP.js.map +1 -0
  84. package/build/server/chunks/_page.svelte-DJRLEvxc.js +12 -0
  85. package/build/server/chunks/{_page.svelte-jYXkeWmV.js.map → _page.svelte-DJRLEvxc.js.map} +1 -1
  86. package/build/server/chunks/{_page.svelte-Dcq4iR71.js → _page.svelte-I9fcckyX.js} +10 -9
  87. package/build/server/chunks/_page.svelte-I9fcckyX.js.map +1 -0
  88. package/build/server/chunks/{client-BwGZz7hC.js → client-D5FV-LOu.js} +3 -12
  89. package/build/server/chunks/client-D5FV-LOu.js.map +1 -0
  90. package/build/server/chunks/error.svelte-cLGudrL-.js +24 -0
  91. package/build/server/chunks/error.svelte-cLGudrL-.js.map +1 -0
  92. package/build/server/chunks/{exports-Bdi6Ec6W.js → exports-BObzsBSm.js} +41 -28
  93. package/build/server/chunks/exports-BObzsBSm.js.map +1 -0
  94. package/build/server/chunks/{layout.svelte-4V-_rMCU.js → layout.svelte-BSvrn-4a.js} +2 -2
  95. package/build/server/chunks/layout.svelte-BSvrn-4a.js.map +1 -0
  96. package/build/server/chunks/{user-CaYpK3bP.js → user-HWeBtNq4.js} +26 -20
  97. package/build/server/chunks/user-HWeBtNq4.js.map +1 -0
  98. package/build/server/index.js +849 -589
  99. package/build/server/index.js.map +1 -1
  100. package/build/server/manifest.js +8 -8
  101. package/build/server/manifest.js.map +1 -1
  102. package/dist/api/passkeys.js +1 -1
  103. package/dist/api/register.js +5 -1
  104. package/dist/api/users.js +1 -1
  105. package/dist/cli.js +1 -1
  106. package/dist/config.d.ts +19 -17
  107. package/dist/config.js +14 -12
  108. package/dist/plugins.d.ts +5 -5
  109. package/dist/plugins.js +1 -1
  110. package/dist/requests.d.ts +1 -1
  111. package/dist/requests.js +1 -1
  112. package/dist/routes.d.ts +1 -1
  113. package/dist/sveltekit.js +1 -1
  114. package/package.json +4 -4
  115. package/build/client/_app/immutable/assets/3.D8lAdddR.css +0 -1
  116. package/build/client/_app/immutable/assets/3.D8lAdddR.css.br +0 -0
  117. package/build/client/_app/immutable/assets/3.D8lAdddR.css.gz +0 -0
  118. package/build/client/_app/immutable/chunks/1J1OrtJW.js +0 -1
  119. package/build/client/_app/immutable/chunks/1J1OrtJW.js.br +0 -0
  120. package/build/client/_app/immutable/chunks/1J1OrtJW.js.gz +0 -0
  121. package/build/client/_app/immutable/chunks/Ba8PyTSW.js +0 -3
  122. package/build/client/_app/immutable/chunks/Ba8PyTSW.js.br +0 -0
  123. package/build/client/_app/immutable/chunks/Ba8PyTSW.js.gz +0 -0
  124. package/build/client/_app/immutable/chunks/BmyAb9RG.js +0 -1
  125. package/build/client/_app/immutable/chunks/BmyAb9RG.js.br +0 -2
  126. package/build/client/_app/immutable/chunks/BmyAb9RG.js.gz +0 -0
  127. package/build/client/_app/immutable/chunks/CRHSWE7d.js +0 -33
  128. package/build/client/_app/immutable/chunks/CRHSWE7d.js.br +0 -0
  129. package/build/client/_app/immutable/chunks/CRHSWE7d.js.gz +0 -0
  130. package/build/client/_app/immutable/chunks/CWj6FrbW.js +0 -1
  131. package/build/client/_app/immutable/chunks/CWj6FrbW.js.br +0 -0
  132. package/build/client/_app/immutable/chunks/CWj6FrbW.js.gz +0 -0
  133. package/build/client/_app/immutable/chunks/CeESZvTN.js +0 -1
  134. package/build/client/_app/immutable/chunks/CeESZvTN.js.br +0 -0
  135. package/build/client/_app/immutable/chunks/CeESZvTN.js.gz +0 -0
  136. package/build/client/_app/immutable/chunks/CtXEx3cs.js +0 -1
  137. package/build/client/_app/immutable/chunks/CtXEx3cs.js.br +0 -0
  138. package/build/client/_app/immutable/chunks/CtXEx3cs.js.gz +0 -0
  139. package/build/client/_app/immutable/chunks/svwy5d_q.js.br +0 -0
  140. package/build/client/_app/immutable/chunks/svwy5d_q.js.gz +0 -0
  141. package/build/client/_app/immutable/chunks/yW8Db6jf.js.br +0 -0
  142. package/build/client/_app/immutable/chunks/yW8Db6jf.js.gz +0 -0
  143. package/build/client/_app/immutable/entry/app.4IkQYu-W.js +0 -2
  144. package/build/client/_app/immutable/entry/app.4IkQYu-W.js.br +0 -0
  145. package/build/client/_app/immutable/entry/app.4IkQYu-W.js.gz +0 -0
  146. package/build/client/_app/immutable/entry/start.D1mDxCqy.js +0 -1
  147. package/build/client/_app/immutable/entry/start.D1mDxCqy.js.br +0 -2
  148. package/build/client/_app/immutable/entry/start.D1mDxCqy.js.gz +0 -0
  149. package/build/client/_app/immutable/nodes/0.C8tUtue5.js +0 -1
  150. package/build/client/_app/immutable/nodes/0.C8tUtue5.js.br +0 -0
  151. package/build/client/_app/immutable/nodes/0.C8tUtue5.js.gz +0 -0
  152. package/build/client/_app/immutable/nodes/1.kyrdrh3O.js +0 -1
  153. package/build/client/_app/immutable/nodes/1.kyrdrh3O.js.br +0 -0
  154. package/build/client/_app/immutable/nodes/1.kyrdrh3O.js.gz +0 -0
  155. package/build/client/_app/immutable/nodes/2.B9G2lbYt.js.br +0 -0
  156. package/build/client/_app/immutable/nodes/2.B9G2lbYt.js.gz +0 -0
  157. package/build/client/_app/immutable/nodes/3.B1tn5yYq.js +0 -1
  158. package/build/client/_app/immutable/nodes/3.B1tn5yYq.js.br +0 -0
  159. package/build/client/_app/immutable/nodes/3.B1tn5yYq.js.gz +0 -0
  160. package/build/client/_app/immutable/nodes/4.C0ASCCKJ.js.br +0 -0
  161. package/build/client/_app/immutable/nodes/4.C0ASCCKJ.js.gz +0 -0
  162. package/build/client/_app/immutable/nodes/5.C_0lUGyt.js +0 -1
  163. package/build/client/_app/immutable/nodes/5.C_0lUGyt.js.br +0 -0
  164. package/build/client/_app/immutable/nodes/5.C_0lUGyt.js.gz +0 -0
  165. package/build/client/_app/immutable/nodes/6.YOGJfU-M.js.br +0 -0
  166. package/build/client/_app/immutable/nodes/6.YOGJfU-M.js.gz +0 -0
  167. package/build/server/chunks/0-7meuaxFL.js +0 -9
  168. package/build/server/chunks/1-BbUBgmrG.js +0 -9
  169. package/build/server/chunks/2-D6R7j0yL.js +0 -9
  170. package/build/server/chunks/3-DZ8mi-cG.js +0 -9
  171. package/build/server/chunks/4-Dc6Dzrm7.js +0 -9
  172. package/build/server/chunks/5-Chvceoq8.js +0 -9
  173. package/build/server/chunks/6-Cbl0SopN.js +0 -9
  174. package/build/server/chunks/Logout-DUflDKOi.js.map +0 -1
  175. package/build/server/chunks/_page.svelte-BbkaV9bg.js.map +0 -1
  176. package/build/server/chunks/_page.svelte-CTxNa7SS.js +0 -6
  177. package/build/server/chunks/_page.svelte-CTxNa7SS.js.map +0 -1
  178. package/build/server/chunks/_page.svelte-DDKUcB-D.js.map +0 -1
  179. package/build/server/chunks/_page.svelte-Dcq4iR71.js.map +0 -1
  180. package/build/server/chunks/_page.svelte-jYXkeWmV.js +0 -11
  181. package/build/server/chunks/client-BwGZz7hC.js.map +0 -1
  182. package/build/server/chunks/error.svelte-Cp6qBRXj.js +0 -23
  183. package/build/server/chunks/error.svelte-Cp6qBRXj.js.map +0 -1
  184. package/build/server/chunks/exports-Bdi6Ec6W.js.map +0 -1
  185. package/build/server/chunks/layout.svelte-4V-_rMCU.js.map +0 -1
  186. package/build/server/chunks/user-CaYpK3bP.js.map +0 -1
@@ -1,4 +1,6 @@
1
- import { r as render, L as LEGACY_PROPS, d as define_property, U as UNOWNED, C as COMMENT_NODE, H as HYDRATION_START, a as HYDRATION_ERROR, b as HYDRATION_END, s as safe_equals, S as STATE_SYMBOL, o as object_prototype, c as array_prototype, e as UNINITIALIZED, g as get_descriptor, D as DERIVED, f as DIRTY, h as CLEAN, M as MAYBE_DIRTY, i as DISCONNECTED, j as is_extensible, k as array_from, l as equals, m as get_prototype_of, n as is_array, p as is_passive_event, q as run_all, I as INERT, E as EFFECT, t as DESTROYED, u as USER_EFFECT, v as EFFECT_IS_UPDATING, B as BRANCH_EFFECT, R as ROOT_EFFECT, w as STALE_REACTION, x as EFFECT_RAN, y as EFFECT_PRESERVED, z as BOUNDARY_EFFECT, A as HEAD_EFFECT, F as BLOCK_EFFECT, G as DEV, J as EFFECT_TRANSPARENT, K as index_of, N as INSPECT_EFFECT, O as RENDER_EFFECT, P as push$1, Q as setContext, T as pop$1, V as decode_pathname, W as decode_params, X as normalize_path, Y as disable_search, Z as validate_layout_server_exports, _ as validate_layout_exports, $ as validate_page_server_exports, a0 as validate_page_exports, a1 as resolve, a2 as make_trackable, a3 as readable, a4 as writable } from './chunks/exports-Bdi6Ec6W.js';
1
+ import { r as render, L as LEGACY_PROPS, d as define_property, U as UNOWNED, E as ERROR_VALUE, C as COMMENT_NODE, H as HYDRATION_START, a as HYDRATION_ERROR, b as HYDRATION_END, s as safe_equals, S as STATE_SYMBOL, o as object_prototype, c as array_prototype, e as UNINITIALIZED, g as get_descriptor, D as DERIVED, f as DIRTY, h as CLEAN, M as MAYBE_DIRTY, i as DISCONNECTED, j as is_extensible, k as array_from, I as INERT, l as EFFECT, A as ASYNC, B as BLOCK_EFFECT, m as DEV, n as deferred, p as equals, q as get_prototype_of, t as is_array, u as is_passive_event, v as BRANCH_EFFECT, R as ROOT_EFFECT, w as DESTROYED, x as USER_EFFECT, y as run_all, z as STALE_REACTION, F as REACTION_IS_UPDATING, G as EFFECT_RAN, J as EFFECT_PRESERVED, K as HEAD_EFFECT, N as BOUNDARY_EFFECT, O as EFFECT_TRANSPARENT, P as index_of, Q as INSPECT_EFFECT, T as push$1, V as setContext, W as pop$1, X as decode_pathname, Y as decode_params, Z as normalize_path, _ as disable_search, $ as validate_layout_server_exports, a0 as validate_layout_exports, a1 as validate_page_server_exports, a2 as validate_page_exports, a3 as resolve, a4 as make_trackable, a5 as readable, a6 as writable } from './chunks/exports-BObzsBSm.js';
2
+ import { json, text } from '@sveltejs/kit';
3
+ import { HttpError, Redirect, SvelteKitError, ActionFailure } from '@sveltejs/kit/internal';
2
4
  import { parse, serialize } from 'cookie';
3
5
 
4
6
  let base = "";
@@ -46,56 +48,664 @@ function state_unsafe_mutation() {
46
48
  throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
47
49
  }
48
50
  }
51
+ function hydration_mismatch(location) {
52
+ {
53
+ console.warn(`https://svelte.dev/e/hydration_mismatch`);
54
+ }
55
+ }
56
+ let hydrating = false;
57
+ function set_hydrating(value) {
58
+ hydrating = value;
59
+ }
60
+ let hydrate_node;
61
+ function set_hydrate_node(node) {
62
+ if (node === null) {
63
+ hydration_mismatch();
64
+ throw HYDRATION_ERROR;
65
+ }
66
+ return hydrate_node = node;
67
+ }
68
+ function hydrate_next() {
69
+ return set_hydrate_node(
70
+ /** @type {TemplateNode} */
71
+ /* @__PURE__ */ get_next_sibling(hydrate_node)
72
+ );
73
+ }
49
74
  let tracing_mode_flag = false;
50
75
  let component_context = null;
51
76
  function set_component_context(context) {
52
77
  component_context = context;
53
78
  }
54
- function push(props, runes = false, fn) {
55
- var ctx = component_context = {
56
- p: component_context,
57
- c: null,
58
- d: false,
59
- e: null,
60
- m: false,
61
- s: props,
62
- x: null,
63
- l: null
64
- };
65
- teardown(() => {
66
- ctx.d = true;
67
- });
79
+ function push(props, runes = false, fn) {
80
+ component_context = {
81
+ p: component_context,
82
+ c: null,
83
+ e: null,
84
+ s: props,
85
+ x: null,
86
+ l: null
87
+ };
88
+ }
89
+ function pop(component) {
90
+ var context = (
91
+ /** @type {ComponentContext} */
92
+ component_context
93
+ );
94
+ var effects = context.e;
95
+ if (effects !== null) {
96
+ context.e = null;
97
+ for (var fn of effects) {
98
+ create_user_effect(fn);
99
+ }
100
+ }
101
+ component_context = context.p;
102
+ return (
103
+ /** @type {T} */
104
+ {}
105
+ );
106
+ }
107
+ function is_runes() {
108
+ return true;
109
+ }
110
+ const adjustments = /* @__PURE__ */ new WeakMap();
111
+ function handle_error(error) {
112
+ var effect = active_effect;
113
+ if (effect === null) {
114
+ active_reaction.f |= ERROR_VALUE;
115
+ return error;
116
+ }
117
+ if ((effect.f & EFFECT_RAN) === 0) {
118
+ if ((effect.f & BOUNDARY_EFFECT) === 0) {
119
+ if (!effect.parent && error instanceof Error) {
120
+ apply_adjustments(error);
121
+ }
122
+ throw error;
123
+ }
124
+ effect.b.error(error);
125
+ } else {
126
+ invoke_error_boundary(error, effect);
127
+ }
128
+ }
129
+ function invoke_error_boundary(error, effect) {
130
+ while (effect !== null) {
131
+ if ((effect.f & BOUNDARY_EFFECT) !== 0) {
132
+ try {
133
+ effect.b.error(error);
134
+ return;
135
+ } catch (e) {
136
+ error = e;
137
+ }
138
+ }
139
+ effect = effect.parent;
140
+ }
141
+ if (error instanceof Error) {
142
+ apply_adjustments(error);
143
+ }
144
+ throw error;
145
+ }
146
+ function apply_adjustments(error) {
147
+ const adjusted = adjustments.get(error);
148
+ if (adjusted) {
149
+ define_property(error, "message", {
150
+ value: adjusted.message
151
+ });
152
+ define_property(error, "stack", {
153
+ value: adjusted.stack
154
+ });
155
+ }
156
+ }
157
+ let micro_tasks = [];
158
+ let idle_tasks = [];
159
+ function run_micro_tasks() {
160
+ var tasks2 = micro_tasks;
161
+ micro_tasks = [];
162
+ run_all(tasks2);
163
+ }
164
+ function run_idle_tasks() {
165
+ var tasks2 = idle_tasks;
166
+ idle_tasks = [];
167
+ run_all(tasks2);
168
+ }
169
+ function flush_tasks() {
170
+ if (micro_tasks.length > 0) {
171
+ run_micro_tasks();
172
+ }
173
+ if (idle_tasks.length > 0) {
174
+ run_idle_tasks();
175
+ }
176
+ }
177
+ function destroy_derived_effects(derived) {
178
+ var effects = derived.effects;
179
+ if (effects !== null) {
180
+ derived.effects = null;
181
+ for (var i = 0; i < effects.length; i += 1) {
182
+ destroy_effect(
183
+ /** @type {Effect} */
184
+ effects[i]
185
+ );
186
+ }
187
+ }
188
+ }
189
+ function get_derived_parent_effect(derived) {
190
+ var parent = derived.parent;
191
+ while (parent !== null) {
192
+ if ((parent.f & DERIVED) === 0) {
193
+ return (
194
+ /** @type {Effect} */
195
+ parent
196
+ );
197
+ }
198
+ parent = parent.parent;
199
+ }
200
+ return null;
201
+ }
202
+ function execute_derived(derived) {
203
+ var value;
204
+ var prev_active_effect = active_effect;
205
+ set_active_effect(get_derived_parent_effect(derived));
206
+ {
207
+ try {
208
+ destroy_derived_effects(derived);
209
+ value = update_reaction(derived);
210
+ } finally {
211
+ set_active_effect(prev_active_effect);
212
+ }
213
+ }
214
+ return value;
215
+ }
216
+ function update_derived(derived) {
217
+ var value = execute_derived(derived);
218
+ if (!derived.equals(value)) {
219
+ derived.v = value;
220
+ derived.wv = increment_write_version();
221
+ }
222
+ if (is_destroying_effect) {
223
+ return;
224
+ }
225
+ if (batch_deriveds !== null) {
226
+ batch_deriveds.set(derived, derived.v);
227
+ } else {
228
+ var status = (skip_reaction || (derived.f & UNOWNED) !== 0) && derived.deps !== null ? MAYBE_DIRTY : CLEAN;
229
+ set_signal_status(derived, status);
230
+ }
231
+ }
232
+ const batches = /* @__PURE__ */ new Set();
233
+ let current_batch = null;
234
+ let batch_deriveds = null;
235
+ let effect_pending_updates = /* @__PURE__ */ new Set();
236
+ let tasks = [];
237
+ function dequeue() {
238
+ const task = (
239
+ /** @type {() => void} */
240
+ tasks.shift()
241
+ );
242
+ if (tasks.length > 0) {
243
+ queueMicrotask(dequeue);
244
+ }
245
+ task();
246
+ }
247
+ let queued_root_effects = [];
248
+ let last_scheduled_effect = null;
249
+ let is_flushing = false;
250
+ class Batch {
251
+ /**
252
+ * The current values of any sources that are updated in this batch
253
+ * They keys of this map are identical to `this.#previous`
254
+ * @type {Map<Source, any>}
255
+ */
256
+ #current = /* @__PURE__ */ new Map();
257
+ /**
258
+ * The values of any sources that are updated in this batch _before_ those updates took place.
259
+ * They keys of this map are identical to `this.#current`
260
+ * @type {Map<Source, any>}
261
+ */
262
+ #previous = /* @__PURE__ */ new Map();
263
+ /**
264
+ * When the batch is committed (and the DOM is updated), we need to remove old branches
265
+ * and append new ones by calling the functions added inside (if/each/key/etc) blocks
266
+ * @type {Set<() => void>}
267
+ */
268
+ #callbacks = /* @__PURE__ */ new Set();
269
+ /**
270
+ * The number of async effects that are currently in flight
271
+ */
272
+ #pending = 0;
273
+ /**
274
+ * A deferred that resolves when the batch is committed, used with `settled()`
275
+ * TODO replace with Promise.withResolvers once supported widely enough
276
+ * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
277
+ */
278
+ #deferred = null;
279
+ /**
280
+ * True if an async effect inside this batch resolved and
281
+ * its parent branch was already deleted
282
+ */
283
+ #neutered = false;
284
+ /**
285
+ * Async effects (created inside `async_derived`) encountered during processing.
286
+ * These run after the rest of the batch has updated, since they should
287
+ * always have the latest values
288
+ * @type {Effect[]}
289
+ */
290
+ #async_effects = [];
291
+ /**
292
+ * The same as `#async_effects`, but for effects inside a newly-created
293
+ * `<svelte:boundary>` — these do not prevent the batch from committing
294
+ * @type {Effect[]}
295
+ */
296
+ #boundary_async_effects = [];
297
+ /**
298
+ * Template effects and `$effect.pre` effects, which run when
299
+ * a batch is committed
300
+ * @type {Effect[]}
301
+ */
302
+ #render_effects = [];
303
+ /**
304
+ * The same as `#render_effects`, but for `$effect` (which runs after)
305
+ * @type {Effect[]}
306
+ */
307
+ #effects = [];
308
+ /**
309
+ * Block effects, which may need to re-run on subsequent flushes
310
+ * in order to update internal sources (e.g. each block items)
311
+ * @type {Effect[]}
312
+ */
313
+ #block_effects = [];
314
+ /**
315
+ * A set of branches that still exist, but will be destroyed when this batch
316
+ * is committed — we skip over these during `process`
317
+ * @type {Set<Effect>}
318
+ */
319
+ skipped_effects = /* @__PURE__ */ new Set();
320
+ /**
321
+ *
322
+ * @param {Effect[]} root_effects
323
+ */
324
+ #process(root_effects) {
325
+ queued_root_effects = [];
326
+ var current_values = null;
327
+ if (batches.size > 1) {
328
+ current_values = /* @__PURE__ */ new Map();
329
+ batch_deriveds = /* @__PURE__ */ new Map();
330
+ for (const [source2, current] of this.#current) {
331
+ current_values.set(source2, { v: source2.v, wv: source2.wv });
332
+ source2.v = current;
333
+ }
334
+ for (const batch of batches) {
335
+ if (batch === this) continue;
336
+ for (const [source2, previous] of batch.#previous) {
337
+ if (!current_values.has(source2)) {
338
+ current_values.set(source2, { v: source2.v, wv: source2.wv });
339
+ source2.v = previous;
340
+ }
341
+ }
342
+ }
343
+ }
344
+ for (const root2 of root_effects) {
345
+ this.#traverse_effect_tree(root2);
346
+ }
347
+ if (this.#async_effects.length === 0 && this.#pending === 0) {
348
+ var render_effects = this.#render_effects;
349
+ var effects = this.#effects;
350
+ this.#render_effects = [];
351
+ this.#effects = [];
352
+ this.#block_effects = [];
353
+ this.#commit();
354
+ flush_queued_effects(render_effects);
355
+ flush_queued_effects(effects);
356
+ this.#deferred?.resolve();
357
+ } else {
358
+ for (const e of this.#render_effects) set_signal_status(e, CLEAN);
359
+ for (const e of this.#effects) set_signal_status(e, CLEAN);
360
+ for (const e of this.#block_effects) set_signal_status(e, CLEAN);
361
+ }
362
+ if (current_values) {
363
+ for (const [source2, { v, wv }] of current_values) {
364
+ if (source2.wv <= wv) {
365
+ source2.v = v;
366
+ }
367
+ }
368
+ batch_deriveds = null;
369
+ }
370
+ for (const effect of this.#async_effects) {
371
+ update_effect(effect);
372
+ }
373
+ for (const effect of this.#boundary_async_effects) {
374
+ update_effect(effect);
375
+ }
376
+ this.#async_effects = [];
377
+ this.#boundary_async_effects = [];
378
+ }
379
+ /**
380
+ * Traverse the effect tree, executing effects or stashing
381
+ * them for later execution as appropriate
382
+ * @param {Effect} root
383
+ */
384
+ #traverse_effect_tree(root2) {
385
+ root2.f ^= CLEAN;
386
+ var effect = root2.first;
387
+ while (effect !== null) {
388
+ var flags = effect.f;
389
+ var is_branch = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0;
390
+ var is_skippable_branch = is_branch && (flags & CLEAN) !== 0;
391
+ var skip = is_skippable_branch || (flags & INERT) !== 0 || this.skipped_effects.has(effect);
392
+ if (!skip && effect.fn !== null) {
393
+ if (is_branch) {
394
+ effect.f ^= CLEAN;
395
+ } else if ((flags & EFFECT) !== 0) {
396
+ this.#effects.push(effect);
397
+ } else if (is_dirty(effect)) {
398
+ if ((flags & ASYNC) !== 0) {
399
+ var effects = effect.b?.pending ? this.#boundary_async_effects : this.#async_effects;
400
+ effects.push(effect);
401
+ } else {
402
+ if ((effect.f & BLOCK_EFFECT) !== 0) this.#block_effects.push(effect);
403
+ update_effect(effect);
404
+ }
405
+ }
406
+ var child = effect.first;
407
+ if (child !== null) {
408
+ effect = child;
409
+ continue;
410
+ }
411
+ }
412
+ var parent = effect.parent;
413
+ effect = effect.next;
414
+ while (effect === null && parent !== null) {
415
+ effect = parent.next;
416
+ parent = parent.parent;
417
+ }
418
+ }
419
+ }
420
+ /**
421
+ * Associate a change to a given source with the current
422
+ * batch, noting its previous and current values
423
+ * @param {Source} source
424
+ * @param {any} value
425
+ */
426
+ capture(source2, value) {
427
+ if (!this.#previous.has(source2)) {
428
+ this.#previous.set(source2, value);
429
+ }
430
+ this.#current.set(source2, source2.v);
431
+ }
432
+ activate() {
433
+ current_batch = this;
434
+ }
435
+ deactivate() {
436
+ current_batch = null;
437
+ for (const update of effect_pending_updates) {
438
+ effect_pending_updates.delete(update);
439
+ update();
440
+ if (current_batch !== null) {
441
+ break;
442
+ }
443
+ }
444
+ }
445
+ neuter() {
446
+ this.#neutered = true;
447
+ }
448
+ flush() {
449
+ if (queued_root_effects.length > 0) {
450
+ this.flush_effects();
451
+ } else {
452
+ this.#commit();
453
+ }
454
+ if (current_batch !== this) {
455
+ return;
456
+ }
457
+ if (this.#pending === 0) {
458
+ batches.delete(this);
459
+ }
460
+ this.deactivate();
461
+ }
462
+ flush_effects() {
463
+ var was_updating_effect = is_updating_effect;
464
+ is_flushing = true;
465
+ try {
466
+ var flush_count = 0;
467
+ set_is_updating_effect(true);
468
+ while (queued_root_effects.length > 0) {
469
+ if (flush_count++ > 1e3) {
470
+ var updates, entry;
471
+ if (DEV) ;
472
+ infinite_loop_guard();
473
+ }
474
+ this.#process(queued_root_effects);
475
+ old_values.clear();
476
+ }
477
+ } finally {
478
+ is_flushing = false;
479
+ set_is_updating_effect(was_updating_effect);
480
+ last_scheduled_effect = null;
481
+ }
482
+ }
483
+ /**
484
+ * Append and remove branches to/from the DOM
485
+ */
486
+ #commit() {
487
+ if (!this.#neutered) {
488
+ for (const fn of this.#callbacks) {
489
+ fn();
490
+ }
491
+ }
492
+ this.#callbacks.clear();
493
+ }
494
+ increment() {
495
+ this.#pending += 1;
496
+ }
497
+ decrement() {
498
+ this.#pending -= 1;
499
+ if (this.#pending === 0) {
500
+ for (const e of this.#render_effects) {
501
+ set_signal_status(e, DIRTY);
502
+ schedule_effect(e);
503
+ }
504
+ for (const e of this.#effects) {
505
+ set_signal_status(e, DIRTY);
506
+ schedule_effect(e);
507
+ }
508
+ for (const e of this.#block_effects) {
509
+ set_signal_status(e, DIRTY);
510
+ schedule_effect(e);
511
+ }
512
+ this.#render_effects = [];
513
+ this.#effects = [];
514
+ this.flush();
515
+ } else {
516
+ this.deactivate();
517
+ }
518
+ }
519
+ /** @param {() => void} fn */
520
+ add_callback(fn) {
521
+ this.#callbacks.add(fn);
522
+ }
523
+ settled() {
524
+ return (this.#deferred ??= deferred()).promise;
525
+ }
526
+ static ensure(autoflush = true) {
527
+ if (current_batch === null) {
528
+ const batch = current_batch = new Batch();
529
+ batches.add(current_batch);
530
+ if (autoflush) {
531
+ Batch.enqueue(() => {
532
+ if (current_batch !== batch) {
533
+ return;
534
+ }
535
+ batch.flush();
536
+ });
537
+ }
538
+ }
539
+ return current_batch;
540
+ }
541
+ /** @param {() => void} task */
542
+ static enqueue(task) {
543
+ if (tasks.length === 0) {
544
+ queueMicrotask(dequeue);
545
+ }
546
+ tasks.unshift(task);
547
+ }
548
+ }
549
+ function flushSync(fn) {
550
+ var result;
551
+ const batch = Batch.ensure(false);
552
+ while (true) {
553
+ flush_tasks();
554
+ if (queued_root_effects.length === 0) {
555
+ if (batch === current_batch) {
556
+ batch.flush();
557
+ }
558
+ last_scheduled_effect = null;
559
+ return (
560
+ /** @type {T} */
561
+ result
562
+ );
563
+ }
564
+ batch.flush_effects();
565
+ }
566
+ }
567
+ function infinite_loop_guard() {
568
+ try {
569
+ effect_update_depth_exceeded();
570
+ } catch (error) {
571
+ invoke_error_boundary(error, last_scheduled_effect);
572
+ }
573
+ }
574
+ function flush_queued_effects(effects) {
575
+ var length = effects.length;
576
+ if (length === 0) return;
577
+ for (var i = 0; i < length; i++) {
578
+ var effect = effects[i];
579
+ if ((effect.f & (DESTROYED | INERT)) === 0) {
580
+ if (is_dirty(effect)) {
581
+ var wv = write_version;
582
+ update_effect(effect);
583
+ if (effect.deps === null && effect.first === null && effect.nodes_start === null) {
584
+ if (effect.teardown === null && effect.ac === null) {
585
+ unlink_effect(effect);
586
+ } else {
587
+ effect.fn = null;
588
+ }
589
+ }
590
+ if (write_version > wv && (effect.f & USER_EFFECT) !== 0) {
591
+ break;
592
+ }
593
+ }
594
+ }
595
+ }
596
+ for (; i < length; i += 1) {
597
+ schedule_effect(effects[i]);
598
+ }
599
+ }
600
+ function schedule_effect(signal) {
601
+ var effect = last_scheduled_effect = signal;
602
+ while (effect.parent !== null) {
603
+ effect = effect.parent;
604
+ var flags = effect.f;
605
+ if (is_flushing && effect === active_effect && (flags & BLOCK_EFFECT) !== 0) {
606
+ return;
607
+ }
608
+ if ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {
609
+ if ((flags & CLEAN) === 0) return;
610
+ effect.f ^= CLEAN;
611
+ }
612
+ }
613
+ queued_root_effects.push(effect);
614
+ }
615
+ const old_values = /* @__PURE__ */ new Map();
616
+ function source(v, stack) {
617
+ var signal = {
618
+ f: 0,
619
+ // TODO ideally we could skip this altogether, but it causes type errors
620
+ v,
621
+ reactions: null,
622
+ equals,
623
+ rv: 0,
624
+ wv: 0
625
+ };
626
+ return signal;
627
+ }
628
+ // @__NO_SIDE_EFFECTS__
629
+ function state(v, stack) {
630
+ const s = source(v);
631
+ push_reaction_value(s);
632
+ return s;
633
+ }
634
+ // @__NO_SIDE_EFFECTS__
635
+ function mutable_source(initial_value, immutable = false, trackable = true) {
636
+ const s = source(initial_value);
637
+ if (!immutable) {
638
+ s.equals = safe_equals;
639
+ }
640
+ return s;
641
+ }
642
+ function set(source2, value, should_proxy = false) {
643
+ if (active_reaction !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
644
+ // to ensure we error if state is set inside an inspect effect
645
+ (!untracking || (active_reaction.f & INSPECT_EFFECT) !== 0) && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | INSPECT_EFFECT)) !== 0 && !current_sources?.includes(source2)) {
646
+ state_unsafe_mutation();
647
+ }
648
+ let new_value = should_proxy ? proxy(value) : value;
649
+ return internal_set(source2, new_value);
68
650
  }
69
- function pop(component) {
70
- const context_stack_item = component_context;
71
- if (context_stack_item !== null) {
72
- const component_effects = context_stack_item.e;
73
- if (component_effects !== null) {
74
- var previous_effect = active_effect;
75
- var previous_reaction = active_reaction;
76
- context_stack_item.e = null;
77
- try {
78
- for (var i = 0; i < component_effects.length; i++) {
79
- var component_effect = component_effects[i];
80
- set_active_effect(component_effect.effect);
81
- set_active_reaction(component_effect.reaction);
82
- create_user_effect(component_effect.fn);
83
- }
84
- } finally {
85
- set_active_effect(previous_effect);
86
- set_active_reaction(previous_reaction);
651
+ function internal_set(source2, value) {
652
+ if (!source2.equals(value)) {
653
+ var old_value = source2.v;
654
+ if (is_destroying_effect) {
655
+ old_values.set(source2, value);
656
+ } else {
657
+ old_values.set(source2, old_value);
658
+ }
659
+ source2.v = value;
660
+ const batch = Batch.ensure();
661
+ batch.capture(source2, old_value);
662
+ if ((source2.f & DERIVED) !== 0) {
663
+ if ((source2.f & DIRTY) !== 0) {
664
+ execute_derived(
665
+ /** @type {Derived} */
666
+ source2
667
+ );
668
+ }
669
+ set_signal_status(source2, (source2.f & UNOWNED) === 0 ? CLEAN : MAYBE_DIRTY);
670
+ }
671
+ source2.wv = increment_write_version();
672
+ mark_reactions(source2, DIRTY);
673
+ if (active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0) {
674
+ if (untracked_writes === null) {
675
+ set_untracked_writes([source2]);
676
+ } else {
677
+ untracked_writes.push(source2);
87
678
  }
88
679
  }
89
- component_context = context_stack_item.p;
90
- context_stack_item.m = true;
91
680
  }
92
- return (
93
- /** @type {T} */
94
- {}
95
- );
681
+ return value;
96
682
  }
97
- function is_runes() {
98
- return true;
683
+ function increment(source2) {
684
+ set(source2, source2.v + 1);
685
+ }
686
+ function mark_reactions(signal, status) {
687
+ var reactions = signal.reactions;
688
+ if (reactions === null) return;
689
+ var length = reactions.length;
690
+ for (var i = 0; i < length; i++) {
691
+ var reaction = reactions[i];
692
+ var flags = reaction.f;
693
+ if ((flags & DIRTY) === 0) {
694
+ set_signal_status(reaction, status);
695
+ }
696
+ if ((flags & DERIVED) !== 0) {
697
+ mark_reactions(
698
+ /** @type {Derived} */
699
+ reaction,
700
+ MAYBE_DIRTY
701
+ );
702
+ } else if ((flags & DIRTY) === 0) {
703
+ schedule_effect(
704
+ /** @type {Effect} */
705
+ reaction
706
+ );
707
+ }
708
+ }
99
709
  }
100
710
  function proxy(value) {
101
711
  if (typeof value !== "object" || value === null || STATE_SYMBOL in value) {
@@ -108,12 +718,18 @@ function proxy(value) {
108
718
  var sources = /* @__PURE__ */ new Map();
109
719
  var is_proxied_array = is_array(value);
110
720
  var version = /* @__PURE__ */ state(0);
111
- var reaction = active_reaction;
721
+ var parent_version = update_version;
112
722
  var with_parent = (fn) => {
113
- var previous_reaction = active_reaction;
114
- set_active_reaction(reaction);
723
+ if (update_version === parent_version) {
724
+ return fn();
725
+ }
726
+ var reaction = active_reaction;
727
+ var version2 = update_version;
728
+ set_active_reaction(null);
729
+ set_update_version(parent_version);
115
730
  var result = fn();
116
- set_active_reaction(previous_reaction);
731
+ set_active_reaction(reaction);
732
+ set_update_version(version2);
117
733
  return result;
118
734
  };
119
735
  if (is_proxied_array) {
@@ -148,21 +764,11 @@ function proxy(value) {
148
764
  if (prop in target) {
149
765
  const s2 = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED));
150
766
  sources.set(prop, s2);
151
- update_version(version);
767
+ increment(version);
152
768
  }
153
769
  } else {
154
- if (is_proxied_array && typeof prop === "string") {
155
- var ls = (
156
- /** @type {Source<number>} */
157
- sources.get("length")
158
- );
159
- var n = Number(prop);
160
- if (Number.isInteger(n) && n < ls.v) {
161
- set(ls, n);
162
- }
163
- }
164
770
  set(s, UNINITIALIZED);
165
- update_version(version);
771
+ increment(version);
166
772
  }
167
773
  return true;
168
774
  },
@@ -268,193 +874,27 @@ function proxy(value) {
268
874
  set(ls, n + 1);
269
875
  }
270
876
  }
271
- update_version(version);
877
+ increment(version);
272
878
  }
273
879
  return true;
274
880
  },
275
881
  ownKeys(target) {
276
- get(version);
277
- var own_keys = Reflect.ownKeys(target).filter((key2) => {
278
- var source3 = sources.get(key2);
279
- return source3 === void 0 || source3.v !== UNINITIALIZED;
280
- });
281
- for (var [key, source2] of sources) {
282
- if (source2.v !== UNINITIALIZED && !(key in target)) {
283
- own_keys.push(key);
284
- }
285
- }
286
- return own_keys;
287
- },
288
- setPrototypeOf() {
289
- state_prototype_fixed();
290
- }
291
- }
292
- );
293
- }
294
- function update_version(signal, d = 1) {
295
- set(signal, signal.v + d);
296
- }
297
- function destroy_derived_effects(derived) {
298
- var effects = derived.effects;
299
- if (effects !== null) {
300
- derived.effects = null;
301
- for (var i = 0; i < effects.length; i += 1) {
302
- destroy_effect(
303
- /** @type {Effect} */
304
- effects[i]
305
- );
306
- }
307
- }
308
- }
309
- function get_derived_parent_effect(derived) {
310
- var parent = derived.parent;
311
- while (parent !== null) {
312
- if ((parent.f & DERIVED) === 0) {
313
- return (
314
- /** @type {Effect} */
315
- parent
316
- );
317
- }
318
- parent = parent.parent;
319
- }
320
- return null;
321
- }
322
- function execute_derived(derived) {
323
- var value;
324
- var prev_active_effect = active_effect;
325
- set_active_effect(get_derived_parent_effect(derived));
326
- {
327
- try {
328
- destroy_derived_effects(derived);
329
- value = update_reaction(derived);
330
- } finally {
331
- set_active_effect(prev_active_effect);
332
- }
333
- }
334
- return value;
335
- }
336
- function update_derived(derived) {
337
- var value = execute_derived(derived);
338
- if (!derived.equals(value)) {
339
- derived.v = value;
340
- derived.wv = increment_write_version();
341
- }
342
- if (is_destroying_effect) return;
343
- var status = (skip_reaction || (derived.f & UNOWNED) !== 0) && derived.deps !== null ? MAYBE_DIRTY : CLEAN;
344
- set_signal_status(derived, status);
345
- }
346
- const old_values = /* @__PURE__ */ new Map();
347
- function source(v, stack) {
348
- var signal = {
349
- f: 0,
350
- // TODO ideally we could skip this altogether, but it causes type errors
351
- v,
352
- reactions: null,
353
- equals,
354
- rv: 0,
355
- wv: 0
356
- };
357
- return signal;
358
- }
359
- // @__NO_SIDE_EFFECTS__
360
- function state(v, stack) {
361
- const s = source(v);
362
- push_reaction_value(s);
363
- return s;
364
- }
365
- // @__NO_SIDE_EFFECTS__
366
- function mutable_source(initial_value, immutable = false, trackable = true) {
367
- const s = source(initial_value);
368
- if (!immutable) {
369
- s.equals = safe_equals;
370
- }
371
- return s;
372
- }
373
- function set(source2, value, should_proxy = false) {
374
- if (active_reaction !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
375
- // to ensure we error if state is set inside an inspect effect
376
- (!untracking || (active_reaction.f & INSPECT_EFFECT) !== 0) && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT | INSPECT_EFFECT)) !== 0 && !(source_ownership?.reaction === active_reaction && source_ownership.sources.includes(source2))) {
377
- state_unsafe_mutation();
378
- }
379
- let new_value = should_proxy ? proxy(value) : value;
380
- return internal_set(source2, new_value);
381
- }
382
- function internal_set(source2, value) {
383
- if (!source2.equals(value)) {
384
- var old_value = source2.v;
385
- if (is_destroying_effect) {
386
- old_values.set(source2, value);
387
- } else {
388
- old_values.set(source2, old_value);
389
- }
390
- source2.v = value;
391
- if ((source2.f & DERIVED) !== 0) {
392
- if ((source2.f & DIRTY) !== 0) {
393
- execute_derived(
394
- /** @type {Derived} */
395
- source2
396
- );
397
- }
398
- set_signal_status(source2, (source2.f & UNOWNED) === 0 ? CLEAN : MAYBE_DIRTY);
399
- }
400
- source2.wv = increment_write_version();
401
- mark_reactions(source2, DIRTY);
402
- if (active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0) {
403
- if (untracked_writes === null) {
404
- set_untracked_writes([source2]);
405
- } else {
406
- untracked_writes.push(source2);
407
- }
408
- }
409
- }
410
- return value;
411
- }
412
- function mark_reactions(signal, status) {
413
- var reactions = signal.reactions;
414
- if (reactions === null) return;
415
- var length = reactions.length;
416
- for (var i = 0; i < length; i++) {
417
- var reaction = reactions[i];
418
- var flags = reaction.f;
419
- if ((flags & DIRTY) !== 0) continue;
420
- set_signal_status(reaction, status);
421
- if ((flags & (CLEAN | UNOWNED)) !== 0) {
422
- if ((flags & DERIVED) !== 0) {
423
- mark_reactions(
424
- /** @type {Derived} */
425
- reaction,
426
- MAYBE_DIRTY
427
- );
428
- } else {
429
- schedule_effect(
430
- /** @type {Effect} */
431
- reaction
432
- );
433
- }
434
- }
435
- }
436
- }
437
- function hydration_mismatch(location) {
438
- {
439
- console.warn(`https://svelte.dev/e/hydration_mismatch`);
440
- }
441
- }
442
- let hydrating = false;
443
- function set_hydrating(value) {
444
- hydrating = value;
445
- }
446
- let hydrate_node;
447
- function set_hydrate_node(node) {
448
- if (node === null) {
449
- hydration_mismatch();
450
- throw HYDRATION_ERROR;
451
- }
452
- return hydrate_node = node;
453
- }
454
- function hydrate_next() {
455
- return set_hydrate_node(
456
- /** @type {TemplateNode} */
457
- /* @__PURE__ */ get_next_sibling(hydrate_node)
882
+ get(version);
883
+ var own_keys = Reflect.ownKeys(target).filter((key2) => {
884
+ var source3 = sources.get(key2);
885
+ return source3 === void 0 || source3.v !== UNINITIALIZED;
886
+ });
887
+ for (var [key, source2] of sources) {
888
+ if (source2.v !== UNINITIALIZED && !(key in target)) {
889
+ own_keys.push(key);
890
+ }
891
+ }
892
+ return own_keys;
893
+ },
894
+ setPrototypeOf() {
895
+ state_prototype_fixed();
896
+ }
897
+ }
458
898
  );
459
899
  }
460
900
  var $window;
@@ -507,6 +947,9 @@ function push_effect(effect, parent_effect) {
507
947
  }
508
948
  function create_effect(type, fn, sync, push2 = true) {
509
949
  var parent = active_effect;
950
+ if (parent !== null && (parent.f & INERT) !== 0) {
951
+ type |= INERT;
952
+ }
510
953
  var effect = {
511
954
  ctx: component_context,
512
955
  deps: null,
@@ -536,7 +979,7 @@ function create_effect(type, fn, sync, push2 = true) {
536
979
  } else if (fn !== null) {
537
980
  schedule_effect(effect);
538
981
  }
539
- var inert = sync && effect.deps === null && effect.first === null && effect.nodes_start === null && effect.teardown === null && (effect.f & (EFFECT_PRESERVED | BOUNDARY_EFFECT)) === 0;
982
+ var inert = sync && effect.deps === null && effect.first === null && effect.nodes_start === null && effect.teardown === null && (effect.f & EFFECT_PRESERVED) === 0;
540
983
  if (!inert && push2) {
541
984
  if (parent !== null) {
542
985
  push_effect(effect, parent);
@@ -551,16 +994,11 @@ function create_effect(type, fn, sync, push2 = true) {
551
994
  }
552
995
  return effect;
553
996
  }
554
- function teardown(fn) {
555
- const effect = create_effect(RENDER_EFFECT, null, false);
556
- set_signal_status(effect, CLEAN);
557
- effect.teardown = fn;
558
- return effect;
559
- }
560
997
  function create_user_effect(fn) {
561
998
  return create_effect(EFFECT | USER_EFFECT, fn, false);
562
999
  }
563
1000
  function component_root(fn) {
1001
+ Batch.ensure();
564
1002
  const effect = create_effect(ROOT_EFFECT, fn, true);
565
1003
  return (options2 = {}) => {
566
1004
  return new Promise((fulfil) => {
@@ -577,17 +1015,17 @@ function component_root(fn) {
577
1015
  };
578
1016
  }
579
1017
  function branch(fn, push2 = true) {
580
- return create_effect(RENDER_EFFECT | BRANCH_EFFECT, fn, true, push2);
1018
+ return create_effect(BRANCH_EFFECT, fn, true, push2);
581
1019
  }
582
1020
  function execute_effect_teardown(effect) {
583
- var teardown2 = effect.teardown;
584
- if (teardown2 !== null) {
1021
+ var teardown = effect.teardown;
1022
+ if (teardown !== null) {
585
1023
  const previously_destroying_effect = is_destroying_effect;
586
1024
  const previous_reaction = active_reaction;
587
1025
  set_is_destroying_effect(true);
588
1026
  set_active_reaction(null);
589
1027
  try {
590
- teardown2.call(null);
1028
+ teardown.call(null);
591
1029
  } finally {
592
1030
  set_is_destroying_effect(previously_destroying_effect);
593
1031
  set_active_reaction(previous_reaction);
@@ -702,61 +1140,14 @@ function pause_children(effect, transitions, local) {
702
1140
  child = sibling;
703
1141
  }
704
1142
  }
705
- let micro_tasks = [];
706
- let idle_tasks = [];
707
- function run_micro_tasks() {
708
- var tasks = micro_tasks;
709
- micro_tasks = [];
710
- run_all(tasks);
711
- }
712
- function run_idle_tasks() {
713
- var tasks = idle_tasks;
714
- idle_tasks = [];
715
- run_all(tasks);
716
- }
717
- function flush_tasks() {
718
- if (micro_tasks.length > 0) {
719
- run_micro_tasks();
720
- }
721
- if (idle_tasks.length > 0) {
722
- run_idle_tasks();
723
- }
724
- }
725
- function handle_error(error) {
726
- var effect = (
727
- /** @type {Effect} */
728
- active_effect
729
- );
730
- if ((effect.f & EFFECT_RAN) === 0) {
731
- if ((effect.f & BOUNDARY_EFFECT) === 0) {
732
- throw error;
733
- }
734
- effect.fn(error);
735
- } else {
736
- invoke_error_boundary(error, effect);
737
- }
738
- }
739
- function invoke_error_boundary(error, effect) {
740
- while (effect !== null) {
741
- if ((effect.f & BOUNDARY_EFFECT) !== 0) {
742
- try {
743
- effect.b.error(error);
744
- return;
745
- } catch {
746
- }
747
- }
748
- effect = effect.parent;
749
- }
750
- throw error;
751
- }
752
- let is_flushing = false;
753
- let last_scheduled_effect = null;
754
1143
  let is_updating_effect = false;
1144
+ function set_is_updating_effect(value) {
1145
+ is_updating_effect = value;
1146
+ }
755
1147
  let is_destroying_effect = false;
756
1148
  function set_is_destroying_effect(value) {
757
1149
  is_destroying_effect = value;
758
1150
  }
759
- let queued_root_effects = [];
760
1151
  let active_reaction = null;
761
1152
  let untracking = false;
762
1153
  function set_active_reaction(reaction) {
@@ -766,13 +1157,13 @@ let active_effect = null;
766
1157
  function set_active_effect(effect) {
767
1158
  active_effect = effect;
768
1159
  }
769
- let source_ownership = null;
1160
+ let current_sources = null;
770
1161
  function push_reaction_value(value) {
771
- if (active_reaction !== null && active_reaction.f & EFFECT_IS_UPDATING) {
772
- if (source_ownership === null) {
773
- source_ownership = { reaction: active_reaction, sources: [value] };
1162
+ if (active_reaction !== null && true) {
1163
+ if (current_sources === null) {
1164
+ current_sources = [value];
774
1165
  } else {
775
- source_ownership.sources.push(value);
1166
+ current_sources.push(value);
776
1167
  }
777
1168
  }
778
1169
  }
@@ -784,11 +1175,15 @@ function set_untracked_writes(value) {
784
1175
  }
785
1176
  let write_version = 1;
786
1177
  let read_version = 0;
1178
+ let update_version = read_version;
1179
+ function set_update_version(value) {
1180
+ update_version = value;
1181
+ }
787
1182
  let skip_reaction = false;
788
1183
  function increment_write_version() {
789
1184
  return ++write_version;
790
1185
  }
791
- function check_dirtiness(reaction) {
1186
+ function is_dirty(reaction) {
792
1187
  var flags = reaction.f;
793
1188
  if ((flags & DIRTY) !== 0) {
794
1189
  return true;
@@ -802,7 +1197,7 @@ function check_dirtiness(reaction) {
802
1197
  var is_disconnected = (flags & DISCONNECTED) !== 0;
803
1198
  var is_unowned_connected = is_unowned && active_effect !== null && !skip_reaction;
804
1199
  var length = dependencies.length;
805
- if (is_disconnected || is_unowned_connected) {
1200
+ if ((is_disconnected || is_unowned_connected) && (active_effect === null || (active_effect.f & DESTROYED) === 0)) {
806
1201
  var derived = (
807
1202
  /** @type {Derived} */
808
1203
  reaction
@@ -823,7 +1218,7 @@ function check_dirtiness(reaction) {
823
1218
  }
824
1219
  for (i = 0; i < length; i++) {
825
1220
  dependency = dependencies[i];
826
- if (check_dirtiness(
1221
+ if (is_dirty(
827
1222
  /** @type {Derived} */
828
1223
  dependency
829
1224
  )) {
@@ -846,11 +1241,11 @@ function check_dirtiness(reaction) {
846
1241
  function schedule_possible_effect_self_invalidation(signal, effect, root2 = true) {
847
1242
  var reactions = signal.reactions;
848
1243
  if (reactions === null) return;
1244
+ if (current_sources?.includes(signal)) {
1245
+ return;
1246
+ }
849
1247
  for (var i = 0; i < reactions.length; i++) {
850
1248
  var reaction = reactions[i];
851
- if (source_ownership?.reaction === active_reaction && source_ownership.sources.includes(signal)) {
852
- continue;
853
- }
854
1249
  if ((reaction.f & DERIVED) !== 0) {
855
1250
  schedule_possible_effect_self_invalidation(
856
1251
  /** @type {Derived} */
@@ -877,9 +1272,10 @@ function update_reaction(reaction) {
877
1272
  var previous_untracked_writes = untracked_writes;
878
1273
  var previous_reaction = active_reaction;
879
1274
  var previous_skip_reaction = skip_reaction;
880
- var previous_reaction_sources = source_ownership;
1275
+ var previous_sources = current_sources;
881
1276
  var previous_component_context = component_context;
882
1277
  var previous_untracking = untracking;
1278
+ var previous_update_version = update_version;
883
1279
  var flags = reaction.f;
884
1280
  new_deps = /** @type {null | Value[]} */
885
1281
  null;
@@ -887,16 +1283,16 @@ function update_reaction(reaction) {
887
1283
  untracked_writes = null;
888
1284
  skip_reaction = (flags & UNOWNED) !== 0 && (untracking || !is_updating_effect || active_reaction === null);
889
1285
  active_reaction = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null;
890
- source_ownership = null;
1286
+ current_sources = null;
891
1287
  set_component_context(reaction.ctx);
892
1288
  untracking = false;
893
- read_version++;
894
- reaction.f |= EFFECT_IS_UPDATING;
1289
+ update_version = ++read_version;
895
1290
  if (reaction.ac !== null) {
896
1291
  reaction.ac.abort(STALE_REACTION);
897
1292
  reaction.ac = null;
898
1293
  }
899
1294
  try {
1295
+ reaction.f |= REACTION_IS_UPDATING;
900
1296
  var result = (
901
1297
  /** @type {Function} */
902
1298
  (0, reaction.fn)()
@@ -945,19 +1341,23 @@ function update_reaction(reaction) {
945
1341
  }
946
1342
  }
947
1343
  }
1344
+ if ((reaction.f & ERROR_VALUE) !== 0) {
1345
+ reaction.f ^= ERROR_VALUE;
1346
+ }
948
1347
  return result;
949
1348
  } catch (error) {
950
- handle_error(error);
1349
+ return handle_error(error);
951
1350
  } finally {
1351
+ reaction.f ^= REACTION_IS_UPDATING;
952
1352
  new_deps = previous_deps;
953
1353
  skipped_deps = previous_skipped_deps;
954
1354
  untracked_writes = previous_untracked_writes;
955
1355
  active_reaction = previous_reaction;
956
1356
  skip_reaction = previous_skip_reaction;
957
- source_ownership = previous_reaction_sources;
1357
+ current_sources = previous_sources;
958
1358
  set_component_context(previous_component_context);
959
1359
  untracking = previous_untracking;
960
- reaction.f ^= EFFECT_IS_UPDATING;
1360
+ update_version = previous_update_version;
961
1361
  }
962
1362
  }
963
1363
  function remove_reaction(signal, dependency) {
@@ -1017,158 +1417,41 @@ function update_effect(effect) {
1017
1417
  destroy_effect_children(effect);
1018
1418
  }
1019
1419
  execute_effect_teardown(effect);
1020
- var teardown2 = update_reaction(effect);
1021
- effect.teardown = typeof teardown2 === "function" ? teardown2 : null;
1420
+ var teardown = update_reaction(effect);
1421
+ effect.teardown = typeof teardown === "function" ? teardown : null;
1022
1422
  effect.wv = write_version;
1023
1423
  var dep;
1024
1424
  if (DEV && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) ;
1025
- if (DEV) ;
1026
1425
  } finally {
1027
1426
  is_updating_effect = was_updating_effect;
1028
1427
  active_effect = previous_effect;
1029
1428
  }
1030
1429
  }
1031
- function infinite_loop_guard() {
1032
- try {
1033
- effect_update_depth_exceeded();
1034
- } catch (error) {
1035
- if (last_scheduled_effect !== null) {
1036
- {
1037
- invoke_error_boundary(error, last_scheduled_effect);
1038
- }
1039
- } else {
1040
- throw error;
1041
- }
1042
- }
1043
- }
1044
- function flush_queued_root_effects() {
1045
- var was_updating_effect = is_updating_effect;
1046
- try {
1047
- var flush_count = 0;
1048
- is_updating_effect = true;
1049
- while (queued_root_effects.length > 0) {
1050
- if (flush_count++ > 1e3) {
1051
- infinite_loop_guard();
1052
- }
1053
- var root_effects = queued_root_effects;
1054
- var length = root_effects.length;
1055
- queued_root_effects = [];
1056
- for (var i = 0; i < length; i++) {
1057
- var collected_effects = process_effects(root_effects[i]);
1058
- flush_queued_effects(collected_effects);
1059
- }
1060
- old_values.clear();
1061
- }
1062
- } finally {
1063
- is_flushing = false;
1064
- is_updating_effect = was_updating_effect;
1065
- last_scheduled_effect = null;
1066
- }
1067
- }
1068
- function flush_queued_effects(effects) {
1069
- var length = effects.length;
1070
- if (length === 0) return;
1071
- for (var i = 0; i < length; i++) {
1072
- var effect = effects[i];
1073
- if ((effect.f & (DESTROYED | INERT)) === 0) {
1074
- if (check_dirtiness(effect)) {
1075
- var wv = write_version;
1076
- update_effect(effect);
1077
- if (effect.deps === null && effect.first === null && effect.nodes_start === null) {
1078
- if (effect.teardown === null) {
1079
- unlink_effect(effect);
1080
- } else {
1081
- effect.fn = null;
1082
- }
1083
- }
1084
- if (write_version > wv && (effect.f & USER_EFFECT) !== 0) {
1085
- break;
1086
- }
1087
- }
1088
- }
1089
- }
1090
- for (; i < length; i += 1) {
1091
- schedule_effect(effects[i]);
1092
- }
1093
- }
1094
- function schedule_effect(signal) {
1095
- if (!is_flushing) {
1096
- is_flushing = true;
1097
- queueMicrotask(flush_queued_root_effects);
1098
- }
1099
- var effect = last_scheduled_effect = signal;
1100
- while (effect.parent !== null) {
1101
- effect = effect.parent;
1102
- var flags = effect.f;
1103
- if ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {
1104
- if ((flags & CLEAN) === 0) return;
1105
- effect.f ^= CLEAN;
1106
- }
1107
- }
1108
- queued_root_effects.push(effect);
1109
- }
1110
- function process_effects(root2) {
1111
- var effects = [];
1112
- var effect = root2;
1113
- while (effect !== null) {
1114
- var flags = effect.f;
1115
- var is_branch = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0;
1116
- var is_skippable_branch = is_branch && (flags & CLEAN) !== 0;
1117
- if (!is_skippable_branch && (flags & INERT) === 0) {
1118
- if ((flags & EFFECT) !== 0) {
1119
- effects.push(effect);
1120
- } else if (is_branch) {
1121
- effect.f ^= CLEAN;
1122
- } else {
1123
- if (check_dirtiness(effect)) {
1124
- update_effect(effect);
1125
- }
1126
- }
1127
- var child = effect.first;
1128
- if (child !== null) {
1129
- effect = child;
1130
- continue;
1131
- }
1132
- }
1133
- var parent = effect.parent;
1134
- effect = effect.next;
1135
- while (effect === null && parent !== null) {
1136
- effect = parent.next;
1137
- parent = parent.parent;
1138
- }
1139
- }
1140
- return effects;
1141
- }
1142
- function flushSync(fn) {
1143
- var result;
1144
- while (true) {
1145
- flush_tasks();
1146
- if (queued_root_effects.length === 0) {
1147
- is_flushing = false;
1148
- last_scheduled_effect = null;
1149
- return (
1150
- /** @type {T} */
1151
- result
1152
- );
1153
- }
1154
- is_flushing = true;
1155
- flush_queued_root_effects();
1156
- }
1157
- }
1158
1430
  function get(signal) {
1159
1431
  var flags = signal.f;
1160
1432
  var is_derived = (flags & DERIVED) !== 0;
1161
1433
  if (active_reaction !== null && !untracking) {
1162
- if (source_ownership?.reaction !== active_reaction || !source_ownership?.sources.includes(signal)) {
1434
+ var destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0;
1435
+ if (!destroyed && !current_sources?.includes(signal)) {
1163
1436
  var deps = active_reaction.deps;
1164
- if (signal.rv < read_version) {
1165
- signal.rv = read_version;
1166
- if (new_deps === null && deps !== null && deps[skipped_deps] === signal) {
1167
- skipped_deps++;
1168
- } else if (new_deps === null) {
1169
- new_deps = [signal];
1170
- } else if (!skip_reaction || !new_deps.includes(signal)) {
1171
- new_deps.push(signal);
1437
+ if ((active_reaction.f & REACTION_IS_UPDATING) !== 0) {
1438
+ if (signal.rv < read_version) {
1439
+ signal.rv = read_version;
1440
+ if (new_deps === null && deps !== null && deps[skipped_deps] === signal) {
1441
+ skipped_deps++;
1442
+ } else if (new_deps === null) {
1443
+ new_deps = [signal];
1444
+ } else if (!skip_reaction || !new_deps.includes(signal)) {
1445
+ new_deps.push(signal);
1446
+ }
1447
+ }
1448
+ } else {
1449
+ (active_reaction.deps ??= []).push(signal);
1450
+ var reactions = signal.reactions;
1451
+ if (reactions === null) {
1452
+ signal.reactions = [active_reaction];
1453
+ } else if (!reactions.includes(active_reaction)) {
1454
+ reactions.push(active_reaction);
1172
1455
  }
1173
1456
  }
1174
1457
  }
@@ -1184,18 +1467,51 @@ function get(signal) {
1184
1467
  derived.f ^= UNOWNED;
1185
1468
  }
1186
1469
  }
1187
- if (is_derived) {
1470
+ if (is_destroying_effect) {
1471
+ if (old_values.has(signal)) {
1472
+ return old_values.get(signal);
1473
+ }
1474
+ if (is_derived) {
1475
+ derived = /** @type {Derived} */
1476
+ signal;
1477
+ var value = derived.v;
1478
+ if ((derived.f & CLEAN) === 0 && derived.reactions !== null || depends_on_old_values(derived)) {
1479
+ value = execute_derived(derived);
1480
+ }
1481
+ old_values.set(derived, value);
1482
+ return value;
1483
+ }
1484
+ } else if (is_derived) {
1188
1485
  derived = /** @type {Derived} */
1189
1486
  signal;
1190
- if (check_dirtiness(derived)) {
1487
+ if (batch_deriveds?.has(derived)) {
1488
+ return batch_deriveds.get(derived);
1489
+ }
1490
+ if (is_dirty(derived)) {
1191
1491
  update_derived(derived);
1192
1492
  }
1193
1493
  }
1194
- if (is_destroying_effect && old_values.has(signal)) {
1195
- return old_values.get(signal);
1494
+ if ((signal.f & ERROR_VALUE) !== 0) {
1495
+ throw signal.v;
1196
1496
  }
1197
1497
  return signal.v;
1198
1498
  }
1499
+ function depends_on_old_values(derived) {
1500
+ if (derived.v === UNINITIALIZED) return true;
1501
+ if (derived.deps === null) return false;
1502
+ for (const dep of derived.deps) {
1503
+ if (old_values.has(dep)) {
1504
+ return true;
1505
+ }
1506
+ if ((dep.f & DERIVED) !== 0 && depends_on_old_values(
1507
+ /** @type {Derived} */
1508
+ dep
1509
+ )) {
1510
+ return true;
1511
+ }
1512
+ }
1513
+ return false;
1514
+ }
1199
1515
  const STATUS_MASK = -7169;
1200
1516
  function set_signal_status(signal, status) {
1201
1517
  signal.f = signal.f & STATUS_MASK | status;
@@ -1577,32 +1893,33 @@ function Root($$payload, $$props) {
1577
1893
  }
1578
1894
  const Pyramid_1 = constructors[1];
1579
1895
  if (constructors[1]) {
1580
- $$payload.out += "<!--[-->";
1896
+ $$payload.out.push("<!--[-->");
1581
1897
  const Pyramid_0 = constructors[0];
1582
- $$payload.out += `<!---->`;
1898
+ $$payload.out.push(`<!---->`);
1583
1899
  Pyramid_0($$payload, {
1584
1900
  data: data_0,
1585
1901
  form,
1902
+ params: page.params,
1586
1903
  children: ($$payload2) => {
1587
- $$payload2.out += `<!---->`;
1588
- Pyramid_1($$payload2, { data: data_1, form });
1589
- $$payload2.out += `<!---->`;
1904
+ $$payload2.out.push(`<!---->`);
1905
+ Pyramid_1($$payload2, { data: data_1, form, params: page.params });
1906
+ $$payload2.out.push(`<!---->`);
1590
1907
  },
1591
1908
  $$slots: { default: true }
1592
1909
  });
1593
- $$payload.out += `<!---->`;
1910
+ $$payload.out.push(`<!---->`);
1594
1911
  } else {
1595
- $$payload.out += "<!--[!-->";
1912
+ $$payload.out.push("<!--[!-->");
1596
1913
  const Pyramid_0 = constructors[0];
1597
- $$payload.out += `<!---->`;
1598
- Pyramid_0($$payload, { data: data_0, form });
1599
- $$payload.out += `<!---->`;
1914
+ $$payload.out.push(`<!---->`);
1915
+ Pyramid_0($$payload, { data: data_0, form, params: page.params });
1916
+ $$payload.out.push(`<!---->`);
1600
1917
  }
1601
- $$payload.out += `<!--]--> `;
1918
+ $$payload.out.push(`<!--]--> `);
1602
1919
  {
1603
- $$payload.out += "<!--[!-->";
1920
+ $$payload.out.push("<!--[!-->");
1604
1921
  }
1605
- $$payload.out += `<!--]-->`;
1922
+ $$payload.out.push(`<!--]-->`);
1606
1923
  pop$1();
1607
1924
  }
1608
1925
  const root = asClassComponent(Root);
@@ -1692,7 +2009,7 @@ const options = {
1692
2009
  <div class="error">
1693
2010
  <span class="status">` + status + '</span>\n <div class="message">\n <h1>' + message + "</h1>\n </div>\n </div>\n </body>\n</html>\n"
1694
2011
  },
1695
- version_hash: "1p7g1km"
2012
+ version_hash: "vcxt80"
1696
2013
  };
1697
2014
  async function get_hooks() {
1698
2015
  let handle;
@@ -2739,112 +3056,6 @@ function with_event(event, fn) {
2739
3056
  request_event = null;
2740
3057
  }
2741
3058
  }
2742
- class HttpError {
2743
- /**
2744
- * @param {number} status
2745
- * @param {{message: string} extends App.Error ? (App.Error | string | undefined) : App.Error} body
2746
- */
2747
- constructor(status, body2) {
2748
- this.status = status;
2749
- if (typeof body2 === "string") {
2750
- this.body = { message: body2 };
2751
- } else if (body2) {
2752
- this.body = body2;
2753
- } else {
2754
- this.body = { message: `Error: ${status}` };
2755
- }
2756
- }
2757
- toString() {
2758
- return JSON.stringify(this.body);
2759
- }
2760
- }
2761
- class Redirect {
2762
- /**
2763
- * @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308} status
2764
- * @param {string} location
2765
- */
2766
- constructor(status, location) {
2767
- this.status = status;
2768
- this.location = location;
2769
- }
2770
- }
2771
- class SvelteKitError extends Error {
2772
- /**
2773
- * @param {number} status
2774
- * @param {string} text
2775
- * @param {string} message
2776
- */
2777
- constructor(status, text2, message) {
2778
- super(message);
2779
- this.status = status;
2780
- this.text = text2;
2781
- }
2782
- }
2783
- class ActionFailure {
2784
- /**
2785
- * @param {number} status
2786
- * @param {T} data
2787
- */
2788
- constructor(status, data) {
2789
- this.status = status;
2790
- this.data = data;
2791
- }
2792
- }
2793
- const DATA_SUFFIX = "/__data.json";
2794
- const HTML_DATA_SUFFIX = ".html__data.json";
2795
- function has_data_suffix(pathname) {
2796
- return pathname.endsWith(DATA_SUFFIX) || pathname.endsWith(HTML_DATA_SUFFIX);
2797
- }
2798
- function add_data_suffix(pathname) {
2799
- if (pathname.endsWith(".html")) return pathname.replace(/\.html$/, HTML_DATA_SUFFIX);
2800
- return pathname.replace(/\/$/, "") + DATA_SUFFIX;
2801
- }
2802
- function strip_data_suffix(pathname) {
2803
- if (pathname.endsWith(HTML_DATA_SUFFIX)) {
2804
- return pathname.slice(0, -HTML_DATA_SUFFIX.length) + ".html";
2805
- }
2806
- return pathname.slice(0, -DATA_SUFFIX.length);
2807
- }
2808
- const ROUTE_SUFFIX = "/__route.js";
2809
- function has_resolution_suffix(pathname) {
2810
- return pathname.endsWith(ROUTE_SUFFIX);
2811
- }
2812
- function add_resolution_suffix(pathname) {
2813
- return pathname.replace(/\/$/, "") + ROUTE_SUFFIX;
2814
- }
2815
- function strip_resolution_suffix(pathname) {
2816
- return pathname.slice(0, -ROUTE_SUFFIX.length);
2817
- }
2818
- function json(data, init2) {
2819
- const body2 = JSON.stringify(data);
2820
- const headers2 = new Headers(init2?.headers);
2821
- if (!headers2.has("content-length")) {
2822
- headers2.set("content-length", encoder$3.encode(body2).byteLength.toString());
2823
- }
2824
- if (!headers2.has("content-type")) {
2825
- headers2.set("content-type", "application/json");
2826
- }
2827
- return new Response(body2, {
2828
- ...init2,
2829
- headers: headers2
2830
- });
2831
- }
2832
- const encoder$3 = new TextEncoder();
2833
- function text(body2, init2) {
2834
- const headers2 = new Headers(init2?.headers);
2835
- if (!headers2.has("content-length")) {
2836
- const encoded = encoder$3.encode(body2);
2837
- headers2.set("content-length", encoded.byteLength.toString());
2838
- return new Response(encoded, {
2839
- ...init2,
2840
- headers: headers2
2841
- });
2842
- }
2843
- return new Response(body2, {
2844
- ...init2,
2845
- headers: headers2
2846
- });
2847
- }
2848
3059
  function coalesce_to_error(err) {
2849
3060
  return err instanceof Error || err && /** @type {any} */
2850
3061
  err.name && /** @type {any} */
@@ -2855,7 +3066,7 @@ function coalesce_to_error(err) {
2855
3066
  }
2856
3067
  function normalize_error(error) {
2857
3068
  return (
2858
- /** @type {import('../runtime/control.js').Redirect | HttpError | SvelteKitError | Error} */
3069
+ /** @type {import('../exports/internal/index.js').Redirect | HttpError | SvelteKitError | Error} */
2859
3070
  error
2860
3071
  );
2861
3072
  }
@@ -2955,7 +3166,7 @@ function redirect_response(status, location) {
2955
3166
  }
2956
3167
  function clarify_devalue_error(event, error) {
2957
3168
  if (error.path) {
2958
- return `Data returned from \`load\` while rendering ${event.route.id} is not serializable: ${error.message} (${error.path})`;
3169
+ return `Data returned from \`load\` while rendering ${event.route.id} is not serializable: ${error.message} (${error.path}). If you need to serialize/deserialize custom types, use transport hooks: https://svelte.dev/docs/kit/hooks#Universal-hooks-transport.`;
2959
3170
  }
2960
3171
  if (error.path === "") {
2961
3172
  return `Data returned from \`load\` while rendering ${event.route.id} is not a plain object`;
@@ -3063,6 +3274,31 @@ function compact(arr) {
3063
3274
  (val) => val != null
3064
3275
  );
3065
3276
  }
3277
+ const DATA_SUFFIX = "/__data.json";
3278
+ const HTML_DATA_SUFFIX = ".html__data.json";
3279
+ function has_data_suffix(pathname) {
3280
+ return pathname.endsWith(DATA_SUFFIX) || pathname.endsWith(HTML_DATA_SUFFIX);
3281
+ }
3282
+ function add_data_suffix(pathname) {
3283
+ if (pathname.endsWith(".html")) return pathname.replace(/\.html$/, HTML_DATA_SUFFIX);
3284
+ return pathname.replace(/\/$/, "") + DATA_SUFFIX;
3285
+ }
3286
+ function strip_data_suffix(pathname) {
3287
+ if (pathname.endsWith(HTML_DATA_SUFFIX)) {
3288
+ return pathname.slice(0, -HTML_DATA_SUFFIX.length) + ".html";
3289
+ }
3290
+ return pathname.slice(0, -DATA_SUFFIX.length);
3291
+ }
3292
+ const ROUTE_SUFFIX = "/__route.js";
3293
+ function has_resolution_suffix(pathname) {
3294
+ return pathname.endsWith(ROUTE_SUFFIX);
3295
+ }
3296
+ function add_resolution_suffix(pathname) {
3297
+ return pathname.replace(/\/$/, "") + ROUTE_SUFFIX;
3298
+ }
3299
+ function strip_resolution_suffix(pathname) {
3300
+ return pathname.slice(0, -ROUTE_SUFFIX.length);
3301
+ }
3066
3302
  function is_action_json_request(event) {
3067
3303
  const accept = negotiate(event.request.headers.get("accept") ?? "*/*", [
3068
3304
  "application/json",
@@ -5948,10 +6184,7 @@ class Server {
5948
6184
  this.#manifest = manifest;
5949
6185
  }
5950
6186
  /**
5951
- * @param {{
5952
- * env: Record<string, string>;
5953
- * read?: (file: string) => ReadableStream;
5954
- * }} opts
6187
+ * @param {import('@sveltejs/kit').ServerInitOptions} opts
5955
6188
  */
5956
6189
  async init({ env, read }) {
5957
6190
  const prefixes = {
@@ -5965,7 +6198,34 @@ class Server {
5965
6198
  );
5966
6199
  set_safe_public_env(public_env2);
5967
6200
  if (read) {
5968
- set_read_implementation(read);
6201
+ const wrapped_read = (file) => {
6202
+ const result = read(file);
6203
+ if (result instanceof ReadableStream) {
6204
+ return result;
6205
+ } else {
6206
+ return new ReadableStream({
6207
+ async start(controller) {
6208
+ try {
6209
+ const stream = await Promise.resolve(result);
6210
+ if (!stream) {
6211
+ controller.close();
6212
+ return;
6213
+ }
6214
+ const reader = stream.getReader();
6215
+ while (true) {
6216
+ const { done, value } = await reader.read();
6217
+ if (done) break;
6218
+ controller.enqueue(value);
6219
+ }
6220
+ controller.close();
6221
+ } catch (error) {
6222
+ controller.error(error);
6223
+ }
6224
+ }
6225
+ });
6226
+ }
6227
+ };
6228
+ set_read_implementation(wrapped_read);
5969
6229
  }
5970
6230
  await (init_promise ??= (async () => {
5971
6231
  try {