@neurouter/server 0.0.0-stage → 0.1.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 (1000) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +10 -0
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/app.d.ts +29 -0
  5. package/dist/app.d.ts.map +1 -0
  6. package/dist/app.js +79 -0
  7. package/dist/app.js.map +1 -0
  8. package/dist/console.d.ts +16 -0
  9. package/dist/console.d.ts.map +1 -0
  10. package/dist/console.js +149 -0
  11. package/dist/console.js.map +1 -0
  12. package/dist/controlplane/api/context.d.ts +64 -0
  13. package/dist/controlplane/api/context.d.ts.map +1 -0
  14. package/dist/controlplane/api/context.js +7 -0
  15. package/dist/controlplane/api/context.js.map +1 -0
  16. package/dist/controlplane/api/plugin.d.ts +8 -0
  17. package/dist/controlplane/api/plugin.d.ts.map +1 -0
  18. package/dist/controlplane/api/plugin.js +36 -0
  19. package/dist/controlplane/api/plugin.js.map +1 -0
  20. package/dist/controlplane/api/ports.d.ts +40 -0
  21. package/dist/controlplane/api/ports.d.ts.map +1 -0
  22. package/dist/controlplane/api/ports.js +2 -0
  23. package/dist/controlplane/api/ports.js.map +1 -0
  24. package/dist/controlplane/api/problem.d.ts +15 -0
  25. package/dist/controlplane/api/problem.d.ts.map +1 -0
  26. package/dist/controlplane/api/problem.js +80 -0
  27. package/dist/controlplane/api/problem.js.map +1 -0
  28. package/dist/controlplane/api/routes/audit.d.ts +6 -0
  29. package/dist/controlplane/api/routes/audit.d.ts.map +1 -0
  30. package/dist/controlplane/api/routes/audit.js +139 -0
  31. package/dist/controlplane/api/routes/audit.js.map +1 -0
  32. package/dist/controlplane/api/routes/auth.d.ts +10 -0
  33. package/dist/controlplane/api/routes/auth.d.ts.map +1 -0
  34. package/dist/controlplane/api/routes/auth.js +125 -0
  35. package/dist/controlplane/api/routes/auth.js.map +1 -0
  36. package/dist/controlplane/api/routes/environments.d.ts +5 -0
  37. package/dist/controlplane/api/routes/environments.d.ts.map +1 -0
  38. package/dist/controlplane/api/routes/environments.js +118 -0
  39. package/dist/controlplane/api/routes/environments.js.map +1 -0
  40. package/dist/controlplane/api/routes/evals.d.ts +5 -0
  41. package/dist/controlplane/api/routes/evals.d.ts.map +1 -0
  42. package/dist/controlplane/api/routes/evals.js +348 -0
  43. package/dist/controlplane/api/routes/evals.js.map +1 -0
  44. package/dist/controlplane/api/routes/inbox.d.ts +5 -0
  45. package/dist/controlplane/api/routes/inbox.d.ts.map +1 -0
  46. package/dist/controlplane/api/routes/inbox.js +226 -0
  47. package/dist/controlplane/api/routes/inbox.js.map +1 -0
  48. package/dist/controlplane/api/routes/keys.d.ts +5 -0
  49. package/dist/controlplane/api/routes/keys.d.ts.map +1 -0
  50. package/dist/controlplane/api/routes/keys.js +176 -0
  51. package/dist/controlplane/api/routes/keys.js.map +1 -0
  52. package/dist/controlplane/api/routes/metrics.d.ts +5 -0
  53. package/dist/controlplane/api/routes/metrics.d.ts.map +1 -0
  54. package/dist/controlplane/api/routes/metrics.js +197 -0
  55. package/dist/controlplane/api/routes/metrics.js.map +1 -0
  56. package/dist/controlplane/api/routes/overlays.d.ts +36 -0
  57. package/dist/controlplane/api/routes/overlays.d.ts.map +1 -0
  58. package/dist/controlplane/api/routes/overlays.js +244 -0
  59. package/dist/controlplane/api/routes/overlays.js.map +1 -0
  60. package/dist/controlplane/api/routes/public.d.ts +7 -0
  61. package/dist/controlplane/api/routes/public.d.ts.map +1 -0
  62. package/dist/controlplane/api/routes/public.js +71 -0
  63. package/dist/controlplane/api/routes/public.js.map +1 -0
  64. package/dist/controlplane/api/routes/servers.d.ts +45 -0
  65. package/dist/controlplane/api/routes/servers.d.ts.map +1 -0
  66. package/dist/controlplane/api/routes/servers.js +423 -0
  67. package/dist/controlplane/api/routes/servers.js.map +1 -0
  68. package/dist/controlplane/api/routes/settings.d.ts +21 -0
  69. package/dist/controlplane/api/routes/settings.d.ts.map +1 -0
  70. package/dist/controlplane/api/routes/settings.js +408 -0
  71. package/dist/controlplane/api/routes/settings.js.map +1 -0
  72. package/dist/controlplane/api/routes/tasks.d.ts +12 -0
  73. package/dist/controlplane/api/routes/tasks.d.ts.map +1 -0
  74. package/dist/controlplane/api/routes/tasks.js +144 -0
  75. package/dist/controlplane/api/routes/tasks.js.map +1 -0
  76. package/dist/controlplane/api/routes/tools.d.ts +14 -0
  77. package/dist/controlplane/api/routes/tools.d.ts.map +1 -0
  78. package/dist/controlplane/api/routes/tools.js +174 -0
  79. package/dist/controlplane/api/routes/tools.js.map +1 -0
  80. package/dist/controlplane/api/routes.d.ts +25 -0
  81. package/dist/controlplane/api/routes.d.ts.map +1 -0
  82. package/dist/controlplane/api/routes.js +43 -0
  83. package/dist/controlplane/api/routes.js.map +1 -0
  84. package/dist/controlplane/api/views.d.ts +53 -0
  85. package/dist/controlplane/api/views.d.ts.map +1 -0
  86. package/dist/controlplane/api/views.js +290 -0
  87. package/dist/controlplane/api/views.js.map +1 -0
  88. package/dist/controlplane/auth/guards.d.ts +40 -0
  89. package/dist/controlplane/auth/guards.d.ts.map +1 -0
  90. package/dist/controlplane/auth/guards.js +87 -0
  91. package/dist/controlplane/auth/guards.js.map +1 -0
  92. package/dist/controlplane/auth/local-link.d.ts +28 -0
  93. package/dist/controlplane/auth/local-link.d.ts.map +1 -0
  94. package/dist/controlplane/auth/local-link.js +41 -0
  95. package/dist/controlplane/auth/local-link.js.map +1 -0
  96. package/dist/controlplane/auth/login.d.ts +51 -0
  97. package/dist/controlplane/auth/login.d.ts.map +1 -0
  98. package/dist/controlplane/auth/login.js +115 -0
  99. package/dist/controlplane/auth/login.js.map +1 -0
  100. package/dist/controlplane/auth/oidc.d.ts +63 -0
  101. package/dist/controlplane/auth/oidc.d.ts.map +1 -0
  102. package/dist/controlplane/auth/oidc.js +76 -0
  103. package/dist/controlplane/auth/oidc.js.map +1 -0
  104. package/dist/controlplane/auth/sessions.d.ts +46 -0
  105. package/dist/controlplane/auth/sessions.d.ts.map +1 -0
  106. package/dist/controlplane/auth/sessions.js +65 -0
  107. package/dist/controlplane/auth/sessions.js.map +1 -0
  108. package/dist/controlplane/config-sync/reconcile.d.ts +88 -0
  109. package/dist/controlplane/config-sync/reconcile.d.ts.map +1 -0
  110. package/dist/controlplane/config-sync/reconcile.js +287 -0
  111. package/dist/controlplane/config-sync/reconcile.js.map +1 -0
  112. package/dist/controlplane/environments/environments.service.d.ts +46 -0
  113. package/dist/controlplane/environments/environments.service.d.ts.map +1 -0
  114. package/dist/controlplane/environments/environments.service.js +209 -0
  115. package/dist/controlplane/environments/environments.service.js.map +1 -0
  116. package/dist/controlplane/evals/evals.service.d.ts +126 -0
  117. package/dist/controlplane/evals/evals.service.d.ts.map +1 -0
  118. package/dist/controlplane/evals/evals.service.js +551 -0
  119. package/dist/controlplane/evals/evals.service.js.map +1 -0
  120. package/dist/controlplane/evals/model-keys.d.ts +37 -0
  121. package/dist/controlplane/evals/model-keys.d.ts.map +1 -0
  122. package/dist/controlplane/evals/model-keys.js +43 -0
  123. package/dist/controlplane/evals/model-keys.js.map +1 -0
  124. package/dist/controlplane/keys/api-key-format.d.ts +19 -0
  125. package/dist/controlplane/keys/api-key-format.d.ts.map +1 -0
  126. package/dist/controlplane/keys/api-key-format.js +39 -0
  127. package/dist/controlplane/keys/api-key-format.js.map +1 -0
  128. package/dist/controlplane/keys/api-keys.service.d.ts +42 -0
  129. package/dist/controlplane/keys/api-keys.service.d.ts.map +1 -0
  130. package/dist/controlplane/keys/api-keys.service.js +91 -0
  131. package/dist/controlplane/keys/api-keys.service.js.map +1 -0
  132. package/dist/controlplane/oauth/authorize.d.ts +101 -0
  133. package/dist/controlplane/oauth/authorize.d.ts.map +1 -0
  134. package/dist/controlplane/oauth/authorize.js +172 -0
  135. package/dist/controlplane/oauth/authorize.js.map +1 -0
  136. package/dist/controlplane/oauth/cimd.d.ts +52 -0
  137. package/dist/controlplane/oauth/cimd.d.ts.map +1 -0
  138. package/dist/controlplane/oauth/cimd.js +173 -0
  139. package/dist/controlplane/oauth/cimd.js.map +1 -0
  140. package/dist/controlplane/oauth/clients.service.d.ts +101 -0
  141. package/dist/controlplane/oauth/clients.service.d.ts.map +1 -0
  142. package/dist/controlplane/oauth/clients.service.js +269 -0
  143. package/dist/controlplane/oauth/clients.service.js.map +1 -0
  144. package/dist/controlplane/oauth/metadata.d.ts +27 -0
  145. package/dist/controlplane/oauth/metadata.d.ts.map +1 -0
  146. package/dist/controlplane/oauth/metadata.js +35 -0
  147. package/dist/controlplane/oauth/metadata.js.map +1 -0
  148. package/dist/controlplane/oauth/pkce.d.ts +8 -0
  149. package/dist/controlplane/oauth/pkce.d.ts.map +1 -0
  150. package/dist/controlplane/oauth/pkce.js +16 -0
  151. package/dist/controlplane/oauth/pkce.js.map +1 -0
  152. package/dist/controlplane/oauth/redirect-uri.d.ts +15 -0
  153. package/dist/controlplane/oauth/redirect-uri.d.ts.map +1 -0
  154. package/dist/controlplane/oauth/redirect-uri.js +61 -0
  155. package/dist/controlplane/oauth/redirect-uri.js.map +1 -0
  156. package/dist/controlplane/oauth/resource.d.ts +28 -0
  157. package/dist/controlplane/oauth/resource.d.ts.map +1 -0
  158. package/dist/controlplane/oauth/resource.js +49 -0
  159. package/dist/controlplane/oauth/resource.js.map +1 -0
  160. package/dist/controlplane/oauth/routes.d.ts +28 -0
  161. package/dist/controlplane/oauth/routes.d.ts.map +1 -0
  162. package/dist/controlplane/oauth/routes.js +191 -0
  163. package/dist/controlplane/oauth/routes.js.map +1 -0
  164. package/dist/controlplane/oauth/session.d.ts +36 -0
  165. package/dist/controlplane/oauth/session.d.ts.map +1 -0
  166. package/dist/controlplane/oauth/session.js +38 -0
  167. package/dist/controlplane/oauth/session.js.map +1 -0
  168. package/dist/controlplane/oauth/tokens.service.d.ts +105 -0
  169. package/dist/controlplane/oauth/tokens.service.d.ts.map +1 -0
  170. package/dist/controlplane/oauth/tokens.service.js +209 -0
  171. package/dist/controlplane/oauth/tokens.service.js.map +1 -0
  172. package/dist/controlplane/servers/builds.service.d.ts +54 -0
  173. package/dist/controlplane/servers/builds.service.d.ts.map +1 -0
  174. package/dist/controlplane/servers/builds.service.js +173 -0
  175. package/dist/controlplane/servers/builds.service.js.map +1 -0
  176. package/dist/controlplane/servers/fetch-spec.d.ts +13 -0
  177. package/dist/controlplane/servers/fetch-spec.d.ts.map +1 -0
  178. package/dist/controlplane/servers/fetch-spec.js +30 -0
  179. package/dist/controlplane/servers/fetch-spec.js.map +1 -0
  180. package/dist/controlplane/servers/servers.service.d.ts +87 -0
  181. package/dist/controlplane/servers/servers.service.d.ts.map +1 -0
  182. package/dist/controlplane/servers/servers.service.js +168 -0
  183. package/dist/controlplane/servers/servers.service.js.map +1 -0
  184. package/dist/controlplane/traces/traces.service.d.ts +38 -0
  185. package/dist/controlplane/traces/traces.service.d.ts.map +1 -0
  186. package/dist/controlplane/traces/traces.service.js +189 -0
  187. package/dist/controlplane/traces/traces.service.js.map +1 -0
  188. package/dist/controlplane/upstream-oauth/upstream-oauth.service.d.ts +70 -0
  189. package/dist/controlplane/upstream-oauth/upstream-oauth.service.d.ts.map +1 -0
  190. package/dist/controlplane/upstream-oauth/upstream-oauth.service.js +208 -0
  191. package/dist/controlplane/upstream-oauth/upstream-oauth.service.js.map +1 -0
  192. package/dist/controlplane/users/users.service.d.ts +33 -0
  193. package/dist/controlplane/users/users.service.d.ts.map +1 -0
  194. package/dist/controlplane/users/users.service.js +68 -0
  195. package/dist/controlplane/users/users.service.js.map +1 -0
  196. package/dist/dataplane/auth/authenticate.d.ts +58 -0
  197. package/dist/dataplane/auth/authenticate.d.ts.map +1 -0
  198. package/dist/dataplane/auth/authenticate.js +152 -0
  199. package/dist/dataplane/auth/authenticate.js.map +1 -0
  200. package/dist/dataplane/auth/external-jwt.d.ts +30 -0
  201. package/dist/dataplane/auth/external-jwt.d.ts.map +1 -0
  202. package/dist/dataplane/auth/external-jwt.js +78 -0
  203. package/dist/dataplane/auth/external-jwt.js.map +1 -0
  204. package/dist/dataplane/code/executor-health.d.ts +24 -0
  205. package/dist/dataplane/code/executor-health.d.ts.map +1 -0
  206. package/dist/dataplane/code/executor-health.js +49 -0
  207. package/dist/dataplane/code/executor-health.js.map +1 -0
  208. package/dist/dataplane/code/run-script.d.ts +90 -0
  209. package/dist/dataplane/code/run-script.d.ts.map +1 -0
  210. package/dist/dataplane/code/run-script.js +320 -0
  211. package/dist/dataplane/code/run-script.js.map +1 -0
  212. package/dist/dataplane/code/tokenize.d.ts +44 -0
  213. package/dist/dataplane/code/tokenize.d.ts.map +1 -0
  214. package/dist/dataplane/code/tokenize.js +267 -0
  215. package/dist/dataplane/code/tokenize.js.map +1 -0
  216. package/dist/dataplane/code/validate.d.ts +30 -0
  217. package/dist/dataplane/code/validate.d.ts.map +1 -0
  218. package/dist/dataplane/code/validate.js +94 -0
  219. package/dist/dataplane/code/validate.js.map +1 -0
  220. package/dist/dataplane/code/wrap.d.ts +20 -0
  221. package/dist/dataplane/code/wrap.d.ts.map +1 -0
  222. package/dist/dataplane/code/wrap.js +108 -0
  223. package/dist/dataplane/code/wrap.js.map +1 -0
  224. package/dist/dataplane/http/circuit-breaker.d.ts +23 -0
  225. package/dist/dataplane/http/circuit-breaker.d.ts.map +1 -0
  226. package/dist/dataplane/http/circuit-breaker.js +53 -0
  227. package/dist/dataplane/http/circuit-breaker.js.map +1 -0
  228. package/dist/dataplane/http/credentials.d.ts +59 -0
  229. package/dist/dataplane/http/credentials.d.ts.map +1 -0
  230. package/dist/dataplane/http/credentials.js +93 -0
  231. package/dist/dataplane/http/credentials.js.map +1 -0
  232. package/dist/dataplane/http/errors.d.ts +16 -0
  233. package/dist/dataplane/http/errors.d.ts.map +1 -0
  234. package/dist/dataplane/http/errors.js +32 -0
  235. package/dist/dataplane/http/errors.js.map +1 -0
  236. package/dist/dataplane/http/invoker.d.ts +56 -0
  237. package/dist/dataplane/http/invoker.d.ts.map +1 -0
  238. package/dist/dataplane/http/invoker.js +114 -0
  239. package/dist/dataplane/http/invoker.js.map +1 -0
  240. package/dist/dataplane/http/request-builder.d.ts +39 -0
  241. package/dist/dataplane/http/request-builder.d.ts.map +1 -0
  242. package/dist/dataplane/http/request-builder.js +162 -0
  243. package/dist/dataplane/http/request-builder.js.map +1 -0
  244. package/dist/dataplane/mcp/challenge.d.ts +14 -0
  245. package/dist/dataplane/mcp/challenge.d.ts.map +1 -0
  246. package/dist/dataplane/mcp/challenge.js +25 -0
  247. package/dist/dataplane/mcp/challenge.js.map +1 -0
  248. package/dist/dataplane/mcp/dispatch.d.ts +64 -0
  249. package/dist/dataplane/mcp/dispatch.d.ts.map +1 -0
  250. package/dist/dataplane/mcp/dispatch.js +165 -0
  251. package/dist/dataplane/mcp/dispatch.js.map +1 -0
  252. package/dist/dataplane/mcp/event-bus.d.ts +19 -0
  253. package/dist/dataplane/mcp/event-bus.d.ts.map +1 -0
  254. package/dist/dataplane/mcp/event-bus.js +39 -0
  255. package/dist/dataplane/mcp/event-bus.js.map +1 -0
  256. package/dist/dataplane/mcp/inflight.d.ts +66 -0
  257. package/dist/dataplane/mcp/inflight.d.ts.map +1 -0
  258. package/dist/dataplane/mcp/inflight.js +135 -0
  259. package/dist/dataplane/mcp/inflight.js.map +1 -0
  260. package/dist/dataplane/mcp/origin.d.ts +7 -0
  261. package/dist/dataplane/mcp/origin.d.ts.map +1 -0
  262. package/dist/dataplane/mcp/origin.js +27 -0
  263. package/dist/dataplane/mcp/origin.js.map +1 -0
  264. package/dist/dataplane/mcp/route.d.ts +43 -0
  265. package/dist/dataplane/mcp/route.d.ts.map +1 -0
  266. package/dist/dataplane/mcp/route.js +280 -0
  267. package/dist/dataplane/mcp/route.js.map +1 -0
  268. package/dist/dataplane/mcp/surface.d.ts +43 -0
  269. package/dist/dataplane/mcp/surface.d.ts.map +1 -0
  270. package/dist/dataplane/mcp/surface.js +133 -0
  271. package/dist/dataplane/mcp/surface.js.map +1 -0
  272. package/dist/dataplane/mcp/translate.d.ts +16 -0
  273. package/dist/dataplane/mcp/translate.d.ts.map +1 -0
  274. package/dist/dataplane/mcp/translate.js +33 -0
  275. package/dist/dataplane/mcp/translate.js.map +1 -0
  276. package/dist/dataplane/mock/mock-upstream.d.ts +23 -0
  277. package/dist/dataplane/mock/mock-upstream.d.ts.map +1 -0
  278. package/dist/dataplane/mock/mock-upstream.js +26 -0
  279. package/dist/dataplane/mock/mock-upstream.js.map +1 -0
  280. package/dist/dataplane/ops/ops.d.ts +66 -0
  281. package/dist/dataplane/ops/ops.d.ts.map +1 -0
  282. package/dist/dataplane/ops/ops.js +315 -0
  283. package/dist/dataplane/ops/ops.js.map +1 -0
  284. package/dist/dataplane/pipeline/arg-validate.d.ts +19 -0
  285. package/dist/dataplane/pipeline/arg-validate.d.ts.map +1 -0
  286. package/dist/dataplane/pipeline/arg-validate.js +61 -0
  287. package/dist/dataplane/pipeline/arg-validate.js.map +1 -0
  288. package/dist/dataplane/pipeline/context.d.ts +78 -0
  289. package/dist/dataplane/pipeline/context.d.ts.map +1 -0
  290. package/dist/dataplane/pipeline/context.js +13 -0
  291. package/dist/dataplane/pipeline/context.js.map +1 -0
  292. package/dist/dataplane/pipeline/errors.d.ts +53 -0
  293. package/dist/dataplane/pipeline/errors.d.ts.map +1 -0
  294. package/dist/dataplane/pipeline/errors.js +61 -0
  295. package/dist/dataplane/pipeline/errors.js.map +1 -0
  296. package/dist/dataplane/pipeline/pipeline.d.ts +128 -0
  297. package/dist/dataplane/pipeline/pipeline.d.ts.map +1 -0
  298. package/dist/dataplane/pipeline/pipeline.js +443 -0
  299. package/dist/dataplane/pipeline/pipeline.js.map +1 -0
  300. package/dist/dataplane/pipeline/policy.d.ts +24 -0
  301. package/dist/dataplane/pipeline/policy.d.ts.map +1 -0
  302. package/dist/dataplane/pipeline/policy.js +93 -0
  303. package/dist/dataplane/pipeline/policy.js.map +1 -0
  304. package/dist/dataplane/rate-limit/limiter.d.ts +42 -0
  305. package/dist/dataplane/rate-limit/limiter.d.ts.map +1 -0
  306. package/dist/dataplane/rate-limit/limiter.js +34 -0
  307. package/dist/dataplane/rate-limit/limiter.js.map +1 -0
  308. package/dist/dataplane/rate-limit/stores.d.ts +56 -0
  309. package/dist/dataplane/rate-limit/stores.d.ts.map +1 -0
  310. package/dist/dataplane/rate-limit/stores.js +95 -0
  311. package/dist/dataplane/rate-limit/stores.js.map +1 -0
  312. package/dist/dataplane/rate-limit/token-bucket.d.ts +19 -0
  313. package/dist/dataplane/rate-limit/token-bucket.d.ts.map +1 -0
  314. package/dist/dataplane/rate-limit/token-bucket.js +16 -0
  315. package/dist/dataplane/rate-limit/token-bucket.js.map +1 -0
  316. package/dist/dataplane/search/document.d.ts +22 -0
  317. package/dist/dataplane/search/document.d.ts.map +1 -0
  318. package/dist/dataplane/search/document.js +45 -0
  319. package/dist/dataplane/search/document.js.map +1 -0
  320. package/dist/dataplane/search/embed-worker.d.ts +2 -0
  321. package/dist/dataplane/search/embed-worker.d.ts.map +1 -0
  322. package/dist/dataplane/search/embed-worker.js +55 -0
  323. package/dist/dataplane/search/embed-worker.js.map +1 -0
  324. package/dist/dataplane/search/embedder.d.ts +113 -0
  325. package/dist/dataplane/search/embedder.d.ts.map +1 -0
  326. package/dist/dataplane/search/embedder.js +216 -0
  327. package/dist/dataplane/search/embedder.js.map +1 -0
  328. package/dist/dataplane/search/hybrid.d.ts +28 -0
  329. package/dist/dataplane/search/hybrid.d.ts.map +1 -0
  330. package/dist/dataplane/search/hybrid.js +45 -0
  331. package/dist/dataplane/search/hybrid.js.map +1 -0
  332. package/dist/dataplane/search/indexer.d.ts +62 -0
  333. package/dist/dataplane/search/indexer.d.ts.map +1 -0
  334. package/dist/dataplane/search/indexer.js +105 -0
  335. package/dist/dataplane/search/indexer.js.map +1 -0
  336. package/dist/dataplane/search/keyword-index.d.ts +26 -0
  337. package/dist/dataplane/search/keyword-index.d.ts.map +1 -0
  338. package/dist/dataplane/search/keyword-index.js +60 -0
  339. package/dist/dataplane/search/keyword-index.js.map +1 -0
  340. package/dist/dataplane/search/model-profiles.d.ts +12 -0
  341. package/dist/dataplane/search/model-profiles.d.ts.map +1 -0
  342. package/dist/dataplane/search/model-profiles.js +12 -0
  343. package/dist/dataplane/search/model-profiles.js.map +1 -0
  344. package/dist/dataplane/search/search.service.d.ts +39 -0
  345. package/dist/dataplane/search/search.service.d.ts.map +1 -0
  346. package/dist/dataplane/search/search.service.js +69 -0
  347. package/dist/dataplane/search/search.service.js.map +1 -0
  348. package/dist/dataplane/search/suggest.d.ts +15 -0
  349. package/dist/dataplane/search/suggest.d.ts.map +1 -0
  350. package/dist/dataplane/search/suggest.js +76 -0
  351. package/dist/dataplane/search/suggest.js.map +1 -0
  352. package/dist/dataplane/search/vector-index.d.ts +49 -0
  353. package/dist/dataplane/search/vector-index.d.ts.map +1 -0
  354. package/dist/dataplane/search/vector-index.js +72 -0
  355. package/dist/dataplane/search/vector-index.js.map +1 -0
  356. package/dist/dataplane/shaping/result-pages.d.ts +19 -0
  357. package/dist/dataplane/shaping/result-pages.d.ts.map +1 -0
  358. package/dist/dataplane/shaping/result-pages.js +37 -0
  359. package/dist/dataplane/shaping/result-pages.js.map +1 -0
  360. package/dist/dataplane/shaping/sanitize.d.ts +6 -0
  361. package/dist/dataplane/shaping/sanitize.d.ts.map +1 -0
  362. package/dist/dataplane/shaping/sanitize.js +31 -0
  363. package/dist/dataplane/shaping/sanitize.js.map +1 -0
  364. package/dist/dataplane/tasks/tracker.d.ts +60 -0
  365. package/dist/dataplane/tasks/tracker.d.ts.map +1 -0
  366. package/dist/dataplane/tasks/tracker.js +178 -0
  367. package/dist/dataplane/tasks/tracker.js.map +1 -0
  368. package/dist/dataplane/tasks/usage.d.ts +8 -0
  369. package/dist/dataplane/tasks/usage.d.ts.map +1 -0
  370. package/dist/dataplane/tasks/usage.js +35 -0
  371. package/dist/dataplane/tasks/usage.js.map +1 -0
  372. package/dist/deps.d.ts +133 -0
  373. package/dist/deps.d.ts.map +1 -0
  374. package/dist/deps.js +356 -0
  375. package/dist/deps.js.map +1 -0
  376. package/dist/health/routes.d.ts +22 -0
  377. package/dist/health/routes.d.ts.map +1 -0
  378. package/dist/health/routes.js +40 -0
  379. package/dist/health/routes.js.map +1 -0
  380. package/dist/index.d.ts +8 -0
  381. package/dist/index.d.ts.map +1 -0
  382. package/dist/index.js +8 -0
  383. package/dist/index.js.map +1 -0
  384. package/dist/instrumentation.d.ts +10 -0
  385. package/dist/instrumentation.d.ts.map +1 -0
  386. package/dist/instrumentation.js +72 -0
  387. package/dist/instrumentation.js.map +1 -0
  388. package/dist/jobs.d.ts +5 -0
  389. package/dist/jobs.d.ts.map +1 -0
  390. package/dist/jobs.js +96 -0
  391. package/dist/jobs.js.map +1 -0
  392. package/dist/kernel/audit/archive/azure.d.ts +42 -0
  393. package/dist/kernel/audit/archive/azure.d.ts.map +1 -0
  394. package/dist/kernel/audit/archive/azure.js +80 -0
  395. package/dist/kernel/audit/archive/azure.js.map +1 -0
  396. package/dist/kernel/audit/archive/gcs.d.ts +27 -0
  397. package/dist/kernel/audit/archive/gcs.d.ts.map +1 -0
  398. package/dist/kernel/audit/archive/gcs.js +42 -0
  399. package/dist/kernel/audit/archive/gcs.js.map +1 -0
  400. package/dist/kernel/audit/archive/index.d.ts +20 -0
  401. package/dist/kernel/audit/archive/index.d.ts.map +1 -0
  402. package/dist/kernel/audit/archive/index.js +90 -0
  403. package/dist/kernel/audit/archive/index.js.map +1 -0
  404. package/dist/kernel/audit/archive/local-fs.d.ts +10 -0
  405. package/dist/kernel/audit/archive/local-fs.d.ts.map +1 -0
  406. package/dist/kernel/audit/archive/local-fs.js +24 -0
  407. package/dist/kernel/audit/archive/local-fs.js.map +1 -0
  408. package/dist/kernel/audit/archive/s3.d.ts +49 -0
  409. package/dist/kernel/audit/archive/s3.d.ts.map +1 -0
  410. package/dist/kernel/audit/archive/s3.js +85 -0
  411. package/dist/kernel/audit/archive/s3.js.map +1 -0
  412. package/dist/kernel/audit/archive/store.d.ts +34 -0
  413. package/dist/kernel/audit/archive/store.d.ts.map +1 -0
  414. package/dist/kernel/audit/archive/store.js +27 -0
  415. package/dist/kernel/audit/archive/store.js.map +1 -0
  416. package/dist/kernel/audit/chain.d.ts +33 -0
  417. package/dist/kernel/audit/chain.d.ts.map +1 -0
  418. package/dist/kernel/audit/chain.js +64 -0
  419. package/dist/kernel/audit/chain.js.map +1 -0
  420. package/dist/kernel/audit/checkpoints.d.ts +30 -0
  421. package/dist/kernel/audit/checkpoints.d.ts.map +1 -0
  422. package/dist/kernel/audit/checkpoints.js +33 -0
  423. package/dist/kernel/audit/checkpoints.js.map +1 -0
  424. package/dist/kernel/audit/export.d.ts +14 -0
  425. package/dist/kernel/audit/export.d.ts.map +1 -0
  426. package/dist/kernel/audit/export.js +88 -0
  427. package/dist/kernel/audit/export.js.map +1 -0
  428. package/dist/kernel/audit/partitions.d.ts +29 -0
  429. package/dist/kernel/audit/partitions.d.ts.map +1 -0
  430. package/dist/kernel/audit/partitions.js +58 -0
  431. package/dist/kernel/audit/partitions.js.map +1 -0
  432. package/dist/kernel/audit/query.d.ts +28 -0
  433. package/dist/kernel/audit/query.d.ts.map +1 -0
  434. package/dist/kernel/audit/query.js +114 -0
  435. package/dist/kernel/audit/query.js.map +1 -0
  436. package/dist/kernel/audit/recorder.d.ts +53 -0
  437. package/dist/kernel/audit/recorder.d.ts.map +1 -0
  438. package/dist/kernel/audit/recorder.js +71 -0
  439. package/dist/kernel/audit/recorder.js.map +1 -0
  440. package/dist/kernel/audit/redact.d.ts +69 -0
  441. package/dist/kernel/audit/redact.d.ts.map +1 -0
  442. package/dist/kernel/audit/redact.js +202 -0
  443. package/dist/kernel/audit/redact.js.map +1 -0
  444. package/dist/kernel/audit/redaction-rules.service.d.ts +34 -0
  445. package/dist/kernel/audit/redaction-rules.service.d.ts.map +1 -0
  446. package/dist/kernel/audit/redaction-rules.service.js +53 -0
  447. package/dist/kernel/audit/redaction-rules.service.js.map +1 -0
  448. package/dist/kernel/audit/retention.d.ts +54 -0
  449. package/dist/kernel/audit/retention.d.ts.map +1 -0
  450. package/dist/kernel/audit/retention.js +119 -0
  451. package/dist/kernel/audit/retention.js.map +1 -0
  452. package/dist/kernel/audit/sinks/dispatcher.d.ts +38 -0
  453. package/dist/kernel/audit/sinks/dispatcher.d.ts.map +1 -0
  454. package/dist/kernel/audit/sinks/dispatcher.js +68 -0
  455. package/dist/kernel/audit/sinks/dispatcher.js.map +1 -0
  456. package/dist/kernel/audit/sinks/otel-logs.d.ts +25 -0
  457. package/dist/kernel/audit/sinks/otel-logs.d.ts.map +1 -0
  458. package/dist/kernel/audit/sinks/otel-logs.js +51 -0
  459. package/dist/kernel/audit/sinks/otel-logs.js.map +1 -0
  460. package/dist/kernel/audit/sinks/sink.d.ts +14 -0
  461. package/dist/kernel/audit/sinks/sink.d.ts.map +1 -0
  462. package/dist/kernel/audit/sinks/sink.js +9 -0
  463. package/dist/kernel/audit/sinks/sink.js.map +1 -0
  464. package/dist/kernel/audit/sinks/webhook.d.ts +29 -0
  465. package/dist/kernel/audit/sinks/webhook.d.ts.map +1 -0
  466. package/dist/kernel/audit/sinks/webhook.js +49 -0
  467. package/dist/kernel/audit/sinks/webhook.js.map +1 -0
  468. package/dist/kernel/audit/store.d.ts +158 -0
  469. package/dist/kernel/audit/store.d.ts.map +1 -0
  470. package/dist/kernel/audit/store.js +155 -0
  471. package/dist/kernel/audit/store.js.map +1 -0
  472. package/dist/kernel/audit/types.d.ts +136 -0
  473. package/dist/kernel/audit/types.d.ts.map +1 -0
  474. package/dist/kernel/audit/types.js +2 -0
  475. package/dist/kernel/audit/types.js.map +1 -0
  476. package/dist/kernel/audit/verify.d.ts +22 -0
  477. package/dist/kernel/audit/verify.d.ts.map +1 -0
  478. package/dist/kernel/audit/verify.js +96 -0
  479. package/dist/kernel/audit/verify.js.map +1 -0
  480. package/dist/kernel/audit/writer.d.ts +85 -0
  481. package/dist/kernel/audit/writer.d.ts.map +1 -0
  482. package/dist/kernel/audit/writer.js +255 -0
  483. package/dist/kernel/audit/writer.js.map +1 -0
  484. package/dist/kernel/config/env.d.ts +119 -0
  485. package/dist/kernel/config/env.d.ts.map +1 -0
  486. package/dist/kernel/config/env.js +173 -0
  487. package/dist/kernel/config/env.js.map +1 -0
  488. package/dist/kernel/config/load.d.ts +51 -0
  489. package/dist/kernel/config/load.d.ts.map +1 -0
  490. package/dist/kernel/config/load.js +102 -0
  491. package/dist/kernel/config/load.js.map +1 -0
  492. package/dist/kernel/coordination/memory.d.ts +20 -0
  493. package/dist/kernel/coordination/memory.d.ts.map +1 -0
  494. package/dist/kernel/coordination/memory.js +92 -0
  495. package/dist/kernel/coordination/memory.js.map +1 -0
  496. package/dist/kernel/coordination/postgres.d.ts +47 -0
  497. package/dist/kernel/coordination/postgres.d.ts.map +1 -0
  498. package/dist/kernel/coordination/postgres.js +111 -0
  499. package/dist/kernel/coordination/postgres.js.map +1 -0
  500. package/dist/kernel/coordination/types.d.ts +37 -0
  501. package/dist/kernel/coordination/types.d.ts.map +1 -0
  502. package/dist/kernel/coordination/types.js +2 -0
  503. package/dist/kernel/coordination/types.js.map +1 -0
  504. package/dist/kernel/coordination/wait.d.ts +4 -0
  505. package/dist/kernel/coordination/wait.d.ts.map +1 -0
  506. package/dist/kernel/coordination/wait.js +38 -0
  507. package/dist/kernel/coordination/wait.js.map +1 -0
  508. package/dist/kernel/db/columns.d.ts +25 -0
  509. package/dist/kernel/db/columns.d.ts.map +1 -0
  510. package/dist/kernel/db/columns.js +32 -0
  511. package/dist/kernel/db/columns.js.map +1 -0
  512. package/dist/kernel/db/empty-in-plugin.d.ts +7 -0
  513. package/dist/kernel/db/empty-in-plugin.d.ts.map +1 -0
  514. package/dist/kernel/db/empty-in-plugin.js +28 -0
  515. package/dist/kernel/db/empty-in-plugin.js.map +1 -0
  516. package/dist/kernel/db/index.d.ts +67 -0
  517. package/dist/kernel/db/index.d.ts.map +1 -0
  518. package/dist/kernel/db/index.js +72 -0
  519. package/dist/kernel/db/index.js.map +1 -0
  520. package/dist/kernel/db/migrations/audit/0006_audit.d.ts +7 -0
  521. package/dist/kernel/db/migrations/audit/0006_audit.d.ts.map +1 -0
  522. package/dist/kernel/db/migrations/audit/0006_audit.js +125 -0
  523. package/dist/kernel/db/migrations/audit/0006_audit.js.map +1 -0
  524. package/dist/kernel/db/migrations/audit/0007_metrics.d.ts +6 -0
  525. package/dist/kernel/db/migrations/audit/0007_metrics.d.ts.map +1 -0
  526. package/dist/kernel/db/migrations/audit/0007_metrics.js +38 -0
  527. package/dist/kernel/db/migrations/audit/0007_metrics.js.map +1 -0
  528. package/dist/kernel/db/migrations/index.d.ts +10 -0
  529. package/dist/kernel/db/migrations/index.d.ts.map +1 -0
  530. package/dist/kernel/db/migrations/index.js +15 -0
  531. package/dist/kernel/db/migrations/index.js.map +1 -0
  532. package/dist/kernel/db/migrations/main/0001_core.d.ts +4 -0
  533. package/dist/kernel/db/migrations/main/0001_core.d.ts.map +1 -0
  534. package/dist/kernel/db/migrations/main/0001_core.js +178 -0
  535. package/dist/kernel/db/migrations/main/0001_core.js.map +1 -0
  536. package/dist/kernel/db/migrations/main/0002_servers.d.ts +4 -0
  537. package/dist/kernel/db/migrations/main/0002_servers.d.ts.map +1 -0
  538. package/dist/kernel/db/migrations/main/0002_servers.js +240 -0
  539. package/dist/kernel/db/migrations/main/0002_servers.js.map +1 -0
  540. package/dist/kernel/db/migrations/main/0003_auth.d.ts +4 -0
  541. package/dist/kernel/db/migrations/main/0003_auth.d.ts.map +1 -0
  542. package/dist/kernel/db/migrations/main/0003_auth.js +125 -0
  543. package/dist/kernel/db/migrations/main/0003_auth.js.map +1 -0
  544. package/dist/kernel/db/migrations/main/0004_ops.d.ts +4 -0
  545. package/dist/kernel/db/migrations/main/0004_ops.d.ts.map +1 -0
  546. package/dist/kernel/db/migrations/main/0004_ops.js +196 -0
  547. package/dist/kernel/db/migrations/main/0004_ops.js.map +1 -0
  548. package/dist/kernel/db/migrations/main/0005_evals.d.ts +4 -0
  549. package/dist/kernel/db/migrations/main/0005_evals.d.ts.map +1 -0
  550. package/dist/kernel/db/migrations/main/0005_evals.js +117 -0
  551. package/dist/kernel/db/migrations/main/0005_evals.js.map +1 -0
  552. package/dist/kernel/db/migrations/types.d.ts +17 -0
  553. package/dist/kernel/db/migrations/types.d.ts.map +1 -0
  554. package/dist/kernel/db/migrations/types.js +7 -0
  555. package/dist/kernel/db/migrations/types.js.map +1 -0
  556. package/dist/kernel/db/migrator.d.ts +29 -0
  557. package/dist/kernel/db/migrator.d.ts.map +1 -0
  558. package/dist/kernel/db/migrator.js +64 -0
  559. package/dist/kernel/db/migrator.js.map +1 -0
  560. package/dist/kernel/db/postgres.d.ts +35 -0
  561. package/dist/kernel/db/postgres.d.ts.map +1 -0
  562. package/dist/kernel/db/postgres.js +44 -0
  563. package/dist/kernel/db/postgres.js.map +1 -0
  564. package/dist/kernel/db/schema.d.ts +936 -0
  565. package/dist/kernel/db/schema.d.ts.map +1 -0
  566. package/dist/kernel/db/schema.js +61 -0
  567. package/dist/kernel/db/schema.js.map +1 -0
  568. package/dist/kernel/db/sqlite.d.ts +20 -0
  569. package/dist/kernel/db/sqlite.d.ts.map +1 -0
  570. package/dist/kernel/db/sqlite.js +31 -0
  571. package/dist/kernel/db/sqlite.js.map +1 -0
  572. package/dist/kernel/db/tools-fts.d.ts +11 -0
  573. package/dist/kernel/db/tools-fts.d.ts.map +1 -0
  574. package/dist/kernel/db/tools-fts.js +17 -0
  575. package/dist/kernel/db/tools-fts.js.map +1 -0
  576. package/dist/kernel/db/url.d.ts +17 -0
  577. package/dist/kernel/db/url.d.ts.map +1 -0
  578. package/dist/kernel/db/url.js +30 -0
  579. package/dist/kernel/db/url.js.map +1 -0
  580. package/dist/kernel/jobs/jobs.service.d.ts +24 -0
  581. package/dist/kernel/jobs/jobs.service.d.ts.map +1 -0
  582. package/dist/kernel/jobs/jobs.service.js +65 -0
  583. package/dist/kernel/jobs/jobs.service.js.map +1 -0
  584. package/dist/kernel/jobs/scheduler.d.ts +34 -0
  585. package/dist/kernel/jobs/scheduler.d.ts.map +1 -0
  586. package/dist/kernel/jobs/scheduler.js +70 -0
  587. package/dist/kernel/jobs/scheduler.js.map +1 -0
  588. package/dist/kernel/lib/clock.d.ts +11 -0
  589. package/dist/kernel/lib/clock.d.ts.map +1 -0
  590. package/dist/kernel/lib/clock.js +15 -0
  591. package/dist/kernel/lib/clock.js.map +1 -0
  592. package/dist/kernel/lib/crypto.d.ts +12 -0
  593. package/dist/kernel/lib/crypto.d.ts.map +1 -0
  594. package/dist/kernel/lib/crypto.js +48 -0
  595. package/dist/kernel/lib/crypto.js.map +1 -0
  596. package/dist/kernel/lib/errors.d.ts +29 -0
  597. package/dist/kernel/lib/errors.d.ts.map +1 -0
  598. package/dist/kernel/lib/errors.js +40 -0
  599. package/dist/kernel/lib/errors.js.map +1 -0
  600. package/dist/kernel/lib/histogram.d.ts +28 -0
  601. package/dist/kernel/lib/histogram.d.ts.map +1 -0
  602. package/dist/kernel/lib/histogram.js +70 -0
  603. package/dist/kernel/lib/histogram.js.map +1 -0
  604. package/dist/kernel/lib/ids.d.ts +3 -0
  605. package/dist/kernel/lib/ids.d.ts.map +1 -0
  606. package/dist/kernel/lib/ids.js +6 -0
  607. package/dist/kernel/lib/ids.js.map +1 -0
  608. package/dist/kernel/lib/jcs.d.ts +5 -0
  609. package/dist/kernel/lib/jcs.d.ts.map +1 -0
  610. package/dist/kernel/lib/jcs.js +14 -0
  611. package/dist/kernel/lib/jcs.js.map +1 -0
  612. package/dist/kernel/lib/json.d.ts +9 -0
  613. package/dist/kernel/lib/json.d.ts.map +1 -0
  614. package/dist/kernel/lib/json.js +21 -0
  615. package/dist/kernel/lib/json.js.map +1 -0
  616. package/dist/kernel/lib/keyset.d.ts +25 -0
  617. package/dist/kernel/lib/keyset.d.ts.map +1 -0
  618. package/dist/kernel/lib/keyset.js +36 -0
  619. package/dist/kernel/lib/keyset.js.map +1 -0
  620. package/dist/kernel/lib/logger.d.ts +12 -0
  621. package/dist/kernel/lib/logger.d.ts.map +1 -0
  622. package/dist/kernel/lib/logger.js +41 -0
  623. package/dist/kernel/lib/logger.js.map +1 -0
  624. package/dist/kernel/lib/net/safe-fetch.d.ts +36 -0
  625. package/dist/kernel/lib/net/safe-fetch.d.ts.map +1 -0
  626. package/dist/kernel/lib/net/safe-fetch.js +106 -0
  627. package/dist/kernel/lib/net/safe-fetch.js.map +1 -0
  628. package/dist/kernel/lib/net/ssrf-guard.d.ts +30 -0
  629. package/dist/kernel/lib/net/ssrf-guard.d.ts.map +1 -0
  630. package/dist/kernel/lib/net/ssrf-guard.js +78 -0
  631. package/dist/kernel/lib/net/ssrf-guard.js.map +1 -0
  632. package/dist/kernel/lib/pagination.d.ts +14 -0
  633. package/dist/kernel/lib/pagination.d.ts.map +1 -0
  634. package/dist/kernel/lib/pagination.js +40 -0
  635. package/dist/kernel/lib/pagination.js.map +1 -0
  636. package/dist/kernel/observability/metrics.d.ts +53 -0
  637. package/dist/kernel/observability/metrics.d.ts.map +1 -0
  638. package/dist/kernel/observability/metrics.js +95 -0
  639. package/dist/kernel/observability/metrics.js.map +1 -0
  640. package/dist/kernel/observability/tracing.d.ts +32 -0
  641. package/dist/kernel/observability/tracing.d.ts.map +1 -0
  642. package/dist/kernel/observability/tracing.js +116 -0
  643. package/dist/kernel/observability/tracing.js.map +1 -0
  644. package/dist/kernel/principal.d.ts +16 -0
  645. package/dist/kernel/principal.d.ts.map +1 -0
  646. package/dist/kernel/principal.js +9 -0
  647. package/dist/kernel/principal.js.map +1 -0
  648. package/dist/kernel/runtime-config.d.ts +194 -0
  649. package/dist/kernel/runtime-config.d.ts.map +1 -0
  650. package/dist/kernel/runtime-config.js +192 -0
  651. package/dist/kernel/runtime-config.js.map +1 -0
  652. package/dist/kernel/secrets/builtin.provider.d.ts +26 -0
  653. package/dist/kernel/secrets/builtin.provider.d.ts.map +1 -0
  654. package/dist/kernel/secrets/builtin.provider.js +65 -0
  655. package/dist/kernel/secrets/builtin.provider.js.map +1 -0
  656. package/dist/kernel/secrets/envelope.d.ts +16 -0
  657. package/dist/kernel/secrets/envelope.d.ts.map +1 -0
  658. package/dist/kernel/secrets/envelope.js +44 -0
  659. package/dist/kernel/secrets/envelope.js.map +1 -0
  660. package/dist/kernel/secrets/envelope.service.d.ts +38 -0
  661. package/dist/kernel/secrets/envelope.service.d.ts.map +1 -0
  662. package/dist/kernel/secrets/envelope.service.js +86 -0
  663. package/dist/kernel/secrets/envelope.service.js.map +1 -0
  664. package/dist/kernel/secrets/keyring.d.ts +30 -0
  665. package/dist/kernel/secrets/keyring.d.ts.map +1 -0
  666. package/dist/kernel/secrets/keyring.js +32 -0
  667. package/dist/kernel/secrets/keyring.js.map +1 -0
  668. package/dist/kernel/secrets/named-secrets.d.ts +33 -0
  669. package/dist/kernel/secrets/named-secrets.d.ts.map +1 -0
  670. package/dist/kernel/secrets/named-secrets.js +63 -0
  671. package/dist/kernel/secrets/named-secrets.js.map +1 -0
  672. package/dist/kernel/secrets/provider.d.ts +17 -0
  673. package/dist/kernel/secrets/provider.d.ts.map +1 -0
  674. package/dist/kernel/secrets/provider.js +2 -0
  675. package/dist/kernel/secrets/provider.js.map +1 -0
  676. package/dist/kernel/secrets/rotation.d.ts +25 -0
  677. package/dist/kernel/secrets/rotation.d.ts.map +1 -0
  678. package/dist/kernel/secrets/rotation.js +32 -0
  679. package/dist/kernel/secrets/rotation.js.map +1 -0
  680. package/dist/kernel/settings/settings.service.d.ts +98 -0
  681. package/dist/kernel/settings/settings.service.d.ts.map +1 -0
  682. package/dist/kernel/settings/settings.service.js +92 -0
  683. package/dist/kernel/settings/settings.service.js.map +1 -0
  684. package/dist/main.d.ts +2 -0
  685. package/dist/main.d.ts.map +1 -0
  686. package/dist/main.js +39 -0
  687. package/dist/main.js.map +1 -0
  688. package/dist/routes.d.ts +5 -0
  689. package/dist/routes.d.ts.map +1 -0
  690. package/dist/routes.js +58 -0
  691. package/dist/routes.js.map +1 -0
  692. package/dist/scripts/fetch-model.d.ts +2 -0
  693. package/dist/scripts/fetch-model.d.ts.map +1 -0
  694. package/dist/scripts/fetch-model.js +34 -0
  695. package/dist/scripts/fetch-model.js.map +1 -0
  696. package/dist/scripts/gen-schema.d.ts +2 -0
  697. package/dist/scripts/gen-schema.d.ts.map +1 -0
  698. package/dist/scripts/gen-schema.js +71 -0
  699. package/dist/scripts/gen-schema.js.map +1 -0
  700. package/dist/scripts/keys.d.ts +2 -0
  701. package/dist/scripts/keys.d.ts.map +1 -0
  702. package/dist/scripts/keys.js +24 -0
  703. package/dist/scripts/keys.js.map +1 -0
  704. package/dist/scripts/migrate.d.ts +2 -0
  705. package/dist/scripts/migrate.d.ts.map +1 -0
  706. package/dist/scripts/migrate.js +45 -0
  707. package/dist/scripts/migrate.js.map +1 -0
  708. package/dist/server.d.ts +30 -0
  709. package/dist/server.d.ts.map +1 -0
  710. package/dist/server.js +129 -0
  711. package/dist/server.js.map +1 -0
  712. package/dist/version.d.ts +3 -0
  713. package/dist/version.d.ts.map +1 -0
  714. package/dist/version.js +13 -0
  715. package/dist/version.js.map +1 -0
  716. package/dist/web/static.d.ts +30 -0
  717. package/dist/web/static.d.ts.map +1 -0
  718. package/dist/web/static.js +65 -0
  719. package/dist/web/static.js.map +1 -0
  720. package/package.json +106 -4
  721. package/web-dist/assets/CompositeItem-B2Bd2eM-.js +2 -0
  722. package/web-dist/assets/CompositeItem-B2Bd2eM-.js.map +1 -0
  723. package/web-dist/assets/DialogRoot-h0udFiba.js +2 -0
  724. package/web-dist/assets/DialogRoot-h0udFiba.js.map +1 -0
  725. package/web-dist/assets/DialogTitle-fTXvJGbH.js +2 -0
  726. package/web-dist/assets/DialogTitle-fTXvJGbH.js.map +1 -0
  727. package/web-dist/assets/DirectionContext-CRBE3EOa.js +2 -0
  728. package/web-dist/assets/DirectionContext-CRBE3EOa.js.map +1 -0
  729. package/web-dist/assets/FieldItemContext-B4r08RkZ.js +2 -0
  730. package/web-dist/assets/FieldItemContext-B4r08RkZ.js.map +1 -0
  731. package/web-dist/assets/FloatingPortal-D_eDEbvZ.js +2 -0
  732. package/web-dist/assets/FloatingPortal-D_eDEbvZ.js.map +1 -0
  733. package/web-dist/assets/FloatingPortalLite-DWlDzoqv.js +2 -0
  734. package/web-dist/assets/FloatingPortalLite-DWlDzoqv.js.map +1 -0
  735. package/web-dist/assets/Separator-DDDyVkeP.js +2 -0
  736. package/web-dist/assets/Separator-DDDyVkeP.js.map +1 -0
  737. package/web-dist/assets/_app-BY6-IpyI.js +2 -0
  738. package/web-dist/assets/_app-BY6-IpyI.js.map +1 -0
  739. package/web-dist/assets/_app-Ba10rJVa.js +2 -0
  740. package/web-dist/assets/_app-Ba10rJVa.js.map +1 -0
  741. package/web-dist/assets/_app-Bv2dBVot.js +2 -0
  742. package/web-dist/assets/_app-Bv2dBVot.js.map +1 -0
  743. package/web-dist/assets/_groupId-ENiG99V5.js +2 -0
  744. package/web-dist/assets/_groupId-ENiG99V5.js.map +1 -0
  745. package/web-dist/assets/_issueId-CAHjIiZ8.js +2 -0
  746. package/web-dist/assets/_issueId-CAHjIiZ8.js.map +1 -0
  747. package/web-dist/assets/_runId-XmmZmpWa.js +4 -0
  748. package/web-dist/assets/_runId-XmmZmpWa.js.map +1 -0
  749. package/web-dist/assets/_serverId-C9y6ztaL.js +2 -0
  750. package/web-dist/assets/_serverId-C9y6ztaL.js.map +1 -0
  751. package/web-dist/assets/_taskId-D8fVBV_H.js +2 -0
  752. package/web-dist/assets/_taskId-D8fVBV_H.js.map +1 -0
  753. package/web-dist/assets/_toolId-CnbF7zls.js +6 -0
  754. package/web-dist/assets/_toolId-CnbF7zls.js.map +1 -0
  755. package/web-dist/assets/alert-OPOFnW2X.js +2 -0
  756. package/web-dist/assets/alert-OPOFnW2X.js.map +1 -0
  757. package/web-dist/assets/api-client-CnTzbAbK.js +56 -0
  758. package/web-dist/assets/api-client-CnTzbAbK.js.map +1 -0
  759. package/web-dist/assets/appearance-D7nZLK7y.js +2 -0
  760. package/web-dist/assets/appearance-D7nZLK7y.js.map +1 -0
  761. package/web-dist/assets/arrow-up-Dop2Zfy9.js +2 -0
  762. package/web-dist/assets/arrow-up-Dop2Zfy9.js.map +1 -0
  763. package/web-dist/assets/audit-Cws4Sb1Z.js +2 -0
  764. package/web-dist/assets/audit-Cws4Sb1Z.js.map +1 -0
  765. package/web-dist/assets/button-0-kx6BS-.js +2 -0
  766. package/web-dist/assets/button-0-kx6BS-.js.map +1 -0
  767. package/web-dist/assets/card-bOMGzWND.js +2 -0
  768. package/web-dist/assets/card-bOMGzWND.js.map +1 -0
  769. package/web-dist/assets/chevron-right-jlmAjiMj.js +2 -0
  770. package/web-dist/assets/chevron-right-jlmAjiMj.js.map +1 -0
  771. package/web-dist/assets/client-snippet-DyzxqQDv.js +2 -0
  772. package/web-dist/assets/client-snippet-DyzxqQDv.js.map +1 -0
  773. package/web-dist/assets/code-view-Dp3S3g6k.js +4 -0
  774. package/web-dist/assets/code-view-Dp3S3g6k.js.map +1 -0
  775. package/web-dist/assets/compare-CHKwYuEP.js +2 -0
  776. package/web-dist/assets/compare-CHKwYuEP.js.map +1 -0
  777. package/web-dist/assets/components-CNkWqS3X.js +2 -0
  778. package/web-dist/assets/components-CNkWqS3X.js.map +1 -0
  779. package/web-dist/assets/components-DYbjYUzw.js +2 -0
  780. package/web-dist/assets/components-DYbjYUzw.js.map +1 -0
  781. package/web-dist/assets/composite-Bfwhy6qy.js +2 -0
  782. package/web-dist/assets/composite-Bfwhy6qy.js.map +1 -0
  783. package/web-dist/assets/confirm-dialog-BY5FJuQC.js +2 -0
  784. package/web-dist/assets/confirm-dialog-BY5FJuQC.js.map +1 -0
  785. package/web-dist/assets/connect-DEWuCUqH.js +2 -0
  786. package/web-dist/assets/connect-DEWuCUqH.js.map +1 -0
  787. package/web-dist/assets/core-CveQFPAO.js +13 -0
  788. package/web-dist/assets/core-CveQFPAO.js.map +1 -0
  789. package/web-dist/assets/create-key-dialog-DbtnDlv9.js +3 -0
  790. package/web-dist/assets/create-key-dialog-DbtnDlv9.js.map +1 -0
  791. package/web-dist/assets/createLucideIcon-4wkYGrAu.js +2 -0
  792. package/web-dist/assets/createLucideIcon-4wkYGrAu.js.map +1 -0
  793. package/web-dist/assets/crumbs-CFOzyevD.js +2 -0
  794. package/web-dist/assets/crumbs-CFOzyevD.js.map +1 -0
  795. package/web-dist/assets/data-table-DL8nsehq.js +2 -0
  796. package/web-dist/assets/data-table-DL8nsehq.js.map +1 -0
  797. package/web-dist/assets/download-BJL2mMMG.js +2 -0
  798. package/web-dist/assets/download-BJL2mMMG.js.map +1 -0
  799. package/web-dist/assets/download-Ct9K1Blk.js +2 -0
  800. package/web-dist/assets/download-Ct9K1Blk.js.map +1 -0
  801. package/web-dist/assets/draft-bar-DQo326FN.js +2 -0
  802. package/web-dist/assets/draft-bar-DQo326FN.js.map +1 -0
  803. package/web-dist/assets/engine-javascript-C30F4iNc.js +142 -0
  804. package/web-dist/assets/engine-javascript-C30F4iNc.js.map +1 -0
  805. package/web-dist/assets/env-summary-C8OSGAi1.js +2 -0
  806. package/web-dist/assets/env-summary-C8OSGAi1.js.map +1 -0
  807. package/web-dist/assets/environments-xDHrvcC0.js +2 -0
  808. package/web-dist/assets/environments-xDHrvcC0.js.map +1 -0
  809. package/web-dist/assets/evals-D103yj9M.js +2 -0
  810. package/web-dist/assets/evals-D103yj9M.js.map +1 -0
  811. package/web-dist/assets/file-drop-BUz7NVu0.js +2 -0
  812. package/web-dist/assets/file-drop-BUz7NVu0.js.map +1 -0
  813. package/web-dist/assets/file-text-BzSWwAXx.js +2 -0
  814. package/web-dist/assets/file-text-BzSWwAXx.js.map +1 -0
  815. package/web-dist/assets/file-up-DhxoycHf.js +2 -0
  816. package/web-dist/assets/file-up-DhxoycHf.js.map +1 -0
  817. package/web-dist/assets/gauge-DB20Sf_v.js +2 -0
  818. package/web-dist/assets/gauge-DB20Sf_v.js.map +1 -0
  819. package/web-dist/assets/github-dark-default-DXG-b-1a.js +2 -0
  820. package/web-dist/assets/github-dark-default-DXG-b-1a.js.map +1 -0
  821. package/web-dist/assets/github-light-default-BXViO-2h.js +2 -0
  822. package/web-dist/assets/github-light-default-BXViO-2h.js.map +1 -0
  823. package/web-dist/assets/graphql-CSsyTQ1B.js +2 -0
  824. package/web-dist/assets/graphql-CSsyTQ1B.js.map +1 -0
  825. package/web-dist/assets/inbox--axfoemS.js +2 -0
  826. package/web-dist/assets/inbox--axfoemS.js.map +1 -0
  827. package/web-dist/assets/inbox-Bg9XxN9I.js +2 -0
  828. package/web-dist/assets/inbox-Bg9XxN9I.js.map +1 -0
  829. package/web-dist/assets/index-CI-LmJP7.css +2 -0
  830. package/web-dist/assets/index-EqRZkjd6.js +17 -0
  831. package/web-dist/assets/index-EqRZkjd6.js.map +1 -0
  832. package/web-dist/assets/inertValue-BEKHztUQ.js +2 -0
  833. package/web-dist/assets/inertValue-BEKHztUQ.js.map +1 -0
  834. package/web-dist/assets/json-qhed-kSA.js +2 -0
  835. package/web-dist/assets/json-qhed-kSA.js.map +1 -0
  836. package/web-dist/assets/json-viewer-DFAY-JaC.js +2 -0
  837. package/web-dist/assets/json-viewer-DFAY-JaC.js.map +1 -0
  838. package/web-dist/assets/key-round-CPrc1zQr.js +2 -0
  839. package/web-dist/assets/key-round-CPrc1zQr.js.map +1 -0
  840. package/web-dist/assets/keys-D2H6bYnB.js +2 -0
  841. package/web-dist/assets/keys-D2H6bYnB.js.map +1 -0
  842. package/web-dist/assets/labels-B8sf8Hg_.js +2 -0
  843. package/web-dist/assets/labels-B8sf8Hg_.js.map +1 -0
  844. package/web-dist/assets/link-CByMaQfX.js +3 -0
  845. package/web-dist/assets/link-CByMaQfX.js.map +1 -0
  846. package/web-dist/assets/link-tabs-C06q3Y1p.js +2 -0
  847. package/web-dist/assets/link-tabs-C06q3Y1p.js.map +1 -0
  848. package/web-dist/assets/link-xDlPECzC.js +2 -0
  849. package/web-dist/assets/link-xDlPECzC.js.map +1 -0
  850. package/web-dist/assets/list-tree-Cq6aoA_B.js +2 -0
  851. package/web-dist/assets/list-tree-Cq6aoA_B.js.map +1 -0
  852. package/web-dist/assets/logged-out-Cia2QO9r.js +2 -0
  853. package/web-dist/assets/logged-out-Cia2QO9r.js.map +1 -0
  854. package/web-dist/assets/login-DgDPuB_V.js +2 -0
  855. package/web-dist/assets/login-DgDPuB_V.js.map +1 -0
  856. package/web-dist/assets/mode-recommendation-DoHGuZUm.js +2 -0
  857. package/web-dist/assets/mode-recommendation-DoHGuZUm.js.map +1 -0
  858. package/web-dist/assets/models-DPi2Bzvy.js +2 -0
  859. package/web-dist/assets/models-DPi2Bzvy.js.map +1 -0
  860. package/web-dist/assets/navigation-Crt8lW1m.js +2 -0
  861. package/web-dist/assets/navigation-Crt8lW1m.js.map +1 -0
  862. package/web-dist/assets/new-Ccw0Hlfl.js +5 -0
  863. package/web-dist/assets/new-Ccw0Hlfl.js.map +1 -0
  864. package/web-dist/assets/overlay-C_UeOJOw.js +2 -0
  865. package/web-dist/assets/overlay-C_UeOJOw.js.map +1 -0
  866. package/web-dist/assets/page-header-CHk7bso7.js +2 -0
  867. package/web-dist/assets/page-header-CHk7bso7.js.map +1 -0
  868. package/web-dist/assets/permissions-Bf3wb1Jv.js +2 -0
  869. package/web-dist/assets/permissions-Bf3wb1Jv.js.map +1 -0
  870. package/web-dist/assets/plug-CrM5MZO2.js +2 -0
  871. package/web-dist/assets/plug-CrM5MZO2.js.map +1 -0
  872. package/web-dist/assets/plus-C6_H380k.js +2 -0
  873. package/web-dist/assets/plus-C6_H380k.js.map +1 -0
  874. package/web-dist/assets/progress-DaZnZarb.js +2 -0
  875. package/web-dist/assets/progress-DaZnZarb.js.map +1 -0
  876. package/web-dist/assets/python-gzcpVVnB.js +2 -0
  877. package/web-dist/assets/python-gzcpVVnB.js.map +1 -0
  878. package/web-dist/assets/queries-3DiENdpp.js +2 -0
  879. package/web-dist/assets/queries-3DiENdpp.js.map +1 -0
  880. package/web-dist/assets/queries-CJD0QpGi.js +2 -0
  881. package/web-dist/assets/queries-CJD0QpGi.js.map +1 -0
  882. package/web-dist/assets/queries-CaU3gifI.js +2 -0
  883. package/web-dist/assets/queries-CaU3gifI.js.map +1 -0
  884. package/web-dist/assets/queries-DOMFJPBg.js +2 -0
  885. package/web-dist/assets/queries-DOMFJPBg.js.map +1 -0
  886. package/web-dist/assets/queries-DzYj_ZKK.js +2 -0
  887. package/web-dist/assets/queries-DzYj_ZKK.js.map +1 -0
  888. package/web-dist/assets/queries-O4X2594T.js +2 -0
  889. package/web-dist/assets/queries-O4X2594T.js.map +1 -0
  890. package/web-dist/assets/queries-iauKjcDt.js +2 -0
  891. package/web-dist/assets/queries-iauKjcDt.js.map +1 -0
  892. package/web-dist/assets/queries-yxFwGLDb.js +2 -0
  893. package/web-dist/assets/queries-yxFwGLDb.js.map +1 -0
  894. package/web-dist/assets/reason-parts-B6nt3n-F.js +2 -0
  895. package/web-dist/assets/reason-parts-B6nt3n-F.js.map +1 -0
  896. package/web-dist/assets/redirect-B4OxYbs2.js +2 -0
  897. package/web-dist/assets/redirect-B4OxYbs2.js.map +1 -0
  898. package/web-dist/assets/refresh-cw-Dk41furN.js +2 -0
  899. package/web-dist/assets/refresh-cw-Dk41furN.js.map +1 -0
  900. package/web-dist/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  901. package/web-dist/assets/route-Ba10rJVa.js +2 -0
  902. package/web-dist/assets/route-Ba10rJVa.js.map +1 -0
  903. package/web-dist/assets/route-DFvqBlRc.js +2 -0
  904. package/web-dist/assets/route-DFvqBlRc.js.map +1 -0
  905. package/web-dist/assets/score-ring-D3Ff8hXt.js +2 -0
  906. package/web-dist/assets/score-ring-D3Ff8hXt.js.map +1 -0
  907. package/web-dist/assets/section-Bq1blJ9c.js +2 -0
  908. package/web-dist/assets/section-Bq1blJ9c.js.map +1 -0
  909. package/web-dist/assets/segmented-RsFdV9xJ.js +2 -0
  910. package/web-dist/assets/segmented-RsFdV9xJ.js.map +1 -0
  911. package/web-dist/assets/separator-CcxDVEHH.js +2 -0
  912. package/web-dist/assets/separator-CcxDVEHH.js.map +1 -0
  913. package/web-dist/assets/server-BvD6BIlz.js +2 -0
  914. package/web-dist/assets/server-BvD6BIlz.js.map +1 -0
  915. package/web-dist/assets/server-switcher-hOm8Popx.js +2 -0
  916. package/web-dist/assets/server-switcher-hOm8Popx.js.map +1 -0
  917. package/web-dist/assets/servers-DBjU_qiZ.js +2 -0
  918. package/web-dist/assets/servers-DBjU_qiZ.js.map +1 -0
  919. package/web-dist/assets/settings-DCmODejD.js +2 -0
  920. package/web-dist/assets/settings-DCmODejD.js.map +1 -0
  921. package/web-dist/assets/settings-zp4uTZ2u.js +2 -0
  922. package/web-dist/assets/settings-zp4uTZ2u.js.map +1 -0
  923. package/web-dist/assets/sheet-CZ77BIgN.js +2 -0
  924. package/web-dist/assets/sheet-CZ77BIgN.js.map +1 -0
  925. package/web-dist/assets/skeleton-CuU6NqIG.js +2 -0
  926. package/web-dist/assets/skeleton-CuU6NqIG.js.map +1 -0
  927. package/web-dist/assets/sparkles-DMF5S9tx.js +2 -0
  928. package/web-dist/assets/sparkles-DMF5S9tx.js.map +1 -0
  929. package/web-dist/assets/spec-Bhk7L9IF.js +2 -0
  930. package/web-dist/assets/spec-Bhk7L9IF.js.map +1 -0
  931. package/web-dist/assets/spinner-BLf8_Ajk.js +2 -0
  932. package/web-dist/assets/spinner-BLf8_Ajk.js.map +1 -0
  933. package/web-dist/assets/states-Z2xH3pUB.js +2 -0
  934. package/web-dist/assets/states-Z2xH3pUB.js.map +1 -0
  935. package/web-dist/assets/storage-CuUK35fn.js +2 -0
  936. package/web-dist/assets/storage-CuUK35fn.js.map +1 -0
  937. package/web-dist/assets/store-SrwTVjPk.js +2 -0
  938. package/web-dist/assets/store-SrwTVjPk.js.map +1 -0
  939. package/web-dist/assets/switch-C_lbqEIt.js +2 -0
  940. package/web-dist/assets/switch-C_lbqEIt.js.map +1 -0
  941. package/web-dist/assets/tasks-CRKt_Suy.js +2 -0
  942. package/web-dist/assets/tasks-CRKt_Suy.js.map +1 -0
  943. package/web-dist/assets/timeline-Cye1s7g_.js +2 -0
  944. package/web-dist/assets/timeline-Cye1s7g_.js.map +1 -0
  945. package/web-dist/assets/tools-C5I1npEn.js +2 -0
  946. package/web-dist/assets/tools-C5I1npEn.js.map +1 -0
  947. package/web-dist/assets/tooltip--tDonqxM.js +2 -0
  948. package/web-dist/assets/tooltip--tDonqxM.js.map +1 -0
  949. package/web-dist/assets/use-cursor-stack-DIOApcfL.js +2 -0
  950. package/web-dist/assets/use-cursor-stack-DIOApcfL.js.map +1 -0
  951. package/web-dist/assets/use-debounced-value-CSowsQHr.js +2 -0
  952. package/web-dist/assets/use-debounced-value-CSowsQHr.js.map +1 -0
  953. package/web-dist/assets/use-min-width-b55txtG6.js +2 -0
  954. package/web-dist/assets/use-min-width-b55txtG6.js.map +1 -0
  955. package/web-dist/assets/use-mobile-R850ZQZG.js +2 -0
  956. package/web-dist/assets/use-mobile-R850ZQZG.js.map +1 -0
  957. package/web-dist/assets/useAriaLabelledBy-DjHYrmeF.js +2 -0
  958. package/web-dist/assets/useAriaLabelledBy-DjHYrmeF.js.map +1 -0
  959. package/web-dist/assets/useBaseQuery-BoQjiPOp.js +2 -0
  960. package/web-dist/assets/useBaseQuery-BoQjiPOp.js.map +1 -0
  961. package/web-dist/assets/useBaseUiId-BUBV7JiZ.js +2 -0
  962. package/web-dist/assets/useBaseUiId-BUBV7JiZ.js.map +1 -0
  963. package/web-dist/assets/useButton-DQ6Sgg7h.js +2 -0
  964. package/web-dist/assets/useButton-DQ6Sgg7h.js.map +1 -0
  965. package/web-dist/assets/useControlled-B9BFcdfh.js +2 -0
  966. package/web-dist/assets/useControlled-B9BFcdfh.js.map +1 -0
  967. package/web-dist/assets/useNavigate-CrwlTILa.js +2 -0
  968. package/web-dist/assets/useNavigate-CrwlTILa.js.map +1 -0
  969. package/web-dist/assets/useOpenChangeComplete-DUM-_E2z.js +2 -0
  970. package/web-dist/assets/useOpenChangeComplete-DUM-_E2z.js.map +1 -0
  971. package/web-dist/assets/usePositioner-BQnDdcQL.js +2 -0
  972. package/web-dist/assets/usePositioner-BQnDdcQL.js.map +1 -0
  973. package/web-dist/assets/useQuery-BkgWvtTa.js +2 -0
  974. package/web-dist/assets/useQuery-BkgWvtTa.js.map +1 -0
  975. package/web-dist/assets/useRegisterFieldControl-DuodOtnM.js +2 -0
  976. package/web-dist/assets/useRegisterFieldControl-DuodOtnM.js.map +1 -0
  977. package/web-dist/assets/useRouterState-DeGPqG1m.js +2 -0
  978. package/web-dist/assets/useRouterState-DeGPqG1m.js.map +1 -0
  979. package/web-dist/assets/useScrollLock-BWBVawYJ.js +2 -0
  980. package/web-dist/assets/useScrollLock-BWBVawYJ.js.map +1 -0
  981. package/web-dist/assets/useTimeout-SGSgaiy1.js +2 -0
  982. package/web-dist/assets/useTimeout-SGSgaiy1.js.map +1 -0
  983. package/web-dist/assets/useTransitionStatus-Dy_zd4z2.js +2 -0
  984. package/web-dist/assets/useTransitionStatus-Dy_zd4z2.js.map +1 -0
  985. package/web-dist/assets/useTriggerFocusGuards-9VjGYE1p.js +2 -0
  986. package/web-dist/assets/useTriggerFocusGuards-9VjGYE1p.js.map +1 -0
  987. package/web-dist/assets/useValueChanged-BqSvidps.js +2 -0
  988. package/web-dist/assets/useValueChanged-BqSvidps.js.map +1 -0
  989. package/web-dist/assets/utils-BFSetRo1.js +2 -0
  990. package/web-dist/assets/utils-BFSetRo1.js.map +1 -0
  991. package/web-dist/assets/wrench-CIdGHcvJ.js +2 -0
  992. package/web-dist/assets/wrench-CIdGHcvJ.js.map +1 -0
  993. package/web-dist/assets/x-5OcgPlDp.js +2 -0
  994. package/web-dist/assets/x-5OcgPlDp.js.map +1 -0
  995. package/web-dist/assets/yaml-rwi0_p6S.js +2 -0
  996. package/web-dist/assets/yaml-rwi0_p6S.js.map +1 -0
  997. package/web-dist/favicon.svg +1 -0
  998. package/web-dist/index.html +55 -0
  999. package/web-dist/theme-init.js +44 -0
  1000. package/README.md +0 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBaseQuery-BoQjiPOp.js","names":["isServer","__toESM","require_react","require_use_sync_external_store_shim_production","__commonJSMin","React","is","x","y","objectIs","useState","useEffect","useLayoutEffect","useDebugValue","useSyncExternalStore$2","value","getSnapshot","_useState","inst","forceUpdate","checkIfSnapshotChanged","subscribe","latestGetSnapshot","nextValue","useSyncExternalStore$1","shim","require_shim","require_with_selector_production","useSyncExternalStore","useRef","useMemo","instRef","memoizedSelector","hasMemo","nextSnapshot","selector","isEqual","currentSelection","memoizedSelection","memoizedSnapshot","nextSelection","maybeGetServerSnapshot","getServerSnapshot","require_with_selector","import_react","IsRestoringContext","useIsRestoring","import_jsx_runtime","require_jsx_runtime","QueryClientContext","useQueryClient","client","queryClient","QueryClientProvider","createValue","isReset","QueryErrorResetBoundaryContext","useQueryErrorResetBoundary","Subscribable","listener","focusManager","#setup","onFocus","#cleanup","setup","focused","#focused","isFocused","defaultTimeoutProvider","callback","delay","timeoutId","intervalId","timeoutManager","#provider","provider","systemSetTimeoutZero","isServer$1","noop","functionalUpdate","updater","input","isValidTimeout","timeUntilStale","updatedAt","staleTime","resolveQueryValue","query","matchQuery","filters","queryKey","exact","hashQueryKeyByOptions","partialMatchKey","type","isActive","stale","fetchStatus","predicate","matchMutation","mutationKey","mutation","hashKey","status","options","isPlainObject","val","key","result","a","b","i","bKeys","hasOwn","replaceEqualDeep","depth","array","isPlainArray","aSize","bItems","bSize","copy","equalItems","aItem","bItem","v","shallowEqualObjects","hasObjectPrototype","o","objectPrototype","ctor","prot","sleep","resolve","timeout","replaceData","prevData","data","keepPreviousData","previousData","addToArray","newItems","prepend","item","items","max","skipToken","ensureQueryFn","fetchOptions","shouldThrowError","throwOnError","params","fetchSignal","addConsumeAwareSignal","consumed","signal","object","internalSignal","getSignal","onCancelled","isServerFn","isServer","infiniteQueryBehavior","context","direction","oldPages","oldPageParams","currentPage","fetchFn","cancelled","signalContext","addSignalProperty","queryFn","fetchPage","param","queryFnContext","previous","page","maxPages","pageParamFn","getPreviousPageParam","getNextPageParam","oldData","remainingPages","pages","lastIndex","pageParams","defaultScheduler","createNotifyManager","queue","transactions","notifyFn","batchNotifyFn","scheduleFn","schedule","flush","originalQueue","args","fn","notifyManager","Removable","#gcTimeout","newGcTime","onlineManager","onlineListener","onOnline","offlineListener","#online","online","defaultRetryDelay","failureCount","canFetch","networkMode","CancelledError","createRetryer","isRetryCancelled","continueFn","promiseResolve","promiseReject","promise","reject","isResolved","cancel","error","cancelOptions","config","cancelRetry","continueRetry","canContinue","canStart","pause","canResume","continueResolve","run","promiseOrValue","initialPromise","retry","retryDelay","shouldRetry","Query","#abortSignalConsumed","#defaultOptions","#client","#cache","#initialState","getDefaultState","#queryType","#retryer","defaultState","successState","newData","#dispatch","observer","index","#scheduleGcIfCached","#fetchPromise","abortController","#revertState","retryer","fetchPromise","reducer","action","state","fetchState","newState","dataUpdatedAt","hasData","initialDataUpdatedAt","QueryObserver","#selectError","#currentQuery","shouldFetchOnMount","#executeFetch","#updateTimers","shouldFetchOn","#clearStaleTimeout","#clearRefetchInterval","prevOptions","prevQuery","#updateQuery","mounted","shouldFetchOptionally","#updateStaleTimeout","nextRefetchInterval","#computeRefetchInterval","#currentRefetchInterval","#updateRefetchInterval","#currentResult","#currentResultOptions","onPropTracked","target","#trackedProps","defaultedOptions","unsubscribe","resolveEarly","cachePromise","event","#shouldScheduleTimer","#staleTimeoutId","nextInterval","#refetchIntervalId","prevResult","prevResultOptions","queryInitialState","#currentQueryInitialState","isPlaceholderData","fetchOnMount","fetchOptionally","skipSelect","placeholderData","isMemoizedPlaceholder","#lastQueryWithDefinedData","#selectInput","#selectFn","#selectResult","selectError","isFetching","isPending","isError","isLoading","isStale","nextResult","notifyListeners","notifyOnChangePropsValue","notifyOnChangeProps","shouldLoadOnMount","field","ensurePreventErrorBoundaryRetry","errorResetBoundary","useClearResetErrorBoundary","getHasError","suspense","defaultThrowOnError","ensureSuspenseTimers","MIN_SUSPENSE_TIME_MS","clamp","originalStaleTime","shouldSuspend","fetchOptimistic","useBaseQuery","isRestoring","subscribed","Observer","shouldSubscribe","onStoreChange"],"sources":["../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../../../../node_modules/use-sync-external-store/shim/index.js","../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","../../../../node_modules/use-sync-external-store/shim/with-selector.js","../../../../node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js","../../../../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js","../../../../node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js","../../../../node_modules/@tanstack/query-core/build/modern/subscribable.js","../../../../node_modules/@tanstack/query-core/build/modern/focusManager.js","../../../../node_modules/@tanstack/query-core/build/modern/timeoutManager.js","../../../../node_modules/@tanstack/query-core/build/modern/utils.js","../../../../node_modules/@tanstack/query-core/build/modern/environmentManager.js","../../../../node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js","../../../../node_modules/@tanstack/query-core/build/modern/notifyManager.js","../../../../node_modules/@tanstack/query-core/build/modern/removable.js","../../../../node_modules/@tanstack/query-core/build/modern/onlineManager.js","../../../../node_modules/@tanstack/query-core/build/modern/retryer.js","../../../../node_modules/@tanstack/query-core/build/modern/query.js","../../../../node_modules/@tanstack/query-core/build/modern/queryObserver.js","../../../../node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js","../../../../node_modules/@tanstack/react-query/build/modern/suspense.js","../../../../node_modules/@tanstack/react-query/build/modern/useBaseQuery.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n","\"use client\";\nimport * as React from \"react\";\n// src/IsRestoringProvider.ts\nconst IsRestoringContext = React.createContext(false);\n/**\n* If you are using `PersistQueryClientProvider`, you can also use the `useIsRestoring` hook alongside it to\n* check if a restore is currently in progress. `useQuery` and friends also check this internally to avoid\n* race conditions between the restore and mounting queries.\n* @returns `true` while a persisted client is being restored, `false` otherwise.\n*/\nconst useIsRestoring = () => React.useContext(IsRestoringContext);\n/**\n* The Provider that `PersistQueryClientProvider` uses to signal whether a persisted client is currently\n* being restored, read by `useIsRestoring`.\n*/\nconst IsRestoringProvider = IsRestoringContext.Provider;\nexport { IsRestoringProvider, useIsRestoring };\n\n//# sourceMappingURL=IsRestoringProvider.js.map","\"use client\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n// src/QueryClientProvider.tsx\n/**\n* The context that `useQueryClient` reads from. `QueryClientProvider` is the normal way to set it.\n*/\nconst QueryClientContext = React.createContext(void 0);\n/**\n* The `useQueryClient` hook returns the current `QueryClient` instance.\n* @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n* be used.\n* @returns The current `QueryClient` instance.\n* @throws {Error} If no `queryClient` argument is passed and no `QueryClientProvider` is found in the\n* component tree.\n*/\nconst useQueryClient = (queryClient) => {\n\tconst client = React.useContext(QueryClientContext);\n\tif (queryClient) return queryClient;\n\tif (!client) throw new Error(\"No QueryClient set, use QueryClientProvider to set one\");\n\treturn client;\n};\n/**\n* Use the `QueryClientProvider` component to connect and provide a `QueryClient` to your application. Also\n* calls `client.mount()`/`client.unmount()` as this component mounts/unmounts, which subscribes the client to\n* focus/online events (resuming any paused mutations and refetching as needed when the app regains focus or\n* comes back online).\n* @param props - The `client` to provide, and the `children` that get access to it.\n* @returns The provided `children`, wrapped so they can read the `QueryClient` via `useQueryClient`.\n* @example\n* ```tsx\n* import { QueryClient, QueryClientProvider } from '@tanstack/react-query'\n*\n* const queryClient = new QueryClient()\n*\n* function App() {\n* return <QueryClientProvider client={queryClient}>...</QueryClientProvider>\n* }\n* ```\n*/\nconst QueryClientProvider = ({ client, children }) => {\n\tReact.useEffect(() => {\n\t\tclient.mount();\n\t\treturn () => {\n\t\t\tclient.unmount();\n\t\t};\n\t}, [client]);\n\treturn /* @__PURE__ */ jsx(QueryClientContext.Provider, {\n\t\tvalue: client,\n\t\tchildren\n\t});\n};\nexport { QueryClientContext, QueryClientProvider, useQueryClient };\n\n//# sourceMappingURL=QueryClientProvider.js.map","\"use client\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n// src/QueryErrorResetBoundary.tsx\n/**\n* Creates the value shared through the boundary's context, which tracks whether a reset was\n* requested.\n* @returns The `clearReset`, `isReset`, and `reset` functions of the boundary.\n*/\nfunction createValue() {\n\tlet isReset = false;\n\treturn {\n\t\t/**\n\t\t* Clears the reset state, so queries know not to try again until the boundary is reset again.\n\t\t*/\n\t\tclearReset: () => {\n\t\t\tisReset = false;\n\t\t},\n\t\t/**\n\t\t* Resets any query errors within the boundary, so queries know they can try again.\n\t\t*/\n\t\treset: () => {\n\t\t\tisReset = true;\n\t\t},\n\t\t/**\n\t\t* Returns whether the boundary has been reset and not yet cleared.\n\t\t* @returns `true` if the boundary has been reset and not yet cleared.\n\t\t*/\n\t\tisReset: () => {\n\t\t\treturn isReset;\n\t\t}\n\t};\n}\nconst QueryErrorResetBoundaryContext = React.createContext(createValue());\n/**\n* This hook will reset any query errors within the closest `QueryErrorResetBoundary`. If there is no boundary\n* defined it will reset them globally.\n* @returns The boundary's {@link QueryErrorResetBoundaryValue}.\n* @example\n* ```tsx\n* import { ErrorBoundary } from 'react-error-boundary'\n* import { useQueryErrorResetBoundary } from '@tanstack/react-query'\n*\n* function App({ children }: { children: React.ReactNode }) {\n* const { reset } = useQueryErrorResetBoundary()\n*\n* return (\n* <ErrorBoundary\n* onReset={reset}\n* fallbackRender={({ resetErrorBoundary }) => (\n* <div>\n* There was an error!\n* <button onClick={() => resetErrorBoundary()}>Try again</button>\n* </div>\n* )}\n* >\n* {children}\n* </ErrorBoundary>\n* )\n* }\n* ```\n*/\nconst useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext);\n/**\n* When using `suspense` or `throwOnError` in your queries, you need a way to let queries know that you want to\n* try again when re-rendering after some error occurred. With the `QueryErrorResetBoundary` component you can\n* reset any query errors within the boundaries of the component.\n* @param props - The `children` to render.\n* @returns The `children`, rendered as-is, or called with the boundary's {@link QueryErrorResetBoundaryValue}\n* if `children` is a function.\n* @example\n* ```tsx\n* import { ErrorBoundary } from 'react-error-boundary'\n* import { QueryErrorResetBoundary } from '@tanstack/react-query'\n*\n* function App() {\n* return (\n* <QueryErrorResetBoundary>\n* {({ reset }) => (\n* <ErrorBoundary\n* onReset={reset}\n* fallbackRender={({ resetErrorBoundary }) => (\n* <div>\n* There was an error!\n* <button onClick={() => resetErrorBoundary()}>Try again</button>\n* </div>\n* )}\n* >\n* <Page />\n* </ErrorBoundary>\n* )}\n* </QueryErrorResetBoundary>\n* )\n* }\n* ```\n*/\nconst QueryErrorResetBoundary = ({ children }) => {\n\tconst [value] = React.useState(() => createValue());\n\treturn /* @__PURE__ */ jsx(QueryErrorResetBoundaryContext.Provider, {\n\t\tvalue,\n\t\tchildren: typeof children === \"function\" ? children(value) : children\n\t});\n};\nexport { QueryErrorResetBoundary, useQueryErrorResetBoundary };\n\n//# sourceMappingURL=QueryErrorResetBoundary.js.map","// src/subscribable.ts\n/**\n* The base class behind everything in Query that you can subscribe to: `QueryCache`, `MutationCache`,\n* the observers, and the `FocusManager`/`OnlineManager` behind `focusManager` and `onlineManager`.\n* Subclasses decide what a listener receives and when it is called.\n*/\nvar Subscribable = class {\n\tconstructor() {\n\t\tthis.listeners = /* @__PURE__ */ new Set();\n\t\tthis.subscribe = this.subscribe.bind(this);\n\t}\n\t/**\n\t* Registers a listener to be called on every update this object notifies about. Returns a function\n\t* that removes the listener again — call it to stop listening. The base class never drops a listener\n\t* on its own, though some subclasses clear all of theirs in `destroy()`.\n\t* @param listener - Called on each update, with whatever the subclass passes to its subscribers.\n\t* @returns A function that removes the listener.\n\t* @example\n\t* ```ts\n\t* const unsubscribe = subscribable.subscribe(() => {\n\t* // react to the update\n\t* })\n\t*\n\t* unsubscribe()\n\t* ```\n\t*/\n\tsubscribe(listener) {\n\t\tthis.listeners.add(listener);\n\t\tthis.onSubscribe();\n\t\treturn () => {\n\t\t\tthis.listeners.delete(listener);\n\t\t\tthis.onUnsubscribe();\n\t\t};\n\t}\n\t/**\n\t* Returns `true` while at least one listener is registered, `false` once they have all unsubscribed.\n\t* @returns `true` if at least one listener is registered.\n\t*/\n\thasListeners() {\n\t\treturn this.listeners.size > 0;\n\t}\n\t/**\n\t* Called after a listener is added. Does nothing here; subclasses override it, e.g. to start\n\t* tracking what they observe once the first listener subscribes.\n\t*/\n\tonSubscribe() {}\n\t/**\n\t* Called after a listener is removed. Does nothing here; subclasses override it, e.g. to clean up\n\t* once the last listener unsubscribes.\n\t*/\n\tonUnsubscribe() {}\n};\nexport { Subscribable };\n\n//# sourceMappingURL=subscribable.js.map","import { Subscribable } from \"./subscribable.js\";\n// src/focusManager.ts\n/**\n* The `FocusManager` manages the focus state within TanStack Query.\n*\n* It can be used to change the default event listeners or to manually change the focus state.\n*/\nvar FocusManager = class extends Subscribable {\n\t#focused;\n\t#cleanup;\n\t#setup;\n\tconstructor() {\n\t\tsuper();\n\t\tthis.#setup = (onFocus) => {\n\t\t\tif (typeof window !== \"undefined\" && window.addEventListener) {\n\t\t\t\tconst listener = () => onFocus();\n\t\t\t\twindow.addEventListener(\"visibilitychange\", listener, false);\n\t\t\t\treturn () => {\n\t\t\t\t\twindow.removeEventListener(\"visibilitychange\", listener);\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tonSubscribe() {\n\t\tif (!this.#cleanup) this.setEventListener(this.#setup);\n\t}\n\tonUnsubscribe() {\n\t\tif (!this.hasListeners()) {\n\t\t\tthis.#cleanup?.();\n\t\t\tthis.#cleanup = void 0;\n\t\t}\n\t}\n\t/**\n\t* `setEventListener` can be used to set a custom event listener that will\n\t* be used to determine the focus state. The provided `setup` function\n\t* receives a `setFocused` callback: call it with a `boolean` to manually\n\t* set the focus state, or with no arguments to re-evaluate the current\n\t* focus state and notify subscribers.\n\t* @param setup - Receives the `setFocused` callback, registers the event listener, and may return\n\t* a cleanup function that is called when the listener is replaced or no longer needed.\n\t* @example\n\t* ```ts\n\t* import { focusManager } from '@tanstack/query-core'\n\t*\n\t* focusManager.setEventListener((handleFocus) => {\n\t* const listener = () => handleFocus()\n\t* // Listen to visibilitychange\n\t* if (typeof window !== 'undefined' && window.addEventListener) {\n\t* window.addEventListener('visibilitychange', listener, false)\n\t* }\n\t*\n\t* return () => {\n\t* // Be sure to unsubscribe if a new handler is set\n\t* window.removeEventListener('visibilitychange', listener)\n\t* }\n\t* })\n\t* ```\n\t*/\n\tsetEventListener(setup) {\n\t\tthis.#setup = setup;\n\t\tthis.#cleanup?.();\n\t\tthis.#cleanup = setup((focused) => {\n\t\t\tif (typeof focused === \"boolean\") this.setFocused(focused);\n\t\t\telse this.onFocus();\n\t\t});\n\t}\n\t/**\n\t* `setFocused` can be used to manually set the focus state. Set `undefined`\n\t* to fall back to the default focus check.\n\t* @param focused - The focus state, or `undefined` to use the default focus check.\n\t* @example\n\t* ```ts\n\t* import { focusManager } from '@tanstack/query-core'\n\t*\n\t* // Set focused\n\t* focusManager.setFocused(true)\n\t*\n\t* // Set unfocused\n\t* focusManager.setFocused(false)\n\t*\n\t* // Fallback to the default focus check\n\t* focusManager.setFocused(undefined)\n\t* ```\n\t*/\n\tsetFocused(focused) {\n\t\tif (this.#focused !== focused) {\n\t\t\tthis.#focused = focused;\n\t\t\tthis.onFocus();\n\t\t}\n\t}\n\t/**\n\t* `onFocus` notifies all subscribed listeners with the current focus state.\n\t*/\n\tonFocus() {\n\t\tconst isFocused = this.isFocused();\n\t\tthis.listeners.forEach((listener) => {\n\t\t\tlistener(isFocused);\n\t\t});\n\t}\n\t/**\n\t* `isFocused` can be used to get the current focus state.\n\t* @returns The focus state set with `setFocused`, or otherwise whether the document is visible.\n\t*/\n\tisFocused() {\n\t\tif (typeof this.#focused === \"boolean\") return this.#focused;\n\t\treturn globalThis.document?.visibilityState !== \"hidden\";\n\t}\n};\n/**\n* Singleton instance of {@link FocusManager}, used to manage and observe the focus state within TanStack Query.\n*/\nconst focusManager = new FocusManager();\nexport { FocusManager, focusManager };\n\n//# sourceMappingURL=focusManager.js.map","// src/timeoutManager.ts\nconst defaultTimeoutProvider = {\n\tsetTimeout: (callback, delay) => setTimeout(callback, delay),\n\tclearTimeout: (timeoutId) => clearTimeout(timeoutId),\n\tsetInterval: (callback, delay) => setInterval(callback, delay),\n\tclearInterval: (intervalId) => clearInterval(intervalId)\n};\n/**\n* Allows customization of how timeouts are created.\n*\n* `@tanstack/query-core` makes liberal use of timeouts to implement `staleTime`\n* and `gcTime`. The default TimeoutManager provider uses the platform's global\n* `setTimeout` implementation, which is known to have scalability issues with\n* thousands of timeouts on the event loop.\n*\n* If you hit this limitation, consider providing a custom TimeoutProvider that\n* coalesces timeouts.\n*/\nvar TimeoutManager = class {\n\t#provider = defaultTimeoutProvider;\n\t#providerCalled = false;\n\t/**\n\t* `setTimeoutProvider` can be used to set a custom implementation of the\n\t* `setTimeout`, `clearTimeout`, `setInterval`, `clearInterval` functions,\n\t* called a `TimeoutProvider`.\n\t*\n\t* This may be useful if you notice event loop performance issues with\n\t* thousands of queries. A custom TimeoutProvider could also support timer\n\t* delays longer than the global `setTimeout` maximum delay value of about\n\t* 24 days.\n\t*\n\t* It is important to call `setTimeoutProvider` before creating a\n\t* QueryClient or queries, so that the same provider is used consistently\n\t* for all timers in the application, since different TimeoutProviders\n\t* cannot cancel each others' timers.\n\t* @param provider - The `TimeoutProvider` to use for all timers from now on.\n\t* @example\n\t* ```ts\n\t* import { timeoutManager, QueryClient } from '@tanstack/query-core'\n\t* import { CustomTimeoutProvider } from './CustomTimeoutProvider'\n\t*\n\t* timeoutManager.setTimeoutProvider(new CustomTimeoutProvider())\n\t*\n\t* export const queryClient = new QueryClient()\n\t* ```\n\t*/\n\tsetTimeoutProvider(provider) {\n\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\tif (this.#providerCalled && provider !== this.#provider) console.error(`[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, {\n\t\t\t\tprevious: this.#provider,\n\t\t\t\tprovider\n\t\t\t});\n\t\t}\n\t\tthis.#provider = provider;\n\t\tif (process.env.NODE_ENV !== \"production\") this.#providerCalled = false;\n\t}\n\t/**\n\t* `setTimeout` schedules a callback to run after approximately `delay`\n\t* milliseconds, like the global `setTimeout` function. The callback can be\n\t* canceled with `clearTimeout`.\n\t*\n\t* It returns a timer ID, which may be a number or an object that can be\n\t* coerced to a number via `Symbol.toPrimitive`.\n\t* @param callback - The function to call when the timeout elapses.\n\t* @param delay - The time to wait before calling `callback`, in milliseconds.\n\t* @returns The timer ID, to pass to {@link TimeoutManager#clearTimeout}.\n\t* @example\n\t* ```ts\n\t* import { timeoutManager } from '@tanstack/query-core'\n\t*\n\t* const timeoutId = timeoutManager.setTimeout(\n\t* () => console.log('ran at:', new Date()),\n\t* 1000,\n\t* )\n\t*\n\t* const timeoutIdNumber: number = Number(timeoutId)\n\t* ```\n\t*/\n\tsetTimeout(callback, delay) {\n\t\tif (process.env.NODE_ENV !== \"production\") this.#providerCalled = true;\n\t\treturn this.#provider.setTimeout(callback, delay);\n\t}\n\t/**\n\t* `clearTimeout` cancels a timeout callback scheduled with `setTimeout`,\n\t* like the global `clearTimeout` function. It should be called with a\n\t* timer ID returned by `setTimeout`.\n\t* @param timeoutId - The timer ID returned by `setTimeout`, or `undefined`.\n\t* @example\n\t* ```ts\n\t* import { timeoutManager } from '@tanstack/query-core'\n\t*\n\t* const timeoutId = timeoutManager.setTimeout(\n\t* () => console.log('ran at:', new Date()),\n\t* 1000,\n\t* )\n\t*\n\t* timeoutManager.clearTimeout(timeoutId)\n\t* ```\n\t*/\n\tclearTimeout(timeoutId) {\n\t\tthis.#provider.clearTimeout(timeoutId);\n\t}\n\t/**\n\t* `setInterval` schedules a callback to be called approximately every\n\t* `delay` milliseconds, like the global `setInterval` function.\n\t*\n\t* Like `setTimeout`, it returns a timer ID, which may be a number or an\n\t* object that can be coerced to a number via `Symbol.toPrimitive`.\n\t* @param callback - The function to call on every interval.\n\t* @param delay - The time between calls, in milliseconds.\n\t* @returns The timer ID, to pass to {@link TimeoutManager#clearInterval}.\n\t* @example\n\t* ```ts\n\t* import { timeoutManager } from '@tanstack/query-core'\n\t*\n\t* const intervalId = timeoutManager.setInterval(\n\t* () => console.log('ran at:', new Date()),\n\t* 1000,\n\t* )\n\t* ```\n\t*/\n\tsetInterval(callback, delay) {\n\t\tif (process.env.NODE_ENV !== \"production\") this.#providerCalled = true;\n\t\treturn this.#provider.setInterval(callback, delay);\n\t}\n\t/**\n\t* `clearInterval` can be used to cancel an interval, like the global\n\t* `clearInterval` function. It should be called with an interval ID\n\t* returned by `setInterval`.\n\t* @param intervalId - The timer ID returned by `setInterval`, or `undefined`.\n\t* @example\n\t* ```ts\n\t* import { timeoutManager } from '@tanstack/query-core'\n\t*\n\t* const intervalId = timeoutManager.setInterval(\n\t* () => console.log('ran at:', new Date()),\n\t* 1000,\n\t* )\n\t*\n\t* timeoutManager.clearInterval(intervalId)\n\t* ```\n\t*/\n\tclearInterval(intervalId) {\n\t\tthis.#provider.clearInterval(intervalId);\n\t}\n};\n/**\n* Singleton instance of {@link TimeoutManager}, used throughout TanStack Query to schedule and cancel timers.\n*/\nconst timeoutManager = new TimeoutManager();\n/**\n* In many cases code wants to delay to the next event loop tick; this is not\n* mediated by {@link timeoutManager}.\n*\n* This function is provided to make auditing the `tanstack/query-core` for\n* incorrect use of system `setTimeout` easier.\n* @param callback - The function to call on the next event loop tick.\n*/\nfunction systemSetTimeoutZero(callback) {\n\tsetTimeout(callback, 0);\n}\nexport { TimeoutManager, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager };\n\n//# sourceMappingURL=timeoutManager.js.map","import { timeoutManager } from \"./timeoutManager.js\";\n// src/utils.ts\n/**\n* @deprecated use `environmentManager.isServer()` instead.\n*/\nconst isServer = typeof window === \"undefined\" || \"Deno\" in globalThis;\nfunction noop() {}\n/**\n* Resolves an {@link Updater}: calls it with `input` if it is a function, otherwise returns it as\n* is.\n* @param updater - The new value, or a function that receives `input` and returns the new value.\n* @param input - The current value, passed to `updater` if it is a function.\n* @returns The new value.\n*/\nfunction functionalUpdate(updater, input) {\n\treturn typeof updater === \"function\" ? updater(input) : updater;\n}\n/**\n* Checks whether a value can be used as a timeout: a non-negative, finite number.\n* @param value - The value to check.\n* @returns `true` if `value` is a number that is `>= 0` and not `Infinity`.\n*/\nfunction isValidTimeout(value) {\n\treturn typeof value === \"number\" && value >= 0 && value !== Infinity;\n}\n/**\n* Calculates how long until data updated at `updatedAt` becomes stale.\n* @param updatedAt - The timestamp, in milliseconds, at which the data was last updated.\n* @param staleTime - The time, in milliseconds, after which data is considered stale. Defaults to\n* `0`.\n* @returns The remaining time in milliseconds, or `0` if the data is already stale.\n*/\nfunction timeUntilStale(updatedAt, staleTime) {\n\treturn Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\n/**\n* Resolves an option that can be given either as a value or as a function of the query, such as\n* `staleTime`.\n* @param value - The option value, or a function that receives `query` and returns the value.\n* @param query - The query passed to `value` if it is a function.\n* @returns The resolved value, or `undefined` if `value` is `undefined`.\n*/\nfunction resolveQueryValue(value, query) {\n\treturn typeof value === \"function\" ? value(query) : value;\n}\n/**\n* Checks whether a query matches the given {@link QueryFilters}.\n* Every filter that is specified must match; filters that are left unspecified are ignored.\n* @param filters - The filters to check the query against.\n* @param query - The query to check.\n* @returns `true` if the query matches every specified filter.\n* @example\n* ```ts\n* const queryCache = queryClient.getQueryCache()\n*\n* const matchingQueries = queryCache\n* .getAll()\n* .filter((query) => matchQuery({ queryKey: ['posts'] }, query))\n* ```\n*/\nfunction matchQuery(filters, query) {\n\tconst { type = \"all\", exact, fetchStatus, predicate, queryKey, stale } = filters;\n\tif (queryKey) {\n\t\tif (exact) {\n\t\t\tif (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) return false;\n\t\t} else if (!partialMatchKey(query.queryKey, queryKey)) return false;\n\t}\n\tif (type !== \"all\") {\n\t\tconst isActive = query.isActive();\n\t\tif (type === \"active\" && !isActive) return false;\n\t\tif (type === \"inactive\" && isActive) return false;\n\t}\n\tif (typeof stale === \"boolean\" && query.isStale() !== stale) return false;\n\tif (fetchStatus && fetchStatus !== query.state.fetchStatus) return false;\n\tif (predicate && !predicate(query)) return false;\n\treturn true;\n}\n/**\n* Checks whether a mutation matches the given {@link MutationFilters}.\n* Every filter that is specified must match; filters that are left unspecified are ignored.\n* If a `mutationKey` filter is provided but the mutation has no `mutationKey` of its own, it does not match.\n* @param filters - The filters to check the mutation against.\n* @param mutation - The mutation to check.\n* @returns `true` if the mutation matches every specified filter.\n* @example\n* ```ts\n* const mutationCache = queryClient.getMutationCache()\n*\n* const matchingMutations = mutationCache\n* .getAll()\n* .filter((mutation) => matchMutation({ mutationKey: ['addPost'] }, mutation))\n* ```\n*/\nfunction matchMutation(filters, mutation) {\n\tconst { exact, status, predicate, mutationKey } = filters;\n\tif (mutationKey) {\n\t\tif (!mutation.options.mutationKey) return false;\n\t\tif (exact) {\n\t\t\tif (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) return false;\n\t\t} else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) return false;\n\t}\n\tif (status && mutation.state.status !== status) return false;\n\tif (predicate && !predicate(mutation)) return false;\n\treturn true;\n}\n/**\n* Hashes a query key with the query's `queryKeyHashFn` option, falling back to {@link hashKey}.\n* @param queryKey - The query key to hash.\n* @param options - The query options that may provide a custom `queryKeyHashFn`.\n* @returns The query hash, a string that identifies the query in the cache.\n*/\nfunction hashQueryKeyByOptions(queryKey, options) {\n\treturn (options?.queryKeyHashFn || hashKey)(queryKey);\n}\n/**\n* Default query & mutation keys hash function.\n* Hashes the value into a stable hash.\n* @param queryKey - The query or mutation key to hash.\n* @returns The stable hash of the key, as a JSON string.\n* @example\n* ```ts\n* // Object keys are sorted, so key order doesn't affect the hash:\n* hashKey(['todos', { page: 1, filter: 'done' }]) // === '[\"todos\",{\"filter\":\"done\",\"page\":1}]'\n* ```\n*/\nfunction hashKey(queryKey) {\n\treturn JSON.stringify(queryKey, (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {\n\t\tresult[key] = val[key];\n\t\treturn result;\n\t}, {}) : val);\n}\nfunction partialMatchKey(a, b) {\n\tif (a === b) return true;\n\tif (typeof a !== typeof b) return false;\n\tif (a && b && typeof a === \"object\" && typeof b === \"object\") {\n\t\tif (Array.isArray(a) !== Array.isArray(b)) return false;\n\t\tif (Array.isArray(a) && Array.isArray(b)) {\n\t\t\tif (b.length > a.length) return false;\n\t\t\tfor (let i = 0; i < b.length; i++) if (!partialMatchKey(a[i], b[i])) return false;\n\t\t\treturn true;\n\t\t}\n\t\tconst bKeys = Object.keys(b);\n\t\tfor (const key of bKeys) if (!partialMatchKey(a[key], b[key])) return false;\n\t\treturn true;\n\t}\n\treturn false;\n}\nconst hasOwn = Object.prototype.hasOwnProperty;\nfunction replaceEqualDeep(a, b, depth = 0) {\n\tif (a === b) return a;\n\tif (depth > 500) return b;\n\tconst array = isPlainArray(a) && isPlainArray(b);\n\tif (!array && !(isPlainObject(a) && isPlainObject(b))) return b;\n\tconst aSize = (array ? a : Object.keys(a)).length;\n\tconst bItems = array ? b : Object.keys(b);\n\tconst bSize = bItems.length;\n\tconst copy = array ? new Array(bSize) : {};\n\tlet equalItems = 0;\n\tfor (let i = 0; i < bSize; i++) {\n\t\tconst key = array ? i : bItems[i];\n\t\tconst aItem = a[key];\n\t\tconst bItem = b[key];\n\t\tif (aItem === bItem) {\n\t\t\tcopy[key] = aItem;\n\t\t\tif (array ? i < aSize : hasOwn.call(a, key)) equalItems++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (aItem === null || bItem === null || typeof aItem !== \"object\" || typeof bItem !== \"object\") {\n\t\t\tcopy[key] = bItem;\n\t\t\tcontinue;\n\t\t}\n\t\tconst v = replaceEqualDeep(aItem, bItem, depth + 1);\n\t\tcopy[key] = v;\n\t\tif (v === aItem) equalItems++;\n\t}\n\treturn aSize === bSize && equalItems === aSize ? a : copy;\n}\n/**\n* Shallow compare objects.\n* @param a - The first object.\n* @param b - The second object, or `undefined`.\n* @returns `true` if both objects have the same keys, with strictly equal values for each key.\n*/\nfunction shallowEqualObjects(a, b) {\n\tif (!b || Object.keys(a).length !== Object.keys(b).length) return false;\n\tfor (const key of Object.keys(a)) if (!hasOwn.call(b, key) || a[key] !== b[key]) return false;\n\treturn true;\n}\n/**\n* Checks whether a value is an array with no holes and no extra properties.\n* @param value - The value to check.\n* @returns `true` if `value` is an array whose number of own keys equals its `length`.\n*/\nfunction isPlainArray(value) {\n\treturn Array.isArray(value) && value.length === Object.keys(value).length;\n}\n/**\n* Checks whether a value is a plain object, e.g. created with an object literal or\n* `Object.create(null)`.\n* @param o - The value to check.\n* @returns `true` if `o` is a plain object.\n*/\nfunction isPlainObject(o) {\n\tif (!hasObjectPrototype(o)) return false;\n\tconst objectPrototype = Object.getPrototypeOf(o);\n\tconst ctor = objectPrototype?.constructor;\n\tif (ctor === void 0) return true;\n\tif (typeof ctor !== \"function\") return false;\n\tconst prot = ctor.prototype;\n\tif (!hasObjectPrototype(prot)) return false;\n\tif (!prot.hasOwnProperty(\"isPrototypeOf\")) return false;\n\tif (objectPrototype !== Object.prototype) return false;\n\treturn true;\n}\n/**\n* Checks whether a value's `Object.prototype.toString` tag is `[object Object]`.\n* @param o - The value to check.\n* @returns `true` if the tag is `[object Object]`.\n*/\nfunction hasObjectPrototype(o) {\n\treturn Object.prototype.toString.call(o) === \"[object Object]\";\n}\n/**\n* Waits for the given time, using the configured {@link timeoutManager}.\n* @param timeout - The time to wait, in milliseconds.\n* @returns A promise that resolves after `timeout` milliseconds.\n*/\nfunction sleep(timeout) {\n\treturn new Promise((resolve) => {\n\t\ttimeoutManager.setTimeout(resolve, timeout);\n\t});\n}\n/**\n* Applies a query's `structuralSharing` option when writing new data.\n* @param prevData - The previously cached data.\n* @param data - The new data.\n* @param options - The query options, whose `structuralSharing` decides how the data is merged.\n* @returns The result of a custom `structuralSharing` function, `data` with its unchanged parts\n* replaced by those of `prevData` by default, or `data` as is if `structuralSharing` is `false`.\n* @throws {Error} The error from the default structural sharing, e.g. when the data is not JSON serializable.\n* Outside production, it is also logged to the console.\n*/\nfunction replaceData(prevData, data, options) {\n\tif (typeof options.structuralSharing === \"function\") return options.structuralSharing(prevData, data);\n\telse if (options.structuralSharing !== false) {\n\t\tif (process.env.NODE_ENV !== \"production\") try {\n\t\t\treturn replaceEqualDeep(prevData, data);\n\t\t} catch (error) {\n\t\t\tconsole.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`);\n\t\t\tthrow error;\n\t\t}\n\t\treturn replaceEqualDeep(prevData, data);\n\t}\n\treturn data;\n}\n/**\n* Intended to be passed as a query's `placeholderData` option, for example\n* `placeholderData: keepPreviousData`. Instead of resetting the query's data to `undefined` while a new\n* query key is fetching, it keeps displaying the previously fetched data until the new data arrives.\n* @param previousData - The data of the previous query key, passed by the observer.\n* @returns The previous data, unchanged.\n* @example\n* ```ts\n* new QueryObserver(queryClient, {\n* queryKey: ['posts', page],\n* queryFn: () => fetchPosts(page),\n* placeholderData: keepPreviousData,\n* })\n* ```\n*/\nfunction keepPreviousData(previousData) {\n\treturn previousData;\n}\n/**\n* Adds an item to one end of a new array. If the result exceeds `max`, removes\n* excess items from the opposite end.\n* @param items - The current items.\n* @param item - The value to add.\n* @param max - The maximum number of items to keep. Omit it or use `0` for no limit.\n* @param prepend - Pass `true` to add at the start. The default is to add at the end.\n* @returns A new array with `item` added.\n*/\nfunction addToArray(items, item, max, prepend) {\n\tconst newItems = prepend ? [item, ...items] : [...items, item];\n\tif (max && newItems.length > max) return prepend ? newItems.slice(0, max) : newItems.slice(-max);\n\treturn newItems;\n}\n/**\n* Sentinel value that can be passed as a query's `queryFn` to conditionally disable the query (equivalent\n* to `enabled: false`) while preserving full type inference for the query's data. Unlike `enabled: false`,\n* a query disabled via `skipToken` cannot be triggered with `refetch`.\n* @example\n* ```ts\n* new QueryObserver(queryClient, {\n* queryKey: ['post', postId],\n* queryFn: postId != null ? () => fetchPost(postId) : skipToken,\n* })\n* ```\n*/\nconst skipToken = Symbol();\n/**\n* Returns the function to call for a fetch. If there is no `queryFn` but the fetch was started from\n* an `initialPromise`, that promise is returned instead. If there is no usable `queryFn` (missing or\n* {@link skipToken}), the returned function rejects with a `Missing queryFn` error.\n* @param options - The query options with the `queryFn`, and the `queryHash` used in error messages.\n* @param fetchOptions - The fetch options, which may carry an `initialPromise`.\n* @returns The function to call for the fetch.\n*/\nfunction ensureQueryFn(options, fetchOptions) {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tif (options.queryFn === skipToken) console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`);\n\t}\n\tif (!options.queryFn && fetchOptions?.initialPromise) return () => fetchOptions.initialPromise;\n\tif (!options.queryFn || options.queryFn === skipToken) return () => Promise.reject(/* @__PURE__ */ new Error(`Missing queryFn: '${options.queryHash}'`));\n\treturn options.queryFn;\n}\n/**\n* Resolves a `throwOnError` option to a boolean.\n* If `throwOnError` is a function, it is called with `params` (e.g. the error and, depending on the caller,\n* additional context such as the query or mutation) and its result is returned, allowing the throwing\n* behavior to be decided per error. Otherwise, `throwOnError` itself is coerced to a boolean (`undefined`\n* resolves to `false`).\n* @param throwOnError - The `throwOnError` option: a boolean, a function that decides per error, or\n* `undefined`.\n* @param params - The arguments passed to `throwOnError` if it is a function.\n* @returns Whether the error should be thrown.\n* @example\n* ```ts\n* const throwOnError =\n* query.state.error && typeof options.throwOnError === 'function'\n* ? shouldThrowError(options.throwOnError, [query.state.error, query])\n* : options.throwOnError\n* ```\n*/\nfunction shouldThrowError(throwOnError, params) {\n\tif (typeof throwOnError === \"function\") return throwOnError(...params);\n\treturn !!throwOnError;\n}\nconst fetchSignal = Symbol();\n/**\n* Adds a lazy `signal` getter to an object, such as a query function context. The first time\n* `signal` is read, `onCancelled` is registered for the signal's `abort` event (or called right\n* away if it is already aborted), so cancellation is only tracked when the signal is actually used.\n* @param object - The object to add the `signal` property to.\n* @param getSignal - Returns the `AbortSignal`. Called once, when `signal` is first read.\n* @param onCancelled - Called when the signal is aborted, if `signal` was read.\n* @param internalSignal - The fetch signal to forward without consuming the getter.\n* @returns The same object, with the `signal` property added.\n*/\nfunction addConsumeAwareSignal(object, getSignal, onCancelled, internalSignal) {\n\tlet consumed = false;\n\tlet signal;\n\tObject.defineProperties(object, {\n\t\t[fetchSignal]: { value: internalSignal },\n\t\tsignal: {\n\t\t\tenumerable: true,\n\t\t\tget: () => {\n\t\t\t\tsignal ??= getSignal();\n\t\t\t\tif (consumed) return signal;\n\t\t\t\tconsumed = true;\n\t\t\t\tif (signal.aborted) onCancelled();\n\t\t\t\telse signal.addEventListener(\"abort\", onCancelled, { once: true });\n\t\t\t\treturn signal;\n\t\t\t}\n\t\t}\n\t});\n\treturn object;\n}\nexport { addConsumeAwareSignal, addToArray, ensureQueryFn, fetchSignal, functionalUpdate, hashKey, hashQueryKeyByOptions, isPlainArray, isPlainObject, isServer, isValidTimeout, keepPreviousData, matchMutation, matchQuery, noop, partialMatchKey, replaceData, replaceEqualDeep, resolveQueryValue, shallowEqualObjects, shouldThrowError, skipToken, sleep, timeUntilStale };\n\n//# sourceMappingURL=utils.js.map","import { isServer as isServer$1 } from \"./utils.js\";\n// src/environmentManager.ts\nlet isServerFn = () => isServer$1;\n/**\n* Returns whether the current runtime should be treated as a server environment.\n* @returns `true` if the runtime is treated as a server.\n*/\nconst isServer = () => isServerFn();\n/**\n* Manages how TanStack Query detects whether the current runtime should be treated as\n* server-side, which disables scheduling refetch timers and changes the default `retry` count\n* and `gcTime`. By default, the detection treats a missing `window` (or the presence of a\n* `Deno` global) as server.\n*\n* Override this for runtimes where that default detection would give the wrong answer — for\n* example, a Service Worker, where `window` is undefined even though the environment should\n* behave like a client.\n* @example\n* ```ts\n* import { environmentManager } from '@tanstack/query-core'\n*\n* environmentManager.setIsServer(() => false)\n* ```\n*/\nconst environmentManager = {\n\tisServer,\n\t/**\n\t* Overrides the server check globally.\n\t* @param isServerValue - A function that returns whether the runtime should be treated as a\n\t* server.\n\t*/\n\tsetIsServer(isServerValue) {\n\t\tisServerFn = isServerValue;\n\t}\n};\nexport { environmentManager, isServer };\n\n//# sourceMappingURL=environmentManager.js.map","import { addConsumeAwareSignal, addToArray, ensureQueryFn, fetchSignal } from \"./utils.js\";\n// src/infiniteQueryBehavior.ts\n/**\n* Creates the behavior that fetches the pages of an infinite query: the next or previous page for\n* `fetchNextPage`/`fetchPreviousPage`, or all pages again from the start on a refetch.\n* @param pages - The number of pages to fetch from the start when all pages are fetched again,\n* e.g. from the `pages` option of `queryClient.infiniteQuery`. Defaults to the number of cached\n* pages.\n* @returns The query behavior to set on an infinite query.\n*/\nfunction infiniteQueryBehavior(pages) {\n\treturn { onFetch: (context, query) => {\n\t\tconst options = context.options;\n\t\tconst direction = context.fetchOptions?.meta?.fetchMore?.direction;\n\t\tconst oldPages = context.state.data?.pages || [];\n\t\tconst oldPageParams = context.state.data?.pageParams || [];\n\t\tlet result = {\n\t\t\tpages: [],\n\t\t\tpageParams: []\n\t\t};\n\t\tlet currentPage = 0;\n\t\tconst fetchFn = async () => {\n\t\t\tlet cancelled = false;\n\t\t\tconst signalContext = context;\n\t\t\tconst addSignalProperty = (object) => {\n\t\t\t\taddConsumeAwareSignal(object, () => context.signal, () => cancelled = true, signalContext[fetchSignal]);\n\t\t\t};\n\t\t\tconst queryFn = ensureQueryFn(context.options, context.fetchOptions);\n\t\t\tconst fetchPage = async (data, param, previous) => {\n\t\t\t\tif (cancelled) return Promise.reject(context.signal.reason);\n\t\t\t\tif (param == null && data.pages.length) return Promise.resolve(data);\n\t\t\t\tconst createQueryFnContext = () => {\n\t\t\t\t\tconst queryFnContext = {\n\t\t\t\t\t\tclient: context.client,\n\t\t\t\t\t\tqueryKey: context.queryKey,\n\t\t\t\t\t\tpageParam: param,\n\t\t\t\t\t\tdirection: previous ? \"backward\" : \"forward\",\n\t\t\t\t\t\tmeta: context.options.meta\n\t\t\t\t\t};\n\t\t\t\t\taddSignalProperty(queryFnContext);\n\t\t\t\t\treturn queryFnContext;\n\t\t\t\t};\n\t\t\t\tconst queryFnContext = createQueryFnContext();\n\t\t\t\tconst page = await queryFn(queryFnContext);\n\t\t\t\tconst { maxPages } = context.options;\n\t\t\t\treturn {\n\t\t\t\t\tpages: addToArray(data.pages, page, maxPages, previous),\n\t\t\t\t\tpageParams: addToArray(data.pageParams, param, maxPages, previous)\n\t\t\t\t};\n\t\t\t};\n\t\t\tif (direction && oldPages.length) {\n\t\t\t\tconst previous = direction === \"backward\";\n\t\t\t\tconst pageParamFn = previous ? getPreviousPageParam : getNextPageParam;\n\t\t\t\tconst oldData = {\n\t\t\t\t\tpages: oldPages,\n\t\t\t\t\tpageParams: oldPageParams\n\t\t\t\t};\n\t\t\t\tresult = await fetchPage(oldData, pageParamFn(options, oldData), previous);\n\t\t\t} else {\n\t\t\t\tconst remainingPages = pages ?? oldPages.length;\n\t\t\t\tdo {\n\t\t\t\t\tconst param = currentPage === 0 ? oldPageParams[0] === void 0 ? options.initialPageParam : oldPageParams[0] : getNextPageParam(options, result);\n\t\t\t\t\tif (currentPage > 0 && param == null) break;\n\t\t\t\t\tresult = await fetchPage(result, param);\n\t\t\t\t\tcurrentPage++;\n\t\t\t\t} while (currentPage < remainingPages);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\t\tif (context.options.persister) context.fetchFn = () => {\n\t\t\treturn context.options.persister?.(fetchFn, {\n\t\t\t\tclient: context.client,\n\t\t\t\tqueryKey: context.queryKey,\n\t\t\t\tmeta: context.options.meta,\n\t\t\t\tsignal: context.signal\n\t\t\t}, query);\n\t\t};\n\t\telse context.fetchFn = fetchFn;\n\t} };\n}\n/**\n* Computes the page param of the page after the last one, with the `getNextPageParam` option.\n* @param options - The infinite query options.\n* @param data - The current pages and page params.\n* @returns The next page param, or `undefined` if there are no pages yet.\n*/\nfunction getNextPageParam(options, { pages, pageParams }) {\n\tconst lastIndex = pages.length - 1;\n\treturn pages.length > 0 ? options.getNextPageParam(pages[lastIndex], pages, pageParams[lastIndex], pageParams) : void 0;\n}\n/**\n* Computes the page param of the page before the first one, with the `getPreviousPageParam`\n* option.\n* @param options - The infinite query options.\n* @param data - The current pages and page params.\n* @returns The previous page param, or `undefined` if there are no pages yet or no\n* `getPreviousPageParam` option.\n*/\nfunction getPreviousPageParam(options, { pages, pageParams }) {\n\treturn pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0;\n}\n/**\n* Checks if there is a next page.\n* @param options - The infinite query options with `getNextPageParam`.\n* @param data - The current pages and page params.\n* @returns `true` if `getNextPageParam` returns a value other than `null` or `undefined`.\n*/\nfunction hasNextPage(options, data) {\n\tif (!data) return false;\n\treturn getNextPageParam(options, data) != null;\n}\n/**\n* Checks if there is a previous page.\n* @param options - The infinite query options with `getPreviousPageParam`.\n* @param data - The current pages and page params.\n* @returns `true` if `getPreviousPageParam` is set and returns a value other than `null` or\n* `undefined`.\n*/\nfunction hasPreviousPage(options, data) {\n\tif (!data || !options.getPreviousPageParam) return false;\n\treturn getPreviousPageParam(options, data) != null;\n}\nexport { hasNextPage, hasPreviousPage, infiniteQueryBehavior };\n\n//# sourceMappingURL=infiniteQueryBehavior.js.map","import { systemSetTimeoutZero } from \"./timeoutManager.js\";\n// src/notifyManager.ts\n/**\n* Default scheduling function used by the notify manager.\n* Schedules the callback with the system's `setTimeout(callback, 0)`.\n*/\nconst defaultScheduler = systemSetTimeoutZero;\n/**\n* Creates a notify manager, which schedules and batches notifications to subscribers. Query uses a\n* single instance of it, exported as {@link notifyManager}.\n* @returns A new notify manager.\n*/\nfunction createNotifyManager() {\n\tlet queue = [];\n\tlet transactions = 0;\n\tlet notifyFn = (callback) => {\n\t\tcallback();\n\t};\n\tlet batchNotifyFn = (callback) => {\n\t\tcallback();\n\t};\n\tlet scheduleFn = defaultScheduler;\n\tconst schedule = (callback) => {\n\t\tif (transactions) queue.push(callback);\n\t\telse scheduleFn(() => {\n\t\t\tnotifyFn(callback);\n\t\t});\n\t};\n\tconst flush = () => {\n\t\tconst originalQueue = queue;\n\t\tqueue = [];\n\t\tif (originalQueue.length) scheduleFn(() => {\n\t\t\tbatchNotifyFn(() => {\n\t\t\t\toriginalQueue.forEach((callback) => {\n\t\t\t\t\tnotifyFn(callback);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t};\n\treturn {\n\t\t/**\n\t\t* Batches all updates scheduled inside the passed callback.\n\t\t* This is mainly used internally to optimize query client updating.\n\t\t* Batches can be nested; the queue is only flushed once the outermost `batch` call finishes.\n\t\t* The return value of `callback` is passed through.\n\t\t* @param callback - The function to run in the batch.\n\t\t* @returns The return value of `callback`.\n\t\t*/\n\t\tbatch: (callback) => {\n\t\t\tlet result;\n\t\t\ttransactions++;\n\t\t\ttry {\n\t\t\t\tresult = callback();\n\t\t\t} finally {\n\t\t\t\ttransactions--;\n\t\t\t\tif (!transactions) flush();\n\t\t\t}\n\t\t\treturn result;\n\t\t},\n\t\t/**\n\t\t* All calls to the wrapped function will be batched.\n\t\t* @param callback - The function to wrap.\n\t\t* @returns A function that schedules a call to `callback` with the given arguments.\n\t\t*/\n\t\tbatchCalls: (callback) => {\n\t\t\treturn (...args) => {\n\t\t\t\tschedule(() => {\n\t\t\t\t\tcallback(...args);\n\t\t\t\t});\n\t\t\t};\n\t\t},\n\t\t/**\n\t\t* Schedules a function to be run on the next batch.\n\t\t* By default, the batch is run with a `setTimeout`, but this can be configured via `setScheduler`.\n\t\t*/\n\t\tschedule,\n\t\t/**\n\t\t* Use this method to set a custom notify function.\n\t\t* This can be used to for example wrap notifications with `React.act` while running tests.\n\t\t* @param fn - Receives each notification callback and must call it.\n\t\t*/\n\t\tsetNotifyFunction: (fn) => {\n\t\t\tnotifyFn = fn;\n\t\t},\n\t\t/**\n\t\t* Use this method to set a custom function to batch notifications together into a single tick.\n\t\t* Framework adapters use this to plug in their own batching primitive, so that a single query\n\t\t* update only triggers one re-render instead of one per subscriber.\n\t\t* @param fn - Receives a function that runs a batch of notifications and must call it.\n\t\t* @example\n\t\t* ```ts\n\t\t* import { notifyManager } from '@tanstack/query-core'\n\t\t* import { batch } from 'solid-js'\n\t\t*\n\t\t* notifyManager.setBatchNotifyFunction(batch)\n\t\t* ```\n\t\t*/\n\t\tsetBatchNotifyFunction: (fn) => {\n\t\t\tbatchNotifyFn = fn;\n\t\t},\n\t\t/**\n\t\t* Configures a custom callback that schedules when the next batch runs.\n\t\t* The default behavior is `setTimeout(callback, 0)`.\n\t\t* @param fn - Receives a callback that runs the next batch, and schedules it.\n\t\t* @example\n\t\t* ```ts\n\t\t* import { notifyManager } from '@tanstack/query-core'\n\t\t*\n\t\t* // Schedule batches in the next microtask\n\t\t* notifyManager.setScheduler(queueMicrotask)\n\t\t*\n\t\t* // Schedule batches before the next frame is rendered\n\t\t* notifyManager.setScheduler(requestAnimationFrame)\n\t\t*\n\t\t* // Schedule batches some time in the future\n\t\t* notifyManager.setScheduler((cb) => setTimeout(cb, 10))\n\t\t* ```\n\t\t*/\n\t\tsetScheduler: (fn) => {\n\t\t\tscheduleFn = fn;\n\t\t}\n\t};\n}\n/**\n* Handles scheduling and batching callbacks in TanStack Query.\n*/\nconst notifyManager = createNotifyManager();\nexport { createNotifyManager, defaultScheduler, notifyManager };\n\n//# sourceMappingURL=notifyManager.js.map","import { isServer } from \"./environmentManager.js\";\nimport { timeoutManager } from \"./timeoutManager.js\";\nimport { isValidTimeout } from \"./utils.js\";\n// src/removable.ts\n/**\n* The base class for cache entries that are garbage collected once nothing is using them —\n* `Query` and `Mutation` both extend it. `gcTime` controls how long an unused entry is kept.\n*/\nvar Removable = class {\n\t#gcTimeout;\n\t/**\n\t* Clears the pending garbage collection timeout, so the entry is no longer scheduled for removal.\n\t* A subclass may override this to release what it holds on to as well — `Query` also cancels any\n\t* in-flight fetch.\n\t*/\n\tdestroy() {\n\t\tthis.clearGcTimeout();\n\t}\n\t/**\n\t* Schedules the entry to be removed from its cache after `gcTime`, replacing any timeout scheduled\n\t* before. Nothing is scheduled if `gcTime` is `Infinity`.\n\t*/\n\tscheduleGc() {\n\t\tthis.clearGcTimeout();\n\t\tif (isValidTimeout(this.gcTime)) this.#gcTimeout = timeoutManager.setTimeout(() => {\n\t\t\tthis.optionalRemove();\n\t\t}, this.gcTime);\n\t}\n\t/**\n\t* Updates `gcTime`, keeping the longest one seen so far. Without a value, it defaults to 5 minutes\n\t* on the client and `Infinity` on the server.\n\t* @param newGcTime - The `gcTime` from the latest options, if any.\n\t*/\n\tupdateGcTime(newGcTime) {\n\t\tthis.gcTime = Math.max(this.gcTime || 0, newGcTime ?? (isServer() ? Infinity : 3e5));\n\t}\n\t/**\n\t* Cancels the scheduled removal, if there is one.\n\t*/\n\tclearGcTimeout() {\n\t\tif (this.#gcTimeout !== void 0) {\n\t\t\ttimeoutManager.clearTimeout(this.#gcTimeout);\n\t\t\tthis.#gcTimeout = void 0;\n\t\t}\n\t}\n};\nexport { Removable };\n\n//# sourceMappingURL=removable.js.map","import { Subscribable } from \"./subscribable.js\";\n// src/onlineManager.ts\n/**\n* The `OnlineManager` manages the online state within TanStack Query. It can\n* be used to change the default event listeners or to manually change the\n* online state.\n*\n* By default, the `onlineManager` assumes an active network connection, and\n* listens to the `online` and `offline` events on the `window` object to\n* detect changes.\n*/\nvar OnlineManager = class extends Subscribable {\n\t#online = true;\n\t#cleanup;\n\t#setup;\n\tconstructor() {\n\t\tsuper();\n\t\tthis.#setup = (onOnline) => {\n\t\t\tif (typeof window !== \"undefined\" && window.addEventListener) {\n\t\t\t\tconst onlineListener = () => onOnline(true);\n\t\t\t\tconst offlineListener = () => onOnline(false);\n\t\t\t\twindow.addEventListener(\"online\", onlineListener, false);\n\t\t\t\twindow.addEventListener(\"offline\", offlineListener, false);\n\t\t\t\treturn () => {\n\t\t\t\t\twindow.removeEventListener(\"online\", onlineListener);\n\t\t\t\t\twindow.removeEventListener(\"offline\", offlineListener);\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tonSubscribe() {\n\t\tif (!this.#cleanup) this.setEventListener(this.#setup);\n\t}\n\tonUnsubscribe() {\n\t\tif (!this.hasListeners()) {\n\t\t\tthis.#cleanup?.();\n\t\t\tthis.#cleanup = void 0;\n\t\t}\n\t}\n\t/**\n\t* `setEventListener` can be used to set a custom event listener that will\n\t* be used to determine the online state. The provided `setup` function\n\t* receives a `setOnline` callback that should be called with a `boolean`\n\t* whenever the online state changes.\n\t* @param setup - Receives the `setOnline` callback, registers the event listener, and may return\n\t* a cleanup function that is called when the listener is replaced or no longer needed.\n\t* @example\n\t* ```ts\n\t* import NetInfo from '@react-native-community/netinfo'\n\t* import { onlineManager } from '@tanstack/query-core'\n\t*\n\t* onlineManager.setEventListener((setOnline) => {\n\t* return NetInfo.addEventListener((state) => {\n\t* setOnline(!!state.isConnected)\n\t* })\n\t* })\n\t* ```\n\t*/\n\tsetEventListener(setup) {\n\t\tthis.#setup = setup;\n\t\tthis.#cleanup?.();\n\t\tthis.#cleanup = setup(this.setOnline.bind(this));\n\t}\n\t/**\n\t* `setOnline` can be used to manually set the online state.\n\t* @param online - The online state.\n\t* @example\n\t* ```ts\n\t* import { onlineManager } from '@tanstack/query-core'\n\t*\n\t* // Set to online\n\t* onlineManager.setOnline(true)\n\t*\n\t* // Set to offline\n\t* onlineManager.setOnline(false)\n\t* ```\n\t*/\n\tsetOnline(online) {\n\t\tif (this.#online !== online) {\n\t\t\tthis.#online = online;\n\t\t\tthis.listeners.forEach((listener) => {\n\t\t\t\tlistener(online);\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* `isOnline` can be used to get the current online state.\n\t* @returns `true` if online.\n\t*/\n\tisOnline() {\n\t\treturn this.#online;\n\t}\n};\n/**\n* Singleton instance of {@link OnlineManager}, used to manage and observe the online state within TanStack Query.\n*/\nconst onlineManager = new OnlineManager();\nexport { OnlineManager, onlineManager };\n\n//# sourceMappingURL=onlineManager.js.map","import { isServer } from \"./environmentManager.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { noop, sleep } from \"./utils.js\";\n// src/retryer.ts\n/**\n* The default `retryDelay`: doubles with every failure, starting at 1 second, up to 30 seconds.\n* @param failureCount - The number of failures so far.\n* @returns The delay before the next retry, in milliseconds.\n*/\nfunction defaultRetryDelay(failureCount) {\n\treturn Math.min(1e3 * 2 ** failureCount, 3e4);\n}\n/**\n* Checks whether a fetch can run for the given network mode.\n* @param networkMode - The `networkMode` option. Defaults to `'online'`.\n* @returns `true` if the network mode is not `'online'`, or if it is and the client is online.\n*/\nfunction canFetch(networkMode) {\n\treturn (networkMode ?? \"online\") === \"online\" ? onlineManager.isOnline() : true;\n}\n/**\n* The error thrown by a `Retryer` (and surfaced to `query.promise`/`mutation`) when a fetch is cancelled, e.g. via\n* `query.cancel()`. `revert`, if `true`, tells the caller to restore the state the query was in before the fetch\n* started instead of surfacing the error. `silent`, if `true`, tells the caller to suppress this error and instead\n* resolve with the promise of the fetch that triggered the cancellation.\n* @example\n* ```ts\n* query.cancel()\n*\n* try {\n* await query.promise\n* } catch (error) {\n* if (error instanceof CancelledError) {\n* // the fetch was cancelled, e.g. via `query.cancel()`\n* }\n* }\n* ```\n*/\nvar CancelledError = class extends Error {\n\tconstructor(options) {\n\t\tsuper(\"CancelledError\");\n\t\tthis.revert = options?.revert;\n\t\tthis.silent = options?.silent;\n\t}\n};\n/**\n* Checks whether a value is a `CancelledError`.\n* @param value - The value to check.\n* @returns `true` if `value` is a `CancelledError`.\n* @deprecated Use instanceof `CancelledError` instead.\n*/\nfunction isCancelledError(value) {\n\treturn value instanceof CancelledError;\n}\n/**\n* Creates a retryer, which runs a function and retries it on failure according to the `retry` and\n* `retryDelay` options. It pauses while the network mode doesn't allow fetching or `canRun` returns\n* `false`, and can be cancelled. Queries and mutations use it to run their `queryFn` and\n* `mutationFn`.\n* @param config - The function to run, the retry options, and the callbacks for failures, pausing,\n* continuing, and cancellation.\n* @returns The retryer, whose `promise` settles with the result of the function.\n*/\nfunction createRetryer(config) {\n\tlet isRetryCancelled = false;\n\tlet failureCount = 0;\n\tlet continueFn;\n\tlet status = \"pending\";\n\tlet promiseResolve;\n\tlet promiseReject;\n\tconst promise = new Promise((resolve, reject) => {\n\t\tpromiseResolve = resolve;\n\t\tpromiseReject = reject;\n\t});\n\tpromise.catch(noop);\n\tconst isResolved = () => status !== \"pending\";\n\tconst cancel = (cancelOptions) => {\n\t\tif (!isResolved()) {\n\t\t\tconst error = new CancelledError(cancelOptions);\n\t\t\treject(error);\n\t\t\tconfig.onCancel?.(error);\n\t\t}\n\t};\n\tconst cancelRetry = () => {\n\t\tisRetryCancelled = true;\n\t};\n\tconst continueRetry = () => {\n\t\tisRetryCancelled = false;\n\t};\n\tconst canContinue = () => focusManager.isFocused() && (config.networkMode === \"always\" || onlineManager.isOnline()) && config.canRun();\n\tconst canStart = () => canFetch(config.networkMode) && config.canRun();\n\tconst resolve = (value) => {\n\t\tif (!isResolved()) {\n\t\t\tcontinueFn?.();\n\t\t\tstatus = \"resolved\";\n\t\t\tpromiseResolve(value);\n\t\t}\n\t};\n\tconst reject = (value) => {\n\t\tif (!isResolved()) {\n\t\t\tcontinueFn?.();\n\t\t\tstatus = \"rejected\";\n\t\t\tpromiseReject(value);\n\t\t}\n\t};\n\tconst pause = (canResume) => {\n\t\treturn new Promise((continueResolve) => {\n\t\t\tcontinueFn = (value) => {\n\t\t\t\tif (isResolved() || canResume()) continueResolve(value);\n\t\t\t};\n\t\t\tconfig.onPause?.();\n\t\t}).then(() => {\n\t\t\tcontinueFn = void 0;\n\t\t\tif (!isResolved()) config.onContinue?.();\n\t\t});\n\t};\n\tconst run = () => {\n\t\tif (isResolved()) return;\n\t\tlet promiseOrValue;\n\t\tconst initialPromise = failureCount === 0 ? config.initialPromise : void 0;\n\t\ttry {\n\t\t\tpromiseOrValue = initialPromise ?? config.fn();\n\t\t} catch (error) {\n\t\t\tpromiseOrValue = Promise.reject(error);\n\t\t}\n\t\tPromise.resolve(promiseOrValue).then(resolve).catch((error) => {\n\t\t\tif (isResolved()) return;\n\t\t\tconst retry = config.retry ?? (isServer() ? 0 : 3);\n\t\t\tconst retryDelay = config.retryDelay ?? defaultRetryDelay;\n\t\t\tconst delay = typeof retryDelay === \"function\" ? retryDelay(failureCount, error) : retryDelay;\n\t\t\tconst shouldRetry = retry === true || typeof retry === \"number\" && failureCount < retry || typeof retry === \"function\" && retry(failureCount, error);\n\t\t\tif (isRetryCancelled || !shouldRetry) {\n\t\t\t\treject(error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfailureCount++;\n\t\t\tconfig.onFail?.(failureCount, error);\n\t\t\tsleep(delay).then(() => {\n\t\t\t\treturn isResolved() || canContinue() ? void 0 : pause(canContinue);\n\t\t\t}).then(() => {\n\t\t\t\tif (isRetryCancelled) reject(error);\n\t\t\t\telse run();\n\t\t\t});\n\t\t});\n\t};\n\treturn {\n\t\tpromise,\n\t\tstatus: () => status,\n\t\tcancel,\n\t\tcontinue: () => {\n\t\t\tcontinueFn?.();\n\t\t\treturn promise;\n\t\t},\n\t\tcancelRetry,\n\t\tcontinueRetry,\n\t\tcanStart,\n\t\tstart: () => {\n\t\t\tif (canStart()) run();\n\t\t\telse pause(canStart).then(run);\n\t\t\treturn promise;\n\t\t}\n\t};\n}\nexport { CancelledError, canFetch, createRetryer, isCancelledError };\n\n//# sourceMappingURL=retryer.js.map","import { infiniteQueryBehavior } from \"./infiniteQueryBehavior.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Removable } from \"./removable.js\";\nimport { CancelledError, canFetch, createRetryer } from \"./retryer.js\";\nimport { ensureQueryFn, fetchSignal, noop, replaceData, resolveQueryValue, skipToken, timeUntilStale } from \"./utils.js\";\n// src/query.ts\n/**\n* Represents a single cached query. A `Query` holds the query's key, options,\n* state (data/error/status), and the observers currently subscribed to it.\n*\n* Instances are created and managed internally by `QueryCache`; application\n* code typically interacts with queries indirectly through `QueryClient` or\n* a framework hook like `useQuery`. Direct access to a `Query` instance is\n* possible via `queryCache.find()`/`findAll()` for inspecting cache state.\n* @example\n* ```ts\n* const queryCache = queryClient.getQueryCache()\n* const query = queryCache.find({ queryKey: ['posts'] })\n*\n* if (query) {\n* console.log(query.state.dataUpdatedAt)\n* }\n* ```\n*/\nvar Query = class extends Removable {\n\t#queryType;\n\t#initialState;\n\t#revertState;\n\t#cache;\n\t#client;\n\t#retryer;\n\t#fetchPromise;\n\t#defaultOptions;\n\t#abortSignalConsumed;\n\tconstructor(config) {\n\t\tsuper();\n\t\tthis.#abortSignalConsumed = false;\n\t\tthis.#defaultOptions = config.defaultOptions;\n\t\tthis.setOptions(config.options);\n\t\tthis.observers = [];\n\t\tthis.#client = config.client;\n\t\tthis.#cache = this.#client.getQueryCache();\n\t\tthis.queryKey = config.queryKey;\n\t\tthis.queryHash = config.queryHash;\n\t\tthis.#initialState = getDefaultState(this.options);\n\t\tthis.state = config.state ?? this.#initialState;\n\t\tthis.scheduleGc();\n\t}\n\t/**\n\t* The `meta` object passed in the query's options, if any.\n\t* @returns The query's `meta`, or `undefined` if none was set.\n\t*/\n\tget meta() {\n\t\treturn this.options.meta;\n\t}\n\t/**\n\t* `'infinite'` for an infinite query, otherwise `undefined`.\n\t* @internal\n\t* @returns The type of the query, set from the `_type` option (e.g. `'infinite'`).\n\t*/\n\tget queryType() {\n\t\treturn this.#queryType;\n\t}\n\t/**\n\t* The promise for the currently in-flight fetch, if the query is fetching.\n\t* `undefined` when the query is not fetching.\n\t* @returns The promise of the in-flight fetch, or `undefined`.\n\t*/\n\tget promise() {\n\t\treturn this.#retryer?.promise;\n\t}\n\t/**\n\t* Replaces the query's options and applies their `gcTime`. If the query has no data yet, it gets\n\t* the `initialData` from the new options, if any.\n\t* @internal\n\t* @param options - The new query options, merged on top of the query's default options.\n\t*/\n\tsetOptions(options) {\n\t\tthis.options = {\n\t\t\t...this.#defaultOptions,\n\t\t\t...options\n\t\t};\n\t\tif (options?._type) this.#queryType = options._type;\n\t\tthis.updateGcTime(this.options.gcTime);\n\t\tif (this.state && this.state.data === void 0) {\n\t\t\tconst defaultState = getDefaultState(this.options);\n\t\t\tif (defaultState.data !== void 0) {\n\t\t\t\tthis.setState(successState(defaultState.data, defaultState.dataUpdatedAt));\n\t\t\t\tthis.#initialState = defaultState;\n\t\t\t}\n\t\t}\n\t}\n\toptionalRemove() {\n\t\tif (!this.observers.length && this.state.fetchStatus === \"idle\") this.#cache.remove(this);\n\t}\n\t/**\n\t* Writes new data to the query and marks it as successfully fetched.\n\t* @internal\n\t* @param newData - The data to write. Structural sharing with the current data is applied.\n\t* @param options - Set `updatedAt` to override the timestamp, and `manual` to mark the write as\n\t* manual (e.g. from `queryClient.setQueryData`).\n\t* @returns The data that was written.\n\t*/\n\tsetData(newData, options) {\n\t\tconst data = replaceData(this.state.data, newData, this.options);\n\t\tthis.#dispatch({\n\t\t\tdata,\n\t\t\ttype: \"success\",\n\t\t\tdataUpdatedAt: options?.updatedAt,\n\t\t\tmanual: options?.manual\n\t\t});\n\t\treturn data;\n\t}\n\t/**\n\t* Merges the given partial state directly into this query's state, notifying observers. Used\n\t* by persistence and broadcast plugins to restore a state snapshot, and by devtools to let a\n\t* user manually trigger a loading/error state or edit the cached data.\n\t* @param state - The partial state to merge into the query's state.\n\t*/\n\tsetState(state) {\n\t\tthis.#dispatch({\n\t\t\ttype: \"setState\",\n\t\t\tstate\n\t\t});\n\t}\n\t/**\n\t* Cancels the query's currently in-flight fetch, if any.\n\t* - Returns a promise that resolves once the cancellation has settled.\n\t* - If no fetch is in progress, resolves immediately.\n\t* @param options - Set `revert` to restore the state from before the fetch started, and `silent`\n\t* to suppress the cancellation error when a new fetch replaces the cancelled one.\n\t* @returns A promise that resolves once the cancellation has settled.\n\t* @example\n\t* ```ts\n\t* await query.cancel()\n\t* ```\n\t*/\n\tcancel(options) {\n\t\tconst promise = this.#retryer?.promise;\n\t\tthis.#retryer?.cancel(options);\n\t\treturn promise ? promise.then(noop).catch(noop) : Promise.resolve();\n\t}\n\t/**\n\t* Silently cancels any in-flight fetch, then clears the query's garbage\n\t* collection timeout. Called by `QueryCache` when the query is removed from\n\t* the cache.\n\t* @see {@link Query#cancel}\n\t*/\n\tdestroy() {\n\t\tthis.cancel({ silent: true });\n\t\tsuper.destroy();\n\t}\n\t/**\n\t* The state the query was created with.\n\t* @internal\n\t* @returns The state the query had when it was first created, used by {@link Query#reset}.\n\t*/\n\tget resetState() {\n\t\treturn this.#initialState;\n\t}\n\t/**\n\t* Resets the query back to its initial state (the state it had when it was\n\t* first created, e.g. any `initialData`), destroying it first to cancel any\n\t* in-flight fetch.\n\t*/\n\treset() {\n\t\tthis.destroy();\n\t\tthis.setState(this.resetState);\n\t}\n\t/**\n\t* Returns `true` if the query has at least one observer for which `enabled`\n\t* does not resolve to `false`.\n\t* @returns `true` if the query has an enabled observer.\n\t*/\n\tisActive() {\n\t\treturn this.observers.some((observer) => resolveQueryValue(observer.options.enabled, this) !== false);\n\t}\n\t/**\n\t* Returns `true` if the query is disabled, meaning it will not fetch\n\t* automatically.\n\t* - If the query has observers, it is disabled when none of them are active\n\t* (see `isActive`).\n\t* - If the query has no observers, it is disabled when its `queryFn` is\n\t* `skipToken` or it has never been fetched.\n\t* @returns `true` if the query is disabled.\n\t*/\n\tisDisabled() {\n\t\tif (this.getObserversCount() > 0) return !this.isActive();\n\t\treturn this.options.queryFn === skipToken || !this.isFetched();\n\t}\n\t/**\n\t* Returns `true` if the query has been fetched, i.e. it has resolved with\n\t* either data or an error at least once.\n\t* @returns `true` if the query has been fetched.\n\t*/\n\tisFetched() {\n\t\treturn this.state.dataUpdateCount + this.state.errorUpdateCount > 0;\n\t}\n\t/**\n\t* Returns `true` if the query has data and at least one observer configured with\n\t* `staleTime: 'static'`, meaning it is treated as never stale.\n\t* @returns `true` if the query is static.\n\t*/\n\tisStatic() {\n\t\tif (this.state.data === void 0) return false;\n\t\tif (this.getObserversCount() > 0) return this.observers.some((observer) => resolveQueryValue(observer.options.staleTime, this) === \"static\");\n\t\treturn false;\n\t}\n\t/**\n\t* Returns `true` if the query is stale.\n\t* - If the query has observers, defers to whether any observer's current\n\t* result reports `isStale` (which accounts for each observer's own\n\t* `staleTime` and `enabled` state).\n\t* - If the query has no observers, it is considered stale when it has no\n\t* data or has been invalidated.\n\t* @returns `true` if the query is stale.\n\t* @see {@link Query#isStaleByTime}\n\t* @example\n\t* ```ts\n\t* if (query.isStale()) {\n\t* // refetch or otherwise treat the cached data as outdated\n\t* }\n\t* ```\n\t*/\n\tisStale() {\n\t\tif (this.getObserversCount() > 0) return this.observers.some((observer) => observer.getCurrentResult().isStale);\n\t\treturn this.state.data === void 0 || this.state.isInvalidated;\n\t}\n\t/**\n\t* Returns `true` if the query's data is stale relative to the given\n\t* `staleTime` (defaults to `0`).\n\t* - A query with no data is always stale.\n\t* - `staleTime: 'static'` is never stale.\n\t* - An invalidated query is always stale.\n\t* - Otherwise, staleness is based on elapsed time since `dataUpdatedAt`.\n\t* @param staleTime - The time, in milliseconds, after which data is considered stale, or\n\t* `'static'` to never treat existing data as stale. A query without data is stale either way.\n\t* @returns `true` if the query's data is stale.\n\t* @see {@link Query#isStale}\n\t* @example\n\t* ```ts\n\t* const isStale = query.isStaleByTime(60 * 1000)\n\t* ```\n\t*/\n\tisStaleByTime(staleTime = 0) {\n\t\tif (this.state.data === void 0) return true;\n\t\tif (staleTime === \"static\") return false;\n\t\tif (this.state.isInvalidated) return true;\n\t\treturn !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n\t}\n\t/**\n\t* Refetches the query when the window regains focus, if an observer wants that, and continues a\n\t* paused fetch.\n\t* @internal\n\t*/\n\tonFocus() {\n\t\tthis.observers.find((x) => x.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: false });\n\t\tthis.#retryer?.continue();\n\t}\n\t/**\n\t* Refetches the query when the app reconnects, if an observer wants that, and continues a paused\n\t* fetch.\n\t* @internal\n\t*/\n\tonOnline() {\n\t\tthis.observers.find((x) => x.shouldFetchOnReconnect())?.refetch({ cancelRefetch: false });\n\t\tthis.#retryer?.continue();\n\t}\n\t/**\n\t* Subscribes an observer to the query and stops its garbage collection.\n\t* @internal\n\t* @param observer - The observer to add. Adding an observer that is already subscribed does\n\t* nothing.\n\t*/\n\taddObserver(observer) {\n\t\tif (!this.observers.includes(observer)) {\n\t\t\tthis.observers.push(observer);\n\t\t\tthis.clearGcTimeout();\n\t\t\tthis.#cache.notify({\n\t\t\t\ttype: \"observerAdded\",\n\t\t\t\tquery: this,\n\t\t\t\tobserver\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* Unsubscribes an observer from the query.\n\t* @internal\n\t* @param observer - The observer to remove. When the last observer is removed, the in-flight\n\t* fetch is cancelled if its abort signal was consumed (otherwise only its retries are stopped),\n\t* and garbage collection is scheduled if the query is still in the cache.\n\t*/\n\tremoveObserver(observer) {\n\t\tconst index = this.observers.indexOf(observer);\n\t\tif (index !== -1) {\n\t\t\tthis.observers.splice(index, 1);\n\t\t\tif (!this.observers.length) {\n\t\t\t\tif (this.#retryer) {\n\t\t\t\t\tif (this.#abortSignalConsumed || this.state.fetchStatus === \"paused\" && this.state.status === \"pending\") this.#retryer.cancel({ revert: true });\n\t\t\t\t\telse this.#retryer.cancelRetry();\n\t\t\t\t}\n\t\t\t\tthis.#scheduleGcIfCached();\n\t\t\t}\n\t\t\tthis.#cache.notify({\n\t\t\t\ttype: \"observerRemoved\",\n\t\t\t\tquery: this,\n\t\t\t\tobserver\n\t\t\t});\n\t\t}\n\t}\n\t/**\n\t* Returns the number of observers currently subscribed to this query.\n\t* @returns The number of observers.\n\t* @example\n\t* ```ts\n\t* if (query.getObserversCount() === 0) {\n\t* // no component is currently watching this query\n\t* }\n\t* ```\n\t*/\n\tgetObserversCount() {\n\t\treturn this.observers.length;\n\t}\n\t/**\n\t* Marks the query as invalidated, unless it is already invalidated. This\n\t* updates `state.isInvalidated` and notifies observers, but does not by\n\t* itself trigger a refetch.\n\t* @example\n\t* ```ts\n\t* query.invalidate()\n\t* ```\n\t*/\n\tinvalidate() {\n\t\tif (!this.state.isInvalidated) this.#dispatch({ type: \"invalidate\" });\n\t}\n\t/**\n\t* Fetches the query, i.e. runs its `queryFn` (through any configured\n\t* retryer/behavior) and updates the query's state with the result.\n\t* - If a fetch is already in flight, returns its promise instead of\n\t* starting a new one, unless `fetchOptions.cancelRefetch` is set and the\n\t* query already has data, in which case the current fetch is silently\n\t* cancelled first.\n\t* - If `options` is passed, it replaces the query's current options\n\t* before fetching.\n\t* @param options - Query options that replace the query's current options before fetching. They\n\t* are not applied when an in-flight fetch is reused.\n\t* @param fetchOptions - Set `cancelRefetch` to cancel an in-flight fetch first (only if the query\n\t* already has data), and `meta` to pass extra information to the query's behavior.\n\t* @returns A promise that resolves with the fetched data, or rejects with the fetch error. If the\n\t* fetch is cancelled with `revert` while the query has data, it resolves with the restored data\n\t* instead.\n\t*/\n\tasync fetch(options, fetchOptions) {\n\t\tif (this.state.fetchStatus !== \"idle\" && this.#retryer?.status() !== \"rejected\") {\n\t\t\tif (this.state.data !== void 0 && fetchOptions?.cancelRefetch) this.cancel({ silent: true });\n\t\t\telse if (this.#retryer && this.#fetchPromise) {\n\t\t\t\tthis.#retryer.continueRetry();\n\t\t\t\treturn this.#fetchPromise;\n\t\t\t}\n\t\t}\n\t\tif (options) this.setOptions(options);\n\t\tif (!this.options.queryFn) {\n\t\t\tconst observer = this.observers.find((x) => x.options.queryFn);\n\t\t\tif (observer) this.setOptions(observer.options);\n\t\t}\n\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\tif (!Array.isArray(this.options.queryKey)) console.error(`As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`);\n\t\t}\n\t\tconst abortController = new AbortController();\n\t\tconst addSignalProperty = (object) => {\n\t\t\tObject.defineProperties(object, {\n\t\t\t\t[fetchSignal]: {\n\t\t\t\t\tvalue: abortController.signal,\n\t\t\t\t\tenumerable: true\n\t\t\t\t},\n\t\t\t\tsignal: {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tget: () => {\n\t\t\t\t\t\tthis.#abortSignalConsumed = true;\n\t\t\t\t\t\treturn abortController.signal;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\tconst fetchFn = () => {\n\t\t\tconst queryFn = ensureQueryFn(this.options, fetchOptions);\n\t\t\tconst createQueryFnContext = () => {\n\t\t\t\tconst queryFnContext = {\n\t\t\t\t\tclient: this.#client,\n\t\t\t\t\tqueryKey: this.queryKey,\n\t\t\t\t\tmeta: this.meta\n\t\t\t\t};\n\t\t\t\taddSignalProperty(queryFnContext);\n\t\t\t\treturn queryFnContext;\n\t\t\t};\n\t\t\tconst queryFnContext = createQueryFnContext();\n\t\t\tthis.#abortSignalConsumed = false;\n\t\t\tif (this.options.persister) return this.options.persister(queryFn, queryFnContext, this);\n\t\t\treturn queryFn(queryFnContext);\n\t\t};\n\t\tconst createFetchContext = () => {\n\t\t\tconst context = {\n\t\t\t\tfetchOptions,\n\t\t\t\toptions: this.options,\n\t\t\t\tqueryKey: this.queryKey,\n\t\t\t\tclient: this.#client,\n\t\t\t\tstate: this.state,\n\t\t\t\tfetchFn\n\t\t\t};\n\t\t\taddSignalProperty(context);\n\t\t\treturn context;\n\t\t};\n\t\tconst context = createFetchContext();\n\t\t(this.#queryType === \"infinite\" ? infiniteQueryBehavior(this.options.pages) : this.options.behavior)?.onFetch(context, this);\n\t\tthis.#revertState = this.state;\n\t\tif (this.state.fetchStatus === \"idle\" || this.state.fetchMeta !== context.fetchOptions?.meta) this.#dispatch({\n\t\t\ttype: \"fetch\",\n\t\t\tmeta: context.fetchOptions?.meta\n\t\t});\n\t\tconst retryer = this.#retryer = createRetryer({\n\t\t\tinitialPromise: fetchOptions?.initialPromise,\n\t\t\tfn: context.fetchFn,\n\t\t\tonCancel: (error) => {\n\t\t\t\tif (error instanceof CancelledError && error.revert) this.setState({\n\t\t\t\t\t...this.#revertState,\n\t\t\t\t\tfetchStatus: \"idle\"\n\t\t\t\t});\n\t\t\t\tabortController.abort();\n\t\t\t},\n\t\t\tonFail: (failureCount, error) => {\n\t\t\t\tthis.#dispatch({\n\t\t\t\t\ttype: \"failed\",\n\t\t\t\t\tfailureCount,\n\t\t\t\t\terror\n\t\t\t\t});\n\t\t\t},\n\t\t\tonPause: () => {\n\t\t\t\tthis.#dispatch({ type: \"pause\" });\n\t\t\t},\n\t\t\tonContinue: () => {\n\t\t\t\tthis.#dispatch({ type: \"continue\" });\n\t\t\t},\n\t\t\tretry: context.options.retry,\n\t\t\tretryDelay: context.options.retryDelay,\n\t\t\tnetworkMode: context.options.networkMode,\n\t\t\tcanRun: () => true\n\t\t});\n\t\tconst fetchPromise = (async () => {\n\t\t\ttry {\n\t\t\t\tconst data = await retryer.promise;\n\t\t\t\tif (data === void 0) {\n\t\t\t\t\tif (process.env.NODE_ENV !== \"production\") console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`);\n\t\t\t\t\tthrow new Error(`${this.queryHash} data is undefined`);\n\t\t\t\t}\n\t\t\t\tthis.setData(data);\n\t\t\t\tthis.#cache.config.onSuccess?.(data, this);\n\t\t\t\tthis.#cache.config.onSettled?.(data, this.state.error, this);\n\t\t\t\treturn data;\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof CancelledError) {\n\t\t\t\t\tif (error.silent) {\n\t\t\t\t\t\tif (this.#retryer !== retryer && this.#fetchPromise) return this.#fetchPromise;\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t} else if (error.revert) {\n\t\t\t\t\t\tif (this.state.data === void 0) throw error;\n\t\t\t\t\t\treturn this.state.data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.#dispatch({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\terror\n\t\t\t\t});\n\t\t\t\tthis.#cache.config.onError?.(error, this);\n\t\t\t\tthis.#cache.config.onSettled?.(this.state.data, error, this);\n\t\t\t\tthrow error;\n\t\t\t} finally {\n\t\t\t\tif (this.#retryer === retryer) {\n\t\t\t\t\tthis.#retryer = void 0;\n\t\t\t\t\tthis.#fetchPromise = void 0;\n\t\t\t\t}\n\t\t\t\tthis.#scheduleGcIfCached();\n\t\t\t}\n\t\t})();\n\t\tthis.#fetchPromise = fetchPromise;\n\t\tretryer.start();\n\t\treturn fetchPromise;\n\t}\n\t#scheduleGcIfCached() {\n\t\tif (this.#cache.get(this.queryHash) === this) this.scheduleGc();\n\t}\n\t#dispatch(action) {\n\t\tconst reducer = (state) => {\n\t\t\tswitch (action.type) {\n\t\t\t\tcase \"failed\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tfetchFailureCount: action.failureCount,\n\t\t\t\t\tfetchFailureReason: action.error\n\t\t\t\t};\n\t\t\t\tcase \"pause\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tfetchStatus: \"paused\"\n\t\t\t\t};\n\t\t\t\tcase \"continue\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tfetchStatus: \"fetching\"\n\t\t\t\t};\n\t\t\t\tcase \"fetch\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\t...fetchState(state.data, this.options),\n\t\t\t\t\tfetchMeta: action.meta ?? null\n\t\t\t\t};\n\t\t\t\tcase \"success\": {\n\t\t\t\t\tconst newState = {\n\t\t\t\t\t\t...state,\n\t\t\t\t\t\t...successState(action.data, action.dataUpdatedAt),\n\t\t\t\t\t\tdataUpdateCount: state.dataUpdateCount + 1,\n\t\t\t\t\t\t...!action.manual && {\n\t\t\t\t\t\t\tfetchStatus: \"idle\",\n\t\t\t\t\t\t\tfetchFailureCount: 0,\n\t\t\t\t\t\t\tfetchFailureReason: null\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tthis.#revertState = action.manual ? newState : void 0;\n\t\t\t\t\treturn newState;\n\t\t\t\t}\n\t\t\t\tcase \"error\": {\n\t\t\t\t\tconst error = action.error;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...state,\n\t\t\t\t\t\terror,\n\t\t\t\t\t\terrorUpdateCount: state.errorUpdateCount + 1,\n\t\t\t\t\t\terrorUpdatedAt: Date.now(),\n\t\t\t\t\t\tfetchFailureCount: state.fetchFailureCount + 1,\n\t\t\t\t\t\tfetchFailureReason: error,\n\t\t\t\t\t\tfetchStatus: \"idle\",\n\t\t\t\t\t\tstatus: \"error\",\n\t\t\t\t\t\tisInvalidated: true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tcase \"invalidate\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\tisInvalidated: true\n\t\t\t\t};\n\t\t\t\tcase \"setState\": return {\n\t\t\t\t\t...state,\n\t\t\t\t\t...action.state\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t\tthis.state = reducer(this.state);\n\t\tnotifyManager.batch(() => {\n\t\t\tthis.observers.slice().forEach((observer) => {\n\t\t\t\tobserver.onQueryUpdate();\n\t\t\t});\n\t\t\tthis.#cache.notify({\n\t\t\t\tquery: this,\n\t\t\t\ttype: \"updated\",\n\t\t\t\taction\n\t\t\t});\n\t\t});\n\t}\n};\n/**\n* Returns the state changes applied when a query starts fetching.\n* @param data - The query's current data. If it is `undefined`, the query is also reset to\n* `'pending'` with no error.\n* @param options - The query options, whose `networkMode` decides whether the query is `'fetching'`\n* or `'paused'`.\n* @returns The partial query state for a starting fetch.\n*/\nfunction fetchState(data, options) {\n\treturn {\n\t\tfetchFailureCount: 0,\n\t\tfetchFailureReason: null,\n\t\tfetchStatus: canFetch(options.networkMode) ? \"fetching\" : \"paused\",\n\t\t...data === void 0 && {\n\t\t\terror: null,\n\t\t\tstatus: \"pending\"\n\t\t}\n\t};\n}\n/**\n* Returns the state changes applied when a query receives data.\n* @param data - The new data.\n* @param dataUpdatedAt - The timestamp the data is recorded with. Defaults to the current time.\n* @returns The partial query state for a successful update.\n*/\nfunction successState(data, dataUpdatedAt) {\n\treturn {\n\t\tdata,\n\t\tdataUpdatedAt: dataUpdatedAt ?? Date.now(),\n\t\terror: null,\n\t\tisInvalidated: false,\n\t\tstatus: \"success\"\n\t};\n}\n/**\n* Returns the initial state of a query, based on its `initialData` and `initialDataUpdatedAt`\n* options.\n* @param options - The query options.\n* @returns The initial query state: `'success'` if `initialData` is set, otherwise `'pending'`.\n*/\nfunction getDefaultState(options) {\n\tconst data = typeof options.initialData === \"function\" ? options.initialData() : options.initialData;\n\tconst hasData = data !== void 0;\n\tconst initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === \"function\" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n\treturn {\n\t\tdata,\n\t\tdataUpdateCount: 0,\n\t\tdataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,\n\t\terror: null,\n\t\terrorUpdateCount: 0,\n\t\terrorUpdatedAt: 0,\n\t\tfetchFailureCount: 0,\n\t\tfetchFailureReason: null,\n\t\tfetchMeta: null,\n\t\tisInvalidated: false,\n\t\tstatus: hasData ? \"success\" : \"pending\",\n\t\tfetchStatus: \"idle\"\n\t};\n}\nexport { Query, fetchState };\n\n//# sourceMappingURL=query.js.map","import { isServer } from \"./environmentManager.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { fetchState } from \"./query.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { timeoutManager } from \"./timeoutManager.js\";\nimport { isValidTimeout, noop, replaceData, resolveQueryValue, shallowEqualObjects, timeUntilStale } from \"./utils.js\";\n// src/queryObserver.ts\n/**\n* A `QueryObserver` watches a single query in the `QueryCache` and computes a\n* `QueryObserverResult` from its state, recomputing and notifying subscribers\n* whenever the underlying query (or the observer's options) changes. It is\n* the primitive that framework adapters (e.g. `useQuery`) build their hooks\n* on top of, but it can also be used directly to observe and switch between\n* queries outside of any framework.\n* @example\n* ```ts\n* const observer = new QueryObserver(queryClient, {\n* queryKey: ['posts'],\n* queryFn: fetchPosts,\n* })\n*\n* const unsubscribe = observer.subscribe((result) => {\n* console.log(result.data)\n* })\n* ```\n*/\nvar QueryObserver = class extends Subscribable {\n\t#client;\n\t#currentQuery = void 0;\n\t#currentQueryInitialState = void 0;\n\t#currentResult = void 0;\n\t#currentResultOptions;\n\t#selectError;\n\t#selectFn;\n\t#selectInput;\n\t#selectResult;\n\t#lastQueryWithDefinedData;\n\t#staleTimeoutId;\n\t#refetchIntervalId;\n\t#currentRefetchInterval;\n\t#trackedProps = /* @__PURE__ */ new Set();\n\tconstructor(client, options) {\n\t\tsuper();\n\t\tthis.options = options;\n\t\tthis.#client = client;\n\t\tthis.#selectError = null;\n\t\tthis.bindMethods();\n\t\tthis.setOptions(options);\n\t}\n\t/**\n\t* Binds the methods of the result (`refetch`) to the observer, so they keep working when destructured\n\t* from it. Subclasses override it to bind their own result methods as well.\n\t*/\n\tbindMethods() {\n\t\tthis.refetch = this.refetch.bind(this);\n\t}\n\tonSubscribe() {\n\t\tif (this.listeners.size === 1) {\n\t\t\tthis.#currentQuery.addObserver(this);\n\t\t\tif (shouldFetchOnMount(this.#currentQuery, this.options)) this.#executeFetch();\n\t\t\telse this.updateResult();\n\t\t\tthis.#updateTimers();\n\t\t}\n\t}\n\tonUnsubscribe() {\n\t\tif (!this.hasListeners()) this.destroy();\n\t}\n\t/**\n\t* Returns whether the observed query is currently stale and configured\n\t* (via the `refetchOnReconnect` option) to refetch when the network\n\t* reconnects.\n\t* @returns `true` if the observer should refetch the query on reconnect.\n\t*/\n\tshouldFetchOnReconnect() {\n\t\treturn shouldFetchOn(this.#currentQuery, this.options, this.options.refetchOnReconnect);\n\t}\n\t/**\n\t* Returns whether the observed query is currently stale and configured\n\t* (via the `refetchOnWindowFocus` option) to refetch when the window\n\t* regains focus.\n\t* @returns `true` if the observer should refetch the query on window focus.\n\t*/\n\tshouldFetchOnWindowFocus() {\n\t\treturn shouldFetchOn(this.#currentQuery, this.options, this.options.refetchOnWindowFocus);\n\t}\n\t/**\n\t* Stops observing the current query: clears all listeners, cancels the\n\t* stale and refetch-interval timers, and removes this observer from the\n\t* query it was observing.\n\t*/\n\tdestroy() {\n\t\tthis.listeners = /* @__PURE__ */ new Set();\n\t\tthis.#clearStaleTimeout();\n\t\tthis.#clearRefetchInterval();\n\t\tthis.#currentQuery.removeObserver(this);\n\t}\n\t/**\n\t* Updates the observer's options. This will re-resolve the query being\n\t* observed (switching to a different query if the `queryKey` changed),\n\t* trigger a fetch if the new options require one and the observer has\n\t* subscribers, recompute the current result, and reschedule the stale and\n\t* refetch-interval timers as needed.\n\t* @param options - The new observer options. They are defaulted with {@link\n\t* QueryClient#defaultQueryOptions} before being applied.\n\t* @throws {Error} If `enabled` is neither a boolean nor a function.\n\t* @example\n\t* ```ts\n\t* observer.setOptions({ queryKey: ['posts', 1], queryFn: () => fetchPost(1) })\n\t* // later: switch to a different query, reusing the same observer\n\t* observer.setOptions({ queryKey: ['posts', 2], queryFn: () => fetchPost(2) })\n\t* ```\n\t*/\n\tsetOptions(options) {\n\t\tconst prevOptions = this.options;\n\t\tconst prevQuery = this.#currentQuery;\n\t\tthis.options = this.#client.defaultQueryOptions(options);\n\t\tif (this.options.enabled !== void 0 && typeof this.options.enabled !== \"boolean\" && typeof this.options.enabled !== \"function\" && typeof resolveQueryValue(this.options.enabled, this.#currentQuery) !== \"boolean\") throw new Error(\"Expected enabled to be a boolean or a callback that returns a boolean\");\n\t\tthis.#updateQuery();\n\t\tthis.#currentQuery.setOptions(this.options);\n\t\tif (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) this.#client.getQueryCache().notify({\n\t\t\ttype: \"observerOptionsUpdated\",\n\t\t\tquery: this.#currentQuery,\n\t\t\tobserver: this\n\t\t});\n\t\tconst mounted = this.hasListeners();\n\t\tif (mounted && shouldFetchOptionally(this.#currentQuery, prevQuery, this.options, prevOptions)) this.#executeFetch();\n\t\tthis.updateResult();\n\t\tif (mounted && (this.#currentQuery !== prevQuery || resolveQueryValue(this.options.enabled, this.#currentQuery) !== resolveQueryValue(prevOptions.enabled, this.#currentQuery) || resolveQueryValue(this.options.staleTime, this.#currentQuery) !== resolveQueryValue(prevOptions.staleTime, this.#currentQuery))) this.#updateStaleTimeout();\n\t\tconst nextRefetchInterval = this.#computeRefetchInterval();\n\t\tif (mounted && (this.#currentQuery !== prevQuery || resolveQueryValue(this.options.enabled, this.#currentQuery) !== resolveQueryValue(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) this.#updateRefetchInterval(nextRefetchInterval);\n\t}\n\t/**\n\t* Computes the result the observer would produce for the given (already-defaulted) options\n\t* right now, building the underlying `Query` if it doesn't exist yet, without waiting for a\n\t* subscription callback. Called by framework adapters on every render (e.g. `useQuery`) so the\n\t* returned value is available synchronously, ahead of `setOptions` triggering an actual fetch.\n\t* @param options - The defaulted observer options to compute the result for.\n\t* @returns The result for the given options.\n\t*/\n\tgetOptimisticResult(options) {\n\t\tconst query = this.#client.getQueryCache().build(this.#client, options);\n\t\tconst result = this.createResult(query, options);\n\t\tif (!shallowEqualObjects(this.getCurrentResult(), result)) {\n\t\t\tthis.#currentResult = result;\n\t\t\tthis.#currentResultOptions = options;\n\t\t}\n\t\treturn result;\n\t}\n\t/**\n\t* Returns the most recently computed `QueryObserverResult` for the\n\t* observed query. This is a point-in-time read; to be notified of updates\n\t* as they happen, subscribe to the observer instead (its inherited\n\t* `subscribe` method).\n\t* @returns The observer's latest result.\n\t* @example\n\t* ```ts\n\t* const result = observer.getCurrentResult()\n\t* console.log(result.status, result.data)\n\t* ```\n\t*/\n\tgetCurrentResult() {\n\t\treturn this.#currentResult;\n\t}\n\t/**\n\t* Wraps a `QueryObserverResult` in a `Proxy` that records which properties are read, via\n\t* {@link QueryObserver#trackProp} (and an optional `onPropTracked` callback). Used by framework\n\t* adapters when `notifyOnChangeProps` is not set, to implement its default \"only re-render on\n\t* properties you actually read\" behavior.\n\t* @param result - The result to wrap.\n\t* @param onPropTracked - Called with the name of each property that is read.\n\t* @returns A proxy of `result` that tracks property reads.\n\t*/\n\ttrackResult(result, onPropTracked) {\n\t\treturn new Proxy(result, { get: (target, key) => {\n\t\t\tthis.trackProp(key);\n\t\t\tonPropTracked?.(key);\n\t\t\treturn Reflect.get(target, key);\n\t\t} });\n\t}\n\t/**\n\t* Records that the given `QueryObserverResult` property was read, so a subsequent update only\n\t* notifies this observer if a tracked property actually changed. Normally called indirectly via\n\t* {@link QueryObserver#trackResult}'s proxy; exposed directly for adapters that track property\n\t* access themselves (e.g. through their own reactivity system) instead of via the proxy.\n\t* @param key - The name of the property that was read.\n\t*/\n\ttrackProp(key) {\n\t\tthis.#trackedProps.add(key);\n\t}\n\t/**\n\t* Returns the `Query` instance this observer is currently observing.\n\t* @returns The observed query.\n\t*/\n\tgetCurrentQuery() {\n\t\treturn this.#currentQuery;\n\t}\n\t/**\n\t* Refetches the observed query and returns a promise that resolves with\n\t* the resulting `QueryObserverResult`.\n\t* @param options - Set `cancelRefetch` to `false` to keep a running fetch instead of cancelling\n\t* it, and `throwOnError` to `true` to reject when the refetch fails.\n\t* @returns A promise that resolves with the result after the refetch.\n\t* @example\n\t* ```ts\n\t* const result = await observer.refetch({ cancelRefetch: false })\n\t* console.log(result.data)\n\t* ```\n\t*/\n\trefetch({ ...options } = {}) {\n\t\treturn this.fetch({ ...options });\n\t}\n\t/**\n\t* Fetches a query defined by the given options without affecting this\n\t* observer's own tracked query or result, and returns a promise that\n\t* resolves with the `QueryObserverResult` for that fetch. This is useful\n\t* for prefetching data that another observer (e.g. a query about to be\n\t* navigated to) will need, ahead of time.\n\t* @param options - The observer options of the query to fetch.\n\t* @returns A promise that resolves with the result for the fetched query.\n\t* @example\n\t* ```ts\n\t* const result = await observer.fetchOptimistic({\n\t* queryKey: ['posts', 2],\n\t* queryFn: () => fetchPost(2),\n\t* })\n\t* console.log(result.data)\n\t* ```\n\t*/\n\tfetchOptimistic(options) {\n\t\tconst defaultedOptions = this.#client.defaultQueryOptions(options);\n\t\tconst query = this.#client.getQueryCache().build(this.#client, defaultedOptions);\n\t\tlet unsubscribe = () => {};\n\t\tlet resolveEarly;\n\t\tconst cachePromise = new Promise((resolve) => {\n\t\t\tresolveEarly = resolve;\n\t\t\tunsubscribe = this.#client.getQueryCache().subscribe((event) => {\n\t\t\t\tif (event.type === \"updated\" && event.query.queryHash === query.queryHash && query.state.data !== void 0) {\n\t\t\t\t\tunsubscribe();\n\t\t\t\t\tresolve(this.createResult(query, defaultedOptions));\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\treturn Promise.race([query.fetch(defaultedOptions).then(() => {\n\t\t\tconst result = this.createResult(query, defaultedOptions);\n\t\t\tresolveEarly?.(result);\n\t\t\treturn result;\n\t\t}).finally(() => {\n\t\t\tunsubscribe();\n\t\t}), cachePromise]);\n\t}\n\t/**\n\t* Fetches the observed query and updates the result once the fetch settles. Used by `refetch` and,\n\t* in `InfiniteQueryObserver`, to fetch more pages.\n\t* @param fetchOptions - Options for this fetch. `cancelRefetch` defaults to `true`.\n\t* @returns A promise that resolves with the updated result.\n\t*/\n\tfetch(fetchOptions) {\n\t\treturn this.#executeFetch({\n\t\t\t...fetchOptions,\n\t\t\tcancelRefetch: fetchOptions.cancelRefetch ?? true\n\t\t}).then(() => {\n\t\t\tthis.updateResult();\n\t\t\treturn this.#currentResult;\n\t\t});\n\t}\n\t#executeFetch(fetchOptions) {\n\t\tthis.#updateQuery();\n\t\tlet promise = this.#currentQuery.fetch(this.options, fetchOptions);\n\t\tif (!fetchOptions?.throwOnError) promise = promise.catch(noop);\n\t\treturn promise;\n\t}\n\t#shouldScheduleTimer(timeout) {\n\t\treturn !isServer() && resolveQueryValue(this.options.enabled, this.#currentQuery) !== false && isValidTimeout(timeout);\n\t}\n\t#updateStaleTimeout() {\n\t\tthis.#clearStaleTimeout();\n\t\tconst staleTime = resolveQueryValue(this.options.staleTime, this.#currentQuery);\n\t\tif (this.#currentResult.isStale || !this.#shouldScheduleTimer(staleTime)) return;\n\t\tconst timeout = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime) + 1;\n\t\tthis.#staleTimeoutId = timeoutManager.setTimeout(() => {\n\t\t\tif (!this.#currentResult.isStale) this.updateResult();\n\t\t}, timeout);\n\t}\n\t#computeRefetchInterval() {\n\t\treturn resolveQueryValue(this.options.refetchInterval, this.#currentQuery) ?? false;\n\t}\n\t#updateRefetchInterval(nextInterval) {\n\t\tthis.#clearRefetchInterval();\n\t\tthis.#currentRefetchInterval = nextInterval;\n\t\tif (this.#currentRefetchInterval === 0 || !this.#shouldScheduleTimer(this.#currentRefetchInterval)) return;\n\t\tthis.#refetchIntervalId = timeoutManager.setInterval(() => {\n\t\t\tif (this.options.refetchIntervalInBackground || focusManager.isFocused()) this.#executeFetch();\n\t\t}, this.#currentRefetchInterval);\n\t}\n\t#updateTimers() {\n\t\tthis.#updateStaleTimeout();\n\t\tthis.#updateRefetchInterval(this.#computeRefetchInterval());\n\t}\n\t#clearStaleTimeout() {\n\t\tif (this.#staleTimeoutId !== void 0) {\n\t\t\ttimeoutManager.clearTimeout(this.#staleTimeoutId);\n\t\t\tthis.#staleTimeoutId = void 0;\n\t\t}\n\t}\n\t#clearRefetchInterval() {\n\t\tif (this.#refetchIntervalId !== void 0) {\n\t\t\ttimeoutManager.clearInterval(this.#refetchIntervalId);\n\t\t\tthis.#refetchIntervalId = void 0;\n\t\t}\n\t}\n\t/**\n\t* Computes the result for a query and options from the query's state, applying `select`,\n\t* `placeholderData`, and the derived flags. Subclasses override it to add their own fields.\n\t* @param query - The query to compute the result for.\n\t* @param options - The observer options to compute the result with.\n\t* @returns The computed result.\n\t*/\n\tcreateResult(query, options) {\n\t\tconst prevQuery = this.#currentQuery;\n\t\tconst prevOptions = this.options;\n\t\tconst prevResult = this.#currentResult;\n\t\tconst prevResultOptions = this.#currentResultOptions;\n\t\tconst queryInitialState = query !== prevQuery ? query.state : this.#currentQueryInitialState;\n\t\tconst { state } = query;\n\t\tlet newState = { ...state };\n\t\tlet isPlaceholderData = false;\n\t\tlet data;\n\t\tif (options._optimisticResults) {\n\t\t\tconst mounted = this.hasListeners();\n\t\t\tconst fetchOnMount = !mounted && shouldFetchOnMount(query, options);\n\t\t\tconst fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);\n\t\t\tif (fetchOnMount || fetchOptionally) newState = {\n\t\t\t\t...newState,\n\t\t\t\t...fetchState(state.data, query.options)\n\t\t\t};\n\t\t\tif (options._optimisticResults === \"isRestoring\") newState.fetchStatus = \"idle\";\n\t\t}\n\t\tlet { error, errorUpdatedAt, status } = newState;\n\t\tdata = newState.data;\n\t\tlet skipSelect = false;\n\t\tif (options.placeholderData !== void 0 && data === void 0 && status === \"pending\") {\n\t\t\tlet placeholderData;\n\t\t\tconst isMemoizedPlaceholder = prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData;\n\t\t\tif (isMemoizedPlaceholder) {\n\t\t\t\tplaceholderData = prevResult.data;\n\t\t\t\tskipSelect = true;\n\t\t\t} else placeholderData = typeof options.placeholderData === \"function\" ? options.placeholderData(this.#lastQueryWithDefinedData?.state.data, this.#lastQueryWithDefinedData) : options.placeholderData;\n\t\t\tif (isMemoizedPlaceholder || placeholderData !== void 0) {\n\t\t\t\tstatus = \"success\";\n\t\t\t\tdata = replaceData(options.select && !skipSelect ? this.#selectInput : prevResult?.data, placeholderData, options);\n\t\t\t\tisPlaceholderData = true;\n\t\t\t}\n\t\t}\n\t\tif (options.select && data !== void 0 && !skipSelect) {\n\t\t\tif (data === this.#selectInput && options.select === this.#selectFn) data = this.#selectResult;\n\t\t\telse try {\n\t\t\t\tthis.#selectFn = options.select;\n\t\t\t\tthis.#selectInput = data;\n\t\t\t\tdata = options.select(data);\n\t\t\t\tdata = replaceData(prevResult?.data, data, options);\n\t\t\t\tthis.#selectResult = data;\n\t\t\t\tthis.#selectError = null;\n\t\t\t} catch (selectError) {\n\t\t\t\tthis.#selectError = selectError;\n\t\t\t}\n\t\t} else if (data === void 0) {\n\t\t\tthis.#selectInput = void 0;\n\t\t\tthis.#selectError = null;\n\t\t}\n\t\tif (this.#selectError) {\n\t\t\terror = this.#selectError;\n\t\t\tdata = this.#selectResult;\n\t\t\terrorUpdatedAt = prevResult?.error === error ? prevResult.errorUpdatedAt : Date.now();\n\t\t\tstatus = \"error\";\n\t\t\tisPlaceholderData = false;\n\t\t}\n\t\tconst isFetching = newState.fetchStatus === \"fetching\";\n\t\tconst isPending = status === \"pending\";\n\t\tconst isError = status === \"error\";\n\t\tconst isLoading = isPending && isFetching;\n\t\tconst hasData = data !== void 0;\n\t\treturn {\n\t\t\tstatus,\n\t\t\tfetchStatus: newState.fetchStatus,\n\t\t\tisPending,\n\t\t\tisSuccess: status === \"success\",\n\t\t\tisError,\n\t\t\tisInitialLoading: isLoading,\n\t\t\tisLoading,\n\t\t\tdata,\n\t\t\tdataUpdatedAt: newState.dataUpdatedAt,\n\t\t\terror,\n\t\t\terrorUpdatedAt,\n\t\t\tfailureCount: newState.fetchFailureCount,\n\t\t\tfailureReason: newState.fetchFailureReason,\n\t\t\terrorUpdateCount: newState.errorUpdateCount,\n\t\t\tisFetched: query.isFetched(),\n\t\t\tisFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n\t\t\tisFetching,\n\t\t\tisRefetching: isFetching && !isPending,\n\t\t\tisLoadingError: isError && !hasData,\n\t\t\tisPaused: newState.fetchStatus === \"paused\",\n\t\t\tisPlaceholderData,\n\t\t\tisRefetchError: isError && hasData,\n\t\t\tisStale: isStale(query, options),\n\t\t\trefetch: this.refetch,\n\t\t\tisEnabled: resolveQueryValue(options.enabled, query) !== false\n\t\t};\n\t}\n\t/**\n\t* Recomputes and stores the current result from the current query/options, notifying listeners\n\t* if it changed. Framework adapters call this right after subscribing to make sure no query\n\t* update was missed in the gap between creating the observer and subscribing to it.\n\t*/\n\tupdateResult() {\n\t\tconst prevResult = this.#currentResult;\n\t\tconst nextResult = this.createResult(this.#currentQuery, this.options);\n\t\tthis.#currentResultOptions = this.options;\n\t\tif (this.#currentQuery.state.data !== void 0) this.#lastQueryWithDefinedData = this.#currentQuery;\n\t\tif (shallowEqualObjects(nextResult, prevResult)) return;\n\t\tthis.#currentResult = nextResult;\n\t\tconst shouldNotifyListeners = () => {\n\t\t\tif (!prevResult) return true;\n\t\t\tconst { notifyOnChangeProps } = this.options;\n\t\t\tconst notifyOnChangePropsValue = typeof notifyOnChangeProps === \"function\" ? notifyOnChangeProps() : notifyOnChangeProps;\n\t\t\tif (notifyOnChangePropsValue === \"all\" || !notifyOnChangePropsValue && !this.#trackedProps.size) return true;\n\t\t\tif (this.options.throwOnError && this.#currentResult.error !== prevResult.error) return true;\n\t\t\tfor (const key of notifyOnChangePropsValue ?? this.#trackedProps) if (this.#currentResult[key] !== prevResult[key]) return true;\n\t\t\treturn false;\n\t\t};\n\t\tconst notifyListeners = shouldNotifyListeners();\n\t\tnotifyManager.batch(() => {\n\t\t\tif (notifyListeners) this.listeners.forEach((listener) => {\n\t\t\t\tlistener(this.#currentResult);\n\t\t\t});\n\t\t\tthis.#client.getQueryCache().notify({\n\t\t\t\tquery: this.#currentQuery,\n\t\t\t\ttype: \"observerResultsUpdated\"\n\t\t\t});\n\t\t});\n\t}\n\t#updateQuery() {\n\t\tconst query = this.#client.getQueryCache().build(this.#client, this.options);\n\t\tif (query === this.#currentQuery) return;\n\t\tconst prevQuery = this.#currentQuery;\n\t\tthis.#currentQuery = query;\n\t\tthis.#currentQueryInitialState = query.state;\n\t\tif (this.hasListeners()) {\n\t\t\tprevQuery?.removeObserver(this);\n\t\t\tquery.addObserver(this);\n\t\t}\n\t}\n\t/**\n\t* Updates the observer's result when the observed query changes, and reschedules its timers if it\n\t* has listeners.\n\t* @internal\n\t*/\n\tonQueryUpdate() {\n\t\tthis.updateResult();\n\t\tif (this.hasListeners()) this.#updateTimers();\n\t}\n};\n/**\n* Checks whether a query has no data yet and should do its initial load when an observer mounts.\n* @param query - The query to check.\n* @param options - The observer options.\n* @returns `true` if the query is enabled, has no data, and isn't in an error state with\n* `retryOnMount: false`.\n*/\nfunction shouldLoadOnMount(query, options) {\n\treturn resolveQueryValue(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === \"error\" && resolveQueryValue(options.retryOnMount, query) === false);\n}\n/**\n* Checks whether a query should fetch when an observer mounts: either for its initial load, or\n* because it has data and `refetchOnMount` asks for a refetch.\n* @param query - The query to check.\n* @param options - The observer options.\n* @returns `true` if the query should fetch on mount.\n*/\nfunction shouldFetchOnMount(query, options) {\n\treturn shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);\n}\n/**\n* Checks whether a query should fetch for a `refetchOnMount`, `refetchOnWindowFocus`, or\n* `refetchOnReconnect` option.\n* @param query - The query to check.\n* @param options - The observer options.\n* @param field - The value of the option to check.\n* @returns `true` if the query is enabled, not static, and the option is `'always'`, or is not\n* `false` and the query is stale.\n*/\nfunction shouldFetchOn(query, options, field) {\n\tif (resolveQueryValue(options.enabled, query) !== false && resolveQueryValue(options.staleTime, query) !== \"static\") {\n\t\tconst value = resolveQueryValue(field, query);\n\t\treturn value === \"always\" || value !== false && isStale(query, options);\n\t}\n\treturn false;\n}\n/**\n* Checks whether a query should fetch after the observer's options change.\n* @param query - The query observed with the new options.\n* @param prevQuery - The query observed with the previous options.\n* @param options - The new observer options.\n* @param prevOptions - The previous observer options.\n* @returns `true` if the query changed or was disabled before, it isn't a suspense query in an\n* error state, and it is stale.\n*/\nfunction shouldFetchOptionally(query, prevQuery, options, prevOptions) {\n\treturn (query !== prevQuery || resolveQueryValue(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== \"error\") && isStale(query, options);\n}\n/**\n* Checks whether a query is stale for the given observer options.\n* @param query - The query to check.\n* @param options - The observer options, whose `enabled` and `staleTime` are used.\n* @returns `true` if the query is enabled and its data is stale for `staleTime`.\n*/\nfunction isStale(query, options) {\n\treturn resolveQueryValue(options.enabled, query) !== false && query.isStaleByTime(resolveQueryValue(options.staleTime, query));\n}\nexport { QueryObserver };\n\n//# sourceMappingURL=queryObserver.js.map","\"use client\";\nimport { shouldThrowError } from \"@tanstack/query-core\";\nimport * as React from \"react\";\n// src/errorBoundaryUtils.ts\n/**\n* Turns off `retryOnMount` for a query that throws its errors (with `suspense` or `throwOnError`),\n* unless the error boundary has been reset, so a remount doesn't retry the failed query before the\n* user resets the boundary. Mutates the options.\n* @param options - The defaulted query options to adjust.\n* @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n* @param query - The query, used to evaluate a `throwOnError` function against its error.\n*/\nconst ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {\n\tconst throwOnError = query?.state.status === \"error\" && typeof options.throwOnError === \"function\" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;\n\tif (options.suspense || throwOnError) {\n\t\tif (!errorResetBoundary.isReset()) options.retryOnMount = false;\n\t}\n};\n/**\n* Clears the reset state of the error boundary after the component mounts, so later errors are\n* thrown to the boundary again.\n* @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n*/\nconst useClearResetErrorBoundary = (errorResetBoundary) => {\n\tReact.useEffect(() => {\n\t\terrorResetBoundary.clearReset();\n\t}, [errorResetBoundary]);\n};\n/**\n* Checks whether the query error should be thrown to the nearest error boundary: the query errored\n* and isn't fetching, the boundary hasn't been reset, and either `suspense` is enabled with no data\n* or `throwOnError` says so.\n* @param params - The observer `result`, the `errorResetBoundary`, the `throwOnError` option, the\n* `query`, and the `suspense` option.\n* @returns `true` if the error should be thrown.\n*/\nconst getHasError = ({ result, errorResetBoundary, throwOnError, query, suspense }) => {\n\treturn result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query]));\n};\nexport { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary };\n\n//# sourceMappingURL=errorBoundaryUtils.js.map","// src/suspense.ts\n/**\n* The default `throwOnError` of the suspense hooks: throws the error to the nearest error boundary\n* only if the query has no data to show.\n* @param _error - The error of the query. Unused.\n* @param query - The query that errored.\n* @returns `true` if the query has no data.\n*/\nconst defaultThrowOnError = (_error, query) => query.state.data === void 0;\n/**\n* Raises `staleTime` and a numeric `gcTime` to at least 1000ms when `suspense` is enabled, so a\n* component that remounts after suspending doesn't refetch right away or find the query garbage\n* collected. A `'static'` `staleTime` is kept as is. Mutates the options.\n* @param defaultedOptions - The defaulted query options to adjust.\n*/\nconst ensureSuspenseTimers = (defaultedOptions) => {\n\tif (defaultedOptions.suspense) {\n\t\tconst MIN_SUSPENSE_TIME_MS = 1e3;\n\t\tconst clamp = (value) => value === \"static\" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS);\n\t\tconst originalStaleTime = defaultedOptions.staleTime;\n\t\tdefaultedOptions.staleTime = typeof originalStaleTime === \"function\" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime);\n\t\tif (typeof defaultedOptions.gcTime === \"number\") defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, MIN_SUSPENSE_TIME_MS);\n\t}\n};\n/**\n* Checks whether a query should suspend: `suspense` is enabled and the result is still `pending`.\n* @param defaultedOptions - The defaulted query options, if any.\n* @param result - The current result of the observer.\n* @returns `true` if the component should suspend.\n*/\nconst shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;\n/**\n* Fetches the query for a suspending component, without affecting the observer's own result. If\n* the fetch fails, the reset state of the error boundary is cleared, so the error is thrown to it.\n* @param defaultedOptions - The defaulted query options to fetch with.\n* @param observer - The observer of the query.\n* @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n* @returns A promise that resolves once the fetch settles. It never rejects.\n*/\nconst fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {\n\terrorResetBoundary.clearReset();\n});\nexport { defaultThrowOnError, ensureSuspenseTimers, fetchOptimistic, shouldSuspend };\n\n//# sourceMappingURL=suspense.js.map","\"use client\";\nimport { useIsRestoring } from \"./IsRestoringProvider.js\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nimport { useQueryErrorResetBoundary } from \"./QueryErrorResetBoundary.js\";\nimport { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary } from \"./errorBoundaryUtils.js\";\nimport { ensureSuspenseTimers, fetchOptimistic, shouldSuspend } from \"./suspense.js\";\nimport { noop, notifyManager } from \"@tanstack/query-core\";\nimport * as React from \"react\";\n// src/useBaseQuery.ts\n/**\n* Base implementation shared by `useQuery`, `useInfiniteQuery`, `useSuspenseQuery`, and\n* `useSuspenseInfiniteQuery`.\n* @param options - The options passed to the calling hook.\n* @param Observer - The observer class from query-core (`QueryObserver` or\n* `InfiniteQueryObserver`).\n* @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest\n* context will be used.\n* @returns The query result, tracking which properties are read unless `notifyOnChangeProps` is\n* set.\n* @throws {Error} If `options` is not an object (outside production), or the query error when it should be\n* thrown to the nearest error boundary (see `throwOnError`). While suspending, it throws a promise instead.\n*/\nfunction useBaseQuery(options, Observer, queryClient) {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tif (typeof options !== \"object\" || Array.isArray(options)) throw new Error(\"Bad argument type. Starting with v5, only the \\\"Object\\\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object\");\n\t}\n\tconst isRestoring = useIsRestoring();\n\tconst errorResetBoundary = useQueryErrorResetBoundary();\n\tconst client = useQueryClient(queryClient);\n\tconst defaultedOptions = client.defaultQueryOptions(options);\n\tconst query = client.getQueryCache().get(defaultedOptions.queryHash);\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tif (!defaultedOptions.queryFn) console.error(`[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`);\n\t}\n\tconst subscribed = options.subscribed !== false;\n\tdefaultedOptions._optimisticResults = isRestoring ? \"isRestoring\" : subscribed ? \"optimistic\" : void 0;\n\tensureSuspenseTimers(defaultedOptions);\n\tensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query);\n\tuseClearResetErrorBoundary(errorResetBoundary);\n\tconst [observer] = React.useState(() => new Observer(client, defaultedOptions));\n\tconst result = observer.getOptimisticResult(defaultedOptions);\n\tReact.useEffect(() => {\n\t\tobserver.setOptions(defaultedOptions);\n\t}, [defaultedOptions, observer]);\n\tconst shouldSubscribe = !isRestoring && subscribed;\n\tReact.useSyncExternalStore(React.useCallback((onStoreChange) => {\n\t\tconst unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop;\n\t\tobserver.updateResult();\n\t\treturn unsubscribe;\n\t}, [observer, shouldSubscribe]), () => observer.getCurrentResult(), () => observer.getCurrentResult());\n\tif (shouldSuspend(defaultedOptions, result)) throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);\n\tif (getHasError({\n\t\tresult,\n\t\terrorResetBoundary,\n\t\tthrowOnError: defaultedOptions.throwOnError,\n\t\tquery,\n\t\tsuspense: defaultedOptions.suspense\n\t})) throw result.error;\n\treturn !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;\n}\nexport { useBaseQuery };\n\n//# sourceMappingURL=useBaseQuery.js.map"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21],"mappings":"A,4GAWA,IAAIK,EAAAH,EAAA,EACJ,SAASI,EAAG,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S,EAAM,qBAAAA,EAA2B,YAAa,GAAkB,CAC/D,IAAMyP,EAAckD,EAAkB3F,EAAS,UAAUrD,EAAc,WAAWiJ,CAAa,CAAC,EAAI1Q,EAEpG,OADA8K,EAAS,aAAa,EACfyC,CACR,EAAG,CAACzC,EAAU2F,CAAe,CAAC,MAAS3F,EAAS,iBAAiB,MAASA,EAAS,iBAAiB,CAAC,EACjGqF,GAAc7C,EAAkBxL,CAAM,EAAG,MAAMsO,GAAgB9C,EAAkBxC,EAAU4E,CAAkB,EACjH,GAAIE,GAAY,CACf,SACA,qBACA,aAActC,EAAiB,aAC/B,QACA,SAAUA,EAAiB,QAC5B,CAAC,EAAG,MAAMxL,EAAO,MACjB,OAAQwL,EAAiB,oBAAqDxL,EAA/BgJ,EAAS,YAAYhJ,CAAM,CAC3E,C"}
