byterover-cli 3.10.0 → 3.10.2

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 (843) hide show
  1. package/dist/agent/infra/agent/service-initializer.js +8 -2
  2. package/dist/agent/infra/llm/agent-llm-service.d.ts +9 -9
  3. package/dist/agent/infra/llm/agent-llm-service.js +28 -18
  4. package/dist/agent/infra/llm/generators/ai-sdk-content-generator.d.ts +10 -1
  5. package/dist/agent/infra/llm/generators/ai-sdk-content-generator.js +21 -4
  6. package/dist/agent/infra/llm/generators/ai-sdk-message-converter.d.ts +4 -0
  7. package/dist/agent/infra/llm/generators/ai-sdk-message-converter.js +8 -1
  8. package/dist/agent/infra/map/abstract-generator.d.ts +29 -0
  9. package/dist/agent/infra/map/abstract-generator.js +161 -0
  10. package/dist/agent/infra/map/abstract-queue.d.ts +7 -0
  11. package/dist/agent/infra/map/abstract-queue.js +100 -26
  12. package/dist/agent/infra/system-prompt/contributors/file-contributor.js +6 -2
  13. package/dist/agent/infra/tools/implementations/curate-tool-task-context.d.ts +2 -0
  14. package/dist/agent/infra/tools/implementations/curate-tool-task-context.js +28 -0
  15. package/dist/agent/infra/tools/implementations/curate-tool.js +57 -16
  16. package/dist/agent/infra/tools/tool-manager.d.ts +10 -1
  17. package/dist/agent/infra/tools/tool-manager.js +10 -1
  18. package/dist/oclif/commands/review.d.ts +16 -0
  19. package/dist/oclif/commands/review.js +96 -0
  20. package/dist/server/core/domain/entities/brv-config.d.ts +6 -0
  21. package/dist/server/core/domain/entities/brv-config.js +27 -0
  22. package/dist/server/core/domain/entities/provider-registry.js +0 -1
  23. package/dist/server/core/domain/transport/schemas.d.ts +8 -0
  24. package/dist/server/core/domain/transport/schemas.js +6 -0
  25. package/dist/server/core/domain/transport/task-info.d.ts +7 -0
  26. package/dist/server/core/interfaces/i-provider-config-store.d.ts +5 -1
  27. package/dist/server/infra/context-tree/propagate-summaries.d.ts +18 -0
  28. package/dist/server/infra/context-tree/propagate-summaries.js +52 -0
  29. package/dist/server/infra/daemon/agent-process.js +78 -8
  30. package/dist/server/infra/daemon/brv-server.js +23 -0
  31. package/dist/server/infra/daemon/post-work-registry.d.ts +45 -0
  32. package/dist/server/infra/daemon/post-work-registry.js +82 -0
  33. package/dist/server/infra/dream/dream-lock-service.d.ts +3 -4
  34. package/dist/server/infra/dream/dream-lock-service.js +3 -4
  35. package/dist/server/infra/dream/dream-state-schema.d.ts +35 -0
  36. package/dist/server/infra/dream/dream-state-schema.js +15 -0
  37. package/dist/server/infra/dream/dream-state-service.d.ts +22 -0
  38. package/dist/server/infra/dream/dream-state-service.js +62 -3
  39. package/dist/server/infra/dream/dream-trigger.js +6 -2
  40. package/dist/server/infra/executor/curate-executor.d.ts +33 -0
  41. package/dist/server/infra/executor/curate-executor.js +116 -36
  42. package/dist/server/infra/executor/dream-executor.d.ts +29 -0
  43. package/dist/server/infra/executor/dream-executor.js +70 -16
  44. package/dist/server/infra/executor/folder-pack-executor.d.ts +10 -0
  45. package/dist/server/infra/executor/folder-pack-executor.js +22 -24
  46. package/dist/server/infra/git/git-error-messages.d.ts +10 -0
  47. package/dist/server/infra/git/git-error-messages.js +12 -0
  48. package/dist/server/infra/git/isomorphic-git-service.js +24 -76
  49. package/dist/server/infra/git/status-row-classifier.d.ts +32 -0
  50. package/dist/server/infra/git/status-row-classifier.js +78 -0
  51. package/dist/server/infra/process/curate-log-handler.d.ts +3 -0
  52. package/dist/server/infra/process/curate-log-handler.js +6 -2
  53. package/dist/server/infra/process/feature-handlers.js +1 -0
  54. package/dist/server/infra/process/task-router.d.ts +29 -0
  55. package/dist/server/infra/process/task-router.js +43 -1
  56. package/dist/server/infra/process/transport-handlers.d.ts +4 -2
  57. package/dist/server/infra/process/transport-handlers.js +1 -0
  58. package/dist/server/infra/storage/file-provider-config-store.d.ts +4 -1
  59. package/dist/server/infra/storage/file-provider-config-store.js +5 -2
  60. package/dist/server/infra/transport/handlers/provider-handler.d.ts +9 -0
  61. package/dist/server/infra/transport/handlers/provider-handler.js +63 -2
  62. package/dist/server/infra/transport/handlers/review-handler.d.ts +5 -0
  63. package/dist/server/infra/transport/handlers/review-handler.js +22 -0
  64. package/dist/shared/transport/events/index.d.ts +2 -0
  65. package/dist/shared/transport/events/review-events.d.ts +11 -0
  66. package/dist/shared/transport/events/review-events.js +2 -0
  67. package/dist/shared/transport/types/dto.d.ts +2 -0
  68. package/dist/tui/features/auth/api/get-auth-state.js +6 -3
  69. package/dist/tui/features/auth/components/auth-initializer.js +4 -2
  70. package/dist/tui/features/provider/components/provider-flow.js +30 -5
  71. package/node_modules/@tanstack/query-core/LICENSE +21 -0
  72. package/node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js +25 -0
  73. package/node_modules/@tanstack/query-core/build/legacy/chunk-PXG64RU4.js.map +1 -0
  74. package/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs +108 -0
  75. package/node_modules/@tanstack/query-core/build/legacy/focusManager.cjs.map +1 -0
  76. package/node_modules/@tanstack/query-core/build/legacy/focusManager.d.cts +17 -0
  77. package/node_modules/@tanstack/query-core/build/legacy/focusManager.d.ts +17 -0
  78. package/node_modules/@tanstack/query-core/build/legacy/focusManager.js +81 -0
  79. package/node_modules/@tanstack/query-core/build/legacy/focusManager.js.map +1 -0
  80. package/node_modules/@tanstack/query-core/build/legacy/hydration-BlEVG2Lp.d.ts +1384 -0
  81. package/node_modules/@tanstack/query-core/build/legacy/hydration-uphG6M-i.d.cts +1384 -0
  82. package/node_modules/@tanstack/query-core/build/legacy/hydration.cjs +178 -0
  83. package/node_modules/@tanstack/query-core/build/legacy/hydration.cjs.map +1 -0
  84. package/node_modules/@tanstack/query-core/build/legacy/hydration.d.cts +3 -0
  85. package/node_modules/@tanstack/query-core/build/legacy/hydration.d.ts +3 -0
  86. package/node_modules/@tanstack/query-core/build/legacy/hydration.js +152 -0
  87. package/node_modules/@tanstack/query-core/build/legacy/hydration.js.map +1 -0
  88. package/node_modules/@tanstack/query-core/build/legacy/index.cjs +110 -0
  89. package/node_modules/@tanstack/query-core/build/legacy/index.cjs.map +1 -0
  90. package/node_modules/@tanstack/query-core/build/legacy/index.d.cts +10 -0
  91. package/node_modules/@tanstack/query-core/build/legacy/index.d.ts +10 -0
  92. package/node_modules/@tanstack/query-core/build/legacy/index.js +73 -0
  93. package/node_modules/@tanstack/query-core/build/legacy/index.js.map +1 -0
  94. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs +146 -0
  95. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.cjs.map +1 -0
  96. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.cts +15 -0
  97. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.d.ts +15 -0
  98. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js +126 -0
  99. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryBehavior.js.map +1 -0
  100. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs +93 -0
  101. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.cjs.map +1 -0
  102. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.cts +20 -0
  103. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.d.ts +20 -0
  104. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js +74 -0
  105. package/node_modules/@tanstack/query-core/build/legacy/infiniteQueryObserver.js.map +1 -0
  106. package/node_modules/@tanstack/query-core/build/legacy/mutation.cjs +333 -0
  107. package/node_modules/@tanstack/query-core/build/legacy/mutation.cjs.map +1 -0
  108. package/node_modules/@tanstack/query-core/build/legacy/mutation.d.cts +3 -0
  109. package/node_modules/@tanstack/query-core/build/legacy/mutation.d.ts +3 -0
  110. package/node_modules/@tanstack/query-core/build/legacy/mutation.js +306 -0
  111. package/node_modules/@tanstack/query-core/build/legacy/mutation.js.map +1 -0
  112. package/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs +170 -0
  113. package/node_modules/@tanstack/query-core/build/legacy/mutationCache.cjs.map +1 -0
  114. package/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.cts +3 -0
  115. package/node_modules/@tanstack/query-core/build/legacy/mutationCache.d.ts +3 -0
  116. package/node_modules/@tanstack/query-core/build/legacy/mutationCache.js +137 -0
  117. package/node_modules/@tanstack/query-core/build/legacy/mutationCache.js.map +1 -0
  118. package/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs +190 -0
  119. package/node_modules/@tanstack/query-core/build/legacy/mutationObserver.cjs.map +1 -0
  120. package/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.cts +3 -0
  121. package/node_modules/@tanstack/query-core/build/legacy/mutationObserver.d.ts +3 -0
  122. package/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js +164 -0
  123. package/node_modules/@tanstack/query-core/build/legacy/mutationObserver.js.map +1 -0
  124. package/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs +113 -0
  125. package/node_modules/@tanstack/query-core/build/legacy/notifyManager.cjs.map +1 -0
  126. package/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.cts +46 -0
  127. package/node_modules/@tanstack/query-core/build/legacy/notifyManager.d.ts +46 -0
  128. package/node_modules/@tanstack/query-core/build/legacy/notifyManager.js +88 -0
  129. package/node_modules/@tanstack/query-core/build/legacy/notifyManager.js.map +1 -0
  130. package/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs +97 -0
  131. package/node_modules/@tanstack/query-core/build/legacy/onlineManager.cjs.map +1 -0
  132. package/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.cts +16 -0
  133. package/node_modules/@tanstack/query-core/build/legacy/onlineManager.d.ts +16 -0
  134. package/node_modules/@tanstack/query-core/build/legacy/onlineManager.js +70 -0
  135. package/node_modules/@tanstack/query-core/build/legacy/onlineManager.js.map +1 -0
  136. package/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs +260 -0
  137. package/node_modules/@tanstack/query-core/build/legacy/queriesObserver.cjs.map +1 -0
  138. package/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.cts +27 -0
  139. package/node_modules/@tanstack/query-core/build/legacy/queriesObserver.d.ts +27 -0
  140. package/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js +234 -0
  141. package/node_modules/@tanstack/query-core/build/legacy/queriesObserver.js.map +1 -0
  142. package/node_modules/@tanstack/query-core/build/legacy/query.cjs +478 -0
  143. package/node_modules/@tanstack/query-core/build/legacy/query.cjs.map +1 -0
  144. package/node_modules/@tanstack/query-core/build/legacy/query.d.cts +3 -0
  145. package/node_modules/@tanstack/query-core/build/legacy/query.d.ts +3 -0
  146. package/node_modules/@tanstack/query-core/build/legacy/query.js +459 -0
  147. package/node_modules/@tanstack/query-core/build/legacy/query.js.map +1 -0
  148. package/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs +131 -0
  149. package/node_modules/@tanstack/query-core/build/legacy/queryCache.cjs.map +1 -0
  150. package/node_modules/@tanstack/query-core/build/legacy/queryCache.d.cts +3 -0
  151. package/node_modules/@tanstack/query-core/build/legacy/queryCache.d.ts +3 -0
  152. package/node_modules/@tanstack/query-core/build/legacy/queryCache.js +105 -0
  153. package/node_modules/@tanstack/query-core/build/legacy/queryCache.js.map +1 -0
  154. package/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs +349 -0
  155. package/node_modules/@tanstack/query-core/build/legacy/queryClient.cjs.map +1 -0
  156. package/node_modules/@tanstack/query-core/build/legacy/queryClient.d.cts +3 -0
  157. package/node_modules/@tanstack/query-core/build/legacy/queryClient.d.ts +3 -0
  158. package/node_modules/@tanstack/query-core/build/legacy/queryClient.js +324 -0
  159. package/node_modules/@tanstack/query-core/build/legacy/queryClient.js.map +1 -0
  160. package/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs +515 -0
  161. package/node_modules/@tanstack/query-core/build/legacy/queryObserver.cjs.map +1 -0
  162. package/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.cts +3 -0
  163. package/node_modules/@tanstack/query-core/build/legacy/queryObserver.d.ts +3 -0
  164. package/node_modules/@tanstack/query-core/build/legacy/queryObserver.js +498 -0
  165. package/node_modules/@tanstack/query-core/build/legacy/queryObserver.js.map +1 -0
  166. package/node_modules/@tanstack/query-core/build/legacy/removable.cjs +69 -0
  167. package/node_modules/@tanstack/query-core/build/legacy/removable.cjs.map +1 -0
  168. package/node_modules/@tanstack/query-core/build/legacy/removable.d.cts +11 -0
  169. package/node_modules/@tanstack/query-core/build/legacy/removable.d.ts +11 -0
  170. package/node_modules/@tanstack/query-core/build/legacy/removable.js +43 -0
  171. package/node_modules/@tanstack/query-core/build/legacy/removable.js.map +1 -0
  172. package/node_modules/@tanstack/query-core/build/legacy/retryer.cjs +165 -0
  173. package/node_modules/@tanstack/query-core/build/legacy/retryer.cjs.map +1 -0
  174. package/node_modules/@tanstack/query-core/build/legacy/retryer.d.cts +3 -0
  175. package/node_modules/@tanstack/query-core/build/legacy/retryer.d.ts +3 -0
  176. package/node_modules/@tanstack/query-core/build/legacy/retryer.js +139 -0
  177. package/node_modules/@tanstack/query-core/build/legacy/retryer.js.map +1 -0
  178. package/node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs +82 -0
  179. package/node_modules/@tanstack/query-core/build/legacy/streamedQuery.cjs.map +1 -0
  180. package/node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.cts +34 -0
  181. package/node_modules/@tanstack/query-core/build/legacy/streamedQuery.d.ts +34 -0
  182. package/node_modules/@tanstack/query-core/build/legacy/streamedQuery.js +59 -0
  183. package/node_modules/@tanstack/query-core/build/legacy/streamedQuery.js.map +1 -0
  184. package/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs +51 -0
  185. package/node_modules/@tanstack/query-core/build/legacy/subscribable.cjs.map +1 -0
  186. package/node_modules/@tanstack/query-core/build/legacy/subscribable.d.cts +10 -0
  187. package/node_modules/@tanstack/query-core/build/legacy/subscribable.d.ts +10 -0
  188. package/node_modules/@tanstack/query-core/build/legacy/subscribable.js +28 -0
  189. package/node_modules/@tanstack/query-core/build/legacy/subscribable.js.map +1 -0
  190. package/node_modules/@tanstack/query-core/build/legacy/thenable.cjs +76 -0
  191. package/node_modules/@tanstack/query-core/build/legacy/thenable.cjs.map +1 -0
  192. package/node_modules/@tanstack/query-core/build/legacy/thenable.d.cts +47 -0
  193. package/node_modules/@tanstack/query-core/build/legacy/thenable.d.ts +47 -0
  194. package/node_modules/@tanstack/query-core/build/legacy/thenable.js +52 -0
  195. package/node_modules/@tanstack/query-core/build/legacy/thenable.js.map +1 -0
  196. package/node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs +110 -0
  197. package/node_modules/@tanstack/query-core/build/legacy/timeoutManager.cjs.map +1 -0
  198. package/node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.cts +58 -0
  199. package/node_modules/@tanstack/query-core/build/legacy/timeoutManager.d.ts +58 -0
  200. package/node_modules/@tanstack/query-core/build/legacy/timeoutManager.js +81 -0
  201. package/node_modules/@tanstack/query-core/build/legacy/timeoutManager.js.map +1 -0
  202. package/node_modules/@tanstack/query-core/build/legacy/types.cjs +37 -0
  203. package/node_modules/@tanstack/query-core/build/legacy/types.cjs.map +1 -0
  204. package/node_modules/@tanstack/query-core/build/legacy/types.d.cts +3 -0
  205. package/node_modules/@tanstack/query-core/build/legacy/types.d.ts +3 -0
  206. package/node_modules/@tanstack/query-core/build/legacy/types.js +12 -0
  207. package/node_modules/@tanstack/query-core/build/legacy/types.js.map +1 -0
  208. package/node_modules/@tanstack/query-core/build/legacy/utils.cjs +330 -0
  209. package/node_modules/@tanstack/query-core/build/legacy/utils.cjs.map +1 -0
  210. package/node_modules/@tanstack/query-core/build/legacy/utils.d.cts +3 -0
  211. package/node_modules/@tanstack/query-core/build/legacy/utils.d.ts +3 -0
  212. package/node_modules/@tanstack/query-core/build/legacy/utils.js +283 -0
  213. package/node_modules/@tanstack/query-core/build/legacy/utils.js.map +1 -0
  214. package/node_modules/@tanstack/query-core/build/modern/focusManager.cjs +94 -0
  215. package/node_modules/@tanstack/query-core/build/modern/focusManager.cjs.map +1 -0
  216. package/node_modules/@tanstack/query-core/build/modern/focusManager.d.cts +17 -0
  217. package/node_modules/@tanstack/query-core/build/modern/focusManager.d.ts +17 -0
  218. package/node_modules/@tanstack/query-core/build/modern/focusManager.js +68 -0
  219. package/node_modules/@tanstack/query-core/build/modern/focusManager.js.map +1 -0
  220. package/node_modules/@tanstack/query-core/build/modern/hydration-BlEVG2Lp.d.ts +1384 -0
  221. package/node_modules/@tanstack/query-core/build/modern/hydration-uphG6M-i.d.cts +1384 -0
  222. package/node_modules/@tanstack/query-core/build/modern/hydration.cjs +173 -0
  223. package/node_modules/@tanstack/query-core/build/modern/hydration.cjs.map +1 -0
  224. package/node_modules/@tanstack/query-core/build/modern/hydration.d.cts +3 -0
  225. package/node_modules/@tanstack/query-core/build/modern/hydration.d.ts +3 -0
  226. package/node_modules/@tanstack/query-core/build/modern/hydration.js +145 -0
  227. package/node_modules/@tanstack/query-core/build/modern/hydration.js.map +1 -0
  228. package/node_modules/@tanstack/query-core/build/modern/index.cjs +110 -0
  229. package/node_modules/@tanstack/query-core/build/modern/index.cjs.map +1 -0
  230. package/node_modules/@tanstack/query-core/build/modern/index.d.cts +10 -0
  231. package/node_modules/@tanstack/query-core/build/modern/index.d.ts +10 -0
  232. package/node_modules/@tanstack/query-core/build/modern/index.js +71 -0
  233. package/node_modules/@tanstack/query-core/build/modern/index.js.map +1 -0
  234. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs +142 -0
  235. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs.map +1 -0
  236. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.cts +15 -0
  237. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.d.ts +15 -0
  238. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js +120 -0
  239. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map +1 -0
  240. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs +92 -0
  241. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs.map +1 -0
  242. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.cts +20 -0
  243. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.ts +20 -0
  244. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js +71 -0
  245. package/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js.map +1 -0
  246. package/node_modules/@tanstack/query-core/build/modern/mutation.cjs +307 -0
  247. package/node_modules/@tanstack/query-core/build/modern/mutation.cjs.map +1 -0
  248. package/node_modules/@tanstack/query-core/build/modern/mutation.d.cts +3 -0
  249. package/node_modules/@tanstack/query-core/build/modern/mutation.d.ts +3 -0
  250. package/node_modules/@tanstack/query-core/build/modern/mutation.js +281 -0
  251. package/node_modules/@tanstack/query-core/build/modern/mutation.js.map +1 -0
  252. package/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs +149 -0
  253. package/node_modules/@tanstack/query-core/build/modern/mutationCache.cjs.map +1 -0
  254. package/node_modules/@tanstack/query-core/build/modern/mutationCache.d.cts +3 -0
  255. package/node_modules/@tanstack/query-core/build/modern/mutationCache.d.ts +3 -0
  256. package/node_modules/@tanstack/query-core/build/modern/mutationCache.js +124 -0
  257. package/node_modules/@tanstack/query-core/build/modern/mutationCache.js.map +1 -0
  258. package/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs +165 -0
  259. package/node_modules/@tanstack/query-core/build/modern/mutationObserver.cjs.map +1 -0
  260. package/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.cts +3 -0
  261. package/node_modules/@tanstack/query-core/build/modern/mutationObserver.d.ts +3 -0
  262. package/node_modules/@tanstack/query-core/build/modern/mutationObserver.js +140 -0
  263. package/node_modules/@tanstack/query-core/build/modern/mutationObserver.js.map +1 -0
  264. package/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs +113 -0
  265. package/node_modules/@tanstack/query-core/build/modern/notifyManager.cjs.map +1 -0
  266. package/node_modules/@tanstack/query-core/build/modern/notifyManager.d.cts +46 -0
  267. package/node_modules/@tanstack/query-core/build/modern/notifyManager.d.ts +46 -0
  268. package/node_modules/@tanstack/query-core/build/modern/notifyManager.js +86 -0
  269. package/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map +1 -0
  270. package/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs +84 -0
  271. package/node_modules/@tanstack/query-core/build/modern/onlineManager.cjs.map +1 -0
  272. package/node_modules/@tanstack/query-core/build/modern/onlineManager.d.cts +16 -0
  273. package/node_modules/@tanstack/query-core/build/modern/onlineManager.d.ts +16 -0
  274. package/node_modules/@tanstack/query-core/build/modern/onlineManager.js +58 -0
  275. package/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map +1 -0
  276. package/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs +237 -0
  277. package/node_modules/@tanstack/query-core/build/modern/queriesObserver.cjs.map +1 -0
  278. package/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.cts +27 -0
  279. package/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.ts +27 -0
  280. package/node_modules/@tanstack/query-core/build/modern/queriesObserver.js +212 -0
  281. package/node_modules/@tanstack/query-core/build/modern/queriesObserver.js.map +1 -0
  282. package/node_modules/@tanstack/query-core/build/modern/query.cjs +452 -0
  283. package/node_modules/@tanstack/query-core/build/modern/query.cjs.map +1 -0
  284. package/node_modules/@tanstack/query-core/build/modern/query.d.cts +3 -0
  285. package/node_modules/@tanstack/query-core/build/modern/query.d.ts +3 -0
  286. package/node_modules/@tanstack/query-core/build/modern/query.js +434 -0
  287. package/node_modules/@tanstack/query-core/build/modern/query.js.map +1 -0
  288. package/node_modules/@tanstack/query-core/build/modern/queryCache.cjs +122 -0
  289. package/node_modules/@tanstack/query-core/build/modern/queryCache.cjs.map +1 -0
  290. package/node_modules/@tanstack/query-core/build/modern/queryCache.d.cts +3 -0
  291. package/node_modules/@tanstack/query-core/build/modern/queryCache.d.ts +3 -0
  292. package/node_modules/@tanstack/query-core/build/modern/queryCache.js +97 -0
  293. package/node_modules/@tanstack/query-core/build/modern/queryCache.js.map +1 -0
  294. package/node_modules/@tanstack/query-core/build/modern/queryClient.cjs +322 -0
  295. package/node_modules/@tanstack/query-core/build/modern/queryClient.cjs.map +1 -0
  296. package/node_modules/@tanstack/query-core/build/modern/queryClient.d.cts +3 -0
  297. package/node_modules/@tanstack/query-core/build/modern/queryClient.d.ts +3 -0
  298. package/node_modules/@tanstack/query-core/build/modern/queryClient.js +305 -0
  299. package/node_modules/@tanstack/query-core/build/modern/queryClient.js.map +1 -0
  300. package/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs +488 -0
  301. package/node_modules/@tanstack/query-core/build/modern/queryObserver.cjs.map +1 -0
  302. package/node_modules/@tanstack/query-core/build/modern/queryObserver.d.cts +3 -0
  303. package/node_modules/@tanstack/query-core/build/modern/queryObserver.d.ts +3 -0
  304. package/node_modules/@tanstack/query-core/build/modern/queryObserver.js +472 -0
  305. package/node_modules/@tanstack/query-core/build/modern/queryObserver.js.map +1 -0
  306. package/node_modules/@tanstack/query-core/build/modern/removable.cjs +58 -0
  307. package/node_modules/@tanstack/query-core/build/modern/removable.cjs.map +1 -0
  308. package/node_modules/@tanstack/query-core/build/modern/removable.d.cts +11 -0
  309. package/node_modules/@tanstack/query-core/build/modern/removable.d.ts +11 -0
  310. package/node_modules/@tanstack/query-core/build/modern/removable.js +33 -0
  311. package/node_modules/@tanstack/query-core/build/modern/removable.js.map +1 -0
  312. package/node_modules/@tanstack/query-core/build/modern/retryer.cjs +161 -0
  313. package/node_modules/@tanstack/query-core/build/modern/retryer.cjs.map +1 -0
  314. package/node_modules/@tanstack/query-core/build/modern/retryer.d.cts +3 -0
  315. package/node_modules/@tanstack/query-core/build/modern/retryer.d.ts +3 -0
  316. package/node_modules/@tanstack/query-core/build/modern/retryer.js +133 -0
  317. package/node_modules/@tanstack/query-core/build/modern/retryer.js.map +1 -0
  318. package/node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs +82 -0
  319. package/node_modules/@tanstack/query-core/build/modern/streamedQuery.cjs.map +1 -0
  320. package/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.cts +34 -0
  321. package/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.ts +34 -0
  322. package/node_modules/@tanstack/query-core/build/modern/streamedQuery.js +57 -0
  323. package/node_modules/@tanstack/query-core/build/modern/streamedQuery.js.map +1 -0
  324. package/node_modules/@tanstack/query-core/build/modern/subscribable.cjs +51 -0
  325. package/node_modules/@tanstack/query-core/build/modern/subscribable.cjs.map +1 -0
  326. package/node_modules/@tanstack/query-core/build/modern/subscribable.d.cts +10 -0
  327. package/node_modules/@tanstack/query-core/build/modern/subscribable.d.ts +10 -0
  328. package/node_modules/@tanstack/query-core/build/modern/subscribable.js +26 -0
  329. package/node_modules/@tanstack/query-core/build/modern/subscribable.js.map +1 -0
  330. package/node_modules/@tanstack/query-core/build/modern/thenable.cjs +75 -0
  331. package/node_modules/@tanstack/query-core/build/modern/thenable.cjs.map +1 -0
  332. package/node_modules/@tanstack/query-core/build/modern/thenable.d.cts +47 -0
  333. package/node_modules/@tanstack/query-core/build/modern/thenable.d.ts +47 -0
  334. package/node_modules/@tanstack/query-core/build/modern/thenable.js +49 -0
  335. package/node_modules/@tanstack/query-core/build/modern/thenable.js.map +1 -0
  336. package/node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs +98 -0
  337. package/node_modules/@tanstack/query-core/build/modern/timeoutManager.cjs.map +1 -0
  338. package/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.cts +58 -0
  339. package/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.ts +58 -0
  340. package/node_modules/@tanstack/query-core/build/modern/timeoutManager.js +70 -0
  341. package/node_modules/@tanstack/query-core/build/modern/timeoutManager.js.map +1 -0
  342. package/node_modules/@tanstack/query-core/build/modern/types.cjs +37 -0
  343. package/node_modules/@tanstack/query-core/build/modern/types.cjs.map +1 -0
  344. package/node_modules/@tanstack/query-core/build/modern/types.d.cts +3 -0
  345. package/node_modules/@tanstack/query-core/build/modern/types.d.ts +3 -0
  346. package/node_modules/@tanstack/query-core/build/modern/types.js +10 -0
  347. package/node_modules/@tanstack/query-core/build/modern/types.js.map +1 -0
  348. package/node_modules/@tanstack/query-core/build/modern/utils.cjs +330 -0
  349. package/node_modules/@tanstack/query-core/build/modern/utils.cjs.map +1 -0
  350. package/node_modules/@tanstack/query-core/build/modern/utils.d.cts +3 -0
  351. package/node_modules/@tanstack/query-core/build/modern/utils.d.ts +3 -0
  352. package/node_modules/@tanstack/query-core/build/modern/utils.js +281 -0
  353. package/node_modules/@tanstack/query-core/build/modern/utils.js.map +1 -0
  354. package/node_modules/@tanstack/query-core/package.json +65 -0
  355. package/node_modules/@tanstack/query-core/src/focusManager.ts +86 -0
  356. package/node_modules/@tanstack/query-core/src/hydration.ts +285 -0
  357. package/node_modules/@tanstack/query-core/src/index.ts +55 -0
  358. package/node_modules/@tanstack/query-core/src/infiniteQueryBehavior.ts +176 -0
  359. package/node_modules/@tanstack/query-core/src/infiniteQueryObserver.ts +190 -0
  360. package/node_modules/@tanstack/query-core/src/mutation.ts +419 -0
  361. package/node_modules/@tanstack/query-core/src/mutationCache.ts +244 -0
  362. package/node_modules/@tanstack/query-core/src/mutationObserver.ts +227 -0
  363. package/node_modules/@tanstack/query-core/src/notifyManager.ts +99 -0
  364. package/node_modules/@tanstack/query-core/src/onlineManager.ts +71 -0
  365. package/node_modules/@tanstack/query-core/src/queriesObserver.ts +315 -0
  366. package/node_modules/@tanstack/query-core/src/query.ts +756 -0
  367. package/node_modules/@tanstack/query-core/src/queryCache.ts +223 -0
  368. package/node_modules/@tanstack/query-core/src/queryClient.ts +648 -0
  369. package/node_modules/@tanstack/query-core/src/queryObserver.ts +828 -0
  370. package/node_modules/@tanstack/query-core/src/removable.ts +39 -0
  371. package/node_modules/@tanstack/query-core/src/retryer.ts +228 -0
  372. package/node_modules/@tanstack/query-core/src/streamedQuery.ts +122 -0
  373. package/node_modules/@tanstack/query-core/src/subscribable.ts +30 -0
  374. package/node_modules/@tanstack/query-core/src/thenable.ts +111 -0
  375. package/node_modules/@tanstack/query-core/src/timeoutManager.ts +135 -0
  376. package/node_modules/@tanstack/query-core/src/types.ts +1391 -0
  377. package/node_modules/@tanstack/query-core/src/utils.ts +499 -0
  378. package/node_modules/@tanstack/react-query/LICENSE +21 -0
  379. package/node_modules/@tanstack/react-query/README.md +48 -0
  380. package/node_modules/@tanstack/react-query/build/codemods/src/utils/index.cjs +208 -0
  381. package/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-cache-transformer.cjs +124 -0
  382. package/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/query-client-transformer.cjs +53 -0
  383. package/node_modules/@tanstack/react-query/build/codemods/src/utils/transformers/use-query-like-transformer.cjs +38 -0
  384. package/node_modules/@tanstack/react-query/build/codemods/src/v4/key-transformation.cjs +181 -0
  385. package/node_modules/@tanstack/react-query/build/codemods/src/v4/replace-import-specifier.cjs +25 -0
  386. package/node_modules/@tanstack/react-query/build/codemods/src/v4/utils/replacers/key-replacer.cjs +164 -0
  387. package/node_modules/@tanstack/react-query/build/codemods/src/v5/is-loading/is-loading.cjs +244 -0
  388. package/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/README.md +32 -0
  389. package/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/keep-previous-data.cjs +271 -0
  390. package/node_modules/@tanstack/react-query/build/codemods/src/v5/keep-previous-data/utils/already-has-placeholder-data-property.cjs +26 -0
  391. package/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/remove-overloads.cjs +58 -0
  392. package/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/filter-aware-usage-transformer.cjs +271 -0
  393. package/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/transformers/query-fn-aware-usage-transformer.cjs +185 -0
  394. package/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/index.cjs +123 -0
  395. package/node_modules/@tanstack/react-query/build/codemods/src/v5/remove-overloads/utils/unknown-usage-error.cjs +27 -0
  396. package/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-hydrate/rename-hydrate.cjs +55 -0
  397. package/node_modules/@tanstack/react-query/build/codemods/src/v5/rename-properties/rename-properties.cjs +41 -0
  398. package/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs +91 -0
  399. package/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.cjs.map +1 -0
  400. package/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.cts +14 -0
  401. package/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.d.ts +14 -0
  402. package/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js +57 -0
  403. package/node_modules/@tanstack/react-query/build/legacy/HydrationBoundary.js.map +1 -0
  404. package/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs +47 -0
  405. package/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.cjs.map +1 -0
  406. package/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.cts +6 -0
  407. package/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.d.ts +6 -0
  408. package/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js +12 -0
  409. package/node_modules/@tanstack/react-query/build/legacy/IsRestoringProvider.js.map +1 -0
  410. package/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs +72 -0
  411. package/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.cjs.map +1 -0
  412. package/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.cts +12 -0
  413. package/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.d.ts +12 -0
  414. package/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js +36 -0
  415. package/node_modules/@tanstack/react-query/build/legacy/QueryClientProvider.js.map +1 -0
  416. package/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs +67 -0
  417. package/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.cjs.map +1 -0
  418. package/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.cts +19 -0
  419. package/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.d.ts +19 -0
  420. package/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js +32 -0
  421. package/node_modules/@tanstack/react-query/build/legacy/QueryErrorResetBoundary.js.map +1 -0
  422. package/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs +69 -0
  423. package/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.cjs.map +1 -0
  424. package/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.cts +16 -0
  425. package/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.d.ts +16 -0
  426. package/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js +33 -0
  427. package/node_modules/@tanstack/react-query/build/legacy/errorBoundaryUtils.js.map +1 -0
  428. package/node_modules/@tanstack/react-query/build/legacy/index.cjs +97 -0
  429. package/node_modules/@tanstack/react-query/build/legacy/index.cjs.map +1 -0
  430. package/node_modules/@tanstack/react-query/build/legacy/index.d.cts +22 -0
  431. package/node_modules/@tanstack/react-query/build/legacy/index.d.ts +22 -0
  432. package/node_modules/@tanstack/react-query/build/legacy/index.js +54 -0
  433. package/node_modules/@tanstack/react-query/build/legacy/index.js.map +1 -0
  434. package/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs +33 -0
  435. package/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.cjs.map +1 -0
  436. package/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.cts +23 -0
  437. package/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.d.ts +23 -0
  438. package/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js +8 -0
  439. package/node_modules/@tanstack/react-query/build/legacy/infiniteQueryOptions.js.map +1 -0
  440. package/node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs +33 -0
  441. package/node_modules/@tanstack/react-query/build/legacy/mutationOptions.cjs.map +1 -0
  442. package/node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.cts +7 -0
  443. package/node_modules/@tanstack/react-query/build/legacy/mutationOptions.d.ts +7 -0
  444. package/node_modules/@tanstack/react-query/build/legacy/mutationOptions.js +8 -0
  445. package/node_modules/@tanstack/react-query/build/legacy/mutationOptions.js.map +1 -0
  446. package/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs +33 -0
  447. package/node_modules/@tanstack/react-query/build/legacy/queryOptions.cjs.map +1 -0
  448. package/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.cts +24 -0
  449. package/node_modules/@tanstack/react-query/build/legacy/queryOptions.d.ts +24 -0
  450. package/node_modules/@tanstack/react-query/build/legacy/queryOptions.js +8 -0
  451. package/node_modules/@tanstack/react-query/build/legacy/queryOptions.js.map +1 -0
  452. package/node_modules/@tanstack/react-query/build/legacy/suspense.cjs +58 -0
  453. package/node_modules/@tanstack/react-query/build/legacy/suspense.cjs.map +1 -0
  454. package/node_modules/@tanstack/react-query/build/legacy/suspense.d.cts +12 -0
  455. package/node_modules/@tanstack/react-query/build/legacy/suspense.d.ts +12 -0
  456. package/node_modules/@tanstack/react-query/build/legacy/suspense.js +29 -0
  457. package/node_modules/@tanstack/react-query/build/legacy/suspense.js.map +1 -0
  458. package/node_modules/@tanstack/react-query/build/legacy/types.cjs +19 -0
  459. package/node_modules/@tanstack/react-query/build/legacy/types.cjs.map +1 -0
  460. package/node_modules/@tanstack/react-query/build/legacy/types.d.cts +52 -0
  461. package/node_modules/@tanstack/react-query/build/legacy/types.d.ts +52 -0
  462. package/node_modules/@tanstack/react-query/build/legacy/types.js +1 -0
  463. package/node_modules/@tanstack/react-query/build/legacy/types.js.map +1 -0
  464. package/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs +133 -0
  465. package/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.cjs.map +1 -0
  466. package/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.cts +6 -0
  467. package/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.d.ts +6 -0
  468. package/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js +108 -0
  469. package/node_modules/@tanstack/react-query/build/legacy/useBaseQuery.js.map +1 -0
  470. package/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs +40 -0
  471. package/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.cjs.map +1 -0
  472. package/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.cts +9 -0
  473. package/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.d.ts +9 -0
  474. package/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js +16 -0
  475. package/node_modules/@tanstack/react-query/build/legacy/useInfiniteQuery.js.map +1 -0
  476. package/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs +56 -0
  477. package/node_modules/@tanstack/react-query/build/legacy/useIsFetching.cjs.map +1 -0
  478. package/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.cts +5 -0
  479. package/node_modules/@tanstack/react-query/build/legacy/useIsFetching.d.ts +5 -0
  480. package/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js +22 -0
  481. package/node_modules/@tanstack/react-query/build/legacy/useIsFetching.js.map +1 -0
  482. package/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs +74 -0
  483. package/node_modules/@tanstack/react-query/build/legacy/useMutation.cjs.map +1 -0
  484. package/node_modules/@tanstack/react-query/build/legacy/useMutation.d.cts +6 -0
  485. package/node_modules/@tanstack/react-query/build/legacy/useMutation.d.ts +6 -0
  486. package/node_modules/@tanstack/react-query/build/legacy/useMutation.js +45 -0
  487. package/node_modules/@tanstack/react-query/build/legacy/useMutation.js.map +1 -0
  488. package/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs +86 -0
  489. package/node_modules/@tanstack/react-query/build/legacy/useMutationState.cjs.map +1 -0
  490. package/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.cts +10 -0
  491. package/node_modules/@tanstack/react-query/build/legacy/useMutationState.d.ts +10 -0
  492. package/node_modules/@tanstack/react-query/build/legacy/useMutationState.js +51 -0
  493. package/node_modules/@tanstack/react-query/build/legacy/useMutationState.js.map +1 -0
  494. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs +37 -0
  495. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.cjs.map +1 -0
  496. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.cts +5 -0
  497. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.d.ts +5 -0
  498. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js +12 -0
  499. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchInfiniteQuery.js.map +1 -0
  500. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs +37 -0
  501. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.cjs.map +1 -0
  502. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.cts +6 -0
  503. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.d.ts +6 -0
  504. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js +12 -0
  505. package/node_modules/@tanstack/react-query/build/legacy/usePrefetchQuery.js.map +1 -0
  506. package/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs +132 -0
  507. package/node_modules/@tanstack/react-query/build/legacy/useQueries.cjs.map +1 -0
  508. package/node_modules/@tanstack/react-query/build/legacy/useQueries.d.cts +76 -0
  509. package/node_modules/@tanstack/react-query/build/legacy/useQueries.d.ts +76 -0
  510. package/node_modules/@tanstack/react-query/build/legacy/useQueries.js +112 -0
  511. package/node_modules/@tanstack/react-query/build/legacy/useQueries.js.map +1 -0
  512. package/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs +36 -0
  513. package/node_modules/@tanstack/react-query/build/legacy/useQuery.cjs.map +1 -0
  514. package/node_modules/@tanstack/react-query/build/legacy/useQuery.d.cts +9 -0
  515. package/node_modules/@tanstack/react-query/build/legacy/useQuery.d.ts +9 -0
  516. package/node_modules/@tanstack/react-query/build/legacy/useQuery.js +12 -0
  517. package/node_modules/@tanstack/react-query/build/legacy/useQuery.js.map +1 -0
  518. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs +51 -0
  519. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.cjs.map +1 -0
  520. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.cts +6 -0
  521. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.d.ts +6 -0
  522. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js +27 -0
  523. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseInfiniteQuery.js.map +1 -0
  524. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs +56 -0
  525. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.cjs.map +1 -0
  526. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.cts +79 -0
  527. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.d.ts +79 -0
  528. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js +32 -0
  529. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQueries.js.map +1 -0
  530. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs +52 -0
  531. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.cjs.map +1 -0
  532. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.cts +6 -0
  533. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.d.ts +6 -0
  534. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js +28 -0
  535. package/node_modules/@tanstack/react-query/build/legacy/useSuspenseQuery.js.map +1 -0
  536. package/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs +91 -0
  537. package/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.cjs.map +1 -0
  538. package/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.cts +14 -0
  539. package/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.ts +14 -0
  540. package/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js +57 -0
  541. package/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js.map +1 -0
  542. package/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs +47 -0
  543. package/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.cjs.map +1 -0
  544. package/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.cts +6 -0
  545. package/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.ts +6 -0
  546. package/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js +12 -0
  547. package/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js.map +1 -0
  548. package/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs +72 -0
  549. package/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs.map +1 -0
  550. package/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.cts +12 -0
  551. package/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.ts +12 -0
  552. package/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js +36 -0
  553. package/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map +1 -0
  554. package/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs +67 -0
  555. package/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs.map +1 -0
  556. package/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.cts +19 -0
  557. package/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.ts +19 -0
  558. package/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js +32 -0
  559. package/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map +1 -0
  560. package/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs +69 -0
  561. package/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs.map +1 -0
  562. package/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.cts +16 -0
  563. package/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.d.ts +16 -0
  564. package/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js +33 -0
  565. package/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map +1 -0
  566. package/node_modules/@tanstack/react-query/build/modern/index.cjs +97 -0
  567. package/node_modules/@tanstack/react-query/build/modern/index.cjs.map +1 -0
  568. package/node_modules/@tanstack/react-query/build/modern/index.d.cts +22 -0
  569. package/node_modules/@tanstack/react-query/build/modern/index.d.ts +22 -0
  570. package/node_modules/@tanstack/react-query/build/modern/index.js +54 -0
  571. package/node_modules/@tanstack/react-query/build/modern/index.js.map +1 -0
  572. package/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs +33 -0
  573. package/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs.map +1 -0
  574. package/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.cts +23 -0
  575. package/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.ts +23 -0
  576. package/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js +8 -0
  577. package/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js.map +1 -0
  578. package/node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs +33 -0
  579. package/node_modules/@tanstack/react-query/build/modern/mutationOptions.cjs.map +1 -0
  580. package/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.cts +7 -0
  581. package/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.ts +7 -0
  582. package/node_modules/@tanstack/react-query/build/modern/mutationOptions.js +8 -0
  583. package/node_modules/@tanstack/react-query/build/modern/mutationOptions.js.map +1 -0
  584. package/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs +33 -0
  585. package/node_modules/@tanstack/react-query/build/modern/queryOptions.cjs.map +1 -0
  586. package/node_modules/@tanstack/react-query/build/modern/queryOptions.d.cts +24 -0
  587. package/node_modules/@tanstack/react-query/build/modern/queryOptions.d.ts +24 -0
  588. package/node_modules/@tanstack/react-query/build/modern/queryOptions.js +8 -0
  589. package/node_modules/@tanstack/react-query/build/modern/queryOptions.js.map +1 -0
  590. package/node_modules/@tanstack/react-query/build/modern/suspense.cjs +58 -0
  591. package/node_modules/@tanstack/react-query/build/modern/suspense.cjs.map +1 -0
  592. package/node_modules/@tanstack/react-query/build/modern/suspense.d.cts +12 -0
  593. package/node_modules/@tanstack/react-query/build/modern/suspense.d.ts +12 -0
  594. package/node_modules/@tanstack/react-query/build/modern/suspense.js +29 -0
  595. package/node_modules/@tanstack/react-query/build/modern/suspense.js.map +1 -0
  596. package/node_modules/@tanstack/react-query/build/modern/types.cjs +19 -0
  597. package/node_modules/@tanstack/react-query/build/modern/types.cjs.map +1 -0
  598. package/node_modules/@tanstack/react-query/build/modern/types.d.cts +52 -0
  599. package/node_modules/@tanstack/react-query/build/modern/types.d.ts +52 -0
  600. package/node_modules/@tanstack/react-query/build/modern/types.js +1 -0
  601. package/node_modules/@tanstack/react-query/build/modern/types.js.map +1 -0
  602. package/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs +130 -0
  603. package/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs.map +1 -0
  604. package/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.cts +6 -0
  605. package/node_modules/@tanstack/react-query/build/modern/useBaseQuery.d.ts +6 -0
  606. package/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js +105 -0
  607. package/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map +1 -0
  608. package/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs +40 -0
  609. package/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs.map +1 -0
  610. package/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.cts +9 -0
  611. package/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.ts +9 -0
  612. package/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js +16 -0
  613. package/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js.map +1 -0
  614. package/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs +56 -0
  615. package/node_modules/@tanstack/react-query/build/modern/useIsFetching.cjs.map +1 -0
  616. package/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.cts +5 -0
  617. package/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.ts +5 -0
  618. package/node_modules/@tanstack/react-query/build/modern/useIsFetching.js +22 -0
  619. package/node_modules/@tanstack/react-query/build/modern/useIsFetching.js.map +1 -0
  620. package/node_modules/@tanstack/react-query/build/modern/useMutation.cjs +74 -0
  621. package/node_modules/@tanstack/react-query/build/modern/useMutation.cjs.map +1 -0
  622. package/node_modules/@tanstack/react-query/build/modern/useMutation.d.cts +6 -0
  623. package/node_modules/@tanstack/react-query/build/modern/useMutation.d.ts +6 -0
  624. package/node_modules/@tanstack/react-query/build/modern/useMutation.js +45 -0
  625. package/node_modules/@tanstack/react-query/build/modern/useMutation.js.map +1 -0
  626. package/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs +86 -0
  627. package/node_modules/@tanstack/react-query/build/modern/useMutationState.cjs.map +1 -0
  628. package/node_modules/@tanstack/react-query/build/modern/useMutationState.d.cts +10 -0
  629. package/node_modules/@tanstack/react-query/build/modern/useMutationState.d.ts +10 -0
  630. package/node_modules/@tanstack/react-query/build/modern/useMutationState.js +51 -0
  631. package/node_modules/@tanstack/react-query/build/modern/useMutationState.js.map +1 -0
  632. package/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs +37 -0
  633. package/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs.map +1 -0
  634. package/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.cts +5 -0
  635. package/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.ts +5 -0
  636. package/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js +12 -0
  637. package/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js.map +1 -0
  638. package/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs +37 -0
  639. package/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.cjs.map +1 -0
  640. package/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.cts +6 -0
  641. package/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.ts +6 -0
  642. package/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js +12 -0
  643. package/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js.map +1 -0
  644. package/node_modules/@tanstack/react-query/build/modern/useQueries.cjs +132 -0
  645. package/node_modules/@tanstack/react-query/build/modern/useQueries.cjs.map +1 -0
  646. package/node_modules/@tanstack/react-query/build/modern/useQueries.d.cts +76 -0
  647. package/node_modules/@tanstack/react-query/build/modern/useQueries.d.ts +76 -0
  648. package/node_modules/@tanstack/react-query/build/modern/useQueries.js +112 -0
  649. package/node_modules/@tanstack/react-query/build/modern/useQueries.js.map +1 -0
  650. package/node_modules/@tanstack/react-query/build/modern/useQuery.cjs +36 -0
  651. package/node_modules/@tanstack/react-query/build/modern/useQuery.cjs.map +1 -0
  652. package/node_modules/@tanstack/react-query/build/modern/useQuery.d.cts +9 -0
  653. package/node_modules/@tanstack/react-query/build/modern/useQuery.d.ts +9 -0
  654. package/node_modules/@tanstack/react-query/build/modern/useQuery.js +12 -0
  655. package/node_modules/@tanstack/react-query/build/modern/useQuery.js.map +1 -0
  656. package/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs +51 -0
  657. package/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs.map +1 -0
  658. package/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.cts +6 -0
  659. package/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.ts +6 -0
  660. package/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js +27 -0
  661. package/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js.map +1 -0
  662. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs +56 -0
  663. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.cjs.map +1 -0
  664. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.cts +79 -0
  665. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.ts +79 -0
  666. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js +32 -0
  667. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js.map +1 -0
  668. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs +52 -0
  669. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.cjs.map +1 -0
  670. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.cts +6 -0
  671. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.ts +6 -0
  672. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js +28 -0
  673. package/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js.map +1 -0
  674. package/node_modules/@tanstack/react-query/build/query-codemods/eslint.config.js +18 -0
  675. package/node_modules/@tanstack/react-query/build/query-codemods/package.json +38 -0
  676. package/node_modules/@tanstack/react-query/build/query-codemods/root.eslint.config.js +64 -0
  677. package/node_modules/@tanstack/react-query/build/query-codemods/tsconfig.json +8 -0
  678. package/node_modules/@tanstack/react-query/build/query-codemods/vite.config.ts +30 -0
  679. package/node_modules/@tanstack/react-query/package.json +87 -0
  680. package/node_modules/@tanstack/react-query/src/HydrationBoundary.tsx +111 -0
  681. package/node_modules/@tanstack/react-query/src/IsRestoringProvider.ts +7 -0
  682. package/node_modules/@tanstack/react-query/src/QueryClientProvider.tsx +45 -0
  683. package/node_modules/@tanstack/react-query/src/QueryErrorResetBoundary.tsx +56 -0
  684. package/node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts +82 -0
  685. package/node_modules/@tanstack/react-query/src/index.ts +56 -0
  686. package/node_modules/@tanstack/react-query/src/infiniteQueryOptions.ts +149 -0
  687. package/node_modules/@tanstack/react-query/src/mutationOptions.ts +41 -0
  688. package/node_modules/@tanstack/react-query/src/queryOptions.ts +87 -0
  689. package/node_modules/@tanstack/react-query/src/suspense.ts +80 -0
  690. package/node_modules/@tanstack/react-query/src/types.ts +242 -0
  691. package/node_modules/@tanstack/react-query/src/useBaseQuery.ts +170 -0
  692. package/node_modules/@tanstack/react-query/src/useInfiniteQuery.ts +81 -0
  693. package/node_modules/@tanstack/react-query/src/useIsFetching.ts +24 -0
  694. package/node_modules/@tanstack/react-query/src/useMutation.ts +69 -0
  695. package/node_modules/@tanstack/react-query/src/useMutationState.ts +75 -0
  696. package/node_modules/@tanstack/react-query/src/usePrefetchInfiniteQuery.tsx +30 -0
  697. package/node_modules/@tanstack/react-query/src/usePrefetchQuery.tsx +19 -0
  698. package/node_modules/@tanstack/react-query/src/useQueries.ts +333 -0
  699. package/node_modules/@tanstack/react-query/src/useQuery.ts +52 -0
  700. package/node_modules/@tanstack/react-query/src/useSuspenseInfiniteQuery.ts +50 -0
  701. package/node_modules/@tanstack/react-query/src/useSuspenseQueries.ts +211 -0
  702. package/node_modules/@tanstack/react-query/src/useSuspenseQuery.ts +34 -0
  703. package/node_modules/react-router/CHANGELOG.md +2366 -0
  704. package/node_modules/react-router/LICENSE.md +23 -0
  705. package/node_modules/react-router/README.md +7 -0
  706. package/node_modules/react-router/dist/development/browser-BEPxnEBW.d.mts +313 -0
  707. package/node_modules/react-router/dist/development/browser-CJ9_du-U.d.ts +313 -0
  708. package/node_modules/react-router/dist/development/chunk-4LKRSAEJ.mjs +2508 -0
  709. package/node_modules/react-router/dist/development/chunk-7PAHGFS4.js +188 -0
  710. package/node_modules/react-router/dist/development/chunk-HMDR2CVH.js +1334 -0
  711. package/node_modules/react-router/dist/development/chunk-JZWAC4HX.mjs +11009 -0
  712. package/node_modules/react-router/dist/development/chunk-WICQJKU6.js +9736 -0
  713. package/node_modules/react-router/dist/development/dom-export.d.mts +171 -0
  714. package/node_modules/react-router/dist/development/dom-export.d.ts +172 -0
  715. package/node_modules/react-router/dist/development/dom-export.js +987 -0
  716. package/node_modules/react-router/dist/development/dom-export.mjs +979 -0
  717. package/node_modules/react-router/dist/development/index-react-server-client-1TI9M9o1.d.ts +2534 -0
  718. package/node_modules/react-router/dist/development/index-react-server-client-MKTlCGL3.d.mts +2534 -0
  719. package/node_modules/react-router/dist/development/index-react-server-client.d.mts +3 -0
  720. package/node_modules/react-router/dist/development/index-react-server-client.d.ts +3 -0
  721. package/node_modules/react-router/dist/development/index-react-server-client.js +61 -0
  722. package/node_modules/react-router/dist/development/index-react-server-client.mjs +59 -0
  723. package/node_modules/react-router/dist/development/index-react-server.d.mts +2553 -0
  724. package/node_modules/react-router/dist/development/index-react-server.d.ts +2553 -0
  725. package/node_modules/react-router/dist/development/index-react-server.js +3708 -0
  726. package/node_modules/react-router/dist/development/index-react-server.mjs +3597 -0
  727. package/node_modules/react-router/dist/development/index.d.mts +1387 -0
  728. package/node_modules/react-router/dist/development/index.d.ts +1387 -0
  729. package/node_modules/react-router/dist/development/index.js +2551 -0
  730. package/node_modules/react-router/dist/development/index.mjs +275 -0
  731. package/node_modules/react-router/dist/development/instrumentation-DvHY1sgY.d.ts +3332 -0
  732. package/node_modules/react-router/dist/development/lib/types/internal.d.mts +184 -0
  733. package/node_modules/react-router/dist/development/lib/types/internal.d.ts +184 -0
  734. package/node_modules/react-router/dist/development/lib/types/internal.js +10 -0
  735. package/node_modules/react-router/dist/development/lib/types/internal.mjs +10 -0
  736. package/node_modules/react-router/dist/development/register-Bm80E9qL.d.ts +30 -0
  737. package/node_modules/react-router/dist/development/register-CS_tiXsm.d.mts +30 -0
  738. package/node_modules/react-router/dist/development/router-5iOvts3c.d.mts +3332 -0
  739. package/node_modules/react-router/dist/production/browser-BEPxnEBW.d.mts +313 -0
  740. package/node_modules/react-router/dist/production/browser-CJ9_du-U.d.ts +313 -0
  741. package/node_modules/react-router/dist/production/chunk-GSFLVUYQ.mjs +2508 -0
  742. package/node_modules/react-router/dist/production/chunk-N2HZAAIG.js +1334 -0
  743. package/node_modules/react-router/dist/production/chunk-NGWWS4QJ.js +188 -0
  744. package/node_modules/react-router/dist/production/chunk-QSNCZFX5.js +9736 -0
  745. package/node_modules/react-router/dist/production/chunk-Y3R63HEB.mjs +11009 -0
  746. package/node_modules/react-router/dist/production/dom-export.d.mts +171 -0
  747. package/node_modules/react-router/dist/production/dom-export.d.ts +172 -0
  748. package/node_modules/react-router/dist/production/dom-export.js +987 -0
  749. package/node_modules/react-router/dist/production/dom-export.mjs +979 -0
  750. package/node_modules/react-router/dist/production/index-react-server-client-1TI9M9o1.d.ts +2534 -0
  751. package/node_modules/react-router/dist/production/index-react-server-client-MKTlCGL3.d.mts +2534 -0
  752. package/node_modules/react-router/dist/production/index-react-server-client.d.mts +3 -0
  753. package/node_modules/react-router/dist/production/index-react-server-client.d.ts +3 -0
  754. package/node_modules/react-router/dist/production/index-react-server-client.js +61 -0
  755. package/node_modules/react-router/dist/production/index-react-server-client.mjs +59 -0
  756. package/node_modules/react-router/dist/production/index-react-server.d.mts +2553 -0
  757. package/node_modules/react-router/dist/production/index-react-server.d.ts +2553 -0
  758. package/node_modules/react-router/dist/production/index-react-server.js +3708 -0
  759. package/node_modules/react-router/dist/production/index-react-server.mjs +3597 -0
  760. package/node_modules/react-router/dist/production/index.d.mts +1387 -0
  761. package/node_modules/react-router/dist/production/index.d.ts +1387 -0
  762. package/node_modules/react-router/dist/production/index.js +2551 -0
  763. package/node_modules/react-router/dist/production/index.mjs +275 -0
  764. package/node_modules/react-router/dist/production/instrumentation-DvHY1sgY.d.ts +3332 -0
  765. package/node_modules/react-router/dist/production/lib/types/internal.d.mts +184 -0
  766. package/node_modules/react-router/dist/production/lib/types/internal.d.ts +184 -0
  767. package/node_modules/react-router/dist/production/lib/types/internal.js +10 -0
  768. package/node_modules/react-router/dist/production/lib/types/internal.mjs +10 -0
  769. package/node_modules/react-router/dist/production/register-Bm80E9qL.d.ts +30 -0
  770. package/node_modules/react-router/dist/production/register-CS_tiXsm.d.mts +30 -0
  771. package/node_modules/react-router/dist/production/router-5iOvts3c.d.mts +3332 -0
  772. package/node_modules/react-router/node_modules/cookie/LICENSE +24 -0
  773. package/node_modules/react-router/node_modules/cookie/README.md +295 -0
  774. package/node_modules/react-router/node_modules/cookie/dist/index.d.ts +148 -0
  775. package/node_modules/react-router/node_modules/cookie/dist/index.js +350 -0
  776. package/node_modules/react-router/node_modules/cookie/dist/index.js.map +1 -0
  777. package/node_modules/react-router/node_modules/cookie/package.json +47 -0
  778. package/node_modules/react-router/package.json +163 -0
  779. package/node_modules/react-router-dom/LICENSE.md +23 -0
  780. package/node_modules/react-router-dom/README.md +6 -0
  781. package/node_modules/react-router-dom/dist/index.d.mts +2 -0
  782. package/node_modules/react-router-dom/dist/index.d.ts +2 -0
  783. package/node_modules/react-router-dom/dist/index.js +45 -0
  784. package/node_modules/react-router-dom/dist/index.mjs +18 -0
  785. package/node_modules/react-router-dom/package.json +83 -0
  786. package/node_modules/set-cookie-parser/LICENSE +21 -0
  787. package/node_modules/set-cookie-parser/README.md +202 -0
  788. package/node_modules/set-cookie-parser/lib/set-cookie.js +242 -0
  789. package/node_modules/set-cookie-parser/package.json +45 -0
  790. package/node_modules/zustand/LICENSE +21 -0
  791. package/node_modules/zustand/README.md +512 -0
  792. package/node_modules/zustand/esm/index.d.mts +2 -0
  793. package/node_modules/zustand/esm/index.mjs +2 -0
  794. package/node_modules/zustand/esm/middleware/combine.d.mts +4 -0
  795. package/node_modules/zustand/esm/middleware/devtools.d.mts +58 -0
  796. package/node_modules/zustand/esm/middleware/immer.d.mts +29 -0
  797. package/node_modules/zustand/esm/middleware/immer.mjs +12 -0
  798. package/node_modules/zustand/esm/middleware/persist.d.mts +99 -0
  799. package/node_modules/zustand/esm/middleware/redux.d.mts +21 -0
  800. package/node_modules/zustand/esm/middleware/ssrSafe.d.mts +2 -0
  801. package/node_modules/zustand/esm/middleware/subscribeWithSelector.d.mts +25 -0
  802. package/node_modules/zustand/esm/middleware.d.mts +6 -0
  803. package/node_modules/zustand/esm/middleware.mjs +487 -0
  804. package/node_modules/zustand/esm/react/shallow.d.mts +1 -0
  805. package/node_modules/zustand/esm/react/shallow.mjs +12 -0
  806. package/node_modules/zustand/esm/react.d.mts +14 -0
  807. package/node_modules/zustand/esm/react.mjs +22 -0
  808. package/node_modules/zustand/esm/shallow.d.mts +2 -0
  809. package/node_modules/zustand/esm/shallow.mjs +2 -0
  810. package/node_modules/zustand/esm/traditional.d.mts +14 -0
  811. package/node_modules/zustand/esm/traditional.mjs +26 -0
  812. package/node_modules/zustand/esm/vanilla/shallow.d.mts +1 -0
  813. package/node_modules/zustand/esm/vanilla/shallow.mjs +55 -0
  814. package/node_modules/zustand/esm/vanilla.d.mts +31 -0
  815. package/node_modules/zustand/esm/vanilla.mjs +24 -0
  816. package/node_modules/zustand/index.d.ts +2 -0
  817. package/node_modules/zustand/index.js +19 -0
  818. package/node_modules/zustand/middleware/combine.d.ts +4 -0
  819. package/node_modules/zustand/middleware/devtools.d.ts +58 -0
  820. package/node_modules/zustand/middleware/immer.d.ts +29 -0
  821. package/node_modules/zustand/middleware/immer.js +14 -0
  822. package/node_modules/zustand/middleware/persist.d.ts +99 -0
  823. package/node_modules/zustand/middleware/redux.d.ts +21 -0
  824. package/node_modules/zustand/middleware/ssrSafe.d.ts +2 -0
  825. package/node_modules/zustand/middleware/subscribeWithSelector.d.ts +25 -0
  826. package/node_modules/zustand/middleware.d.ts +6 -0
  827. package/node_modules/zustand/middleware.js +495 -0
  828. package/node_modules/zustand/package.json +108 -0
  829. package/node_modules/zustand/react/shallow.d.ts +1 -0
  830. package/node_modules/zustand/react/shallow.js +14 -0
  831. package/node_modules/zustand/react.d.ts +14 -0
  832. package/node_modules/zustand/react.js +25 -0
  833. package/node_modules/zustand/shallow.d.ts +2 -0
  834. package/node_modules/zustand/shallow.js +15 -0
  835. package/node_modules/zustand/traditional.d.ts +14 -0
  836. package/node_modules/zustand/traditional.js +29 -0
  837. package/node_modules/zustand/ts_version_4.5_and_above_is_required.d.ts +0 -0
  838. package/node_modules/zustand/vanilla/shallow.d.ts +1 -0
  839. package/node_modules/zustand/vanilla/shallow.js +57 -0
  840. package/node_modules/zustand/vanilla.d.ts +31 -0
  841. package/node_modules/zustand/vanilla.js +26 -0
  842. package/oclif.manifest.json +516 -454
  843. package/package.json +5 -2
