@juspay/shooter 1.23.0 → 1.24.1

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 (349) hide show
  1. package/build/client/_app/immutable/chunks/{DULfdsh6.js → BPIlDnhM.js} +2 -2
  2. package/build/client/_app/immutable/chunks/BPIlDnhM.js.br +0 -0
  3. package/build/client/_app/immutable/chunks/BPIlDnhM.js.gz +0 -0
  4. package/build/client/_app/immutable/chunks/{2rBV5OkJ.js → BQJR1fvD.js} +1 -1
  5. package/build/client/_app/immutable/chunks/BQJR1fvD.js.br +0 -0
  6. package/build/client/_app/immutable/chunks/BQJR1fvD.js.gz +0 -0
  7. package/build/client/_app/immutable/chunks/{DLu6yJIZ.js → BjXFD2Pv.js} +1 -1
  8. package/build/client/_app/immutable/chunks/BjXFD2Pv.js.br +0 -0
  9. package/build/client/_app/immutable/chunks/BjXFD2Pv.js.gz +0 -0
  10. package/build/client/_app/immutable/chunks/BzW0vlVX.js +3 -0
  11. package/build/client/_app/immutable/chunks/BzW0vlVX.js.br +0 -0
  12. package/build/client/_app/immutable/chunks/BzW0vlVX.js.gz +0 -0
  13. package/build/client/_app/immutable/chunks/{BjYr_-Ss.js → CfzjLyJm.js} +1 -1
  14. package/build/client/_app/immutable/chunks/CfzjLyJm.js.br +0 -0
  15. package/build/client/_app/immutable/chunks/CfzjLyJm.js.gz +0 -0
  16. package/build/client/_app/immutable/chunks/{C4Hns_Wl.js → CnsJhNGt.js} +1 -1
  17. package/build/client/_app/immutable/chunks/CnsJhNGt.js.br +0 -0
  18. package/build/client/_app/immutable/chunks/CnsJhNGt.js.gz +0 -0
  19. package/build/client/_app/immutable/chunks/{DomZZqvG.js → DFa6kKPT.js} +1 -1
  20. package/build/client/_app/immutable/chunks/DFa6kKPT.js.br +0 -0
  21. package/build/client/_app/immutable/chunks/DFa6kKPT.js.gz +0 -0
  22. package/build/client/_app/immutable/chunks/{BcpydfqI.js → DcXdn821.js} +1 -1
  23. package/build/client/_app/immutable/chunks/DcXdn821.js.br +0 -0
  24. package/build/client/_app/immutable/chunks/DcXdn821.js.gz +0 -0
  25. package/build/client/_app/immutable/chunks/{fcNfTA-E.js → DjWRwZyr.js} +1 -1
  26. package/build/client/_app/immutable/chunks/DjWRwZyr.js.br +0 -0
  27. package/build/client/_app/immutable/chunks/DjWRwZyr.js.gz +0 -0
  28. package/build/client/_app/immutable/chunks/Dk1NUsIU.js +61 -0
  29. package/build/client/_app/immutable/chunks/Dk1NUsIU.js.br +0 -0
  30. package/build/client/_app/immutable/chunks/Dk1NUsIU.js.gz +0 -0
  31. package/build/client/_app/immutable/chunks/DoGIJDSZ.js +2 -0
  32. package/build/client/_app/immutable/chunks/DoGIJDSZ.js.br +0 -0
  33. package/build/client/_app/immutable/chunks/DoGIJDSZ.js.gz +0 -0
  34. package/build/client/_app/immutable/chunks/{B1bOvemT.js → aiM7Bbhi.js} +8 -8
  35. package/build/client/_app/immutable/chunks/aiM7Bbhi.js.br +0 -0
  36. package/build/client/_app/immutable/chunks/aiM7Bbhi.js.gz +0 -0
  37. package/build/client/_app/immutable/chunks/{CJulw9ux.js → etLjvmY8.js} +1 -1
  38. package/build/client/_app/immutable/chunks/{CJulw9ux.js.br → etLjvmY8.js.br} +0 -0
  39. package/build/client/_app/immutable/chunks/etLjvmY8.js.gz +0 -0
  40. package/build/client/_app/immutable/chunks/kzeZOqU5.js +1 -0
  41. package/build/client/_app/immutable/chunks/kzeZOqU5.js.br +0 -0
  42. package/build/client/_app/immutable/chunks/kzeZOqU5.js.gz +0 -0
  43. package/build/client/_app/immutable/chunks/{i5iZvmIH.js → oIHVoAuz.js} +1 -1
  44. package/build/client/_app/immutable/chunks/oIHVoAuz.js.br +0 -0
  45. package/build/client/_app/immutable/chunks/oIHVoAuz.js.gz +0 -0
  46. package/build/client/_app/immutable/entry/app.9F0rhLIY.js +2 -0
  47. package/build/client/_app/immutable/entry/app.9F0rhLIY.js.br +0 -0
  48. package/build/client/_app/immutable/entry/app.9F0rhLIY.js.gz +0 -0
  49. package/build/client/_app/immutable/entry/start.DGFWmhrj.js +1 -0
  50. package/build/client/_app/immutable/entry/start.DGFWmhrj.js.br +2 -0
  51. package/build/client/_app/immutable/entry/start.DGFWmhrj.js.gz +0 -0
  52. package/build/client/_app/immutable/nodes/{0.Bv_TwEnq.js → 0.MlMcxYLT.js} +1 -1
  53. package/build/client/_app/immutable/nodes/0.MlMcxYLT.js.br +0 -0
  54. package/build/client/_app/immutable/nodes/0.MlMcxYLT.js.gz +0 -0
  55. package/build/client/_app/immutable/nodes/{1.7lffTIeb.js → 1._Bn-HQ9b.js} +1 -1
  56. package/build/client/_app/immutable/nodes/1._Bn-HQ9b.js.br +0 -0
  57. package/build/client/_app/immutable/nodes/1._Bn-HQ9b.js.gz +0 -0
  58. package/build/client/_app/immutable/nodes/{10.ChiIrIDl.js → 10.CsX0V4R9.js} +1 -1
  59. package/build/client/_app/immutable/nodes/10.CsX0V4R9.js.br +0 -0
  60. package/build/client/_app/immutable/nodes/10.CsX0V4R9.js.gz +0 -0
  61. package/build/client/_app/immutable/nodes/{11.DO3vyXEv.js → 11.lM_b6yUv.js} +2 -2
  62. package/build/client/_app/immutable/nodes/11.lM_b6yUv.js.br +0 -0
  63. package/build/client/_app/immutable/nodes/11.lM_b6yUv.js.gz +0 -0
  64. package/build/client/_app/immutable/nodes/{2.iMIqsE7n.js → 2.sAnHf5go.js} +1 -1
  65. package/build/client/_app/immutable/nodes/2.sAnHf5go.js.br +0 -0
  66. package/build/client/_app/immutable/nodes/2.sAnHf5go.js.gz +0 -0
  67. package/build/client/_app/immutable/nodes/{3.CArnSHOO.js → 3.DEHWta3G.js} +1 -1
  68. package/build/client/_app/immutable/nodes/3.DEHWta3G.js.br +0 -0
  69. package/build/client/_app/immutable/nodes/3.DEHWta3G.js.gz +0 -0
  70. package/build/client/_app/immutable/nodes/{4.BFYS2g9C.js → 4.C9fv_m2R.js} +1 -1
  71. package/build/client/_app/immutable/nodes/4.C9fv_m2R.js.br +0 -0
  72. package/build/client/_app/immutable/nodes/4.C9fv_m2R.js.gz +0 -0
  73. package/build/client/_app/immutable/nodes/{5.DziEu9rx.js → 5.vMR5XEA6.js} +1 -1
  74. package/build/client/_app/immutable/nodes/5.vMR5XEA6.js.br +0 -0
  75. package/build/client/_app/immutable/nodes/5.vMR5XEA6.js.gz +0 -0
  76. package/build/client/_app/immutable/nodes/{6.B8l1RwkB.js → 6.-gDjaLSz.js} +1 -1
  77. package/build/client/_app/immutable/nodes/6.-gDjaLSz.js.br +0 -0
  78. package/build/client/_app/immutable/nodes/6.-gDjaLSz.js.gz +0 -0
  79. package/build/client/_app/immutable/nodes/{7.BPyfhDis.js → 7.R-emDnvX.js} +1 -1
  80. package/build/client/_app/immutable/nodes/7.R-emDnvX.js.br +0 -0
  81. package/build/client/_app/immutable/nodes/7.R-emDnvX.js.gz +0 -0
  82. package/build/client/_app/immutable/nodes/{8.D_vszZ9E.js → 8.DXNcFetv.js} +1 -1
  83. package/build/client/_app/immutable/nodes/8.DXNcFetv.js.br +0 -0
  84. package/build/client/_app/immutable/nodes/8.DXNcFetv.js.gz +0 -0
  85. package/build/client/_app/immutable/nodes/{9.Drah-do-.js → 9.Brv6N-Ji.js} +1 -1
  86. package/build/client/_app/immutable/nodes/9.Brv6N-Ji.js.br +0 -0
  87. package/build/client/_app/immutable/nodes/9.Brv6N-Ji.js.gz +0 -0
  88. package/build/client/_app/version.json +1 -1
  89. package/build/client/_app/version.json.br +0 -0
  90. package/build/client/_app/version.json.gz +0 -0
  91. package/build/server/chunks/{0-DAB_6Vm1.js → 0-CezVlDLP.js} +3 -3
  92. package/build/server/chunks/{0-DAB_6Vm1.js.map → 0-CezVlDLP.js.map} +1 -1
  93. package/build/server/chunks/1-CAwGzW00.js +9 -0
  94. package/build/server/chunks/{1-D-qMYaCx.js.map → 1-CAwGzW00.js.map} +1 -1
  95. package/build/server/chunks/10-pqorW2OP.js +9 -0
  96. package/build/server/chunks/{10-CeFFGo-X.js.map → 10-pqorW2OP.js.map} +1 -1
  97. package/build/server/chunks/11-Byxg_lSY.js +9 -0
  98. package/build/server/chunks/{11-DRMu_ATU.js.map → 11-Byxg_lSY.js.map} +1 -1
  99. package/build/server/chunks/{2-B7OLBMNH.js → 2-Bbck5mN2.js} +3 -3
  100. package/build/server/chunks/{2-B7OLBMNH.js.map → 2-Bbck5mN2.js.map} +1 -1
  101. package/build/server/chunks/{3-B38ZarLw.js → 3-BBFbA1P8.js} +3 -3
  102. package/build/server/chunks/{3-B38ZarLw.js.map → 3-BBFbA1P8.js.map} +1 -1
  103. package/build/server/chunks/{4-D92KnTmb.js → 4-w2W_T8ax.js} +3 -3
  104. package/build/server/chunks/{4-D92KnTmb.js.map → 4-w2W_T8ax.js.map} +1 -1
  105. package/build/server/chunks/{5-D-Uv1voC.js → 5-BKDmLKb4.js} +3 -3
  106. package/build/server/chunks/{5-D-Uv1voC.js.map → 5-BKDmLKb4.js.map} +1 -1
  107. package/build/server/chunks/6-BI3p-t3i.js +9 -0
  108. package/build/server/chunks/{6-DP46cUej.js.map → 6-BI3p-t3i.js.map} +1 -1
  109. package/build/server/chunks/7-6XKPVOSu.js +9 -0
  110. package/build/server/chunks/{7-B29_3ar6.js.map → 7-6XKPVOSu.js.map} +1 -1
  111. package/build/server/chunks/8-VOztiJG_.js +9 -0
  112. package/build/server/chunks/{8-DCnSDVrX.js.map → 8-VOztiJG_.js.map} +1 -1
  113. package/build/server/chunks/9-DNUlBLEz.js +9 -0
  114. package/build/server/chunks/{9-BwqDc8wC.js.map → 9-DNUlBLEz.js.map} +1 -1
  115. package/build/server/chunks/{Banner-BgaAs1rs.js → Banner-8zU7JxF6.js} +3 -3
  116. package/build/server/chunks/Banner-8zU7JxF6.js.map +1 -0
  117. package/build/server/chunks/{Button-D0hZ7JYt.js → Button-DmE4ENkb.js} +2 -2
  118. package/build/server/chunks/Button-DmE4ENkb.js.map +1 -0
  119. package/build/server/chunks/{Icon-D0GBnDcs.js → Icon-By4fwUeB.js} +3 -3
  120. package/build/server/chunks/Icon-By4fwUeB.js.map +1 -0
  121. package/build/server/chunks/{Input-OmIiydSx.js → Input-DP3ahKZB.js} +2 -2
  122. package/build/server/chunks/Input-DP3ahKZB.js.map +1 -0
  123. package/build/server/chunks/{Pill-4xJ-VhAA.js → Pill-DwAR6cas.js} +3 -3
  124. package/build/server/chunks/Pill-DwAR6cas.js.map +1 -0
  125. package/build/server/chunks/{Shimmer-Dw2uvTC1.js → Shimmer-Bo1CUNAU.js} +2 -2
  126. package/build/server/chunks/Shimmer-Bo1CUNAU.js.map +1 -0
  127. package/build/server/chunks/{_error.svelte-CZnkxeLr.js → _error.svelte-r3eJvFdN.js} +8 -8
  128. package/build/server/chunks/_error.svelte-r3eJvFdN.js.map +1 -0
  129. package/build/server/chunks/{_layout.svelte-DfgNGGiM.js → _layout.svelte-BlI9weU7.js} +10 -10
  130. package/build/server/chunks/_layout.svelte-BlI9weU7.js.map +1 -0
  131. package/build/server/chunks/{_page.svelte-dabsQl9c.js → _page.svelte-B7_oMI0l.js} +10 -10
  132. package/build/server/chunks/_page.svelte-B7_oMI0l.js.map +1 -0
  133. package/build/server/chunks/{_page.svelte-CWsjjd4l.js → _page.svelte-BB3pLObN.js} +9 -9
  134. package/build/server/chunks/_page.svelte-BB3pLObN.js.map +1 -0
  135. package/build/server/chunks/{_page.svelte-CE7COWnF.js → _page.svelte-BDoNXDBU.js} +7 -7
  136. package/build/server/chunks/_page.svelte-BDoNXDBU.js.map +1 -0
  137. package/build/server/chunks/{_page.svelte-8OFzwdNA.js → _page.svelte-CMryWeEG.js} +11 -11
  138. package/build/server/chunks/_page.svelte-CMryWeEG.js.map +1 -0
  139. package/build/server/chunks/{_page.svelte-D_Ey8QRG.js → _page.svelte-CS4GU4ex.js} +11 -11
  140. package/build/server/chunks/_page.svelte-CS4GU4ex.js.map +1 -0
  141. package/build/server/chunks/{_page.svelte-D5S2hkBk.js → _page.svelte-CUfOc8Hm.js} +9 -9
  142. package/build/server/chunks/{_page.svelte-D5S2hkBk.js.map → _page.svelte-CUfOc8Hm.js.map} +1 -1
  143. package/build/server/chunks/{_page.svelte-BTlfUsBp.js → _page.svelte-Cj5OW0HR.js} +6 -6
  144. package/build/server/chunks/_page.svelte-Cj5OW0HR.js.map +1 -0
  145. package/build/server/chunks/{_page.svelte-Gv9p8nlS.js → _page.svelte-DDE2nChH.js} +6 -6
  146. package/build/server/chunks/_page.svelte-DDE2nChH.js.map +1 -0
  147. package/build/server/chunks/{_page.svelte-BX2FMgSg.js → _page.svelte-svT4jMLg.js} +4 -4
  148. package/build/server/chunks/{_page.svelte-BX2FMgSg.js.map → _page.svelte-svT4jMLg.js.map} +1 -1
  149. package/build/server/chunks/{_page.svelte-C7B0qdrC.js → _page.svelte-vtaZs27Q.js} +5 -5
  150. package/build/server/chunks/_page.svelte-vtaZs27Q.js.map +1 -0
  151. package/build/server/chunks/{_server.ts-Da1kSClZ.js → _server.ts--7PnGah8.js} +3 -3
  152. package/build/server/chunks/{_server.ts-Da1kSClZ.js.map → _server.ts--7PnGah8.js.map} +1 -1
  153. package/build/server/chunks/{_server.ts-Mttr0-Sl.js → _server.ts-57dINphj.js} +2 -2
  154. package/build/server/chunks/{_server.ts-Mttr0-Sl.js.map → _server.ts-57dINphj.js.map} +1 -1
  155. package/build/server/chunks/{_server.ts-BCljU9Sg.js → _server.ts-5ZMeZtad.js} +2 -2
  156. package/build/server/chunks/{_server.ts-BCljU9Sg.js.map → _server.ts-5ZMeZtad.js.map} +1 -1
  157. package/build/server/chunks/{_server.ts-CGqCOCdK.js → _server.ts-ArA8CrYi.js} +2 -2
  158. package/build/server/chunks/{_server.ts-CGqCOCdK.js.map → _server.ts-ArA8CrYi.js.map} +1 -1
  159. package/build/server/chunks/{_server.ts-DPHRUFYS.js → _server.ts-BKqxnNf1.js} +2 -2
  160. package/build/server/chunks/{_server.ts-DPHRUFYS.js.map → _server.ts-BKqxnNf1.js.map} +1 -1
  161. package/build/server/chunks/{_server.ts-BXhmLZwN.js → _server.ts-BTNIhKVv.js} +2 -2
  162. package/build/server/chunks/{_server.ts-BXhmLZwN.js.map → _server.ts-BTNIhKVv.js.map} +1 -1
  163. package/build/server/chunks/{_server.ts-CYWXjihn.js → _server.ts-Bcagaih0.js} +3 -3
  164. package/build/server/chunks/{_server.ts-CYWXjihn.js.map → _server.ts-Bcagaih0.js.map} +1 -1
  165. package/build/server/chunks/{_server.ts-B-evHL2q.js → _server.ts-Bmp-ldee.js} +2 -2
  166. package/build/server/chunks/{_server.ts-B-evHL2q.js.map → _server.ts-Bmp-ldee.js.map} +1 -1
  167. package/build/server/chunks/{_server.ts-QN-Bo5ql.js → _server.ts-BrDK1fJ9.js} +2 -2
  168. package/build/server/chunks/{_server.ts-QN-Bo5ql.js.map → _server.ts-BrDK1fJ9.js.map} +1 -1
  169. package/build/server/chunks/{_server.ts-D9ir7u24.js → _server.ts-C-XPLtdp.js} +2 -2
  170. package/build/server/chunks/{_server.ts-D9ir7u24.js.map → _server.ts-C-XPLtdp.js.map} +1 -1
  171. package/build/server/chunks/{_server.ts-D0___krA.js → _server.ts-C3rA9AOZ.js} +3 -3
  172. package/build/server/chunks/{_server.ts-D0___krA.js.map → _server.ts-C3rA9AOZ.js.map} +1 -1
  173. package/build/server/chunks/{_server.ts-DZvfyuNj.js → _server.ts-CDeJYhn1.js} +2 -2
  174. package/build/server/chunks/{_server.ts-DZvfyuNj.js.map → _server.ts-CDeJYhn1.js.map} +1 -1
  175. package/build/server/chunks/{_server.ts-Blx6TuRU.js → _server.ts-CLxpocw5.js} +3 -3
  176. package/build/server/chunks/{_server.ts-Blx6TuRU.js.map → _server.ts-CLxpocw5.js.map} +1 -1
  177. package/build/server/chunks/{_server.ts-D_WRex0k.js → _server.ts-COpXw9HU.js} +2 -2
  178. package/build/server/chunks/{_server.ts-D_WRex0k.js.map → _server.ts-COpXw9HU.js.map} +1 -1
  179. package/build/server/chunks/{_server.ts-DkZX_O9a.js → _server.ts-CYfsIgGS.js} +2 -2
  180. package/build/server/chunks/{_server.ts-DkZX_O9a.js.map → _server.ts-CYfsIgGS.js.map} +1 -1
  181. package/build/server/chunks/{_server.ts-MbnroWEF.js → _server.ts-CZFcAWEP.js} +2 -2
  182. package/build/server/chunks/{_server.ts-MbnroWEF.js.map → _server.ts-CZFcAWEP.js.map} +1 -1
  183. package/build/server/chunks/{_server.ts-DpRr0Tfh.js → _server.ts-Cm0noZR0.js} +2 -2
  184. package/build/server/chunks/{_server.ts-DpRr0Tfh.js.map → _server.ts-Cm0noZR0.js.map} +1 -1
  185. package/build/server/chunks/{_server.ts-BaaY7Z9D.js → _server.ts-Cu_4i2k1.js} +2 -2
  186. package/build/server/chunks/{_server.ts-BaaY7Z9D.js.map → _server.ts-Cu_4i2k1.js.map} +1 -1
  187. package/build/server/chunks/{_server.ts-BLNDdFWC.js → _server.ts-D2RS8TFd.js} +2 -2
  188. package/build/server/chunks/{_server.ts-BLNDdFWC.js.map → _server.ts-D2RS8TFd.js.map} +1 -1
  189. package/build/server/chunks/{_server.ts-BScvgttw.js → _server.ts-D9_hkPQ6.js} +2 -2
  190. package/build/server/chunks/{_server.ts-BScvgttw.js.map → _server.ts-D9_hkPQ6.js.map} +1 -1
  191. package/build/server/chunks/{_server.ts-BbRSpB74.js → _server.ts-DFI6mMYL.js} +2 -2
  192. package/build/server/chunks/{_server.ts-BbRSpB74.js.map → _server.ts-DFI6mMYL.js.map} +1 -1
  193. package/build/server/chunks/{_server.ts-C6NRpe7e.js → _server.ts-DGPBCKvQ.js} +2 -2
  194. package/build/server/chunks/{_server.ts-C6NRpe7e.js.map → _server.ts-DGPBCKvQ.js.map} +1 -1
  195. package/build/server/chunks/{_server.ts-BB46Fbqn.js → _server.ts-DRRGeb__.js} +2 -2
  196. package/build/server/chunks/{_server.ts-BB46Fbqn.js.map → _server.ts-DRRGeb__.js.map} +1 -1
  197. package/build/server/chunks/{_server.ts-l3cd4Cto.js → _server.ts-DaA9ZSqv.js} +3 -3
  198. package/build/server/chunks/{_server.ts-l3cd4Cto.js.map → _server.ts-DaA9ZSqv.js.map} +1 -1
  199. package/build/server/chunks/{_server.ts-05JJOdcX.js → _server.ts-DfscXcFe.js} +38 -23
  200. package/build/server/chunks/_server.ts-DfscXcFe.js.map +1 -0
  201. package/build/server/chunks/{_server.ts-CVPZOpiv.js → _server.ts-DlGrc8cE.js} +2 -2
  202. package/build/server/chunks/{_server.ts-CVPZOpiv.js.map → _server.ts-DlGrc8cE.js.map} +1 -1
  203. package/build/server/chunks/{_server.ts-C0317RBD.js → _server.ts-DuAA6Ks-.js} +2 -2
  204. package/build/server/chunks/{_server.ts-C0317RBD.js.map → _server.ts-DuAA6Ks-.js.map} +1 -1
  205. package/build/server/chunks/{_server.ts-BTmknWpO.js → _server.ts-EJVmhLtg.js} +2 -2
  206. package/build/server/chunks/{_server.ts-BTmknWpO.js.map → _server.ts-EJVmhLtg.js.map} +1 -1
  207. package/build/server/chunks/{_server.ts-jtqWDWcf.js → _server.ts-NVx03KEN.js} +2 -2
  208. package/build/server/chunks/{_server.ts-jtqWDWcf.js.map → _server.ts-NVx03KEN.js.map} +1 -1
  209. package/build/server/chunks/{_server.ts-W6i3EnGX.js → _server.ts-o_sRQMMS.js} +2 -2
  210. package/build/server/chunks/{_server.ts-W6i3EnGX.js.map → _server.ts-o_sRQMMS.js.map} +1 -1
  211. package/build/server/chunks/{_server.ts-DOGUMzPx.js → _server.ts-v7TaT83B.js} +2 -2
  212. package/build/server/chunks/{_server.ts-DOGUMzPx.js.map → _server.ts-v7TaT83B.js.map} +1 -1
  213. package/build/server/chunks/{cache-BlMaDsHi.js → cache-De-MXr04.js} +2 -2
  214. package/build/server/chunks/cache-De-MXr04.js.map +1 -0
  215. package/build/server/chunks/{client-Ds1brw-8.js → client-dJTdv51U.js} +4 -4
  216. package/build/server/chunks/client-dJTdv51U.js.map +1 -0
  217. package/build/server/chunks/client2-CZlO7zn4.js +7 -0
  218. package/build/server/chunks/{client2-DngLdcUc.js.map → client2-CZlO7zn4.js.map} +1 -1
  219. package/build/server/chunks/{index2-dSGQ9Eaa.js → index-L-OMOXY-.js} +2 -2
  220. package/build/server/chunks/index-L-OMOXY-.js.map +1 -0
  221. package/build/server/chunks/{index-CoD1IJuy.js → index-lhTMmBNn.js} +20 -3
  222. package/build/server/chunks/index-lhTMmBNn.js.map +1 -0
  223. package/build/server/chunks/{index-server-Bq3cnK69.js → index-server-CdDI4vgN.js} +2 -2
  224. package/build/server/chunks/index-server-CdDI4vgN.js.map +1 -0
  225. package/build/server/chunks/{index-CoYB03g7.js → index2-BLq4EEng.js} +1627 -1627
  226. package/build/server/chunks/index2-BLq4EEng.js.map +1 -0
  227. package/build/server/chunks/{pty-manager-DDjG7DlH.js → pty-manager-BsHXoNks.js} +16 -1
  228. package/build/server/chunks/pty-manager-BsHXoNks.js.map +1 -0
  229. package/build/server/chunks/qwen-reader-DGfUbKaJ.js.map +1 -1
  230. package/build/server/chunks/registry-D4J_CuzW.js.map +1 -1
  231. package/build/server/chunks/{root-D4IoFC8F.js → root-Ce8FGAoU.js} +42 -43
  232. package/build/server/chunks/root-Ce8FGAoU.js.map +1 -0
  233. package/build/server/chunks/{state.svelte-CmHqngc_.js → state.svelte-DCKkPJr6.js} +3 -3
  234. package/build/server/chunks/state.svelte-DCKkPJr6.js.map +1 -0
  235. package/build/server/chunks/{stores-CRYxfF0o.js → stores-CVemzLCH.js} +4 -4
  236. package/build/server/chunks/stores-CVemzLCH.js.map +1 -0
  237. package/build/server/index.js +365 -169
  238. package/build/server/index.js.map +1 -1
  239. package/build/server/manifest.js +44 -44
  240. package/build/server/manifest.js.map +1 -1
  241. package/package.json +2 -2
  242. package/server.ts +3 -0
  243. package/src/lib/modules/client/terminal/xterm-wrapper.ts +4 -3
  244. package/src/lib/modules/server/apn/device-token.ts +57 -0
  245. package/src/lib/modules/server/terminal/pty-manager.ts +12 -0
  246. package/src/lib/modules/server/terminal/terminal-store.ts +10 -0
  247. package/src/lib/modules/server/ws/terminal-handler.ts +49 -8
  248. package/src/lib/types/server.ts +7 -0
  249. package/src/lib/types/ws.ts +4 -0
  250. package/src/routes/api/notify/+server.ts +20 -35
  251. package/src/routes/api/terminals/[id]/resize/+server.ts +3 -0
  252. package/build/client/_app/immutable/chunks/2rBV5OkJ.js.br +0 -0
  253. package/build/client/_app/immutable/chunks/2rBV5OkJ.js.gz +0 -0
  254. package/build/client/_app/immutable/chunks/B1bOvemT.js.br +0 -0
  255. package/build/client/_app/immutable/chunks/B1bOvemT.js.gz +0 -0
  256. package/build/client/_app/immutable/chunks/BDcFu3l7.js +0 -61
  257. package/build/client/_app/immutable/chunks/BDcFu3l7.js.br +0 -0
  258. package/build/client/_app/immutable/chunks/BDcFu3l7.js.gz +0 -0
  259. package/build/client/_app/immutable/chunks/BPDiEZo0.js +0 -2
  260. package/build/client/_app/immutable/chunks/BPDiEZo0.js.br +0 -0
  261. package/build/client/_app/immutable/chunks/BPDiEZo0.js.gz +0 -0
  262. package/build/client/_app/immutable/chunks/BcpydfqI.js.br +0 -0
  263. package/build/client/_app/immutable/chunks/BcpydfqI.js.gz +0 -0
  264. package/build/client/_app/immutable/chunks/Bj5wFimK.js +0 -3
  265. package/build/client/_app/immutable/chunks/Bj5wFimK.js.br +0 -0
  266. package/build/client/_app/immutable/chunks/Bj5wFimK.js.gz +0 -0
  267. package/build/client/_app/immutable/chunks/BjYr_-Ss.js.br +0 -0
  268. package/build/client/_app/immutable/chunks/BjYr_-Ss.js.gz +0 -0
  269. package/build/client/_app/immutable/chunks/C4Hns_Wl.js.br +0 -0
  270. package/build/client/_app/immutable/chunks/C4Hns_Wl.js.gz +0 -0
  271. package/build/client/_app/immutable/chunks/CJulw9ux.js.gz +0 -0
  272. package/build/client/_app/immutable/chunks/DLu6yJIZ.js.br +0 -0
  273. package/build/client/_app/immutable/chunks/DLu6yJIZ.js.gz +0 -0
  274. package/build/client/_app/immutable/chunks/DULfdsh6.js.br +0 -0
  275. package/build/client/_app/immutable/chunks/DULfdsh6.js.gz +0 -0
  276. package/build/client/_app/immutable/chunks/DWmC0QM7.js +0 -1
  277. package/build/client/_app/immutable/chunks/DWmC0QM7.js.br +0 -0
  278. package/build/client/_app/immutable/chunks/DWmC0QM7.js.gz +0 -0
  279. package/build/client/_app/immutable/chunks/DomZZqvG.js.br +0 -0
  280. package/build/client/_app/immutable/chunks/DomZZqvG.js.gz +0 -0
  281. package/build/client/_app/immutable/chunks/fcNfTA-E.js.br +0 -0
  282. package/build/client/_app/immutable/chunks/fcNfTA-E.js.gz +0 -0
  283. package/build/client/_app/immutable/chunks/i5iZvmIH.js.br +0 -0
  284. package/build/client/_app/immutable/chunks/i5iZvmIH.js.gz +0 -0
  285. package/build/client/_app/immutable/entry/app.Bvoqymnp.js +0 -2
  286. package/build/client/_app/immutable/entry/app.Bvoqymnp.js.br +0 -0
  287. package/build/client/_app/immutable/entry/app.Bvoqymnp.js.gz +0 -0
  288. package/build/client/_app/immutable/entry/start.BqXCPPZJ.js +0 -1
  289. package/build/client/_app/immutable/entry/start.BqXCPPZJ.js.br +0 -2
  290. package/build/client/_app/immutable/entry/start.BqXCPPZJ.js.gz +0 -0
  291. package/build/client/_app/immutable/nodes/0.Bv_TwEnq.js.br +0 -0
  292. package/build/client/_app/immutable/nodes/0.Bv_TwEnq.js.gz +0 -0
  293. package/build/client/_app/immutable/nodes/1.7lffTIeb.js.br +0 -0
  294. package/build/client/_app/immutable/nodes/1.7lffTIeb.js.gz +0 -0
  295. package/build/client/_app/immutable/nodes/10.ChiIrIDl.js.br +0 -0
  296. package/build/client/_app/immutable/nodes/10.ChiIrIDl.js.gz +0 -0
  297. package/build/client/_app/immutable/nodes/11.DO3vyXEv.js.br +0 -0
  298. package/build/client/_app/immutable/nodes/11.DO3vyXEv.js.gz +0 -0
  299. package/build/client/_app/immutable/nodes/2.iMIqsE7n.js.br +0 -0
  300. package/build/client/_app/immutable/nodes/2.iMIqsE7n.js.gz +0 -0
  301. package/build/client/_app/immutable/nodes/3.CArnSHOO.js.br +0 -0
  302. package/build/client/_app/immutable/nodes/3.CArnSHOO.js.gz +0 -0
  303. package/build/client/_app/immutable/nodes/4.BFYS2g9C.js.br +0 -0
  304. package/build/client/_app/immutable/nodes/4.BFYS2g9C.js.gz +0 -0
  305. package/build/client/_app/immutable/nodes/5.DziEu9rx.js.br +0 -0
  306. package/build/client/_app/immutable/nodes/5.DziEu9rx.js.gz +0 -0
  307. package/build/client/_app/immutable/nodes/6.B8l1RwkB.js.br +0 -0
  308. package/build/client/_app/immutable/nodes/6.B8l1RwkB.js.gz +0 -0
  309. package/build/client/_app/immutable/nodes/7.BPyfhDis.js.br +0 -0
  310. package/build/client/_app/immutable/nodes/7.BPyfhDis.js.gz +0 -0
  311. package/build/client/_app/immutable/nodes/8.D_vszZ9E.js.br +0 -0
  312. package/build/client/_app/immutable/nodes/8.D_vszZ9E.js.gz +0 -0
  313. package/build/client/_app/immutable/nodes/9.Drah-do-.js.br +0 -0
  314. package/build/client/_app/immutable/nodes/9.Drah-do-.js.gz +0 -0
  315. package/build/server/chunks/1-D-qMYaCx.js +0 -9
  316. package/build/server/chunks/10-CeFFGo-X.js +0 -9
  317. package/build/server/chunks/11-DRMu_ATU.js +0 -9
  318. package/build/server/chunks/6-DP46cUej.js +0 -9
  319. package/build/server/chunks/7-B29_3ar6.js +0 -9
  320. package/build/server/chunks/8-DCnSDVrX.js +0 -9
  321. package/build/server/chunks/9-BwqDc8wC.js +0 -9
  322. package/build/server/chunks/Banner-BgaAs1rs.js.map +0 -1
  323. package/build/server/chunks/Button-D0hZ7JYt.js.map +0 -1
  324. package/build/server/chunks/Icon-D0GBnDcs.js.map +0 -1
  325. package/build/server/chunks/Input-OmIiydSx.js.map +0 -1
  326. package/build/server/chunks/Pill-4xJ-VhAA.js.map +0 -1
  327. package/build/server/chunks/Shimmer-Dw2uvTC1.js.map +0 -1
  328. package/build/server/chunks/_error.svelte-CZnkxeLr.js.map +0 -1
  329. package/build/server/chunks/_layout.svelte-DfgNGGiM.js.map +0 -1
  330. package/build/server/chunks/_page.svelte-8OFzwdNA.js.map +0 -1
  331. package/build/server/chunks/_page.svelte-BTlfUsBp.js.map +0 -1
  332. package/build/server/chunks/_page.svelte-C7B0qdrC.js.map +0 -1
  333. package/build/server/chunks/_page.svelte-CE7COWnF.js.map +0 -1
  334. package/build/server/chunks/_page.svelte-CWsjjd4l.js.map +0 -1
  335. package/build/server/chunks/_page.svelte-D_Ey8QRG.js.map +0 -1
  336. package/build/server/chunks/_page.svelte-Gv9p8nlS.js.map +0 -1
  337. package/build/server/chunks/_page.svelte-dabsQl9c.js.map +0 -1
  338. package/build/server/chunks/_server.ts-05JJOdcX.js.map +0 -1
  339. package/build/server/chunks/cache-BlMaDsHi.js.map +0 -1
  340. package/build/server/chunks/client-Ds1brw-8.js.map +0 -1
  341. package/build/server/chunks/client2-DngLdcUc.js +0 -7
  342. package/build/server/chunks/index-CoD1IJuy.js.map +0 -1
  343. package/build/server/chunks/index-CoYB03g7.js.map +0 -1
  344. package/build/server/chunks/index-server-Bq3cnK69.js.map +0 -1
  345. package/build/server/chunks/index2-dSGQ9Eaa.js.map +0 -1
  346. package/build/server/chunks/pty-manager-DDjG7DlH.js.map +0 -1
  347. package/build/server/chunks/root-D4IoFC8F.js.map +0 -1
  348. package/build/server/chunks/state.svelte-CmHqngc_.js.map +0 -1
  349. package/build/server/chunks/stores-CRYxfF0o.js.map +0 -1