@@ -0,0 +1,2 @@
1
+ import{y as e}from"./reason-parts-B6nt3n-F.js";function t(t){return e(t,`base-ui`)}export{t};
2
+ //# sourceMappingURL=useBaseUiId-BUBV7JiZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBaseUiId-BUBV7JiZ.js","names":["useId","useBaseUiId","idOverride"],"sources":["../../../../node_modules/@base-ui/react/internals/useBaseUiId.mjs"],"sourcesContent":["'use client';\n\nimport { useId } from '@base-ui/utils/useId';\n\n/**\n * Wraps `useId` and prefixes generated `id`s with `base-ui-`\n * @param {string | undefined} idOverride overrides the generated id when provided\n * @returns {string | undefined}\n */\nexport function useBaseUiId(idOverride) {\n return useId(idOverride, 'base-ui');\n}"],"ignoreList":[0],"mappings":"A,+CASA,SAAgBC,EAAY,EAAY,CACtC,OAAOD,EAAME,EAAY,SAAS,CACpC,C"}
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t}from"./utils-BFSetRo1.js";var n=e(t(),1);function r(){}var i=Object.freeze([]),a=Object.freeze({}),o={};function s(e,t){let r=n.useRef(o);return r.current===o&&(r.current=e(t)),r}var c=typeof document<`u`?n.useLayoutEffect:()=>{};function l(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var u=l(`https://base-ui.com/production-error`,`Base UI`),d=19;function f(e){return d>=e}var p={...n},m=p.useInsertionEffect,h=m&&m!==p.useLayoutEffect?m:e=>e();function g(e){let t=s(ee).current;return t.next=e,h(t.effect),t.trampoline}function ee(){let e={next:void 0,callback:te,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function te(){}function _(){return typeof window<`u`}function v(e){return x(e)?(e.nodeName||``).toLowerCase():`#document`}function y(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function b(e){return((x(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function x(e){return _()?e instanceof Node||e instanceof y(e).Node:!1}function S(e){return _()?e instanceof Element||e instanceof y(e).Element:!1}function C(e){return _()?e instanceof HTMLElement||e instanceof y(e).HTMLElement:!1}function w(e){return!_()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof y(e).ShadowRoot}function T(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=M(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ne(e){return/^(table|td|th)$/.test(v(e))}function E(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var re=/transform|translate|scale|rotate|perspective|filter/,ie=/paint|layout|strict|content/,D=e=>!!e&&e!==`none`,O;function k(e){let t=S(e)?M(e):e;return D(t.transform)||D(t.translate)||D(t.scale)||D(t.rotate)||D(t.perspective)||!A()&&(D(t.backdropFilter)||D(t.filter))||re.test(t.willChange||``)||ie.test(t.contain||``)}function ae(e){let t=N(e);for(;C(t)&&!j(t);){if(k(t))return t;if(E(t))return null;t=N(t)}return null}function A(){return O??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),O}function j(e){return/^(html|body|#document)$/.test(v(e))}function M(e){return y(e).getComputedStyle(e)}function oe(e){return S(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function N(e){if(v(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||w(e)&&e.host||b(e);return w(t)?t.host:t}function P(e){let t=N(e);return j(t)?(e.ownerDocument||e).body:C(t)&&T(t)?t:P(t)}function F(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=P(e),i=r===e.ownerDocument?.body,a=y(r);if(i){let e=I(a);return t.concat(a,a.visualViewport||[],T(r)?r:[],e&&n?F(e):[])}return t.concat(r,F(r,[],n))}function I(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function L(e,t,n,r){let i=s(R).current;return ce(i,e,t,n,r)&&z(i,[e,t,n,r]),i.callback}function se(e){let t=s(R).current;return le(t,e)&&z(t,e),t.callback}function R(){return{callback:null,cleanup:null,refs:[]}}function ce(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function le(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function z(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function B(e){if(!n.isValidElement(e))return null;let t=e,r=t.props;return(f(19)?r?.ref:t.ref)??null}function V(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function ue(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function de(e,t){return typeof e==`function`?e(t):e}function fe(e,t){return typeof e==`function`?e(t):e}var H={};function U(e,t,n,r,i){if(!n&&!r&&!i&&!e)return W(t);let a=W(e);return t&&(a=G(a,t)),n&&(a=G(a,n)),r&&(a=G(a,r)),i&&(a=G(a,i)),a}function pe(e){if(e.length===0)return H;if(e.length===1)return W(e[0]);let t=W(e[0]);for(let n=1;n<e.length;n+=1)t=G(t,e[n]);return t}function W(e){return q(e)?{...e(H)}:me(e)}function G(e,t){return q(t)?t(e):he(e,t)}function me(e){let t={...e};for(let e in t){let n=t[e];K(e,n)&&(t[e]=J(n))}return t}function he(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=V(e.style,r);break;case`className`:e[n]=X(e.className,r);break;default:e[n]=K(n,r)?ge(e[n],r):r}}return e}function K(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function q(e){return typeof e==`function`}function ge(e,t){return t?e?(...n)=>{let r=n[0];if(Z(r)){let i=r;Y(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:J(t):e}function J(e){return e&&((...t)=>{let n=t[0];return Z(n)&&Y(n),e(...t)})}function Y(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function X(e,t){return t?e?t+` `+e:t:e}function Z(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function _e(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=xe(r));let i=ve(t,n,r);if(n.enabled===!1)return null;let o=n.state??a;return Se(e,r,i,o)}function ve(e,t,n){let{className:r,style:i}=e,{state:o=a,ref:s,props:c,stateAttributesMapping:l,enabled:u=!0}=t,d=u?de(r,o):void 0,f=u?fe(i,o):void 0,p=u?ue(o,l):a,m=u&&c?ye(c):void 0,h=u?V(p,m)??{}:a;return typeof document<`u`&&(u?h.ref=Array.isArray(s)?se([h.ref,B(n),...s]):L(h.ref,B(n),s):L(null,null)),u?(d!==void 0&&(h.className=X(h.className,d)),f!==void 0&&(h.style=V(h.style,f)),h):a}function ye(e){return Array.isArray(e)?pe(e):U(void 0,e)}var be=Symbol.for(`react.lazy`);function xe(e){if(e?.$$typeof!==be)return e;let t=n.Children.toArray(e)[0];return n.isValidElement(t)?t:e}function Se(e,t,r,i){if(t){if(typeof t==`function`)return t(r,i);let e=U(r,t.props);return e.ref=r.ref,n.cloneElement(t,e)}return Ce(e,r)}function Ce(e,t){return e===`button`?(0,n.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,n.createElement)(`img`,{alt:``,...t,key:t.key}):n.createElement(e,t)}var we=n.createContext(void 0);function Te(e=!1){let t=n.useContext(we);if(t===void 0&&!e)throw Error(u(16));return t}function Ee(e){let{focusableWhenDisabled:t,disabled:r,composite:i=!1,tabIndex:a=0,isNativeButton:o}=e,s=i&&t!==!1,c=i&&t===!1;return{props:n.useMemo(()=>{let e={onKeyDown(e){r&&t&&e.key!==`Tab`&&e.preventDefault()}};return i||(e.tabIndex=a,!o&&r&&(e.tabIndex=t?a:-1)),(o&&(t||s)||!o&&r)&&(e[`aria-disabled`]=r),o&&(!t||c)&&(e.disabled=r),e},[i,r,t,s,c,o,a])}}function Q(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(y(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function De(e={}){let{disabled:t=!1,focusableWhenDisabled:r,tabIndex:i=0,native:a=!0,composite:o}=e,s=n.useRef(null),l=Te(!0),u=o??l!==void 0,{props:d}=Ee({focusableWhenDisabled:r,disabled:t,composite:u,tabIndex:i,isNativeButton:a}),f=n.useCallback(()=>{let e=s.current;$(e)&&u&&t&&d.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,d.disabled,u]);return c(f,[f]),{getButtonProps:n.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:i,onKeyDown:o,onPointerDown:s,...c}=e;return U({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Y(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,i=$(r),s=!a&&Oe(r),c=n&&(a?i:!s),l=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&u&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!a||i)&&(e.preventBaseUIHandler(),Q(r,e))}else!c||a||!d&&!l?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),l&&(e.preventBaseUIHandler(),Q(r,e)))},onKeyUp(e){t||(Y(e),i?.(e),e.target===e.currentTarget&&a&&u&&$(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||a||u||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),Q(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},a?{type:`button`}:{role:`button`},d,c)},[t,d,u,a]),buttonRef:g(e=>{s.current=e,f()})}}function $(e){return C(e)&&e.tagName===`BUTTON`}function Oe(e){return C(e)&&e.tagName===`A`&&!!e.href}export{f as A,T as C,A as D,E,a as F,r as I,c as M,s as N,g as O,i as P,x as S,ne as T,y as _,xe as a,C as b,L as c,b as d,I as f,N as g,F as h,Te as i,u as j,p as k,M as l,oe as m,Q as n,_e as o,v as p,we as r,U as s,De as t,ae as u,k as v,w,j as x,S as y};
2
+ //# sourceMappingURL=useButton-DQ6Sgg7h.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useButton-DQ6Sgg7h.js","names":["React","_formatErrorMessage","ownerWindow","__toESM","require_react","import_react","NOOP","EMPTY_ARRAY","EMPTY_OBJECT","UNINITIALIZED","useRefWithInit","ref","init","initArg","useIsoLayoutEffect","createFormatErrorMessage","args","url","baseUrl","code","arg","prefix","formatErrorMessage","majorVersion","isReactVersionAtLeast","reactVersionToCheck","SafeReact","useInsertionEffect","useSafeInsertionEffect","fn","useStableCallback","stable","createStableCallback","callback","assertNotCalled","hasWindow","getNodeName","isNode","node","getWindow","_node$ownerDocument","getDocumentElement","value","isElement","isHTMLElement","isShadowRoot","isOverflowElement","getComputedStyle","element","overflow","overflowY","overflowX","display","isTableElement","isTopLayer","willChangeRe","containRe","isNotNone","isWebKitValue","isContainingBlock","css","elementOrCss","isWebKit","getContainingBlock","currentNode","getParentNode","isLastTraversableNode","getNodeScroll","result","getNearestOverflowAncestor","parentNode","getOverflowAncestors","list","traverseIframes","scrollableAncestor","isBody","win","frameElement","getFrameElement","useMergedRefs","forkRef","createForkRef","didChange","a","b","c","d","update","useMergedRefsN","didChangeN","refs","newRefs","index","instance","cleanupCallbacks","i","refCleanup","cleanupCallback","getReactElementRef","reactElement","propsWithRef","mergeObjects","getStateAttributesProps","props","key","state","customMapping","customProps","resolveClassName","className","resolveStyle","style","EMPTY_PROPS","mergeProps","e","createInitialMergedProps","merged","mergeInto","mergePropsN","isPropsGetter","inputProps","copyInitialProps","mutablyMergeInto","copiedProps","propName","propValue","isEventHandler","wrapEventHandler","externalProps","mergedProps","externalPropValue","mergeClassNames","mergeEventHandlers","code0","code1","code2","theirHandler","ourHandler","event","isSyntheticEvent","baseUIEvent","makeEventPreventable","handler","theirClassName","ourClassName","useRenderElement","renderProp","componentProps","params","unwrapLazyRenderProp","outProps","useRenderElementProps","evaluateRenderProp","classNameProp","styleProp","enabled","stateProps","stateAttributesMapping","resolvedProps","resolveRenderFunctionProps","REACT_LAZY_TYPE","render","unwrapped","renderTag","Tag","CompositeRootContext","useCompositeRootContext","context","optional","useFocusableWhenDisabled","tabIndexProp","parameters","isFocusableComposite","composite","focusableWhenDisabled","isNonFocusableComposite","additionalProps","disabled","isNativeButton","dispatchClickWithModifiers","target","sourceEvent","useButton","compositeProp","elementRef","compositeRootContext","isCompositeItem","focusableWhenDisabledProps","updateDisabled","isButtonElement","externalOnClick","externalOnMouseDown","externalOnKeyUp","externalOnKeyDown","externalOnPointerDown","otherExternalProps","isCurrentTarget","currentTarget","isButton","isLink","isValidLinkElement","shouldClick","isEnterKey","isSpaceKey","role","isTextNavigationRole","elem"],"sources":["../../../../node_modules/@base-ui/utils/empty.mjs","../../../../node_modules/@base-ui/utils/useRefWithInit.mjs","../../../../node_modules/@base-ui/utils/useIsoLayoutEffect.mjs","../../../../node_modules/@base-ui/utils/formatErrorMessage.mjs","../../../../node_modules/@base-ui/utils/reactVersion.mjs","../../../../node_modules/@base-ui/utils/safeReact.mjs","../../../../node_modules/@base-ui/utils/useStableCallback.mjs","../../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../../../node_modules/@base-ui/utils/useMergedRefs.mjs","../../../../node_modules/@base-ui/utils/getReactElementRef.mjs","../../../../node_modules/@base-ui/utils/mergeObjects.mjs","../../../../node_modules/@base-ui/react/internals/getStateAttributesProps.mjs","../../../../node_modules/@base-ui/react/utils/resolveClassName.mjs","../../../../node_modules/@base-ui/react/utils/resolveStyle.mjs","../../../../node_modules/@base-ui/react/merge-props/mergeProps.mjs","../../../../node_modules/@base-ui/react/internals/useRenderElement.mjs","../../../../node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs","../../../../node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs","../../../../node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs","../../../../node_modules/@base-ui/react/internals/use-button/useButton.mjs"],"sourcesContent":["export function NOOP() {}\n\n// Typed as mutable `never[]` so it is assignable to any `T[]` fallback (for example\n// `defaultValue ?? EMPTY_ARRAY` in `useControlled` callers) without widening `T`.\n// Frozen so a write through a widened alias throws instead of mutating the shared singleton.\nexport const EMPTY_ARRAY = Object.freeze([]);\nexport const EMPTY_OBJECT = Object.freeze({});","'use client';\n\nimport * as React from 'react';\nconst UNINITIALIZED = {};\n\n/**\n * A React.useRef() that is initialized with a function. Note that it accepts an optional\n * initialization argument, so the initialization function doesn't need to be an inline closure.\n *\n * @usage\n * const ref = useRefWithInit(sortColumns, columns)\n */\n\nexport function useRefWithInit(init, initArg) {\n const ref = React.useRef(UNINITIALIZED);\n if (ref.current === UNINITIALIZED) {\n ref.current = init(initArg);\n }\n return ref;\n}","'use client';\n\nimport * as React from 'react';\nconst noop = () => {};\nexport const useIsoLayoutEffect = typeof document !== 'undefined' ? React.useLayoutEffect : noop;","/**\n * Creates a formatErrorMessage function with a custom URL and prefix.\n * @param baseUrl - The base URL for the error page (e.g., 'https://base-ui.com/production-error')\n * @param prefix - The prefix for the error message (e.g., 'Base UI')\n * @returns A function that formats error messages with the given URL and prefix\n */\nexport function createFormatErrorMessage(baseUrl, prefix) {\n return function formatErrorMessage(code, ...args) {\n const url = new URL(baseUrl);\n url.searchParams.set('code', code.toString());\n args.forEach(arg => url.searchParams.append('args[]', arg));\n return `${prefix} error #${code}; visit ${url} for the full message.`;\n };\n}\n\n/**\n * WARNING: Don't import this directly. It's imported by the code generated by\n * `@mui/internal-babel-plugin-minify-errors`. Make sure to always use string literals in `Error`\n * constructors to ensure the plugin works as expected. Supported patterns include:\n * throw new Error('My message');\n * throw new Error(`My message: ${foo}`);\n * throw new Error(`My message: ${foo}` + 'another string');\n * ...\n */\nconst formatErrorMessage = createFormatErrorMessage('https://base-ui.com/production-error', 'Base UI');\nexport default formatErrorMessage;","import * as React from 'react';\nconst majorVersion = parseInt(React.version, 10);\nexport function isReactVersionAtLeast(reactVersionToCheck) {\n return majorVersion >= reactVersionToCheck;\n}","import * as React from 'react';\n\n/**\n * A clone of the React namespace for reading APIs that may be missing in older\n * supported React versions. Bundlers can rewrite direct `React.someNewApi`\n * reads into named imports, which breaks React 17. Reading from this cloned\n * object keeps those lookups optional.\n *\n * @see https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379\n */\nexport const SafeReact = {\n ...React\n};","'use client';\n\nimport { SafeReact } from \"./safeReact.mjs\";\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nconst useInsertionEffect = SafeReact.useInsertionEffect;\nconst useSafeInsertionEffect =\n// React 17 doesn't have useInsertionEffect.\nuseInsertionEffect &&\n// Preact replaces useInsertionEffect with useLayoutEffect and fires too late.\nuseInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : fn => fn();\n/**\n * Stabilizes the function passed so it's always the same between renders.\n *\n * The function becomes non-reactive to any values it captures.\n * It can safely be passed as a dependency of `React.useMemo` and `React.useEffect` without re-triggering them if its captured values change.\n *\n * The function must only be called inside effects and event handlers, never during render (which throws an error).\n *\n * This hook is a more permissive version of React 19.2's `React.useEffectEvent` in that it can be passed through contexts and called in event handler props, not just effects.\n */\nexport function useStableCallback(callback) {\n const stable = useRefWithInit(createStableCallback).current;\n stable.next = callback;\n useSafeInsertionEffect(stable.effect);\n return stable.trampoline;\n}\nfunction createStableCallback() {\n const stable = {\n next: undefined,\n callback: assertNotCalled,\n trampoline: (...args) => stable.callback?.(...args),\n effect: () => {\n stable.callback = stable.next;\n }\n };\n return stable;\n}\nfunction assertNotCalled() {\n if (process.env.NODE_ENV !== 'production') {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw /* minify-error-disabled */new Error('Base UI: Cannot call an event handler while rendering.');\n }\n}","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n try {\n if (element.matches(':popover-open')) {\n return true;\n }\n } catch (_e) {\n // no-op\n }\n try {\n return element.matches(':modal');\n } catch (_e) {\n return false;\n }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (isWebKitValue == null) {\n isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n }\n return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return (node.ownerDocument || node).body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n } else {\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n }\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { useRefWithInit } from \"./useRefWithInit.mjs\";\n\n/**\n * Merges refs into a single memoized callback ref or `null`.\n * This makes sure multiple refs are updated together and have the same value.\n *\n * This function accepts up to four refs. If you need to merge more, or have an unspecified number of refs to merge,\n * use `useMergedRefsN` instead.\n */\n\nexport function useMergedRefs(a, b, c, d) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChange(forkRef, a, b, c, d)) {\n update(forkRef, [a, b, c, d]);\n }\n return forkRef.callback;\n}\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n *\n * If you need to merge a fixed number (up to four) of refs, use `useMergedRefs` instead for better performance.\n */\nexport function useMergedRefsN(refs) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChangeN(forkRef, refs)) {\n update(forkRef, refs);\n }\n return forkRef.callback;\n}\nfunction createForkRef() {\n return {\n callback: null,\n cleanup: null,\n refs: []\n };\n}\nfunction didChange(forkRef, a, b, c, d) {\n // prettier-ignore\n return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;\n}\nfunction didChangeN(forkRef, newRefs) {\n return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);\n}\nfunction update(forkRef, refs) {\n forkRef.refs = refs;\n if (refs.every(ref => ref == null)) {\n forkRef.callback = null;\n return;\n }\n forkRef.callback = instance => {\n if (forkRef.cleanup) {\n forkRef.cleanup();\n forkRef.cleanup = null;\n }\n if (instance != null) {\n const cleanupCallbacks = Array(refs.length).fill(null);\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const refCleanup = ref(instance);\n if (typeof refCleanup === 'function') {\n cleanupCallbacks[i] = refCleanup;\n }\n break;\n }\n case 'object':\n {\n ref.current = instance;\n break;\n }\n default:\n }\n }\n forkRef.cleanup = () => {\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const cleanupCallback = cleanupCallbacks[i];\n if (typeof cleanupCallback === 'function') {\n cleanupCallback();\n } else {\n // Legacy ref with no attach-time cleanup: detach by calling it with `null`.\n // It returns nothing; React 19 cleanups are handled in the branch above.\n void ref(null);\n }\n break;\n }\n case 'object':\n {\n ref.current = null;\n break;\n }\n default:\n }\n }\n };\n }\n };\n}","import * as React from 'react';\nimport { isReactVersionAtLeast } from \"./reactVersion.mjs\";\n\n/**\n * Extracts the `ref` from a React element, handling different React versions.\n */\nexport function getReactElementRef(element) {\n if (! /*#__PURE__*/React.isValidElement(element)) {\n return null;\n }\n const reactElement = element;\n const propsWithRef = reactElement.props;\n return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;\n}","export function mergeObjects(a, b) {\n if (a && !b) {\n return a;\n }\n if (!a && b) {\n return b;\n }\n if (a || b) {\n return {\n ...a,\n ...b\n };\n }\n return undefined;\n}","export function getStateAttributesProps(state, customMapping) {\n const props = {};\n\n /* eslint-disable-next-line guard-for-in */\n for (const key in state) {\n const value = state[key];\n if (customMapping?.hasOwnProperty(key)) {\n const customProps = customMapping[key](value);\n if (customProps != null) {\n Object.assign(props, customProps);\n }\n continue;\n }\n if (value === true) {\n props[`data-${key.toLowerCase()}`] = '';\n } else if (value) {\n props[`data-${key.toLowerCase()}`] = value.toString();\n }\n }\n return props;\n}","/**\n * If the provided className is a string, it will be returned as is.\n * Otherwise, the function will call the className function with the state as the first argument.\n *\n * @param className\n * @param state\n */\nexport function resolveClassName(className, state) {\n return typeof className === 'function' ? className(state) : className;\n}","/**\n * If the provided style is an object, it will be returned as is.\n * Otherwise, the function will call the style function with the state as the first argument.\n *\n * @param style\n * @param state\n */\nexport function resolveStyle(style, state) {\n return typeof style === 'function' ? style(state) : style;\n}","import { mergeObjects } from '@base-ui/utils/mergeObjects';\nconst EMPTY_PROPS = {};\n\n/* eslint-disable id-denylist */\n/**\n * Merges multiple sets of React props. It follows the Object.assign pattern where the rightmost object's fields overwrite\n * the conflicting ones from others. This doesn't apply to event handlers, `className` and `style` props.\n *\n * Event handlers are merged and called in right-to-left order (rightmost handler executes first, leftmost last).\n * For React synthetic events, the rightmost handler can prevent prior (left-positioned) handlers from executing\n * by calling `event.preventBaseUIHandler()`. For non-synthetic events (custom events with primitive/object values),\n * all handlers always execute without prevention capability.\n *\n * The `className` prop is merged by concatenating classes in right-to-left order (rightmost class appears first in the string).\n * The `style` prop is merged with rightmost styles overwriting the prior ones.\n *\n * Props can either be provided as objects or as functions that take the previous props as an argument.\n * The function will receive the merged props up to that point (going from left to right):\n * so in the case of `(obj1, obj2, fn, obj3)`, `fn` will receive the merged props of `obj1` and `obj2`.\n * The function is responsible for chaining event handlers if needed (that is, we don't run the merge logic).\n *\n * Event handlers returned by the functions are not automatically prevented when `preventBaseUIHandler` is called.\n * They must check `event.baseUIHandlerPrevented` themselves and bail out if it's true.\n *\n * @important **`ref` is not merged.**\n * @param a Props object to merge.\n * @param b Props object to merge. The function will overwrite conflicting props from `a`.\n * @param c Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param d Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param e Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @returns The merged props.\n * @public\n */\n\nexport function mergeProps(a, b, c, d, e) {\n if (!c && !d && !e && !a) {\n return createInitialMergedProps(b);\n }\n\n // We need to mutably own `merged`.\n let merged = createInitialMergedProps(a);\n if (b) {\n merged = mergeInto(merged, b);\n }\n if (c) {\n merged = mergeInto(merged, c);\n }\n if (d) {\n merged = mergeInto(merged, d);\n }\n if (e) {\n merged = mergeInto(merged, e);\n }\n return merged;\n}\n/* eslint-enable id-denylist */\n\n/**\n * Merges an arbitrary number of React props using the same logic as {@link mergeProps}.\n * This function accepts an array of props instead of individual arguments.\n *\n * This has slightly lower performance than {@link mergeProps} due to accepting an array\n * instead of a fixed number of arguments. Prefer {@link mergeProps} when merging 5 or\n * fewer prop sets for better performance.\n *\n * @param props Array of props to merge.\n * @returns The merged props.\n * @see mergeProps\n * @public\n */\nexport function mergePropsN(props) {\n if (props.length === 0) {\n return EMPTY_PROPS;\n }\n if (props.length === 1) {\n return createInitialMergedProps(props[0]);\n }\n\n // We need to mutably own `merged`.\n let merged = createInitialMergedProps(props[0]);\n for (let i = 1; i < props.length; i += 1) {\n merged = mergeInto(merged, props[i]);\n }\n return merged;\n}\nfunction createInitialMergedProps(inputProps) {\n if (isPropsGetter(inputProps)) {\n // Getter-returned handlers intentionally keep their existing semantics.\n return {\n ...inputProps(EMPTY_PROPS)\n };\n }\n return copyInitialProps(inputProps);\n}\nfunction mergeInto(merged, inputProps) {\n if (isPropsGetter(inputProps)) {\n return inputProps(merged);\n }\n return mutablyMergeInto(merged, inputProps);\n}\nfunction copyInitialProps(inputProps) {\n const copiedProps = {\n ...inputProps\n };\n\n // `copiedProps` is our fresh own-object copy, so iterating with `for...in` is safe here.\n // eslint-disable-next-line guard-for-in\n for (const propName in copiedProps) {\n const propValue = copiedProps[propName];\n if (isEventHandler(propName, propValue)) {\n copiedProps[propName] = wrapEventHandler(propValue);\n }\n }\n return copiedProps;\n}\n\n/**\n * Merges two sets of props. In case of conflicts, the external props take precedence.\n */\nfunction mutablyMergeInto(mergedProps, externalProps) {\n if (!externalProps) {\n return mergedProps;\n }\n\n // eslint-disable-next-line guard-for-in\n for (const propName in externalProps) {\n const externalPropValue = externalProps[propName];\n switch (propName) {\n case 'style':\n {\n mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);\n break;\n }\n case 'className':\n {\n mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);\n break;\n }\n default:\n {\n if (isEventHandler(propName, externalPropValue)) {\n mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);\n } else {\n mergedProps[propName] = externalPropValue;\n }\n }\n }\n }\n return mergedProps;\n}\nfunction isEventHandler(key, value) {\n // This approach is more efficient than using a regex.\n const code0 = key.charCodeAt(0);\n const code1 = key.charCodeAt(1);\n const code2 = key.charCodeAt(2);\n return code0 === 111 /* o */ && code1 === 110 /* n */ && code2 >= 65 /* A */ && code2 <= 90 /* Z */ && (typeof value === 'function' || typeof value === 'undefined');\n}\nfunction isPropsGetter(inputProps) {\n return typeof inputProps === 'function';\n}\nfunction mergeEventHandlers(ourHandler, theirHandler) {\n if (!theirHandler) {\n return ourHandler;\n }\n if (!ourHandler) {\n return wrapEventHandler(theirHandler);\n }\n return (...args) => {\n const event = args[0];\n if (isSyntheticEvent(event)) {\n const baseUIEvent = event;\n makeEventPreventable(baseUIEvent);\n const result = theirHandler(...args);\n if (!baseUIEvent.baseUIHandlerPrevented) {\n ourHandler?.(...args);\n }\n return result;\n }\n const result = theirHandler(...args);\n ourHandler?.(...args);\n return result;\n };\n}\nfunction wrapEventHandler(handler) {\n if (!handler) {\n return handler;\n }\n return (...args) => {\n const event = args[0];\n if (isSyntheticEvent(event)) {\n makeEventPreventable(event);\n }\n return handler(...args);\n };\n}\nexport function makeEventPreventable(event) {\n event.preventBaseUIHandler = () => {\n event.baseUIHandlerPrevented = true;\n };\n return event;\n}\nexport function mergeClassNames(ourClassName, theirClassName) {\n if (theirClassName) {\n if (ourClassName) {\n // eslint-disable-next-line prefer-template\n return theirClassName + ' ' + ourClassName;\n }\n return theirClassName;\n }\n return ourClassName;\n}\nfunction isSyntheticEvent(event) {\n return event != null && typeof event === 'object' && 'nativeEvent' in event;\n}","import * as React from 'react';\nimport { useMergedRefs, useMergedRefsN } from '@base-ui/utils/useMergedRefs';\nimport { getReactElementRef } from '@base-ui/utils/getReactElementRef';\nimport { mergeObjects } from '@base-ui/utils/mergeObjects';\nimport { warn } from '@base-ui/utils/warn';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { getStateAttributesProps } from \"./getStateAttributesProps.mjs\";\nimport { resolveClassName } from \"../utils/resolveClassName.mjs\";\nimport { resolveStyle } from \"../utils/resolveStyle.mjs\";\nimport { mergeProps, mergePropsN, mergeClassNames } from \"../merge-props/index.mjs\";\nimport { createElement as _createElement } from \"react\";\n/**\n * Renders a Base UI element.\n *\n * @param element The default HTML element to render. Can be overridden by the `render` prop.\n * @param componentProps An object containing the `render` and `className` props to be used for element customization. Other props are ignored.\n * @param params Additional parameters for rendering the element.\n */\nexport function useRenderElement(element, componentProps, params = {}) {\n let renderProp = componentProps.render;\n if (params.enabled !== false) {\n // A pending lazy element suspends when unwrapped, so leave it wrapped while disabled.\n renderProp = unwrapLazyRenderProp(renderProp);\n }\n const outProps = useRenderElementProps(componentProps, params, renderProp);\n if (params.enabled === false) {\n return null;\n }\n const state = params.state ?? EMPTY_OBJECT;\n return evaluateRenderProp(element, renderProp, outProps, state);\n}\n\n/**\n * Computes render element final props.\n */\nfunction useRenderElementProps(componentProps, params, renderProp) {\n const {\n className: classNameProp,\n style: styleProp\n } = componentProps;\n const {\n state = EMPTY_OBJECT,\n ref,\n props,\n stateAttributesMapping,\n enabled = true\n } = params;\n const className = enabled ? resolveClassName(classNameProp, state) : undefined;\n const style = enabled ? resolveStyle(styleProp, state) : undefined;\n const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;\n const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : undefined;\n\n // Ensure outProps is always a new mutable object when enabled, never EMPTY_OBJECT.\n // This prevents potential TypeError when setting ref, className, or style properties,\n // since EMPTY_OBJECT is frozen and mutations would fail in strict mode.\n const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;\n\n // SAFETY: The `useMergedRefs` functions use a single hook to store the same value,\n // switching between them at runtime is safe. If this assertion fails, React will\n // throw at runtime anyway.\n // This also skips the `useMergedRefs` call on the server, which is fine because\n // refs are not used on the server side.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (typeof document !== 'undefined') {\n if (!enabled) {\n // Called only to keep the hook order stable when disabled; the merged ref is unused.\n void useMergedRefs(null, null);\n } else if (Array.isArray(ref)) {\n outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);\n } else {\n outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);\n }\n }\n if (!enabled) {\n return EMPTY_OBJECT;\n }\n if (className !== undefined) {\n outProps.className = mergeClassNames(outProps.className, className);\n }\n if (style !== undefined) {\n outProps.style = mergeObjects(outProps.style, style);\n }\n return outProps;\n}\nfunction resolveRenderFunctionProps(props) {\n if (Array.isArray(props)) {\n return mergePropsN(props);\n }\n return mergeProps(undefined, props);\n}\n\n// The symbol React uses internally for lazy components\n// https://github.com/react/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/shared/ReactSymbols.js#L31\n//\n// TODO delete once https://github.com/react/react/issues/32392 is fixed\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy');\nconst COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;\nconst LOWERCASE_CHARACTER_PATTERN = /[a-z]/;\n\n// Workaround for https://github.com/react/react/issues/32392\n// The Flight client hands over a lazy wrapper in place of a render element created in a\n// Server Component. The wrapper exposes no `.props` or `.ref`, so it must be unwrapped\n// before those are read. This works because the toArray() logic unwraps the lazy\n// element type in\n// https://github.com/react/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/react/src/ReactChildren.js#L186\nexport function unwrapLazyRenderProp(render) {\n // `$$typeof` is a React internal, absent from the public element types.\n if (render?.$$typeof !== REACT_LAZY_TYPE) {\n return render;\n }\n // Keep the wrapper unless it unwraps to an element, so an invalid render prop is still\n // reported as one instead of silently falling back to the default element.\n const unwrapped = React.Children.toArray(render)[0];\n return /*#__PURE__*/React.isValidElement(unwrapped) ? unwrapped : render;\n}\nfunction evaluateRenderProp(element, render, props, state) {\n if (render) {\n if (typeof render === 'function') {\n if (process.env.NODE_ENV !== 'production') {\n warnIfRenderPropLooksLikeComponent(render);\n }\n return render(props, state);\n }\n const mergedProps = mergeProps(props, render.props);\n mergedProps.ref = props.ref;\n\n // There is a high number of indirections, the error message thrown by React.cloneElement() is\n // hard to use for developers, this logic provides a better context.\n //\n // Our general guideline is to never change the control flow depending on the environment.\n // However, React.cloneElement() throws if React.isValidElement() is false,\n // so we can throw before with custom message.\n if (process.env.NODE_ENV !== 'production') {\n if (! /*#__PURE__*/React.isValidElement(render)) {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw new Error(['Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.', 'A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.', 'https://base-ui.com/r/invalid-render-prop'].join('\\n'));\n }\n }\n return /*#__PURE__*/React.cloneElement(render, mergedProps);\n }\n // `element` is always provided when there is no `render` prop.\n return renderTag(element, props);\n}\nfunction warnIfRenderPropLooksLikeComponent(renderFn) {\n const functionName = renderFn.name;\n if (functionName.length === 0) {\n return;\n }\n if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {\n return;\n }\n if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {\n return;\n }\n warn(`The \\`render\\` prop received a function named \\`${functionName}\\` that starts with an uppercase letter.`, 'This usually means a React component was passed directly as `render={Component}`.', 'Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.', 'If this is an intentional render callback, rename it to start with a lowercase letter.', 'Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.', 'https://base-ui.com/r/invalid-render-prop');\n}\nfunction renderTag(Tag, props) {\n if (Tag === 'button') {\n return /*#__PURE__*/_createElement(\"button\", {\n type: \"button\",\n ...props,\n key: props.key\n });\n }\n if (Tag === 'img') {\n return /*#__PURE__*/_createElement(\"img\", {\n alt: \"\",\n ...props,\n key: props.key\n });\n }\n return /*#__PURE__*/React.createElement(Tag, props);\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const CompositeRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CompositeRootContext.displayName = \"CompositeRootContext\";\nexport function useCompositeRootContext(optional = false) {\n const context = React.useContext(CompositeRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.' : _formatErrorMessage(16));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nexport function useFocusableWhenDisabled(parameters) {\n const {\n focusableWhenDisabled,\n disabled,\n composite = false,\n tabIndex: tabIndexProp = 0,\n isNativeButton\n } = parameters;\n const isFocusableComposite = composite && focusableWhenDisabled !== false;\n const isNonFocusableComposite = composite && focusableWhenDisabled === false;\n\n // we can't explicitly assign `undefined` to any of these props because it\n // would otherwise prevent subsequently merged props from setting them\n const props = React.useMemo(() => {\n const additionalProps = {\n // allow Tabbing away from focusableWhenDisabled elements\n onKeyDown(event) {\n if (disabled && focusableWhenDisabled && event.key !== 'Tab') {\n event.preventDefault();\n }\n }\n };\n if (!composite) {\n additionalProps.tabIndex = tabIndexProp;\n if (!isNativeButton && disabled) {\n additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;\n }\n }\n if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled) {\n additionalProps['aria-disabled'] = disabled;\n }\n if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {\n additionalProps.disabled = disabled;\n }\n return additionalProps;\n }, [composite, disabled, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);\n return {\n props\n };\n}","import { ownerWindow } from '@base-ui/utils/owner';\n/**\n * Dispatches a constructed click on the target so it carries the source event's\n * modifier state, which `click()` always reports as unpressed. Like `click()`,\n * the untrusted click still runs native activation behavior (form submission,\n * link navigation).\n * `detail` defaults to 0 and `pointerType` to `''` (the native convention for\n * keyboard-generated clicks). When the click represents a mouse gesture, pass\n * `detail: 1` and `pointerType: 'mouse'` so consumers don't classify it as a\n * keyboard activation.\n */\nexport function dispatchClickWithModifiers(target, sourceEvent, {\n detail = 0,\n pointerType = ''\n} = {}) {\n target.dispatchEvent(new (ownerWindow(target).PointerEvent)('click', {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail,\n pointerType,\n shiftKey: sourceEvent.shiftKey,\n ctrlKey: sourceEvent.ctrlKey,\n altKey: sourceEvent.altKey,\n metaKey: sourceEvent.metaKey\n }));\n}","'use client';\n\nimport * as React from 'react';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { error } from '@base-ui/utils/error';\nimport { SafeReact } from '@base-ui/utils/safeReact';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { makeEventPreventable, mergeProps } from \"../../merge-props/index.mjs\";\nimport { useCompositeRootContext } from \"../composite/root/CompositeRootContext.mjs\";\nimport { useFocusableWhenDisabled } from \"../../utils/useFocusableWhenDisabled.mjs\";\nimport { dispatchClickWithModifiers } from \"../../utils/dispatchClickWithModifiers.mjs\";\nexport function useButton(parameters = {}) {\n const {\n disabled = false,\n focusableWhenDisabled,\n tabIndex = 0,\n native: isNativeButton = true,\n composite: compositeProp\n } = parameters;\n const elementRef = React.useRef(null);\n const compositeRootContext = useCompositeRootContext(true);\n const isCompositeItem = compositeProp ?? compositeRootContext !== undefined;\n const {\n props: focusableWhenDisabledProps\n } = useFocusableWhenDisabled({\n focusableWhenDisabled,\n disabled,\n composite: isCompositeItem,\n tabIndex,\n isNativeButton\n });\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (!elementRef.current) {\n return;\n }\n const isButtonTag = isButtonElement(elementRef.current);\n if (isNativeButton) {\n if (!isButtonTag) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = 'A component that acts as a button expected a native <button> because the ' + '`nativeButton` prop is true. Rendering a non-<button> removes native button ' + 'semantics, which can impact forms and accessibility. Use a real <button> in the ' + '`render` prop, or set `nativeButton` to `false`.';\n error(`${message}${ownerStackMessage}`);\n }\n } else if (isButtonTag) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = 'A component that acts as a button expected a non-<button> because the `nativeButton` ' + 'prop is false. Rendering a <button> keeps native behavior while Base UI applies ' + 'non-native attributes and handlers, which can add unintended extra attributes (such ' + 'as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set ' + '`nativeButton` to `true`.';\n error(`${message}${ownerStackMessage}`);\n }\n }, [isNativeButton]);\n }\n\n // handles a disabled composite button rendering another button, e.g.\n // <Toolbar.Button disabled render={<Menu.Trigger />} />\n // the `disabled` prop needs to pass through 2 `useButton`s then finally\n // delete the `disabled` attribute from DOM\n const updateDisabled = React.useCallback(() => {\n const element = elementRef.current;\n if (!isButtonElement(element)) {\n return;\n }\n if (isCompositeItem && disabled && focusableWhenDisabledProps.disabled === undefined && element.disabled) {\n element.disabled = false;\n }\n }, [disabled, focusableWhenDisabledProps.disabled, isCompositeItem]);\n useIsoLayoutEffect(updateDisabled, [updateDisabled]);\n const getButtonProps = React.useCallback((externalProps = {}) => {\n const {\n onClick: externalOnClick,\n onMouseDown: externalOnMouseDown,\n onKeyUp: externalOnKeyUp,\n onKeyDown: externalOnKeyDown,\n onPointerDown: externalOnPointerDown,\n ...otherExternalProps\n } = externalProps;\n return mergeProps({\n onClick(event) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnClick?.(event);\n },\n onMouseDown(event) {\n if (!disabled) {\n externalOnMouseDown?.(event);\n }\n },\n onKeyDown(event) {\n if (disabled) {\n return;\n }\n makeEventPreventable(event);\n externalOnKeyDown?.(event);\n if (event.baseUIHandlerPrevented) {\n return;\n }\n const isCurrentTarget = event.target === event.currentTarget;\n const currentTarget = event.currentTarget;\n const isButton = isButtonElement(currentTarget);\n const isLink = !isNativeButton && isValidLinkElement(currentTarget);\n const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink);\n const isEnterKey = event.key === 'Enter';\n const isSpaceKey = event.key === ' ';\n const role = currentTarget.getAttribute('role');\n const isTextNavigationRole = role?.startsWith('menuitem') || role === 'option' || role === 'gridcell';\n if (isCurrentTarget && isCompositeItem && isSpaceKey) {\n if (event.defaultPrevented && isTextNavigationRole) {\n return;\n }\n event.preventDefault();\n\n // Only a native-mode item that isn't a real <button> is excluded.\n if (!isNativeButton || isButton) {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(currentTarget, event);\n }\n return;\n }\n\n // Keyboard accessibility for native and non-native elements.\n if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) {\n // Space activates links on keyup (`role=\"button\"` semantics, matching the\n // composite path); prevent the page scroll Space would otherwise trigger.\n // Enter is left to the browser's native link activation.\n if (isCurrentTarget && isLink && isSpaceKey) {\n event.preventDefault();\n }\n return;\n }\n\n // Match native buttons: preventing the keydown's default cancels activation.\n if (event.defaultPrevented) {\n return;\n }\n event.preventDefault();\n if (isEnterKey) {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(currentTarget, event);\n }\n },\n onKeyUp(event) {\n if (disabled) {\n return;\n }\n\n // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed\n // https://codesandbox.io/p/sandbox/button-keyup-preventdefault-dn7f0\n makeEventPreventable(event);\n externalOnKeyUp?.(event);\n if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === ' ') {\n event.preventDefault();\n return;\n }\n if (event.baseUIHandlerPrevented) {\n return;\n }\n\n // Keyboard accessibility for non interactive elements.\n // Match native buttons: preventing the keyup's default cancels Space activation.\n // Limitation: unlike a native <button>, a prevented *keydown* cannot cancel the\n // activation — no state is kept between keydown and keyup, so we can't tell\n // whether the keydown was prevented or even happened on this element.\n if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === ' ') {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(event.currentTarget, event);\n }\n },\n onPointerDown(event) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnPointerDown?.(event);\n }\n }, isNativeButton ? {\n type: 'button'\n } : {\n role: 'button'\n }, focusableWhenDisabledProps, otherExternalProps);\n }, [disabled, focusableWhenDisabledProps, isCompositeItem, isNativeButton]);\n const buttonRef = useStableCallback(element => {\n elementRef.current = element;\n updateDisabled();\n });\n return {\n getButtonProps,\n buttonRef\n };\n}\nfunction isButtonElement(elem) {\n return isHTMLElement(elem) && elem.tagName === 'BUTTON';\n}\nfunction isValidLinkElement(elem) {\n return isHTMLElement(elem) && elem.tagName === 'A' && Boolean(elem.href);\n}"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],"mappings":"A,0GAAA,SAAgBM,GAAO,CAAC,CAKxB,IAAaC,EAAc,OAAO,OAAO,CAAC,CAAC,EAC9BC,EAAe,OAAO,OAAO,CAAC,CAAC,ECHtCC,EAAgB,CAAC,EAUvB,SAAgBC,EAAe,EAAM,EAAS,CAC5C,IAAMC,EAAAN,EAAY,OAAOI,CAAa,EAItC,OAHIE,EAAI,UAAYF,IAClB,EAAI,QAAUG,EAAKC,CAAO,GAErBF,CACT,CCfA,IAAaG,EAAqB,OAAO,SAAa,IAAAT,EAAoB,oBADvD,CAAC,ECGpB,SAAgBU,EAAyB,EAAS,EAAQ,CACxD,OAAO,SAA4B,EAAM,GAAGC,EAAM,CAChD,IAAMC,EAA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,SAAWA,EAAM,eAAkBwC,GAAmBQ,GAAoBhD,EAAM,kBAAoBA,EAAM,MAAQ,MAC1HA,EAAM,qBAAqB,EAC3ByC,EAA2BzC,EAAM,cAAeA,CAAK,GAEzD,EACA,cAAc,EAAO,CACfuC,EACFvC,EAAM,eAAe,EAGvBwD,IAAwBxD,CAAK,CAC/B,CACF,EAAGwC,EAAiB,CAClB,KAAM,QACR,EAAI,CACF,KAAM,QACR,EAAGS,EAA4BQ,CAAkB,CACnD,EAAG,CAAClB,EAAUU,EAA4BD,EAAiBR,CAAc,CAM1D,EACb,UANgBpJ,EAAkB,GAAW,CAC7C,EAAW,QAAUkB,EACrB4I,EAAe,CACjB,CAGU,CACV,CACF,CACA,SAASC,EAAgB,EAAM,CAC7B,OAAOjJ,EAAckK,CAAI,GAAKA,EAAK,UAAY,QACjD,CACA,SAASN,GAAmB,EAAM,CAChC,OAAO5J,EAAckK,CAAI,GAAKA,EAAK,UAAY,KAAO,EAAQA,EAAK,IACrE,C"}
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t}from"./utils-BFSetRo1.js";var n=e(t(),1);function r({controlled:e,default:t,name:r,state:i=`value`}){let{current:a}=n.useRef(e!==void 0),[o,s]=n.useState(()=>t);return[a&&e!==void 0?e:o,n.useCallback(e=>{a||s(e)},[])]}export{r as t};
2
+ //# sourceMappingURL=useControlled-B9BFcdfh.js.map