@@ -0,0 +1,2508 @@
1
+ /**
2
+ * react-router v7.13.0
3
+ *
4
+ * Copyright (c) Remix Software Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
11
+ import {
12
+ ENABLE_DEV_WARNINGS,
13
+ ErrorResponseImpl,
14
+ FrameworkContext,
15
+ NO_BODY_STATUS_CODES,
16
+ Outlet,
17
+ RSCRouterContext,
18
+ RemixErrorBoundary,
19
+ RouterContextProvider,
20
+ RouterProvider,
21
+ SINGLE_FETCH_REDIRECT_STATUS,
22
+ SingleFetchRedirectSymbol,
23
+ StaticRouterProvider,
24
+ StreamTransfer,
25
+ convertRoutesToDataRoutes,
26
+ createMemoryRouter,
27
+ createServerRoutes,
28
+ createStaticHandler,
29
+ createStaticRouter,
30
+ decodeRedirectErrorDigest,
31
+ decodeRouteErrorResponseDigest,
32
+ decodeViaTurboStream,
33
+ encode,
34
+ escapeHtml,
35
+ getManifestPath,
36
+ getStaticContextFromError,
37
+ instrumentHandler,
38
+ isDataWithResponseInit,
39
+ isRedirectResponse,
40
+ isRedirectStatusCode,
41
+ isResponse,
42
+ isRouteErrorResponse,
43
+ matchRoutes,
44
+ redirect,
45
+ redirectDocument,
46
+ replace,
47
+ shouldHydrateRouteLoader,
48
+ stripBasename,
49
+ useRouteError,
50
+ warnOnce,
51
+ withComponentProps,
52
+ withErrorBoundaryProps,
53
+ withHydrateFallbackProps
54
+ } from "./chunk-Y3R63HEB.mjs";
55
+
56
+ // lib/dom/ssr/server.tsx
57
+ import * as React from "react";
58
+ function ServerRouter({
59
+ context,
60
+ url,
61
+ nonce
62
+ }) {
63
+ if (typeof url === "string") {
64
+ url = new URL(url);
65
+ }
66
+ let { manifest, routeModules, criticalCss, serverHandoffString } = context;
67
+ let routes = createServerRoutes(
68
+ manifest.routes,
69
+ routeModules,
70
+ context.future,
71
+ context.isSpaMode
72
+ );
73
+ context.staticHandlerContext.loaderData = {
74
+ ...context.staticHandlerContext.loaderData
75
+ };
76
+ for (let match of context.staticHandlerContext.matches) {
77
+ let routeId = match.route.id;
78
+ let route = routeModules[routeId];
79
+ let manifestRoute = context.manifest.routes[routeId];
80
+ if (route && manifestRoute && shouldHydrateRouteLoader(
81
+ routeId,
82
+ route.clientLoader,
83
+ manifestRoute.hasLoader,
84
+ context.isSpaMode
85
+ ) && (route.HydrateFallback || !manifestRoute.hasLoader)) {
86
+ delete context.staticHandlerContext.loaderData[routeId];
87
+ }
88
+ }
89
+ let router = createStaticRouter(routes, context.staticHandlerContext);
90
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
91
+ FrameworkContext.Provider,
92
+ {
93
+ value: {
94
+ manifest,
95
+ routeModules,
96
+ criticalCss,
97
+ serverHandoffString,
98
+ future: context.future,
99
+ ssr: context.ssr,
100
+ isSpaMode: context.isSpaMode,
101
+ routeDiscovery: context.routeDiscovery,
102
+ serializeError: context.serializeError,
103
+ renderMeta: context.renderMeta
104
+ }
105
+ },
106
+ /* @__PURE__ */ React.createElement(RemixErrorBoundary, { location: router.state.location }, /* @__PURE__ */ React.createElement(
107
+ StaticRouterProvider,
108
+ {
109
+ router,
110
+ context: context.staticHandlerContext,
111
+ hydrate: false
112
+ }
113
+ ))
114
+ ), context.serverHandoffStream ? /* @__PURE__ */ React.createElement(React.Suspense, null, /* @__PURE__ */ React.createElement(
115
+ StreamTransfer,
116
+ {
117
+ context,
118
+ identifier: 0,
119
+ reader: context.serverHandoffStream.getReader(),
120
+ textDecoder: new TextDecoder(),
121
+ nonce
122
+ }
123
+ )) : null);
124
+ }
125
+
126
+ // lib/dom/ssr/routes-test-stub.tsx
127
+ import * as React2 from "react";
128
+ function createRoutesStub(routes, _context) {
129
+ return function RoutesTestStub({
130
+ initialEntries,
131
+ initialIndex,
132
+ hydrationData,
133
+ future
134
+ }) {
135
+ let routerRef = React2.useRef();
136
+ let frameworkContextRef = React2.useRef();
137
+ if (routerRef.current == null) {
138
+ frameworkContextRef.current = {
139
+ future: {
140
+ unstable_subResourceIntegrity: future?.unstable_subResourceIntegrity === true,
141
+ v8_middleware: future?.v8_middleware === true,
142
+ unstable_trailingSlashAwareDataRequests: future?.unstable_trailingSlashAwareDataRequests === true
143
+ },
144
+ manifest: {
145
+ routes: {},
146
+ entry: { imports: [], module: "" },
147
+ url: "",
148
+ version: ""
149
+ },
150
+ routeModules: {},
151
+ ssr: false,
152
+ isSpaMode: false,
153
+ routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" }
154
+ };
155
+ let patched = processRoutes(
156
+ // @ts-expect-error `StubRouteObject` is stricter about `loader`/`action`
157
+ // types compared to `AgnosticRouteObject`
158
+ convertRoutesToDataRoutes(routes, (r) => r),
159
+ _context !== void 0 ? _context : future?.v8_middleware ? new RouterContextProvider() : {},
160
+ frameworkContextRef.current.manifest,
161
+ frameworkContextRef.current.routeModules
162
+ );
163
+ routerRef.current = createMemoryRouter(patched, {
164
+ initialEntries,
165
+ initialIndex,
166
+ hydrationData
167
+ });
168
+ }
169
+ return /* @__PURE__ */ React2.createElement(FrameworkContext.Provider, { value: frameworkContextRef.current }, /* @__PURE__ */ React2.createElement(RouterProvider, { router: routerRef.current }));
170
+ };
171
+ }
172
+ function processRoutes(routes, context, manifest, routeModules, parentId) {
173
+ return routes.map((route) => {
174
+ if (!route.id) {
175
+ throw new Error(
176
+ "Expected a route.id in react-router processRoutes() function"
177
+ );
178
+ }
179
+ let newRoute = {
180
+ id: route.id,
181
+ path: route.path,
182
+ index: route.index,
183
+ Component: route.Component ? withComponentProps(route.Component) : void 0,
184
+ HydrateFallback: route.HydrateFallback ? withHydrateFallbackProps(route.HydrateFallback) : void 0,
185
+ ErrorBoundary: route.ErrorBoundary ? withErrorBoundaryProps(route.ErrorBoundary) : void 0,
186
+ action: route.action ? (args) => route.action({ ...args, context }) : void 0,
187
+ loader: route.loader ? (args) => route.loader({ ...args, context }) : void 0,
188
+ middleware: route.middleware ? route.middleware.map(
189
+ (mw) => (...args) => mw(
190
+ { ...args[0], context },
191
+ args[1]
192
+ )
193
+ ) : void 0,
194
+ handle: route.handle,
195
+ shouldRevalidate: route.shouldRevalidate
196
+ };
197
+ let entryRoute = {
198
+ id: route.id,
199
+ path: route.path,
200
+ index: route.index,
201
+ parentId,
202
+ hasAction: route.action != null,
203
+ hasLoader: route.loader != null,
204
+ // When testing routes, you should be stubbing loader/action/middleware,
205
+ // not trying to re-implement the full loader/clientLoader/SSR/hydration
206
+ // flow. That is better tested via E2E tests.
207
+ hasClientAction: false,
208
+ hasClientLoader: false,
209
+ hasClientMiddleware: false,
210
+ hasErrorBoundary: route.ErrorBoundary != null,
211
+ // any need for these?
212
+ module: "build/stub-path-to-module.js",
213
+ clientActionModule: void 0,
214
+ clientLoaderModule: void 0,
215
+ clientMiddlewareModule: void 0,
216
+ hydrateFallbackModule: void 0
217
+ };
218
+ manifest.routes[newRoute.id] = entryRoute;
219
+ routeModules[route.id] = {
220
+ default: newRoute.Component || Outlet,
221
+ ErrorBoundary: newRoute.ErrorBoundary || void 0,
222
+ handle: route.handle,
223
+ links: route.links,
224
+ meta: route.meta,
225
+ shouldRevalidate: route.shouldRevalidate
226
+ };
227
+ if (route.children) {
228
+ newRoute.children = processRoutes(
229
+ route.children,
230
+ context,
231
+ manifest,
232
+ routeModules,
233
+ newRoute.id
234
+ );
235
+ }
236
+ return newRoute;
237
+ });
238
+ }
239
+
240
+ // lib/server-runtime/cookies.ts
241
+ import { parse, serialize } from "cookie";
242
+
243
+ // lib/server-runtime/crypto.ts
244
+ var encoder = /* @__PURE__ */ new TextEncoder();
245
+ var sign = async (value, secret) => {
246
+ let data2 = encoder.encode(value);
247
+ let key = await createKey(secret, ["sign"]);
248
+ let signature = await crypto.subtle.sign("HMAC", key, data2);
249
+ let hash = btoa(String.fromCharCode(...new Uint8Array(signature))).replace(
250
+ /=+$/,
251
+ ""
252
+ );
253
+ return value + "." + hash;
254
+ };
255
+ var unsign = async (cookie, secret) => {
256
+ let index = cookie.lastIndexOf(".");
257
+ let value = cookie.slice(0, index);
258
+ let hash = cookie.slice(index + 1);
259
+ let data2 = encoder.encode(value);
260
+ let key = await createKey(secret, ["verify"]);
261
+ try {
262
+ let signature = byteStringToUint8Array(atob(hash));
263
+ let valid = await crypto.subtle.verify("HMAC", key, signature, data2);
264
+ return valid ? value : false;
265
+ } catch (error) {
266
+ return false;
267
+ }
268
+ };
269
+ var createKey = async (secret, usages) => crypto.subtle.importKey(
270
+ "raw",
271
+ encoder.encode(secret),
272
+ { name: "HMAC", hash: "SHA-256" },
273
+ false,
274
+ usages
275
+ );
276
+ function byteStringToUint8Array(byteString) {
277
+ let array = new Uint8Array(byteString.length);
278
+ for (let i = 0; i < byteString.length; i++) {
279
+ array[i] = byteString.charCodeAt(i);
280
+ }
281
+ return array;
282
+ }
283
+
284
+ // lib/server-runtime/cookies.ts
285
+ var createCookie = (name, cookieOptions = {}) => {
286
+ let { secrets = [], ...options } = {
287
+ path: "/",
288
+ sameSite: "lax",
289
+ ...cookieOptions
290
+ };
291
+ warnOnceAboutExpiresCookie(name, options.expires);
292
+ return {
293
+ get name() {
294
+ return name;
295
+ },
296
+ get isSigned() {
297
+ return secrets.length > 0;
298
+ },
299
+ get expires() {
300
+ return typeof options.maxAge !== "undefined" ? new Date(Date.now() + options.maxAge * 1e3) : options.expires;
301
+ },
302
+ async parse(cookieHeader, parseOptions) {
303
+ if (!cookieHeader) return null;
304
+ let cookies = parse(cookieHeader, { ...options, ...parseOptions });
305
+ if (name in cookies) {
306
+ let value = cookies[name];
307
+ if (typeof value === "string" && value !== "") {
308
+ let decoded = await decodeCookieValue(value, secrets);
309
+ return decoded;
310
+ } else {
311
+ return "";
312
+ }
313
+ } else {
314
+ return null;
315
+ }
316
+ },
317
+ async serialize(value, serializeOptions) {
318
+ return serialize(
319
+ name,
320
+ value === "" ? "" : await encodeCookieValue(value, secrets),
321
+ {
322
+ ...options,
323
+ ...serializeOptions
324
+ }
325
+ );
326
+ }
327
+ };
328
+ };
329
+ var isCookie = (object) => {
330
+ return object != null && typeof object.name === "string" && typeof object.isSigned === "boolean" && typeof object.parse === "function" && typeof object.serialize === "function";
331
+ };
332
+ async function encodeCookieValue(value, secrets) {
333
+ let encoded = encodeData(value);
334
+ if (secrets.length > 0) {
335
+ encoded = await sign(encoded, secrets[0]);
336
+ }
337
+ return encoded;
338
+ }
339
+ async function decodeCookieValue(value, secrets) {
340
+ if (secrets.length > 0) {
341
+ for (let secret of secrets) {
342
+ let unsignedValue = await unsign(value, secret);
343
+ if (unsignedValue !== false) {
344
+ return decodeData(unsignedValue);
345
+ }
346
+ }
347
+ return null;
348
+ }
349
+ return decodeData(value);
350
+ }
351
+ function encodeData(value) {
352
+ return btoa(myUnescape(encodeURIComponent(JSON.stringify(value))));
353
+ }
354
+ function decodeData(value) {
355
+ try {
356
+ return JSON.parse(decodeURIComponent(myEscape(atob(value))));
357
+ } catch (error) {
358
+ return {};
359
+ }
360
+ }
361
+ function myEscape(value) {
362
+ let str = value.toString();
363
+ let result = "";
364
+ let index = 0;
365
+ let chr, code;
366
+ while (index < str.length) {
367
+ chr = str.charAt(index++);
368
+ if (/[\w*+\-./@]/.exec(chr)) {
369
+ result += chr;
370
+ } else {
371
+ code = chr.charCodeAt(0);
372
+ if (code < 256) {
373
+ result += "%" + hex(code, 2);
374
+ } else {
375
+ result += "%u" + hex(code, 4).toUpperCase();
376
+ }
377
+ }
378
+ }
379
+ return result;
380
+ }
381
+ function hex(code, length) {
382
+ let result = code.toString(16);
383
+ while (result.length < length) result = "0" + result;
384
+ return result;
385
+ }
386
+ function myUnescape(value) {
387
+ let str = value.toString();
388
+ let result = "";
389
+ let index = 0;
390
+ let chr, part;
391
+ while (index < str.length) {
392
+ chr = str.charAt(index++);
393
+ if (chr === "%") {
394
+ if (str.charAt(index) === "u") {
395
+ part = str.slice(index + 1, index + 5);
396
+ if (/^[\da-f]{4}$/i.exec(part)) {
397
+ result += String.fromCharCode(parseInt(part, 16));
398
+ index += 5;
399
+ continue;
400
+ }
401
+ } else {
402
+ part = str.slice(index, index + 2);
403
+ if (/^[\da-f]{2}$/i.exec(part)) {
404
+ result += String.fromCharCode(parseInt(part, 16));
405
+ index += 2;
406
+ continue;
407
+ }
408
+ }
409
+ }
410
+ result += chr;
411
+ }
412
+ return result;
413
+ }
414
+ function warnOnceAboutExpiresCookie(name, expires) {
415
+ warnOnce(
416
+ !expires,
417
+ `The "${name}" cookie has an "expires" property set. This will cause the expires value to not be updated when the session is committed. Instead, you should set the expires value when serializing the cookie. You can use \`commitSession(session, { expires })\` if using a session storage object, or \`cookie.serialize("value", { expires })\` if you're using the cookie directly.`
418
+ );
419
+ }
420
+
421
+ // lib/server-runtime/entry.ts
422
+ function createEntryRouteModules(manifest) {
423
+ return Object.keys(manifest).reduce((memo, routeId) => {
424
+ let route = manifest[routeId];
425
+ if (route) {
426
+ memo[routeId] = route.module;
427
+ }
428
+ return memo;
429
+ }, {});
430
+ }
431
+
432
+ // lib/server-runtime/mode.ts
433
+ var ServerMode = /* @__PURE__ */ ((ServerMode2) => {
434
+ ServerMode2["Development"] = "development";
435
+ ServerMode2["Production"] = "production";
436
+ ServerMode2["Test"] = "test";
437
+ return ServerMode2;
438
+ })(ServerMode || {});
439
+ function isServerMode(value) {
440
+ return value === "development" /* Development */ || value === "production" /* Production */ || value === "test" /* Test */;
441
+ }
442
+
443
+ // lib/server-runtime/errors.ts
444
+ function sanitizeError(error, serverMode) {
445
+ if (error instanceof Error && serverMode !== "development" /* Development */) {
446
+ let sanitized = new Error("Unexpected Server Error");
447
+ sanitized.stack = void 0;
448
+ return sanitized;
449
+ }
450
+ return error;
451
+ }
452
+ function sanitizeErrors(errors, serverMode) {
453
+ return Object.entries(errors).reduce((acc, [routeId, error]) => {
454
+ return Object.assign(acc, { [routeId]: sanitizeError(error, serverMode) });
455
+ }, {});
456
+ }
457
+ function serializeError(error, serverMode) {
458
+ let sanitized = sanitizeError(error, serverMode);
459
+ return {
460
+ message: sanitized.message,
461
+ stack: sanitized.stack
462
+ };
463
+ }
464
+ function serializeErrors(errors, serverMode) {
465
+ if (!errors) return null;
466
+ let entries = Object.entries(errors);
467
+ let serialized = {};
468
+ for (let [key, val] of entries) {
469
+ if (isRouteErrorResponse(val)) {
470
+ serialized[key] = { ...val, __type: "RouteErrorResponse" };
471
+ } else if (val instanceof Error) {
472
+ let sanitized = sanitizeError(val, serverMode);
473
+ serialized[key] = {
474
+ message: sanitized.message,
475
+ stack: sanitized.stack,
476
+ __type: "Error",
477
+ // If this is a subclass (i.e., ReferenceError), send up the type so we
478
+ // can re-create the same type during hydration. This will only apply
479
+ // in dev mode since all production errors are sanitized to normal
480
+ // Error instances
481
+ ...sanitized.name !== "Error" ? {
482
+ __subType: sanitized.name
483
+ } : {}
484
+ };
485
+ } else {
486
+ serialized[key] = val;
487
+ }
488
+ }
489
+ return serialized;
490
+ }
491
+
492
+ // lib/server-runtime/routeMatching.ts
493
+ function matchServerRoutes(routes, pathname, basename) {
494
+ let matches = matchRoutes(
495
+ routes,
496
+ pathname,
497
+ basename
498
+ );
499
+ if (!matches) return null;
500
+ return matches.map((match) => ({
501
+ params: match.params,
502
+ pathname: match.pathname,
503
+ route: match.route
504
+ }));
505
+ }
506
+
507
+ // lib/server-runtime/data.ts
508
+ async function callRouteHandler(handler, args) {
509
+ let result = await handler({
510
+ request: stripRoutesParam(stripIndexParam(args.request)),
511
+ params: args.params,
512
+ context: args.context,
513
+ unstable_pattern: args.unstable_pattern
514
+ });
515
+ if (isDataWithResponseInit(result) && result.init && result.init.status && isRedirectStatusCode(result.init.status)) {
516
+ throw new Response(null, result.init);
517
+ }
518
+ return result;
519
+ }
520
+ function stripIndexParam(request) {
521
+ let url = new URL(request.url);
522
+ let indexValues = url.searchParams.getAll("index");
523
+ url.searchParams.delete("index");
524
+ let indexValuesToKeep = [];
525
+ for (let indexValue of indexValues) {
526
+ if (indexValue) {
527
+ indexValuesToKeep.push(indexValue);
528
+ }
529
+ }
530
+ for (let toKeep of indexValuesToKeep) {
531
+ url.searchParams.append("index", toKeep);
532
+ }
533
+ let init = {
534
+ method: request.method,
535
+ body: request.body,
536
+ headers: request.headers,
537
+ signal: request.signal
538
+ };
539
+ if (init.body) {
540
+ init.duplex = "half";
541
+ }
542
+ return new Request(url.href, init);
543
+ }
544
+ function stripRoutesParam(request) {
545
+ let url = new URL(request.url);
546
+ url.searchParams.delete("_routes");
547
+ let init = {
548
+ method: request.method,
549
+ body: request.body,
550
+ headers: request.headers,
551
+ signal: request.signal
552
+ };
553
+ if (init.body) {
554
+ init.duplex = "half";
555
+ }
556
+ return new Request(url.href, init);
557
+ }
558
+
559
+ // lib/server-runtime/invariant.ts
560
+ function invariant(value, message) {
561
+ if (value === false || value === null || typeof value === "undefined") {
562
+ console.error(
563
+ "The following error is a bug in React Router; please open an issue! https://github.com/remix-run/react-router/issues/new/choose"
564
+ );
565
+ throw new Error(message);
566
+ }
567
+ }
568
+
569
+ // lib/server-runtime/dev.ts
570
+ var globalDevServerHooksKey = "__reactRouterDevServerHooks";
571
+ function setDevServerHooks(devServerHooks) {
572
+ globalThis[globalDevServerHooksKey] = devServerHooks;
573
+ }
574
+ function getDevServerHooks() {
575
+ return globalThis[globalDevServerHooksKey];
576
+ }
577
+ function getBuildTimeHeader(request, headerName) {
578
+ if (typeof process !== "undefined") {
579
+ try {
580
+ if (process.env?.IS_RR_BUILD_REQUEST === "yes") {
581
+ return request.headers.get(headerName);
582
+ }
583
+ } catch (e) {
584
+ }
585
+ }
586
+ return null;
587
+ }
588
+
589
+ // lib/server-runtime/routes.ts
590
+ function groupRoutesByParentId(manifest) {
591
+ let routes = {};
592
+ Object.values(manifest).forEach((route) => {
593
+ if (route) {
594
+ let parentId = route.parentId || "";
595
+ if (!routes[parentId]) {
596
+ routes[parentId] = [];
597
+ }
598
+ routes[parentId].push(route);
599
+ }
600
+ });
601
+ return routes;
602
+ }
603
+ function createRoutes(manifest, parentId = "", routesByParentId = groupRoutesByParentId(manifest)) {
604
+ return (routesByParentId[parentId] || []).map((route) => ({
605
+ ...route,
606
+ children: createRoutes(manifest, route.id, routesByParentId)
607
+ }));
608
+ }
609
+ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesByParentId = groupRoutesByParentId(manifest)) {
610
+ return (routesByParentId[parentId] || []).map((route) => {
611
+ let commonRoute = {
612
+ // Always include root due to default boundaries
613
+ hasErrorBoundary: route.id === "root" || route.module.ErrorBoundary != null,
614
+ id: route.id,
615
+ path: route.path,
616
+ middleware: route.module.middleware,
617
+ // Need to use RR's version in the param typed here to permit the optional
618
+ // context even though we know it'll always be provided in remix
619
+ loader: route.module.loader ? async (args) => {
620
+ let preRenderedData = getBuildTimeHeader(
621
+ args.request,
622
+ "X-React-Router-Prerender-Data"
623
+ );
624
+ if (preRenderedData != null) {
625
+ let encoded = preRenderedData ? decodeURI(preRenderedData) : preRenderedData;
626
+ invariant(encoded, "Missing prerendered data for route");
627
+ let uint8array = new TextEncoder().encode(encoded);
628
+ let stream = new ReadableStream({
629
+ start(controller) {
630
+ controller.enqueue(uint8array);
631
+ controller.close();
632
+ }
633
+ });
634
+ let decoded = await decodeViaTurboStream(stream, global);
635
+ let data2 = decoded.value;
636
+ if (data2 && SingleFetchRedirectSymbol in data2) {
637
+ let result = data2[SingleFetchRedirectSymbol];
638
+ let init = { status: result.status };
639
+ if (result.reload) {
640
+ throw redirectDocument(result.redirect, init);
641
+ } else if (result.replace) {
642
+ throw replace(result.redirect, init);
643
+ } else {
644
+ throw redirect(result.redirect, init);
645
+ }
646
+ } else {
647
+ invariant(
648
+ data2 && route.id in data2,
649
+ "Unable to decode prerendered data"
650
+ );
651
+ let result = data2[route.id];
652
+ invariant(
653
+ "data" in result,
654
+ "Unable to process prerendered data"
655
+ );
656
+ return result.data;
657
+ }
658
+ }
659
+ let val = await callRouteHandler(route.module.loader, args);
660
+ return val;
661
+ } : void 0,
662
+ action: route.module.action ? (args) => callRouteHandler(route.module.action, args) : void 0,
663
+ handle: route.module.handle
664
+ };
665
+ return route.index ? {
666
+ index: true,
667
+ ...commonRoute
668
+ } : {
669
+ caseSensitive: route.caseSensitive,
670
+ children: createStaticHandlerDataRoutes(
671
+ manifest,
672
+ future,
673
+ route.id,
674
+ routesByParentId
675
+ ),
676
+ ...commonRoute
677
+ };
678
+ });
679
+ }
680
+
681
+ // lib/server-runtime/serverHandoff.ts
682
+ function createServerHandoffString(serverHandoff) {
683
+ return escapeHtml(JSON.stringify(serverHandoff));
684
+ }
685
+
686
+ // lib/server-runtime/headers.ts
687
+ import { splitCookiesString } from "set-cookie-parser";
688
+ function getDocumentHeaders(context, build) {
689
+ return getDocumentHeadersImpl(context, (m) => {
690
+ let route = build.routes[m.route.id];
691
+ invariant(route, `Route with id "${m.route.id}" not found in build`);
692
+ return route.module.headers;
693
+ });
694
+ }
695
+ function getDocumentHeadersImpl(context, getRouteHeadersFn, _defaultHeaders) {
696
+ let boundaryIdx = context.errors ? context.matches.findIndex((m) => context.errors[m.route.id]) : -1;
697
+ let matches = boundaryIdx >= 0 ? context.matches.slice(0, boundaryIdx + 1) : context.matches;
698
+ let errorHeaders;
699
+ if (boundaryIdx >= 0) {
700
+ let { actionHeaders, actionData, loaderHeaders, loaderData } = context;
701
+ context.matches.slice(boundaryIdx).some((match) => {
702
+ let id = match.route.id;
703
+ if (actionHeaders[id] && (!actionData || !actionData.hasOwnProperty(id))) {
704
+ errorHeaders = actionHeaders[id];
705
+ } else if (loaderHeaders[id] && !loaderData.hasOwnProperty(id)) {
706
+ errorHeaders = loaderHeaders[id];
707
+ }
708
+ return errorHeaders != null;
709
+ });
710
+ }
711
+ const defaultHeaders = new Headers(_defaultHeaders);
712
+ return matches.reduce((parentHeaders, match, idx) => {
713
+ let { id } = match.route;
714
+ let loaderHeaders = context.loaderHeaders[id] || new Headers();
715
+ let actionHeaders = context.actionHeaders[id] || new Headers();
716
+ let includeErrorHeaders = errorHeaders != null && idx === matches.length - 1;
717
+ let includeErrorCookies = includeErrorHeaders && errorHeaders !== loaderHeaders && errorHeaders !== actionHeaders;
718
+ let headersFn = getRouteHeadersFn(match);
719
+ if (headersFn == null) {
720
+ let headers2 = new Headers(parentHeaders);
721
+ if (includeErrorCookies) {
722
+ prependCookies(errorHeaders, headers2);
723
+ }
724
+ prependCookies(actionHeaders, headers2);
725
+ prependCookies(loaderHeaders, headers2);
726
+ return headers2;
727
+ }
728
+ let headers = new Headers(
729
+ typeof headersFn === "function" ? headersFn({
730
+ loaderHeaders,
731
+ parentHeaders,
732
+ actionHeaders,
733
+ errorHeaders: includeErrorHeaders ? errorHeaders : void 0
734
+ }) : headersFn
735
+ );
736
+ if (includeErrorCookies) {
737
+ prependCookies(errorHeaders, headers);
738
+ }
739
+ prependCookies(actionHeaders, headers);
740
+ prependCookies(loaderHeaders, headers);
741
+ prependCookies(parentHeaders, headers);
742
+ return headers;
743
+ }, new Headers(defaultHeaders));
744
+ }
745
+ function prependCookies(parentHeaders, childHeaders) {
746
+ let parentSetCookieString = parentHeaders.get("Set-Cookie");
747
+ if (parentSetCookieString) {
748
+ let cookies = splitCookiesString(parentSetCookieString);
749
+ let childCookies = new Set(childHeaders.getSetCookie());
750
+ cookies.forEach((cookie) => {
751
+ if (!childCookies.has(cookie)) {
752
+ childHeaders.append("Set-Cookie", cookie);
753
+ }
754
+ });
755
+ }
756
+ }
757
+
758
+ // lib/actions.ts
759
+ function throwIfPotentialCSRFAttack(headers, allowedActionOrigins) {
760
+ let originHeader = headers.get("origin");
761
+ let originDomain = typeof originHeader === "string" && originHeader !== "null" ? new URL(originHeader).host : originHeader;
762
+ let host = parseHostHeader(headers);
763
+ if (originDomain && (!host || originDomain !== host.value)) {
764
+ if (!isAllowedOrigin(originDomain, allowedActionOrigins)) {
765
+ if (host) {
766
+ throw new Error(
767
+ `${host.type} header does not match \`origin\` header from a forwarded action request. Aborting the action.`
768
+ );
769
+ } else {
770
+ throw new Error(
771
+ "`x-forwarded-host` or `host` headers are not provided. One of these is needed to compare the `origin` header from a forwarded action request. Aborting the action."
772
+ );
773
+ }
774
+ }
775
+ }
776
+ }
777
+ function matchWildcardDomain(domain, pattern) {
778
+ const domainParts = domain.split(".");
779
+ const patternParts = pattern.split(".");
780
+ if (patternParts.length < 1) {
781
+ return false;
782
+ }
783
+ if (domainParts.length < patternParts.length) {
784
+ return false;
785
+ }
786
+ while (patternParts.length) {
787
+ const patternPart = patternParts.pop();
788
+ const domainPart = domainParts.pop();
789
+ switch (patternPart) {
790
+ case "": {
791
+ return false;
792
+ }
793
+ case "*": {
794
+ if (domainPart) {
795
+ continue;
796
+ } else {
797
+ return false;
798
+ }
799
+ }
800
+ case "**": {
801
+ if (patternParts.length > 0) {
802
+ return false;
803
+ }
804
+ return domainPart !== void 0;
805
+ }
806
+ case void 0:
807
+ default: {
808
+ if (domainPart !== patternPart) {
809
+ return false;
810
+ }
811
+ }
812
+ }
813
+ }
814
+ return domainParts.length === 0;
815
+ }
816
+ function isAllowedOrigin(originDomain, allowedActionOrigins = []) {
817
+ return allowedActionOrigins.some(
818
+ (allowedOrigin) => allowedOrigin && (allowedOrigin === originDomain || matchWildcardDomain(originDomain, allowedOrigin))
819
+ );
820
+ }
821
+ function parseHostHeader(headers) {
822
+ let forwardedHostHeader = headers.get("x-forwarded-host");
823
+ let forwardedHostValue = forwardedHostHeader?.split(",")[0]?.trim();
824
+ let hostHeader = headers.get("host");
825
+ return forwardedHostValue ? {
826
+ type: "x-forwarded-host",
827
+ value: forwardedHostValue
828
+ } : hostHeader ? {
829
+ type: "host",
830
+ value: hostHeader
831
+ } : void 0;
832
+ }
833
+
834
+ // lib/server-runtime/single-fetch.ts
835
+ var SERVER_NO_BODY_STATUS_CODES = /* @__PURE__ */ new Set([
836
+ ...NO_BODY_STATUS_CODES,
837
+ 304
838
+ ]);
839
+ async function singleFetchAction(build, serverMode, staticHandler, request, handlerUrl, loadContext, handleError) {
840
+ try {
841
+ try {
842
+ throwIfPotentialCSRFAttack(
843
+ request.headers,
844
+ Array.isArray(build.allowedActionOrigins) ? build.allowedActionOrigins : []
845
+ );
846
+ } catch (e) {
847
+ return handleQueryError(new Error("Bad Request"), 400);
848
+ }
849
+ let handlerRequest = new Request(handlerUrl, {
850
+ method: request.method,
851
+ body: request.body,
852
+ headers: request.headers,
853
+ signal: request.signal,
854
+ ...request.body ? { duplex: "half" } : void 0
855
+ });
856
+ let result = await staticHandler.query(handlerRequest, {
857
+ requestContext: loadContext,
858
+ skipLoaderErrorBubbling: true,
859
+ skipRevalidation: true,
860
+ generateMiddlewareResponse: build.future.v8_middleware ? async (query) => {
861
+ try {
862
+ let innerResult = await query(handlerRequest);
863
+ return handleQueryResult(innerResult);
864
+ } catch (error) {
865
+ return handleQueryError(error);
866
+ }
867
+ } : void 0
868
+ });
869
+ return handleQueryResult(result);
870
+ } catch (error) {
871
+ return handleQueryError(error);
872
+ }
873
+ function handleQueryResult(result) {
874
+ return isResponse(result) ? result : staticContextToResponse(result);
875
+ }
876
+ function handleQueryError(error, status = 500) {
877
+ handleError(error);
878
+ return generateSingleFetchResponse(request, build, serverMode, {
879
+ result: { error },
880
+ headers: new Headers(),
881
+ status
882
+ });
883
+ }
884
+ function staticContextToResponse(context) {
885
+ let headers = getDocumentHeaders(context, build);
886
+ if (isRedirectStatusCode(context.statusCode) && headers.has("Location")) {
887
+ return new Response(null, { status: context.statusCode, headers });
888
+ }
889
+ if (context.errors) {
890
+ Object.values(context.errors).forEach((err) => {
891
+ if (!isRouteErrorResponse(err) || err.error) {
892
+ handleError(err);
893
+ }
894
+ });
895
+ context.errors = sanitizeErrors(context.errors, serverMode);
896
+ }
897
+ let singleFetchResult;
898
+ if (context.errors) {
899
+ singleFetchResult = { error: Object.values(context.errors)[0] };
900
+ } else {
901
+ singleFetchResult = {
902
+ data: Object.values(context.actionData || {})[0]
903
+ };
904
+ }
905
+ return generateSingleFetchResponse(request, build, serverMode, {
906
+ result: singleFetchResult,
907
+ headers,
908
+ status: context.statusCode
909
+ });
910
+ }
911
+ }
912
+ async function singleFetchLoaders(build, serverMode, staticHandler, request, handlerUrl, loadContext, handleError) {
913
+ let routesParam = new URL(request.url).searchParams.get("_routes");
914
+ let loadRouteIds = routesParam ? new Set(routesParam.split(",")) : null;
915
+ try {
916
+ let handlerRequest = new Request(handlerUrl, {
917
+ headers: request.headers,
918
+ signal: request.signal
919
+ });
920
+ let result = await staticHandler.query(handlerRequest, {
921
+ requestContext: loadContext,
922
+ filterMatchesToLoad: (m) => !loadRouteIds || loadRouteIds.has(m.route.id),
923
+ skipLoaderErrorBubbling: true,
924
+ generateMiddlewareResponse: build.future.v8_middleware ? async (query) => {
925
+ try {
926
+ let innerResult = await query(handlerRequest);
927
+ return handleQueryResult(innerResult);
928
+ } catch (error) {
929
+ return handleQueryError(error);
930
+ }
931
+ } : void 0
932
+ });
933
+ return handleQueryResult(result);
934
+ } catch (error) {
935
+ return handleQueryError(error);
936
+ }
937
+ function handleQueryResult(result) {
938
+ return isResponse(result) ? result : staticContextToResponse(result);
939
+ }
940
+ function handleQueryError(error) {
941
+ handleError(error);
942
+ return generateSingleFetchResponse(request, build, serverMode, {
943
+ result: { error },
944
+ headers: new Headers(),
945
+ status: 500
946
+ });
947
+ }
948
+ function staticContextToResponse(context) {
949
+ let headers = getDocumentHeaders(context, build);
950
+ if (isRedirectStatusCode(context.statusCode) && headers.has("Location")) {
951
+ return new Response(null, { status: context.statusCode, headers });
952
+ }
953
+ if (context.errors) {
954
+ Object.values(context.errors).forEach((err) => {
955
+ if (!isRouteErrorResponse(err) || err.error) {
956
+ handleError(err);
957
+ }
958
+ });
959
+ context.errors = sanitizeErrors(context.errors, serverMode);
960
+ }
961
+ let results = {};
962
+ let loadedMatches = new Set(
963
+ context.matches.filter(
964
+ (m) => loadRouteIds ? loadRouteIds.has(m.route.id) : m.route.loader != null
965
+ ).map((m) => m.route.id)
966
+ );
967
+ if (context.errors) {
968
+ for (let [id, error] of Object.entries(context.errors)) {
969
+ results[id] = { error };
970
+ }
971
+ }
972
+ for (let [id, data2] of Object.entries(context.loaderData)) {
973
+ if (!(id in results) && loadedMatches.has(id)) {
974
+ results[id] = { data: data2 };
975
+ }
976
+ }
977
+ return generateSingleFetchResponse(request, build, serverMode, {
978
+ result: results,
979
+ headers,
980
+ status: context.statusCode
981
+ });
982
+ }
983
+ }
984
+ function generateSingleFetchResponse(request, build, serverMode, {
985
+ result,
986
+ headers,
987
+ status
988
+ }) {
989
+ let resultHeaders = new Headers(headers);
990
+ resultHeaders.set("X-Remix-Response", "yes");
991
+ if (SERVER_NO_BODY_STATUS_CODES.has(status)) {
992
+ return new Response(null, { status, headers: resultHeaders });
993
+ }
994
+ resultHeaders.set("Content-Type", "text/x-script");
995
+ resultHeaders.delete("Content-Length");
996
+ return new Response(
997
+ encodeViaTurboStream(
998
+ result,
999
+ request.signal,
1000
+ build.entry.module.streamTimeout,
1001
+ serverMode
1002
+ ),
1003
+ {
1004
+ status: status || 200,
1005
+ headers: resultHeaders
1006
+ }
1007
+ );
1008
+ }
1009
+ function generateSingleFetchRedirectResponse(redirectResponse, request, build, serverMode) {
1010
+ let redirect2 = getSingleFetchRedirect(
1011
+ redirectResponse.status,
1012
+ redirectResponse.headers,
1013
+ build.basename
1014
+ );
1015
+ let headers = new Headers(redirectResponse.headers);
1016
+ headers.delete("Location");
1017
+ headers.set("Content-Type", "text/x-script");
1018
+ return generateSingleFetchResponse(request, build, serverMode, {
1019
+ result: request.method === "GET" ? { [SingleFetchRedirectSymbol]: redirect2 } : redirect2,
1020
+ headers,
1021
+ status: SINGLE_FETCH_REDIRECT_STATUS
1022
+ });
1023
+ }
1024
+ function getSingleFetchRedirect(status, headers, basename) {
1025
+ let redirect2 = headers.get("Location");
1026
+ if (basename) {
1027
+ redirect2 = stripBasename(redirect2, basename) || redirect2;
1028
+ }
1029
+ return {
1030
+ redirect: redirect2,
1031
+ status,
1032
+ revalidate: (
1033
+ // Technically X-Remix-Revalidate isn't needed here - that was an implementation
1034
+ // detail of ?_data requests as our way to tell the front end to revalidate when
1035
+ // we didn't have a response body to include that information in.
1036
+ // With single fetch, we tell the front end via this revalidate boolean field.
1037
+ // However, we're respecting it for now because it may be something folks have
1038
+ // used in their own responses
1039
+ // TODO(v3): Consider removing or making this official public API
1040
+ headers.has("X-Remix-Revalidate") || headers.has("Set-Cookie")
1041
+ ),
1042
+ reload: headers.has("X-Remix-Reload-Document"),
1043
+ replace: headers.has("X-Remix-Replace")
1044
+ };
1045
+ }
1046
+ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
1047
+ let controller = new AbortController();
1048
+ let timeoutId = setTimeout(
1049
+ () => controller.abort(new Error("Server Timeout")),
1050
+ typeof streamTimeout === "number" ? streamTimeout : 4950
1051
+ );
1052
+ requestSignal.addEventListener("abort", () => clearTimeout(timeoutId));
1053
+ return encode(data2, {
1054
+ signal: controller.signal,
1055
+ plugins: [
1056
+ (value) => {
1057
+ if (value instanceof Error) {
1058
+ let { name, message, stack } = serverMode === "production" /* Production */ ? sanitizeError(value, serverMode) : value;
1059
+ return ["SanitizedError", name, message, stack];
1060
+ }
1061
+ if (value instanceof ErrorResponseImpl) {
1062
+ let { data: data3, status, statusText } = value;
1063
+ return ["ErrorResponse", data3, status, statusText];
1064
+ }
1065
+ if (value && typeof value === "object" && SingleFetchRedirectSymbol in value) {
1066
+ return ["SingleFetchRedirect", value[SingleFetchRedirectSymbol]];
1067
+ }
1068
+ }
1069
+ ],
1070
+ postPlugins: [
1071
+ (value) => {
1072
+ if (!value) return;
1073
+ if (typeof value !== "object") return;
1074
+ return [
1075
+ "SingleFetchClassInstance",
1076
+ Object.fromEntries(Object.entries(value))
1077
+ ];
1078
+ },
1079
+ () => ["SingleFetchFallback"]
1080
+ ]
1081
+ });
1082
+ }
1083
+
1084
+ // lib/server-runtime/server.ts
1085
+ function derive(build, mode) {
1086
+ let routes = createRoutes(build.routes);
1087
+ let dataRoutes = createStaticHandlerDataRoutes(build.routes, build.future);
1088
+ let serverMode = isServerMode(mode) ? mode : "production" /* Production */;
1089
+ let staticHandler = createStaticHandler(dataRoutes, {
1090
+ basename: build.basename,
1091
+ unstable_instrumentations: build.entry.module.unstable_instrumentations
1092
+ });
1093
+ let errorHandler = build.entry.module.handleError || ((error, { request }) => {
1094
+ if (serverMode !== "test" /* Test */ && !request.signal.aborted) {
1095
+ console.error(
1096
+ // @ts-expect-error This is "private" from users but intended for internal use
1097
+ isRouteErrorResponse(error) && error.error ? error.error : error
1098
+ );
1099
+ }
1100
+ });
1101
+ let requestHandler = async (request, initialContext) => {
1102
+ let params = {};
1103
+ let loadContext;
1104
+ let handleError = (error) => {
1105
+ if (mode === "development" /* Development */) {
1106
+ getDevServerHooks()?.processRequestError?.(error);
1107
+ }
1108
+ errorHandler(error, {
1109
+ context: loadContext,
1110
+ params,
1111
+ request
1112
+ });
1113
+ };
1114
+ if (build.future.v8_middleware) {
1115
+ if (initialContext && !(initialContext instanceof RouterContextProvider)) {
1116
+ let error = new Error(
1117
+ "Invalid `context` value provided to `handleRequest`. When middleware is enabled you must return an instance of `RouterContextProvider` from your `getLoadContext` function."
1118
+ );
1119
+ handleError(error);
1120
+ return returnLastResortErrorResponse(error, serverMode);
1121
+ }
1122
+ loadContext = initialContext || new RouterContextProvider();
1123
+ } else {
1124
+ loadContext = initialContext || {};
1125
+ }
1126
+ let url = new URL(request.url);
1127
+ let normalizedBasename = build.basename || "/";
1128
+ let normalizedPath = url.pathname;
1129
+ if (build.future.unstable_trailingSlashAwareDataRequests) {
1130
+ if (normalizedPath.endsWith("/_.data")) {
1131
+ normalizedPath = normalizedPath.replace(/_.data$/, "");
1132
+ } else {
1133
+ normalizedPath = normalizedPath.replace(/\.data$/, "");
1134
+ }
1135
+ } else {
1136
+ if (stripBasename(normalizedPath, normalizedBasename) === "/_root.data") {
1137
+ normalizedPath = normalizedBasename;
1138
+ } else if (normalizedPath.endsWith(".data")) {
1139
+ normalizedPath = normalizedPath.replace(/\.data$/, "");
1140
+ }
1141
+ if (stripBasename(normalizedPath, normalizedBasename) !== "/" && normalizedPath.endsWith("/")) {
1142
+ normalizedPath = normalizedPath.slice(0, -1);
1143
+ }
1144
+ }
1145
+ let isSpaMode = getBuildTimeHeader(request, "X-React-Router-SPA-Mode") === "yes";
1146
+ if (!build.ssr) {
1147
+ let decodedPath = decodeURI(normalizedPath);
1148
+ if (normalizedBasename !== "/") {
1149
+ let strippedPath = stripBasename(decodedPath, normalizedBasename);
1150
+ if (strippedPath == null) {
1151
+ errorHandler(
1152
+ new ErrorResponseImpl(
1153
+ 404,
1154
+ "Not Found",
1155
+ `Refusing to prerender the \`${decodedPath}\` path because it does not start with the basename \`${normalizedBasename}\``
1156
+ ),
1157
+ {
1158
+ context: loadContext,
1159
+ params,
1160
+ request
1161
+ }
1162
+ );
1163
+ return new Response("Not Found", {
1164
+ status: 404,
1165
+ statusText: "Not Found"
1166
+ });
1167
+ }
1168
+ decodedPath = strippedPath;
1169
+ }
1170
+ if (build.prerender.length === 0) {
1171
+ isSpaMode = true;
1172
+ } else if (!build.prerender.includes(decodedPath) && !build.prerender.includes(decodedPath + "/")) {
1173
+ if (url.pathname.endsWith(".data")) {
1174
+ errorHandler(
1175
+ new ErrorResponseImpl(
1176
+ 404,
1177
+ "Not Found",
1178
+ `Refusing to SSR the path \`${decodedPath}\` because \`ssr:false\` is set and the path is not included in the \`prerender\` config, so in production the path will be a 404.`
1179
+ ),
1180
+ {
1181
+ context: loadContext,
1182
+ params,
1183
+ request
1184
+ }
1185
+ );
1186
+ return new Response("Not Found", {
1187
+ status: 404,
1188
+ statusText: "Not Found"
1189
+ });
1190
+ } else {
1191
+ isSpaMode = true;
1192
+ }
1193
+ }
1194
+ }
1195
+ let manifestUrl = getManifestPath(
1196
+ build.routeDiscovery.manifestPath,
1197
+ normalizedBasename
1198
+ );
1199
+ if (url.pathname === manifestUrl) {
1200
+ try {
1201
+ let res = await handleManifestRequest(build, routes, url);
1202
+ return res;
1203
+ } catch (e) {
1204
+ handleError(e);
1205
+ return new Response("Unknown Server Error", { status: 500 });
1206
+ }
1207
+ }
1208
+ let matches = matchServerRoutes(routes, normalizedPath, build.basename);
1209
+ if (matches && matches.length > 0) {
1210
+ Object.assign(params, matches[0].params);
1211
+ }
1212
+ let response;
1213
+ if (url.pathname.endsWith(".data")) {
1214
+ let handlerUrl = new URL(request.url);
1215
+ handlerUrl.pathname = normalizedPath;
1216
+ let singleFetchMatches = matchServerRoutes(
1217
+ routes,
1218
+ handlerUrl.pathname,
1219
+ build.basename
1220
+ );
1221
+ response = await handleSingleFetchRequest(
1222
+ serverMode,
1223
+ build,
1224
+ staticHandler,
1225
+ request,
1226
+ handlerUrl,
1227
+ loadContext,
1228
+ handleError
1229
+ );
1230
+ if (isRedirectResponse(response)) {
1231
+ response = generateSingleFetchRedirectResponse(
1232
+ response,
1233
+ request,
1234
+ build,
1235
+ serverMode
1236
+ );
1237
+ }
1238
+ if (build.entry.module.handleDataRequest) {
1239
+ response = await build.entry.module.handleDataRequest(response, {
1240
+ context: loadContext,
1241
+ params: singleFetchMatches ? singleFetchMatches[0].params : {},
1242
+ request
1243
+ });
1244
+ if (isRedirectResponse(response)) {
1245
+ response = generateSingleFetchRedirectResponse(
1246
+ response,
1247
+ request,
1248
+ build,
1249
+ serverMode
1250
+ );
1251
+ }
1252
+ }
1253
+ } else if (!isSpaMode && matches && matches[matches.length - 1].route.module.default == null && matches[matches.length - 1].route.module.ErrorBoundary == null) {
1254
+ response = await handleResourceRequest(
1255
+ serverMode,
1256
+ build,
1257
+ staticHandler,
1258
+ matches.slice(-1)[0].route.id,
1259
+ request,
1260
+ loadContext,
1261
+ handleError
1262
+ );
1263
+ } else {
1264
+ let { pathname } = url;
1265
+ let criticalCss = void 0;
1266
+ if (build.unstable_getCriticalCss) {
1267
+ criticalCss = await build.unstable_getCriticalCss({ pathname });
1268
+ } else if (mode === "development" /* Development */ && getDevServerHooks()?.getCriticalCss) {
1269
+ criticalCss = await getDevServerHooks()?.getCriticalCss?.(pathname);
1270
+ }
1271
+ response = await handleDocumentRequest(
1272
+ serverMode,
1273
+ build,
1274
+ staticHandler,
1275
+ request,
1276
+ loadContext,
1277
+ handleError,
1278
+ isSpaMode,
1279
+ criticalCss
1280
+ );
1281
+ }
1282
+ if (request.method === "HEAD") {
1283
+ return new Response(null, {
1284
+ headers: response.headers,
1285
+ status: response.status,
1286
+ statusText: response.statusText
1287
+ });
1288
+ }
1289
+ return response;
1290
+ };
1291
+ if (build.entry.module.unstable_instrumentations) {
1292
+ requestHandler = instrumentHandler(
1293
+ requestHandler,
1294
+ build.entry.module.unstable_instrumentations.map((i) => i.handler).filter(Boolean)
1295
+ );
1296
+ }
1297
+ return {
1298
+ routes,
1299
+ dataRoutes,
1300
+ serverMode,
1301
+ staticHandler,
1302
+ errorHandler,
1303
+ requestHandler
1304
+ };
1305
+ }
1306
+ var createRequestHandler = (build, mode) => {
1307
+ let _build;
1308
+ let routes;
1309
+ let serverMode;
1310
+ let staticHandler;
1311
+ let errorHandler;
1312
+ let _requestHandler;
1313
+ return async function requestHandler(request, initialContext) {
1314
+ _build = typeof build === "function" ? await build() : build;
1315
+ if (typeof build === "function") {
1316
+ let derived = derive(_build, mode);
1317
+ routes = derived.routes;
1318
+ serverMode = derived.serverMode;
1319
+ staticHandler = derived.staticHandler;
1320
+ errorHandler = derived.errorHandler;
1321
+ _requestHandler = derived.requestHandler;
1322
+ } else if (!routes || !serverMode || !staticHandler || !errorHandler || !_requestHandler) {
1323
+ let derived = derive(_build, mode);
1324
+ routes = derived.routes;
1325
+ serverMode = derived.serverMode;
1326
+ staticHandler = derived.staticHandler;
1327
+ errorHandler = derived.errorHandler;
1328
+ _requestHandler = derived.requestHandler;
1329
+ }
1330
+ return _requestHandler(request, initialContext);
1331
+ };
1332
+ };
1333
+ async function handleManifestRequest(build, routes, url) {
1334
+ if (build.assets.version !== url.searchParams.get("version")) {
1335
+ return new Response(null, {
1336
+ status: 204,
1337
+ headers: {
1338
+ "X-Remix-Reload-Document": "true"
1339
+ }
1340
+ });
1341
+ }
1342
+ let patches = {};
1343
+ if (url.searchParams.has("paths")) {
1344
+ let paths = /* @__PURE__ */ new Set();
1345
+ let pathParam = url.searchParams.get("paths") || "";
1346
+ let requestedPaths = pathParam.split(",").filter(Boolean);
1347
+ requestedPaths.forEach((path) => {
1348
+ if (!path.startsWith("/")) {
1349
+ path = `/${path}`;
1350
+ }
1351
+ let segments = path.split("/").slice(1);
1352
+ segments.forEach((_, i) => {
1353
+ let partialPath = segments.slice(0, i + 1).join("/");
1354
+ paths.add(`/${partialPath}`);
1355
+ });
1356
+ });
1357
+ for (let path of paths) {
1358
+ let matches = matchServerRoutes(routes, path, build.basename);
1359
+ if (matches) {
1360
+ for (let match of matches) {
1361
+ let routeId = match.route.id;
1362
+ let route = build.assets.routes[routeId];
1363
+ if (route) {
1364
+ patches[routeId] = route;
1365
+ }
1366
+ }
1367
+ }
1368
+ }
1369
+ return Response.json(patches, {
1370
+ headers: {
1371
+ "Cache-Control": "public, max-age=31536000, immutable"
1372
+ }
1373
+ });
1374
+ }
1375
+ return new Response("Invalid Request", { status: 400 });
1376
+ }
1377
+ async function handleSingleFetchRequest(serverMode, build, staticHandler, request, handlerUrl, loadContext, handleError) {
1378
+ let response = request.method !== "GET" ? await singleFetchAction(
1379
+ build,
1380
+ serverMode,
1381
+ staticHandler,
1382
+ request,
1383
+ handlerUrl,
1384
+ loadContext,
1385
+ handleError
1386
+ ) : await singleFetchLoaders(
1387
+ build,
1388
+ serverMode,
1389
+ staticHandler,
1390
+ request,
1391
+ handlerUrl,
1392
+ loadContext,
1393
+ handleError
1394
+ );
1395
+ return response;
1396
+ }
1397
+ async function handleDocumentRequest(serverMode, build, staticHandler, request, loadContext, handleError, isSpaMode, criticalCss) {
1398
+ try {
1399
+ if (request.method === "POST") {
1400
+ try {
1401
+ throwIfPotentialCSRFAttack(
1402
+ request.headers,
1403
+ Array.isArray(build.allowedActionOrigins) ? build.allowedActionOrigins : []
1404
+ );
1405
+ } catch (e) {
1406
+ handleError(e);
1407
+ return new Response("Bad Request", { status: 400 });
1408
+ }
1409
+ }
1410
+ let result = await staticHandler.query(request, {
1411
+ requestContext: loadContext,
1412
+ generateMiddlewareResponse: build.future.v8_middleware ? async (query) => {
1413
+ try {
1414
+ let innerResult = await query(request);
1415
+ if (!isResponse(innerResult)) {
1416
+ innerResult = await renderHtml(innerResult, isSpaMode);
1417
+ }
1418
+ return innerResult;
1419
+ } catch (error) {
1420
+ handleError(error);
1421
+ return new Response(null, { status: 500 });
1422
+ }
1423
+ } : void 0
1424
+ });
1425
+ if (!isResponse(result)) {
1426
+ result = await renderHtml(result, isSpaMode);
1427
+ }
1428
+ return result;
1429
+ } catch (error) {
1430
+ handleError(error);
1431
+ return new Response(null, { status: 500 });
1432
+ }
1433
+ async function renderHtml(context, isSpaMode2) {
1434
+ let headers = getDocumentHeaders(context, build);
1435
+ if (SERVER_NO_BODY_STATUS_CODES.has(context.statusCode)) {
1436
+ return new Response(null, { status: context.statusCode, headers });
1437
+ }
1438
+ if (context.errors) {
1439
+ Object.values(context.errors).forEach((err) => {
1440
+ if (!isRouteErrorResponse(err) || err.error) {
1441
+ handleError(err);
1442
+ }
1443
+ });
1444
+ context.errors = sanitizeErrors(context.errors, serverMode);
1445
+ }
1446
+ let state = {
1447
+ loaderData: context.loaderData,
1448
+ actionData: context.actionData,
1449
+ errors: serializeErrors(context.errors, serverMode)
1450
+ };
1451
+ let baseServerHandoff = {
1452
+ basename: build.basename,
1453
+ future: build.future,
1454
+ routeDiscovery: build.routeDiscovery,
1455
+ ssr: build.ssr,
1456
+ isSpaMode: isSpaMode2
1457
+ };
1458
+ let entryContext = {
1459
+ manifest: build.assets,
1460
+ routeModules: createEntryRouteModules(build.routes),
1461
+ staticHandlerContext: context,
1462
+ criticalCss,
1463
+ serverHandoffString: createServerHandoffString({
1464
+ ...baseServerHandoff,
1465
+ criticalCss
1466
+ }),
1467
+ serverHandoffStream: encodeViaTurboStream(
1468
+ state,
1469
+ request.signal,
1470
+ build.entry.module.streamTimeout,
1471
+ serverMode
1472
+ ),
1473
+ renderMeta: {},
1474
+ future: build.future,
1475
+ ssr: build.ssr,
1476
+ routeDiscovery: build.routeDiscovery,
1477
+ isSpaMode: isSpaMode2,
1478
+ serializeError: (err) => serializeError(err, serverMode)
1479
+ };
1480
+ let handleDocumentRequestFunction = build.entry.module.default;
1481
+ try {
1482
+ return await handleDocumentRequestFunction(
1483
+ request,
1484
+ context.statusCode,
1485
+ headers,
1486
+ entryContext,
1487
+ loadContext
1488
+ );
1489
+ } catch (error) {
1490
+ handleError(error);
1491
+ let errorForSecondRender = error;
1492
+ if (isResponse(error)) {
1493
+ try {
1494
+ let data2 = await unwrapResponse(error);
1495
+ errorForSecondRender = new ErrorResponseImpl(
1496
+ error.status,
1497
+ error.statusText,
1498
+ data2
1499
+ );
1500
+ } catch (e) {
1501
+ }
1502
+ }
1503
+ context = getStaticContextFromError(
1504
+ staticHandler.dataRoutes,
1505
+ context,
1506
+ errorForSecondRender
1507
+ );
1508
+ if (context.errors) {
1509
+ context.errors = sanitizeErrors(context.errors, serverMode);
1510
+ }
1511
+ let state2 = {
1512
+ loaderData: context.loaderData,
1513
+ actionData: context.actionData,
1514
+ errors: serializeErrors(context.errors, serverMode)
1515
+ };
1516
+ entryContext = {
1517
+ ...entryContext,
1518
+ staticHandlerContext: context,
1519
+ serverHandoffString: createServerHandoffString(baseServerHandoff),
1520
+ serverHandoffStream: encodeViaTurboStream(
1521
+ state2,
1522
+ request.signal,
1523
+ build.entry.module.streamTimeout,
1524
+ serverMode
1525
+ ),
1526
+ renderMeta: {}
1527
+ };
1528
+ try {
1529
+ return await handleDocumentRequestFunction(
1530
+ request,
1531
+ context.statusCode,
1532
+ headers,
1533
+ entryContext,
1534
+ loadContext
1535
+ );
1536
+ } catch (error2) {
1537
+ handleError(error2);
1538
+ return returnLastResortErrorResponse(error2, serverMode);
1539
+ }
1540
+ }
1541
+ }
1542
+ }
1543
+ async function handleResourceRequest(serverMode, build, staticHandler, routeId, request, loadContext, handleError) {
1544
+ try {
1545
+ let result = await staticHandler.queryRoute(request, {
1546
+ routeId,
1547
+ requestContext: loadContext,
1548
+ generateMiddlewareResponse: build.future.v8_middleware ? async (queryRoute) => {
1549
+ try {
1550
+ let innerResult = await queryRoute(request);
1551
+ return handleQueryRouteResult(innerResult);
1552
+ } catch (error) {
1553
+ return handleQueryRouteError(error);
1554
+ }
1555
+ } : void 0
1556
+ });
1557
+ return handleQueryRouteResult(result);
1558
+ } catch (error) {
1559
+ return handleQueryRouteError(error);
1560
+ }
1561
+ function handleQueryRouteResult(result) {
1562
+ if (isResponse(result)) {
1563
+ return result;
1564
+ }
1565
+ if (typeof result === "string") {
1566
+ return new Response(result);
1567
+ }
1568
+ return Response.json(result);
1569
+ }
1570
+ function handleQueryRouteError(error) {
1571
+ if (isResponse(error)) {
1572
+ return error;
1573
+ }
1574
+ if (isRouteErrorResponse(error)) {
1575
+ handleError(error);
1576
+ return errorResponseToJson(error, serverMode);
1577
+ }
1578
+ if (error instanceof Error && error.message === "Expected a response from queryRoute") {
1579
+ let newError = new Error(
1580
+ "Expected a Response to be returned from resource route handler"
1581
+ );
1582
+ handleError(newError);
1583
+ return returnLastResortErrorResponse(newError, serverMode);
1584
+ }
1585
+ handleError(error);
1586
+ return returnLastResortErrorResponse(error, serverMode);
1587
+ }
1588
+ }
1589
+ function errorResponseToJson(errorResponse, serverMode) {
1590
+ return Response.json(
1591
+ serializeError(
1592
+ // @ts-expect-error This is "private" from users but intended for internal use
1593
+ errorResponse.error || new Error("Unexpected Server Error"),
1594
+ serverMode
1595
+ ),
1596
+ {
1597
+ status: errorResponse.status,
1598
+ statusText: errorResponse.statusText
1599
+ }
1600
+ );
1601
+ }
1602
+ function returnLastResortErrorResponse(error, serverMode) {
1603
+ let message = "Unexpected Server Error";
1604
+ if (serverMode !== "production" /* Production */) {
1605
+ message += `
1606
+
1607
+ ${String(error)}`;
1608
+ }
1609
+ return new Response(message, {
1610
+ status: 500,
1611
+ headers: {
1612
+ "Content-Type": "text/plain"
1613
+ }
1614
+ });
1615
+ }
1616
+ function unwrapResponse(response) {
1617
+ let contentType = response.headers.get("Content-Type");
1618
+ return contentType && /\bapplication\/json\b/.test(contentType) ? response.body == null ? null : response.json() : response.text();
1619
+ }
1620
+
1621
+ // lib/server-runtime/sessions.ts
1622
+ function flash(name) {
1623
+ return `__flash_${name}__`;
1624
+ }
1625
+ var createSession = (initialData = {}, id = "") => {
1626
+ let map = new Map(Object.entries(initialData));
1627
+ return {
1628
+ get id() {
1629
+ return id;
1630
+ },
1631
+ get data() {
1632
+ return Object.fromEntries(map);
1633
+ },
1634
+ has(name) {
1635
+ return map.has(name) || map.has(flash(name));
1636
+ },
1637
+ get(name) {
1638
+ if (map.has(name)) return map.get(name);
1639
+ let flashName = flash(name);
1640
+ if (map.has(flashName)) {
1641
+ let value = map.get(flashName);
1642
+ map.delete(flashName);
1643
+ return value;
1644
+ }
1645
+ return void 0;
1646
+ },
1647
+ set(name, value) {
1648
+ map.set(name, value);
1649
+ },
1650
+ flash(name, value) {
1651
+ map.set(flash(name), value);
1652
+ },
1653
+ unset(name) {
1654
+ map.delete(name);
1655
+ }
1656
+ };
1657
+ };
1658
+ var isSession = (object) => {
1659
+ return object != null && typeof object.id === "string" && typeof object.data !== "undefined" && typeof object.has === "function" && typeof object.get === "function" && typeof object.set === "function" && typeof object.flash === "function" && typeof object.unset === "function";
1660
+ };
1661
+ function createSessionStorage({
1662
+ cookie: cookieArg,
1663
+ createData,
1664
+ readData,
1665
+ updateData,
1666
+ deleteData
1667
+ }) {
1668
+ let cookie = isCookie(cookieArg) ? cookieArg : createCookie(cookieArg?.name || "__session", cookieArg);
1669
+ warnOnceAboutSigningSessionCookie(cookie);
1670
+ return {
1671
+ async getSession(cookieHeader, options) {
1672
+ let id = cookieHeader && await cookie.parse(cookieHeader, options);
1673
+ let data2 = id && await readData(id);
1674
+ return createSession(data2 || {}, id || "");
1675
+ },
1676
+ async commitSession(session, options) {
1677
+ let { id, data: data2 } = session;
1678
+ let expires = options?.maxAge != null ? new Date(Date.now() + options.maxAge * 1e3) : options?.expires != null ? options.expires : cookie.expires;
1679
+ if (id) {
1680
+ await updateData(id, data2, expires);
1681
+ } else {
1682
+ id = await createData(data2, expires);
1683
+ }
1684
+ return cookie.serialize(id, options);
1685
+ },
1686
+ async destroySession(session, options) {
1687
+ await deleteData(session.id);
1688
+ return cookie.serialize("", {
1689
+ ...options,
1690
+ maxAge: void 0,
1691
+ expires: /* @__PURE__ */ new Date(0)
1692
+ });
1693
+ }
1694
+ };
1695
+ }
1696
+ function warnOnceAboutSigningSessionCookie(cookie) {
1697
+ warnOnce(
1698
+ cookie.isSigned,
1699
+ `The "${cookie.name}" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://reactrouter.com/explanation/sessions-and-cookies#signing-cookies for more information.`
1700
+ );
1701
+ }
1702
+
1703
+ // lib/server-runtime/sessions/cookieStorage.ts
1704
+ function createCookieSessionStorage({ cookie: cookieArg } = {}) {
1705
+ let cookie = isCookie(cookieArg) ? cookieArg : createCookie(cookieArg?.name || "__session", cookieArg);
1706
+ warnOnceAboutSigningSessionCookie(cookie);
1707
+ return {
1708
+ async getSession(cookieHeader, options) {
1709
+ return createSession(
1710
+ cookieHeader && await cookie.parse(cookieHeader, options) || {}
1711
+ );
1712
+ },
1713
+ async commitSession(session, options) {
1714
+ let serializedCookie = await cookie.serialize(session.data, options);
1715
+ if (serializedCookie.length > 4096) {
1716
+ throw new Error(
1717
+ "Cookie length will exceed browser maximum. Length: " + serializedCookie.length
1718
+ );
1719
+ }
1720
+ return serializedCookie;
1721
+ },
1722
+ async destroySession(_session, options) {
1723
+ return cookie.serialize("", {
1724
+ ...options,
1725
+ maxAge: void 0,
1726
+ expires: /* @__PURE__ */ new Date(0)
1727
+ });
1728
+ }
1729
+ };
1730
+ }
1731
+
1732
+ // lib/server-runtime/sessions/memoryStorage.ts
1733
+ function createMemorySessionStorage({ cookie } = {}) {
1734
+ let map = /* @__PURE__ */ new Map();
1735
+ return createSessionStorage({
1736
+ cookie,
1737
+ async createData(data2, expires) {
1738
+ let id = Math.random().toString(36).substring(2, 10);
1739
+ map.set(id, { data: data2, expires });
1740
+ return id;
1741
+ },
1742
+ async readData(id) {
1743
+ if (map.has(id)) {
1744
+ let { data: data2, expires } = map.get(id);
1745
+ if (!expires || expires > /* @__PURE__ */ new Date()) {
1746
+ return data2;
1747
+ }
1748
+ if (expires) map.delete(id);
1749
+ }
1750
+ return null;
1751
+ },
1752
+ async updateData(id, data2, expires) {
1753
+ map.set(id, { data: data2, expires });
1754
+ },
1755
+ async deleteData(id) {
1756
+ map.delete(id);
1757
+ }
1758
+ });
1759
+ }
1760
+
1761
+ // lib/href.ts
1762
+ function href(path, ...args) {
1763
+ let params = args[0];
1764
+ let result = trimTrailingSplat(path).replace(
1765
+ /\/:([\w-]+)(\?)?/g,
1766
+ // same regex as in .\router\utils.ts: compilePath().
1767
+ (_, param, questionMark) => {
1768
+ const isRequired = questionMark === void 0;
1769
+ const value = params?.[param];
1770
+ if (isRequired && value === void 0) {
1771
+ throw new Error(
1772
+ `Path '${path}' requires param '${param}' but it was not provided`
1773
+ );
1774
+ }
1775
+ return value === void 0 ? "" : "/" + value;
1776
+ }
1777
+ );
1778
+ if (path.endsWith("*")) {
1779
+ const value = params?.["*"];
1780
+ if (value !== void 0) {
1781
+ result += "/" + value;
1782
+ }
1783
+ }
1784
+ return result || "/";
1785
+ }
1786
+ function trimTrailingSplat(path) {
1787
+ let i = path.length - 1;
1788
+ let char = path[i];
1789
+ if (char !== "*" && char !== "/") return path;
1790
+ i--;
1791
+ for (; i >= 0; i--) {
1792
+ if (path[i] !== "/") break;
1793
+ }
1794
+ return path.slice(0, i + 1);
1795
+ }
1796
+
1797
+ // lib/rsc/server.ssr.tsx
1798
+ import * as React4 from "react";
1799
+
1800
+ // lib/rsc/html-stream/server.ts
1801
+ var encoder2 = new TextEncoder();
1802
+ var trailer = "</body></html>";
1803
+ function injectRSCPayload(rscStream) {
1804
+ let decoder = new TextDecoder();
1805
+ let resolveFlightDataPromise;
1806
+ let flightDataPromise = new Promise(
1807
+ (resolve) => resolveFlightDataPromise = resolve
1808
+ );
1809
+ let startedRSC = false;
1810
+ let buffered = [];
1811
+ let timeout = null;
1812
+ function flushBufferedChunks(controller) {
1813
+ for (let chunk of buffered) {
1814
+ let buf = decoder.decode(chunk, { stream: true });
1815
+ if (buf.endsWith(trailer)) {
1816
+ buf = buf.slice(0, -trailer.length);
1817
+ }
1818
+ controller.enqueue(encoder2.encode(buf));
1819
+ }
1820
+ buffered.length = 0;
1821
+ timeout = null;
1822
+ }
1823
+ return new TransformStream({
1824
+ transform(chunk, controller) {
1825
+ buffered.push(chunk);
1826
+ if (timeout) {
1827
+ return;
1828
+ }
1829
+ timeout = setTimeout(async () => {
1830
+ flushBufferedChunks(controller);
1831
+ if (!startedRSC) {
1832
+ startedRSC = true;
1833
+ writeRSCStream(rscStream, controller).catch((err) => controller.error(err)).then(resolveFlightDataPromise);
1834
+ }
1835
+ }, 0);
1836
+ },
1837
+ async flush(controller) {
1838
+ await flightDataPromise;
1839
+ if (timeout) {
1840
+ clearTimeout(timeout);
1841
+ flushBufferedChunks(controller);
1842
+ }
1843
+ controller.enqueue(encoder2.encode("</body></html>"));
1844
+ }
1845
+ });
1846
+ }
1847
+ async function writeRSCStream(rscStream, controller) {
1848
+ let decoder = new TextDecoder("utf-8", { fatal: true });
1849
+ const reader = rscStream.getReader();
1850
+ try {
1851
+ let read;
1852
+ while ((read = await reader.read()) && !read.done) {
1853
+ const chunk = read.value;
1854
+ try {
1855
+ writeChunk(
1856
+ JSON.stringify(decoder.decode(chunk, { stream: true })),
1857
+ controller
1858
+ );
1859
+ } catch (err) {
1860
+ let base64 = JSON.stringify(btoa(String.fromCodePoint(...chunk)));
1861
+ writeChunk(
1862
+ `Uint8Array.from(atob(${base64}), m => m.codePointAt(0))`,
1863
+ controller
1864
+ );
1865
+ }
1866
+ }
1867
+ } finally {
1868
+ reader.releaseLock();
1869
+ }
1870
+ let remaining = decoder.decode();
1871
+ if (remaining.length) {
1872
+ writeChunk(JSON.stringify(remaining), controller);
1873
+ }
1874
+ }
1875
+ function writeChunk(chunk, controller) {
1876
+ controller.enqueue(
1877
+ encoder2.encode(
1878
+ `<script>${escapeScript(
1879
+ `(self.__FLIGHT_DATA||=[]).push(${chunk})`
1880
+ )}</script>`
1881
+ )
1882
+ );
1883
+ }
1884
+ function escapeScript(script) {
1885
+ return script.replace(/<!--/g, "<\\!--").replace(/<\/(script)/gi, "</\\$1");
1886
+ }
1887
+
1888
+ // lib/rsc/errorBoundaries.tsx
1889
+ import React3 from "react";
1890
+ var RSCRouterGlobalErrorBoundary = class extends React3.Component {
1891
+ constructor(props) {
1892
+ super(props);
1893
+ this.state = { error: null, location: props.location };
1894
+ }
1895
+ static getDerivedStateFromError(error) {
1896
+ return { error };
1897
+ }
1898
+ static getDerivedStateFromProps(props, state) {
1899
+ if (state.location !== props.location) {
1900
+ return { error: null, location: props.location };
1901
+ }
1902
+ return { error: state.error, location: state.location };
1903
+ }
1904
+ render() {
1905
+ if (this.state.error) {
1906
+ return /* @__PURE__ */ React3.createElement(
1907
+ RSCDefaultRootErrorBoundaryImpl,
1908
+ {
1909
+ error: this.state.error,
1910
+ renderAppShell: true
1911
+ }
1912
+ );
1913
+ } else {
1914
+ return this.props.children;
1915
+ }
1916
+ }
1917
+ };
1918
+ function ErrorWrapper({
1919
+ renderAppShell,
1920
+ title,
1921
+ children
1922
+ }) {
1923
+ if (!renderAppShell) {
1924
+ return children;
1925
+ }
1926
+ return /* @__PURE__ */ React3.createElement("html", { lang: "en" }, /* @__PURE__ */ React3.createElement("head", null, /* @__PURE__ */ React3.createElement("meta", { charSet: "utf-8" }), /* @__PURE__ */ React3.createElement(
1927
+ "meta",
1928
+ {
1929
+ name: "viewport",
1930
+ content: "width=device-width,initial-scale=1,viewport-fit=cover"
1931
+ }
1932
+ ), /* @__PURE__ */ React3.createElement("title", null, title)), /* @__PURE__ */ React3.createElement("body", null, /* @__PURE__ */ React3.createElement("main", { style: { fontFamily: "system-ui, sans-serif", padding: "2rem" } }, children)));
1933
+ }
1934
+ function RSCDefaultRootErrorBoundaryImpl({
1935
+ error,
1936
+ renderAppShell
1937
+ }) {
1938
+ console.error(error);
1939
+ let heyDeveloper = /* @__PURE__ */ React3.createElement(
1940
+ "script",
1941
+ {
1942
+ dangerouslySetInnerHTML: {
1943
+ __html: `
1944
+ console.log(
1945
+ "\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
1946
+ );
1947
+ `
1948
+ }
1949
+ }
1950
+ );
1951
+ if (isRouteErrorResponse(error)) {
1952
+ return /* @__PURE__ */ React3.createElement(
1953
+ ErrorWrapper,
1954
+ {
1955
+ renderAppShell,
1956
+ title: "Unhandled Thrown Response!"
1957
+ },
1958
+ /* @__PURE__ */ React3.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
1959
+ ENABLE_DEV_WARNINGS ? heyDeveloper : null
1960
+ );
1961
+ }
1962
+ let errorInstance;
1963
+ if (error instanceof Error) {
1964
+ errorInstance = error;
1965
+ } else {
1966
+ let errorString = error == null ? "Unknown Error" : typeof error === "object" && "toString" in error ? error.toString() : JSON.stringify(error);
1967
+ errorInstance = new Error(errorString);
1968
+ }
1969
+ return /* @__PURE__ */ React3.createElement(ErrorWrapper, { renderAppShell, title: "Application Error!" }, /* @__PURE__ */ React3.createElement("h1", { style: { fontSize: "24px" } }, "Application Error"), /* @__PURE__ */ React3.createElement(
1970
+ "pre",
1971
+ {
1972
+ style: {
1973
+ padding: "2rem",
1974
+ background: "hsla(10, 50%, 50%, 0.1)",
1975
+ color: "red",
1976
+ overflow: "auto"
1977
+ }
1978
+ },
1979
+ errorInstance.stack
1980
+ ), heyDeveloper);
1981
+ }
1982
+ function RSCDefaultRootErrorBoundary({
1983
+ hasRootLayout
1984
+ }) {
1985
+ let error = useRouteError();
1986
+ if (hasRootLayout === void 0) {
1987
+ throw new Error("Missing 'hasRootLayout' prop");
1988
+ }
1989
+ return /* @__PURE__ */ React3.createElement(
1990
+ RSCDefaultRootErrorBoundaryImpl,
1991
+ {
1992
+ renderAppShell: !hasRootLayout,
1993
+ error
1994
+ }
1995
+ );
1996
+ }
1997
+
1998
+ // lib/rsc/route-modules.ts
1999
+ function createRSCRouteModules(payload) {
2000
+ const routeModules = {};
2001
+ for (const match of payload.matches) {
2002
+ populateRSCRouteModules(routeModules, match);
2003
+ }
2004
+ return routeModules;
2005
+ }
2006
+ function populateRSCRouteModules(routeModules, matches) {
2007
+ matches = Array.isArray(matches) ? matches : [matches];
2008
+ for (const match of matches) {
2009
+ routeModules[match.id] = {
2010
+ links: match.links,
2011
+ meta: match.meta,
2012
+ default: noopComponent
2013
+ };
2014
+ }
2015
+ }
2016
+ var noopComponent = () => null;
2017
+
2018
+ // lib/rsc/server.ssr.tsx
2019
+ var REACT_USE = "use";
2020
+ var useImpl = React4[REACT_USE];
2021
+ function useSafe(promise) {
2022
+ if (useImpl) {
2023
+ return useImpl(promise);
2024
+ }
2025
+ throw new Error("React Router v7 requires React 19+ for RSC features.");
2026
+ }
2027
+ async function routeRSCServerRequest({
2028
+ request,
2029
+ serverResponse,
2030
+ createFromReadableStream,
2031
+ renderHTML,
2032
+ hydrate = true
2033
+ }) {
2034
+ const url = new URL(request.url);
2035
+ const isDataRequest = isReactServerRequest(url);
2036
+ const respondWithRSCPayload = isDataRequest || isManifestRequest(url) || request.headers.has("rsc-action-id");
2037
+ if (respondWithRSCPayload || serverResponse.headers.get("React-Router-Resource") === "true") {
2038
+ return serverResponse;
2039
+ }
2040
+ if (!serverResponse.body) {
2041
+ throw new Error("Missing body in server response");
2042
+ }
2043
+ const detectRedirectResponse = serverResponse.clone();
2044
+ let serverResponseB = null;
2045
+ if (hydrate) {
2046
+ serverResponseB = serverResponse.clone();
2047
+ }
2048
+ const body = serverResponse.body;
2049
+ let buffer;
2050
+ let streamControllers = [];
2051
+ const createStream = () => {
2052
+ if (!buffer) {
2053
+ buffer = [];
2054
+ return body.pipeThrough(
2055
+ new TransformStream({
2056
+ transform(chunk, controller) {
2057
+ buffer.push(chunk);
2058
+ controller.enqueue(chunk);
2059
+ streamControllers.forEach((c) => c.enqueue(chunk));
2060
+ },
2061
+ flush() {
2062
+ streamControllers.forEach((c) => c.close());
2063
+ streamControllers = [];
2064
+ }
2065
+ })
2066
+ );
2067
+ }
2068
+ return new ReadableStream({
2069
+ start(controller) {
2070
+ buffer.forEach((chunk) => controller.enqueue(chunk));
2071
+ streamControllers.push(controller);
2072
+ }
2073
+ });
2074
+ };
2075
+ let deepestRenderedBoundaryId = null;
2076
+ const getPayload = () => {
2077
+ const payloadPromise = Promise.resolve(
2078
+ createFromReadableStream(createStream())
2079
+ );
2080
+ return Object.defineProperties(payloadPromise, {
2081
+ _deepestRenderedBoundaryId: {
2082
+ get() {
2083
+ return deepestRenderedBoundaryId;
2084
+ },
2085
+ set(boundaryId) {
2086
+ deepestRenderedBoundaryId = boundaryId;
2087
+ }
2088
+ },
2089
+ formState: {
2090
+ get() {
2091
+ return payloadPromise.then(
2092
+ (payload) => payload.type === "render" ? payload.formState : void 0
2093
+ );
2094
+ }
2095
+ }
2096
+ });
2097
+ };
2098
+ let renderRedirect;
2099
+ let renderError;
2100
+ try {
2101
+ if (!detectRedirectResponse.body) {
2102
+ throw new Error("Failed to clone server response");
2103
+ }
2104
+ const payload = await createFromReadableStream(
2105
+ detectRedirectResponse.body
2106
+ );
2107
+ if (serverResponse.status === SINGLE_FETCH_REDIRECT_STATUS && payload.type === "redirect") {
2108
+ const headers2 = new Headers(serverResponse.headers);
2109
+ headers2.delete("Content-Encoding");
2110
+ headers2.delete("Content-Length");
2111
+ headers2.delete("Content-Type");
2112
+ headers2.delete("X-Remix-Response");
2113
+ headers2.set("Location", payload.location);
2114
+ return new Response(serverResponseB?.body || "", {
2115
+ headers: headers2,
2116
+ status: payload.status,
2117
+ statusText: serverResponse.statusText
2118
+ });
2119
+ }
2120
+ let reactHeaders = new Headers();
2121
+ let status = serverResponse.status;
2122
+ let statusText = serverResponse.statusText;
2123
+ let html = await renderHTML(getPayload, {
2124
+ onError(error) {
2125
+ if (typeof error === "object" && error && "digest" in error && typeof error.digest === "string") {
2126
+ renderRedirect = decodeRedirectErrorDigest(error.digest);
2127
+ if (renderRedirect) {
2128
+ return error.digest;
2129
+ }
2130
+ let routeErrorResponse = decodeRouteErrorResponseDigest(error.digest);
2131
+ if (routeErrorResponse) {
2132
+ renderError = routeErrorResponse;
2133
+ status = routeErrorResponse.status;
2134
+ statusText = routeErrorResponse.statusText;
2135
+ return error.digest;
2136
+ }
2137
+ }
2138
+ },
2139
+ onHeaders(headers2) {
2140
+ for (const [key, value] of headers2) {
2141
+ reactHeaders.append(key, value);
2142
+ }
2143
+ }
2144
+ });
2145
+ const headers = new Headers(reactHeaders);
2146
+ for (const [key, value] of serverResponse.headers) {
2147
+ headers.append(key, value);
2148
+ }
2149
+ headers.set("Content-Type", "text/html; charset=utf-8");
2150
+ if (renderRedirect) {
2151
+ headers.set("Location", renderRedirect.location);
2152
+ return new Response(html, {
2153
+ status: renderRedirect.status,
2154
+ headers
2155
+ });
2156
+ }
2157
+ const redirectTransform = new TransformStream({
2158
+ flush(controller) {
2159
+ if (renderRedirect) {
2160
+ controller.enqueue(
2161
+ new TextEncoder().encode(
2162
+ `<meta http-equiv="refresh" content="0;url=${escapeHtml(renderRedirect.location)}"/>`
2163
+ )
2164
+ );
2165
+ }
2166
+ }
2167
+ });
2168
+ if (!hydrate) {
2169
+ return new Response(html.pipeThrough(redirectTransform), {
2170
+ status,
2171
+ statusText,
2172
+ headers
2173
+ });
2174
+ }
2175
+ if (!serverResponseB?.body) {
2176
+ throw new Error("Failed to clone server response");
2177
+ }
2178
+ const body2 = html.pipeThrough(injectRSCPayload(serverResponseB.body)).pipeThrough(redirectTransform);
2179
+ return new Response(body2, {
2180
+ status,
2181
+ statusText,
2182
+ headers
2183
+ });
2184
+ } catch (reason) {
2185
+ if (reason instanceof Response) {
2186
+ return reason;
2187
+ }
2188
+ if (renderRedirect) {
2189
+ return new Response(`Redirect: ${renderRedirect.location}`, {
2190
+ status: renderRedirect.status,
2191
+ headers: {
2192
+ Location: renderRedirect.location
2193
+ }
2194
+ });
2195
+ }
2196
+ try {
2197
+ reason = renderError ?? reason;
2198
+ let [status, statusText] = isRouteErrorResponse(reason) ? [reason.status, reason.statusText] : [500, ""];
2199
+ let retryRedirect;
2200
+ let reactHeaders = new Headers();
2201
+ const html = await renderHTML(
2202
+ () => {
2203
+ const decoded = Promise.resolve(
2204
+ createFromReadableStream(createStream())
2205
+ );
2206
+ const payloadPromise = decoded.then(
2207
+ (payload) => Object.assign(payload, {
2208
+ status,
2209
+ errors: deepestRenderedBoundaryId ? {
2210
+ [deepestRenderedBoundaryId]: reason
2211
+ } : {}
2212
+ })
2213
+ );
2214
+ return Object.defineProperties(payloadPromise, {
2215
+ _deepestRenderedBoundaryId: {
2216
+ get() {
2217
+ return deepestRenderedBoundaryId;
2218
+ },
2219
+ set(boundaryId) {
2220
+ deepestRenderedBoundaryId = boundaryId;
2221
+ }
2222
+ },
2223
+ formState: {
2224
+ get() {
2225
+ return payloadPromise.then(
2226
+ (payload) => payload.type === "render" ? payload.formState : void 0
2227
+ );
2228
+ }
2229
+ }
2230
+ });
2231
+ },
2232
+ {
2233
+ onError(error) {
2234
+ if (typeof error === "object" && error && "digest" in error && typeof error.digest === "string") {
2235
+ retryRedirect = decodeRedirectErrorDigest(error.digest);
2236
+ if (retryRedirect) {
2237
+ return error.digest;
2238
+ }
2239
+ let routeErrorResponse = decodeRouteErrorResponseDigest(
2240
+ error.digest
2241
+ );
2242
+ if (routeErrorResponse) {
2243
+ status = routeErrorResponse.status;
2244
+ statusText = routeErrorResponse.statusText;
2245
+ return error.digest;
2246
+ }
2247
+ }
2248
+ },
2249
+ onHeaders(headers2) {
2250
+ for (const [key, value] of headers2) {
2251
+ reactHeaders.append(key, value);
2252
+ }
2253
+ }
2254
+ }
2255
+ );
2256
+ const headers = new Headers(reactHeaders);
2257
+ for (const [key, value] of serverResponse.headers) {
2258
+ headers.append(key, value);
2259
+ }
2260
+ headers.set("Content-Type", "text/html; charset=utf-8");
2261
+ if (retryRedirect) {
2262
+ headers.set("Location", retryRedirect.location);
2263
+ return new Response(html, {
2264
+ status: retryRedirect.status,
2265
+ headers
2266
+ });
2267
+ }
2268
+ const retryRedirectTransform = new TransformStream({
2269
+ flush(controller) {
2270
+ if (retryRedirect) {
2271
+ controller.enqueue(
2272
+ new TextEncoder().encode(
2273
+ `<meta http-equiv="refresh" content="0;url=${escapeHtml(retryRedirect.location)}"/>`
2274
+ )
2275
+ );
2276
+ }
2277
+ }
2278
+ });
2279
+ if (!hydrate) {
2280
+ return new Response(html.pipeThrough(retryRedirectTransform), {
2281
+ status,
2282
+ statusText,
2283
+ headers
2284
+ });
2285
+ }
2286
+ if (!serverResponseB?.body) {
2287
+ throw new Error("Failed to clone server response");
2288
+ }
2289
+ const body2 = html.pipeThrough(injectRSCPayload(serverResponseB.body)).pipeThrough(retryRedirectTransform);
2290
+ return new Response(body2, {
2291
+ status,
2292
+ statusText,
2293
+ headers
2294
+ });
2295
+ } catch {
2296
+ }
2297
+ throw reason;
2298
+ }
2299
+ }
2300
+ function RSCStaticRouter({ getPayload }) {
2301
+ const decoded = getPayload();
2302
+ const payload = useSafe(decoded);
2303
+ if (payload.type === "redirect") {
2304
+ throw new Response(null, {
2305
+ status: payload.status,
2306
+ headers: {
2307
+ Location: payload.location
2308
+ }
2309
+ });
2310
+ }
2311
+ if (payload.type !== "render") return null;
2312
+ let patchedLoaderData = { ...payload.loaderData };
2313
+ for (const match of payload.matches) {
2314
+ if (shouldHydrateRouteLoader(
2315
+ match.id,
2316
+ match.clientLoader,
2317
+ match.hasLoader,
2318
+ false
2319
+ ) && (match.hydrateFallbackElement || !match.hasLoader)) {
2320
+ delete patchedLoaderData[match.id];
2321
+ }
2322
+ }
2323
+ const context = {
2324
+ get _deepestRenderedBoundaryId() {
2325
+ return decoded._deepestRenderedBoundaryId ?? null;
2326
+ },
2327
+ set _deepestRenderedBoundaryId(boundaryId) {
2328
+ decoded._deepestRenderedBoundaryId = boundaryId;
2329
+ },
2330
+ actionData: payload.actionData,
2331
+ actionHeaders: {},
2332
+ basename: payload.basename,
2333
+ errors: payload.errors,
2334
+ loaderData: patchedLoaderData,
2335
+ loaderHeaders: {},
2336
+ location: payload.location,
2337
+ statusCode: 200,
2338
+ matches: payload.matches.map((match) => ({
2339
+ params: match.params,
2340
+ pathname: match.pathname,
2341
+ pathnameBase: match.pathnameBase,
2342
+ route: {
2343
+ id: match.id,
2344
+ action: match.hasAction || !!match.clientAction,
2345
+ handle: match.handle,
2346
+ hasErrorBoundary: match.hasErrorBoundary,
2347
+ loader: match.hasLoader || !!match.clientLoader,
2348
+ index: match.index,
2349
+ path: match.path,
2350
+ shouldRevalidate: match.shouldRevalidate
2351
+ }
2352
+ }))
2353
+ };
2354
+ const router = createStaticRouter(
2355
+ payload.matches.reduceRight((previous, match) => {
2356
+ const route = {
2357
+ id: match.id,
2358
+ action: match.hasAction || !!match.clientAction,
2359
+ element: match.element,
2360
+ errorElement: match.errorElement,
2361
+ handle: match.handle,
2362
+ hasErrorBoundary: !!match.errorElement,
2363
+ hydrateFallbackElement: match.hydrateFallbackElement,
2364
+ index: match.index,
2365
+ loader: match.hasLoader || !!match.clientLoader,
2366
+ path: match.path,
2367
+ shouldRevalidate: match.shouldRevalidate
2368
+ };
2369
+ if (previous.length > 0) {
2370
+ route.children = previous;
2371
+ }
2372
+ return [route];
2373
+ }, []),
2374
+ context
2375
+ );
2376
+ const frameworkContext = {
2377
+ future: {
2378
+ // These flags have no runtime impact so can always be false. If we add
2379
+ // flags that drive runtime behavior they'll need to be proxied through.
2380
+ v8_middleware: false,
2381
+ unstable_subResourceIntegrity: false,
2382
+ unstable_trailingSlashAwareDataRequests: true
2383
+ // always on for RSC
2384
+ },
2385
+ isSpaMode: false,
2386
+ ssr: true,
2387
+ criticalCss: "",
2388
+ manifest: {
2389
+ routes: {},
2390
+ version: "1",
2391
+ url: "",
2392
+ entry: {
2393
+ module: "",
2394
+ imports: []
2395
+ }
2396
+ },
2397
+ routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
2398
+ routeModules: createRSCRouteModules(payload)
2399
+ };
2400
+ return /* @__PURE__ */ React4.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React4.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React4.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React4.createElement(
2401
+ StaticRouterProvider,
2402
+ {
2403
+ context,
2404
+ router,
2405
+ hydrate: false,
2406
+ nonce: payload.nonce
2407
+ }
2408
+ ))));
2409
+ }
2410
+ function isReactServerRequest(url) {
2411
+ return url.pathname.endsWith(".rsc");
2412
+ }
2413
+ function isManifestRequest(url) {
2414
+ return url.pathname.endsWith(".manifest");
2415
+ }
2416
+
2417
+ // lib/dom/ssr/errors.ts
2418
+ function deserializeErrors(errors) {
2419
+ if (!errors) return null;
2420
+ let entries = Object.entries(errors);
2421
+ let serialized = {};
2422
+ for (let [key, val] of entries) {
2423
+ if (val && val.__type === "RouteErrorResponse") {
2424
+ serialized[key] = new ErrorResponseImpl(
2425
+ val.status,
2426
+ val.statusText,
2427
+ val.data,
2428
+ val.internal === true
2429
+ );
2430
+ } else if (val && val.__type === "Error") {
2431
+ if (val.__subType) {
2432
+ let ErrorConstructor = window[val.__subType];
2433
+ if (typeof ErrorConstructor === "function") {
2434
+ try {
2435
+ let error = new ErrorConstructor(val.message);
2436
+ error.stack = val.stack;
2437
+ serialized[key] = error;
2438
+ } catch (e) {
2439
+ }
2440
+ }
2441
+ }
2442
+ if (serialized[key] == null) {
2443
+ let error = new Error(val.message);
2444
+ error.stack = val.stack;
2445
+ serialized[key] = error;
2446
+ }
2447
+ } else {
2448
+ serialized[key] = val;
2449
+ }
2450
+ }
2451
+ return serialized;
2452
+ }
2453
+
2454
+ // lib/dom/ssr/hydration.tsx
2455
+ function getHydrationData({
2456
+ state,
2457
+ routes,
2458
+ getRouteInfo,
2459
+ location,
2460
+ basename,
2461
+ isSpaMode
2462
+ }) {
2463
+ let hydrationData = {
2464
+ ...state,
2465
+ loaderData: { ...state.loaderData }
2466
+ };
2467
+ let initialMatches = matchRoutes(routes, location, basename);
2468
+ if (initialMatches) {
2469
+ for (let match of initialMatches) {
2470
+ let routeId = match.route.id;
2471
+ let routeInfo = getRouteInfo(routeId);
2472
+ if (shouldHydrateRouteLoader(
2473
+ routeId,
2474
+ routeInfo.clientLoader,
2475
+ routeInfo.hasLoader,
2476
+ isSpaMode
2477
+ ) && (routeInfo.hasHydrateFallback || !routeInfo.hasLoader)) {
2478
+ delete hydrationData.loaderData[routeId];
2479
+ } else if (!routeInfo.hasLoader) {
2480
+ hydrationData.loaderData[routeId] = null;
2481
+ }
2482
+ }
2483
+ }
2484
+ return hydrationData;
2485
+ }
2486
+
2487
+ export {
2488
+ ServerRouter,
2489
+ createRoutesStub,
2490
+ createCookie,
2491
+ isCookie,
2492
+ ServerMode,
2493
+ setDevServerHooks,
2494
+ createRequestHandler,
2495
+ createSession,
2496
+ isSession,
2497
+ createSessionStorage,
2498
+ createCookieSessionStorage,
2499
+ createMemorySessionStorage,
2500
+ href,
2501
+ RSCRouterGlobalErrorBoundary,
2502
+ RSCDefaultRootErrorBoundary,
2503
+ populateRSCRouteModules,
2504
+ routeRSCServerRequest,
2505
+ RSCStaticRouter,
2506
+ deserializeErrors,
2507
+ getHydrationData
2508
+ };