@@ -1,4 +1,45 @@
1
1
  const browser = false;
2
+ function lifecycle_outside_component(name) {
3
+ {
4
+ throw new Error(`https://svelte.dev/e/lifecycle_outside_component`);
5
+ }
6
+ }
7
+ function await_invalid() {
8
+ const error = new Error(`await_invalid
9
+ Encountered asynchronous work while rendering synchronously.
10
+ https://svelte.dev/e/await_invalid`);
11
+ error.name = "Svelte error";
12
+ throw error;
13
+ }
14
+ function invalid_csp() {
15
+ const error = new Error(`invalid_csp
16
+ \`csp.nonce\` was set while \`csp.hash\` was \`true\`. These options cannot be used simultaneously.
17
+ https://svelte.dev/e/invalid_csp`);
18
+ error.name = "Svelte error";
19
+ throw error;
20
+ }
21
+ function invalid_id_prefix() {
22
+ const error = new Error(`invalid_id_prefix
23
+ The \`idPrefix\` option cannot include \`--\`.
24
+ https://svelte.dev/e/invalid_id_prefix`);
25
+ error.name = "Svelte error";
26
+ throw error;
27
+ }
28
+ function server_context_required() {
29
+ const error = new Error(`server_context_required
30
+ Could not resolve \`render\` context.
31
+ https://svelte.dev/e/server_context_required`);
32
+ error.name = "Svelte error";
33
+ throw error;
34
+ }
35
+ function get_render_context() {
36
+ const store = als?.getStore();
37
+ {
38
+ server_context_required();
39
+ }
40
+ return store;
41
+ }
42
+ let als = null;
2
43
  const UNDEFINED = -1;
3
44
  const HOLE = -2;
4
45
  const NAN = -3;
@@ -125,7 +166,6 @@ function valid_array_indices(array) {
125
166
  keys.length = i + 1;
126
167
  return keys;
127
168
  }
128
-
129
169
  const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$";
130
170
  const unsafe_chars = /[<\b\f\n\r\t\0\u2028\u2029]/g;
131
171
  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)$/;
