dexto 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (400) hide show
  1. package/README.md +25 -15
  2. package/dist/agents/agent-registry.json +9 -0
  3. package/dist/agents/coding-agent/coding-agent.yml +5 -0
  4. package/dist/agents/default-agent.yml +2 -2
  5. package/dist/api/server-hono.d.ts.map +1 -1
  6. package/dist/api/server-hono.js +39 -5
  7. package/dist/cli/cli-subscriber.d.ts.map +1 -1
  8. package/dist/cli/cli-subscriber.js +7 -1
  9. package/dist/cli/commands/helpers/formatters.d.ts.map +1 -1
  10. package/dist/cli/commands/helpers/formatters.js +2 -1
  11. package/dist/cli/commands/install.d.ts.map +1 -1
  12. package/dist/cli/commands/install.js +14 -40
  13. package/dist/cli/commands/interactive-commands/command-parser.d.ts +17 -14
  14. package/dist/cli/commands/interactive-commands/command-parser.d.ts.map +1 -1
  15. package/dist/cli/commands/interactive-commands/command-parser.js +0 -15
  16. package/dist/cli/commands/interactive-commands/commands.d.ts +4 -4
  17. package/dist/cli/commands/interactive-commands/commands.d.ts.map +1 -1
  18. package/dist/cli/commands/interactive-commands/commands.js +34 -42
  19. package/dist/cli/commands/interactive-commands/documentation-commands.d.ts.map +1 -1
  20. package/dist/cli/commands/interactive-commands/documentation-commands.js +4 -7
  21. package/dist/cli/commands/interactive-commands/general-commands.d.ts.map +1 -1
  22. package/dist/cli/commands/interactive-commands/general-commands.js +159 -117
  23. package/dist/cli/commands/interactive-commands/mcp/index.d.ts +9 -3
  24. package/dist/cli/commands/interactive-commands/mcp/index.d.ts.map +1 -1
  25. package/dist/cli/commands/interactive-commands/mcp/index.js +18 -3
  26. package/dist/cli/commands/interactive-commands/model/index.d.ts +8 -6
  27. package/dist/cli/commands/interactive-commands/model/index.d.ts.map +1 -1
  28. package/dist/cli/commands/interactive-commands/model/index.js +18 -6
  29. package/dist/cli/commands/interactive-commands/prompt-commands.d.ts +3 -2
  30. package/dist/cli/commands/interactive-commands/prompt-commands.d.ts.map +1 -1
  31. package/dist/cli/commands/interactive-commands/prompt-commands.js +69 -52
  32. package/dist/cli/commands/interactive-commands/session/index.d.ts +7 -12
  33. package/dist/cli/commands/interactive-commands/session/index.d.ts.map +1 -1
  34. package/dist/cli/commands/interactive-commands/session/index.js +7 -14
  35. package/dist/cli/commands/interactive-commands/session/session-commands.d.ts +10 -24
  36. package/dist/cli/commands/interactive-commands/session/session-commands.d.ts.map +1 -1
  37. package/dist/cli/commands/interactive-commands/session/session-commands.js +16 -371
  38. package/dist/cli/commands/interactive-commands/system/system-commands.d.ts +1 -0
  39. package/dist/cli/commands/interactive-commands/system/system-commands.d.ts.map +1 -1
  40. package/dist/cli/commands/interactive-commands/system/system-commands.js +103 -74
  41. package/dist/cli/commands/interactive-commands/tool-commands.d.ts +1 -1
  42. package/dist/cli/commands/interactive-commands/tool-commands.d.ts.map +1 -1
  43. package/dist/cli/commands/interactive-commands/tool-commands.js +5 -62
  44. package/dist/cli/commands/interactive-commands/utils/command-output.d.ts +13 -17
  45. package/dist/cli/commands/interactive-commands/utils/command-output.d.ts.map +1 -1
  46. package/dist/cli/commands/interactive-commands/utils/command-output.js +18 -37
  47. package/dist/cli/commands/list-agents.d.ts +2 -2
  48. package/dist/cli/commands/list-agents.d.ts.map +1 -1
  49. package/dist/cli/commands/list-agents.js +36 -32
  50. package/dist/cli/commands/uninstall.d.ts.map +1 -1
  51. package/dist/cli/commands/uninstall.js +4 -6
  52. package/dist/cli/commands/which.d.ts.map +1 -1
  53. package/dist/cli/commands/which.js +17 -3
  54. package/dist/cli/ink-cli/InkCLIRefactored.d.ts +9 -22
  55. package/dist/cli/ink-cli/InkCLIRefactored.d.ts.map +1 -1
  56. package/dist/cli/ink-cli/InkCLIRefactored.js +50 -133
  57. package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts +24 -3
  58. package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +1 -1
  59. package/dist/cli/ink-cli/components/ApprovalPrompt.js +160 -45
  60. package/dist/cli/ink-cli/components/ElicitationForm.d.ts +22 -0
  61. package/dist/cli/ink-cli/components/ElicitationForm.d.ts.map +1 -0
  62. package/dist/cli/ink-cli/components/ElicitationForm.js +358 -0
  63. package/dist/cli/ink-cli/components/Footer.d.ts +16 -0
  64. package/dist/cli/ink-cli/components/Footer.d.ts.map +1 -0
  65. package/dist/cli/ink-cli/components/Footer.js +27 -0
  66. package/dist/cli/ink-cli/components/HistorySearchBar.d.ts +17 -0
  67. package/dist/cli/ink-cli/components/HistorySearchBar.d.ts.map +1 -0
  68. package/dist/cli/ink-cli/components/HistorySearchBar.js +8 -0
  69. package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts +15 -2
  70. package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts.map +1 -1
  71. package/dist/cli/ink-cli/components/ResourceAutocomplete.js +126 -82
  72. package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts +15 -2
  73. package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts.map +1 -1
  74. package/dist/cli/ink-cli/components/SlashCommandAutocomplete.js +228 -122
  75. package/dist/cli/ink-cli/components/StatusBar.d.ts +15 -2
  76. package/dist/cli/ink-cli/components/StatusBar.d.ts.map +1 -1
  77. package/dist/cli/ink-cli/components/StatusBar.js +46 -8
  78. package/dist/cli/ink-cli/components/TextBufferInput.d.ts +52 -0
  79. package/dist/cli/ink-cli/components/TextBufferInput.d.ts.map +1 -0
  80. package/dist/cli/ink-cli/components/TextBufferInput.js +471 -0
  81. package/dist/cli/ink-cli/components/base/BaseSelector.d.ts +11 -1
  82. package/dist/cli/ink-cli/components/base/BaseSelector.d.ts.map +1 -1
  83. package/dist/cli/ink-cli/components/base/BaseSelector.js +90 -49
  84. package/dist/cli/ink-cli/components/chat/Header.d.ts +1 -0
  85. package/dist/cli/ink-cli/components/chat/Header.d.ts.map +1 -1
  86. package/dist/cli/ink-cli/components/chat/Header.js +7 -2
  87. package/dist/cli/ink-cli/components/chat/MessageItem.d.ts +3 -0
  88. package/dist/cli/ink-cli/components/chat/MessageItem.d.ts.map +1 -1
  89. package/dist/cli/ink-cli/components/chat/MessageItem.js +95 -9
  90. package/dist/cli/ink-cli/components/chat/MessageList.js +1 -1
  91. package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.d.ts +16 -0
  92. package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.d.ts.map +1 -0
  93. package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.js +27 -0
  94. package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts +4 -2
  95. package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts.map +1 -1
  96. package/dist/cli/ink-cli/components/chat/ToolIcon.js +19 -5
  97. package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.d.ts +10 -0
  98. package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.d.ts.map +1 -0
  99. package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.js +6 -0
  100. package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.d.ts +10 -0
  101. package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.d.ts.map +1 -0
  102. package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.js +15 -0
  103. package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts +10 -0
  104. package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts.map +1 -0
  105. package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.js +9 -0
  106. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.d.ts +10 -0
  107. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.d.ts.map +1 -0
  108. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.js +37 -0
  109. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.d.ts +10 -0
  110. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.d.ts.map +1 -0
  111. package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.js +9 -0
  112. package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.d.ts +10 -0
  113. package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.d.ts.map +1 -0
  114. package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.js +6 -0
  115. package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.d.ts +10 -0
  116. package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.d.ts.map +1 -0
  117. package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.js +29 -0
  118. package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.d.ts +45 -0
  119. package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.d.ts.map +1 -0
  120. package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.js +38 -0
  121. package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.d.ts +10 -0
  122. package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.d.ts.map +1 -0
  123. package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.js +6 -0
  124. package/dist/cli/ink-cli/components/chat/styled-boxes/index.d.ts +13 -0
  125. package/dist/cli/ink-cli/components/chat/styled-boxes/index.d.ts.map +1 -0
  126. package/dist/cli/ink-cli/components/chat/styled-boxes/index.js +12 -0
  127. package/dist/cli/ink-cli/components/input/InputArea.d.ts +36 -8
  128. package/dist/cli/ink-cli/components/input/InputArea.d.ts.map +1 -1
  129. package/dist/cli/ink-cli/components/input/InputArea.js +3 -3
  130. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts +25 -0
  131. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +1 -0
  132. package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +166 -0
  133. package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts +27 -0
  134. package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +1 -0
  135. package/dist/cli/ink-cli/components/modes/StaticCLI.js +95 -0
  136. package/dist/cli/ink-cli/components/modes/index.d.ts +10 -0
  137. package/dist/cli/ink-cli/components/modes/index.d.ts.map +1 -0
  138. package/dist/cli/ink-cli/components/modes/index.js +9 -0
  139. package/dist/cli/ink-cli/components/overlays/ApiKeyInput.d.ts +26 -0
  140. package/dist/cli/ink-cli/components/overlays/ApiKeyInput.d.ts.map +1 -0
  141. package/dist/cli/ink-cli/components/overlays/ApiKeyInput.js +92 -0
  142. package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts +21 -0
  143. package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts.map +1 -0
  144. package/dist/cli/ink-cli/components/overlays/CustomModelWizard.js +177 -0
  145. package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts +22 -0
  146. package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts.map +1 -0
  147. package/dist/cli/ink-cli/components/overlays/LogLevelSelector.js +59 -0
  148. package/dist/cli/ink-cli/components/overlays/McpAddChoice.d.ts +22 -0
  149. package/dist/cli/ink-cli/components/overlays/McpAddChoice.d.ts.map +1 -0
  150. package/dist/cli/ink-cli/components/overlays/McpAddChoice.js +59 -0
  151. package/dist/cli/ink-cli/components/overlays/McpAddSelector.d.ts +26 -0
  152. package/dist/cli/ink-cli/components/overlays/McpAddSelector.d.ts.map +1 -0
  153. package/dist/cli/ink-cli/components/overlays/McpAddSelector.js +73 -0
  154. package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.d.ts +21 -0
  155. package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.d.ts.map +1 -0
  156. package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.js +51 -0
  157. package/dist/cli/ink-cli/components/overlays/McpCustomWizard.d.ts +29 -0
  158. package/dist/cli/ink-cli/components/overlays/McpCustomWizard.d.ts.map +1 -0
  159. package/dist/cli/ink-cli/components/overlays/McpCustomWizard.js +215 -0
  160. package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts +22 -0
  161. package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts.map +1 -0
  162. package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.js +74 -0
  163. package/dist/cli/ink-cli/components/overlays/McpSelector.d.ts +21 -0
  164. package/dist/cli/ink-cli/components/overlays/McpSelector.d.ts.map +1 -0
  165. package/dist/cli/ink-cli/components/overlays/McpSelector.js +52 -0
  166. package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts +28 -0
  167. package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts.map +1 -0
  168. package/dist/cli/ink-cli/components/overlays/McpServerActions.js +84 -0
  169. package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts +29 -0
  170. package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts.map +1 -0
  171. package/dist/cli/ink-cli/components/overlays/McpServerList.js +109 -0
  172. package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts +15 -8
  173. package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
  174. package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.js +247 -24
  175. package/dist/cli/ink-cli/components/overlays/PromptAddChoice.d.ts +22 -0
  176. package/dist/cli/ink-cli/components/overlays/PromptAddChoice.d.ts.map +1 -0
  177. package/dist/cli/ink-cli/components/overlays/PromptAddChoice.js +52 -0
  178. package/dist/cli/ink-cli/components/overlays/PromptAddWizard.d.ts +29 -0
  179. package/dist/cli/ink-cli/components/overlays/PromptAddWizard.d.ts.map +1 -0
  180. package/dist/cli/ink-cli/components/overlays/PromptAddWizard.js +166 -0
  181. package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.d.ts +27 -0
  182. package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.d.ts.map +1 -0
  183. package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.js +119 -0
  184. package/dist/cli/ink-cli/components/overlays/PromptList.d.ts +33 -0
  185. package/dist/cli/ink-cli/components/overlays/PromptList.d.ts.map +1 -0
  186. package/dist/cli/ink-cli/components/overlays/PromptList.js +144 -0
  187. package/dist/cli/ink-cli/components/overlays/SearchOverlay.d.ts +23 -0
  188. package/dist/cli/ink-cli/components/overlays/SearchOverlay.d.ts.map +1 -0
  189. package/dist/cli/ink-cli/components/overlays/SearchOverlay.js +189 -0
  190. package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.d.ts +7 -2
  191. package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.d.ts.map +1 -1
  192. package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.js +19 -5
  193. package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.d.ts +21 -0
  194. package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.d.ts.map +1 -0
  195. package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.js +42 -0
  196. package/dist/cli/ink-cli/components/overlays/StreamSelector.d.ts +20 -0
  197. package/dist/cli/ink-cli/components/overlays/StreamSelector.d.ts.map +1 -0
  198. package/dist/cli/ink-cli/components/overlays/StreamSelector.js +58 -0
  199. package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts +25 -0
  200. package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts.map +1 -0
  201. package/dist/cli/ink-cli/components/overlays/ToolBrowser.js +400 -0
  202. package/dist/cli/ink-cli/components/renderers/DiffRenderer.d.ts +21 -0
  203. package/dist/cli/ink-cli/components/renderers/DiffRenderer.d.ts.map +1 -0
  204. package/dist/cli/ink-cli/components/renderers/DiffRenderer.js +65 -0
  205. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts +28 -0
  206. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts.map +1 -0
  207. package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.js +66 -0
  208. package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts +19 -0
  209. package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts.map +1 -0
  210. package/dist/cli/ink-cli/components/renderers/FileRenderer.js +26 -0
  211. package/dist/cli/ink-cli/components/renderers/GenericRenderer.d.ts +21 -0
  212. package/dist/cli/ink-cli/components/renderers/GenericRenderer.d.ts.map +1 -0
  213. package/dist/cli/ink-cli/components/renderers/GenericRenderer.js +26 -0
  214. package/dist/cli/ink-cli/components/renderers/SearchRenderer.d.ts +20 -0
  215. package/dist/cli/ink-cli/components/renderers/SearchRenderer.d.ts.map +1 -0
  216. package/dist/cli/ink-cli/components/renderers/SearchRenderer.js +12 -0
  217. package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts +21 -0
  218. package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts.map +1 -0
  219. package/dist/cli/ink-cli/components/renderers/ShellRenderer.js +25 -0
  220. package/dist/cli/ink-cli/components/renderers/diff-shared.d.ts +61 -0
  221. package/dist/cli/ink-cli/components/renderers/diff-shared.d.ts.map +1 -0
  222. package/dist/cli/ink-cli/components/renderers/diff-shared.js +158 -0
  223. package/dist/cli/ink-cli/components/renderers/index.d.ts +28 -0
  224. package/dist/cli/ink-cli/components/renderers/index.d.ts.map +1 -0
  225. package/dist/cli/ink-cli/components/renderers/index.js +36 -0
  226. package/dist/cli/ink-cli/components/shared/MarkdownText.d.ts +38 -0
  227. package/dist/cli/ink-cli/components/shared/MarkdownText.d.ts.map +1 -0
  228. package/dist/cli/ink-cli/components/shared/MarkdownText.js +360 -0
  229. package/dist/cli/ink-cli/components/shared/VirtualizedList.d.ts +44 -0
  230. package/dist/cli/ink-cli/components/shared/VirtualizedList.d.ts.map +1 -0
  231. package/dist/cli/ink-cli/components/shared/VirtualizedList.js +300 -0
  232. package/dist/cli/ink-cli/components/shared/text-buffer.d.ts +185 -0
  233. package/dist/cli/ink-cli/components/shared/text-buffer.d.ts.map +1 -0
  234. package/dist/cli/ink-cli/components/shared/text-buffer.js +1338 -0
  235. package/dist/cli/ink-cli/constants/processingPhrases.d.ts +10 -0
  236. package/dist/cli/ink-cli/constants/processingPhrases.d.ts.map +1 -0
  237. package/dist/cli/ink-cli/constants/processingPhrases.js +64 -0
  238. package/dist/cli/ink-cli/constants/tips.d.ts +15 -0
  239. package/dist/cli/ink-cli/constants/tips.d.ts.map +1 -0
  240. package/dist/cli/ink-cli/constants/tips.js +53 -0
  241. package/dist/cli/ink-cli/containers/InputContainer.d.ts +42 -8
  242. package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +1 -1
  243. package/dist/cli/ink-cli/containers/InputContainer.js +491 -85
  244. package/dist/cli/ink-cli/containers/OverlayContainer.d.ts +23 -5
  245. package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +1 -1
  246. package/dist/cli/ink-cli/containers/OverlayContainer.js +1156 -130
  247. package/dist/cli/ink-cli/containers/index.d.ts +1 -1
  248. package/dist/cli/ink-cli/containers/index.d.ts.map +1 -1
  249. package/dist/cli/ink-cli/contexts/KeypressContext.d.ts +36 -0
  250. package/dist/cli/ink-cli/contexts/KeypressContext.d.ts.map +1 -0
  251. package/dist/cli/ink-cli/contexts/KeypressContext.js +461 -0
  252. package/dist/cli/ink-cli/contexts/MouseContext.d.ts +27 -0
  253. package/dist/cli/ink-cli/contexts/MouseContext.d.ts.map +1 -0
  254. package/dist/cli/ink-cli/contexts/MouseContext.js +102 -0
  255. package/dist/cli/ink-cli/contexts/ScrollProvider.d.ts +33 -0
  256. package/dist/cli/ink-cli/contexts/ScrollProvider.d.ts.map +1 -0
  257. package/dist/cli/ink-cli/contexts/ScrollProvider.js +170 -0
  258. package/dist/cli/ink-cli/contexts/index.d.ts +7 -0
  259. package/dist/cli/ink-cli/contexts/index.d.ts.map +1 -0
  260. package/dist/cli/ink-cli/contexts/index.js +6 -0
  261. package/dist/cli/ink-cli/hooks/index.d.ts +5 -0
  262. package/dist/cli/ink-cli/hooks/index.d.ts.map +1 -1
  263. package/dist/cli/ink-cli/hooks/index.js +6 -1
  264. package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts +26 -9
  265. package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts.map +1 -1
  266. package/dist/cli/ink-cli/hooks/useAgentEvents.js +86 -198
  267. package/dist/cli/ink-cli/hooks/useBatchedScroll.d.ts +14 -0
  268. package/dist/cli/ink-cli/hooks/useBatchedScroll.d.ts.map +1 -0
  269. package/dist/cli/ink-cli/hooks/useBatchedScroll.js +25 -0
  270. package/dist/cli/ink-cli/hooks/useCLIState.d.ts +50 -0
  271. package/dist/cli/ink-cli/hooks/useCLIState.d.ts.map +1 -0
  272. package/dist/cli/ink-cli/hooks/useCLIState.js +188 -0
  273. package/dist/cli/ink-cli/hooks/useElapsedTime.d.ts +24 -0
  274. package/dist/cli/ink-cli/hooks/useElapsedTime.d.ts.map +1 -0
  275. package/dist/cli/ink-cli/hooks/useElapsedTime.js +69 -0
  276. package/dist/cli/ink-cli/hooks/useHistorySearch.d.ts +61 -0
  277. package/dist/cli/ink-cli/hooks/useHistorySearch.d.ts.map +1 -0
  278. package/dist/cli/ink-cli/hooks/useHistorySearch.js +210 -0
  279. package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts +136 -0
  280. package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts.map +1 -0
  281. package/dist/cli/ink-cli/hooks/useInputOrchestrator.js +663 -0
  282. package/dist/cli/ink-cli/hooks/useKeyboardShortcuts.d.ts.map +1 -1
  283. package/dist/cli/ink-cli/hooks/useKeyboardShortcuts.js +7 -26
  284. package/dist/cli/ink-cli/hooks/useKeypress.d.ts +18 -0
  285. package/dist/cli/ink-cli/hooks/useKeypress.d.ts.map +1 -0
  286. package/dist/cli/ink-cli/hooks/useKeypress.js +26 -0
  287. package/dist/cli/ink-cli/hooks/usePhraseCycler.d.ts +30 -0
  288. package/dist/cli/ink-cli/hooks/usePhraseCycler.d.ts.map +1 -0
  289. package/dist/cli/ink-cli/hooks/usePhraseCycler.js +68 -0
  290. package/dist/cli/ink-cli/hooks/useStreaming.d.ts +19 -0
  291. package/dist/cli/ink-cli/hooks/useStreaming.d.ts.map +1 -0
  292. package/dist/cli/ink-cli/hooks/useStreaming.js +26 -0
  293. package/dist/cli/ink-cli/hooks/useTerminalSize.d.ts +14 -0
  294. package/dist/cli/ink-cli/hooks/useTerminalSize.d.ts.map +1 -0
  295. package/dist/cli/ink-cli/hooks/useTerminalSize.js +31 -0
  296. package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts +42 -0
  297. package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts.map +1 -0
  298. package/dist/cli/ink-cli/hooks/useTokenCounter.js +96 -0
  299. package/dist/cli/ink-cli/services/CommandService.d.ts +32 -1
  300. package/dist/cli/ink-cli/services/CommandService.d.ts.map +1 -1
  301. package/dist/cli/ink-cli/services/CommandService.js +36 -5
  302. package/dist/cli/ink-cli/services/InputService.d.ts +1 -5
  303. package/dist/cli/ink-cli/services/InputService.d.ts.map +1 -1
  304. package/dist/cli/ink-cli/services/InputService.js +1 -8
  305. package/dist/cli/ink-cli/services/index.d.ts +2 -1
  306. package/dist/cli/ink-cli/services/index.d.ts.map +1 -1
  307. package/dist/cli/ink-cli/services/index.js +2 -1
  308. package/dist/cli/ink-cli/services/processStream.d.ts +69 -0
  309. package/dist/cli/ink-cli/services/processStream.d.ts.map +1 -0
  310. package/dist/cli/ink-cli/services/processStream.js +674 -0
  311. package/dist/cli/ink-cli/state/actions.d.ts +30 -60
  312. package/dist/cli/ink-cli/state/actions.d.ts.map +1 -1
  313. package/dist/cli/ink-cli/state/actions.js +3 -0
  314. package/dist/cli/ink-cli/state/index.d.ts +5 -3
  315. package/dist/cli/ink-cli/state/index.d.ts.map +1 -1
  316. package/dist/cli/ink-cli/state/index.js +4 -3
  317. package/dist/cli/ink-cli/state/initialState.d.ts +4 -3
  318. package/dist/cli/ink-cli/state/initialState.d.ts.map +1 -1
  319. package/dist/cli/ink-cli/state/initialState.js +20 -4
  320. package/dist/cli/ink-cli/state/reducer.d.ts +3 -0
  321. package/dist/cli/ink-cli/state/reducer.d.ts.map +1 -1
  322. package/dist/cli/ink-cli/state/reducer.js +62 -168
  323. package/dist/cli/ink-cli/state/streaming-state.d.ts +27 -0
  324. package/dist/cli/ink-cli/state/streaming-state.d.ts.map +1 -0
  325. package/dist/cli/ink-cli/state/streaming-state.js +39 -0
  326. package/dist/cli/ink-cli/state/types.d.ts +222 -6
  327. package/dist/cli/ink-cli/state/types.d.ts.map +1 -1
  328. package/dist/cli/ink-cli/utils/bracketedPaste.d.ts +22 -0
  329. package/dist/cli/ink-cli/utils/bracketedPaste.d.ts.map +1 -0
  330. package/dist/cli/ink-cli/utils/bracketedPaste.js +27 -0
  331. package/dist/cli/ink-cli/utils/clipboardUtils.d.ts +49 -0
  332. package/dist/cli/ink-cli/utils/clipboardUtils.d.ts.map +1 -0
  333. package/dist/cli/ink-cli/utils/clipboardUtils.js +356 -0
  334. package/dist/cli/ink-cli/utils/commandOverlays.d.ts +33 -0
  335. package/dist/cli/ink-cli/utils/commandOverlays.d.ts.map +1 -0
  336. package/dist/cli/ink-cli/utils/commandOverlays.js +78 -0
  337. package/dist/cli/ink-cli/utils/debugLog.d.ts +38 -0
  338. package/dist/cli/ink-cli/utils/debugLog.d.ts.map +1 -0
  339. package/dist/cli/ink-cli/utils/debugLog.js +66 -0
  340. package/dist/cli/ink-cli/utils/index.d.ts +2 -1
  341. package/dist/cli/ink-cli/utils/index.d.ts.map +1 -1
  342. package/dist/cli/ink-cli/utils/index.js +3 -1
  343. package/dist/cli/ink-cli/utils/input.d.ts +25 -0
  344. package/dist/cli/ink-cli/utils/input.d.ts.map +1 -0
  345. package/dist/cli/ink-cli/utils/input.js +56 -0
  346. package/dist/cli/ink-cli/utils/inputParsing.d.ts +0 -9
  347. package/dist/cli/ink-cli/utils/inputParsing.d.ts.map +1 -1
  348. package/dist/cli/ink-cli/utils/inputParsing.js +0 -27
  349. package/dist/cli/ink-cli/utils/messageFormatting.d.ts +54 -3
  350. package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +1 -1
  351. package/dist/cli/ink-cli/utils/messageFormatting.js +290 -20
  352. package/dist/cli/ink-cli/utils/mouse.d.ts +61 -0
  353. package/dist/cli/ink-cli/utils/mouse.d.ts.map +1 -0
  354. package/dist/cli/ink-cli/utils/mouse.js +209 -0
  355. package/dist/cli/ink-cli/utils/streamSplitter.d.ts +44 -0
  356. package/dist/cli/ink-cli/utils/streamSplitter.d.ts.map +1 -0
  357. package/dist/cli/ink-cli/utils/streamSplitter.js +154 -0
  358. package/dist/cli/ink-cli/utils/textUtils.d.ts +63 -0
  359. package/dist/cli/ink-cli/utils/textUtils.d.ts.map +1 -0
  360. package/dist/cli/ink-cli/utils/textUtils.js +248 -0
  361. package/dist/cli/ink-cli/utils/toolUtils.d.ts +9 -0
  362. package/dist/cli/ink-cli/utils/toolUtils.d.ts.map +1 -0
  363. package/dist/cli/ink-cli/utils/toolUtils.js +13 -0
  364. package/dist/cli/utils/options.d.ts.map +1 -1
  365. package/dist/cli/utils/options.js +0 -2
  366. package/dist/config/cli-overrides.d.ts +1 -1
  367. package/dist/config/cli-overrides.d.ts.map +1 -1
  368. package/dist/config/cli-overrides.js +5 -10
  369. package/dist/index.js +66 -48
  370. package/dist/utils/agent-helpers.d.ts +95 -0
  371. package/dist/utils/agent-helpers.d.ts.map +1 -0
  372. package/dist/utils/agent-helpers.js +117 -0
  373. package/dist/webui/assets/index-BkwPkZpd.css +1 -0
  374. package/dist/webui/assets/index-D9u1XfyH.js +2025 -0
  375. package/dist/webui/assets/{tanstack-DgxBONJY.js → tanstack-Br79RQ-n.js} +1 -1
  376. package/dist/webui/index.html +3 -3
  377. package/package.json +16 -14
  378. package/dist/cli/commands/interactive-commands/index.d.ts +0 -63
  379. package/dist/cli/commands/interactive-commands/index.d.ts.map +0 -1
  380. package/dist/cli/commands/interactive-commands/index.js +0 -73
  381. package/dist/cli/commands/interactive-commands/mcp/mcp-add-utils.d.ts +0 -34
  382. package/dist/cli/commands/interactive-commands/mcp/mcp-add-utils.d.ts.map +0 -1
  383. package/dist/cli/commands/interactive-commands/mcp/mcp-add-utils.js +0 -178
  384. package/dist/cli/commands/interactive-commands/mcp/mcp-commands.d.ts +0 -9
  385. package/dist/cli/commands/interactive-commands/mcp/mcp-commands.d.ts.map +0 -1
  386. package/dist/cli/commands/interactive-commands/mcp/mcp-commands.js +0 -325
  387. package/dist/cli/commands/interactive-commands/model/model-commands.d.ts +0 -21
  388. package/dist/cli/commands/interactive-commands/model/model-commands.d.ts.map +0 -1
  389. package/dist/cli/commands/interactive-commands/model/model-commands.js +0 -190
  390. package/dist/cli/ink-cli/components/MultiLineTextInput.d.ts +0 -26
  391. package/dist/cli/ink-cli/components/MultiLineTextInput.d.ts.map +0 -1
  392. package/dist/cli/ink-cli/components/MultiLineTextInput.js +0 -220
  393. package/dist/discord/bot.d.ts +0 -4
  394. package/dist/discord/bot.d.ts.map +0 -1
  395. package/dist/discord/bot.js +0 -193
  396. package/dist/telegram/bot.d.ts +0 -5
  397. package/dist/telegram/bot.d.ts.map +0 -1
  398. package/dist/telegram/bot.js +0 -251
  399. package/dist/webui/assets/index-DKq5Xng1.js +0 -687
  400. package/dist/webui/assets/index-D_0_GBu5.css +0 -1