@@ -234,7 +274,7 @@ function uneval(value, replacer) {
234
274
  Array.from(counts).filter((entry) => entry[1] > 1).sort((a, b) => b[1] - a[1]).forEach((entry, i) => {
235
275
  names.set(entry[0], get_name(i));
236
276
  });
237
- function stringify2(thing) {
277
+ function stringify(thing) {
238
278
  if (names.has(thing)) {
239
279
  return names.get(thing);
240
280
  }
@@ -250,10 +290,10 @@ function uneval(value, replacer) {
250
290
  case "String":
251
291
  case "Boolean":
252
292
  case "BigInt":
253
- return `Object(${stringify2(thing.valueOf())})`;
293
+ return `Object(${stringify(thing.valueOf())})`;
254
294
  case "RegExp":
255
- const { source: source2, flags } = thing;
256
- return flags ? `new RegExp(${stringify_string(source2)},"${flags}")` : `new RegExp(${stringify_string(source2)})`;
295
+ const { source, flags } = thing;
296
+ return flags ? `new RegExp(${stringify_string(source)},"${flags}")` : `new RegExp(${stringify_string(source)})`;
257
297
  case "Date":
258
298
  return `new Date(${thing.getTime()})`;
259
299
  case "URL":
@@ -266,7 +306,7 @@ function uneval(value, replacer) {
266
306
  for (let i = 0; i < thing.length; i += 1) {
267
307
  if (i > 0) result += ",";
268
308
  if (Object.hasOwn(thing, i)) {
269
- result += stringify2(thing[i]);
309
+ result += stringify(thing[i]);
270
310
  } else if (!has_holes) {
271
311
  const populated_keys = valid_array_indices(
272
312
  /** @type {any[]} */
@@ -277,7 +317,7 @@ function uneval(value, replacer) {
277
317
  const hole_cost = thing.length + 2;
278
318
  const sparse_cost = 25 + d + population * (d + 2);
279
319
  if (hole_cost > sparse_cost) {
280
- const entries = populated_keys.map((k) => `${k}:${stringify2(thing[k])}`).join(",");
320
+ const entries = populated_keys.map((k) => `${k}:${stringify(thing[k])}`).join(",");
281
321
  return `Object.assign(Array(${thing.length}),{${entries}})`;
282
322
  }
283
323
  has_holes = true;
@@ -289,7 +329,7 @@ function uneval(value, replacer) {
289
329
  }
290
330
  case "Set":
291
331
  case "Map":
292
- return `new ${type}([${Array.from(thing).map(stringify2).join(",")}])`;
332
+ return `new ${type}([${Array.from(thing).map(stringify).join(",")}])`;
293
333
  case "Int8Array":
294
334
  case "Uint8Array":
295
335
  case "Uint8ClampedArray":
@@ -307,7 +347,7 @@ function uneval(value, replacer) {
307
347
  const array = new thing.constructor(thing.buffer);
308
348
  str2 += `([${array}])`;
309
349
  } else {
310
- str2 += `(${stringify2(thing.buffer)})`;
350
+ str2 += `(${stringify(thing.buffer)})`;
311
351
  }
312
352
  if (thing.byteLength !== thing.buffer.byteLength) {
313
353
  const start = thing.byteOffset / thing.BYTES_PER_ELEMENT;
@@ -321,7 +361,7 @@ function uneval(value, replacer) {
321
361
  if (!names.has(thing.buffer)) {
322
362
  str2 += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`;
323
363
  } else {
324
- str2 += `(${stringify2(thing.buffer)}`;
364
+ str2 += `(${stringify(thing.buffer)}`;
325
365
  }
326
366
  if (thing.byteLength !== thing.buffer.byteLength) {
327
367
  str2 += `,${thing.startOffset},${thing.byteLength}`;
@@ -343,7 +383,7 @@ function uneval(value, replacer) {
343
383
  return `${type}.from(${stringify_string(thing.toString())})`;
344
384
  default:
345
385
  const keys2 = Object.keys(thing);
346
- const obj = keys2.map((key) => `${safe_key(key)}:${stringify2(thing[key])}`).join(",");
386
+ const obj = keys2.map((key) => `${safe_key(key)}:${stringify(thing[key])}`).join(",");
347
387
  const proto = Object.getPrototypeOf(thing);
348
388
  if (proto === null) {
349
389
  return keys2.length > 0 ? `{${obj},__proto__:null}` : `{__proto__:null}`;
@@ -351,7 +391,7 @@ function uneval(value, replacer) {
351
391
  return `{${obj}}`;
352
392
  }
353
393
  }
354
- const str = stringify2(value);
394
+ const str = stringify(value);
355
395
  if (names.size) {
356
396
  const params = [];
357
397
  const statements = [];
@@ -375,11 +415,11 @@ function uneval(value, replacer) {
375
415
  case "String":
376
416
  case "Boolean":
377
417
  case "BigInt":
378
- values.push(`Object(${stringify2(thing.valueOf())})`);
418
+ values.push(`Object(${stringify(thing.valueOf())})`);
379
419
  break;
380
420
  case "RegExp":
381
- const { source: source2, flags } = thing;
382
- const regexp = flags ? `new RegExp(${stringify_string(source2)},"${flags}")` : `new RegExp(${stringify_string(source2)})`;
421
+ const { source, flags } = thing;
422
+ const regexp = flags ? `new RegExp(${stringify_string(source)},"${flags}")` : `new RegExp(${stringify_string(source)})`;
383
423
  values.push(regexp);
384
424
  break;
385
425
  case "Date":
@@ -394,19 +434,19 @@ function uneval(value, replacer) {
394
434
  case "Array":
395
435
  values.push(`Array(${thing.length})`);
396
436
  thing.forEach((v, i) => {
397
- statements.push(`${name}[${i}]=${stringify2(v)}`);
437
+ statements.push(`${name}[${i}]=${stringify(v)}`);
398
438
  });
399
439
  break;
400
440
  case "Set":
401
441
  values.push(`new Set`);
402
442
  statements.push(
403
- `${name}.${Array.from(thing).map((v) => `add(${stringify2(v)})`).join(".")}`
443
+ `${name}.${Array.from(thing).map((v) => `add(${stringify(v)})`).join(".")}`
404
444
  );
405
445
  break;
406
446
  case "Map":
407
447
  values.push(`new Map`);
408
448
  statements.push(
409
- `${name}.${Array.from(thing).map(([k, v]) => `set(${stringify2(k)}, ${stringify2(v)})`).join(".")}`
449
+ `${name}.${Array.from(thing).map(([k, v]) => `set(${stringify(k)}, ${stringify(v)})`).join(".")}`
410
450
  );
411
451
  break;
412
452
  case "Int8Array":
@@ -426,7 +466,7 @@ function uneval(value, replacer) {
426
466
  const array = new thing.constructor(thing.buffer);
427
467
  str2 += `([${array}])`;
428
468
  } else {
429
- str2 += `(${stringify2(thing.buffer)})`;
469
+ str2 += `(${stringify(thing.buffer)})`;
430
470
  }
431
471
  if (thing.byteLength !== thing.buffer.byteLength) {
432
472
  const start = thing.byteOffset / thing.BYTES_PER_ELEMENT;
@@ -442,7 +482,7 @@ function uneval(value, replacer) {
442
482
  if (!names.has(thing.buffer)) {
443
483
  str2 += `(new Uint8Array([${new Uint8Array(thing.buffer)}]).buffer`;
444
484
  } else {
445
- str2 += `(${stringify2(thing.buffer)}`;
485
+ str2 += `(${stringify(thing.buffer)}`;
446
486
  }
447
487
  if (thing.byteLength !== thing.buffer.byteLength) {
448
488
  str2 += `,${thing.byteOffset},${thing.byteLength}`;
@@ -458,7 +498,7 @@ function uneval(value, replacer) {
458
498
  default:
459
499
  values.push(Object.getPrototypeOf(thing) === null ? "Object.create(null)" : "{}");
460
500
  Object.keys(thing).forEach((key) => {
461
- statements.push(`${name}${safe_prop(key)}=${stringify2(thing[key])}`);
501
+ statements.push(`${name}${safe_prop(key)}=${stringify(thing[key])}`);
462
502
  });
463
503
  }
464
504
  });
@@ -498,42 +538,7 @@ function stringify_primitive(thing) {
498
538
  if (type === "bigint") return thing + "n";
499
539
  return str;
500
540
  }
501
- var is_array = Array.isArray;
502
- var index_of = Array.prototype.indexOf;
503
- var includes = Array.prototype.includes;
504
- var array_from = Array.from;
505
- var define_property = Object.defineProperty;
506
- var get_descriptor = Object.getOwnPropertyDescriptor;
507
- var object_prototype = Object.prototype;
508
- var array_prototype = Array.prototype;
509
- var get_prototype_of = Object.getPrototypeOf;
510
- var is_extensible = Object.isExtensible;
511
- var has_own_property = Object.prototype.hasOwnProperty;
512
- const noop = () => {
513
- };
514
- function run_all(arr) {
515
- for (var i = 0; i < arr.length; i++) {
516
- arr[i]();
517
- }
518
- }
519
- function deferred() {
520
- var resolve;
521
- var reject;
522
- var promise = new Promise((res, rej) => {
523
- resolve = res;
524
- reject = rej;
525
- });
526
- return { promise, resolve, reject };
527
- }
528
- function equals(value) {
529
- return value === this.v;
530
- }
531
- function safe_not_equal(a, b) {
532
- return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function";
533
- }
534
- function safe_equals(value) {
535
- return !safe_not_equal(value, this.v);
536
- }
541
+
537
542
  const DERIVED = 1 << 1;
538
543
  const EFFECT = 1 << 2;
539
544
  const RENDER_EFFECT = 1 << 3;
@@ -570,11 +575,42 @@ const STALE_REACTION = new class StaleReactionError extends Error {
570
575
  message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
571
576
  }();
572
577
  const COMMENT_NODE = 8;
573
- function lifecycle_outside_component(name) {
574
- {
575
- throw new Error(`https://svelte.dev/e/lifecycle_outside_component`);
578
+ var is_array = Array.isArray;
579
+ var index_of = Array.prototype.indexOf;
580
+ var includes = Array.prototype.includes;
581
+ var array_from = Array.from;
582
+ var define_property = Object.defineProperty;
583
+ var get_descriptor = Object.getOwnPropertyDescriptor;
584
+ var object_prototype = Object.prototype;
585
+ var array_prototype = Array.prototype;
586
+ var get_prototype_of = Object.getPrototypeOf;
587
+ var is_extensible = Object.isExtensible;
588
+ var has_own_property = Object.prototype.hasOwnProperty;
589
+ const noop = () => {
590
+ };
591
+ function run_all(arr) {
592
+ for (var i = 0; i < arr.length; i++) {
593
+ arr[i]();
576
594
  }
577
595
  }
596
+ function deferred() {
597
+ var resolve;
598
+ var reject;
599
+ var promise = new Promise((res, rej) => {
600
+ resolve = res;
601
+ reject = rej;
602
+ });
603
+ return { promise, resolve, reject };
604
+ }
605
+ function equals(value) {
606
+ return value === this.v;
607
+ }
608
+ function safe_not_equal(a, b) {
609
+ return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function";
610
+ }
611
+ function safe_equals(value) {
612
+ return !safe_not_equal(value, this.v);
613
+ }
578
614
  function effect_update_depth_exceeded() {
579
615
  {
580
616
  throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
@@ -605,6 +641,7 @@ function svelte_boundary_reset_onerror() {
605
641
  throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
606
642
  }
607
643
  }
644
+ let tracing_mode_flag = false;
608
645
  const HYDRATION_START = "[";
609
646
  const HYDRATION_START_ELSE = "[!";
610
647
  const HYDRATION_START_FAILED = "[?";
@@ -614,22 +651,6 @@ const ELEMENT_IS_NAMESPACED = 1;
614
651
  const ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1;
615
652
  const ELEMENT_IS_INPUT = 1 << 2;
616
653
  const UNINITIALIZED = /* @__PURE__ */ Symbol();
617
- function derived_inert() {
618
- {
619
- console.warn(`https://svelte.dev/e/derived_inert`);
620
- }
621
- }
622
- function hydration_mismatch(location) {
623
- {
624
- console.warn(`https://svelte.dev/e/hydration_mismatch`);
625
- }
626
- }
627
- function svelte_boundary_reset_noop() {
628
- {
629
- console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
630
- }
631
- }
632
- let tracing_mode_flag = false;
633
654
  let component_context = null;
634
655
  function set_component_context(context) {
635
656
  component_context = context;
@@ -691,1535 +712,1321 @@ function flush_tasks() {
691
712
  run_micro_tasks();
692
713
  }
693
714
  }
694
- function handle_error(error) {
695
- var effect = active_effect;
696
- if (effect === null) {
697
- active_reaction.f |= ERROR_VALUE;
698
- return error;
699
- }
700
- if ((effect.f & REACTION_RAN) === 0 && (effect.f & EFFECT) === 0) {
701
- throw error;
715
+ function derived_inert() {
716
+ {
717
+ console.warn(`https://svelte.dev/e/derived_inert`);
702
718
  }
703
- invoke_error_boundary(error, effect);
704
719
  }
705
- function invoke_error_boundary(error, effect) {
706
- while (effect !== null) {
707
- if ((effect.f & BOUNDARY_EFFECT) !== 0) {
708
- if ((effect.f & REACTION_RAN) === 0) {
709
- throw error;
710
- }
711
- try {
712
- effect.b.error(error);
713
- return;
714
- } catch (e) {
715
- error = e;
716
- }
717
- }
718
- effect = effect.parent;
720
+ function hydration_mismatch(location) {
721
+ {
722
+ console.warn(`https://svelte.dev/e/hydration_mismatch`);
719
723
  }
720
- throw error;
721
- }
722
- const STATUS_MASK = -7169;
723
- function set_signal_status(signal, status) {
724
- signal.f = signal.f & STATUS_MASK | status;
725
724
  }
726
- function update_derived_status(derived2) {
727
- if ((derived2.f & CONNECTED) !== 0 || derived2.deps === null) {
728
- set_signal_status(derived2, CLEAN);
729
- } else {
730
- set_signal_status(derived2, MAYBE_DIRTY);
725
+ function svelte_boundary_reset_noop() {
726
+ {
727
+ console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
731
728
  }
732
729
  }
733
- function clear_marked(deps) {
734
- if (deps === null) return;
735
- for (const dep of deps) {
736
- if ((dep.f & DERIVED) === 0 || (dep.f & WAS_MARKED) === 0) {
737
- continue;
738
- }
739
- dep.f ^= WAS_MARKED;
740
- clear_marked(
741
- /** @type {Derived} */
742
- dep.deps
743
- );
730
+ function proxy(value) {
731
+ if (typeof value !== "object" || value === null || STATE_SYMBOL in value) {
732
+ return value;
744
733
  }
745
- }
746
- function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
747
- if ((effect.f & DIRTY) !== 0) {
748
- dirty_effects.add(effect);
749
- } else if ((effect.f & MAYBE_DIRTY) !== 0) {
750
- maybe_dirty_effects.add(effect);
734
+ const prototype = get_prototype_of(value);
735
+ if (prototype !== object_prototype && prototype !== array_prototype) {
736
+ return value;
751
737
  }
752
- clear_marked(effect.deps);
753
- set_signal_status(effect, CLEAN);
754
- }
755
- let first_batch = null;
756
- let last_batch = null;
757
- let current_batch = null;
758
- let previous_batch = null;
759
- let batch_values = null;
760
- let last_scheduled_effect = null;
761
- let is_flushing_sync = false;
762
- let is_processing = false;
763
- let collected_effects = null;
764
- let legacy_updates = null;
765
- var flush_count = 0;
766
- let uid = 1;
767
- class Batch {
768
- id = uid++;
769
- /** True as soon as `#process` was called */
770
- #started = false;
771
- linked = true;
772
- /** @type {Batch | null} */
773
- #prev = null;
774
- /** @type {Batch | null} */
775
- #next = null;
776
- /** @type {Map<Effect, ReturnType<typeof deferred<any>>>} */
777
- async_deriveds = /* @__PURE__ */ new Map();
778
- /**
779
- * The current values of any signals that are updated in this batch.
780
- * Tuple format: [value, is_derived] (note: is_derived is false for deriveds, too, if they were overridden via assignment)
781
- * They keys of this map are identical to `this.#previous`
782
- * @type {Map<Value, [any, boolean]>}
783
- */
784
- current = /* @__PURE__ */ new Map();
785
- /**
786
- * The values of any signals (sources and deriveds) that are updated in this batch _before_ those updates took place.
787
- * They keys of this map are identical to `this.#current`
788
- * @type {Map<Value, any>}
789
- */
790
- previous = /* @__PURE__ */ new Map();
791
- /**
792
- * Async effects which this batch doesn't take into account anymore when calculating blockers,
793
- * as it has a value for it already.
794
- * @type {Set<Effect>}
795
- */
796
- unblocked = /* @__PURE__ */ new Set();
797
- /**
798
- * When the batch is committed (and the DOM is updated), we need to remove old branches
799
- * and append new ones by calling the functions added inside (if/each/key/etc) blocks
800
- * @type {Set<(batch: Batch) => void>}
801
- */
802
- #commit_callbacks = /* @__PURE__ */ new Set();
803
- /**
804
- * If a fork is discarded, we need to destroy any effects that are no longer needed
805
- * @type {Set<(batch: Batch) => void>}
806
- */
807
- #discard_callbacks = /* @__PURE__ */ new Set();
808
- /**
809
- * Callbacks that should run only when a fork is committed.
810
- * @type {Set<(batch: Batch) => void>}
811
- */
812
- #fork_commit_callbacks = /* @__PURE__ */ new Set();
813
- /**
814
- * The number of async effects that are currently in flight
815
- */
816
- #pending = 0;
817
- /**
818
- * Async effects that are currently in flight, _not_ inside a pending boundary
819
- * @type {Map<Effect, number>}
820
- */
821
- #blocking_pending = /* @__PURE__ */ new Map();
822
- /**
823
- * A deferred that resolves when the batch is committed, used with `settled()`
824
- * TODO replace with Promise.withResolvers once supported widely enough
825
- * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
826
- */
827
- #deferred = null;
828
- /**
829
- * The root effects that need to be flushed
830
- * @type {Effect[]}
831
- */
832
- #roots = [];
833
- /**
834
- * Effects created while this batch was active.
835
- * @type {Effect[]}
836
- */
837
- #new_effects = [];
838
- /**
839
- * Deferred effects (which run after async work has completed) that are DIRTY
840
- * @type {Set<Effect>}
841
- */
842
- #dirty_effects = /* @__PURE__ */ new Set();
843
- /**
844
- * Deferred effects that are MAYBE_DIRTY
845
- * @type {Set<Effect>}
846
- */
847
- #maybe_dirty_effects = /* @__PURE__ */ new Set();
848
- /**
849
- * A map of branches that still exist, but will be destroyed when this batch
850
- * is committed — we skip over these during `process`.
851
- * The value contains child effects that were dirty/maybe_dirty before being reset,
852
- * so they can be rescheduled if the branch survives.
853
- * @type {Map<Effect, { d: Effect[], m: Effect[] }>}
854
- */
855
- #skipped_branches = /* @__PURE__ */ new Map();
856
- /**
857
- * Inverse of #skipped_branches which we need to tell prior batches to unskip them when committing
858
- * @type {Set<Effect>}
859
- */
860
- #unskipped_branches = /* @__PURE__ */ new Set();
861
- is_fork = false;
862
- #decrement_queued = false;
863
- #is_deferred() {
864
- if (this.is_fork) return true;
865
- for (const effect of this.#blocking_pending.keys()) {
866
- var e = effect;
867
- var skipped = false;
868
- while (e.parent !== null) {
869
- if (this.#skipped_branches.has(e)) {
870
- skipped = true;
871
- break;
872
- }
873
- e = e.parent;
874
- }
875
- if (!skipped) {
876
- return true;
877
- }
878
- }
879
- return false;
880
- }
881
- /**
882
- * Add an effect to the #skipped_branches map and reset its children
883
- * @param {Effect} effect
884
- */
885
- skip_effect(effect) {
886
- if (!this.#skipped_branches.has(effect)) {
887
- this.#skipped_branches.set(effect, { d: [], m: [] });
888
- }
889
- this.#unskipped_branches.delete(effect);
890
- }
891
- /**
892
- * Remove an effect from the #skipped_branches map and reschedule
893
- * any tracked dirty/maybe_dirty child effects
894
- * @param {Effect} effect
895
- * @param {(e: Effect) => void} callback
896
- */
897
- unskip_effect(effect, callback = (e) => this.schedule(e)) {
898
- var tracked = this.#skipped_branches.get(effect);
899
- if (tracked) {
900
- this.#skipped_branches.delete(effect);
901
- for (var e of tracked.d) {
902
- set_signal_status(e, DIRTY);
903
- callback(e);
904
- }
905
- for (e of tracked.m) {
906
- set_signal_status(e, MAYBE_DIRTY);
907
- callback(e);
908
- }
909
- }
910
- this.#unskipped_branches.add(effect);
911
- }
912
- #process() {
913
- this.#started = true;
914
- if (flush_count++ > 1e3) {
915
- this.#unlink();
916
- infinite_loop_guard();
917
- }
918
- if (!this.#is_deferred()) {
919
- for (const e of this.#dirty_effects) {
920
- this.#maybe_dirty_effects.delete(e);
921
- set_signal_status(e, DIRTY);
922
- this.schedule(e);
923
- }
924
- for (const e of this.#maybe_dirty_effects) {
925
- set_signal_status(e, MAYBE_DIRTY);
926
- this.schedule(e);
927
- }
928
- }
929
- const roots = this.#roots;
930
- this.#roots = [];
931
- this.apply();
932
- var effects = collected_effects = [];
933
- var render_effects = [];
934
- var updates = legacy_updates = [];
935
- for (const root of roots) {
936
- try {
937
- this.#traverse(root, effects, render_effects);
938
- } catch (e) {
939
- reset_all(root);
940
- throw e;
941
- }
942
- }
943
- current_batch = null;
944
- if (updates.length > 0) {
945
- var batch = Batch.ensure();
946
- for (const e of updates) {
947
- batch.schedule(e);
948
- }
949
- }
950
- collected_effects = null;
951
- legacy_updates = null;
952
- if (this.#is_deferred()) {
953
- this.#defer_effects(render_effects);
954
- this.#defer_effects(effects);
955
- for (const [e, t] of this.#skipped_branches) {
956
- reset_branch(e, t);
957
- }
958
- if (updates.length > 0) {
959
- /** @type {unknown} */
960
- current_batch.#process();
961
- }
962
- return;
963
- }
964
- const earlier_batch = this.#find_earlier_batch();
965
- if (earlier_batch) {
966
- earlier_batch.#merge(this);
967
- return;
968
- }
969
- this.#dirty_effects.clear();
970
- this.#maybe_dirty_effects.clear();
971
- for (const fn of this.#commit_callbacks) fn(this);
972
- this.#commit_callbacks.clear();
973
- previous_batch = this;
974
- flush_queued_effects(render_effects);
975
- flush_queued_effects(effects);
976
- previous_batch = null;
977
- this.#deferred?.resolve();
978
- var next_batch = (
979
- /** @type {Batch | null} */
980
- /** @type {unknown} */
981
- current_batch
982
- );
983
- if (this.linked && this.#pending === 0) {
984
- this.#unlink();
985
- }
986
- if (this.#roots.length > 0) {
987
- if (next_batch === null) {
988
- next_batch = this;
989
- this.#link();
990
- }
991
- const batch2 = next_batch;
992
- batch2.#roots.push(...this.#roots.filter((r2) => !batch2.#roots.includes(r2)));
993
- }
994
- if (next_batch !== null) {
995
- next_batch.#process();
996
- }
997
- }
998
- /**
999
- * Traverse the effect tree, executing effects or stashing
1000
- * them for later execution as appropriate
1001
- * @param {Effect} root
1002
- * @param {Effect[]} effects
1003
- * @param {Effect[]} render_effects
1004
- */
1005
- #traverse(root, effects, render_effects) {
1006
- root.f ^= CLEAN;
1007
- var effect = root.first;
1008
- while (effect !== null) {
1009
- var flags = effect.f;
1010
- var is_branch = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0;
1011
- var is_skippable_branch = is_branch && (flags & CLEAN) !== 0;
1012
- var skip = is_skippable_branch || (flags & INERT) !== 0 || this.#skipped_branches.has(effect);
1013
- if (!skip && effect.fn !== null) {
1014
- if (is_branch) {
1015
- effect.f ^= CLEAN;
1016
- } else if ((flags & EFFECT) !== 0) {
1017
- effects.push(effect);
1018
- } else if (is_dirty(effect)) {
1019
- if ((flags & BLOCK_EFFECT) !== 0) this.#maybe_dirty_effects.add(effect);
1020
- update_effect(effect);
1021
- }
1022
- var child = effect.first;
1023
- if (child !== null) {
1024
- effect = child;
1025
- continue;
1026
- }
1027
- }
1028
- while (effect !== null) {
1029
- var next = effect.next;
1030
- if (next !== null) {
1031
- effect = next;
1032
- break;
1033
- }
1034
- effect = effect.parent;
1035
- }
1036
- }
1037
- }
1038
- #find_earlier_batch() {
1039
- var batch = this.#prev;
1040
- while (batch !== null) {
1041
- if (!batch.is_fork) {
1042
- for (const [value, [, is_derived]] of this.current) {
1043
- if (batch.current.has(value) && !is_derived) {
1044
- return batch;
1045
- }
1046
- }
1047
- }
1048
- batch = batch.#prev;
1049
- }
1050
- return null;
1051
- }
1052
- /**
1053
- * @param {Batch} batch
1054
- */
1055
- #merge(batch) {
1056
- for (const [source2, value] of batch.current) {
1057
- if (!this.previous.has(source2) && batch.previous.has(source2)) {
1058
- this.previous.set(source2, batch.previous.get(source2));
1059
- }
1060
- this.current.set(source2, value);
1061
- }
1062
- for (const [effect, deferred2] of batch.async_deriveds) {
1063
- const d = this.async_deriveds.get(effect);
1064
- if (d) deferred2.promise.then(d.resolve);
1065
- }
1066
- const mark = (value) => {
1067
- var reactions = value.reactions;
1068
- if (reactions === null) return;
1069
- for (const reaction of reactions) {
1070
- var flags = reaction.f;
1071
- if ((flags & DERIVED) !== 0) {
1072
- mark(
1073
- /** @type {Derived} */
1074
- reaction
1075
- );
1076
- } else {
1077
- var effect = (
1078
- /** @type {Effect} */
1079
- reaction
1080
- );
1081
- if (flags & (ASYNC | BLOCK_EFFECT) && !this.async_deriveds.has(effect)) {
1082
- this.#maybe_dirty_effects.delete(effect);
1083
- set_signal_status(effect, DIRTY);
1084
- this.schedule(effect);
1085
- }
1086
- }
1087
- }
1088
- };
1089
- for (const source2 of this.current.keys()) {
1090
- mark(source2);
1091
- }
1092
- this.oncommit(() => batch.discard());
1093
- batch.#unlink();
1094
- current_batch = this;
1095
- this.#process();
1096
- }
1097
- /**
1098
- * @param {Effect[]} effects
1099
- */
1100
- #defer_effects(effects) {
1101
- for (var i = 0; i < effects.length; i += 1) {
1102
- defer_effect(effects[i], this.#dirty_effects, this.#maybe_dirty_effects);
1103
- }
1104
- }
1105
- /**
1106
- * Associate a change to a given source with the current
1107
- * batch, noting its previous and current values
1108
- * @param {Value} source
1109
- * @param {any} value
1110
- * @param {boolean} [is_derived]
1111
- */
1112
- capture(source2, value, is_derived = false) {
1113
- if (source2.v !== UNINITIALIZED && !this.previous.has(source2)) {
1114
- this.previous.set(source2, source2.v);
1115
- }
1116
- if ((source2.f & ERROR_VALUE) === 0) {
1117
- this.current.set(source2, [value, is_derived]);
1118
- batch_values?.set(source2, value);
1119
- }
1120
- if (!this.is_fork) {
1121
- source2.v = value;
1122
- }
1123
- }
1124
- activate() {
1125
- current_batch = this;
1126
- }
1127
- deactivate() {
1128
- current_batch = null;
1129
- batch_values = null;
1130
- }
1131
- flush() {
1132
- try {
1133
- if (browser) ;
1134
- is_processing = true;
1135
- current_batch = this;
1136
- this.#process();
1137
- } finally {
1138
- flush_count = 0;
1139
- last_scheduled_effect = null;
1140
- collected_effects = null;
1141
- legacy_updates = null;
1142
- is_processing = false;
1143
- current_batch = null;
1144
- batch_values = null;
1145
- old_values.clear();
738
+ var sources = /* @__PURE__ */ new Map();
739
+ var is_proxied_array = is_array(value);
740
+ var version = /* @__PURE__ */ state(0);
741
+ var parent_version = update_version;
742
+ var with_parent = (fn) => {
743
+ if (update_version === parent_version) {
744
+ return fn();
1146
745
  }
746
+ var reaction = active_reaction;
747
+ var version2 = update_version;
748
+ set_active_reaction(null);
749
+ set_update_version(parent_version);
750
+ var result = fn();
751
+ set_active_reaction(reaction);
752
+ set_update_version(version2);
753
+ return result;
754
+ };
755
+ if (is_proxied_array) {
756
+ sources.set("length", /* @__PURE__ */ state(
757
+ /** @type {any[]} */
758
+ value.length
759
+ ));
1147
760
  }
1148
- discard() {
1149
- for (const fn of this.#discard_callbacks) fn(this);
1150
- this.#discard_callbacks.clear();
1151
- this.#fork_commit_callbacks.clear();
1152
- this.#unlink();
1153
- }
1154
- /**
1155
- * @param {Effect} effect
1156
- */
1157
- register_created_effect(effect) {
1158
- this.#new_effects.push(effect);
1159
- }
1160
- #commit() {
1161
- this.#unlink();
1162
- for (let batch = first_batch; batch !== null; batch = batch.#next) {
1163
- var is_earlier = batch.id < this.id;
1164
- var sources = [];
1165
- for (const [source3, [value, is_derived]] of this.current) {
1166
- if (batch.current.has(source3)) {
1167
- var batch_value = (
1168
- /** @type {[any, boolean]} */
1169
- batch.current.get(source3)[0]
1170
- );
1171
- if (is_earlier && value !== batch_value) {
1172
- batch.current.set(source3, [value, is_derived]);
1173
- } else {
1174
- continue;
761
+ return new Proxy(
762
+ /** @type {any} */
763
+ value,
764
+ {
765
+ defineProperty(_, prop, descriptor) {
766
+ if (!("value" in descriptor) || descriptor.configurable === false || descriptor.enumerable === false || descriptor.writable === false) {
767
+ state_descriptors_fixed();
768
+ }
769
+ var s = sources.get(prop);
770
+ if (s === void 0) {
771
+ with_parent(() => {
772
+ var s2 = /* @__PURE__ */ state(descriptor.value);
773
+ sources.set(prop, s2);
774
+ return s2;
775
+ });
776
+ } else {
777
+ set(s, descriptor.value, true);
778
+ }
779
+ return true;
780
+ },
781
+ deleteProperty(target, prop) {
782
+ var s = sources.get(prop);
783
+ if (s === void 0) {
784
+ if (prop in target) {
785
+ const s2 = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED));
786
+ sources.set(prop, s2);
787
+ increment(version);
1175
788
  }
789
+ } else {
790
+ set(s, UNINITIALIZED);
791
+ increment(version);
1176
792
  }
1177
- sources.push(source3);
1178
- }
1179
- if (is_earlier) {
1180
- for (const [effect, deferred2] of this.async_deriveds) {
1181
- const d = batch.async_deriveds.get(effect);
1182
- if (d) deferred2.promise.then(d.resolve);
793
+ return true;
794
+ },
795
+ get(target, prop, receiver) {
796
+ if (prop === STATE_SYMBOL) {
797
+ return value;
1183
798
  }
1184
- }
1185
- if (!batch.#started) continue;
1186
- var others = [...batch.current.keys()].filter((s) => !this.current.has(s));
1187
- if (others.length === 0) {
1188
- if (is_earlier) {
1189
- batch.discard();
799
+ var s = sources.get(prop);
800
+ var exists = prop in target;
801
+ if (s === void 0 && (!exists || get_descriptor(target, prop)?.writable)) {
802
+ s = with_parent(() => {
803
+ var p = proxy(exists ? target[prop] : UNINITIALIZED);
804
+ var s2 = /* @__PURE__ */ state(p);
805
+ return s2;
806
+ });
807
+ sources.set(prop, s);
1190
808
  }
1191
- } else if (sources.length > 0) {
1192
- if (is_earlier) {
1193
- for (const unskipped of this.#unskipped_branches) {
1194
- batch.unskip_effect(unskipped, (e) => {
1195
- if ((e.f & (BLOCK_EFFECT | ASYNC)) !== 0) {
1196
- batch.schedule(e);
1197
- } else {
1198
- batch.#defer_effects([e]);
1199
- }
809
+ if (s !== void 0) {
810
+ var v = get(s);
811
+ return v === UNINITIALIZED ? void 0 : v;
812
+ }
813
+ return Reflect.get(target, prop, receiver);
814
+ },
815
+ getOwnPropertyDescriptor(target, prop) {
816
+ var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
817
+ if (descriptor && "value" in descriptor) {
818
+ var s = sources.get(prop);
819
+ if (s) descriptor.value = get(s);
820
+ } else if (descriptor === void 0) {
821
+ var source2 = sources.get(prop);
822
+ var value2 = source2?.v;
823
+ if (source2 !== void 0 && value2 !== UNINITIALIZED) {
824
+ return {
825
+ enumerable: true,
826
+ configurable: true,
827
+ value: value2,
828
+ writable: true
829
+ };
830
+ }
831
+ }
832
+ return descriptor;
833
+ },
834
+ has(target, prop) {
835
+ if (prop === STATE_SYMBOL) {
836
+ return true;
837
+ }
838
+ var s = sources.get(prop);
839
+ var has = s !== void 0 && s.v !== UNINITIALIZED || Reflect.has(target, prop);
840
+ if (s !== void 0 || active_effect !== null && (!has || get_descriptor(target, prop)?.writable)) {
841
+ if (s === void 0) {
842
+ s = with_parent(() => {
843
+ var p = has ? proxy(target[prop]) : UNINITIALIZED;
844
+ var s2 = /* @__PURE__ */ state(p);
845
+ return s2;
1200
846
  });
847
+ sources.set(prop, s);
848
+ }
849
+ var value2 = get(s);
850
+ if (value2 === UNINITIALIZED) {
851
+ return false;
1201
852
  }
1202
853
  }
1203
- batch.activate();
1204
- var marked = /* @__PURE__ */ new Set();
1205
- var checked = /* @__PURE__ */ new Map();
1206
- for (var source2 of sources) {
1207
- mark_effects(source2, others, marked, checked);
854
+ return has;
855
+ },
856
+ set(target, prop, value2, receiver) {
857
+ var s = sources.get(prop);
858
+ var has = prop in target;
859
+ if (is_proxied_array && prop === "length") {
860
+ for (var i = value2; i < /** @type {Source<number>} */
861
+ s.v; i += 1) {
862
+ var other_s = sources.get(i + "");
863
+ if (other_s !== void 0) {
864
+ set(other_s, UNINITIALIZED);
865
+ } else if (i in target) {
866
+ other_s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED));
867
+ sources.set(i + "", other_s);
868
+ }
869
+ }
1208
870
  }
1209
- checked = /* @__PURE__ */ new Map();
1210
- var current_unequal = [...batch.current.keys()].filter(
1211
- (c) => this.current.has(c) ? (
1212
- /** @type {[any, boolean]} */
1213
- this.current.get(c)[0] !== c.v
1214
- ) : true
1215
- );
1216
- if (current_unequal.length > 0) {
1217
- for (const effect of this.#new_effects) {
1218
- if ((effect.f & (DESTROYED | INERT | EAGER_EFFECT)) === 0 && depends_on(effect, current_unequal, checked)) {
1219
- if ((effect.f & (ASYNC | BLOCK_EFFECT)) !== 0) {
1220
- set_signal_status(effect, DIRTY);
1221
- batch.schedule(effect);
1222
- } else {
1223
- batch.#dirty_effects.add(effect);
1224
- }
871
+ if (s === void 0) {
872
+ if (!has || get_descriptor(target, prop)?.writable) {
873
+ s = with_parent(() => /* @__PURE__ */ state(void 0));
874
+ set(s, proxy(value2));
875
+ sources.set(prop, s);
876
+ }
877
+ } else {
878
+ has = s.v !== UNINITIALIZED;
879
+ var p = with_parent(() => proxy(value2));
880
+ set(s, p);
881
+ }
882
+ var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
883
+ if (descriptor?.set) {
884
+ descriptor.set.call(receiver, value2);
885
+ }
886
+ if (!has) {
887
+ if (is_proxied_array && typeof prop === "string") {
888
+ var ls = (
889
+ /** @type {Source<number>} */
890
+ sources.get("length")
891
+ );
892
+ var n = Number(prop);
893
+ if (Number.isInteger(n) && n >= ls.v) {
894
+ set(ls, n + 1);
1225
895
  }
1226
896
  }
897
+ increment(version);
1227
898
  }
1228
- if (batch.#roots.length > 0) {
1229
- batch.apply();
1230
- for (var root of batch.#roots) {
1231
- batch.#traverse(root, [], []);
899
+ return true;
900
+ },
901
+ ownKeys(target) {
902
+ get(version);
903
+ var own_keys = Reflect.ownKeys(target).filter((key2) => {
904
+ var source3 = sources.get(key2);
905
+ return source3 === void 0 || source3.v !== UNINITIALIZED;
906
+ });
907
+ for (var [key, source2] of sources) {
908
+ if (source2.v !== UNINITIALIZED && !(key in target)) {
909
+ own_keys.push(key);
1232
910
  }
1233
- batch.#roots = [];
1234
911
  }
1235
- batch.deactivate();
1236
- }
1237
- }
1238
- }
1239
- /**
1240
- * @param {boolean} blocking
1241
- * @param {Effect} effect
1242
- */
1243
- increment(blocking, effect) {
1244
- this.#pending += 1;
1245
- if (blocking) {
1246
- let blocking_pending_count = this.#blocking_pending.get(effect) ?? 0;
1247
- this.#blocking_pending.set(effect, blocking_pending_count + 1);
1248
- }
1249
- }
1250
- /**
1251
- * @param {boolean} blocking
1252
- * @param {Effect} effect
1253
- */
1254
- decrement(blocking, effect) {
1255
- this.#pending -= 1;
1256
- if (blocking) {
1257
- let blocking_pending_count = this.#blocking_pending.get(effect) ?? 0;
1258
- if (blocking_pending_count === 1) {
1259
- this.#blocking_pending.delete(effect);
1260
- } else {
1261
- this.#blocking_pending.set(effect, blocking_pending_count - 1);
1262
- }
1263
- }
1264
- if (this.#decrement_queued) return;
1265
- this.#decrement_queued = true;
1266
- queue_micro_task(() => {
1267
- this.#decrement_queued = false;
1268
- if (this.linked) {
1269
- this.flush();
912
+ return own_keys;
913
+ },
914
+ setPrototypeOf() {
915
+ state_prototype_fixed();
1270
916
  }
1271
- });
1272
- }
1273
- /**
1274
- * @param {Set<Effect>} dirty_effects
1275
- * @param {Set<Effect>} maybe_dirty_effects
1276
- */
1277
- transfer_effects(dirty_effects, maybe_dirty_effects) {
1278
- for (const e of dirty_effects) {
1279
- this.#dirty_effects.add(e);
1280
- }
1281
- for (const e of maybe_dirty_effects) {
1282
- this.#maybe_dirty_effects.add(e);
1283
917
  }
1284
- dirty_effects.clear();
1285
- maybe_dirty_effects.clear();
1286
- }
1287
- /** @param {(batch: Batch) => void} fn */
1288
- oncommit(fn) {
1289
- this.#commit_callbacks.add(fn);
918
+ );
919
+ }
920
+ var $window;
921
+ var first_child_getter;
922
+ var next_sibling_getter;
923
+ function init_operations() {
924
+ if ($window !== void 0) {
925
+ return;
1290
926
  }
1291
- /** @param {(batch: Batch) => void} fn */
1292
- ondiscard(fn) {
1293
- this.#discard_callbacks.add(fn);
927
+ $window = window;
928
+ var element_prototype = Element.prototype;
929
+ var node_prototype = Node.prototype;
930
+ var text_prototype = Text.prototype;
931
+ first_child_getter = get_descriptor(node_prototype, "firstChild").get;
932
+ next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get;
933
+ if (is_extensible(element_prototype)) {
934
+ element_prototype[CLASS_CACHE] = void 0;
935
+ element_prototype[ATTRIBUTES_CACHE] = null;
936
+ element_prototype[STYLE_CACHE] = void 0;
937
+ element_prototype.__e = void 0;
1294
938
  }
1295
- /** @param {(batch: Batch) => void} fn */
1296
- on_fork_commit(fn) {
1297
- this.#fork_commit_callbacks.add(fn);
939
+ if (is_extensible(text_prototype)) {
940
+ text_prototype[TEXT_CACHE] = void 0;
1298
941
  }
1299
- run_fork_commit_callbacks() {
1300
- for (const fn of this.#fork_commit_callbacks) fn(this);
1301
- this.#fork_commit_callbacks.clear();
942
+ }
943
+ function create_text(value = "") {
944
+ return document.createTextNode(value);
945
+ }
946
+ // @__NO_SIDE_EFFECTS__
947
+ function get_first_child(node) {
948
+ return (
949
+ /** @type {TemplateNode | null} */
950
+ first_child_getter.call(node)
951
+ );
952
+ }
953
+ // @__NO_SIDE_EFFECTS__
954
+ function get_next_sibling(node) {
955
+ return (
956
+ /** @type {TemplateNode | null} */
957
+ next_sibling_getter.call(node)
958
+ );
959
+ }
960
+ function clear_text_content(node) {
961
+ node.textContent = "";
962
+ }
963
+ function handle_error(error) {
964
+ var effect = active_effect;
965
+ if (effect === null) {
966
+ active_reaction.f |= ERROR_VALUE;
967
+ return error;
1302
968
  }
1303
- settled() {
1304
- return (this.#deferred ??= deferred()).promise;
969
+ if ((effect.f & REACTION_RAN) === 0 && (effect.f & EFFECT) === 0) {
970
+ throw error;
1305
971
  }
1306
- static ensure() {
1307
- if (current_batch === null) {
1308
- const batch = current_batch = new Batch();
1309
- batch.#link();
1310
- if (!is_processing && !is_flushing_sync) {
1311
- queue_micro_task(() => {
1312
- if (!batch.#started) {
1313
- batch.flush();
1314
- }
1315
- });
972
+ invoke_error_boundary(error, effect);
973
+ }
974
+ function invoke_error_boundary(error, effect) {
975
+ while (effect !== null) {
976
+ if ((effect.f & BOUNDARY_EFFECT) !== 0) {
977
+ if ((effect.f & REACTION_RAN) === 0) {
978
+ throw error;
979
+ }
980
+ try {
981
+ effect.b.error(error);
982
+ return;
983
+ } catch (e) {
984
+ error = e;
1316
985
  }
1317
986
  }
1318
- return current_batch;
987
+ effect = effect.parent;
1319
988
  }
1320
- apply() {
1321
- {
1322
- batch_values = null;
1323
- return;
989
+ throw error;
990
+ }
991
+ const STATUS_MASK = -7169;
992
+ function set_signal_status(signal, status) {
993
+ signal.f = signal.f & STATUS_MASK | status;
994
+ }
995
+ function update_derived_status(derived2) {
996
+ if ((derived2.f & CONNECTED) !== 0 || derived2.deps === null) {
997
+ set_signal_status(derived2, CLEAN);
998
+ } else {
999
+ set_signal_status(derived2, MAYBE_DIRTY);
1000
+ }
1001
+ }
1002
+ function clear_marked(deps) {
1003
+ if (deps === null) return;
1004
+ for (const dep of deps) {
1005
+ if ((dep.f & DERIVED) === 0 || (dep.f & WAS_MARKED) === 0) {
1006
+ continue;
1324
1007
  }
1008
+ dep.f ^= WAS_MARKED;
1009
+ clear_marked(
1010
+ /** @type {Derived} */
1011
+ dep.deps
1012
+ );
1325
1013
  }
1014
+ }
1015
+ function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
1016
+ if ((effect.f & DIRTY) !== 0) {
1017
+ dirty_effects.add(effect);
1018
+ } else if ((effect.f & MAYBE_DIRTY) !== 0) {
1019
+ maybe_dirty_effects.add(effect);
1020
+ }
1021
+ clear_marked(effect.deps);
1022
+ set_signal_status(effect, CLEAN);
1023
+ }
1024
+ function subscribe_to_store(store, run, invalidate) {
1025
+ if (store == null) {
1026
+ run(void 0);
1027
+ return noop;
1028
+ }
1029
+ const unsub = untrack(
1030
+ () => store.subscribe(
1031
+ run,
1032
+ // @ts-expect-error
1033
+ invalidate
1034
+ )
1035
+ );
1036
+ return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
1037
+ }
1038
+ let first_batch = null;
1039
+ let last_batch = null;
1040
+ let current_batch = null;
1041
+ let previous_batch = null;
1042
+ let batch_values = null;
1043
+ let last_scheduled_effect = null;
1044
+ let is_flushing_sync = false;
1045
+ let is_processing = false;
1046
+ let collected_effects = null;
1047
+ let legacy_updates = null;
1048
+ var flush_count = 0;
1049
+ let uid = 1;
1050
+ class Batch {
1051
+ id = uid++;
1052
+ /** True as soon as `#process` was called */
1053
+ #started = false;
1054
+ linked = true;
1055
+ /** @type {Batch | null} */
1056
+ #prev = null;
1057
+ /** @type {Batch | null} */
1058
+ #next = null;
1059
+ /** @type {Map<Effect, ReturnType<typeof deferred<any>>>} */
1060
+ async_deriveds = /* @__PURE__ */ new Map();
1326
1061
  /**
1327
- *
1328
- * @param {Effect} effect
1062
+ * The current values of any signals that are updated in this batch.
1063
+ * Tuple format: [value, is_derived] (note: is_derived is false for deriveds, too, if they were overridden via assignment)
1064
+ * They keys of this map are identical to `this.#previous`
1065
+ * @type {Map<Value, [any, boolean]>}
1329
1066
  */
1330
- schedule(effect) {
1331
- last_scheduled_effect = effect;
1332
- if (effect.b?.is_pending && (effect.f & (EFFECT | RENDER_EFFECT | MANAGED_EFFECT)) !== 0 && (effect.f & REACTION_RAN) === 0) {
1333
- effect.b.defer_effect(effect);
1334
- return;
1335
- }
1336
- var e = effect;
1337
- while (e.parent !== null) {
1338
- e = e.parent;
1339
- var flags = e.f;
1340
- if (collected_effects !== null && e === active_effect) {
1341
- if ((active_reaction === null || (active_reaction.f & DERIVED) === 0) && true) {
1342
- return;
1343
- }
1344
- }
1345
- if ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {
1346
- if ((flags & CLEAN) === 0) {
1347
- return;
1067
+ current = /* @__PURE__ */ new Map();
1068
+ /**
1069
+ * The values of any signals (sources and deriveds) that are updated in this batch _before_ those updates took place.
1070
+ * They keys of this map are identical to `this.#current`
1071
+ * @type {Map<Value, any>}
1072
+ */
1073
+ previous = /* @__PURE__ */ new Map();
1074
+ /**
1075
+ * Async effects which this batch doesn't take into account anymore when calculating blockers,
1076
+ * as it has a value for it already.
1077
+ * @type {Set<Effect>}
1078
+ */
1079
+ unblocked = /* @__PURE__ */ new Set();
1080
+ /**
1081
+ * When the batch is committed (and the DOM is updated), we need to remove old branches
1082
+ * and append new ones by calling the functions added inside (if/each/key/etc) blocks
1083
+ * @type {Set<(batch: Batch) => void>}
1084
+ */
1085
+ #commit_callbacks = /* @__PURE__ */ new Set();
1086
+ /**
1087
+ * If a fork is discarded, we need to destroy any effects that are no longer needed
1088
+ * @type {Set<(batch: Batch) => void>}
1089
+ */
1090
+ #discard_callbacks = /* @__PURE__ */ new Set();
1091
+ /**
1092
+ * Callbacks that should run only when a fork is committed.
1093
+ * @type {Set<(batch: Batch) => void>}
1094
+ */
1095
+ #fork_commit_callbacks = /* @__PURE__ */ new Set();
1096
+ /**
1097
+ * The number of async effects that are currently in flight
1098
+ */
1099
+ #pending = 0;
1100
+ /**
1101
+ * Async effects that are currently in flight, _not_ inside a pending boundary
1102
+ * @type {Map<Effect, number>}
1103
+ */
1104
+ #blocking_pending = /* @__PURE__ */ new Map();
1105
+ /**
1106
+ * A deferred that resolves when the batch is committed, used with `settled()`
1107
+ * TODO replace with Promise.withResolvers once supported widely enough
1108
+ * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
1109
+ */
1110
+ #deferred = null;
1111
+ /**
1112
+ * The root effects that need to be flushed
1113
+ * @type {Effect[]}
1114
+ */
1115
+ #roots = [];
1116
+ /**
1117
+ * Effects created while this batch was active.
1118
+ * @type {Effect[]}
1119
+ */
1120
+ #new_effects = [];
1121
+ /**
1122
+ * Deferred effects (which run after async work has completed) that are DIRTY
1123
+ * @type {Set<Effect>}
1124
+ */
1125
+ #dirty_effects = /* @__PURE__ */ new Set();
1126
+ /**
1127
+ * Deferred effects that are MAYBE_DIRTY
1128
+ * @type {Set<Effect>}
1129
+ */
1130
+ #maybe_dirty_effects = /* @__PURE__ */ new Set();
1131
+ /**
1132
+ * A map of branches that still exist, but will be destroyed when this batch
1133
+ * is committed — we skip over these during `process`.
1134
+ * The value contains child effects that were dirty/maybe_dirty before being reset,
1135
+ * so they can be rescheduled if the branch survives.
1136
+ * @type {Map<Effect, { d: Effect[], m: Effect[] }>}
1137
+ */
1138
+ #skipped_branches = /* @__PURE__ */ new Map();
1139
+ /**
1140
+ * Inverse of #skipped_branches which we need to tell prior batches to unskip them when committing
1141
+ * @type {Set<Effect>}
1142
+ */
1143
+ #unskipped_branches = /* @__PURE__ */ new Set();
1144
+ is_fork = false;
1145
+ #decrement_queued = false;
1146
+ #is_deferred() {
1147
+ if (this.is_fork) return true;
1148
+ for (const effect of this.#blocking_pending.keys()) {
1149
+ var e = effect;
1150
+ var skipped = false;
1151
+ while (e.parent !== null) {
1152
+ if (this.#skipped_branches.has(e)) {
1153
+ skipped = true;
1154
+ break;
1348
1155
  }
1349
- e.f ^= CLEAN;
1156
+ e = e.parent;
1350
1157
  }
1351
- }
1352
- this.#roots.push(e);
1353
- }
1354
- #link() {
1355
- if (last_batch === null) {
1356
- first_batch = last_batch = this;
1357
- } else {
1358
- last_batch.#next = this;
1359
- this.#prev = last_batch;
1360
- }
1361
- last_batch = this;
1362
- }
1363
- #unlink() {
1364
- var prev = this.#prev;
1365
- var next = this.#next;
1366
- if (prev === null) {
1367
- first_batch = next;
1368
- } else {
1369
- prev.#next = next;
1370
- }
1371
- if (next === null) {
1372
- last_batch = prev;
1373
- } else {
1374
- next.#prev = prev;
1375
- }
1376
- this.linked = false;
1377
- }
1378
- }
1379
- function flushSync(fn) {
1380
- var was_flushing_sync = is_flushing_sync;
1381
- is_flushing_sync = true;
1382
- try {
1383
- var result;
1384
- if (fn) ;
1385
- while (true) {
1386
- flush_tasks();
1387
- if (current_batch === null) {
1388
- return (
1389
- /** @type {T} */
1390
- result
1391
- );
1158
+ if (!skipped) {
1159
+ return true;
1392
1160
  }
1393
- current_batch.flush();
1394
1161
  }
1395
- } finally {
1396
- is_flushing_sync = was_flushing_sync;
1162
+ return false;
1397
1163
  }
1398
- }
1399
- function infinite_loop_guard() {
1400
- try {
1401
- effect_update_depth_exceeded();
1402
- } catch (error) {
1403
- invoke_error_boundary(error, last_scheduled_effect);
1164
+ /**
1165
+ * Add an effect to the #skipped_branches map and reset its children
1166
+ * @param {Effect} effect
1167
+ */
1168
+ skip_effect(effect) {
1169
+ if (!this.#skipped_branches.has(effect)) {
1170
+ this.#skipped_branches.set(effect, { d: [], m: [] });
1171
+ }
1172
+ this.#unskipped_branches.delete(effect);
1404
1173
  }
1405
- }
1406
- let eager_block_effects = null;
1407
- function flush_queued_effects(effects) {
1408
- var length = effects.length;
1409
- if (length === 0) return;
1410
- var i = 0;
1411
- while (i < length) {
1412
- var effect = effects[i++];
1413
- if ((effect.f & (DESTROYED | INERT)) === 0 && is_dirty(effect)) {
1414
- eager_block_effects = /* @__PURE__ */ new Set();
1415
- update_effect(effect);
1416
- if (effect.deps === null && effect.first === null && effect.nodes === null && effect.teardown === null && effect.ac === null) {
1417
- unlink_effect(effect);
1174
+ /**
1175
+ * Remove an effect from the #skipped_branches map and reschedule
1176
+ * any tracked dirty/maybe_dirty child effects
1177
+ * @param {Effect} effect
1178
+ * @param {(e: Effect) => void} callback
1179
+ */
1180
+ unskip_effect(effect, callback = (e) => this.schedule(e)) {
1181
+ var tracked = this.#skipped_branches.get(effect);
1182
+ if (tracked) {
1183
+ this.#skipped_branches.delete(effect);
1184
+ for (var e of tracked.d) {
1185
+ set_signal_status(e, DIRTY);
1186
+ callback(e);
1418
1187
  }
1419
- if (eager_block_effects?.size > 0) {
1420
- old_values.clear();
1421
- for (const e of eager_block_effects) {
1422
- if ((e.f & (DESTROYED | INERT)) !== 0) continue;
1423
- const ordered_effects = [e];
1424
- let ancestor = e.parent;
1425
- while (ancestor !== null) {
1426
- if (eager_block_effects.has(ancestor)) {
1427
- eager_block_effects.delete(ancestor);
1428
- ordered_effects.push(ancestor);
1429
- }
1430
- ancestor = ancestor.parent;
1431
- }
1432
- for (let j = ordered_effects.length - 1; j >= 0; j--) {
1433
- const e2 = ordered_effects[j];
1434
- if ((e2.f & (DESTROYED | INERT)) !== 0) continue;
1435
- update_effect(e2);
1436
- }
1437
- }
1438
- eager_block_effects.clear();
1188
+ for (e of tracked.m) {
1189
+ set_signal_status(e, MAYBE_DIRTY);
1190
+ callback(e);
1439
1191
  }
1440
1192
  }
1193
+ this.#unskipped_branches.add(effect);
1441
1194
  }
1442
- eager_block_effects = null;
1443
- }
1444
- function mark_effects(value, sources, marked, checked) {
1445
- if (marked.has(value)) return;
1446
- marked.add(value);
1447
- if (value.reactions !== null) {
1448
- for (const reaction of value.reactions) {
1449
- const flags = reaction.f;
1450
- if ((flags & DERIVED) !== 0) {
1451
- mark_effects(
1452
- /** @type {Derived} */
1453
- reaction,
1454
- sources,
1455
- marked,
1456
- checked
1457
- );
1458
- } else if ((flags & (ASYNC | BLOCK_EFFECT)) !== 0 && (flags & DIRTY) === 0 && depends_on(reaction, sources, checked)) {
1459
- set_signal_status(reaction, DIRTY);
1460
- schedule_effect(
1461
- /** @type {Effect} */
1462
- reaction
1463
- );
1464
- }
1195
+ #process() {
1196
+ this.#started = true;
1197
+ if (flush_count++ > 1e3) {
1198
+ this.#unlink();
1199
+ infinite_loop_guard();
1465
1200
  }
1466
- }
1467
- }
1468
- function depends_on(reaction, sources, checked) {
1469
- const depends = checked.get(reaction);
1470
- if (depends !== void 0) return depends;
1471
- if (reaction.deps !== null) {
1472
- for (const dep of reaction.deps) {
1473
- if (includes.call(sources, dep)) {
1474
- return true;
1201
+ if (!this.#is_deferred()) {
1202
+ for (const e of this.#dirty_effects) {
1203
+ this.#maybe_dirty_effects.delete(e);
1204
+ set_signal_status(e, DIRTY);
1205
+ this.schedule(e);
1475
1206
  }
1476
- if ((dep.f & DERIVED) !== 0 && depends_on(
1477
- /** @type {Derived} */
1478
- dep,
1479
- sources,
1480
- checked
1481
- )) {
1482
- checked.set(
1483
- /** @type {Derived} */
1484
- dep,
1485
- true
1486
- );
1487
- return true;
1207
+ for (const e of this.#maybe_dirty_effects) {
1208
+ set_signal_status(e, MAYBE_DIRTY);
1209
+ this.schedule(e);
1488
1210
  }
1489
1211
  }
1490
- }
1491
- checked.set(reaction, false);
1492
- return false;
1493
- }
1494
- function schedule_effect(effect) {
1495
- current_batch.schedule(effect);
1496
- }
1497
- function reset_branch(effect, tracked) {
1498
- if ((effect.f & BRANCH_EFFECT) !== 0 && (effect.f & CLEAN) !== 0) {
1499
- return;
1500
- }
1501
- if ((effect.f & DIRTY) !== 0) {
1502
- tracked.d.push(effect);
1503
- } else if ((effect.f & MAYBE_DIRTY) !== 0) {
1504
- tracked.m.push(effect);
1505
- }
1506
- set_signal_status(effect, CLEAN);
1507
- var e = effect.first;
1508
- while (e !== null) {
1509
- reset_branch(e, tracked);
1510
- e = e.next;
1511
- }
1512
- }
1513
- function reset_all(effect) {
1514
- set_signal_status(effect, CLEAN);
1515
- var e = effect.first;
1516
- while (e !== null) {
1517
- reset_all(e);
1518
- e = e.next;
1519
- }
1520
- }
1521
- function destroy_derived_effects(derived2) {
1522
- var effects = derived2.effects;
1523
- if (effects !== null) {
1524
- derived2.effects = null;
1525
- for (var i = 0; i < effects.length; i += 1) {
1526
- destroy_effect(
1527
- /** @type {Effect} */
1528
- effects[i]
1529
- );
1530
- }
1531
- }
1532
- }
1533
- function execute_derived(derived2) {
1534
- var value;
1535
- var prev_active_effect = active_effect;
1536
- var parent = derived2.parent;
1537
- if (!is_destroying_effect && parent !== null && (parent.f & (DESTROYED | INERT)) !== 0) {
1538
- derived_inert();
1539
- return derived2.v;
1540
- }
1541
- set_active_effect(parent);
1542
- {
1543
- try {
1544
- derived2.f &= ~WAS_MARKED;
1545
- destroy_derived_effects(derived2);
1546
- value = update_reaction(derived2);
1547
- } finally {
1548
- set_active_effect(prev_active_effect);
1212
+ const roots = this.#roots;
1213
+ this.#roots = [];
1214
+ this.apply();
1215
+ var effects = collected_effects = [];
1216
+ var render_effects = [];
1217
+ var updates = legacy_updates = [];
1218
+ for (const root of roots) {
1219
+ try {
1220
+ this.#traverse(root, effects, render_effects);
1221
+ } catch (e) {
1222
+ reset_all(root);
1223
+ throw e;
1224
+ }
1549
1225
  }
1550
- }
1551
- return value;
1552
- }
1553
- function update_derived(derived2) {
1554
- var value = execute_derived(derived2);
1555
- if (!derived2.equals(value)) {
1556
- derived2.wv = increment_write_version();
1557
- if (!current_batch?.is_fork || derived2.deps === null) {
1558
- if (current_batch !== null) {
1559
- current_batch.capture(derived2, value, true);
1560
- previous_batch?.capture(derived2, value, true);
1561
- } else {
1562
- derived2.v = value;
1226
+ current_batch = null;
1227
+ if (updates.length > 0) {
1228
+ var batch = Batch.ensure();
1229
+ for (const e of updates) {
1230
+ batch.schedule(e);
1563
1231
  }
1564
- if (derived2.deps === null) {
1565
- set_signal_status(derived2, CLEAN);
1566
- return;
1232
+ }
1233
+ collected_effects = null;
1234
+ legacy_updates = null;
1235
+ if (this.#is_deferred()) {
1236
+ this.#defer_effects(render_effects);
1237
+ this.#defer_effects(effects);
1238
+ for (const [e, t] of this.#skipped_branches) {
1239
+ reset_branch(e, t);
1240
+ }
1241
+ if (updates.length > 0) {
1242
+ /** @type {unknown} */
1243
+ current_batch.#process();
1567
1244
  }
1245
+ return;
1568
1246
  }
1569
- }
1570
- if (is_destroying_effect) {
1571
- return;
1572
- }
1573
- if (batch_values !== null) {
1574
- if (effect_tracking() || current_batch?.is_fork) {
1575
- batch_values.set(derived2, value);
1247
+ const earlier_batch = this.#find_earlier_batch();
1248
+ if (earlier_batch) {
1249
+ earlier_batch.#merge(this);
1250
+ return;
1576
1251
  }
1577
- } else {
1578
- update_derived_status(derived2);
1579
- }
1580
- }
1581
- function freeze_derived_effects(derived2) {
1582
- if (derived2.effects === null) return;
1583
- for (const e of derived2.effects) {
1584
- if (e.teardown || e.ac) {
1585
- e.teardown?.();
1586
- e.ac?.abort(STALE_REACTION);
1587
- e.teardown = noop;
1588
- e.ac = null;
1589
- remove_reactions(e, 0);
1590
- destroy_effect_children(e);
1252
+ this.#dirty_effects.clear();
1253
+ this.#maybe_dirty_effects.clear();
1254
+ for (const fn of this.#commit_callbacks) fn(this);
1255
+ this.#commit_callbacks.clear();
1256
+ previous_batch = this;
1257
+ flush_queued_effects(render_effects);
1258
+ flush_queued_effects(effects);
1259
+ previous_batch = null;
1260
+ this.#deferred?.resolve();
1261
+ var next_batch = (
1262
+ /** @type {Batch | null} */
1263
+ /** @type {unknown} */
1264
+ current_batch
1265
+ );
1266
+ if (this.linked && this.#pending === 0) {
1267
+ this.#unlink();
1591
1268
  }
1592
- }
1593
- }
1594
- function unfreeze_derived_effects(derived2) {
1595
- if (derived2.effects === null) return;
1596
- for (const e of derived2.effects) {
1597
- if (e.teardown) {
1598
- update_effect(e);
1269
+ if (this.#roots.length > 0) {
1270
+ if (next_batch === null) {
1271
+ next_batch = this;
1272
+ this.#link();
1273
+ }
1274
+ const batch2 = next_batch;
1275
+ batch2.#roots.push(...this.#roots.filter((r2) => !batch2.#roots.includes(r2)));
1276
+ }
1277
+ if (next_batch !== null) {
1278
+ next_batch.#process();
1599
1279
  }
1600
1280
  }
1601
- }
1602
- let eager_effects = /* @__PURE__ */ new Set();
1603
- const old_values = /* @__PURE__ */ new Map();
1604
- let eager_effects_deferred = false;
1605
- function source(v, stack) {
1606
- var signal = {
1607
- f: 0,
1608
- // TODO ideally we could skip this altogether, but it causes type errors
1609
- v,
1610
- reactions: null,
1611
- equals,
1612
- rv: 0,
1613
- wv: 0
1614
- };
1615
- return signal;
1616
- }
1617
- // @__NO_SIDE_EFFECTS__
1618
- function state(v, stack) {
1619
- const s = source(v);
1620
- push_reaction_value(s);
1621
- return s;
1622
- }
1623
- // @__NO_SIDE_EFFECTS__
1624
- function mutable_source(initial_value, immutable = false, trackable = true) {
1625
- const s = source(initial_value);
1626
- if (!immutable) {
1627
- s.equals = safe_equals;
1628
- }
1629
- return s;
1630
- }
1631
- function set(source2, value, should_proxy = false) {
1632
- if (active_reaction !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
1633
- // to ensure we error if state is set inside an inspect effect
1634
- (!untracking || (active_reaction.f & EAGER_EFFECT) !== 0) && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | EAGER_EFFECT)) !== 0 && (current_sources === null || !includes.call(current_sources, source2))) {
1635
- state_unsafe_mutation();
1636
- }
1637
- let new_value = should_proxy ? proxy(value) : value;
1638
- return internal_set(source2, new_value, legacy_updates);
1639
- }
1640
- function internal_set(source2, value, updated_during_traversal = null) {
1641
- if (!source2.equals(value)) {
1642
- old_values.set(source2, is_destroying_effect ? value : source2.v);
1643
- var batch = Batch.ensure();
1644
- batch.capture(source2, value);
1645
- if ((source2.f & DERIVED) !== 0) {
1646
- const derived2 = (
1647
- /** @type {Derived} */
1648
- source2
1649
- );
1650
- if ((source2.f & DIRTY) !== 0) {
1651
- execute_derived(derived2);
1281
+ /**
1282
+ * Traverse the effect tree, executing effects or stashing
1283
+ * them for later execution as appropriate
1284
+ * @param {Effect} root
1285
+ * @param {Effect[]} effects
1286
+ * @param {Effect[]} render_effects
1287
+ */
1288
+ #traverse(root, effects, render_effects) {
1289
+ root.f ^= CLEAN;
1290
+ var effect = root.first;
1291
+ while (effect !== null) {
1292
+ var flags = effect.f;
1293
+ var is_branch = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0;
1294
+ var is_skippable_branch = is_branch && (flags & CLEAN) !== 0;
1295
+ var skip = is_skippable_branch || (flags & INERT) !== 0 || this.#skipped_branches.has(effect);
1296
+ if (!skip && effect.fn !== null) {
1297
+ if (is_branch) {
1298
+ effect.f ^= CLEAN;
1299
+ } else if ((flags & EFFECT) !== 0) {
1300
+ effects.push(effect);
1301
+ } else if (is_dirty(effect)) {
1302
+ if ((flags & BLOCK_EFFECT) !== 0) this.#maybe_dirty_effects.add(effect);
1303
+ update_effect(effect);
1304
+ }
1305
+ var child = effect.first;
1306
+ if (child !== null) {
1307
+ effect = child;
1308
+ continue;
1309
+ }
1652
1310
  }
1653
- if (batch_values === null) {
1654
- update_derived_status(derived2);
1311
+ while (effect !== null) {
1312
+ var next = effect.next;
1313
+ if (next !== null) {
1314
+ effect = next;
1315
+ break;
1316
+ }
1317
+ effect = effect.parent;
1655
1318
  }
1656
1319
  }
1657
- source2.wv = increment_write_version();
1658
- mark_reactions(source2, DIRTY, updated_during_traversal);
1659
- if (active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0) {
1660
- if (untracked_writes === null) {
1661
- set_untracked_writes([source2]);
1662
- } else {
1663
- untracked_writes.push(source2);
1320
+ }
1321
+ #find_earlier_batch() {
1322
+ var batch = this.#prev;
1323
+ while (batch !== null) {
1324
+ if (!batch.is_fork) {
1325
+ for (const [value, [, is_derived]] of this.current) {
1326
+ if (batch.current.has(value) && !is_derived) {
1327
+ return batch;
1328
+ }
1329
+ }
1664
1330
  }
1331
+ batch = batch.#prev;
1665
1332
  }
1666
- if (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) {
1667
- flush_eager_effects();
1668
- }
1333
+ return null;
1669
1334
  }
1670
- return value;
1671
- }
1672
- function flush_eager_effects() {
1673
- eager_effects_deferred = false;
1674
- for (const effect of eager_effects) {
1675
- if ((effect.f & CLEAN) !== 0) {
1676
- set_signal_status(effect, MAYBE_DIRTY);
1677
- }
1678
- let dirty;
1679
- try {
1680
- dirty = is_dirty(effect);
1681
- } catch {
1682
- dirty = true;
1683
- }
1684
- if (dirty) {
1685
- update_effect(effect);
1335
+ /**
1336
+ * @param {Batch} batch
1337
+ */
1338
+ #merge(batch) {
1339
+ for (const [source2, value] of batch.current) {
1340
+ if (!this.previous.has(source2) && batch.previous.has(source2)) {
1341
+ this.previous.set(source2, batch.previous.get(source2));
1342
+ }
1343
+ this.current.set(source2, value);
1686
1344
  }
1687
- }
1688
- eager_effects.clear();
1689
- }
1690
- function increment(source2) {
1691
- set(source2, source2.v + 1);
1692
- }
1693
- function mark_reactions(signal, status, updated_during_traversal) {
1694
- var reactions = signal.reactions;
1695
- if (reactions === null) return;
1696
- var length = reactions.length;
1697
- for (var i = 0; i < length; i++) {
1698
- var reaction = reactions[i];
1699
- var flags = reaction.f;
1700
- var not_dirty = (flags & DIRTY) === 0;
1701
- if (not_dirty) {
1702
- set_signal_status(reaction, status);
1345
+ for (const [effect, deferred2] of batch.async_deriveds) {
1346
+ const d = this.async_deriveds.get(effect);
1347
+ if (d) deferred2.promise.then(d.resolve);
1703
1348
  }
1704
- if ((flags & EAGER_EFFECT) !== 0) {
1705
- eager_effects.add(
1706
- /** @type {Effect} */
1707
- reaction
1708
- );
1709
- } else if ((flags & DERIVED) !== 0) {
1710
- var derived2 = (
1711
- /** @type {Derived} */
1712
- reaction
1713
- );
1714
- batch_values?.delete(derived2);
1715
- if ((flags & WAS_MARKED) === 0) {
1716
- if (flags & CONNECTED && (active_effect === null || (active_effect.f & REACTION_IS_UPDATING) === 0)) {
1717
- reaction.f |= WAS_MARKED;
1349
+ const mark = (value) => {
1350
+ var reactions = value.reactions;
1351
+ if (reactions === null) return;
1352
+ for (const reaction of reactions) {
1353
+ var flags = reaction.f;
1354
+ if ((flags & DERIVED) !== 0) {
1355
+ mark(
1356
+ /** @type {Derived} */
1357
+ reaction
1358
+ );
1359
+ } else {
1360
+ var effect = (
1361
+ /** @type {Effect} */
1362
+ reaction
1363
+ );
1364
+ if (flags & (ASYNC | BLOCK_EFFECT) && !this.async_deriveds.has(effect)) {
1365
+ this.#maybe_dirty_effects.delete(effect);
1366
+ set_signal_status(effect, DIRTY);
1367
+ this.schedule(effect);
1368
+ }
1718
1369
  }
1719
- mark_reactions(derived2, MAYBE_DIRTY, updated_during_traversal);
1720
- }
1721
- } else if (not_dirty) {
1722
- var effect = (
1723
- /** @type {Effect} */
1724
- reaction
1725
- );
1726
- if ((flags & BLOCK_EFFECT) !== 0 && eager_block_effects !== null) {
1727
- eager_block_effects.add(effect);
1728
- }
1729
- if (updated_during_traversal !== null) {
1730
- updated_during_traversal.push(effect);
1731
- } else {
1732
- schedule_effect(effect);
1733
1370
  }
1371
+ };
1372
+ for (const source2 of this.current.keys()) {
1373
+ mark(source2);
1734
1374
  }
1375
+ this.oncommit(() => batch.discard());
1376
+ batch.#unlink();
1377
+ current_batch = this;
1378
+ this.#process();
1735
1379
  }
1736
- }
1737
- function proxy(value) {
1738
- if (typeof value !== "object" || value === null || STATE_SYMBOL in value) {
1739
- return value;
1380
+ /**
1381
+ * @param {Effect[]} effects
1382
+ */
1383
+ #defer_effects(effects) {
1384
+ for (var i = 0; i < effects.length; i += 1) {
1385
+ defer_effect(effects[i], this.#dirty_effects, this.#maybe_dirty_effects);
1386
+ }
1740
1387
  }
1741
- const prototype = get_prototype_of(value);
1742
- if (prototype !== object_prototype && prototype !== array_prototype) {
1743
- return value;
1388
+ /**
1389
+ * Associate a change to a given source with the current
1390
+ * batch, noting its previous and current values
1391
+ * @param {Value} source
1392
+ * @param {any} value
1393
+ * @param {boolean} [is_derived]
1394
+ */
1395
+ capture(source2, value, is_derived = false) {
1396
+ if (source2.v !== UNINITIALIZED && !this.previous.has(source2)) {
1397
+ this.previous.set(source2, source2.v);
1398
+ }
1399
+ if ((source2.f & ERROR_VALUE) === 0) {
1400
+ this.current.set(source2, [value, is_derived]);
1401
+ batch_values?.set(source2, value);
1402
+ }
1403
+ if (!this.is_fork) {
1404
+ source2.v = value;
1405
+ }
1744
1406
  }
1745
- var sources = /* @__PURE__ */ new Map();
1746
- var is_proxied_array = is_array(value);
1747
- var version = /* @__PURE__ */ state(0);
1748
- var parent_version = update_version;
1749
- var with_parent = (fn) => {
1750
- if (update_version === parent_version) {
1751
- return fn();
1407
+ activate() {
1408
+ current_batch = this;
1409
+ }
1410
+ deactivate() {
1411
+ current_batch = null;
1412
+ batch_values = null;
1413
+ }
1414
+ flush() {
1415
+ try {
1416
+ if (browser) ;
1417
+ is_processing = true;
1418
+ current_batch = this;
1419
+ this.#process();
1420
+ } finally {
1421
+ flush_count = 0;
1422
+ last_scheduled_effect = null;
1423
+ collected_effects = null;
1424
+ legacy_updates = null;
1425
+ is_processing = false;
1426
+ current_batch = null;
1427
+ batch_values = null;
1428
+ old_values.clear();
1752
1429
  }
1753
- var reaction = active_reaction;
1754
- var version2 = update_version;
1755
- set_active_reaction(null);
1756
- set_update_version(parent_version);
1757
- var result = fn();
1758
- set_active_reaction(reaction);
1759
- set_update_version(version2);
1760
- return result;
1761
- };
1762
- if (is_proxied_array) {
1763
- sources.set("length", /* @__PURE__ */ state(
1764
- /** @type {any[]} */
1765
- value.length
1766
- ));
1767
1430
  }
1768
- return new Proxy(
1769
- /** @type {any} */
1770
- value,
1771
- {
1772
- defineProperty(_, prop, descriptor) {
1773
- if (!("value" in descriptor) || descriptor.configurable === false || descriptor.enumerable === false || descriptor.writable === false) {
1774
- state_descriptors_fixed();
1775
- }
1776
- var s = sources.get(prop);
1777
- if (s === void 0) {
1778
- with_parent(() => {
1779
- var s2 = /* @__PURE__ */ state(descriptor.value);
1780
- sources.set(prop, s2);
1781
- return s2;
1782
- });
1783
- } else {
1784
- set(s, descriptor.value, true);
1785
- }
1786
- return true;
1787
- },
1788
- deleteProperty(target, prop) {
1789
- var s = sources.get(prop);
1790
- if (s === void 0) {
1791
- if (prop in target) {
1792
- const s2 = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED));
1793
- sources.set(prop, s2);
1794
- increment(version);
1795
- }
1796
- } else {
1797
- set(s, UNINITIALIZED);
1798
- increment(version);
1799
- }
1800
- return true;
1801
- },
1802
- get(target, prop, receiver) {
1803
- if (prop === STATE_SYMBOL) {
1804
- return value;
1805
- }
1806
- var s = sources.get(prop);
1807
- var exists = prop in target;
1808
- if (s === void 0 && (!exists || get_descriptor(target, prop)?.writable)) {
1809
- s = with_parent(() => {
1810
- var p = proxy(exists ? target[prop] : UNINITIALIZED);
1811
- var s2 = /* @__PURE__ */ state(p);
1812
- return s2;
1813
- });
1814
- sources.set(prop, s);
1815
- }
1816
- if (s !== void 0) {
1817
- var v = get(s);
1818
- return v === UNINITIALIZED ? void 0 : v;
1819
- }
1820
- return Reflect.get(target, prop, receiver);
1821
- },
1822
- getOwnPropertyDescriptor(target, prop) {
1823
- var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
1824
- if (descriptor && "value" in descriptor) {
1825
- var s = sources.get(prop);
1826
- if (s) descriptor.value = get(s);
1827
- } else if (descriptor === void 0) {
1828
- var source2 = sources.get(prop);
1829
- var value2 = source2?.v;
1830
- if (source2 !== void 0 && value2 !== UNINITIALIZED) {
1831
- return {
1832
- enumerable: true,
1833
- configurable: true,
1834
- value: value2,
1835
- writable: true
1836
- };
1837
- }
1838
- }
1839
- return descriptor;
1840
- },
1841
- has(target, prop) {
1842
- if (prop === STATE_SYMBOL) {
1843
- return true;
1844
- }
1845
- var s = sources.get(prop);
1846
- var has = s !== void 0 && s.v !== UNINITIALIZED || Reflect.has(target, prop);
1847
- if (s !== void 0 || active_effect !== null && (!has || get_descriptor(target, prop)?.writable)) {
1848
- if (s === void 0) {
1849
- s = with_parent(() => {
1850
- var p = has ? proxy(target[prop]) : UNINITIALIZED;
1851
- var s2 = /* @__PURE__ */ state(p);
1852
- return s2;
1853
- });
1854
- sources.set(prop, s);
1855
- }
1856
- var value2 = get(s);
1857
- if (value2 === UNINITIALIZED) {
1858
- return false;
1431
+ discard() {
1432
+ for (const fn of this.#discard_callbacks) fn(this);
1433
+ this.#discard_callbacks.clear();
1434
+ this.#fork_commit_callbacks.clear();
1435
+ this.#unlink();
1436
+ }
1437
+ /**
1438
+ * @param {Effect} effect
1439
+ */
1440
+ register_created_effect(effect) {
1441
+ this.#new_effects.push(effect);
1442
+ }
1443
+ #commit() {
1444
+ this.#unlink();
1445
+ for (let batch = first_batch; batch !== null; batch = batch.#next) {
1446
+ var is_earlier = batch.id < this.id;
1447
+ var sources = [];
1448
+ for (const [source3, [value, is_derived]] of this.current) {
1449
+ if (batch.current.has(source3)) {
1450
+ var batch_value = (
1451
+ /** @type {[any, boolean]} */
1452
+ batch.current.get(source3)[0]
1453
+ );
1454
+ if (is_earlier && value !== batch_value) {
1455
+ batch.current.set(source3, [value, is_derived]);
1456
+ } else {
1457
+ continue;
1859
1458
  }
1860
1459
  }
1861
- return has;
1862
- },
1863
- set(target, prop, value2, receiver) {
1864
- var s = sources.get(prop);
1865
- var has = prop in target;
1866
- if (is_proxied_array && prop === "length") {
1867
- for (var i = value2; i < /** @type {Source<number>} */
1868
- s.v; i += 1) {
1869
- var other_s = sources.get(i + "");
1870
- if (other_s !== void 0) {
1871
- set(other_s, UNINITIALIZED);
1872
- } else if (i in target) {
1873
- other_s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED));
1874
- sources.set(i + "", other_s);
1875
- }
1876
- }
1460
+ sources.push(source3);
1461
+ }
1462
+ if (is_earlier) {
1463
+ for (const [effect, deferred2] of this.async_deriveds) {
1464
+ const d = batch.async_deriveds.get(effect);
1465
+ if (d) deferred2.promise.then(d.resolve);
1877
1466
  }
1878
- if (s === void 0) {
1879
- if (!has || get_descriptor(target, prop)?.writable) {
1880
- s = with_parent(() => /* @__PURE__ */ state(void 0));
1881
- set(s, proxy(value2));
1882
- sources.set(prop, s);
1467
+ }
1468
+ if (!batch.#started) continue;
1469
+ var others = [...batch.current.keys()].filter((s) => !this.current.has(s));
1470
+ if (others.length === 0) {
1471
+ if (is_earlier) {
1472
+ batch.discard();
1473
+ }
1474
+ } else if (sources.length > 0) {
1475
+ if (is_earlier) {
1476
+ for (const unskipped of this.#unskipped_branches) {
1477
+ batch.unskip_effect(unskipped, (e) => {
1478
+ if ((e.f & (BLOCK_EFFECT | ASYNC)) !== 0) {
1479
+ batch.schedule(e);
1480
+ } else {
1481
+ batch.#defer_effects([e]);
1482
+ }
1483
+ });
1883
1484
  }
1884
- } else {
1885
- has = s.v !== UNINITIALIZED;
1886
- var p = with_parent(() => proxy(value2));
1887
- set(s, p);
1888
1485
  }
1889
- var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
1890
- if (descriptor?.set) {
1891
- descriptor.set.call(receiver, value2);
1486
+ batch.activate();
1487
+ var marked = /* @__PURE__ */ new Set();
1488
+ var checked = /* @__PURE__ */ new Map();
1489
+ for (var source2 of sources) {
1490
+ mark_effects(source2, others, marked, checked);
1892
1491
  }
1893
- if (!has) {
1894
- if (is_proxied_array && typeof prop === "string") {
1895
- var ls = (
1896
- /** @type {Source<number>} */
1897
- sources.get("length")
1898
- );
1899
- var n = Number(prop);
1900
- if (Number.isInteger(n) && n >= ls.v) {
1901
- set(ls, n + 1);
1492
+ checked = /* @__PURE__ */ new Map();
1493
+ var current_unequal = [...batch.current.keys()].filter(
1494
+ (c) => this.current.has(c) ? (
1495
+ /** @type {[any, boolean]} */
1496
+ this.current.get(c)[0] !== c.v
1497
+ ) : true
1498
+ );
1499
+ if (current_unequal.length > 0) {
1500
+ for (const effect of this.#new_effects) {
1501
+ if ((effect.f & (DESTROYED | INERT | EAGER_EFFECT)) === 0 && depends_on(effect, current_unequal, checked)) {
1502
+ if ((effect.f & (ASYNC | BLOCK_EFFECT)) !== 0) {
1503
+ set_signal_status(effect, DIRTY);
1504
+ batch.schedule(effect);
1505
+ } else {
1506
+ batch.#dirty_effects.add(effect);
1507
+ }
1902
1508
  }
1903
1509
  }
1904
- increment(version);
1905
1510
  }
1906
- return true;
1907
- },
1908
- ownKeys(target) {
1909
- get(version);
1910
- var own_keys = Reflect.ownKeys(target).filter((key2) => {
1911
- var source3 = sources.get(key2);
1912
- return source3 === void 0 || source3.v !== UNINITIALIZED;
1913
- });
1914
- for (var [key, source2] of sources) {
1915
- if (source2.v !== UNINITIALIZED && !(key in target)) {
1916
- own_keys.push(key);
1511
+ if (batch.#roots.length > 0) {
1512
+ batch.apply();
1513
+ for (var root of batch.#roots) {
1514
+ batch.#traverse(root, [], []);
1917
1515
  }
1516
+ batch.#roots = [];
1918
1517
  }
1919
- return own_keys;
1920
- },
1921
- setPrototypeOf() {
1922
- state_prototype_fixed();
1518
+ batch.deactivate();
1923
1519
  }
1924
1520
  }
1925
- );
1926
- }
1927
- var $window;
1928
- var first_child_getter;
1929
- var next_sibling_getter;
1930
- function init_operations() {
1931
- if ($window !== void 0) {
1932
- return;
1933
1521
  }
1934
- $window = window;
1935
- var element_prototype = Element.prototype;
1936
- var node_prototype = Node.prototype;
1937
- var text_prototype = Text.prototype;
1938
- first_child_getter = get_descriptor(node_prototype, "firstChild").get;
1939
- next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get;
1940
- if (is_extensible(element_prototype)) {
1941
- element_prototype[CLASS_CACHE] = void 0;
1942
- element_prototype[ATTRIBUTES_CACHE] = null;
1943
- element_prototype[STYLE_CACHE] = void 0;
1944
- element_prototype.__e = void 0;
1522
+ /**
1523
+ * @param {boolean} blocking
1524
+ * @param {Effect} effect
1525
+ */
1526
+ increment(blocking, effect) {
1527
+ this.#pending += 1;
1528
+ if (blocking) {
1529
+ let blocking_pending_count = this.#blocking_pending.get(effect) ?? 0;
1530
+ this.#blocking_pending.set(effect, blocking_pending_count + 1);
1531
+ }
1945
1532
  }
1946
- if (is_extensible(text_prototype)) {
1947
- text_prototype[TEXT_CACHE] = void 0;
1533
+ /**
1534
+ * @param {boolean} blocking
1535
+ * @param {Effect} effect
1536
+ */
1537
+ decrement(blocking, effect) {
1538
+ this.#pending -= 1;
1539
+ if (blocking) {
1540
+ let blocking_pending_count = this.#blocking_pending.get(effect) ?? 0;
1541
+ if (blocking_pending_count === 1) {
1542
+ this.#blocking_pending.delete(effect);
1543
+ } else {
1544
+ this.#blocking_pending.set(effect, blocking_pending_count - 1);
1545
+ }
1546
+ }
1547
+ if (this.#decrement_queued) return;
1548
+ this.#decrement_queued = true;
1549
+ queue_micro_task(() => {
1550
+ this.#decrement_queued = false;
1551
+ if (this.linked) {
1552
+ this.flush();
1553
+ }
1554
+ });
1555
+ }
1556
+ /**
1557
+ * @param {Set<Effect>} dirty_effects
1558
+ * @param {Set<Effect>} maybe_dirty_effects
1559
+ */
1560
+ transfer_effects(dirty_effects, maybe_dirty_effects) {
1561
+ for (const e of dirty_effects) {
1562
+ this.#dirty_effects.add(e);
1563
+ }
1564
+ for (const e of maybe_dirty_effects) {
1565
+ this.#maybe_dirty_effects.add(e);
1566
+ }
1567
+ dirty_effects.clear();
1568
+ maybe_dirty_effects.clear();
1569
+ }
1570
+ /** @param {(batch: Batch) => void} fn */
1571
+ oncommit(fn) {
1572
+ this.#commit_callbacks.add(fn);
1573
+ }
1574
+ /** @param {(batch: Batch) => void} fn */
1575
+ ondiscard(fn) {
1576
+ this.#discard_callbacks.add(fn);
1577
+ }
1578
+ /** @param {(batch: Batch) => void} fn */
1579
+ on_fork_commit(fn) {
1580
+ this.#fork_commit_callbacks.add(fn);
1581
+ }
1582
+ run_fork_commit_callbacks() {
1583
+ for (const fn of this.#fork_commit_callbacks) fn(this);
1584
+ this.#fork_commit_callbacks.clear();
1585
+ }
1586
+ settled() {
1587
+ return (this.#deferred ??= deferred()).promise;
1588
+ }
1589
+ static ensure() {
1590
+ if (current_batch === null) {
1591
+ const batch = current_batch = new Batch();
1592
+ batch.#link();
1593
+ if (!is_processing && !is_flushing_sync) {
1594
+ queue_micro_task(() => {
1595
+ if (!batch.#started) {
1596
+ batch.flush();
1597
+ }
1598
+ });
1599
+ }
1600
+ }
1601
+ return current_batch;
1602
+ }
1603
+ apply() {
1604
+ {
1605
+ batch_values = null;
1606
+ return;
1607
+ }
1608
+ }
1609
+ /**
1610
+ *
1611
+ * @param {Effect} effect
1612
+ */
1613
+ schedule(effect) {
1614
+ last_scheduled_effect = effect;
1615
+ if (effect.b?.is_pending && (effect.f & (EFFECT | RENDER_EFFECT | MANAGED_EFFECT)) !== 0 && (effect.f & REACTION_RAN) === 0) {
1616
+ effect.b.defer_effect(effect);
1617
+ return;
1618
+ }
1619
+ var e = effect;
1620
+ while (e.parent !== null) {
1621
+ e = e.parent;
1622
+ var flags = e.f;
1623
+ if (collected_effects !== null && e === active_effect) {
1624
+ if ((active_reaction === null || (active_reaction.f & DERIVED) === 0) && true) {
1625
+ return;
1626
+ }
1627
+ }
1628
+ if ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {
1629
+ if ((flags & CLEAN) === 0) {
1630
+ return;
1631
+ }
1632
+ e.f ^= CLEAN;
1633
+ }
1634
+ }
1635
+ this.#roots.push(e);
1636
+ }
1637
+ #link() {
1638
+ if (last_batch === null) {
1639
+ first_batch = last_batch = this;
1640
+ } else {
1641
+ last_batch.#next = this;
1642
+ this.#prev = last_batch;
1643
+ }
1644
+ last_batch = this;
1645
+ }
1646
+ #unlink() {
1647
+ var prev = this.#prev;
1648
+ var next = this.#next;
1649
+ if (prev === null) {
1650
+ first_batch = next;
1651
+ } else {
1652
+ prev.#next = next;
1653
+ }
1654
+ if (next === null) {
1655
+ last_batch = prev;
1656
+ } else {
1657
+ next.#prev = prev;
1658
+ }
1659
+ this.linked = false;
1948
1660
  }
1949
1661
  }
1950
- function create_text(value = "") {
1951
- return document.createTextNode(value);
1952
- }
1953
- // @__NO_SIDE_EFFECTS__
1954
- function get_first_child(node) {
1955
- return (
1956
- /** @type {TemplateNode | null} */
1957
- first_child_getter.call(node)
1958
- );
1959
- }
1960
- // @__NO_SIDE_EFFECTS__
1961
- function get_next_sibling(node) {
1962
- return (
1963
- /** @type {TemplateNode | null} */
1964
- next_sibling_getter.call(node)
1965
- );
1966
- }
1967
- function clear_text_content(node) {
1968
- node.textContent = "";
1969
- }
1970
- function without_reactive_context(fn) {
1971
- var previous_reaction = active_reaction;
1972
- var previous_effect = active_effect;
1973
- set_active_reaction(null);
1974
- set_active_effect(null);
1662
+ function flushSync(fn) {
1663
+ var was_flushing_sync = is_flushing_sync;
1664
+ is_flushing_sync = true;
1975
1665
  try {
1976
- return fn();
1666
+ var result;
1667
+ if (fn) ;
1668
+ while (true) {
1669
+ flush_tasks();
1670
+ if (current_batch === null) {
1671
+ return (
1672
+ /** @type {T} */
1673
+ result
1674
+ );
1675
+ }
1676
+ current_batch.flush();
1677
+ }
1977
1678
  } finally {
1978
- set_active_reaction(previous_reaction);
1979
- set_active_effect(previous_effect);
1679
+ is_flushing_sync = was_flushing_sync;
1980
1680
  }
1981
1681
  }
1982
- function push_effect(effect, parent_effect) {
1983
- var parent_last = parent_effect.last;
1984
- if (parent_last === null) {
1985
- parent_effect.last = parent_effect.first = effect;
1986
- } else {
1987
- parent_last.next = effect;
1988
- effect.prev = parent_last;
1989
- parent_effect.last = effect;
1682
+ function infinite_loop_guard() {
1683
+ try {
1684
+ effect_update_depth_exceeded();
1685
+ } catch (error) {
1686
+ invoke_error_boundary(error, last_scheduled_effect);
1990
1687
  }
1991
1688
  }
1992
- function create_effect(type, fn) {
1993
- var parent = active_effect;
1994
- if (parent !== null && (parent.f & INERT) !== 0) {
1995
- type |= INERT;
1996
- }
1997
- var effect = {
1998
- ctx: component_context,
1999
- deps: null,
2000
- nodes: null,
2001
- f: type | DIRTY | CONNECTED,
2002
- first: null,
2003
- fn,
2004
- last: null,
2005
- next: null,
2006
- parent,
2007
- b: parent && parent.b,
2008
- prev: null,
2009
- teardown: null,
2010
- wv: 0,
2011
- ac: null
2012
- };
2013
- current_batch?.register_created_effect(effect);
2014
- var e = effect;
2015
- if ((type & EFFECT) !== 0) {
2016
- if (collected_effects !== null) {
2017
- collected_effects.push(effect);
2018
- } else {
2019
- Batch.ensure().schedule(effect);
2020
- }
2021
- } else if (fn !== null) {
2022
- try {
1689
+ let eager_block_effects = null;
1690
+ function flush_queued_effects(effects) {
1691
+ var length = effects.length;
1692
+ if (length === 0) return;
1693
+ var i = 0;
1694
+ while (i < length) {
1695
+ var effect = effects[i++];
1696
+ if ((effect.f & (DESTROYED | INERT)) === 0 && is_dirty(effect)) {
1697
+ eager_block_effects = /* @__PURE__ */ new Set();
2023
1698
  update_effect(effect);
2024
- } catch (e2) {
2025
- destroy_effect(effect);
2026
- throw e2;
2027
- }
2028
- if (e.deps === null && e.teardown === null && e.nodes === null && e.first === e.last && // either `null`, or a singular child
2029
- (e.f & EFFECT_PRESERVED) === 0) {
2030
- e = e.first;
2031
- if ((type & BLOCK_EFFECT) !== 0 && (type & EFFECT_TRANSPARENT) !== 0 && e !== null) {
2032
- e.f |= EFFECT_TRANSPARENT;
1699
+ if (effect.deps === null && effect.first === null && effect.nodes === null && effect.teardown === null && effect.ac === null) {
1700
+ unlink_effect(effect);
1701
+ }
1702
+ if (eager_block_effects?.size > 0) {
1703
+ old_values.clear();
1704
+ for (const e of eager_block_effects) {
1705
+ if ((e.f & (DESTROYED | INERT)) !== 0) continue;
1706
+ const ordered_effects = [e];
1707
+ let ancestor = e.parent;
1708
+ while (ancestor !== null) {
1709
+ if (eager_block_effects.has(ancestor)) {
1710
+ eager_block_effects.delete(ancestor);
1711
+ ordered_effects.push(ancestor);
1712
+ }
1713
+ ancestor = ancestor.parent;
1714
+ }
1715
+ for (let j = ordered_effects.length - 1; j >= 0; j--) {
1716
+ const e2 = ordered_effects[j];
1717
+ if ((e2.f & (DESTROYED | INERT)) !== 0) continue;
1718
+ update_effect(e2);
1719
+ }
1720
+ }
1721
+ eager_block_effects.clear();
2033
1722
  }
2034
1723
  }
2035
1724
  }
2036
- if (e !== null) {
2037
- e.parent = parent;
2038
- if (parent !== null) {
2039
- push_effect(e, parent);
2040
- }
2041
- if (active_reaction !== null && (active_reaction.f & DERIVED) !== 0 && (type & ROOT_EFFECT) === 0) {
2042
- var derived2 = (
2043
- /** @type {Derived} */
2044
- active_reaction
2045
- );
2046
- (derived2.effects ??= []).push(e);
1725
+ eager_block_effects = null;
1726
+ }
1727
+ function mark_effects(value, sources, marked, checked) {
1728
+ if (marked.has(value)) return;
1729
+ marked.add(value);
1730
+ if (value.reactions !== null) {
1731
+ for (const reaction of value.reactions) {
1732
+ const flags = reaction.f;
1733
+ if ((flags & DERIVED) !== 0) {
1734
+ mark_effects(
1735
+ /** @type {Derived} */
1736
+ reaction,
1737
+ sources,
1738
+ marked,
1739
+ checked
1740
+ );
1741
+ } else if ((flags & (ASYNC | BLOCK_EFFECT)) !== 0 && (flags & DIRTY) === 0 && depends_on(reaction, sources, checked)) {
1742
+ set_signal_status(reaction, DIRTY);
1743
+ schedule_effect(
1744
+ /** @type {Effect} */
1745
+ reaction
1746
+ );
1747
+ }
2047
1748
  }
2048
1749
  }
2049
- return effect;
2050
- }
2051
- function effect_tracking() {
2052
- return active_reaction !== null && !untracking;
2053
- }
2054
- function create_user_effect(fn) {
2055
- return create_effect(EFFECT | USER_EFFECT, fn);
2056
1750
  }
2057
- function component_root(fn) {
2058
- Batch.ensure();
2059
- const effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn);
2060
- return (options = {}) => {
2061
- return new Promise((fulfil) => {
2062
- if (options.outro) {
2063
- pause_effect(effect, () => {
2064
- destroy_effect(effect);
2065
- fulfil(void 0);
2066
- });
2067
- } else {
2068
- destroy_effect(effect);
2069
- fulfil(void 0);
1751
+ function depends_on(reaction, sources, checked) {
1752
+ const depends = checked.get(reaction);
1753
+ if (depends !== void 0) return depends;
1754
+ if (reaction.deps !== null) {
1755
+ for (const dep of reaction.deps) {
1756
+ if (includes.call(sources, dep)) {
1757
+ return true;
2070
1758
  }
2071
- });
2072
- };
1759
+ if ((dep.f & DERIVED) !== 0 && depends_on(
1760
+ /** @type {Derived} */
1761
+ dep,
1762
+ sources,
1763
+ checked
1764
+ )) {
1765
+ checked.set(
1766
+ /** @type {Derived} */
1767
+ dep,
1768
+ true
1769
+ );
1770
+ return true;
1771
+ }
1772
+ }
1773
+ }
1774
+ checked.set(reaction, false);
1775
+ return false;
2073
1776
  }
2074
- function render_effect(fn, flags = 0) {
2075
- return create_effect(RENDER_EFFECT | flags, fn);
1777
+ function schedule_effect(effect) {
1778
+ current_batch.schedule(effect);
2076
1779
  }
2077
- function block(fn, flags = 0) {
2078
- var effect = create_effect(BLOCK_EFFECT | flags, fn);
2079
- return effect;
1780
+ function reset_branch(effect, tracked) {
1781
+ if ((effect.f & BRANCH_EFFECT) !== 0 && (effect.f & CLEAN) !== 0) {
1782
+ return;
1783
+ }
1784
+ if ((effect.f & DIRTY) !== 0) {
1785
+ tracked.d.push(effect);
1786
+ } else if ((effect.f & MAYBE_DIRTY) !== 0) {
1787
+ tracked.m.push(effect);
1788
+ }
1789
+ set_signal_status(effect, CLEAN);
1790
+ var e = effect.first;
1791
+ while (e !== null) {
1792
+ reset_branch(e, tracked);
1793
+ e = e.next;
1794
+ }
2080
1795
  }
2081
- function branch(fn) {
2082
- return create_effect(BRANCH_EFFECT | EFFECT_PRESERVED, fn);
1796
+ function reset_all(effect) {
1797
+ set_signal_status(effect, CLEAN);
1798
+ var e = effect.first;
1799
+ while (e !== null) {
1800
+ reset_all(e);
1801
+ e = e.next;
1802
+ }
2083
1803
  }
2084
- function execute_effect_teardown(effect) {
2085
- var teardown = effect.teardown;
2086
- if (teardown !== null) {
2087
- const previously_destroying_effect = is_destroying_effect;
2088
- const previous_reaction = active_reaction;
2089
- set_is_destroying_effect(true);
2090
- set_active_reaction(null);
2091
- try {
2092
- teardown.call(null);
2093
- } finally {
2094
- set_is_destroying_effect(previously_destroying_effect);
2095
- set_active_reaction(previous_reaction);
1804
+ function destroy_derived_effects(derived2) {
1805
+ var effects = derived2.effects;
1806
+ if (effects !== null) {
1807
+ derived2.effects = null;
1808
+ for (var i = 0; i < effects.length; i += 1) {
1809
+ destroy_effect(
1810
+ /** @type {Effect} */
1811
+ effects[i]
1812
+ );
2096
1813
  }
2097
1814
  }
2098
1815
  }
2099
- function destroy_effect_children(signal, remove_dom = false) {
2100
- var effect = signal.first;
2101
- signal.first = signal.last = null;
2102
- while (effect !== null) {
2103
- const controller2 = effect.ac;
2104
- if (controller2 !== null) {
2105
- without_reactive_context(() => {
2106
- controller2.abort(STALE_REACTION);
2107
- });
2108
- }
2109
- var next = effect.next;
2110
- if ((effect.f & ROOT_EFFECT) !== 0) {
2111
- effect.parent = null;
2112
- } else {
2113
- destroy_effect(effect, remove_dom);
1816
+ function execute_derived(derived2) {
1817
+ var value;
1818
+ var prev_active_effect = active_effect;
1819
+ var parent = derived2.parent;
1820
+ if (!is_destroying_effect && parent !== null && (parent.f & (DESTROYED | INERT)) !== 0) {
1821
+ derived_inert();
1822
+ return derived2.v;
1823
+ }
1824
+ set_active_effect(parent);
1825
+ {
1826
+ try {
1827
+ derived2.f &= ~WAS_MARKED;
1828
+ destroy_derived_effects(derived2);
1829
+ value = update_reaction(derived2);
1830
+ } finally {
1831
+ set_active_effect(prev_active_effect);
2114
1832
  }
2115
- effect = next;
2116
1833
  }
1834
+ return value;
2117
1835
  }
2118
- function destroy_block_effect_children(signal) {
2119
- var effect = signal.first;
2120
- while (effect !== null) {
2121
- var next = effect.next;
2122
- if ((effect.f & BRANCH_EFFECT) === 0) {
2123
- destroy_effect(effect);
1836
+ function update_derived(derived2) {
1837
+ var value = execute_derived(derived2);
1838
+ if (!derived2.equals(value)) {
1839
+ derived2.wv = increment_write_version();
1840
+ if (!current_batch?.is_fork || derived2.deps === null) {
1841
+ if (current_batch !== null) {
1842
+ current_batch.capture(derived2, value, true);
1843
+ previous_batch?.capture(derived2, value, true);
1844
+ } else {
1845
+ derived2.v = value;
1846
+ }
1847
+ if (derived2.deps === null) {
1848
+ set_signal_status(derived2, CLEAN);
1849
+ return;
1850
+ }
2124
1851
  }
2125
- effect = next;
2126
1852
  }
2127
- }
2128
- function destroy_effect(effect, remove_dom = true) {
2129
- var removed = false;
2130
- if ((remove_dom || (effect.f & HEAD_EFFECT) !== 0) && effect.nodes !== null && effect.nodes.end !== null) {
2131
- remove_effect_dom(
2132
- effect.nodes.start,
2133
- /** @type {TemplateNode} */
2134
- effect.nodes.end
2135
- );
2136
- removed = true;
1853
+ if (is_destroying_effect) {
1854
+ return;
2137
1855
  }
2138
- set_signal_status(effect, DESTROYING);
2139
- destroy_effect_children(effect, remove_dom && !removed);
2140
- remove_reactions(effect, 0);
2141
- var transitions = effect.nodes && effect.nodes.t;
2142
- if (transitions !== null) {
2143
- for (const transition of transitions) {
2144
- transition.stop();
1856
+ if (batch_values !== null) {
1857
+ if (effect_tracking() || current_batch?.is_fork) {
1858
+ batch_values.set(derived2, value);
2145
1859
  }
1860
+ } else {
1861
+ update_derived_status(derived2);
2146
1862
  }
2147
- execute_effect_teardown(effect);
2148
- effect.f ^= DESTROYING;
2149
- effect.f |= DESTROYED;
2150
- var parent = effect.parent;
2151
- if (parent !== null && parent.first !== null) {
2152
- unlink_effect(effect);
2153
- }
2154
- effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes = effect.ac = effect.b = null;
2155
1863
  }
2156
- function remove_effect_dom(node, end) {
2157
- while (node !== null) {
2158
- var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
2159
- node.remove();
2160
- node = next;
1864
+ function freeze_derived_effects(derived2) {
1865
+ if (derived2.effects === null) return;
1866
+ for (const e of derived2.effects) {
1867
+ if (e.teardown || e.ac) {
1868
+ e.teardown?.();
1869
+ e.ac?.abort(STALE_REACTION);
1870
+ e.teardown = noop;
1871
+ e.ac = null;
1872
+ remove_reactions(e, 0);
1873
+ destroy_effect_children(e);
1874
+ }
2161
1875
  }
2162
1876
  }
2163
- function unlink_effect(effect) {
2164
- var parent = effect.parent;
2165
- var prev = effect.prev;
2166
- var next = effect.next;
2167
- if (prev !== null) prev.next = next;
2168
- if (next !== null) next.prev = prev;
2169
- if (parent !== null) {
2170
- if (parent.first === effect) parent.first = next;
2171
- if (parent.last === effect) parent.last = prev;
1877
+ function unfreeze_derived_effects(derived2) {
1878
+ if (derived2.effects === null) return;
1879
+ for (const e of derived2.effects) {
1880
+ if (e.teardown) {
1881
+ update_effect(e);
1882
+ }
2172
1883
  }
2173
1884
  }
2174
- function pause_effect(effect, callback, destroy = true) {
2175
- var transitions = [];
2176
- pause_children(effect, transitions, true);
2177
- var fn = () => {
2178
- if (destroy) destroy_effect(effect);
2179
- if (callback) callback();
1885
+ let eager_effects = /* @__PURE__ */ new Set();
1886
+ const old_values = /* @__PURE__ */ new Map();
1887
+ let eager_effects_deferred = false;
1888
+ function source(v, stack) {
1889
+ var signal = {
1890
+ f: 0,
1891
+ // TODO ideally we could skip this altogether, but it causes type errors
1892
+ v,
1893
+ reactions: null,
1894
+ equals,
1895
+ rv: 0,
1896
+ wv: 0
2180
1897
  };
2181
- var remaining = transitions.length;
2182
- if (remaining > 0) {
2183
- var check = () => --remaining || fn();
2184
- for (var transition of transitions) {
2185
- transition.out(check);
2186
- }
2187
- } else {
2188
- fn();
1898
+ return signal;
1899
+ }
1900
+ // @__NO_SIDE_EFFECTS__
1901
+ function state(v, stack) {
1902
+ const s = source(v);
1903
+ push_reaction_value(s);
1904
+ return s;
1905
+ }
1906
+ // @__NO_SIDE_EFFECTS__
1907
+ function mutable_source(initial_value, immutable = false, trackable = true) {
1908
+ const s = source(initial_value);
1909
+ if (!immutable) {
1910
+ s.equals = safe_equals;
2189
1911
  }
1912
+ return s;
2190
1913
  }
2191
- function pause_children(effect, transitions, local) {
2192
- if ((effect.f & INERT) !== 0) return;
2193
- effect.f ^= INERT;
2194
- var t = effect.nodes && effect.nodes.t;
2195
- if (t !== null) {
2196
- for (const transition of t) {
2197
- if (transition.is_global || local) {
2198
- transitions.push(transition);
1914
+ function set(source2, value, should_proxy = false) {
1915
+ if (active_reaction !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
1916
+ // to ensure we error if state is set inside an inspect effect
1917
+ (!untracking || (active_reaction.f & EAGER_EFFECT) !== 0) && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | EAGER_EFFECT)) !== 0 && (current_sources === null || !includes.call(current_sources, source2))) {
1918
+ state_unsafe_mutation();
1919
+ }
1920
+ let new_value = should_proxy ? proxy(value) : value;
1921
+ return internal_set(source2, new_value, legacy_updates);
1922
+ }
1923
+ function internal_set(source2, value, updated_during_traversal = null) {
1924
+ if (!source2.equals(value)) {
1925
+ old_values.set(source2, is_destroying_effect ? value : source2.v);
1926
+ var batch = Batch.ensure();
1927
+ batch.capture(source2, value);
1928
+ if ((source2.f & DERIVED) !== 0) {
1929
+ const derived2 = (
1930
+ /** @type {Derived} */
1931
+ source2
1932
+ );
1933
+ if ((source2.f & DIRTY) !== 0) {
1934
+ execute_derived(derived2);
1935
+ }
1936
+ if (batch_values === null) {
1937
+ update_derived_status(derived2);
1938
+ }
1939
+ }
1940
+ source2.wv = increment_write_version();
1941
+ mark_reactions(source2, DIRTY, updated_during_traversal);
1942
+ if (active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0) {
1943
+ if (untracked_writes === null) {
1944
+ set_untracked_writes([source2]);
1945
+ } else {
1946
+ untracked_writes.push(source2);
2199
1947
  }
2200
1948
  }
1949
+ if (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) {
1950
+ flush_eager_effects();
1951
+ }
2201
1952
  }
2202
- var child = effect.first;
2203
- while (child !== null) {
2204
- var sibling = child.next;
2205
- if ((child.f & ROOT_EFFECT) === 0) {
2206
- var transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || // If this is a branch effect without a block effect parent,
2207
- // it means the parent block effect was pruned. In that case,
2208
- // transparency information was transferred to the branch effect.
2209
- (child.f & BRANCH_EFFECT) !== 0 && (effect.f & BLOCK_EFFECT) !== 0;
2210
- pause_children(child, transitions, transparent ? local : false);
1953
+ return value;
1954
+ }
1955
+ function flush_eager_effects() {
1956
+ eager_effects_deferred = false;
1957
+ for (const effect of eager_effects) {
1958
+ if ((effect.f & CLEAN) !== 0) {
1959
+ set_signal_status(effect, MAYBE_DIRTY);
1960
+ }
1961
+ let dirty;
1962
+ try {
1963
+ dirty = is_dirty(effect);
1964
+ } catch {
1965
+ dirty = true;
1966
+ }
1967
+ if (dirty) {
1968
+ update_effect(effect);
2211
1969
  }
2212
- child = sibling;
2213
1970
  }
1971
+ eager_effects.clear();
2214
1972
  }
2215
- function move_effect(effect, fragment) {
2216
- if (!effect.nodes) return;
2217
- var node = effect.nodes.start;
2218
- var end = effect.nodes.end;
2219
- while (node !== null) {
2220
- var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
2221
- fragment.append(node);
2222
- node = next;
1973
+ function increment(source2) {
1974
+ set(source2, source2.v + 1);
1975
+ }
1976
+ function mark_reactions(signal, status, updated_during_traversal) {
1977
+ var reactions = signal.reactions;
1978
+ if (reactions === null) return;
1979
+ var length = reactions.length;
1980
+ for (var i = 0; i < length; i++) {
1981
+ var reaction = reactions[i];
1982
+ var flags = reaction.f;
1983
+ var not_dirty = (flags & DIRTY) === 0;
1984
+ if (not_dirty) {
1985
+ set_signal_status(reaction, status);
1986
+ }
1987
+ if ((flags & EAGER_EFFECT) !== 0) {
1988
+ eager_effects.add(
1989
+ /** @type {Effect} */
1990
+ reaction
1991
+ );
1992
+ } else if ((flags & DERIVED) !== 0) {
1993
+ var derived2 = (
1994
+ /** @type {Derived} */
1995
+ reaction
1996
+ );
1997
+ batch_values?.delete(derived2);
1998
+ if ((flags & WAS_MARKED) === 0) {
1999
+ if (flags & CONNECTED && (active_effect === null || (active_effect.f & REACTION_IS_UPDATING) === 0)) {
2000
+ reaction.f |= WAS_MARKED;
2001
+ }
2002
+ mark_reactions(derived2, MAYBE_DIRTY, updated_during_traversal);
2003
+ }
2004
+ } else if (not_dirty) {
2005
+ var effect = (
2006
+ /** @type {Effect} */
2007
+ reaction
2008
+ );
2009
+ if ((flags & BLOCK_EFFECT) !== 0 && eager_block_effects !== null) {
2010
+ eager_block_effects.add(effect);
2011
+ }
2012
+ if (updated_during_traversal !== null) {
2013
+ updated_during_traversal.push(effect);
2014
+ } else {
2015
+ schedule_effect(effect);
2016
+ }
2017
+ }
2018
+ }
2019
+ }
2020
+ function without_reactive_context(fn) {
2021
+ var previous_reaction = active_reaction;
2022
+ var previous_effect = active_effect;
2023
+ set_active_reaction(null);
2024
+ set_active_effect(null);
2025
+ try {
2026
+ return fn();
2027
+ } finally {
2028
+ set_active_reaction(previous_reaction);
2029
+ set_active_effect(previous_effect);
2223
2030
  }
2224
2031
  }
2225
2032
  let is_updating_effect = false;
@@ -2486,140 +2293,369 @@ function update_effect(effect) {
2486
2293
  if ((flags & (BLOCK_EFFECT | MANAGED_EFFECT)) !== 0) {
2487
2294
  destroy_block_effect_children(effect);
2488
2295
  } else {
2489
- destroy_effect_children(effect);
2296
+ destroy_effect_children(effect);
2297
+ }
2298
+ execute_effect_teardown(effect);
2299
+ var teardown = update_reaction(effect);
2300
+ effect.teardown = typeof teardown === "function" ? teardown : null;
2301
+ effect.wv = write_version;
2302
+ var dep;
2303
+ if (browser && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) ;
2304
+ } finally {
2305
+ is_updating_effect = was_updating_effect;
2306
+ active_effect = previous_effect;
2307
+ }
2308
+ }
2309
+ function get(signal) {
2310
+ var flags = signal.f;
2311
+ var is_derived = (flags & DERIVED) !== 0;
2312
+ if (active_reaction !== null && !untracking) {
2313
+ var destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0;
2314
+ if (!destroyed && (current_sources === null || !includes.call(current_sources, signal))) {
2315
+ var deps = active_reaction.deps;
2316
+ if ((active_reaction.f & REACTION_IS_UPDATING) !== 0) {
2317
+ if (signal.rv < read_version) {
2318
+ signal.rv = read_version;
2319
+ if (new_deps === null && deps !== null && deps[skipped_deps] === signal) {
2320
+ skipped_deps++;
2321
+ } else if (new_deps === null) {
2322
+ new_deps = [signal];
2323
+ } else {
2324
+ new_deps.push(signal);
2325
+ }
2326
+ }
2327
+ } else {
2328
+ (active_reaction.deps ??= []).push(signal);
2329
+ var reactions = signal.reactions;
2330
+ if (reactions === null) {
2331
+ signal.reactions = [active_reaction];
2332
+ } else if (!includes.call(reactions, active_reaction)) {
2333
+ reactions.push(active_reaction);
2334
+ }
2335
+ }
2336
+ }
2337
+ }
2338
+ if (is_destroying_effect && old_values.has(signal)) {
2339
+ return old_values.get(signal);
2340
+ }
2341
+ if (is_derived) {
2342
+ var derived2 = (
2343
+ /** @type {Derived} */
2344
+ signal
2345
+ );
2346
+ if (is_destroying_effect) {
2347
+ var value = derived2.v;
2348
+ if ((derived2.f & CLEAN) === 0 && derived2.reactions !== null || depends_on_old_values(derived2)) {
2349
+ value = execute_derived(derived2);
2350
+ }
2351
+ old_values.set(derived2, value);
2352
+ return value;
2353
+ }
2354
+ var should_connect = (derived2.f & CONNECTED) === 0 && !untracking && active_reaction !== null && (is_updating_effect || (active_reaction.f & CONNECTED) !== 0);
2355
+ var is_new = (derived2.f & REACTION_RAN) === 0;
2356
+ if (is_dirty(derived2)) {
2357
+ if (should_connect) {
2358
+ derived2.f |= CONNECTED;
2359
+ }
2360
+ update_derived(derived2);
2361
+ }
2362
+ if (should_connect && !is_new) {
2363
+ unfreeze_derived_effects(derived2);
2364
+ reconnect(derived2);
2365
+ }
2366
+ }
2367
+ if (batch_values?.has(signal)) {
2368
+ return batch_values.get(signal);
2369
+ }
2370
+ if ((signal.f & ERROR_VALUE) !== 0) {
2371
+ throw signal.v;
2372
+ }
2373
+ return signal.v;
2374
+ }
2375
+ function reconnect(derived2) {
2376
+ derived2.f |= CONNECTED;
2377
+ if (derived2.deps === null) return;
2378
+ for (const dep of derived2.deps) {
2379
+ (dep.reactions ??= []).push(derived2);
2380
+ if ((dep.f & DERIVED) !== 0 && (dep.f & CONNECTED) === 0) {
2381
+ unfreeze_derived_effects(
2382
+ /** @type {Derived} */
2383
+ dep
2384
+ );
2385
+ reconnect(
2386
+ /** @type {Derived} */
2387
+ dep
2388
+ );
2389
+ }
2390
+ }
2391
+ }
2392
+ function depends_on_old_values(derived2) {
2393
+ if (derived2.v === UNINITIALIZED) return true;
2394
+ if (derived2.deps === null) return false;
2395
+ for (const dep of derived2.deps) {
2396
+ if (old_values.has(dep)) {
2397
+ return true;
2398
+ }
2399
+ if ((dep.f & DERIVED) !== 0 && depends_on_old_values(
2400
+ /** @type {Derived} */
2401
+ dep
2402
+ )) {
2403
+ return true;
2404
+ }
2405
+ }
2406
+ return false;
2407
+ }
2408
+ function untrack(fn) {
2409
+ var previous_untracking = untracking;
2410
+ try {
2411
+ untracking = true;
2412
+ return fn();
2413
+ } finally {
2414
+ untracking = previous_untracking;
2415
+ }
2416
+ }
2417
+ function push_effect(effect, parent_effect) {
2418
+ var parent_last = parent_effect.last;
2419
+ if (parent_last === null) {
2420
+ parent_effect.last = parent_effect.first = effect;
2421
+ } else {
2422
+ parent_last.next = effect;
2423
+ effect.prev = parent_last;
2424
+ parent_effect.last = effect;
2425
+ }
2426
+ }
2427
+ function create_effect(type, fn) {
2428
+ var parent = active_effect;
2429
+ if (parent !== null && (parent.f & INERT) !== 0) {
2430
+ type |= INERT;
2431
+ }
2432
+ var effect = {
2433
+ ctx: component_context,
2434
+ deps: null,
2435
+ nodes: null,
2436
+ f: type | DIRTY | CONNECTED,
2437
+ first: null,
2438
+ fn,
2439
+ last: null,
2440
+ next: null,
2441
+ parent,
2442
+ b: parent && parent.b,
2443
+ prev: null,
2444
+ teardown: null,
2445
+ wv: 0,
2446
+ ac: null
2447
+ };
2448
+ current_batch?.register_created_effect(effect);
2449
+ var e = effect;
2450
+ if ((type & EFFECT) !== 0) {
2451
+ if (collected_effects !== null) {
2452
+ collected_effects.push(effect);
2453
+ } else {
2454
+ Batch.ensure().schedule(effect);
2455
+ }
2456
+ } else if (fn !== null) {
2457
+ try {
2458
+ update_effect(effect);
2459
+ } catch (e2) {
2460
+ destroy_effect(effect);
2461
+ throw e2;
2462
+ }
2463
+ if (e.deps === null && e.teardown === null && e.nodes === null && e.first === e.last && // either `null`, or a singular child
2464
+ (e.f & EFFECT_PRESERVED) === 0) {
2465
+ e = e.first;
2466
+ if ((type & BLOCK_EFFECT) !== 0 && (type & EFFECT_TRANSPARENT) !== 0 && e !== null) {
2467
+ e.f |= EFFECT_TRANSPARENT;
2468
+ }
2469
+ }
2470
+ }
2471
+ if (e !== null) {
2472
+ e.parent = parent;
2473
+ if (parent !== null) {
2474
+ push_effect(e, parent);
2475
+ }
2476
+ if (active_reaction !== null && (active_reaction.f & DERIVED) !== 0 && (type & ROOT_EFFECT) === 0) {
2477
+ var derived2 = (
2478
+ /** @type {Derived} */
2479
+ active_reaction
2480
+ );
2481
+ (derived2.effects ??= []).push(e);
2482
+ }
2483
+ }
2484
+ return effect;
2485
+ }
2486
+ function effect_tracking() {
2487
+ return active_reaction !== null && !untracking;
2488
+ }
2489
+ function create_user_effect(fn) {
2490
+ return create_effect(EFFECT | USER_EFFECT, fn);
2491
+ }
2492
+ function component_root(fn) {
2493
+ Batch.ensure();
2494
+ const effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn);
2495
+ return (options = {}) => {
2496
+ return new Promise((fulfil) => {
2497
+ if (options.outro) {
2498
+ pause_effect(effect, () => {
2499
+ destroy_effect(effect);
2500
+ fulfil(void 0);
2501
+ });
2502
+ } else {
2503
+ destroy_effect(effect);
2504
+ fulfil(void 0);
2505
+ }
2506
+ });
2507
+ };
2508
+ }
2509
+ function render_effect(fn, flags = 0) {
2510
+ return create_effect(RENDER_EFFECT | flags, fn);
2511
+ }
2512
+ function block(fn, flags = 0) {
2513
+ var effect = create_effect(BLOCK_EFFECT | flags, fn);
2514
+ return effect;
2515
+ }
2516
+ function branch(fn) {
2517
+ return create_effect(BRANCH_EFFECT | EFFECT_PRESERVED, fn);
2518
+ }
2519
+ function execute_effect_teardown(effect) {
2520
+ var teardown = effect.teardown;
2521
+ if (teardown !== null) {
2522
+ const previously_destroying_effect = is_destroying_effect;
2523
+ const previous_reaction = active_reaction;
2524
+ set_is_destroying_effect(true);
2525
+ set_active_reaction(null);
2526
+ try {
2527
+ teardown.call(null);
2528
+ } finally {
2529
+ set_is_destroying_effect(previously_destroying_effect);
2530
+ set_active_reaction(previous_reaction);
2531
+ }
2532
+ }
2533
+ }
2534
+ function destroy_effect_children(signal, remove_dom = false) {
2535
+ var effect = signal.first;
2536
+ signal.first = signal.last = null;
2537
+ while (effect !== null) {
2538
+ const controller2 = effect.ac;
2539
+ if (controller2 !== null) {
2540
+ without_reactive_context(() => {
2541
+ controller2.abort(STALE_REACTION);
2542
+ });
2543
+ }
2544
+ var next = effect.next;
2545
+ if ((effect.f & ROOT_EFFECT) !== 0) {
2546
+ effect.parent = null;
2547
+ } else {
2548
+ destroy_effect(effect, remove_dom);
2490
2549
  }
2491
- execute_effect_teardown(effect);
2492
- var teardown = update_reaction(effect);
2493
- effect.teardown = typeof teardown === "function" ? teardown : null;
2494
- effect.wv = write_version;
2495
- var dep;
2496
- if (browser && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) ;
2497
- } finally {
2498
- is_updating_effect = was_updating_effect;
2499
- active_effect = previous_effect;
2550
+ effect = next;
2500
2551
  }
2501
2552
  }
2502
- function get(signal) {
2503
- var flags = signal.f;
2504
- var is_derived = (flags & DERIVED) !== 0;
2505
- if (active_reaction !== null && !untracking) {
2506
- var destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0;
2507
- if (!destroyed && (current_sources === null || !includes.call(current_sources, signal))) {
2508
- var deps = active_reaction.deps;
2509
- if ((active_reaction.f & REACTION_IS_UPDATING) !== 0) {
2510
- if (signal.rv < read_version) {
2511
- signal.rv = read_version;
2512
- if (new_deps === null && deps !== null && deps[skipped_deps] === signal) {
2513
- skipped_deps++;
2514
- } else if (new_deps === null) {
2515
- new_deps = [signal];
2516
- } else {
2517
- new_deps.push(signal);
2518
- }
2519
- }
2520
- } else {
2521
- (active_reaction.deps ??= []).push(signal);
2522
- var reactions = signal.reactions;
2523
- if (reactions === null) {
2524
- signal.reactions = [active_reaction];
2525
- } else if (!includes.call(reactions, active_reaction)) {
2526
- reactions.push(active_reaction);
2527
- }
2528
- }
2553
+ function destroy_block_effect_children(signal) {
2554
+ var effect = signal.first;
2555
+ while (effect !== null) {
2556
+ var next = effect.next;
2557
+ if ((effect.f & BRANCH_EFFECT) === 0) {
2558
+ destroy_effect(effect);
2529
2559
  }
2560
+ effect = next;
2530
2561
  }
2531
- if (is_destroying_effect && old_values.has(signal)) {
2532
- return old_values.get(signal);
2533
- }
2534
- if (is_derived) {
2535
- var derived2 = (
2536
- /** @type {Derived} */
2537
- signal
2562
+ }
2563
+ function destroy_effect(effect, remove_dom = true) {
2564
+ var removed = false;
2565
+ if ((remove_dom || (effect.f & HEAD_EFFECT) !== 0) && effect.nodes !== null && effect.nodes.end !== null) {
2566
+ remove_effect_dom(
2567
+ effect.nodes.start,
2568
+ /** @type {TemplateNode} */
2569
+ effect.nodes.end
2538
2570
  );
2539
- if (is_destroying_effect) {
2540
- var value = derived2.v;
2541
- if ((derived2.f & CLEAN) === 0 && derived2.reactions !== null || depends_on_old_values(derived2)) {
2542
- value = execute_derived(derived2);
2543
- }
2544
- old_values.set(derived2, value);
2545
- return value;
2546
- }
2547
- var should_connect = (derived2.f & CONNECTED) === 0 && !untracking && active_reaction !== null && (is_updating_effect || (active_reaction.f & CONNECTED) !== 0);
2548
- var is_new = (derived2.f & REACTION_RAN) === 0;
2549
- if (is_dirty(derived2)) {
2550
- if (should_connect) {
2551
- derived2.f |= CONNECTED;
2552
- }
2553
- update_derived(derived2);
2554
- }
2555
- if (should_connect && !is_new) {
2556
- unfreeze_derived_effects(derived2);
2557
- reconnect(derived2);
2571
+ removed = true;
2572
+ }
2573
+ set_signal_status(effect, DESTROYING);
2574
+ destroy_effect_children(effect, remove_dom && !removed);
2575
+ remove_reactions(effect, 0);
2576
+ var transitions = effect.nodes && effect.nodes.t;
2577
+ if (transitions !== null) {
2578
+ for (const transition of transitions) {
2579
+ transition.stop();
2558
2580
  }
2559
2581
  }
2560
- if (batch_values?.has(signal)) {
2561
- return batch_values.get(signal);
2582
+ execute_effect_teardown(effect);
2583
+ effect.f ^= DESTROYING;
2584
+ effect.f |= DESTROYED;
2585
+ var parent = effect.parent;
2586
+ if (parent !== null && parent.first !== null) {
2587
+ unlink_effect(effect);
2562
2588
  }
2563
- if ((signal.f & ERROR_VALUE) !== 0) {
2564
- throw signal.v;
2589
+ effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes = effect.ac = effect.b = null;
2590
+ }
2591
+ function remove_effect_dom(node, end) {
2592
+ while (node !== null) {
2593
+ var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
2594
+ node.remove();
2595
+ node = next;
2565
2596
  }
2566
- return signal.v;
2567
2597
  }
2568
- function reconnect(derived2) {
2569
- derived2.f |= CONNECTED;
2570
- if (derived2.deps === null) return;
2571
- for (const dep of derived2.deps) {
2572
- (dep.reactions ??= []).push(derived2);
2573
- if ((dep.f & DERIVED) !== 0 && (dep.f & CONNECTED) === 0) {
2574
- unfreeze_derived_effects(
2575
- /** @type {Derived} */
2576
- dep
2577
- );
2578
- reconnect(
2579
- /** @type {Derived} */
2580
- dep
2581
- );
2582
- }
2598
+ function unlink_effect(effect) {
2599
+ var parent = effect.parent;
2600
+ var prev = effect.prev;
2601
+ var next = effect.next;
2602
+ if (prev !== null) prev.next = next;
2603
+ if (next !== null) next.prev = prev;
2604
+ if (parent !== null) {
2605
+ if (parent.first === effect) parent.first = next;
2606
+ if (parent.last === effect) parent.last = prev;
2583
2607
  }
2584
2608
  }
2585
- function depends_on_old_values(derived2) {
2586
- if (derived2.v === UNINITIALIZED) return true;
2587
- if (derived2.deps === null) return false;
2588
- for (const dep of derived2.deps) {
2589
- if (old_values.has(dep)) {
2590
- return true;
2591
- }
2592
- if ((dep.f & DERIVED) !== 0 && depends_on_old_values(
2593
- /** @type {Derived} */
2594
- dep
2595
- )) {
2596
- return true;
2609
+ function pause_effect(effect, callback, destroy = true) {
2610
+ var transitions = [];
2611
+ pause_children(effect, transitions, true);
2612
+ var fn = () => {
2613
+ if (destroy) destroy_effect(effect);
2614
+ if (callback) callback();
2615
+ };
2616
+ var remaining = transitions.length;
2617
+ if (remaining > 0) {
2618
+ var check = () => --remaining || fn();
2619
+ for (var transition of transitions) {
2620
+ transition.out(check);
2597
2621
  }
2622
+ } else {
2623
+ fn();
2598
2624
  }
2599
- return false;
2600
2625
  }
2601
- function untrack(fn) {
2602
- var previous_untracking = untracking;
2603
- try {
2604
- untracking = true;
2605
- return fn();
2606
- } finally {
2607
- untracking = previous_untracking;
2626
+ function pause_children(effect, transitions, local) {
2627
+ if ((effect.f & INERT) !== 0) return;
2628
+ effect.f ^= INERT;
2629
+ var t = effect.nodes && effect.nodes.t;
2630
+ if (t !== null) {
2631
+ for (const transition of t) {
2632
+ if (transition.is_global || local) {
2633
+ transitions.push(transition);
2634
+ }
2635
+ }
2636
+ }
2637
+ var child = effect.first;
2638
+ while (child !== null) {
2639
+ var sibling = child.next;
2640
+ if ((child.f & ROOT_EFFECT) === 0) {
2641
+ var transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || // If this is a branch effect without a block effect parent,
2642
+ // it means the parent block effect was pruned. In that case,
2643
+ // transparency information was transferred to the branch effect.
2644
+ (child.f & BRANCH_EFFECT) !== 0 && (effect.f & BLOCK_EFFECT) !== 0;
2645
+ pause_children(child, transitions, transparent ? local : false);
2646
+ }
2647
+ child = sibling;
2608
2648
  }
2609
2649
  }
2610
- function subscribe_to_store(store, run, invalidate) {
2611
- if (store == null) {
2612
- run(void 0);
2613
- return noop;
2650
+ function move_effect(effect, fragment) {
2651
+ if (!effect.nodes) return;
2652
+ var node = effect.nodes.start;
2653
+ var end = effect.nodes.end;
2654
+ while (node !== null) {
2655
+ var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
2656
+ fragment.append(node);
2657
+ node = next;
2614
2658
  }
2615
- const unsub = untrack(
2616
- () => store.subscribe(
2617
- run,
2618
- // @ts-expect-error
2619
- invalidate
2620
- )
2621
- );
2622
- return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
2623
2659
  }
2624
2660
  const DOM_BOOLEAN_ATTRIBUTES = [
2625
2661
  "allowfullscreen",
@@ -2664,15 +2700,15 @@ function escape_html(value, is_attr) {
2664
2700
  const str = String(value ?? "");
2665
2701
  const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;
2666
2702
  pattern.lastIndex = 0;
2667
- let escaped2 = "";
2703
+ let escaped = "";
2668
2704
  let last = 0;
2669
2705
  while (pattern.test(str)) {
2670
2706
  const i = pattern.lastIndex - 1;
2671
2707
  const ch = str[i];
2672
- escaped2 += str.substring(last, i) + (ch === "&" ? "&amp;" : ch === '"' ? "&quot;" : "&lt;");
2708
+ escaped += str.substring(last, i) + (ch === "&" ? "&amp;" : ch === '"' ? "&quot;" : "&lt;");
2673
2709
  last = i + 1;
2674
2710
  }
2675
- return escaped2 + str.substring(last);
2711
+ return escaped + str.substring(last);
2676
2712
  }
2677
2713
  function r(e) {
2678
2714
  var t, f, n = "";
@@ -2836,34 +2872,6 @@ function abort() {
2836
2872
  controller?.abort(STALE_REACTION);
2837
2873
  controller = null;
2838
2874
  }
2839
- function await_invalid() {
2840
- const error = new Error(`await_invalid
2841
- Encountered asynchronous work while rendering synchronously.
2842
- https://svelte.dev/e/await_invalid`);
2843
- error.name = "Svelte error";
2844
- throw error;
2845
- }
2846
- function invalid_csp() {
2847
- const error = new Error(`invalid_csp
2848
- \`csp.nonce\` was set while \`csp.hash\` was \`true\`. These options cannot be used simultaneously.
2849
- https://svelte.dev/e/invalid_csp`);
2850
- error.name = "Svelte error";
2851
- throw error;
2852
- }
2853
- function invalid_id_prefix() {
2854
- const error = new Error(`invalid_id_prefix
2855
- The \`idPrefix\` option cannot include \`--\`.
2856
- https://svelte.dev/e/invalid_id_prefix`);
2857
- error.name = "Svelte error";
2858
- throw error;
2859
- }
2860
- function server_context_required() {
2861
- const error = new Error(`server_context_required
2862
- Could not resolve \`render\` context.
2863
- https://svelte.dev/e/server_context_required`);
2864
- error.name = "Svelte error";
2865
- throw error;
2866
- }
2867
2875
  var ssr_context = null;
2868
2876
  function set_ssr_context(v) {
2869
2877
  ssr_context = v;
@@ -2909,14 +2917,6 @@ function unresolved_hydratable(key, stack) {
2909
2917
  console.warn(`https://svelte.dev/e/unresolved_hydratable`);
2910
2918
  }
2911
2919
  }
2912
- function get_render_context() {
2913
- const store = als?.getStore();
2914
- {
2915
- server_context_required();
2916
- }
2917
- return store;
2918
- }
2919
- let als = null;
2920
2920
  let text_encoder;
2921
2921
  let crypto;
2922
2922
  const obfuscated_import = (module_name) => import(
@@ -3324,8 +3324,8 @@ class Renderer {
3324
3324
  */
3325
3325
  static #serialize_failed_boundary(error) {
3326
3326
  var json = JSON.stringify(error);
3327
- var escaped2 = json.replace(/>/g, "\\u003e").replace(/</g, "\\u003c");
3328
- return `<!--${HYDRATION_START_FAILED}${escaped2}-->`;
3327
+ var escaped = json.replace(/>/g, "\\u003e").replace(/</g, "\\u003c");
3328
+ return `<!--${HYDRATION_START_FAILED}${escaped}-->`;
3329
3329
  }
3330
3330
  /**
3331
3331
  * Only available on the server and when compiling with the `server` option.
@@ -3823,4 +3823,4 @@ function derived(fn) {
3823
3823
  }
3824
3824
 
3825
3825
  export { set_component_context as $, hydration_mismatch as A, component_root as B, COMMENT_NODE as C, DevalueError as D, create_text as E, array_from as F, is_passive_event as G, HOLE as H, set_active_reaction as I, set_active_effect as J, active_reaction as K, LEGACY_PROPS as L, MAX_ARRAY_INDEX as M, NAN as N, active_effect as O, POSITIVE_INFINITY as P, setContext as Q, BOUNDARY_EFFECT as R, SPARSE as S, block as T, UNDEFINED as U, branch as V, queue_micro_task as W, pause_effect as X, current_batch as Y, move_effect as Z, defer_effect as _, NEGATIVE_INFINITY as a, Batch as a0, handle_error as a1, component_context as a2, internal_set as a3, destroy_effect as a4, invoke_error_boundary as a5, derived as a6, effect_tracking as a7, render_effect as a8, HYDRATION_END as a9, clsx as aA, HYDRATION_START_ELSE as aa, svelte_boundary_reset_onerror as ab, source as ac, untrack as ad, increment as ae, HYDRATION_START_FAILED as af, svelte_boundary_reset_noop as ag, push$1 as ah, pop$1 as ai, EFFECT_TRANSPARENT as aj, EFFECT_PRESERVED as ak, noop as al, safe_not_equal as am, stringify as an, store_get as ao, attr_class as ap, unsubscribe_stores as aq, getContext as ar, attr as as, bind_props as at, escape_html as au, spread_props as av, head as aw, ensure_array_like as ax, ssr_context as ay, attr_style as az, NEGATIVE_ZERO as b, is_valid_array_index as c, is_primitive as d, is_plain_object as e, enumerable_symbols as f, get_type as g, stringify_string as h, is_valid_array_len as i, browser as j, set as k, get as l, flushSync as m, define_property as n, mutable_source as o, init_operations as p, get_first_child as q, render as r, stringify_key as s, HYDRATION_START as t, uneval as u, valid_array_indices as v, get_next_sibling as w, HYDRATION_ERROR as x, hydration_failed as y, clear_text_content as z };
3826
- //# sourceMappingURL=index-CoYB03g7.js.map
3826
+ //# sourceMappingURL=index2-BLq4EEng.js.map