@@ -22,4 +22,4 @@ var Bn=t=>{throw TypeError(t)};var Ms=(t,e,s)=>e.has(t)||Bn("Cannot "+s);var l=(
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */var Zn;function To(){if(Zn)return js;Zn=1;var t=pn(),e=Eo();function s(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:s,r=e.useSyncExternalStore,i=t.useRef,o=t.useEffect,a=t.useMemo,u=t.useDebugValue;return js.useSyncExternalStoreWithSelector=function(h,p,c,f,d){var m=i(null);if(m.current===null){var y={hasValue:!1,value:null};m.current=y}else y=m.current;m=a(function(){function v(R){if(!_){if(_=!0,w=R,R=f(R),d!==void 0&&y.hasValue){var P=y.value;if(d(P,R))return S=P}return S=R}if(P=S,n(w,R))return P;var M=f(R);return d!==void 0&&d(P,M)?(w=R,P):(w=R,S=M)}var _=!1,w,S,C=c===void 0?null:c;return[function(){return v(p())},C===null?void 0:function(){return v(C())}]},[p,c,f,d]);var g=r(h,m[0],m[1]);return o(function(){y.hasValue=!0,y.value=g},[g]),u(g),g},js}var tr;function Io(){return tr||(tr=1,Ds.exports=To()),Ds.exports}var Oo=Io();function ko(t,e=n=>n,s={}){const n=s.equal??Fo;return Oo.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,e,n)}function Fo(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[n,r]of t)if(!e.has(n)||!Object.is(r,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();const s=er(t);if(s.length!==er(e).length)return!1;for(let n=0;n<s.length;n++)if(!Object.prototype.hasOwnProperty.call(e,s[n])||!Object.is(t[s[n]],e[s[n]]))return!1;return!0}function er(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}const Ns=T.createContext(null);function zr(){return typeof document>"u"?Ns:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Ns,Ns)}function Z(t){const e=T.useContext(zr());return t==null||t.warn,e}function J(t){const e=Z({warn:(t==null?void 0:t.router)===void 0}),s=(t==null?void 0:t.router)||e,n=T.useRef(void 0);return ko(s.__store,r=>{if(t!=null&&t.select){if(t.structuralSharing??s.options.defaultStructuralSharing){const i=tt(n.current,t.select(r));return n.current=i,i}return t.select(r)}return r})}const _s=T.createContext(void 0),Ao=T.createContext(void 0);function mt(t){const e=T.useContext(t.from?Ao:_s);return J({select:n=>{const r=n.matches.find(i=>t.from?t.from===i.routeId:i.id===e);if(Pt(!((t.shouldThrow??!0)&&!r),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),r!==void 0)return t.select?t.select(r):r},structuralSharing:t.structuralSharing})}function Rn(t){return mt({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.loaderData):e.loaderData})}function bn(t){const{select:e,...s}=t;return mt({...s,select:n=>e?e(n.loaderDeps):n.loaderDeps})}function wn(t){return mt({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:e=>{const s=t.strict===!1?e.params:e._strictParams;return t.select?t.select(s):s}})}function Pn(t){return mt({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.search):e.search})}const rs=typeof window<"u"?T.useLayoutEffect:T.useEffect;function Qs(t){const e=T.useRef({value:t,prev:null}),s=e.current.value;return t!==s&&(e.current={value:t,prev:s}),e.current.prev}function Do(t,e,s={},n={}){T.useEffect(()=>{if(!t.current||n.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([i])=>{e(i)},s);return r.observe(t.current),()=>{r.disconnect()}},[e,s,n.disabled,t])}function jo(t){const e=T.useRef(null);return T.useImperativeHandle(t,()=>e.current,[]),e}function _n(t){const e=Z();return T.useCallback(s=>e.navigate({...s,from:s.from??(t==null?void 0:t.from)}),[t==null?void 0:t.from,e])}var Hr=Ri();const Da=Tr(Hr);function Bo(t,e){const s=Z(),[n,r]=T.useState(!1),i=T.useRef(!1),o=jo(e),{activeProps:a,inactiveProps:u,activeOptions:h,to:p,preload:c,preloadDelay:f,hashScrollIntoView:d,replace:m,startTransition:y,resetScroll:g,viewTransition:v,children:_,target:w,disabled:S,style:C,className:R,onClick:P,onFocus:M,onMouseEnter:O,onMouseLeave:b,onTouchStart:L,ignoreBlocker:A,params:B,search:lt,hash:Me,state:V,mask:it,reloadDocument:ht,unsafeRelative:Le,from:Ia,_fromLocation:Oa,...On}=t,pi=J({select:j=>j.location.search,structuralSharing:!0}),kn=t.from,Ee=T.useMemo(()=>({...t,from:kn}),[s,pi,kn,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),yt=T.useMemo(()=>s.buildLocation({...Ee}),[s,Ee]),_t=T.useMemo(()=>{if(S)return;let j=yt.maskedLocation?yt.maskedLocation.url:yt.url,$=!1;return s.origin&&(j.startsWith(s.origin)?j=s.history.createHref(j.replace(s.origin,""))||"/":$=!0),{href:j,external:$}},[S,yt.maskedLocation,yt.url,s.origin,s.history]),Ye=T.useMemo(()=>{if(_t!=null&&_t.external)return _t.href;try{return new URL(p),p}catch{}},[p,_t]),ae=t.reloadDocument||Ye?!1:c??s.options.defaultPreload,xs=f??s.options.defaultPreloadDelay??0,Cs=J({select:j=>{if(Ye)return!1;if(h!=null&&h.exact){if(!Vi(j.location.pathname,yt.pathname,s.basepath))return!1}else{const $=ms(j.location.pathname,s.basepath),ot=ms(yt.pathname,s.basepath);if(!($.startsWith(ot)&&($.length===ot.length||$[ot.length]==="/")))return!1}return((h==null?void 0:h.includeSearch)??!0)&&!Zt(j.location.search,yt.search,{partial:!(h!=null&&h.exact),ignoreUndefined:!(h!=null&&h.explicitUndefined)})?!1:h!=null&&h.includeHash?j.location.hash===yt.hash:!0}}),Nt=T.useCallback(()=>{s.preloadRoute({...Ee}).catch(j=>{console.warn(j),console.warn(wo)})},[s,Ee]),mi=T.useCallback(j=>{j!=null&&j.isIntersecting&&Nt()},[Nt]);Do(o,mi,qo,{disabled:!!S||ae!=="viewport"}),T.useEffect(()=>{i.current||!S&&ae==="render"&&(Nt(),i.current=!0)},[S,Nt,ae]);const yi=j=>{const $=j.currentTarget.getAttribute("target"),ot=w!==void 0?w:$;if(!S&&!Ko(j)&&!j.defaultPrevented&&(!ot||ot==="_self")&&j.button===0){j.preventDefault(),Hr.flushSync(()=>{r(!0)});const jn=s.subscribe("onResolved",()=>{jn(),r(!1)});s.navigate({...Ee,replace:m,resetScroll:g,hashScrollIntoView:d,startTransition:y,viewTransition:v,ignoreBlocker:A})}};if(Ye)return{...On,ref:o,href:Ye,..._&&{children:_},...w&&{target:w},...S&&{disabled:S},...C&&{style:C},...R&&{className:R},...P&&{onClick:P},...M&&{onFocus:M},...O&&{onMouseEnter:O},...b&&{onMouseLeave:b},...L&&{onTouchStart:L}};const Fn=j=>{S||ae&&Nt()},gi=Fn,vi=j=>{if(!(S||!ae))if(!xs)Nt();else{const $=j.target;if(Oe.has($))return;const ot=setTimeout(()=>{Oe.delete($),Nt()},xs);Oe.set($,ot)}},Si=j=>{if(S||!ae||!xs)return;const $=j.target,ot=Oe.get($);ot&&(clearTimeout(ot),Oe.delete($))},Xe=Cs?Xt(a,{})??Uo:$s,Ze=Cs?$s:Xt(u,{})??$s,An=[R,Xe.className,Ze.className].filter(Boolean).join(" "),Dn=(C||Xe.style||Ze.style)&&{...C,...Xe.style,...Ze.style};return{...On,...Xe,...Ze,href:_t==null?void 0:_t.href,ref:o,onClick:ke([P,yi]),onFocus:ke([M,Fn]),onMouseEnter:ke([O,vi]),onMouseLeave:ke([b,Si]),onTouchStart:ke([L,gi]),disabled:!!S,target:w,...Dn&&{style:Dn},...An&&{className:An},...S&&No,...Cs&&Qo,...n&&$o}}const $s={},Uo={className:"active"},No={role:"link","aria-disabled":!0},Qo={"data-status":"active","aria-current":"page"},$o={"data-transitioning":"transitioning"},Oe=new WeakMap,qo={rootMargin:"100px"},ke=t=>e=>{for(const s of t)if(s){if(e.defaultPrevented)return;s(e)}},Vr=T.forwardRef((t,e)=>{const{_asChild:s,...n}=t,{type:r,ref:i,...o}=Bo(n,e),a=typeof n.children=="function"?n.children({isActive:o["data-status"]==="active"}):n.children;return s===void 0&&delete o.disabled,T.createElement(s||"a",{...o,ref:i},a)});function Ko(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}class zo extends Kr{constructor(e){super(e),this.useMatch=s=>mt({select:s==null?void 0:s.select,from:this.id,structuralSharing:s==null?void 0:s.structuralSharing}),this.useRouteContext=s=>mt({...s,from:this.id,select:n=>s!=null&&s.select?s.select(n.context):n.context}),this.useSearch=s=>Pn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.id}),this.useParams=s=>wn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.id}),this.useLoaderDeps=s=>bn({...s,from:this.id}),this.useLoaderData=s=>Rn({...s,from:this.id}),this.useNavigate=()=>_n({from:this.fullPath}),this.Link=_e.forwardRef((s,n)=>I.jsx(Vr,{ref:n,from:this.fullPath,...s})),this.$$typeof=Symbol.for("react.memo")}}function Ho(t){return new zo(t)}class Vo extends Po{constructor(e){super(e),this.useMatch=s=>mt({select:s==null?void 0:s.select,from:this.id,structuralSharing:s==null?void 0:s.structuralSharing}),this.useRouteContext=s=>mt({...s,from:this.id,select:n=>s!=null&&s.select?s.select(n.context):n.context}),this.useSearch=s=>Pn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.id}),this.useParams=s=>wn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.id}),this.useLoaderDeps=s=>bn({...s,from:this.id}),this.useLoaderData=s=>Rn({...s,from:this.id}),this.useNavigate=()=>_n({from:this.fullPath}),this.Link=_e.forwardRef((s,n)=>I.jsx(Vr,{ref:n,from:this.fullPath,...s})),this.$$typeof=Symbol.for("react.memo")}}function ja(t){return new Vo(t)}function sr(t){return typeof t=="object"?new nr(t,{silent:!0}).createRoute(t):new nr(t,{silent:!0}).createRoute}class nr{constructor(e,s){this.path=e,this.createRoute=n=>{this.silent;const r=Ho(n);return r.isRoot=!1,r},this.silent=s==null?void 0:s.silent}}class rr{constructor(e){this.useMatch=s=>mt({select:s==null?void 0:s.select,from:this.options.id,structuralSharing:s==null?void 0:s.structuralSharing}),this.useRouteContext=s=>mt({from:this.options.id,select:n=>s!=null&&s.select?s.select(n.context):n.context}),this.useSearch=s=>Pn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.options.id}),this.useParams=s=>wn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.options.id}),this.useLoaderDeps=s=>bn({...s,from:this.options.id}),this.useLoaderData=s=>Rn({...s,from:this.options.id}),this.useNavigate=()=>{const s=Z();return _n({from:s.routesById[this.options.id].fullPath})},this.options=e,this.$$typeof=Symbol.for("react.memo")}}function ir(t){return typeof t=="object"?new rr(t):e=>new rr({id:t,...e})}function Wo(){const t=Z(),e=T.useRef({router:t,mounted:!1}),[s,n]=T.useState(!1),{hasPendingMatches:r,isLoading:i}=J({select:c=>({isLoading:c.isLoading,hasPendingMatches:c.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),o=Qs(i),a=i||s||r,u=Qs(a),h=i||r,p=Qs(h);return t.startTransition=c=>{n(!0),T.startTransition(()=>{c(),n(!1)})},T.useEffect(()=>{const c=t.history.subscribe(t.load),f=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return te(t.latestLocation.href)!==te(f.href)&&t.commitLocation({...f,replace:!0}),()=>{c()}},[t,t.history]),rs(()=>{if(typeof window<"u"&&t.ssr||e.current.router===t&&e.current.mounted)return;e.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(f){console.error(f)}})()},[t]),rs(()=>{o&&!i&&t.emit({type:"onLoad",...ee(t.state)})},[o,t,i]),rs(()=>{p&&!h&&t.emit({type:"onBeforeRouteMount",...ee(t.state)})},[h,p,t]),rs(()=>{if(u&&!a){const c=ee(t.state);t.emit({type:"onResolved",...c}),t.__store.setState(f=>({...f,status:"idle",resolvedLocation:f.location})),c.hrefChanged&&eo(t)}},[a,u,t]),null}function Go(t){const e=J({select:s=>`not-found-${s.location.pathname}-${s.status}`});return I.jsx(Sn,{getResetKey:()=>e,onCatch:(s,n)=>{var r;if(rt(s))(r=t.onCatch)==null||r.call(t,s,n);else throw s},errorComponent:({error:s})=>{var n;if(rt(s))return(n=t.fallback)==null?void 0:n.call(t,s);throw s},children:t.children})}function Jo(){return I.jsx("p",{children:"Not Found"})}function ce(t){return I.jsx(I.Fragment,{children:t.children})}function Wr(t,e,s){return e.options.notFoundComponent?I.jsx(e.options.notFoundComponent,{...s}):t.options.defaultNotFoundComponent?I.jsx(t.options.defaultNotFoundComponent,{...s}):I.jsx(Jo,{})}function Yo({children:t}){var s;const e=Z();return e.isServer?I.jsx("script",{nonce:(s=e.options.ssr)==null?void 0:s.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:t+';typeof $_TSR !== "undefined" && $_TSR.c()'}}):null}function Xo(){const t=Z();if(!t.isScrollRestoring||!t.isServer||typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return null;const s=(t.options.getScrollRestorationKey||Ks)(t.latestLocation),n=s!==Ks(t.latestLocation)?s:void 0,r={storageKey:ys,shouldScrollRestoration:!0};return n&&(r.key=n),I.jsx(Yo,{children:`(${Fr.toString()})(${JSON.stringify(r)})`})}const Gr=T.memo(function({matchId:e}){var v,_;const s=Z(),n=J({select:w=>{const S=w.matches.find(C=>C.id===e);return Pt(S),{routeId:S.routeId,ssr:S.ssr,_displayPending:S._displayPending}},structuralSharing:!0}),r=s.routesById[n.routeId],i=r.options.pendingComponent??s.options.defaultPendingComponent,o=i?I.jsx(i,{}):null,a=r.options.errorComponent??s.options.defaultErrorComponent,u=r.options.onCatch??s.options.defaultOnCatch,h=r.isRoot?r.options.notFoundComponent??((v=s.options.notFoundRoute)==null?void 0:v.options.component):r.options.notFoundComponent,p=n.ssr===!1||n.ssr==="data-only",c=(!r.isRoot||r.options.wrapInSuspense||p)&&(r.options.wrapInSuspense??i??(((_=r.options.errorComponent)==null?void 0:_.preload)||p))?T.Suspense:ce,f=a?Sn:ce,d=h?Go:ce,m=J({select:w=>w.loadedAt}),y=J({select:w=>{var C;const S=w.matches.findIndex(R=>R.id===e);return(C=w.matches[S-1])==null?void 0:C.routeId}}),g=r.isRoot?r.options.shellComponent??ce:ce;return I.jsxs(g,{children:[I.jsx(_s.Provider,{value:e,children:I.jsx(c,{fallback:o,children:I.jsx(f,{getResetKey:()=>m,errorComponent:a||Ps,onCatch:(w,S)=>{if(rt(w))throw w;u==null||u(w,S)},children:I.jsx(d,{fallback:w=>{if(!h||w.routeId&&w.routeId!==n.routeId||!w.routeId&&!r.isRoot)throw w;return T.createElement(h,w)},children:p||n._displayPending?I.jsx(xo,{fallback:o,children:I.jsx(or,{matchId:e})}):I.jsx(or,{matchId:e})})})})}),y===X&&s.options.scrollRestoration?I.jsxs(I.Fragment,{children:[I.jsx(Zo,{}),I.jsx(Xo,{})]}):null]})});function Zo(){const t=Z(),e=T.useRef(void 0);return I.jsx("script",{suppressHydrationWarning:!0,ref:s=>{s&&(e.current===void 0||e.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...ee(t.state)}),e.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}const or=T.memo(function({matchId:e}){var u,h,p,c;const s=Z(),{match:n,key:r,routeId:i}=J({select:f=>{const d=f.matches.find(_=>_.id===e),m=d.routeId,y=s.routesById[m].options.remountDeps??s.options.defaultRemountDeps,g=y==null?void 0:y({routeId:m,loaderDeps:d.loaderDeps,params:d._strictParams,search:d._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:m,match:{id:d.id,status:d.status,error:d.error,_forcePending:d._forcePending,_displayPending:d._displayPending}}},structuralSharing:!0}),o=s.routesById[i],a=T.useMemo(()=>{const f=o.options.component??s.options.defaultComponent;return f?I.jsx(f,{},r):I.jsx(ta,{})},[r,o.options.component,s.options.defaultComponent]);if(n._displayPending)throw(u=s.getMatch(n.id))==null?void 0:u._nonReactive.displayPendingPromise;if(n._forcePending)throw(h=s.getMatch(n.id))==null?void 0:h._nonReactive.minPendingPromise;if(n.status==="pending"){const f=o.options.pendingMinMs??s.options.defaultPendingMinMs;if(f){const d=s.getMatch(n.id);if(d&&!d._nonReactive.minPendingPromise&&!s.isServer){const m=xe();d._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),d._nonReactive.minPendingPromise=void 0},f)}}throw(p=s.getMatch(n.id))==null?void 0:p._nonReactive.loadPromise}if(n.status==="notFound")return Pt(rt(n.error)),Wr(s,o,n.error);if(n.status==="redirected")throw Pt(ut(n.error)),(c=s.getMatch(n.id))==null?void 0:c._nonReactive.loadPromise;if(n.status==="error"){if(s.isServer){const f=(o.options.errorComponent??s.options.defaultErrorComponent)||Ps;return I.jsx(f,{error:n.error,reset:void 0,info:{componentStack:""}})}throw n.error}return a}),ta=T.memo(function(){const e=Z(),s=T.useContext(_s),n=J({select:h=>{var p;return(p=h.matches.find(c=>c.id===s))==null?void 0:p.routeId}}),r=e.routesById[n],i=J({select:h=>{const c=h.matches.find(f=>f.id===s);return Pt(c),c.globalNotFound}}),o=J({select:h=>{var f;const p=h.matches,c=p.findIndex(d=>d.id===s);return(f=p[c+1])==null?void 0:f.id}}),a=e.options.defaultPendingComponent?I.jsx(e.options.defaultPendingComponent,{}):null;if(i)return Wr(e,r,void 0);if(!o)return null;const u=I.jsx(Gr,{matchId:o});return n===X?I.jsx(T.Suspense,{fallback:a,children:u}):u});function ea(){const t=Z(),s=t.routesById[X].options.pendingComponent??t.options.defaultPendingComponent,n=s?I.jsx(s,{}):null,r=t.isServer||typeof document<"u"&&t.ssr?ce:T.Suspense,i=I.jsxs(r,{fallback:n,children:[!t.isServer&&I.jsx(Wo,{}),I.jsx(sa,{})]});return t.options.InnerWrap?I.jsx(t.options.InnerWrap,{children:i}):i}function sa(){const t=Z(),e=J({select:r=>{var i;return(i=r.matches[0])==null?void 0:i.id}}),s=J({select:r=>r.loadedAt}),n=e?I.jsx(Gr,{matchId:e}):null;return I.jsx(_s.Provider,{value:e,children:t.options.disableGlobalCatchBoundary?n:I.jsx(Sn,{getResetKey:()=>s,errorComponent:Ps,onCatch:r=>{r.message||r.toString()},children:n})})}const Ba=t=>new na(t);class na extends go{constructor(e){super(e)}}typeof globalThis<"u"?(globalThis.createFileRoute=sr,globalThis.createLazyFileRoute=ir):typeof window<"u"&&(window.createFileRoute=sr,window.createLazyFileRoute=ir);function ra({router:t,children:e,...s}){Object.keys(s).length>0&&t.update({...t.options,...s,context:{...t.options.context,...s.context}});const n=zr(),r=I.jsx(n.Provider,{value:t,children:e});return t.options.Wrap?I.jsx(t.options.Wrap,{children:r}):r}function Ua({router:t,...e}){return I.jsx(ra,{router:t,...e,children:I.jsx(ea,{})})}var oe=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ia={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Ct,fn,vr,oa=(vr=class{constructor(){E(this,Ct,ia);E(this,fn,!1)}setTimeoutProvider(t){x(this,Ct,t)}setTimeout(t,e){return l(this,Ct).setTimeout(t,e)}clearTimeout(t){l(this,Ct).clearTimeout(t)}setInterval(t,e){return l(this,Ct).setInterval(t,e)}clearInterval(t){l(this,Ct).clearInterval(t)}},Ct=new WeakMap,fn=new WeakMap,vr),$t=new oa;function aa(t){setTimeout(t,0)}var re=typeof window>"u"||"Deno"in globalThis;function K(){}function ca(t,e){return typeof t=="function"?t(e):t}function Hs(t){return typeof t=="number"&&t>=0&&t!==1/0}function Jr(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Ut(t,e){return typeof t=="function"?t(e):t}function nt(t,e){return typeof t=="function"?t(e):t}function ar(t,e){const{type:s="all",exact:n,fetchStatus:r,predicate:i,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==xn(o,e.options))return!1}else if(!Qe(e.queryKey,o))return!1}if(s!=="all"){const u=e.isActive();if(s==="active"&&!u||s==="inactive"&&u)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||r&&r!==e.state.fetchStatus||i&&!i(e))}function cr(t,e){const{exact:s,status:n,predicate:r,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(s){if(ie(e.options.mutationKey)!==ie(i))return!1}else if(!Qe(e.options.mutationKey,i))return!1}return!(n&&e.state.status!==n||r&&!r(e))}function xn(t,e){return((e==null?void 0:e.queryKeyHashFn)||ie)(t)}function ie(t){return JSON.stringify(t,(e,s)=>Vs(s)?Object.keys(s).sort().reduce((n,r)=>(n[r]=s[r],n),{}):s)}function Qe(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(s=>Qe(t[s],e[s])):!1}var ua=Object.prototype.hasOwnProperty;function Cn(t,e){if(t===e)return t;const s=ur(t)&&ur(e);if(!s&&!(Vs(t)&&Vs(e)))return e;const r=(s?t:Object.keys(t)).length,i=s?e:Object.keys(e),o=i.length,a=s?new Array(o):{};let u=0;for(let h=0;h<o;h++){const p=s?h:i[h],c=t[p],f=e[p];if(c===f){a[p]=c,(s?h<r:ua.call(t,p))&&u++;continue}if(c===null||f===null||typeof c!="object"||typeof f!="object"){a[p]=f;continue}const d=Cn(c,f);a[p]=d,d===c&&u++}return r===o&&u===r?t:a}function $e(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function ur(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Vs(t){if(!lr(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!lr(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function lr(t){return Object.prototype.toString.call(t)==="[object Object]"}function la(t){return new Promise(e=>{$t.setTimeout(e,t)})}function Ws(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?Cn(t,e):e}function ha(t,e,s=0){const n=[...t,e];return s&&n.length>s?n.slice(1):n}function da(t,e,s=0){const n=[e,...t];return s&&n.length>s?n.slice(0,-1):n}var Mn=Symbol();function Yr(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Mn?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Xr(t,e){return typeof t=="function"?t(...e):!!t}var qt,Mt,ue,Sr,fa=(Sr=class extends oe{constructor(){super();E(this,qt);E(this,Mt);E(this,ue);x(this,ue,e=>{if(!re&&window.addEventListener){const s=()=>e();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){l(this,Mt)||this.setEventListener(l(this,ue))}onUnsubscribe(){var e;this.hasListeners()||((e=l(this,Mt))==null||e.call(this),x(this,Mt,void 0))}setEventListener(e){var s;x(this,ue,e),(s=l(this,Mt))==null||s.call(this),x(this,Mt,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){l(this,qt)!==e&&(x(this,qt,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(s=>{s(e)})}isFocused(){var e;return typeof l(this,qt)=="boolean"?l(this,qt):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},qt=new WeakMap,Mt=new WeakMap,ue=new WeakMap,Sr),Ln=new fa;function Gs(){let t,e;const s=new Promise((r,i)=>{t=r,e=i});s.status="pending",s.catch(()=>{});function n(r){Object.assign(s,r),delete s.resolve,delete s.reject}return s.resolve=r=>{n({status:"fulfilled",value:r}),t(r)},s.reject=r=>{n({status:"rejected",reason:r}),e(r)},s}var pa=aa;function ma(){let t=[],e=0,s=a=>{a()},n=a=>{a()},r=pa;const i=a=>{e?t.push(a):r(()=>{s(a)})},o=()=>{const a=t;t=[],a.length&&r(()=>{n(()=>{a.forEach(u=>{s(u)})})})};return{batch:a=>{let u;e++;try{u=a()}finally{e--,e||o()}return u},batchCalls:a=>(...u)=>{i(()=>{a(...u)})},schedule:i,setNotifyFunction:a=>{s=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{r=a}}}var N=ma(),le,Lt,he,Rr,ya=(Rr=class extends oe{constructor(){super();E(this,le,!0);E(this,Lt);E(this,he);x(this,he,e=>{if(!re&&window.addEventListener){const s=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",n)}}})}onSubscribe(){l(this,Lt)||this.setEventListener(l(this,he))}onUnsubscribe(){var e;this.hasListeners()||((e=l(this,Lt))==null||e.call(this),x(this,Lt,void 0))}setEventListener(e){var s;x(this,he,e),(s=l(this,Lt))==null||s.call(this),x(this,Lt,e(this.setOnline.bind(this)))}setOnline(e){l(this,le)!==e&&(x(this,le,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return l(this,le)}},le=new WeakMap,Lt=new WeakMap,he=new WeakMap,Rr),Ss=new ya;function ga(t){return Math.min(1e3*2**t,3e4)}function Zr(t){return(t??"online")==="online"?Ss.isOnline():!0}var Js=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function ti(t){let e=!1,s=0,n;const r=Gs(),i=()=>r.status!=="pending",o=y=>{var g;if(!i()){const v=new Js(y);f(v),(g=t.onCancel)==null||g.call(t,v)}},a=()=>{e=!0},u=()=>{e=!1},h=()=>Ln.isFocused()&&(t.networkMode==="always"||Ss.isOnline())&&t.canRun(),p=()=>Zr(t.networkMode)&&t.canRun(),c=y=>{i()||(n==null||n(),r.resolve(y))},f=y=>{i()||(n==null||n(),r.reject(y))},d=()=>new Promise(y=>{var g;n=v=>{(i()||h())&&y(v)},(g=t.onPause)==null||g.call(t)}).then(()=>{var y;n=void 0,i()||(y=t.onContinue)==null||y.call(t)}),m=()=>{if(i())return;let y;const g=s===0?t.initialPromise:void 0;try{y=g??t.fn()}catch(v){y=Promise.reject(v)}Promise.resolve(y).then(c).catch(v=>{var R;if(i())return;const _=t.retry??(re?0:3),w=t.retryDelay??ga,S=typeof w=="function"?w(s,v):w,C=_===!0||typeof _=="number"&&s<_||typeof _=="function"&&_(s,v);if(e||!C){f(v);return}s++,(R=t.onFail)==null||R.call(t,s,v),la(S).then(()=>h()?void 0:d()).then(()=>{e?f(v):m()})})};return{promise:r,status:()=>r.status,cancel:o,continue:()=>(n==null||n(),r),cancelRetry:a,continueRetry:u,canStart:p,start:()=>(p()?m():d().then(m),r)}}var Kt,br,ei=(br=class{constructor(){E(this,Kt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Hs(this.gcTime)&&x(this,Kt,$t.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(re?1/0:300*1e3))}clearGcTimeout(){l(this,Kt)&&($t.clearTimeout(l(this,Kt)),x(this,Kt,void 0))}},Kt=new WeakMap,br),zt,de,et,Ht,Q,qe,Vt,at,gt,wr,va=(wr=class extends ei{constructor(e){super();E(this,at);E(this,zt);E(this,de);E(this,et);E(this,Ht);E(this,Q);E(this,qe);E(this,Vt);x(this,Vt,!1),x(this,qe,e.defaultOptions),this.setOptions(e.options),this.observers=[],x(this,Ht,e.client),x(this,et,l(this,Ht).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,x(this,zt,dr(this.options)),this.state=e.state??l(this,zt),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=l(this,Q))==null?void 0:e.promise}setOptions(e){if(this.options={...l(this,qe),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=dr(this.options);s.data!==void 0&&(this.setState(hr(s.data,s.dataUpdatedAt)),x(this,zt,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&l(this,et).remove(this)}setData(e,s){const n=Ws(this.state.data,e,this.options);return k(this,at,gt).call(this,{data:n,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),n}setState(e,s){k(this,at,gt).call(this,{type:"setState",state:e,setStateOptions:s})}cancel(e){var n,r;const s=(n=l(this,Q))==null?void 0:n.promise;return(r=l(this,Q))==null||r.cancel(e),s?s.then(K).catch(K):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(l(this,zt))}isActive(){return this.observers.some(e=>nt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Mn||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ut(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Jr(this.state.dataUpdatedAt,e)}onFocus(){var s;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(s=l(this,Q))==null||s.continue()}onOnline(){var s;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(s=l(this,Q))==null||s.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),l(this,et).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(s=>s!==e),this.observers.length||(l(this,Q)&&(l(this,Vt)?l(this,Q).cancel({revert:!0}):l(this,Q).cancelRetry()),this.scheduleGc()),l(this,et).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||k(this,at,gt).call(this,{type:"invalidate"})}async fetch(e,s){var u,h,p,c,f,d,m,y,g,v,_,w;if(this.state.fetchStatus!=="idle"&&((u=l(this,Q))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(l(this,Q))return l(this,Q).continueRetry(),l(this,Q).promise}if(e&&this.setOptions(e),!this.options.queryFn){const S=this.observers.find(C=>C.options.queryFn);S&&this.setOptions(S.options)}const n=new AbortController,r=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(x(this,Vt,!0),n.signal)})},i=()=>{const S=Yr(this.options,s),R=(()=>{const P={client:l(this,Ht),queryKey:this.queryKey,meta:this.meta};return r(P),P})();return x(this,Vt,!1),this.options.persister?this.options.persister(S,R,this):S(R)},a=(()=>{const S={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:l(this,Ht),state:this.state,fetchFn:i};return r(S),S})();(h=this.options.behavior)==null||h.onFetch(a,this),x(this,de,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=a.fetchOptions)==null?void 0:p.meta))&&k(this,at,gt).call(this,{type:"fetch",meta:(c=a.fetchOptions)==null?void 0:c.meta}),x(this,Q,ti({initialPromise:s==null?void 0:s.initialPromise,fn:a.fetchFn,onCancel:S=>{S instanceof Js&&S.revert&&this.setState({...l(this,de),fetchStatus:"idle"}),n.abort()},onFail:(S,C)=>{k(this,at,gt).call(this,{type:"failed",failureCount:S,error:C})},onPause:()=>{k(this,at,gt).call(this,{type:"pause"})},onContinue:()=>{k(this,at,gt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const S=await l(this,Q).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(d=(f=l(this,et).config).onSuccess)==null||d.call(f,S,this),(y=(m=l(this,et).config).onSettled)==null||y.call(m,S,this.state.error,this),S}catch(S){if(S instanceof Js){if(S.silent)return l(this,Q).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw k(this,at,gt).call(this,{type:"error",error:S}),(v=(g=l(this,et).config).onError)==null||v.call(g,S,this),(w=(_=l(this,et).config).onSettled)==null||w.call(_,this.state.data,S,this),S}finally{this.scheduleGc()}}},zt=new WeakMap,de=new WeakMap,et=new WeakMap,Ht=new WeakMap,Q=new WeakMap,qe=new WeakMap,Vt=new WeakMap,at=new WeakSet,gt=function(e){const s=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...si(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...hr(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return x(this,de,e.manual?r:void 0),r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=s(this.state),N.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),l(this,et).notify({query:this,type:"updated",action:e})})},wr);function si(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Zr(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function hr(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function dr(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,n=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var W,F,Ke,z,Wt,fe,vt,Et,ze,pe,me,Gt,Jt,Tt,ye,D,Ae,Ys,Xs,Zs,tn,en,sn,nn,ni,Pr,En=(Pr=class extends oe{constructor(e,s){super();E(this,D);E(this,W);E(this,F);E(this,Ke);E(this,z);E(this,Wt);E(this,fe);E(this,vt);E(this,Et);E(this,ze);E(this,pe);E(this,me);E(this,Gt);E(this,Jt);E(this,Tt);E(this,ye,new Set);this.options=s,x(this,W,e),x(this,Et,null),x(this,vt,Gs()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(l(this,F).addObserver(this),fr(l(this,F),this.options)?k(this,D,Ae).call(this):this.updateResult(),k(this,D,tn).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return rn(l(this,F),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return rn(l(this,F),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,k(this,D,en).call(this),k(this,D,sn).call(this),l(this,F).removeObserver(this)}setOptions(e){const s=this.options,n=l(this,F);if(this.options=l(this,W).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof nt(this.options.enabled,l(this,F))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");k(this,D,nn).call(this),l(this,F).setOptions(this.options),s._defaulted&&!$e(this.options,s)&&l(this,W).getQueryCache().notify({type:"observerOptionsUpdated",query:l(this,F),observer:this});const r=this.hasListeners();r&&pr(l(this,F),n,this.options,s)&&k(this,D,Ae).call(this),this.updateResult(),r&&(l(this,F)!==n||nt(this.options.enabled,l(this,F))!==nt(s.enabled,l(this,F))||Ut(this.options.staleTime,l(this,F))!==Ut(s.staleTime,l(this,F)))&&k(this,D,Ys).call(this);const i=k(this,D,Xs).call(this);r&&(l(this,F)!==n||nt(this.options.enabled,l(this,F))!==nt(s.enabled,l(this,F))||i!==l(this,Tt))&&k(this,D,Zs).call(this,i)}getOptimisticResult(e){const s=l(this,W).getQueryCache().build(l(this,W),e),n=this.createResult(s,e);return Ra(this,n)&&(x(this,z,n),x(this,fe,this.options),x(this,Wt,l(this,F).state)),n}getCurrentResult(){return l(this,z)}trackResult(e,s){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),s==null||s(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&l(this,vt).status==="pending"&&l(this,vt).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){l(this,ye).add(e)}getCurrentQuery(){return l(this,F)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const s=l(this,W).defaultQueryOptions(e),n=l(this,W).getQueryCache().build(l(this,W),s);return n.fetch().then(()=>this.createResult(n,s))}fetch(e){return k(this,D,Ae).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),l(this,z)))}createResult(e,s){var O;const n=l(this,F),r=this.options,i=l(this,z),o=l(this,Wt),a=l(this,fe),h=e!==n?e.state:l(this,Ke),{state:p}=e;let c={...p},f=!1,d;if(s._optimisticResults){const b=this.hasListeners(),L=!b&&fr(e,s),A=b&&pr(e,n,s,r);(L||A)&&(c={...c,...si(p.data,e.options)}),s._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:m,errorUpdatedAt:y,status:g}=c;d=c.data;let v=!1;if(s.placeholderData!==void 0&&d===void 0&&g==="pending"){let b;i!=null&&i.isPlaceholderData&&s.placeholderData===(a==null?void 0:a.placeholderData)?(b=i.data,v=!0):b=typeof s.placeholderData=="function"?s.placeholderData((O=l(this,me))==null?void 0:O.state.data,l(this,me)):s.placeholderData,b!==void 0&&(g="success",d=Ws(i==null?void 0:i.data,b,s),f=!0)}if(s.select&&d!==void 0&&!v)if(i&&d===(o==null?void 0:o.data)&&s.select===l(this,ze))d=l(this,pe);else try{x(this,ze,s.select),d=s.select(d),d=Ws(i==null?void 0:i.data,d,s),x(this,pe,d),x(this,Et,null)}catch(b){x(this,Et,b)}l(this,Et)&&(m=l(this,Et),d=l(this,pe),y=Date.now(),g="error");const _=c.fetchStatus==="fetching",w=g==="pending",S=g==="error",C=w&&_,R=d!==void 0,M={status:g,fetchStatus:c.fetchStatus,isPending:w,isSuccess:g==="success",isError:S,isInitialLoading:C,isLoading:C,data:d,dataUpdatedAt:c.dataUpdatedAt,error:m,errorUpdatedAt:y,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>h.dataUpdateCount||c.errorUpdateCount>h.errorUpdateCount,isFetching:_,isRefetching:_&&!w,isLoadingError:S&&!R,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&R,isStale:Tn(e,s),refetch:this.refetch,promise:l(this,vt),isEnabled:nt(s.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const b=B=>{M.status==="error"?B.reject(M.error):M.data!==void 0&&B.resolve(M.data)},L=()=>{const B=x(this,vt,M.promise=Gs());b(B)},A=l(this,vt);switch(A.status){case"pending":e.queryHash===n.queryHash&&b(A);break;case"fulfilled":(M.status==="error"||M.data!==A.value)&&L();break;case"rejected":(M.status!=="error"||M.error!==A.reason)&&L();break}}return M}updateResult(){const e=l(this,z),s=this.createResult(l(this,F),this.options);if(x(this,Wt,l(this,F).state),x(this,fe,this.options),l(this,Wt).data!==void 0&&x(this,me,l(this,F)),$e(s,e))return;x(this,z,s);const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!l(this,ye).size)return!0;const o=new Set(i??l(this,ye));return this.options.throwOnError&&o.add("error"),Object.keys(l(this,z)).some(a=>{const u=a;return l(this,z)[u]!==e[u]&&o.has(u)})};k(this,D,ni).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&k(this,D,tn).call(this)}},W=new WeakMap,F=new WeakMap,Ke=new WeakMap,z=new WeakMap,Wt=new WeakMap,fe=new WeakMap,vt=new WeakMap,Et=new WeakMap,ze=new WeakMap,pe=new WeakMap,me=new WeakMap,Gt=new WeakMap,Jt=new WeakMap,Tt=new WeakMap,ye=new WeakMap,D=new WeakSet,Ae=function(e){k(this,D,nn).call(this);let s=l(this,F).fetch(this.options,e);return e!=null&&e.throwOnError||(s=s.catch(K)),s},Ys=function(){k(this,D,en).call(this);const e=Ut(this.options.staleTime,l(this,F));if(re||l(this,z).isStale||!Hs(e))return;const n=Jr(l(this,z).dataUpdatedAt,e)+1;x(this,Gt,$t.setTimeout(()=>{l(this,z).isStale||this.updateResult()},n))},Xs=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(l(this,F)):this.options.refetchInterval)??!1},Zs=function(e){k(this,D,sn).call(this),x(this,Tt,e),!(re||nt(this.options.enabled,l(this,F))===!1||!Hs(l(this,Tt))||l(this,Tt)===0)&&x(this,Jt,$t.setInterval(()=>{(this.options.refetchIntervalInBackground||Ln.isFocused())&&k(this,D,Ae).call(this)},l(this,Tt)))},tn=function(){k(this,D,Ys).call(this),k(this,D,Zs).call(this,k(this,D,Xs).call(this))},en=function(){l(this,Gt)&&($t.clearTimeout(l(this,Gt)),x(this,Gt,void 0))},sn=function(){l(this,Jt)&&($t.clearInterval(l(this,Jt)),x(this,Jt,void 0))},nn=function(){const e=l(this,W).getQueryCache().build(l(this,W),this.options);if(e===l(this,F))return;const s=l(this,F);x(this,F,e),x(this,Ke,e.state),this.hasListeners()&&(s==null||s.removeObserver(this),e.addObserver(this))},ni=function(e){N.batch(()=>{e.listeners&&this.listeners.forEach(s=>{s(l(this,z))}),l(this,W).getQueryCache().notify({query:l(this,F),type:"observerResultsUpdated"})})},Pr);function Sa(t,e){return nt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function fr(t,e){return Sa(t,e)||t.state.data!==void 0&&rn(t,e,e.refetchOnMount)}function rn(t,e,s){if(nt(e.enabled,t)!==!1&&Ut(e.staleTime,t)!=="static"){const n=typeof s=="function"?s(t):s;return n==="always"||n!==!1&&Tn(t,e)}return!1}function pr(t,e,s,n){return(t!==e||nt(n.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&Tn(t,s)}function Tn(t,e){return nt(e.enabled,t)!==!1&&t.isStaleByTime(Ut(e.staleTime,t))}function Ra(t,e){return!$e(t.getCurrentResult(),e)}function mr(t){return{onFetch:(e,s)=>{var p,c,f,d,m;const n=e.options,r=(f=(c=(p=e.fetchOptions)==null?void 0:p.meta)==null?void 0:c.fetchMore)==null?void 0:f.direction,i=((d=e.state.data)==null?void 0:d.pages)||[],o=((m=e.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},u=0;const h=async()=>{let y=!1;const g=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(e.signal.aborted?y=!0:e.signal.addEventListener("abort",()=>{y=!0}),e.signal)})},v=Yr(e.options,e.fetchOptions),_=async(w,S,C)=>{if(y)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const P=(()=>{const L={client:e.client,queryKey:e.queryKey,pageParam:S,direction:C?"backward":"forward",meta:e.options.meta};return g(L),L})(),M=await v(P),{maxPages:O}=e.options,b=C?da:ha;return{pages:b(w.pages,M,O),pageParams:b(w.pageParams,S,O)}};if(r&&i.length){const w=r==="backward",S=w?ba:yr,C={pages:i,pageParams:o},R=S(n,C);a=await _(C,R,w)}else{const w=t??i.length;do{const S=u===0?o[0]??n.initialPageParam:yr(n,a);if(u>0&&S==null)break;a=await _(a,S),u++}while(u<w)}return a};e.options.persister?e.fetchFn=()=>{var y,g;return(g=(y=e.options).persister)==null?void 0:g.call(y,h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s)}:e.fetchFn=h}}}function yr(t,{pages:e,pageParams:s}){const n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,s[n],s):void 0}function ba(t,{pages:e,pageParams:s}){var n;return e.length>0?(n=t.getPreviousPageParam)==null?void 0:n.call(t,e[0],e,s[0],s):void 0}var He,dt,H,Yt,ft,xt,_r,wa=(_r=class extends ei{constructor(e){super();E(this,ft);E(this,He);E(this,dt);E(this,H);E(this,Yt);x(this,He,e.client),this.mutationId=e.mutationId,x(this,H,e.mutationCache),x(this,dt,[]),this.state=e.state||ri(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){l(this,dt).includes(e)||(l(this,dt).push(e),this.clearGcTimeout(),l(this,H).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){x(this,dt,l(this,dt).filter(s=>s!==e)),this.scheduleGc(),l(this,H).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){l(this,dt).length||(this.state.status==="pending"?this.scheduleGc():l(this,H).remove(this))}continue(){var e;return((e=l(this,Yt))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,u,h,p,c,f,d,m,y,g,v,_,w,S,C,R,P,M,O;const s=()=>{k(this,ft,xt).call(this,{type:"continue"})},n={client:l(this,He),meta:this.options.meta,mutationKey:this.options.mutationKey};x(this,Yt,ti({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(b,L)=>{k(this,ft,xt).call(this,{type:"failed",failureCount:b,error:L})},onPause:()=>{k(this,ft,xt).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>l(this,H).canRun(this)}));const r=this.state.status==="pending",i=!l(this,Yt).canStart();try{if(r)s();else{k(this,ft,xt).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(o=l(this,H).config).onMutate)==null?void 0:a.call(o,e,this,n));const L=await((h=(u=this.options).onMutate)==null?void 0:h.call(u,e,n));L!==this.state.context&&k(this,ft,xt).call(this,{type:"pending",context:L,variables:e,isPaused:i})}const b=await l(this,Yt).start();return await((c=(p=l(this,H).config).onSuccess)==null?void 0:c.call(p,b,e,this.state.context,this,n)),await((d=(f=this.options).onSuccess)==null?void 0:d.call(f,b,e,this.state.context,n)),await((y=(m=l(this,H).config).onSettled)==null?void 0:y.call(m,b,null,this.state.variables,this.state.context,this,n)),await((v=(g=this.options).onSettled)==null?void 0:v.call(g,b,null,e,this.state.context,n)),k(this,ft,xt).call(this,{type:"success",data:b}),b}catch(b){try{throw await((w=(_=l(this,H).config).onError)==null?void 0:w.call(_,b,e,this.state.context,this,n)),await((C=(S=this.options).onError)==null?void 0:C.call(S,b,e,this.state.context,n)),await((P=(R=l(this,H).config).onSettled)==null?void 0:P.call(R,void 0,b,this.state.variables,this.state.context,this,n)),await((O=(M=this.options).onSettled)==null?void 0:O.call(M,void 0,b,e,this.state.context,n)),b}finally{k(this,ft,xt).call(this,{type:"error",error:b})}}finally{l(this,H).runNext(this)}}},He=new WeakMap,dt=new WeakMap,H=new WeakMap,Yt=new WeakMap,ft=new WeakSet,xt=function(e){const s=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=s(this.state),N.batch(()=>{l(this,dt).forEach(n=>{n.onMutationUpdate(e)}),l(this,H).notify({mutation:this,type:"updated",action:e})})},_r);function ri(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var St,ct,Ve,xr,Pa=(xr=class extends oe{constructor(e={}){super();E(this,St);E(this,ct);E(this,Ve);this.config=e,x(this,St,new Set),x(this,ct,new Map),x(this,Ve,0)}build(e,s,n){const r=new wa({client:e,mutationCache:this,mutationId:++ts(this,Ve)._,options:e.defaultMutationOptions(s),state:n});return this.add(r),r}add(e){l(this,St).add(e);const s=is(e);if(typeof s=="string"){const n=l(this,ct).get(s);n?n.push(e):l(this,ct).set(s,[e])}this.notify({type:"added",mutation:e})}remove(e){if(l(this,St).delete(e)){const s=is(e);if(typeof s=="string"){const n=l(this,ct).get(s);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&l(this,ct).delete(s)}}this.notify({type:"removed",mutation:e})}canRun(e){const s=is(e);if(typeof s=="string"){const n=l(this,ct).get(s),r=n==null?void 0:n.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){var n;const s=is(e);if(typeof s=="string"){const r=(n=l(this,ct).get(s))==null?void 0:n.find(i=>i!==e&&i.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}else return Promise.resolve()}clear(){N.batch(()=>{l(this,St).forEach(e=>{this.notify({type:"removed",mutation:e})}),l(this,St).clear(),l(this,ct).clear()})}getAll(){return Array.from(l(this,St))}find(e){const s={exact:!0,...e};return this.getAll().find(n=>cr(s,n))}findAll(e={}){return this.getAll().filter(s=>cr(e,s))}notify(e){N.batch(()=>{this.listeners.forEach(s=>{s(e)})})}resumePausedMutations(){const e=this.getAll().filter(s=>s.state.isPaused);return N.batch(()=>Promise.all(e.map(s=>s.continue().catch(K))))}},St=new WeakMap,ct=new WeakMap,Ve=new WeakMap,xr);function is(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Rt,It,G,bt,wt,us,on,Cr,_a=(Cr=class extends oe{constructor(e,s){super();E(this,wt);E(this,Rt);E(this,It);E(this,G);E(this,bt);x(this,Rt,e),this.setOptions(s),this.bindMethods(),k(this,wt,us).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var n;const s=this.options;this.options=l(this,Rt).defaultMutationOptions(e),$e(this.options,s)||l(this,Rt).getMutationCache().notify({type:"observerOptionsUpdated",mutation:l(this,G),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&ie(s.mutationKey)!==ie(this.options.mutationKey)?this.reset():((n=l(this,G))==null?void 0:n.state.status)==="pending"&&l(this,G).setOptions(this.options)}onUnsubscribe(){var e;this.hasListeners()||(e=l(this,G))==null||e.removeObserver(this)}onMutationUpdate(e){k(this,wt,us).call(this),k(this,wt,on).call(this,e)}getCurrentResult(){return l(this,It)}reset(){var e;(e=l(this,G))==null||e.removeObserver(this),x(this,G,void 0),k(this,wt,us).call(this),k(this,wt,on).call(this)}mutate(e,s){var n;return x(this,bt,s),(n=l(this,G))==null||n.removeObserver(this),x(this,G,l(this,Rt).getMutationCache().build(l(this,Rt),this.options)),l(this,G).addObserver(this),l(this,G).execute(e)}},Rt=new WeakMap,It=new WeakMap,G=new WeakMap,bt=new WeakMap,wt=new WeakSet,us=function(){var s;const e=((s=l(this,G))==null?void 0:s.state)??ri();x(this,It,{...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset})},on=function(e){N.batch(()=>{var s,n,r,i,o,a,u,h;if(l(this,bt)&&this.hasListeners()){const p=l(this,It).variables,c=l(this,It).context,f={client:l(this,Rt),meta:this.options.meta,mutationKey:this.options.mutationKey};(e==null?void 0:e.type)==="success"?((n=(s=l(this,bt)).onSuccess)==null||n.call(s,e.data,p,c,f),(i=(r=l(this,bt)).onSettled)==null||i.call(r,e.data,null,p,c,f)):(e==null?void 0:e.type)==="error"&&((a=(o=l(this,bt)).onError)==null||a.call(o,e.error,p,c,f),(h=(u=l(this,bt)).onSettled)==null||h.call(u,void 0,e.error,p,c,f))}this.listeners.forEach(p=>{p(l(this,It))})})},Cr);function gr(t,e){const s=new Set(e);return t.filter(n=>!s.has(n))}function xa(t,e,s){const n=t.slice(0);return n[e]=s,n}var ge,Y,ve,Se,st,Ot,We,Ge,Je,q,an,cn,un,ln,hn,Mr,Ca=(Mr=class extends oe{constructor(e,s,n){super();E(this,q);E(this,ge);E(this,Y);E(this,ve);E(this,Se);E(this,st);E(this,Ot);E(this,We);E(this,Ge);E(this,Je,[]);x(this,ge,e),x(this,Se,n),x(this,ve,[]),x(this,st,[]),x(this,Y,[]),this.setQueries(s)}onSubscribe(){this.listeners.size===1&&l(this,st).forEach(e=>{e.subscribe(s=>{k(this,q,ln).call(this,e,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,l(this,st).forEach(e=>{e.destroy()})}setQueries(e,s){x(this,ve,e),x(this,Se,s),N.batch(()=>{const n=l(this,st),r=k(this,q,un).call(this,l(this,ve));x(this,Je,r),r.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions));const i=r.map(c=>c.observer),o=i.map(c=>c.getCurrentResult()),a=n.length!==i.length,u=i.some((c,f)=>c!==n[f]),h=a||u,p=h?!0:o.some((c,f)=>{const d=l(this,Y)[f];return!d||!$e(c,d)});!h&&!p||(h&&x(this,st,i),x(this,Y,o),this.hasListeners()&&(h&&(gr(n,i).forEach(c=>{c.destroy()}),gr(i,n).forEach(c=>{c.subscribe(f=>{k(this,q,ln).call(this,c,f)})})),k(this,q,hn).call(this)))})}getCurrentResult(){return l(this,Y)}getQueries(){return l(this,st).map(e=>e.getCurrentQuery())}getObservers(){return l(this,st)}getOptimisticResult(e,s){const n=k(this,q,un).call(this,e),r=n.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions));return[r,i=>k(this,q,cn).call(this,i??r,s),()=>k(this,q,an).call(this,r,n)]}},ge=new WeakMap,Y=new WeakMap,ve=new WeakMap,Se=new WeakMap,st=new WeakMap,Ot=new WeakMap,We=new WeakMap,Ge=new WeakMap,Je=new WeakMap,q=new WeakSet,an=function(e,s){return s.map((n,r)=>{const i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,o=>{s.forEach(a=>{a.observer.trackProp(o)})})})},cn=function(e,s){return s?((!l(this,Ot)||l(this,Y)!==l(this,Ge)||s!==l(this,We))&&(x(this,We,s),x(this,Ge,l(this,Y)),x(this,Ot,Cn(l(this,Ot),s(e)))),l(this,Ot)):e},un=function(e){const s=new Map(l(this,st).map(r=>[r.options.queryHash,r])),n=[];return e.forEach(r=>{const i=l(this,ge).defaultQueryOptions(r),o=s.get(i.queryHash);o?n.push({defaultedQueryOptions:i,observer:o}):n.push({defaultedQueryOptions:i,observer:new En(l(this,ge),i)})}),n},ln=function(e,s){const n=l(this,st).indexOf(e);n!==-1&&(x(this,Y,xa(l(this,Y),n,s)),k(this,q,hn).call(this))},hn=function(){var e;if(this.hasListeners()){const s=l(this,Ot),n=k(this,q,an).call(this,l(this,Y),l(this,Je)),r=k(this,q,cn).call(this,n,(e=l(this,Se))==null?void 0:e.combine);s!==r&&N.batch(()=>{this.listeners.forEach(i=>{i(l(this,Y))})})}},Mr),pt,Lr,Ma=(Lr=class extends oe{constructor(e={}){super();E(this,pt);this.config=e,x(this,pt,new Map)}build(e,s,n){const r=s.queryKey,i=s.queryHash??xn(r,s);let o=this.get(i);return o||(o=new va({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(s),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){l(this,pt).has(e.queryHash)||(l(this,pt).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const s=l(this,pt).get(e.queryHash);s&&(e.destroy(),s===e&&l(this,pt).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){N.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return l(this,pt).get(e)}getAll(){return[...l(this,pt).values()]}find(e){const s={exact:!0,...e};return this.getAll().find(n=>ar(s,n))}findAll(e={}){const s=this.getAll();return Object.keys(e).length>0?s.filter(n=>ar(e,n)):s}notify(e){N.batch(()=>{this.listeners.forEach(s=>{s(e)})})}onFocus(){N.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){N.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},pt=new WeakMap,Lr),U,kt,Ft,Re,be,At,we,Pe,Er,Na=(Er=class{constructor(t={}){E(this,U);E(this,kt);E(this,Ft);E(this,Re);E(this,be);E(this,At);E(this,we);E(this,Pe);x(this,U,t.queryCache||new Ma),x(this,kt,t.mutationCache||new Pa),x(this,Ft,t.defaultOptions||{}),x(this,Re,new Map),x(this,be,new Map),x(this,At,0)}mount(){ts(this,At)._++,l(this,At)===1&&(x(this,we,Ln.subscribe(async t=>{t&&(await this.resumePausedMutations(),l(this,U).onFocus())})),x(this,Pe,Ss.subscribe(async t=>{t&&(await this.resumePausedMutations(),l(this,U).onOnline())})))}unmount(){var t,e;ts(this,At)._--,l(this,At)===0&&((t=l(this,we))==null||t.call(this),x(this,we,void 0),(e=l(this,Pe))==null||e.call(this),x(this,Pe,void 0))}isFetching(t){return l(this,U).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return l(this,kt).findAll({...t,status:"pending"}).length}getQueryData(t){var s;const e=this.defaultQueryOptions({queryKey:t});return(s=l(this,U).get(e.queryHash))==null?void 0:s.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=l(this,U).build(this,e),n=s.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(Ut(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return l(this,U).findAll(t).map(({queryKey:e,state:s})=>{const n=s.data;return[e,n]})}setQueryData(t,e,s){const n=this.defaultQueryOptions({queryKey:t}),r=l(this,U).get(n.queryHash),i=r==null?void 0:r.state.data,o=ca(e,i);if(o!==void 0)return l(this,U).build(this,n).setData(o,{...s,manual:!0})}setQueriesData(t,e,s){return N.batch(()=>l(this,U).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,s)]))}getQueryState(t){var s;const e=this.defaultQueryOptions({queryKey:t});return(s=l(this,U).get(e.queryHash))==null?void 0:s.state}removeQueries(t){const e=l(this,U);N.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=l(this,U);return N.batch(()=>(s.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},n=N.batch(()=>l(this,U).findAll(t).map(r=>r.cancel(s)));return Promise.all(n).then(K).catch(K)}invalidateQueries(t,e={}){return N.batch(()=>(l(this,U).findAll(t).forEach(s=>{s.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},n=N.batch(()=>l(this,U).findAll(t).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let i=r.fetch(void 0,s);return s.throwOnError||(i=i.catch(K)),r.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(K)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=l(this,U).build(this,e);return s.isStaleByTime(Ut(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(K).catch(K)}fetchInfiniteQuery(t){return t.behavior=mr(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(K).catch(K)}ensureInfiniteQueryData(t){return t.behavior=mr(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ss.isOnline()?l(this,kt).resumePausedMutations():Promise.resolve()}getQueryCache(){return l(this,U)}getMutationCache(){return l(this,kt)}getDefaultOptions(){return l(this,Ft)}setDefaultOptions(t){x(this,Ft,t)}setQueryDefaults(t,e){l(this,Re).set(ie(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...l(this,Re).values()],s={};return e.forEach(n=>{Qe(t,n.queryKey)&&Object.assign(s,n.defaultOptions)}),s}setMutationDefaults(t,e){l(this,be).set(ie(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...l(this,be).values()],s={};return e.forEach(n=>{Qe(t,n.mutationKey)&&Object.assign(s,n.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...l(this,Ft).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=xn(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Mn&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...l(this,Ft).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){l(this,U).clear(),l(this,kt).clear()}},U=new WeakMap,kt=new WeakMap,Ft=new WeakMap,Re=new WeakMap,be=new WeakMap,At=new WeakMap,we=new WeakMap,Pe=new WeakMap,Er),ii=T.createContext(void 0),In=t=>{const e=T.useContext(ii);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Qa=({client:t,children:e})=>(T.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),I.jsx(ii.Provider,{value:t,children:e})),oi=T.createContext(!1),ai=()=>T.useContext(oi);oi.Provider;function La(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Ea=T.createContext(La()),ci=()=>T.useContext(Ea),ui=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},li=t=>{T.useEffect(()=>{t.clearReset()},[t])},hi=({result:t,errorResetBoundary:e,throwOnError:s,query:n,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(r&&t.data===void 0||Xr(s,[t.error,n])),di=t=>{if(t.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...r)=>s(n(...r)):s(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},fi=(t,e)=>t.isLoading&&t.isFetching&&!e,dn=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Rs=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function $a({queries:t,...e},s){const n=In(),r=ai(),i=ci(),o=T.useMemo(()=>t.map(y=>{const g=n.defaultQueryOptions(y);return g._optimisticResults=r?"isRestoring":"optimistic",g}),[t,n,r]);o.forEach(y=>{di(y),ui(y,i)}),li(i);const[a]=T.useState(()=>new Ca(n,o,e)),[u,h,p]=a.getOptimisticResult(o,e.combine),c=!r&&e.subscribed!==!1;T.useSyncExternalStore(T.useCallback(y=>c?a.subscribe(N.batchCalls(y)):K,[a,c]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),T.useEffect(()=>{a.setQueries(o,e)},[o,e,a]);const d=u.some((y,g)=>dn(o[g],y))?u.flatMap((y,g)=>{const v=o[g];if(v){const _=new En(n,v);if(dn(v,y))return Rs(v,_,i);fi(y,r)&&Rs(v,_,i)}return[]}):[];if(d.length>0)throw Promise.all(d);const m=u.find((y,g)=>{const v=o[g];return v&&hi({result:y,errorResetBoundary:i,throwOnError:v.throwOnError,query:n.getQueryCache().get(v.queryHash),suspense:v.suspense})});if(m!=null&&m.error)throw m.error;return h(p())}function Ta(t,e,s){var c,f,d,m,y;const n=ai(),r=ci(),i=In(),o=i.defaultQueryOptions(t);(f=(c=i.getDefaultOptions().queries)==null?void 0:c._experimental_beforeQuery)==null||f.call(c,o),o._optimisticResults=n?"isRestoring":"optimistic",di(o),ui(o,r),li(r);const a=!i.getQueryCache().get(o.queryHash),[u]=T.useState(()=>new e(i,o)),h=u.getOptimisticResult(o),p=!n&&t.subscribed!==!1;if(T.useSyncExternalStore(T.useCallback(g=>{const v=p?u.subscribe(N.batchCalls(g)):K;return u.updateResult(),v},[u,p]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),T.useEffect(()=>{u.setOptions(o)},[o,u]),dn(o,h))throw Rs(o,u,r);if(hi({result:h,errorResetBoundary:r,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw h.error;if((m=(d=i.getDefaultOptions().queries)==null?void 0:d._experimental_afterQuery)==null||m.call(d,o,h),o.experimental_prefetchInRender&&!re&&fi(h,n)){const g=a?Rs(o,u,r):(y=i.getQueryCache().get(o.queryHash))==null?void 0:y.promise;g==null||g.catch(K).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?h:u.trackResult(h)}function qa(t,e){return Ta(t,En)}function Ka(t,e){const s=In(),[n]=T.useState(()=>new _a(s,t));T.useEffect(()=>{n.setOptions(t)},[n,t]);const r=T.useSyncExternalStore(T.useCallback(o=>n.subscribe(N.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=T.useCallback((o,a)=>{n.mutate(o,a).catch(K)},[n]);if(r.error&&Xr(n.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:i,mutateAsync:r.mutate}}export{Vr as L,ta as O,Na as Q,_e as R,Qa as a,qa as b,_n as c,Ka as d,Hr as e,Aa as f,Da as g,$a as h,wn as i,I as j,ja as k,Ho as l,Ba as m,Ua as n,T as r,In as u};
25
+ */var Zn;function To(){if(Zn)return js;Zn=1;var t=pn(),e=Eo();function s(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:s,r=e.useSyncExternalStore,i=t.useRef,o=t.useEffect,a=t.useMemo,u=t.useDebugValue;return js.useSyncExternalStoreWithSelector=function(h,p,c,f,d){var m=i(null);if(m.current===null){var y={hasValue:!1,value:null};m.current=y}else y=m.current;m=a(function(){function v(R){if(!_){if(_=!0,w=R,R=f(R),d!==void 0&&y.hasValue){var P=y.value;if(d(P,R))return S=P}return S=R}if(P=S,n(w,R))return P;var M=f(R);return d!==void 0&&d(P,M)?(w=R,P):(w=R,S=M)}var _=!1,w,S,C=c===void 0?null:c;return[function(){return v(p())},C===null?void 0:function(){return v(C())}]},[p,c,f,d]);var g=r(h,m[0],m[1]);return o(function(){y.hasValue=!0,y.value=g},[g]),u(g),g},js}var tr;function Io(){return tr||(tr=1,Ds.exports=To()),Ds.exports}var Oo=Io();function ko(t,e=n=>n,s={}){const n=s.equal??Fo;return Oo.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,e,n)}function Fo(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[n,r]of t)if(!e.has(n)||!Object.is(r,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();const s=er(t);if(s.length!==er(e).length)return!1;for(let n=0;n<s.length;n++)if(!Object.prototype.hasOwnProperty.call(e,s[n])||!Object.is(t[s[n]],e[s[n]]))return!1;return!0}function er(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}const Ns=T.createContext(null);function zr(){return typeof document>"u"?Ns:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Ns,Ns)}function Z(t){const e=T.useContext(zr());return t==null||t.warn,e}function J(t){const e=Z({warn:(t==null?void 0:t.router)===void 0}),s=(t==null?void 0:t.router)||e,n=T.useRef(void 0);return ko(s.__store,r=>{if(t!=null&&t.select){if(t.structuralSharing??s.options.defaultStructuralSharing){const i=tt(n.current,t.select(r));return n.current=i,i}return t.select(r)}return r})}const _s=T.createContext(void 0),Ao=T.createContext(void 0);function mt(t){const e=T.useContext(t.from?Ao:_s);return J({select:n=>{const r=n.matches.find(i=>t.from?t.from===i.routeId:i.id===e);if(Pt(!((t.shouldThrow??!0)&&!r),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),r!==void 0)return t.select?t.select(r):r},structuralSharing:t.structuralSharing})}function Rn(t){return mt({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.loaderData):e.loaderData})}function bn(t){const{select:e,...s}=t;return mt({...s,select:n=>e?e(n.loaderDeps):n.loaderDeps})}function wn(t){return mt({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:e=>{const s=t.strict===!1?e.params:e._strictParams;return t.select?t.select(s):s}})}function Pn(t){return mt({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.search):e.search})}const rs=typeof window<"u"?T.useLayoutEffect:T.useEffect;function Qs(t){const e=T.useRef({value:t,prev:null}),s=e.current.value;return t!==s&&(e.current={value:t,prev:s}),e.current.prev}function Do(t,e,s={},n={}){T.useEffect(()=>{if(!t.current||n.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([i])=>{e(i)},s);return r.observe(t.current),()=>{r.disconnect()}},[e,s,n.disabled,t])}function jo(t){const e=T.useRef(null);return T.useImperativeHandle(t,()=>e.current,[]),e}function _n(t){const e=Z();return T.useCallback(s=>e.navigate({...s,from:s.from??(t==null?void 0:t.from)}),[t==null?void 0:t.from,e])}var Hr=Ri();const Da=Tr(Hr);function Bo(t,e){const s=Z(),[n,r]=T.useState(!1),i=T.useRef(!1),o=jo(e),{activeProps:a,inactiveProps:u,activeOptions:h,to:p,preload:c,preloadDelay:f,hashScrollIntoView:d,replace:m,startTransition:y,resetScroll:g,viewTransition:v,children:_,target:w,disabled:S,style:C,className:R,onClick:P,onFocus:M,onMouseEnter:O,onMouseLeave:b,onTouchStart:L,ignoreBlocker:A,params:B,search:lt,hash:Me,state:V,mask:it,reloadDocument:ht,unsafeRelative:Le,from:Ia,_fromLocation:Oa,...On}=t,pi=J({select:j=>j.location.search,structuralSharing:!0}),kn=t.from,Ee=T.useMemo(()=>({...t,from:kn}),[s,pi,kn,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),yt=T.useMemo(()=>s.buildLocation({...Ee}),[s,Ee]),_t=T.useMemo(()=>{if(S)return;let j=yt.maskedLocation?yt.maskedLocation.url:yt.url,$=!1;return s.origin&&(j.startsWith(s.origin)?j=s.history.createHref(j.replace(s.origin,""))||"/":$=!0),{href:j,external:$}},[S,yt.maskedLocation,yt.url,s.origin,s.history]),Ye=T.useMemo(()=>{if(_t!=null&&_t.external)return _t.href;try{return new URL(p),p}catch{}},[p,_t]),ae=t.reloadDocument||Ye?!1:c??s.options.defaultPreload,xs=f??s.options.defaultPreloadDelay??0,Cs=J({select:j=>{if(Ye)return!1;if(h!=null&&h.exact){if(!Vi(j.location.pathname,yt.pathname,s.basepath))return!1}else{const $=ms(j.location.pathname,s.basepath),ot=ms(yt.pathname,s.basepath);if(!($.startsWith(ot)&&($.length===ot.length||$[ot.length]==="/")))return!1}return((h==null?void 0:h.includeSearch)??!0)&&!Zt(j.location.search,yt.search,{partial:!(h!=null&&h.exact),ignoreUndefined:!(h!=null&&h.explicitUndefined)})?!1:h!=null&&h.includeHash?j.location.hash===yt.hash:!0}}),Nt=T.useCallback(()=>{s.preloadRoute({...Ee}).catch(j=>{console.warn(j),console.warn(wo)})},[s,Ee]),mi=T.useCallback(j=>{j!=null&&j.isIntersecting&&Nt()},[Nt]);Do(o,mi,qo,{disabled:!!S||ae!=="viewport"}),T.useEffect(()=>{i.current||!S&&ae==="render"&&(Nt(),i.current=!0)},[S,Nt,ae]);const yi=j=>{const $=j.currentTarget.getAttribute("target"),ot=w!==void 0?w:$;if(!S&&!Ko(j)&&!j.defaultPrevented&&(!ot||ot==="_self")&&j.button===0){j.preventDefault(),Hr.flushSync(()=>{r(!0)});const jn=s.subscribe("onResolved",()=>{jn(),r(!1)});s.navigate({...Ee,replace:m,resetScroll:g,hashScrollIntoView:d,startTransition:y,viewTransition:v,ignoreBlocker:A})}};if(Ye)return{...On,ref:o,href:Ye,..._&&{children:_},...w&&{target:w},...S&&{disabled:S},...C&&{style:C},...R&&{className:R},...P&&{onClick:P},...M&&{onFocus:M},...O&&{onMouseEnter:O},...b&&{onMouseLeave:b},...L&&{onTouchStart:L}};const Fn=j=>{S||ae&&Nt()},gi=Fn,vi=j=>{if(!(S||!ae))if(!xs)Nt();else{const $=j.target;if(Oe.has($))return;const ot=setTimeout(()=>{Oe.delete($),Nt()},xs);Oe.set($,ot)}},Si=j=>{if(S||!ae||!xs)return;const $=j.target,ot=Oe.get($);ot&&(clearTimeout(ot),Oe.delete($))},Xe=Cs?Xt(a,{})??Uo:$s,Ze=Cs?$s:Xt(u,{})??$s,An=[R,Xe.className,Ze.className].filter(Boolean).join(" "),Dn=(C||Xe.style||Ze.style)&&{...C,...Xe.style,...Ze.style};return{...On,...Xe,...Ze,href:_t==null?void 0:_t.href,ref:o,onClick:ke([P,yi]),onFocus:ke([M,Fn]),onMouseEnter:ke([O,vi]),onMouseLeave:ke([b,Si]),onTouchStart:ke([L,gi]),disabled:!!S,target:w,...Dn&&{style:Dn},...An&&{className:An},...S&&No,...Cs&&Qo,...n&&$o}}const $s={},Uo={className:"active"},No={role:"link","aria-disabled":!0},Qo={"data-status":"active","aria-current":"page"},$o={"data-transitioning":"transitioning"},Oe=new WeakMap,qo={rootMargin:"100px"},ke=t=>e=>{for(const s of t)if(s){if(e.defaultPrevented)return;s(e)}},Vr=T.forwardRef((t,e)=>{const{_asChild:s,...n}=t,{type:r,ref:i,...o}=Bo(n,e),a=typeof n.children=="function"?n.children({isActive:o["data-status"]==="active"}):n.children;return s===void 0&&delete o.disabled,T.createElement(s||"a",{...o,ref:i},a)});function Ko(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}class zo extends Kr{constructor(e){super(e),this.useMatch=s=>mt({select:s==null?void 0:s.select,from:this.id,structuralSharing:s==null?void 0:s.structuralSharing}),this.useRouteContext=s=>mt({...s,from:this.id,select:n=>s!=null&&s.select?s.select(n.context):n.context}),this.useSearch=s=>Pn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.id}),this.useParams=s=>wn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.id}),this.useLoaderDeps=s=>bn({...s,from:this.id}),this.useLoaderData=s=>Rn({...s,from:this.id}),this.useNavigate=()=>_n({from:this.fullPath}),this.Link=_e.forwardRef((s,n)=>I.jsx(Vr,{ref:n,from:this.fullPath,...s})),this.$$typeof=Symbol.for("react.memo")}}function Ho(t){return new zo(t)}class Vo extends Po{constructor(e){super(e),this.useMatch=s=>mt({select:s==null?void 0:s.select,from:this.id,structuralSharing:s==null?void 0:s.structuralSharing}),this.useRouteContext=s=>mt({...s,from:this.id,select:n=>s!=null&&s.select?s.select(n.context):n.context}),this.useSearch=s=>Pn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.id}),this.useParams=s=>wn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.id}),this.useLoaderDeps=s=>bn({...s,from:this.id}),this.useLoaderData=s=>Rn({...s,from:this.id}),this.useNavigate=()=>_n({from:this.fullPath}),this.Link=_e.forwardRef((s,n)=>I.jsx(Vr,{ref:n,from:this.fullPath,...s})),this.$$typeof=Symbol.for("react.memo")}}function ja(t){return new Vo(t)}function sr(t){return typeof t=="object"?new nr(t,{silent:!0}).createRoute(t):new nr(t,{silent:!0}).createRoute}class nr{constructor(e,s){this.path=e,this.createRoute=n=>{this.silent;const r=Ho(n);return r.isRoot=!1,r},this.silent=s==null?void 0:s.silent}}class rr{constructor(e){this.useMatch=s=>mt({select:s==null?void 0:s.select,from:this.options.id,structuralSharing:s==null?void 0:s.structuralSharing}),this.useRouteContext=s=>mt({from:this.options.id,select:n=>s!=null&&s.select?s.select(n.context):n.context}),this.useSearch=s=>Pn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.options.id}),this.useParams=s=>wn({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.options.id}),this.useLoaderDeps=s=>bn({...s,from:this.options.id}),this.useLoaderData=s=>Rn({...s,from:this.options.id}),this.useNavigate=()=>{const s=Z();return _n({from:s.routesById[this.options.id].fullPath})},this.options=e,this.$$typeof=Symbol.for("react.memo")}}function ir(t){return typeof t=="object"?new rr(t):e=>new rr({id:t,...e})}function Wo(){const t=Z(),e=T.useRef({router:t,mounted:!1}),[s,n]=T.useState(!1),{hasPendingMatches:r,isLoading:i}=J({select:c=>({isLoading:c.isLoading,hasPendingMatches:c.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),o=Qs(i),a=i||s||r,u=Qs(a),h=i||r,p=Qs(h);return t.startTransition=c=>{n(!0),T.startTransition(()=>{c(),n(!1)})},T.useEffect(()=>{const c=t.history.subscribe(t.load),f=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return te(t.latestLocation.href)!==te(f.href)&&t.commitLocation({...f,replace:!0}),()=>{c()}},[t,t.history]),rs(()=>{if(typeof window<"u"&&t.ssr||e.current.router===t&&e.current.mounted)return;e.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(f){console.error(f)}})()},[t]),rs(()=>{o&&!i&&t.emit({type:"onLoad",...ee(t.state)})},[o,t,i]),rs(()=>{p&&!h&&t.emit({type:"onBeforeRouteMount",...ee(t.state)})},[h,p,t]),rs(()=>{if(u&&!a){const c=ee(t.state);t.emit({type:"onResolved",...c}),t.__store.setState(f=>({...f,status:"idle",resolvedLocation:f.location})),c.hrefChanged&&eo(t)}},[a,u,t]),null}function Go(t){const e=J({select:s=>`not-found-${s.location.pathname}-${s.status}`});return I.jsx(Sn,{getResetKey:()=>e,onCatch:(s,n)=>{var r;if(rt(s))(r=t.onCatch)==null||r.call(t,s,n);else throw s},errorComponent:({error:s})=>{var n;if(rt(s))return(n=t.fallback)==null?void 0:n.call(t,s);throw s},children:t.children})}function Jo(){return I.jsx("p",{children:"Not Found"})}function ce(t){return I.jsx(I.Fragment,{children:t.children})}function Wr(t,e,s){return e.options.notFoundComponent?I.jsx(e.options.notFoundComponent,{...s}):t.options.defaultNotFoundComponent?I.jsx(t.options.defaultNotFoundComponent,{...s}):I.jsx(Jo,{})}function Yo({children:t}){var s;const e=Z();return e.isServer?I.jsx("script",{nonce:(s=e.options.ssr)==null?void 0:s.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:t+';typeof $_TSR !== "undefined" && $_TSR.c()'}}):null}function Xo(){const t=Z();if(!t.isScrollRestoring||!t.isServer||typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return null;const s=(t.options.getScrollRestorationKey||Ks)(t.latestLocation),n=s!==Ks(t.latestLocation)?s:void 0,r={storageKey:ys,shouldScrollRestoration:!0};return n&&(r.key=n),I.jsx(Yo,{children:`(${Fr.toString()})(${JSON.stringify(r)})`})}const Gr=T.memo(function({matchId:e}){var v,_;const s=Z(),n=J({select:w=>{const S=w.matches.find(C=>C.id===e);return Pt(S),{routeId:S.routeId,ssr:S.ssr,_displayPending:S._displayPending}},structuralSharing:!0}),r=s.routesById[n.routeId],i=r.options.pendingComponent??s.options.defaultPendingComponent,o=i?I.jsx(i,{}):null,a=r.options.errorComponent??s.options.defaultErrorComponent,u=r.options.onCatch??s.options.defaultOnCatch,h=r.isRoot?r.options.notFoundComponent??((v=s.options.notFoundRoute)==null?void 0:v.options.component):r.options.notFoundComponent,p=n.ssr===!1||n.ssr==="data-only",c=(!r.isRoot||r.options.wrapInSuspense||p)&&(r.options.wrapInSuspense??i??(((_=r.options.errorComponent)==null?void 0:_.preload)||p))?T.Suspense:ce,f=a?Sn:ce,d=h?Go:ce,m=J({select:w=>w.loadedAt}),y=J({select:w=>{var C;const S=w.matches.findIndex(R=>R.id===e);return(C=w.matches[S-1])==null?void 0:C.routeId}}),g=r.isRoot?r.options.shellComponent??ce:ce;return I.jsxs(g,{children:[I.jsx(_s.Provider,{value:e,children:I.jsx(c,{fallback:o,children:I.jsx(f,{getResetKey:()=>m,errorComponent:a||Ps,onCatch:(w,S)=>{if(rt(w))throw w;u==null||u(w,S)},children:I.jsx(d,{fallback:w=>{if(!h||w.routeId&&w.routeId!==n.routeId||!w.routeId&&!r.isRoot)throw w;return T.createElement(h,w)},children:p||n._displayPending?I.jsx(xo,{fallback:o,children:I.jsx(or,{matchId:e})}):I.jsx(or,{matchId:e})})})})}),y===X&&s.options.scrollRestoration?I.jsxs(I.Fragment,{children:[I.jsx(Zo,{}),I.jsx(Xo,{})]}):null]})});function Zo(){const t=Z(),e=T.useRef(void 0);return I.jsx("script",{suppressHydrationWarning:!0,ref:s=>{s&&(e.current===void 0||e.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...ee(t.state)}),e.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}const or=T.memo(function({matchId:e}){var u,h,p,c;const s=Z(),{match:n,key:r,routeId:i}=J({select:f=>{const d=f.matches.find(_=>_.id===e),m=d.routeId,y=s.routesById[m].options.remountDeps??s.options.defaultRemountDeps,g=y==null?void 0:y({routeId:m,loaderDeps:d.loaderDeps,params:d._strictParams,search:d._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:m,match:{id:d.id,status:d.status,error:d.error,_forcePending:d._forcePending,_displayPending:d._displayPending}}},structuralSharing:!0}),o=s.routesById[i],a=T.useMemo(()=>{const f=o.options.component??s.options.defaultComponent;return f?I.jsx(f,{},r):I.jsx(ta,{})},[r,o.options.component,s.options.defaultComponent]);if(n._displayPending)throw(u=s.getMatch(n.id))==null?void 0:u._nonReactive.displayPendingPromise;if(n._forcePending)throw(h=s.getMatch(n.id))==null?void 0:h._nonReactive.minPendingPromise;if(n.status==="pending"){const f=o.options.pendingMinMs??s.options.defaultPendingMinMs;if(f){const d=s.getMatch(n.id);if(d&&!d._nonReactive.minPendingPromise&&!s.isServer){const m=xe();d._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),d._nonReactive.minPendingPromise=void 0},f)}}throw(p=s.getMatch(n.id))==null?void 0:p._nonReactive.loadPromise}if(n.status==="notFound")return Pt(rt(n.error)),Wr(s,o,n.error);if(n.status==="redirected")throw Pt(ut(n.error)),(c=s.getMatch(n.id))==null?void 0:c._nonReactive.loadPromise;if(n.status==="error"){if(s.isServer){const f=(o.options.errorComponent??s.options.defaultErrorComponent)||Ps;return I.jsx(f,{error:n.error,reset:void 0,info:{componentStack:""}})}throw n.error}return a}),ta=T.memo(function(){const e=Z(),s=T.useContext(_s),n=J({select:h=>{var p;return(p=h.matches.find(c=>c.id===s))==null?void 0:p.routeId}}),r=e.routesById[n],i=J({select:h=>{const c=h.matches.find(f=>f.id===s);return Pt(c),c.globalNotFound}}),o=J({select:h=>{var f;const p=h.matches,c=p.findIndex(d=>d.id===s);return(f=p[c+1])==null?void 0:f.id}}),a=e.options.defaultPendingComponent?I.jsx(e.options.defaultPendingComponent,{}):null;if(i)return Wr(e,r,void 0);if(!o)return null;const u=I.jsx(Gr,{matchId:o});return n===X?I.jsx(T.Suspense,{fallback:a,children:u}):u});function ea(){const t=Z(),s=t.routesById[X].options.pendingComponent??t.options.defaultPendingComponent,n=s?I.jsx(s,{}):null,r=t.isServer||typeof document<"u"&&t.ssr?ce:T.Suspense,i=I.jsxs(r,{fallback:n,children:[!t.isServer&&I.jsx(Wo,{}),I.jsx(sa,{})]});return t.options.InnerWrap?I.jsx(t.options.InnerWrap,{children:i}):i}function sa(){const t=Z(),e=J({select:r=>{var i;return(i=r.matches[0])==null?void 0:i.id}}),s=J({select:r=>r.loadedAt}),n=e?I.jsx(Gr,{matchId:e}):null;return I.jsx(_s.Provider,{value:e,children:t.options.disableGlobalCatchBoundary?n:I.jsx(Sn,{getResetKey:()=>s,errorComponent:Ps,onCatch:r=>{r.message||r.toString()},children:n})})}const Ba=t=>new na(t);class na extends go{constructor(e){super(e)}}typeof globalThis<"u"?(globalThis.createFileRoute=sr,globalThis.createLazyFileRoute=ir):typeof window<"u"&&(window.createFileRoute=sr,window.createLazyFileRoute=ir);function ra({router:t,children:e,...s}){Object.keys(s).length>0&&t.update({...t.options,...s,context:{...t.options.context,...s.context}});const n=zr(),r=I.jsx(n.Provider,{value:t,children:e});return t.options.Wrap?I.jsx(t.options.Wrap,{children:r}):r}function Ua({router:t,...e}){return I.jsx(ra,{router:t,...e,children:I.jsx(ea,{})})}var oe=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ia={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Ct,fn,vr,oa=(vr=class{constructor(){E(this,Ct,ia);E(this,fn,!1)}setTimeoutProvider(t){x(this,Ct,t)}setTimeout(t,e){return l(this,Ct).setTimeout(t,e)}clearTimeout(t){l(this,Ct).clearTimeout(t)}setInterval(t,e){return l(this,Ct).setInterval(t,e)}clearInterval(t){l(this,Ct).clearInterval(t)}},Ct=new WeakMap,fn=new WeakMap,vr),$t=new oa;function aa(t){setTimeout(t,0)}var re=typeof window>"u"||"Deno"in globalThis;function K(){}function ca(t,e){return typeof t=="function"?t(e):t}function Hs(t){return typeof t=="number"&&t>=0&&t!==1/0}function Jr(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Ut(t,e){return typeof t=="function"?t(e):t}function nt(t,e){return typeof t=="function"?t(e):t}function ar(t,e){const{type:s="all",exact:n,fetchStatus:r,predicate:i,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==xn(o,e.options))return!1}else if(!Qe(e.queryKey,o))return!1}if(s!=="all"){const u=e.isActive();if(s==="active"&&!u||s==="inactive"&&u)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||r&&r!==e.state.fetchStatus||i&&!i(e))}function cr(t,e){const{exact:s,status:n,predicate:r,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(s){if(ie(e.options.mutationKey)!==ie(i))return!1}else if(!Qe(e.options.mutationKey,i))return!1}return!(n&&e.state.status!==n||r&&!r(e))}function xn(t,e){return((e==null?void 0:e.queryKeyHashFn)||ie)(t)}function ie(t){return JSON.stringify(t,(e,s)=>Vs(s)?Object.keys(s).sort().reduce((n,r)=>(n[r]=s[r],n),{}):s)}function Qe(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(s=>Qe(t[s],e[s])):!1}var ua=Object.prototype.hasOwnProperty;function Cn(t,e){if(t===e)return t;const s=ur(t)&&ur(e);if(!s&&!(Vs(t)&&Vs(e)))return e;const r=(s?t:Object.keys(t)).length,i=s?e:Object.keys(e),o=i.length,a=s?new Array(o):{};let u=0;for(let h=0;h<o;h++){const p=s?h:i[h],c=t[p],f=e[p];if(c===f){a[p]=c,(s?h<r:ua.call(t,p))&&u++;continue}if(c===null||f===null||typeof c!="object"||typeof f!="object"){a[p]=f;continue}const d=Cn(c,f);a[p]=d,d===c&&u++}return r===o&&u===r?t:a}function $e(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function ur(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Vs(t){if(!lr(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!lr(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function lr(t){return Object.prototype.toString.call(t)==="[object Object]"}function la(t){return new Promise(e=>{$t.setTimeout(e,t)})}function Ws(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?Cn(t,e):e}function ha(t,e,s=0){const n=[...t,e];return s&&n.length>s?n.slice(1):n}function da(t,e,s=0){const n=[e,...t];return s&&n.length>s?n.slice(0,-1):n}var Mn=Symbol();function Yr(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Mn?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Xr(t,e){return typeof t=="function"?t(...e):!!t}var qt,Mt,ue,Sr,fa=(Sr=class extends oe{constructor(){super();E(this,qt);E(this,Mt);E(this,ue);x(this,ue,e=>{if(!re&&window.addEventListener){const s=()=>e();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){l(this,Mt)||this.setEventListener(l(this,ue))}onUnsubscribe(){var e;this.hasListeners()||((e=l(this,Mt))==null||e.call(this),x(this,Mt,void 0))}setEventListener(e){var s;x(this,ue,e),(s=l(this,Mt))==null||s.call(this),x(this,Mt,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){l(this,qt)!==e&&(x(this,qt,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(s=>{s(e)})}isFocused(){var e;return typeof l(this,qt)=="boolean"?l(this,qt):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},qt=new WeakMap,Mt=new WeakMap,ue=new WeakMap,Sr),Ln=new fa;function Gs(){let t,e;const s=new Promise((r,i)=>{t=r,e=i});s.status="pending",s.catch(()=>{});function n(r){Object.assign(s,r),delete s.resolve,delete s.reject}return s.resolve=r=>{n({status:"fulfilled",value:r}),t(r)},s.reject=r=>{n({status:"rejected",reason:r}),e(r)},s}var pa=aa;function ma(){let t=[],e=0,s=a=>{a()},n=a=>{a()},r=pa;const i=a=>{e?t.push(a):r(()=>{s(a)})},o=()=>{const a=t;t=[],a.length&&r(()=>{n(()=>{a.forEach(u=>{s(u)})})})};return{batch:a=>{let u;e++;try{u=a()}finally{e--,e||o()}return u},batchCalls:a=>(...u)=>{i(()=>{a(...u)})},schedule:i,setNotifyFunction:a=>{s=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{r=a}}}var N=ma(),le,Lt,he,Rr,ya=(Rr=class extends oe{constructor(){super();E(this,le,!0);E(this,Lt);E(this,he);x(this,he,e=>{if(!re&&window.addEventListener){const s=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",n)}}})}onSubscribe(){l(this,Lt)||this.setEventListener(l(this,he))}onUnsubscribe(){var e;this.hasListeners()||((e=l(this,Lt))==null||e.call(this),x(this,Lt,void 0))}setEventListener(e){var s;x(this,he,e),(s=l(this,Lt))==null||s.call(this),x(this,Lt,e(this.setOnline.bind(this)))}setOnline(e){l(this,le)!==e&&(x(this,le,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return l(this,le)}},le=new WeakMap,Lt=new WeakMap,he=new WeakMap,Rr),Ss=new ya;function ga(t){return Math.min(1e3*2**t,3e4)}function Zr(t){return(t??"online")==="online"?Ss.isOnline():!0}var Js=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function ti(t){let e=!1,s=0,n;const r=Gs(),i=()=>r.status!=="pending",o=y=>{var g;if(!i()){const v=new Js(y);f(v),(g=t.onCancel)==null||g.call(t,v)}},a=()=>{e=!0},u=()=>{e=!1},h=()=>Ln.isFocused()&&(t.networkMode==="always"||Ss.isOnline())&&t.canRun(),p=()=>Zr(t.networkMode)&&t.canRun(),c=y=>{i()||(n==null||n(),r.resolve(y))},f=y=>{i()||(n==null||n(),r.reject(y))},d=()=>new Promise(y=>{var g;n=v=>{(i()||h())&&y(v)},(g=t.onPause)==null||g.call(t)}).then(()=>{var y;n=void 0,i()||(y=t.onContinue)==null||y.call(t)}),m=()=>{if(i())return;let y;const g=s===0?t.initialPromise:void 0;try{y=g??t.fn()}catch(v){y=Promise.reject(v)}Promise.resolve(y).then(c).catch(v=>{var R;if(i())return;const _=t.retry??(re?0:3),w=t.retryDelay??ga,S=typeof w=="function"?w(s,v):w,C=_===!0||typeof _=="number"&&s<_||typeof _=="function"&&_(s,v);if(e||!C){f(v);return}s++,(R=t.onFail)==null||R.call(t,s,v),la(S).then(()=>h()?void 0:d()).then(()=>{e?f(v):m()})})};return{promise:r,status:()=>r.status,cancel:o,continue:()=>(n==null||n(),r),cancelRetry:a,continueRetry:u,canStart:p,start:()=>(p()?m():d().then(m),r)}}var Kt,br,ei=(br=class{constructor(){E(this,Kt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Hs(this.gcTime)&&x(this,Kt,$t.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(re?1/0:300*1e3))}clearGcTimeout(){l(this,Kt)&&($t.clearTimeout(l(this,Kt)),x(this,Kt,void 0))}},Kt=new WeakMap,br),zt,de,et,Ht,Q,qe,Vt,at,gt,wr,va=(wr=class extends ei{constructor(e){super();E(this,at);E(this,zt);E(this,de);E(this,et);E(this,Ht);E(this,Q);E(this,qe);E(this,Vt);x(this,Vt,!1),x(this,qe,e.defaultOptions),this.setOptions(e.options),this.observers=[],x(this,Ht,e.client),x(this,et,l(this,Ht).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,x(this,zt,dr(this.options)),this.state=e.state??l(this,zt),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=l(this,Q))==null?void 0:e.promise}setOptions(e){if(this.options={...l(this,qe),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=dr(this.options);s.data!==void 0&&(this.setState(hr(s.data,s.dataUpdatedAt)),x(this,zt,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&l(this,et).remove(this)}setData(e,s){const n=Ws(this.state.data,e,this.options);return k(this,at,gt).call(this,{data:n,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),n}setState(e,s){k(this,at,gt).call(this,{type:"setState",state:e,setStateOptions:s})}cancel(e){var n,r;const s=(n=l(this,Q))==null?void 0:n.promise;return(r=l(this,Q))==null||r.cancel(e),s?s.then(K).catch(K):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(l(this,zt))}isActive(){return this.observers.some(e=>nt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Mn||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ut(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Jr(this.state.dataUpdatedAt,e)}onFocus(){var s;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(s=l(this,Q))==null||s.continue()}onOnline(){var s;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(s=l(this,Q))==null||s.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),l(this,et).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(s=>s!==e),this.observers.length||(l(this,Q)&&(l(this,Vt)?l(this,Q).cancel({revert:!0}):l(this,Q).cancelRetry()),this.scheduleGc()),l(this,et).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||k(this,at,gt).call(this,{type:"invalidate"})}async fetch(e,s){var u,h,p,c,f,d,m,y,g,v,_,w;if(this.state.fetchStatus!=="idle"&&((u=l(this,Q))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(l(this,Q))return l(this,Q).continueRetry(),l(this,Q).promise}if(e&&this.setOptions(e),!this.options.queryFn){const S=this.observers.find(C=>C.options.queryFn);S&&this.setOptions(S.options)}const n=new AbortController,r=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(x(this,Vt,!0),n.signal)})},i=()=>{const S=Yr(this.options,s),R=(()=>{const P={client:l(this,Ht),queryKey:this.queryKey,meta:this.meta};return r(P),P})();return x(this,Vt,!1),this.options.persister?this.options.persister(S,R,this):S(R)},a=(()=>{const S={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:l(this,Ht),state:this.state,fetchFn:i};return r(S),S})();(h=this.options.behavior)==null||h.onFetch(a,this),x(this,de,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=a.fetchOptions)==null?void 0:p.meta))&&k(this,at,gt).call(this,{type:"fetch",meta:(c=a.fetchOptions)==null?void 0:c.meta}),x(this,Q,ti({initialPromise:s==null?void 0:s.initialPromise,fn:a.fetchFn,onCancel:S=>{S instanceof Js&&S.revert&&this.setState({...l(this,de),fetchStatus:"idle"}),n.abort()},onFail:(S,C)=>{k(this,at,gt).call(this,{type:"failed",failureCount:S,error:C})},onPause:()=>{k(this,at,gt).call(this,{type:"pause"})},onContinue:()=>{k(this,at,gt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const S=await l(this,Q).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(d=(f=l(this,et).config).onSuccess)==null||d.call(f,S,this),(y=(m=l(this,et).config).onSettled)==null||y.call(m,S,this.state.error,this),S}catch(S){if(S instanceof Js){if(S.silent)return l(this,Q).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw k(this,at,gt).call(this,{type:"error",error:S}),(v=(g=l(this,et).config).onError)==null||v.call(g,S,this),(w=(_=l(this,et).config).onSettled)==null||w.call(_,this.state.data,S,this),S}finally{this.scheduleGc()}}},zt=new WeakMap,de=new WeakMap,et=new WeakMap,Ht=new WeakMap,Q=new WeakMap,qe=new WeakMap,Vt=new WeakMap,at=new WeakSet,gt=function(e){const s=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...si(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...hr(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return x(this,de,e.manual?r:void 0),r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=s(this.state),N.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),l(this,et).notify({query:this,type:"updated",action:e})})},wr);function si(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Zr(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function hr(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function dr(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,n=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var W,F,Ke,z,Wt,fe,vt,Et,ze,pe,me,Gt,Jt,Tt,ye,D,Ae,Ys,Xs,Zs,tn,en,sn,nn,ni,Pr,En=(Pr=class extends oe{constructor(e,s){super();E(this,D);E(this,W);E(this,F);E(this,Ke);E(this,z);E(this,Wt);E(this,fe);E(this,vt);E(this,Et);E(this,ze);E(this,pe);E(this,me);E(this,Gt);E(this,Jt);E(this,Tt);E(this,ye,new Set);this.options=s,x(this,W,e),x(this,Et,null),x(this,vt,Gs()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(l(this,F).addObserver(this),fr(l(this,F),this.options)?k(this,D,Ae).call(this):this.updateResult(),k(this,D,tn).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return rn(l(this,F),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return rn(l(this,F),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,k(this,D,en).call(this),k(this,D,sn).call(this),l(this,F).removeObserver(this)}setOptions(e){const s=this.options,n=l(this,F);if(this.options=l(this,W).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof nt(this.options.enabled,l(this,F))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");k(this,D,nn).call(this),l(this,F).setOptions(this.options),s._defaulted&&!$e(this.options,s)&&l(this,W).getQueryCache().notify({type:"observerOptionsUpdated",query:l(this,F),observer:this});const r=this.hasListeners();r&&pr(l(this,F),n,this.options,s)&&k(this,D,Ae).call(this),this.updateResult(),r&&(l(this,F)!==n||nt(this.options.enabled,l(this,F))!==nt(s.enabled,l(this,F))||Ut(this.options.staleTime,l(this,F))!==Ut(s.staleTime,l(this,F)))&&k(this,D,Ys).call(this);const i=k(this,D,Xs).call(this);r&&(l(this,F)!==n||nt(this.options.enabled,l(this,F))!==nt(s.enabled,l(this,F))||i!==l(this,Tt))&&k(this,D,Zs).call(this,i)}getOptimisticResult(e){const s=l(this,W).getQueryCache().build(l(this,W),e),n=this.createResult(s,e);return Ra(this,n)&&(x(this,z,n),x(this,fe,this.options),x(this,Wt,l(this,F).state)),n}getCurrentResult(){return l(this,z)}trackResult(e,s){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),s==null||s(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&l(this,vt).status==="pending"&&l(this,vt).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){l(this,ye).add(e)}getCurrentQuery(){return l(this,F)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const s=l(this,W).defaultQueryOptions(e),n=l(this,W).getQueryCache().build(l(this,W),s);return n.fetch().then(()=>this.createResult(n,s))}fetch(e){return k(this,D,Ae).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),l(this,z)))}createResult(e,s){var O;const n=l(this,F),r=this.options,i=l(this,z),o=l(this,Wt),a=l(this,fe),h=e!==n?e.state:l(this,Ke),{state:p}=e;let c={...p},f=!1,d;if(s._optimisticResults){const b=this.hasListeners(),L=!b&&fr(e,s),A=b&&pr(e,n,s,r);(L||A)&&(c={...c,...si(p.data,e.options)}),s._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:m,errorUpdatedAt:y,status:g}=c;d=c.data;let v=!1;if(s.placeholderData!==void 0&&d===void 0&&g==="pending"){let b;i!=null&&i.isPlaceholderData&&s.placeholderData===(a==null?void 0:a.placeholderData)?(b=i.data,v=!0):b=typeof s.placeholderData=="function"?s.placeholderData((O=l(this,me))==null?void 0:O.state.data,l(this,me)):s.placeholderData,b!==void 0&&(g="success",d=Ws(i==null?void 0:i.data,b,s),f=!0)}if(s.select&&d!==void 0&&!v)if(i&&d===(o==null?void 0:o.data)&&s.select===l(this,ze))d=l(this,pe);else try{x(this,ze,s.select),d=s.select(d),d=Ws(i==null?void 0:i.data,d,s),x(this,pe,d),x(this,Et,null)}catch(b){x(this,Et,b)}l(this,Et)&&(m=l(this,Et),d=l(this,pe),y=Date.now(),g="error");const _=c.fetchStatus==="fetching",w=g==="pending",S=g==="error",C=w&&_,R=d!==void 0,M={status:g,fetchStatus:c.fetchStatus,isPending:w,isSuccess:g==="success",isError:S,isInitialLoading:C,isLoading:C,data:d,dataUpdatedAt:c.dataUpdatedAt,error:m,errorUpdatedAt:y,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>h.dataUpdateCount||c.errorUpdateCount>h.errorUpdateCount,isFetching:_,isRefetching:_&&!w,isLoadingError:S&&!R,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&R,isStale:Tn(e,s),refetch:this.refetch,promise:l(this,vt),isEnabled:nt(s.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const b=B=>{M.status==="error"?B.reject(M.error):M.data!==void 0&&B.resolve(M.data)},L=()=>{const B=x(this,vt,M.promise=Gs());b(B)},A=l(this,vt);switch(A.status){case"pending":e.queryHash===n.queryHash&&b(A);break;case"fulfilled":(M.status==="error"||M.data!==A.value)&&L();break;case"rejected":(M.status!=="error"||M.error!==A.reason)&&L();break}}return M}updateResult(){const e=l(this,z),s=this.createResult(l(this,F),this.options);if(x(this,Wt,l(this,F).state),x(this,fe,this.options),l(this,Wt).data!==void 0&&x(this,me,l(this,F)),$e(s,e))return;x(this,z,s);const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!l(this,ye).size)return!0;const o=new Set(i??l(this,ye));return this.options.throwOnError&&o.add("error"),Object.keys(l(this,z)).some(a=>{const u=a;return l(this,z)[u]!==e[u]&&o.has(u)})};k(this,D,ni).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&k(this,D,tn).call(this)}},W=new WeakMap,F=new WeakMap,Ke=new WeakMap,z=new WeakMap,Wt=new WeakMap,fe=new WeakMap,vt=new WeakMap,Et=new WeakMap,ze=new WeakMap,pe=new WeakMap,me=new WeakMap,Gt=new WeakMap,Jt=new WeakMap,Tt=new WeakMap,ye=new WeakMap,D=new WeakSet,Ae=function(e){k(this,D,nn).call(this);let s=l(this,F).fetch(this.options,e);return e!=null&&e.throwOnError||(s=s.catch(K)),s},Ys=function(){k(this,D,en).call(this);const e=Ut(this.options.staleTime,l(this,F));if(re||l(this,z).isStale||!Hs(e))return;const n=Jr(l(this,z).dataUpdatedAt,e)+1;x(this,Gt,$t.setTimeout(()=>{l(this,z).isStale||this.updateResult()},n))},Xs=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(l(this,F)):this.options.refetchInterval)??!1},Zs=function(e){k(this,D,sn).call(this),x(this,Tt,e),!(re||nt(this.options.enabled,l(this,F))===!1||!Hs(l(this,Tt))||l(this,Tt)===0)&&x(this,Jt,$t.setInterval(()=>{(this.options.refetchIntervalInBackground||Ln.isFocused())&&k(this,D,Ae).call(this)},l(this,Tt)))},tn=function(){k(this,D,Ys).call(this),k(this,D,Zs).call(this,k(this,D,Xs).call(this))},en=function(){l(this,Gt)&&($t.clearTimeout(l(this,Gt)),x(this,Gt,void 0))},sn=function(){l(this,Jt)&&($t.clearInterval(l(this,Jt)),x(this,Jt,void 0))},nn=function(){const e=l(this,W).getQueryCache().build(l(this,W),this.options);if(e===l(this,F))return;const s=l(this,F);x(this,F,e),x(this,Ke,e.state),this.hasListeners()&&(s==null||s.removeObserver(this),e.addObserver(this))},ni=function(e){N.batch(()=>{e.listeners&&this.listeners.forEach(s=>{s(l(this,z))}),l(this,W).getQueryCache().notify({query:l(this,F),type:"observerResultsUpdated"})})},Pr);function Sa(t,e){return nt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function fr(t,e){return Sa(t,e)||t.state.data!==void 0&&rn(t,e,e.refetchOnMount)}function rn(t,e,s){if(nt(e.enabled,t)!==!1&&Ut(e.staleTime,t)!=="static"){const n=typeof s=="function"?s(t):s;return n==="always"||n!==!1&&Tn(t,e)}return!1}function pr(t,e,s,n){return(t!==e||nt(n.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&Tn(t,s)}function Tn(t,e){return nt(e.enabled,t)!==!1&&t.isStaleByTime(Ut(e.staleTime,t))}function Ra(t,e){return!$e(t.getCurrentResult(),e)}function mr(t){return{onFetch:(e,s)=>{var p,c,f,d,m;const n=e.options,r=(f=(c=(p=e.fetchOptions)==null?void 0:p.meta)==null?void 0:c.fetchMore)==null?void 0:f.direction,i=((d=e.state.data)==null?void 0:d.pages)||[],o=((m=e.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},u=0;const h=async()=>{let y=!1;const g=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(e.signal.aborted?y=!0:e.signal.addEventListener("abort",()=>{y=!0}),e.signal)})},v=Yr(e.options,e.fetchOptions),_=async(w,S,C)=>{if(y)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const P=(()=>{const L={client:e.client,queryKey:e.queryKey,pageParam:S,direction:C?"backward":"forward",meta:e.options.meta};return g(L),L})(),M=await v(P),{maxPages:O}=e.options,b=C?da:ha;return{pages:b(w.pages,M,O),pageParams:b(w.pageParams,S,O)}};if(r&&i.length){const w=r==="backward",S=w?ba:yr,C={pages:i,pageParams:o},R=S(n,C);a=await _(C,R,w)}else{const w=t??i.length;do{const S=u===0?o[0]??n.initialPageParam:yr(n,a);if(u>0&&S==null)break;a=await _(a,S),u++}while(u<w)}return a};e.options.persister?e.fetchFn=()=>{var y,g;return(g=(y=e.options).persister)==null?void 0:g.call(y,h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s)}:e.fetchFn=h}}}function yr(t,{pages:e,pageParams:s}){const n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,s[n],s):void 0}function ba(t,{pages:e,pageParams:s}){var n;return e.length>0?(n=t.getPreviousPageParam)==null?void 0:n.call(t,e[0],e,s[0],s):void 0}var He,dt,H,Yt,ft,xt,_r,wa=(_r=class extends ei{constructor(e){super();E(this,ft);E(this,He);E(this,dt);E(this,H);E(this,Yt);x(this,He,e.client),this.mutationId=e.mutationId,x(this,H,e.mutationCache),x(this,dt,[]),this.state=e.state||ri(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){l(this,dt).includes(e)||(l(this,dt).push(e),this.clearGcTimeout(),l(this,H).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){x(this,dt,l(this,dt).filter(s=>s!==e)),this.scheduleGc(),l(this,H).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){l(this,dt).length||(this.state.status==="pending"?this.scheduleGc():l(this,H).remove(this))}continue(){var e;return((e=l(this,Yt))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,u,h,p,c,f,d,m,y,g,v,_,w,S,C,R,P,M,O;const s=()=>{k(this,ft,xt).call(this,{type:"continue"})},n={client:l(this,He),meta:this.options.meta,mutationKey:this.options.mutationKey};x(this,Yt,ti({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(b,L)=>{k(this,ft,xt).call(this,{type:"failed",failureCount:b,error:L})},onPause:()=>{k(this,ft,xt).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>l(this,H).canRun(this)}));const r=this.state.status==="pending",i=!l(this,Yt).canStart();try{if(r)s();else{k(this,ft,xt).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(o=l(this,H).config).onMutate)==null?void 0:a.call(o,e,this,n));const L=await((h=(u=this.options).onMutate)==null?void 0:h.call(u,e,n));L!==this.state.context&&k(this,ft,xt).call(this,{type:"pending",context:L,variables:e,isPaused:i})}const b=await l(this,Yt).start();return await((c=(p=l(this,H).config).onSuccess)==null?void 0:c.call(p,b,e,this.state.context,this,n)),await((d=(f=this.options).onSuccess)==null?void 0:d.call(f,b,e,this.state.context,n)),await((y=(m=l(this,H).config).onSettled)==null?void 0:y.call(m,b,null,this.state.variables,this.state.context,this,n)),await((v=(g=this.options).onSettled)==null?void 0:v.call(g,b,null,e,this.state.context,n)),k(this,ft,xt).call(this,{type:"success",data:b}),b}catch(b){try{throw await((w=(_=l(this,H).config).onError)==null?void 0:w.call(_,b,e,this.state.context,this,n)),await((C=(S=this.options).onError)==null?void 0:C.call(S,b,e,this.state.context,n)),await((P=(R=l(this,H).config).onSettled)==null?void 0:P.call(R,void 0,b,this.state.variables,this.state.context,this,n)),await((O=(M=this.options).onSettled)==null?void 0:O.call(M,void 0,b,e,this.state.context,n)),b}finally{k(this,ft,xt).call(this,{type:"error",error:b})}}finally{l(this,H).runNext(this)}}},He=new WeakMap,dt=new WeakMap,H=new WeakMap,Yt=new WeakMap,ft=new WeakSet,xt=function(e){const s=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=s(this.state),N.batch(()=>{l(this,dt).forEach(n=>{n.onMutationUpdate(e)}),l(this,H).notify({mutation:this,type:"updated",action:e})})},_r);function ri(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var St,ct,Ve,xr,Pa=(xr=class extends oe{constructor(e={}){super();E(this,St);E(this,ct);E(this,Ve);this.config=e,x(this,St,new Set),x(this,ct,new Map),x(this,Ve,0)}build(e,s,n){const r=new wa({client:e,mutationCache:this,mutationId:++ts(this,Ve)._,options:e.defaultMutationOptions(s),state:n});return this.add(r),r}add(e){l(this,St).add(e);const s=is(e);if(typeof s=="string"){const n=l(this,ct).get(s);n?n.push(e):l(this,ct).set(s,[e])}this.notify({type:"added",mutation:e})}remove(e){if(l(this,St).delete(e)){const s=is(e);if(typeof s=="string"){const n=l(this,ct).get(s);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&l(this,ct).delete(s)}}this.notify({type:"removed",mutation:e})}canRun(e){const s=is(e);if(typeof s=="string"){const n=l(this,ct).get(s),r=n==null?void 0:n.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){var n;const s=is(e);if(typeof s=="string"){const r=(n=l(this,ct).get(s))==null?void 0:n.find(i=>i!==e&&i.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}else return Promise.resolve()}clear(){N.batch(()=>{l(this,St).forEach(e=>{this.notify({type:"removed",mutation:e})}),l(this,St).clear(),l(this,ct).clear()})}getAll(){return Array.from(l(this,St))}find(e){const s={exact:!0,...e};return this.getAll().find(n=>cr(s,n))}findAll(e={}){return this.getAll().filter(s=>cr(e,s))}notify(e){N.batch(()=>{this.listeners.forEach(s=>{s(e)})})}resumePausedMutations(){const e=this.getAll().filter(s=>s.state.isPaused);return N.batch(()=>Promise.all(e.map(s=>s.continue().catch(K))))}},St=new WeakMap,ct=new WeakMap,Ve=new WeakMap,xr);function is(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Rt,It,G,bt,wt,us,on,Cr,_a=(Cr=class extends oe{constructor(e,s){super();E(this,wt);E(this,Rt);E(this,It);E(this,G);E(this,bt);x(this,Rt,e),this.setOptions(s),this.bindMethods(),k(this,wt,us).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var n;const s=this.options;this.options=l(this,Rt).defaultMutationOptions(e),$e(this.options,s)||l(this,Rt).getMutationCache().notify({type:"observerOptionsUpdated",mutation:l(this,G),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&ie(s.mutationKey)!==ie(this.options.mutationKey)?this.reset():((n=l(this,G))==null?void 0:n.state.status)==="pending"&&l(this,G).setOptions(this.options)}onUnsubscribe(){var e;this.hasListeners()||(e=l(this,G))==null||e.removeObserver(this)}onMutationUpdate(e){k(this,wt,us).call(this),k(this,wt,on).call(this,e)}getCurrentResult(){return l(this,It)}reset(){var e;(e=l(this,G))==null||e.removeObserver(this),x(this,G,void 0),k(this,wt,us).call(this),k(this,wt,on).call(this)}mutate(e,s){var n;return x(this,bt,s),(n=l(this,G))==null||n.removeObserver(this),x(this,G,l(this,Rt).getMutationCache().build(l(this,Rt),this.options)),l(this,G).addObserver(this),l(this,G).execute(e)}},Rt=new WeakMap,It=new WeakMap,G=new WeakMap,bt=new WeakMap,wt=new WeakSet,us=function(){var s;const e=((s=l(this,G))==null?void 0:s.state)??ri();x(this,It,{...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset})},on=function(e){N.batch(()=>{var s,n,r,i,o,a,u,h;if(l(this,bt)&&this.hasListeners()){const p=l(this,It).variables,c=l(this,It).context,f={client:l(this,Rt),meta:this.options.meta,mutationKey:this.options.mutationKey};(e==null?void 0:e.type)==="success"?((n=(s=l(this,bt)).onSuccess)==null||n.call(s,e.data,p,c,f),(i=(r=l(this,bt)).onSettled)==null||i.call(r,e.data,null,p,c,f)):(e==null?void 0:e.type)==="error"&&((a=(o=l(this,bt)).onError)==null||a.call(o,e.error,p,c,f),(h=(u=l(this,bt)).onSettled)==null||h.call(u,void 0,e.error,p,c,f))}this.listeners.forEach(p=>{p(l(this,It))})})},Cr);function gr(t,e){const s=new Set(e);return t.filter(n=>!s.has(n))}function xa(t,e,s){const n=t.slice(0);return n[e]=s,n}var ge,Y,ve,Se,st,Ot,We,Ge,Je,q,an,cn,un,ln,hn,Mr,Ca=(Mr=class extends oe{constructor(e,s,n){super();E(this,q);E(this,ge);E(this,Y);E(this,ve);E(this,Se);E(this,st);E(this,Ot);E(this,We);E(this,Ge);E(this,Je,[]);x(this,ge,e),x(this,Se,n),x(this,ve,[]),x(this,st,[]),x(this,Y,[]),this.setQueries(s)}onSubscribe(){this.listeners.size===1&&l(this,st).forEach(e=>{e.subscribe(s=>{k(this,q,ln).call(this,e,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,l(this,st).forEach(e=>{e.destroy()})}setQueries(e,s){x(this,ve,e),x(this,Se,s),N.batch(()=>{const n=l(this,st),r=k(this,q,un).call(this,l(this,ve));x(this,Je,r),r.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions));const i=r.map(c=>c.observer),o=i.map(c=>c.getCurrentResult()),a=n.length!==i.length,u=i.some((c,f)=>c!==n[f]),h=a||u,p=h?!0:o.some((c,f)=>{const d=l(this,Y)[f];return!d||!$e(c,d)});!h&&!p||(h&&x(this,st,i),x(this,Y,o),this.hasListeners()&&(h&&(gr(n,i).forEach(c=>{c.destroy()}),gr(i,n).forEach(c=>{c.subscribe(f=>{k(this,q,ln).call(this,c,f)})})),k(this,q,hn).call(this)))})}getCurrentResult(){return l(this,Y)}getQueries(){return l(this,st).map(e=>e.getCurrentQuery())}getObservers(){return l(this,st)}getOptimisticResult(e,s){const n=k(this,q,un).call(this,e),r=n.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions));return[r,i=>k(this,q,cn).call(this,i??r,s),()=>k(this,q,an).call(this,r,n)]}},ge=new WeakMap,Y=new WeakMap,ve=new WeakMap,Se=new WeakMap,st=new WeakMap,Ot=new WeakMap,We=new WeakMap,Ge=new WeakMap,Je=new WeakMap,q=new WeakSet,an=function(e,s){return s.map((n,r)=>{const i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,o=>{s.forEach(a=>{a.observer.trackProp(o)})})})},cn=function(e,s){return s?((!l(this,Ot)||l(this,Y)!==l(this,Ge)||s!==l(this,We))&&(x(this,We,s),x(this,Ge,l(this,Y)),x(this,Ot,Cn(l(this,Ot),s(e)))),l(this,Ot)):e},un=function(e){const s=new Map(l(this,st).map(r=>[r.options.queryHash,r])),n=[];return e.forEach(r=>{const i=l(this,ge).defaultQueryOptions(r),o=s.get(i.queryHash);o?n.push({defaultedQueryOptions:i,observer:o}):n.push({defaultedQueryOptions:i,observer:new En(l(this,ge),i)})}),n},ln=function(e,s){const n=l(this,st).indexOf(e);n!==-1&&(x(this,Y,xa(l(this,Y),n,s)),k(this,q,hn).call(this))},hn=function(){var e;if(this.hasListeners()){const s=l(this,Ot),n=k(this,q,an).call(this,l(this,Y),l(this,Je)),r=k(this,q,cn).call(this,n,(e=l(this,Se))==null?void 0:e.combine);s!==r&&N.batch(()=>{this.listeners.forEach(i=>{i(l(this,Y))})})}},Mr),pt,Lr,Ma=(Lr=class extends oe{constructor(e={}){super();E(this,pt);this.config=e,x(this,pt,new Map)}build(e,s,n){const r=s.queryKey,i=s.queryHash??xn(r,s);let o=this.get(i);return o||(o=new va({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(s),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){l(this,pt).has(e.queryHash)||(l(this,pt).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const s=l(this,pt).get(e.queryHash);s&&(e.destroy(),s===e&&l(this,pt).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){N.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return l(this,pt).get(e)}getAll(){return[...l(this,pt).values()]}find(e){const s={exact:!0,...e};return this.getAll().find(n=>ar(s,n))}findAll(e={}){const s=this.getAll();return Object.keys(e).length>0?s.filter(n=>ar(e,n)):s}notify(e){N.batch(()=>{this.listeners.forEach(s=>{s(e)})})}onFocus(){N.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){N.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},pt=new WeakMap,Lr),U,kt,Ft,Re,be,At,we,Pe,Er,Na=(Er=class{constructor(t={}){E(this,U);E(this,kt);E(this,Ft);E(this,Re);E(this,be);E(this,At);E(this,we);E(this,Pe);x(this,U,t.queryCache||new Ma),x(this,kt,t.mutationCache||new Pa),x(this,Ft,t.defaultOptions||{}),x(this,Re,new Map),x(this,be,new Map),x(this,At,0)}mount(){ts(this,At)._++,l(this,At)===1&&(x(this,we,Ln.subscribe(async t=>{t&&(await this.resumePausedMutations(),l(this,U).onFocus())})),x(this,Pe,Ss.subscribe(async t=>{t&&(await this.resumePausedMutations(),l(this,U).onOnline())})))}unmount(){var t,e;ts(this,At)._--,l(this,At)===0&&((t=l(this,we))==null||t.call(this),x(this,we,void 0),(e=l(this,Pe))==null||e.call(this),x(this,Pe,void 0))}isFetching(t){return l(this,U).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return l(this,kt).findAll({...t,status:"pending"}).length}getQueryData(t){var s;const e=this.defaultQueryOptions({queryKey:t});return(s=l(this,U).get(e.queryHash))==null?void 0:s.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=l(this,U).build(this,e),n=s.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(Ut(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return l(this,U).findAll(t).map(({queryKey:e,state:s})=>{const n=s.data;return[e,n]})}setQueryData(t,e,s){const n=this.defaultQueryOptions({queryKey:t}),r=l(this,U).get(n.queryHash),i=r==null?void 0:r.state.data,o=ca(e,i);if(o!==void 0)return l(this,U).build(this,n).setData(o,{...s,manual:!0})}setQueriesData(t,e,s){return N.batch(()=>l(this,U).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,s)]))}getQueryState(t){var s;const e=this.defaultQueryOptions({queryKey:t});return(s=l(this,U).get(e.queryHash))==null?void 0:s.state}removeQueries(t){const e=l(this,U);N.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=l(this,U);return N.batch(()=>(s.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},n=N.batch(()=>l(this,U).findAll(t).map(r=>r.cancel(s)));return Promise.all(n).then(K).catch(K)}invalidateQueries(t,e={}){return N.batch(()=>(l(this,U).findAll(t).forEach(s=>{s.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},n=N.batch(()=>l(this,U).findAll(t).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let i=r.fetch(void 0,s);return s.throwOnError||(i=i.catch(K)),r.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(K)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=l(this,U).build(this,e);return s.isStaleByTime(Ut(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(K).catch(K)}fetchInfiniteQuery(t){return t.behavior=mr(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(K).catch(K)}ensureInfiniteQueryData(t){return t.behavior=mr(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ss.isOnline()?l(this,kt).resumePausedMutations():Promise.resolve()}getQueryCache(){return l(this,U)}getMutationCache(){return l(this,kt)}getDefaultOptions(){return l(this,Ft)}setDefaultOptions(t){x(this,Ft,t)}setQueryDefaults(t,e){l(this,Re).set(ie(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...l(this,Re).values()],s={};return e.forEach(n=>{Qe(t,n.queryKey)&&Object.assign(s,n.defaultOptions)}),s}setMutationDefaults(t,e){l(this,be).set(ie(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...l(this,be).values()],s={};return e.forEach(n=>{Qe(t,n.mutationKey)&&Object.assign(s,n.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...l(this,Ft).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=xn(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Mn&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...l(this,Ft).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){l(this,U).clear(),l(this,kt).clear()}},U=new WeakMap,kt=new WeakMap,Ft=new WeakMap,Re=new WeakMap,be=new WeakMap,At=new WeakMap,we=new WeakMap,Pe=new WeakMap,Er),ii=T.createContext(void 0),In=t=>{const e=T.useContext(ii);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Qa=({client:t,children:e})=>(T.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),I.jsx(ii.Provider,{value:t,children:e})),oi=T.createContext(!1),ai=()=>T.useContext(oi);oi.Provider;function La(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Ea=T.createContext(La()),ci=()=>T.useContext(Ea),ui=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},li=t=>{T.useEffect(()=>{t.clearReset()},[t])},hi=({result:t,errorResetBoundary:e,throwOnError:s,query:n,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(r&&t.data===void 0||Xr(s,[t.error,n])),di=t=>{if(t.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...r)=>s(n(...r)):s(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},fi=(t,e)=>t.isLoading&&t.isFetching&&!e,dn=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Rs=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function $a({queries:t,...e},s){const n=In(),r=ai(),i=ci(),o=T.useMemo(()=>t.map(y=>{const g=n.defaultQueryOptions(y);return g._optimisticResults=r?"isRestoring":"optimistic",g}),[t,n,r]);o.forEach(y=>{di(y),ui(y,i)}),li(i);const[a]=T.useState(()=>new Ca(n,o,e)),[u,h,p]=a.getOptimisticResult(o,e.combine),c=!r&&e.subscribed!==!1;T.useSyncExternalStore(T.useCallback(y=>c?a.subscribe(N.batchCalls(y)):K,[a,c]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),T.useEffect(()=>{a.setQueries(o,e)},[o,e,a]);const d=u.some((y,g)=>dn(o[g],y))?u.flatMap((y,g)=>{const v=o[g];if(v){const _=new En(n,v);if(dn(v,y))return Rs(v,_,i);fi(y,r)&&Rs(v,_,i)}return[]}):[];if(d.length>0)throw Promise.all(d);const m=u.find((y,g)=>{const v=o[g];return v&&hi({result:y,errorResetBoundary:i,throwOnError:v.throwOnError,query:n.getQueryCache().get(v.queryHash),suspense:v.suspense})});if(m!=null&&m.error)throw m.error;return h(p())}function Ta(t,e,s){var c,f,d,m,y;const n=ai(),r=ci(),i=In(),o=i.defaultQueryOptions(t);(f=(c=i.getDefaultOptions().queries)==null?void 0:c._experimental_beforeQuery)==null||f.call(c,o),o._optimisticResults=n?"isRestoring":"optimistic",di(o),ui(o,r),li(r);const a=!i.getQueryCache().get(o.queryHash),[u]=T.useState(()=>new e(i,o)),h=u.getOptimisticResult(o),p=!n&&t.subscribed!==!1;if(T.useSyncExternalStore(T.useCallback(g=>{const v=p?u.subscribe(N.batchCalls(g)):K;return u.updateResult(),v},[u,p]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),T.useEffect(()=>{u.setOptions(o)},[o,u]),dn(o,h))throw Rs(o,u,r);if(hi({result:h,errorResetBoundary:r,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw h.error;if((m=(d=i.getDefaultOptions().queries)==null?void 0:d._experimental_afterQuery)==null||m.call(d,o,h),o.experimental_prefetchInRender&&!re&&fi(h,n)){const g=a?Rs(o,u,r):(y=i.getQueryCache().get(o.queryHash))==null?void 0:y.promise;g==null||g.catch(K).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?h:u.trackResult(h)}function qa(t,e){return Ta(t,En)}function Ka(t,e){const s=In(),[n]=T.useState(()=>new _a(s,t));T.useEffect(()=>{n.setOptions(t)},[n,t]);const r=T.useSyncExternalStore(T.useCallback(o=>n.subscribe(N.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=T.useCallback((o,a)=>{n.mutate(o,a).catch(K)},[n]);if(r.error&&Xr(n.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:i,mutateAsync:r.mutate}}export{Vr as L,ta as O,Na as Q,_e as R,Qa as a,qa as b,Ka as c,_n as d,Hr as e,Aa as f,Da as g,$a as h,wn as i,I as j,ja as k,Ho as l,Ba as m,Ua as n,T as r,In as u};
@@ -24,10 +24,10 @@
24
24
  if (theme === 'dark') document.documentElement.classList.add('dark');
25
25
  })();
26
26
  </script>
27
- <script type="module" crossorigin src="/assets/index-DKq5Xng1.js"></script>
27
+ <script type="module" crossorigin src="/assets/index-D9u1XfyH.js"></script>
28
28
  <link rel="modulepreload" crossorigin href="/assets/react-vendor-gH-7aFTg.js">
29
- <link rel="modulepreload" crossorigin href="/assets/tanstack-DgxBONJY.js">
30
- <link rel="stylesheet" crossorigin href="/assets/index-D_0_GBu5.css">
29
+ <link rel="modulepreload" crossorigin href="/assets/tanstack-Br79RQ-n.js">
30
+ <link rel="stylesheet" crossorigin href="/assets/index-BkwPkZpd.css">
31
31
  </head>
32
32
  <body>
33
33
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dexto",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "dexto": "./dist/index.js"
@@ -18,31 +18,33 @@
18
18
  "@opentelemetry/semantic-conventions": "^1.28.0",
19
19
  "better-sqlite3": "^11.10.0",
20
20
  "boxen": "^7.1.1",
21
- "chalk": "^5.4.1",
21
+ "chalk": "^5.6.0",
22
22
  "commander": "^11.1.0",
23
- "discord.js": "^14.19.3",
23
+ "diff": "^8.0.2",
24
24
  "dotenv": "^16.4.7",
25
25
  "fs-extra": "^11.3.0",
26
- "grammy": "^1.38.2",
27
26
  "hono": "^4.7.13",
27
+ "ink": "npm:@jrichman/ink@6.4.6",
28
+ "ink-spinner": "^5.0.0",
29
+ "ink-text-input": "^6.0.0",
28
30
  "ioredis": "^5.7.0",
31
+ "open": "^10.2.0",
29
32
  "pg": "^8.15.4",
30
- "tsx": "^4.19.2",
31
33
  "posthog-node": "^4.2.1",
32
- "next": "15.5.2",
33
- "open": "^10.2.0",
34
- "ink": "^6.4.0",
35
- "ink-text-input": "^6.0.0",
36
- "ink-spinner": "^5.0.0",
37
34
  "react": "19.1.1",
38
35
  "react-dom": "19.1.1",
36
+ "string-width": "^8.1.0",
37
+ "strip-ansi": "^7.1.2",
38
+ "tsx": "^4.19.2",
39
+ "wrap-ansi": "^9.0.2",
39
40
  "ws": "^8.18.1",
40
41
  "yaml": "^2.7.1",
41
42
  "zod": "^3.25.0",
42
- "@dexto/analytics": "1.3.0",
43
- "@dexto/agent-management": "1.3.0",
44
- "@dexto/core": "1.3.0",
45
- "@dexto/server": "1.3.0"
43
+ "@dexto/agent-management": "1.4.0",
44
+ "@dexto/analytics": "1.4.0",
45
+ "@dexto/core": "1.4.0",
46
+ "@dexto/registry": "1.4.0",
47
+ "@dexto/server": "1.4.0"
46
48
  },
47
49
  "devDependencies": {
48
50
  "@types/react": "^19.0.0",
@@ -1,63 +0,0 @@
1
- /**
2
- * Interactive Command Registry
3
- *
4
- * This module provides the foundation for organizing CLI commands into a registry structure.
5
- * This is part of the CLI refactoring plan to improve code organization and maintainability.
6
- *
7
- * Future phases will gradually migrate commands from commands.ts into this registry system.
8
- */
9
- import type { DextoAgent } from '@dexto/core';
10
- /**
11
- * Base interface for command handlers
12
- */
13
- export interface CommandHandler {
14
- (args: string[], agent: DextoAgent): Promise<boolean>;
15
- }
16
- /**
17
- * Interface for command registration
18
- */
19
- export interface InteractiveCommand {
20
- name: string;
21
- description: string;
22
- usage: string;
23
- category: string;
24
- aliases?: string[];
25
- handler: CommandHandler;
26
- subcommands?: InteractiveCommand[];
27
- }
28
- /**
29
- * Command registry to hold all interactive commands
30
- */
31
- export declare class CommandRegistry {
32
- private commands;
33
- private aliases;
34
- /**
35
- * Register a command in the registry
36
- */
37
- register(command: InteractiveCommand): void;
38
- /**
39
- * Get a command by name or alias
40
- */
41
- get(nameOrAlias: string): InteractiveCommand | undefined;
42
- /**
43
- * Get all registered commands
44
- */
45
- getAll(): InteractiveCommand[];
46
- /**
47
- * Get commands by category
48
- */
49
- getByCategory(category: string): InteractiveCommand[];
50
- /**
51
- * Check if a command exists
52
- */
53
- has(nameOrAlias: string): boolean;
54
- /**
55
- * Get all command names and aliases
56
- */
57
- getAllNames(): string[];
58
- }
59
- /**
60
- * Global command registry instance
61
- */
62
- export declare const commandRegistry: CommandRegistry;
63
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACzD;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,cAAc,CAAC;IACxB,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACtC;AAED;;GAEG;AACH,qBAAa,eAAe;IACxB,OAAO,CAAC,QAAQ,CAA8C;IAC9D,OAAO,CAAC,OAAO,CAAkC;IAEjD;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI;IAW3C;;OAEG;IACH,GAAG,CAAC,WAAW,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAgBxD;;OAEG;IACH,MAAM,IAAI,kBAAkB,EAAE;IAI9B;;OAEG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,EAAE;IAIrD;;OAEG;IACH,GAAG,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAIjC;;OAEG;IACH,WAAW,IAAI,MAAM,EAAE;CAK1B;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,iBAAwB,CAAC"}
@@ -1,73 +0,0 @@
1
- /**
2
- * Interactive Command Registry
3
- *
4
- * This module provides the foundation for organizing CLI commands into a registry structure.
5
- * This is part of the CLI refactoring plan to improve code organization and maintainability.
6
- *
7
- * Future phases will gradually migrate commands from commands.ts into this registry system.
8
- */
9
- /**
10
- * Command registry to hold all interactive commands
11
- */
12
- export class CommandRegistry {
13
- commands = new Map();
14
- aliases = new Map();
15
- /**
16
- * Register a command in the registry
17
- */
18
- register(command) {
19
- this.commands.set(command.name, command);
20
- // Register aliases
21
- if (command.aliases) {
22
- for (const alias of command.aliases) {
23
- this.aliases.set(alias, command.name);
24
- }
25
- }
26
- }
27
- /**
28
- * Get a command by name or alias
29
- */
30
- get(nameOrAlias) {
31
- // Check direct name first
32
- const command = this.commands.get(nameOrAlias);
33
- if (command) {
34
- return command;
35
- }
36
- // Check aliases
37
- const mainName = this.aliases.get(nameOrAlias);
38
- if (mainName) {
39
- return this.commands.get(mainName);
40
- }
41
- return undefined;
42
- }
43
- /**
44
- * Get all registered commands
45
- */
46
- getAll() {
47
- return Array.from(this.commands.values());
48
- }
49
- /**
50
- * Get commands by category
51
- */
52
- getByCategory(category) {
53
- return Array.from(this.commands.values()).filter((cmd) => cmd.category === category);
54
- }
55
- /**
56
- * Check if a command exists
57
- */
58
- has(nameOrAlias) {
59
- return this.commands.has(nameOrAlias) || this.aliases.has(nameOrAlias);
60
- }
61
- /**
62
- * Get all command names and aliases
63
- */
64
- getAllNames() {
65
- const names = Array.from(this.commands.keys());
66
- const aliasNames = Array.from(this.aliases.keys());
67
- return [...names, ...aliasNames];
68
- }
69
- }
70
- /**
71
- * Global command registry instance
72
- */
73
- export const commandRegistry = new CommandRegistry();
@@ -1,34 +0,0 @@
1
- import { StdioServerConfig, HttpServerConfig, SseServerConfig, McpServerConfig } from '@dexto/core';
2
- /**
3
- * Parse stdio server arguments
4
- */
5
- export declare function parseStdioArgs(args: string[]): {
6
- serverName: string;
7
- config: StdioServerConfig;
8
- errors: string[];
9
- };
10
- /**
11
- * Parse HTTP server arguments
12
- */
13
- export declare function parseHttpArgs(args: string[]): {
14
- serverName: string;
15
- config: HttpServerConfig;
16
- errors: string[];
17
- };
18
- /**
19
- * Parse SSE server arguments
20
- */
21
- export declare function parseSseArgs(args: string[]): {
22
- serverName: string;
23
- config: SseServerConfig;
24
- errors: string[];
25
- };
26
- /**
27
- * Show help for MCP add commands
28
- */
29
- export declare function showMcpAddHelp(): void;
30
- /**
31
- * Validate server configuration and show errors
32
- */
33
- export declare function validateAndShowErrors(serverName: string, config: McpServerConfig, existingServers?: string[]): boolean;
34
- //# sourceMappingURL=mcp-add-utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-add-utils.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/interactive-commands/mcp/mcp-add-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,eAAe,EAElB,MAAM,aAAa,CAAC;AAIrB;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB,CAsCA;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB,CA6CA;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB,CA6CA;AAKD;;GAEG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAoCrC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACjC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,eAAe,EACvB,eAAe,GAAE,MAAM,EAAO,GAC/B,OAAO,CA2BT"}